Added emoji reaction message type validation
This commit is contained in:
parent
154a169ffb
commit
a0e7e0751c
|
@ -204,6 +204,27 @@ 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 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 message.ContentType == protobuf.ChatMessage_AUDIO {
|
||||
|
|
Loading…
Reference in New Issue