Added emoji reaction JSON RPC un/marshalling
This commit is contained in:
parent
39bd6d479a
commit
8089468e83
|
@ -122,6 +122,14 @@ func (m *Message) MarshalJSON() ([]byte, error) {
|
|||
Hash string `json:"hash"`
|
||||
Pack int32 `json:"pack"`
|
||||
}
|
||||
type EmojiReactionAlias struct {
|
||||
MessageId string `json:"message_id"`
|
||||
Type int32 `json:"type"`
|
||||
}
|
||||
type EmojiReactionRetractionAlias struct {
|
||||
EmojiReactionId string `json:"emoji_reaction_id"`
|
||||
}
|
||||
|
||||
item := struct {
|
||||
ID string `json:"id"`
|
||||
WhisperTimestamp uint64 `json:"whisperTimestamp"`
|
||||
|
@ -206,8 +214,14 @@ func (m *Message) UnmarshalJSON(data []byte) error {
|
|||
if err := json.Unmarshal(data, &aux); err != nil {
|
||||
return err
|
||||
}
|
||||
if aux.ContentType == protobuf.ChatMessage_STICKER {
|
||||
|
||||
switch aux.ContentType {
|
||||
case protobuf.ChatMessage_STICKER:
|
||||
m.Payload = &protobuf.ChatMessage_Sticker{Sticker: aux.Sticker}
|
||||
case protobuf.ChatMessage_EMOJI_REACTION:
|
||||
m.Payload = &protobuf.ChatMessage_EmojiReaction{EmojiReaction: aux.EmojiReaction}
|
||||
case protobuf.ChatMessage_EMOJI_REACTION_RETRACTION:
|
||||
m.Payload = &protobuf.ChatMessage_EmojiReactionRetraction{EmojiReactionRetraction: aux.EmojiReactionRetraction}
|
||||
}
|
||||
if aux.ContentType == protobuf.ChatMessage_AUDIO {
|
||||
m.Payload = &protobuf.ChatMessage_Audio{
|
||||
|
|
Loading…
Reference in New Issue