mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/portal: redact conflicting reactions before sending MSS success
This commit is contained in:
parent
7836f35a1a
commit
7a53f3928a
1 changed files with 6 additions and 1 deletions
|
|
@ -1587,6 +1587,12 @@ func (portal *Portal) handleMatrixReaction(ctx context.Context, sender *UserLogi
|
|||
if portal.Bridge.Config.OutgoingMessageReID {
|
||||
deterministicID = portal.Bridge.Matrix.GenerateReactionEventID(portal.MXID, reactionTarget, preResp.SenderID, preResp.EmojiID)
|
||||
}
|
||||
defer func() {
|
||||
// Do this in a defer so that it happens after any potential defer calls to removeOutdatedReaction
|
||||
if handleRes.Success {
|
||||
portal.sendSuccessStatus(ctx, evt, 0, deterministicID)
|
||||
}
|
||||
}()
|
||||
removeOutdatedReaction := func(oldReact *database.Reaction, deleteDB bool) {
|
||||
if !handleRes.Success {
|
||||
return
|
||||
|
|
@ -1684,7 +1690,6 @@ func (portal *Portal) handleMatrixReaction(ctx context.Context, sender *UserLogi
|
|||
if err != nil {
|
||||
log.Err(err).Msg("Failed to save reaction to database")
|
||||
}
|
||||
portal.sendSuccessStatus(ctx, evt, 0, deterministicID)
|
||||
return EventHandlingResultSuccess.WithEventID(deterministicID)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue