-
Notifications
You must be signed in to change notification settings - Fork 0
/
server_call_buzz.go
56 lines (43 loc) · 1.22 KB
/
server_call_buzz.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package tdproto
import (
"time"
)
func NewServerCallBuzz(teamShort TeamShort, chatShort ChatShort, actorShort ContactShort, uid string, timeout time.Duration) (r ServerCallBuzz) {
r.Name = r.GetName()
r.Params.TeamShort = teamShort
r.Params.ChatShort = chatShort
r.Params.ActorShort = actorShort
r.Params.Uid = uid
r.Params.Jid = chatShort.Jid
r.Params.BuzzTimeout = int(timeout.Seconds())
r.Params.Icons = chatShort.Icons
r.Params.DisplayName = chatShort.DisplayName
r.Params.Team = teamShort.Uid
return r
}
// Call buzzing
type ServerCallBuzz struct {
BaseEvent
Params serverCallBuzzParams `json:"params"`
}
func (p ServerCallBuzz) GetName() string { return "server.call.buzz" }
type serverCallBuzzParams struct {
// 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"`
}