Skip to content

Commit

Permalink
fix: allow empty user message body
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <norman@berty.tech>
  • Loading branch information
n0izn0iz committed Dec 17, 2021
1 parent cd0c3a6 commit 3b1e7f9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions go/internal/messengerpayloads/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,9 +845,7 @@ func (h *EventHandler) handleAppMessageGroupInvitation(tx *messengerdb.DBWrapper
}

func (h *EventHandler) handleAppMessageUserMessage(tx *messengerdb.DBWrapper, i *mt.Interaction, amPayload proto.Message) (*mt.Interaction, bool, error) {
if len(i.GetPayload()) == 0 {
return nil, false, ErrNilPayload
}
// NOTE: it's ok to have an empty payload here since a user message can be only medias

i, isNew, err := tx.AddInteraction(*i)
if err != nil {
Expand Down

0 comments on commit 3b1e7f9

Please sign in to comment.