forked from glitch-soc/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix most backend issues #4
Merged
kescherCode
merged 9 commits into
CatCatNya:feature/emoji_reactions
from
Plastikmensch:emoji-reactions/fix-most-backend-issues
May 27, 2023
Merged
Fix most backend issues #4
kescherCode
merged 9 commits into
CatCatNya:feature/emoji_reactions
from
Plastikmensch:emoji-reactions/fix-most-backend-issues
May 27, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Plastikmensch <[email protected]>
These occur when an account tries to react with disabled custom emojis. In both `EmojiReact` and `Like? activities, the activity is discarded. Signed-off-by: Plastikmensch <[email protected]>
Processing all custom emojis is neither wise nor necessary as both `Like` and `EmojiReact` only expect a single custom emoji Signed-off-by: Plastikmensch <[email protected]>
Right now Misskey users were able to react, but couldn't remove their reactions. delegates `Undo` for a `Like` to `undo_emoji_react` when there is no favourite found. (Misskey `Like` activities can still create a fav when the emoji tag is invalid, I don't see the point though) Signed-off-by: Plastikmensch <[email protected]>
Also doesn't set custom_emoji to a local variant of name when not given. Signed-off-by: Plastikmensch <[email protected]>
When an account and a remote account reacted with a custom emoji with the same shortcode, the `me` attribute was also true for the remote reaction, despite being a different emoji. This query should probably be optimised, but it works. Signed-off-by: Plastikmensch <[email protected]>
Handling remote reactions with foreign emojis would require an extensive rewrite of vanilla code, so instead prevent reactions with remote emojis when the status is not local. Signed-off-by: Plastikmensch <[email protected]>
Instead of processing tag and then look for the custom emoji, let the processing return an emoji. Add `name` to `process_emoji_tags` to check if it matches the shortcode. Removed `process_single_emoji` and added its code to `process_emoji_tags` Removed arg from `maybe_process_misskey_reaction`. Ideally, `original_status` should be a global object, but I wanted to modify vanilla code as little as possible. Signed-off-by: Plastikmensch <[email protected]>
When reacting with different custom emojis with the same shortcode, it would count as an already present reaction and processed, bypassing the limit. Signed-off-by: Plastikmensch <[email protected]>
kescherCode
added a commit
that referenced
this pull request
May 27, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes multiple occurrences of looking for
:shortcode:
in the database, preventingUndo
activities to be processed.Added handling for
Undo
with Misskey reactions.Fixes an issue where
me
was true when a remote reaction had the same shortcode as an already present reaction.Added
custom_emoji
toreacted?
to be able to differentiate between reactions with the same shortcode but different emojis.Don't know if you were already working on this or not, but I thought I offer my solution.
Some of it could probably be optimised, but I worked multiple days on this and I'm tired.
Outstanding issues:
Because reactions from the same account with the same name, but different custom emojis can exist, it is possible for sidekiq to throw:
for remote reactions and
Duplicate record
for local reactions.