Skip to content

Commit

Permalink
event params description
Browse files Browse the repository at this point in the history
  • Loading branch information
sdfsdhgjkbmnmxc committed Mar 21, 2021
1 parent 9dbd932 commit 8bbc853
Show file tree
Hide file tree
Showing 52 changed files with 334 additions and 105 deletions.
2 changes: 1 addition & 1 deletion call_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type CallEvent struct {
// Call record enabled
Audiorecord bool `json:"audiorecord"`

// Call members
// Call participants
Onliners []CallOnliner `json:"onliners"`
}

Expand Down
3 changes: 2 additions & 1 deletion client_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func NewClientActivity(afk bool) (r ClientActivity) {
return r
}

// Change AFG (away from keyboard) status
// Change AFK (away from keyboard) status
type ClientActivity struct {
BaseEvent
Params clientActivityParams `json:"params"`
Expand All @@ -15,5 +15,6 @@ type ClientActivity struct {
func (p ClientActivity) GetName() string { return "client.activity" }

type clientActivityParams struct {
// Is away from keyboard
Afk bool `json:"afk"`
}
5 changes: 4 additions & 1 deletion client_call_buzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ func (p ClientCallBuzz) GetName() string { return "client.call.buzz" }

// Call buzzing
type clientCallBuzzParams struct {
Jid JID `json:"jid"`
// Chat or contact id
Jid JID `json:"jid"`

// List of call participants
Members []JID `json:"members"`
}
1 change: 1 addition & 0 deletions client_call_buzzcancel.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ type ClientCallBuzzCancel struct {
func (p ClientCallBuzzCancel) GetName() string { return "client.call.buzzcancel" }

type clientCallBuzzCancelParams struct {
// Chat or contact id
Jid JID `json:"jid"`
}
5 changes: 4 additions & 1 deletion client_call_leave.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type ClientCallLeave struct {
func (p ClientCallLeave) GetName() string { return "client.call.leave" }

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

// Reason, if any
Reason string `json:"reason"`
}
1 change: 1 addition & 0 deletions client_call_muteall.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ type ClientCallMuteAll struct {
func (p ClientCallMuteAll) GetName() string { return "client.call.muteall" }

type clientCallMuteAllParams struct {
// Chat or contact id
Jid JID `json:"jid"`
}
15 changes: 11 additions & 4 deletions client_call_offer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ type ClientCallOffer struct {
func (p ClientCallOffer) GetName() string { return "client.call.offer" }

type clientCallOfferParams struct {
Jid JID `json:"jid"`
Muted bool `json:"muted"`
Trickle bool `json:"trickle"`
Sdp string `json:"sdp"`
// Chat or contact id
Jid JID `json:"jid"`

// Mute state
Muted bool `json:"muted"`

// Is trickle mode enabled
Trickle bool `json:"trickle"`

// SDP (session description protocol) data
Sdp string `json:"sdp"`
}
5 changes: 4 additions & 1 deletion client_call_reject.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type ClientCallReject struct {
func (p ClientCallReject) GetName() string { return "client.call.reject" }

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

// Reason, if any
Reason string `json:"reason"`
}
5 changes: 4 additions & 1 deletion client_call_sound.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ type ClientCallSound struct {
func (p ClientCallSound) GetName() string { return "client.call.sound" }

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

// Mute state
Muted bool `json:"muted"`
}
15 changes: 11 additions & 4 deletions client_call_trickle.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ type ClientCallTrickle struct {
func (p ClientCallTrickle) GetName() string { return "client.call.trickle" }

type clientCallTrickleParams struct {
Jid JID `json:"jid"`
Candidate string `json:"candidate"`
SdpMid string `json:"sdp_mid"`
SdpMlineIndex int `json:"sdp_mline_index"`
// Chat or contact id
Jid JID `json:"jid"`

// Trickle candidate
Candidate string `json:"candidate"`

// SDP mid
SdpMid string `json:"sdp_mid"`

// SDP index
SdpMlineIndex int `json:"sdp_mline_index"`
}
15 changes: 11 additions & 4 deletions client_chat_composing.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ type ClientChatComposing struct {
func (p ClientChatComposing) GetName() string { return "client.chat.composing" }

type clientChatComposingParams struct {
Jid JID `json:"jid"`
IsAudio bool `json:"is_audio,omitempty"`
Composing bool `json:"composing,omitempty"`
Draft *string `json:"draft,omitempty"`
// Chat or contact id
Jid JID `json:"jid"`

// true = audiomessage, false = text typing
IsAudio bool `json:"is_audio,omitempty"`

// true = start typing / audio recording, false = stop
Composing bool `json:"composing,omitempty"`

// Message draft data
Draft *string `json:"draft,omitempty"`
}
5 changes: 4 additions & 1 deletion client_chat_lastread.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ type ClientChatLastread struct {
func (p ClientChatLastread) GetName() string { return "client.chat.lastread" }

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

// Last read message id. Omitted = last message in chat
LastReadMessageId *string `json:"last_read_message_id,omitempty"`
}
1 change: 1 addition & 0 deletions client_confirm.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ type ClientConfirm struct {
func (p ClientConfirm) GetName() string { return "client.confirm" }

type clientConfirmParams struct {
// Unique identifier generated by client
ConfirmId string `json:"confirm_id"`
}
1 change: 1 addition & 0 deletions client_message_deleted.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ type ClientMessageDeleted struct {
func (p ClientMessageDeleted) GetName() string { return "client.message.deleted" }

type clientMessageDeletedParams struct {
// Message id
MessageId string `json:"message_id,omitempty"`
}
27 changes: 21 additions & 6 deletions section.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
package tdproto

type Section struct {
Uid string `json:"uid"`
SortOrdering uint `json:"sort_ordering"`
Name string `json:"name"`
Gentime int64 `json:"gentime"`
Description string `json:"description,omitempty"`
IsArchive bool `json:"is_archive,omitempty"`
// Section uid
Uid string `json:"uid"`

// Sort ordering
SortOrdering uint `json:"sort_ordering"`

// Name
Name string `json:"name"`

// Object version
Gentime int64 `json:"gentime"`

// Description, if any
Description string `json:"description,omitempty"`

// Is deleted
IsArchive bool `json:"is_archive,omitempty"`
}

type DeletedSection struct {
// Section uid
Uid string `json:"uid"`

// Object version
Gentime int64 `json:"gentime"`
}
17 changes: 13 additions & 4 deletions server_call_answer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@ type ServerCallAnswer struct {
func (p ServerCallAnswer) GetName() string { return "server.call.answer" }

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

// List of ICE candidates (when trickle = false)
Candidates []serverCallAnswerCandidate `json:"candidates"`
Onliners []CallOnliner `json:"onliners"`
JSEP JSEP `json:"jsep"`
Uid string `json:"uid"`

// Current call participants
Onliners []CallOnliner `json:"onliners"`

// SDP data
JSEP JSEP `json:"jsep"`

// Call id
Uid string `json:"uid"`
}

type JSEP struct {
Expand Down
40 changes: 27 additions & 13 deletions server_call_buzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ func NewServerCallBuzz(teamShort TeamShort, chatShort ChatShort, actorShort Cont
r.Params.Uid = uid
r.Params.Jid = chatShort.Jid
r.Params.BuzzTimeout = int(timeout.Seconds())

r.Params.Icons = chatShort.Icons

// Set as Deprecated or just leave for backward compatibility?
r.Params.Team = teamShort.Uid
r.Params.DisplayName = chatShort.DisplayName
r.Params.Team = teamShort.Uid
return r
}

Expand All @@ -30,13 +27,30 @@ type ServerCallBuzz struct {
func (p ServerCallBuzz) GetName() string { return "server.call.buzz" }

type serverCallBuzzParams struct {
TeamShort TeamShort `json:"teaminfo"`
ChatShort ChatShort `json:"chat"`
ActorShort ContactShort `json:"actor"`
Uid string `json:"uid"`
Jid JID `json:"jid"`
BuzzTimeout int `json:"buzz_timeout"`
Icons *IconData `json:"icons"`
Team string `json:"team"`
DisplayName string `json:"display_name"`
// Chat or contact id
Jid JID `json:"jid"`

// Chat icons
Icons *IconData `json:"icons"`

// Chat title
DisplayName string `json:"display_name"`

// Short team information
TeamShort TeamShort `json:"teaminfo"`

// Short chat information
ChatShort ChatShort `json:"chat"`

// Short call creator information
ActorShort ContactShort `json:"actor"`

// Call id
Uid string `json:"uid"`

// Number of seconds for stop buzzing
BuzzTimeout int `json:"buzz_timeout"`

// Deprecated
Team string `json:"team"`
}
5 changes: 5 additions & 0 deletions server_call_buzzcancel.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ type ServerCallBuzzcancel struct {
func (p ServerCallBuzzcancel) GetName() string { return "server.call.buzzcancel" }

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

// Team id
Team string `json:"team"`

// Call id
Uid string `json:"uid"`
}
5 changes: 4 additions & 1 deletion server_call_leave.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ type ServerCallLeave struct {
func (p ServerCallLeave) GetName() string { return "server.call.leave" }

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

// Call uid
Uid string `json:"uid"`
}
5 changes: 4 additions & 1 deletion server_call_muteall.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ type ServerCallMuteall struct {
func (p ServerCallMuteall) GetName() string { return "server.call.muteall" }

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

// Mute state
Muted bool `json:"muted"`
}
9 changes: 7 additions & 2 deletions server_call_reject.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ type ServerCallReject struct {
func (p ServerCallReject) GetName() string { return "server.call.reject" }

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

// Call id
Uid string `json:"uid"`

// Reason, if any
Reason string `json:"reason"`
Uid string `json:"uid"`
}
9 changes: 7 additions & 2 deletions server_call_restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ type ServerCallRestart struct {
func (p ServerCallRestart) GetName() string { return "server.call.restart" }

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

// Call id
Uid string `json:"uid"`

// Team id
Team string `json:"team"`
Uid string `json:"uid"`
}
5 changes: 4 additions & 1 deletion server_call_sound.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ type ServerCallSound struct {
func (p ServerCallSound) GetName() string { return "server.call.sound" }

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

// Mute state
Muted bool `json:"muted"`
}
31 changes: 23 additions & 8 deletions server_call_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,27 @@ type ServerCallState struct {
func (p ServerCallState) GetName() string { return "server.call.state" }

type serverCallStateParams struct {
Jid JID `json:"jid"`
Onliners []CallOnliner `json:"onliners"`
Start *string `json:"start"`
Finish *string `json:"finish"`
Audiorecord bool `json:"audiorecord"`
Buzz bool `json:"buzz,omitempty"`
Uid string `json:"uid"`
Timestamp int64 `json:"timestamp"`
// Chat or contact id
Jid JID `json:"jid"`

// Call id
Uid string `json:"uid"`

// Call participants
Onliners []CallOnliner `json:"onliners"`

// Call start, if any
Start *ISODateTimeString `json:"start"`

// Call finish, if any
Finish *ISODateTimeString `json:"finish"`

// Call record enabled
Audiorecord bool `json:"audiorecord"`

// Call buzzing
Buzz bool `json:"buzz,omitempty"`

// Event start. FIXME: why not gentime?
Timestamp int64 `json:"timestamp"`
}
Loading

0 comments on commit 8bbc853

Please sign in to comment.