Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dedup_messages'
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFerr committed Nov 13, 2023
2 parents fa23bd4 + 32ce3d2 commit 86cbd35
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,15 @@ func (portal *Portal) handleSignalMessages(portalMessage portalSignalMessage) {
portal.bridge.notifyBridgeBlocked(true)
return
}
if old_message := portal.bridge.DB.Message.GetBySignalID(
portalMessage.sender.SignalID,
portalMessage.message.Base().Timestamp,
portal.ChatID,
portal.Receiver,
); old_message != nil {
portal.log.Debug().Msgf("Ignoring message %d by %s as it was already handled", old_message.Timestamp, old_message.Sender)
return
}
if portal.MXID == "" {
portal.log.Debug().Msg("Creating Matrix room from incoming message")
if err := portal.CreateMatrixRoom(portalMessage.user, nil); err != nil {
Expand Down

0 comments on commit 86cbd35

Please sign in to comment.