Drop image messages in public chats
Currently image messages are actually displayed, we only prevent sending. This commit changes the behavior so that we drop them.
This commit is contained in:
parent
61993fab47
commit
add5040b48
|
@ -423,6 +423,10 @@ func (m *MessageHandler) HandleChatMessage(state *ReceivedMessageState) error {
|
|||
return err // matchChatEntity returns a descriptive error message
|
||||
}
|
||||
|
||||
if chat.Public() && receivedMessage.ContentType == protobuf.ChatMessage_IMAGE {
|
||||
return errors.New("images are not allowed in public chats")
|
||||
}
|
||||
|
||||
// If profile updates check if author is the same as chat profile public key
|
||||
if chat.ProfileUpdates() && receivedMessage.From != chat.Profile {
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue