Skip to content

Commit

Permalink
Not nullable lists
Browse files Browse the repository at this point in the history
  • Loading branch information
sdfsdhgjkbmnmxc committed Apr 3, 2021
1 parent 40b8101 commit dd3aed7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ type Chat struct {
Num uint `chattype:"task" json:"num,omitempty"`

// Task followers id's. TODO: rename to "followers"
Observers *[]JID `chattype:"task" json:"observers,omitempty"`
Observers []JID `chattype:"task" json:"observers,omitempty"`

// Task creator
Owner *JID `chattype:"task" json:"owner,omitempty"`
Expand Down Expand Up @@ -195,7 +195,7 @@ type Chat struct {
Parents []Subtask `chattype:"task" json:"parents,omitempty"`

// Tab names
Tabs *[]TaskTabKey `chattype:"task" json:"tabs,omitempty"`
Tabs []TaskTabKey `chattype:"task" json:"tabs,omitempty"`

// My status in group chat
Status *GroupStatus `chattype:"group" json:"status,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type Contact struct {
CanDelete bool `json:"can_delete,omitempty"`

// Changeable fields
ChangeableFields *[]string `json:"changeable_fields,omitempty"`
ChangeableFields []string `json:"changeable_fields,omitempty"`

// Family name
FamilyName *string `json:"family_name,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ type MessageContent struct {
Patronymic *string `mediatype:"contact" json:"patronymic,omitempty"`

// Contact phones list (for "contact" mediatype)
Phones *[]string `mediatype:"contact" json:"phones,omitempty"`
Phones []string `mediatype:"contact" json:"phones,omitempty"`

// Emails list (for "contact" mediatype)
Emails *[]string `mediatype:"contact" json:"emails,omitempty"`
Emails []string `mediatype:"contact" json:"emails,omitempty"`

// Stickerpack name (for "sticker" subtype)
Stickerpack string `mediasubtype:"sticker" json:"stickerpack,omitempty"`
Expand Down
8 changes: 4 additions & 4 deletions server_online.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package tdproto

func NewServerOnline(contacts []OnlineContact, calls []OnlineCall) (r ServerOnline) {
r.Name = r.GetName()
r.Params.Contacts = &contacts
r.Params.Calls = &calls
r.Params.Contacts = contacts
r.Params.Calls = calls
return r
}

Expand All @@ -17,10 +17,10 @@ func (p ServerOnline) GetName() string { return "server.online" }

type serverOnlineParams struct {
// Online team members
Contacts *[]OnlineContact `json:"contacts"`
Contacts []OnlineContact `json:"contacts"`

// Active calls
Calls *[]OnlineCall `json:"calls"`
Calls []OnlineCall `json:"calls,omitempty"`
}

type OnlineContact struct {
Expand Down

0 comments on commit dd3aed7

Please sign in to comment.