Fix mistake in reaction replace error handling

This commit is contained in:
Tulir Asokan
2023-03-11 00:07:53 +02:00
parent ff052d7f18
commit 15d4cf07f9

View File

@@ -1526,10 +1526,11 @@ func (portal *Portal) handleDiscordReaction(user *User, reaction *discordgo.Mess
resp, err := intent.RedactEvent(portal.MXID, existing.MXID) resp, err := intent.RedactEvent(portal.MXID, existing.MXID)
if err != nil { if err != nil {
portal.log.Warnfln("Failed to remove reaction from %s: %v", portal.MXID, err) portal.log.Warnfln("Failed to remove reaction from %s: %v", portal.MXID, err)
} else {
go portal.sendDeliveryReceipt(resp.EventID)
} }
existing.Delete() existing.Delete()
go portal.sendDeliveryReceipt(resp.EventID)
return return
} else if existing != nil { } else if existing != nil {
portal.log.Debugfln("Ignoring duplicate reaction %s from %s to %s", discordID, reaction.UserID, message[0].DiscordID) portal.log.Debugfln("Ignoring duplicate reaction %s from %s to %s", discordID, reaction.UserID, message[0].DiscordID)