camel case emojiReactions

This commit is contained in:
Andrea Maria Piana 2020-07-28 13:37:17 +02:00
parent a1a6e1c6c0
commit 7e7d95a907
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
1 changed files with 17 additions and 9 deletions

View File

@ -53,17 +53,25 @@ func (e *EmojiReaction) SetMessageType(messageType protobuf.MessageType) {
func (e EmojiReaction) MarshalJSON() ([]byte, error) { func (e EmojiReaction) MarshalJSON() ([]byte, error) {
type EmojiAlias EmojiReaction type EmojiAlias EmojiReaction
item := struct { item := struct {
EmojiAlias ID string `json:"id"`
ID string `json:"id"` Clock uint64 `json:"clock,omitempty"`
EmojiID protobuf.EmojiReaction_Type `json:"emojiId"` ChatID string `json:"chatId,omitempty"`
LocalChatID string `json:"localChatId,omitempty"`
From string `json:"from"`
MessageID string `json:"messageId,omitempty"`
MessageType protobuf.MessageType `json:"messageType,omitempty"`
EmojiID protobuf.EmojiReaction_Type `json:"emojiId,omitempty"`
}{ }{
EmojiAlias: (EmojiAlias)(e),
ID: e.ID(),
EmojiID: e.Type,
}
// cleanup type ID: e.ID(),
item.Type = 0 Clock: e.Clock,
ChatID: e.ChatId,
LocalChatID: e.LocalChatID,
From: e.From,
MessageID: e.MessageId,
MessageType: e.MessageType,
EmojiID: e.Type,
}
return json.Marshal(item) return json.Marshal(item)
} }