Skip to content

Commit

Permalink
client event shortcuts, deprecate client call events
Browse files Browse the repository at this point in the history
  • Loading branch information
sdfsdhgjkbmnmxc committed Sep 10, 2020
1 parent 0cda1f8 commit 29c715f
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client_activity.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package tdproto

func NewClientActivity(afk bool) (r ClientActivity) {
r.Name = "client.activity"
r.Params.Afk = afk
return r
}

type ClientActivity struct {
BaseEvent
Params clientActivityParams `json:"params"`
Expand Down
1 change: 1 addition & 0 deletions client_call_buzz.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tdproto

// deprecated: use http api
type ClientCallBuzz struct {
BaseEvent
Params clientCallBuzzParams `json:"params"`
Expand Down
1 change: 1 addition & 0 deletions client_call_buzzcancel.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tdproto

// deprecated: use http api
type ClientCallBuzzCancel struct {
BaseEvent
Params clientCallBuzzCancelParams `json:"params"`
Expand Down
1 change: 1 addition & 0 deletions client_call_leave.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tdproto

// deprecated: use http api
type ClientCallLeave struct {
BaseEvent
Params clientCallLeaveParams `json:"params"`
Expand Down
1 change: 1 addition & 0 deletions client_call_muteall.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tdproto

// deprecated: use http api
type ClientCallMuteAll struct {
BaseEvent
Params clientCallMuteAllParams `json:"params"`
Expand Down
1 change: 1 addition & 0 deletions client_call_offer.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tdproto

// deprecated: use http api
type ClientCallOffer struct {
BaseEvent
Params clientCallOfferParams `json:"params"`
Expand Down
1 change: 1 addition & 0 deletions client_call_reject.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tdproto

// deprecated: use http api
type ClientCallReject struct {
BaseEvent
Params clientCallRejectParams `json:"params"`
Expand Down
1 change: 1 addition & 0 deletions client_call_sound.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tdproto

// deprecated: use http api
type ClientCallSound struct {
BaseEvent
Params clientCallSoundParams `json:"params"`
Expand Down
1 change: 1 addition & 0 deletions client_call_trickle.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tdproto

// deprecated: use http api
type ClientCallTrickle struct {
BaseEvent
Params clientCallTrickleParams `json:"params"`
Expand Down
8 changes: 8 additions & 0 deletions client_chat_composing.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package tdproto

func NewClientChatComposing(jid JID, composing bool, draft *string) (r ClientChatComposing) {
r.Name = "client.chat.composing"
r.Params.Jid = jid
r.Params.Composing = composing
r.Params.Draft = draft
return r
}

type ClientChatComposing struct {
BaseEvent
Params clientChatComposingParams `json:"params"`
Expand Down
8 changes: 8 additions & 0 deletions client_chat_lastread.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package tdproto

func NewClientChatLastread(jid JID, messageId *string) (r ClientChatLastread) {
r.Name = "client.chat.lastread"
r.ConfirmId = ConfirmId()
r.Params.Jid = jid
r.Params.LastReadMessageId = messageId
return r
}

type ClientChatLastread struct {
BaseEvent
Params clientChatLastreadParams `json:"params"`
Expand Down

0 comments on commit 29c715f

Please sign in to comment.