Removed original iteration
This commit is contained in:
parent
2d9db29f31
commit
ae1e6db883
|
@ -122,13 +122,6 @@ 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"`
|
||||
|
@ -215,13 +208,8 @@ func (m *Message) UnmarshalJSON(data []byte) error {
|
|||
return err
|
||||
}
|
||||
|
||||
switch aux.ContentType {
|
||||
case protobuf.ChatMessage_STICKER:
|
||||
if aux.ContentType == 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{
|
||||
|
|
|
@ -204,33 +204,6 @@ func ValidateReceivedChatMessage(message *protobuf.ChatMessage, whisperTimestamp
|
|||
if image.Type == protobuf.ImageMessage_UNKNOWN_IMAGE_TYPE {
|
||||
return errors.New("image type unknown")
|
||||
}
|
||||
|
||||
case protobuf.ChatMessage_EMOJI_REACTION:
|
||||
if message.Payload == nil {
|
||||
return errors.New("no emoji reaction data")
|
||||
}
|
||||
emojiR := message.GetEmojiReaction()
|
||||
if emojiR == nil {
|
||||
return errors.New("no emoji reaction data")
|
||||
}
|
||||
if len(emojiR.MessageId) == 0 {
|
||||
return errors.New("emoji reaction no target message id")
|
||||
}
|
||||
if emojiR.Type == protobuf.EmojiReaction_UNKNOWN_EMOJI_REACTION_TYPE {
|
||||
return errors.New("emoji reaction type unknown")
|
||||
}
|
||||
|
||||
case protobuf.ChatMessage_EMOJI_REACTION_RETRACTION:
|
||||
if message.Payload == nil {
|
||||
return errors.New("no emoji reaction retraction data")
|
||||
}
|
||||
emojiRR := message.GetEmojiReactionRetraction()
|
||||
if emojiRR == nil {
|
||||
return errors.New("no emoji reaction retraction data")
|
||||
}
|
||||
if len(emojiRR.EmojiReactionId) == 0 {
|
||||
return errors.New("emoji reaction retraction no target emoji reaction id")
|
||||
}
|
||||
}
|
||||
|
||||
if message.ContentType == protobuf.ChatMessage_AUDIO {
|
||||
|
|
|
@ -87,11 +87,11 @@ type RawResponse struct {
|
|||
}
|
||||
|
||||
type MessengerResponse struct {
|
||||
Chats []*Chat `json:"chats,omitempty"`
|
||||
Messages []*Message `json:"messages,omitempty"`
|
||||
Contacts []*Contact `json:"contacts,omitempty"`
|
||||
Installations []*multidevice.Installation `json:"installations,omitempty"`
|
||||
EmojiReactions []*EmojiReaction `json:"emoji_reactions"`
|
||||
Chats []*Chat `json:"chats,omitempty"`
|
||||
Messages []*Message `json:"messages,omitempty"`
|
||||
Contacts []*Contact `json:"contacts,omitempty"`
|
||||
Installations []*multidevice.Installation `json:"installations,omitempty"`
|
||||
EmojiReactions []*EmojiReaction `json:"emoji_reactions,omitempty"`
|
||||
}
|
||||
|
||||
func (m *MessengerResponse) IsEmpty() bool {
|
||||
|
|
Loading…
Reference in New Issue