bridgev2/portal: don't bridge remote edits by different users
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run

This commit is contained in:
Tulir Asokan 2025-03-10 22:52:06 +02:00
commit a01edae1c3

View file

@ -2095,6 +2095,12 @@ func (portal *Portal) handleRemoteEdit(ctx context.Context, source *UserLogin, e
intent := portal.GetIntentFor(ctx, evt.GetSender(), source, RemoteEventEdit)
if intent == nil {
return
} else if intent.GetMXID() != existing[0].SenderMXID {
log.Warn().
Stringer("edit_sender_mxid", intent.GetMXID()).
Stringer("original_sender_mxid", existing[0].SenderMXID).
Msg("Not bridging edit: sender doesn't match original message sender")
return
}
ts := getEventTS(evt)
converted, err := evt.ConvertEdit(ctx, portal, intent, existing)