Skip to content

Commit

Permalink
codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
sdfsdhgjkbmnmxc committed Sep 23, 2020
1 parent 2b0e0f8 commit 5281192
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions server_call_buzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,36 @@ import (
"time"
)

func NewServerCallBuzz(teamShort TeamShort, chatShort ChatShort, actorShort ContactShort, uid string, timeout time.Duration) (resp ServerCallBuzz) {
resp.BaseEvent.Name = "server.call.buzz"
resp.Params.TeamShort = teamShort
resp.Params.ChatShort = chatShort
resp.Params.ActorShort = actorShort
resp.Params.Uid = uid
resp.Params.Jid = chatShort.Jid
resp.Params.BuzzTimeout = int(timeout.Seconds())
func NewServerCallBuzz(teamShort TeamShort, chatShort ChatShort, actorShort ContactShort, uid string, timeout time.Duration) (r ServerCallBuzz) {
r.BaseEvent.Name = "server.call.buzz"
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())

resp.Params.Icons = chatShort.Icons
r.Params.Icons = chatShort.Icons

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

type ServerCallBuzz struct {
BaseEvent
Params 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"`
Params serverCallBuzzParams `json:"params"`
}

Team string `json:"team"`
DisplayName string `json:"display_name"`
} `json:"params"`
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"`
}

0 comments on commit 5281192

Please sign in to comment.