Skip to content

Commit

Permalink
new events for video calling (#29)
Browse files Browse the repository at this point in the history
* new events for video calling

* remove useless event
  • Loading branch information
palage4a authored Jun 9, 2021
1 parent f348ad2 commit 051fb44
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
17 changes: 17 additions & 0 deletions client_call_answer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package tdproto

// Signal server about answer
type ClientCallAnswer struct {
BaseEvent
Params clientCallAnswerParams `json:"params"`
}

func (p ClientCallAnswer) GetName() string { return "client.call.answer" }

type clientCallAnswerParams struct {
// Chat or contact id
Jid JID `json:"jid"`

// SDP (session description protocol) data
Sdp string `json:"sdp"`
}
23 changes: 23 additions & 0 deletions server_call_offer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package tdproto

// Signal client about offer
type ServerCallOffer struct {
BaseEvent
Params serverCallOfferParams `json:"params"`
}

func (p ServerCallOffer) GetName() string { return "server.call.offer" }

type serverCallOfferParams struct {
// Chat or contact id
Jid JID `json:"jid"`
// SDP (session description protocol) data
Sdp string `json:"sdp"`
}

func NewServerCallOffer(jid JID, sdp string) (r ServerCallOffer) {
r.Name = r.GetName()
r.Params.Jid = jid
r.Params.Sdp = sdp
return r
}

0 comments on commit 051fb44

Please sign in to comment.