Explorar o código

Fix mistake in reaction replace error handling

Tulir Asokan %!s(int64=2) %!d(string=hai) anos
pai
achega
15d4cf07f9
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      portal.go

+ 2 - 1
portal.go

@@ -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)