Don't delete our reaction on Discord unless we have 0 of that reaction coming from Matrix #85
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: cadence/out-of-your-element#85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ellie/out-of-your-element:ellie-fix-reacts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes a bug where, if multiple Matrix users had used the same reaction on a message, and then one of those Matrix users removed their reactions, the bot would forcibly remove all of that reactions. Now, we check and make sure there are no remaining reactions from Matrix before removal.
Self-review. I don't think anything else needs to be done here (or would make sense to include).
Just a quick look. Seems like the right path! Thanks for humouring me.
@ -57,6 +59,30 @@ function eventNotFoundThenRetrigger(inputID, fn, ...rest) {return true // event was not found, then retrigger}function reactionNotFoundThenRetrigger(reactionEventID, fn, ...rest){Is it more or less gross if these were abstracted into a common base?
It was less gross
@ -51,2 +51,4 @@db.prepare("REPLACE INTO reaction (hashed_event_id, message_id, encoded_emoji, original_encoding) VALUES (?, ?, ?, ?)").run(utils.getEventIDHash(event.event_id), messageID, discordPreferredEncoding, key)retrigger.messageFinishedBridging(event.event_id)Is this really the correct function to call here?
@ -41,11 +41,17 @@ async function suppressEmbeds(event) {* @param {Ty.Event.Outer_M_Room_Redaction} event*/async function removeReaction(event) {if (retrigger.reactionNotFoundThenRetrigger(event.redacts, () => as.emit("type:m.room.redaction", event))) returnRetrigger target should be this function, not as.emit, otherwise other operations related to redaction could possibly be duplicated
Note: after this is merged see if the
ourDeletedReactionsarray fills up with garbage data, or if it's reliably removing stuff added to it (we don't currently clear this).Sometimes there's only an emoji ID, apparently? We should handle this properly.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.