Commit graph

18134 commits

Author SHA1 Message Date
Jeremy Kescher
3b3bfecba6
Fix translations 2023-05-27 14:12:04 +02:00
Jeremy Kescher
fd5e5a759e
Move status_reactions.js to status_reactions.jsx 2023-05-27 13:55:17 +02:00
Plastikmensch
3dc590a327
Add missing name param.
Follow-up to 3a91f535fa
Missed these while porting changes.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-05-27 13:32:45 +02:00
Jeremy Kescher
55199ec150
Use named import for AnimatedNumber 2023-05-27 13:32:45 +02:00
Jeremy Kescher
0e1ef3efd0
Fix some RubyCop offenses 2023-05-27 13:32:43 +02:00
Plastikmensch
2a13d27be4
Fix being able to bypass MAX_REACTIONS
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 <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Plastikmensch
3a91f535fa
Refactor emoji reactions
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 <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Plastikmensch
4e15a89b39
Only allow reacting with remote emojis when status is local
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 <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Plastikmensch
ea10f2e1e0
Don't set me to true for remote reactions
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 <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Plastikmensch
b326dcab78
Don't allow reactions with disabled custom emojis
Also doesn't set custom_emoji to a local variant of name when not given.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Plastikmensch
f9730eba77
Handle Undo from Misskey
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 <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Plastikmensch
8cecb468b0
Only process single custom emoji
Processing all custom emojis is neither wise nor necessary as both `Like` and `EmojiReact` only expect a single custom emoji

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Plastikmensch
239170830e
Rescue uncaught RecordInvalid errors
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 <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Plastikmensch
051bb17de8
Add custom_emoji to reacted?
Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Jeremy Kescher
88cb32e766
ReactionsController: Don't check for status reaction existence in destroy
UnreactService checks for its existence in the background anyway, so remove redundant checks.
2023-05-27 12:01:13 +02:00
Jeremy Kescher
a801d5035c
Fix invalidating status reactions when they already exist
Co-authored-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Jeremy Kescher
245e212ba1
status_reaction_fabricator: Use a unicode emoji instead of "MyString"
Co-authored-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Jeremy Kescher
241d61af52
api.rb: Remove resources line that wasn't in routes.rb anymore
Co-authored-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-05-27 12:01:13 +02:00
Jeremy Kescher
ab5d17c9fa
Remove German translation for setting_visible_reactions 2023-05-27 12:01:13 +02:00
Jeremy Kescher
69a5c9483b
Remove old french emoji reaction-related strings 2023-05-27 12:01:13 +02:00
Jeremy Kescher
9be1967d05
Introduce visible reactions default setting 2023-05-27 12:01:13 +02:00
Jeremy Kescher
00d74e293a
Re-apply schema version 2023-05-27 12:01:13 +02:00
Jeremy Kescher
7f21afa5b8
Fix visible reactions setting not applying 2023-05-27 12:01:13 +02:00
Jeremy Kescher
956ce75185
eslint fix 2023-05-27 12:01:13 +02:00
Jeremy Kescher
4ba93c2c10
Remove further leftover makeCustomEmojiMap references 2023-05-27 12:01:13 +02:00
Jeremy Kescher
d18ca9eef6
Remove duplicate notification_mailer definition 2023-05-27 12:01:13 +02:00
Jeremy Kescher
9da713f009
Fix n+1 query for move emoji reaction settings migration 2023-05-27 12:01:13 +02:00
Jeremy Kescher
bf7945f15b
Run rubocop -a 2023-05-27 12:01:13 +02:00
Jeremy Kescher
263f10fd3e
Removed unused imports in status_container.js 2023-05-27 12:01:13 +02:00
Jeremy Kescher
ffd8aa6a2a
Add back missing visibleReactions variable to both initial_state.js files 2023-05-27 12:01:13 +02:00
Jeremy Kescher
672c123211
Add missing visible_reactions to vanilla initial_state typedef 2023-05-27 12:01:13 +02:00
Jeremy Kescher
0859f5b511
Fix max_reactions typedef 2023-05-27 12:01:13 +02:00
Jeremy Kescher
c4d82b4170
Move reaction endpoints from route.rb to api.rb 2023-05-27 12:01:13 +02:00
neatchee
20da97252d
Remove stale/missed references to makeCustomEmojiMap / EmojiMap 2023-05-27 12:01:13 +02:00
Jeremy Kescher
92fea0e028
Reactions: Return 404 when status should not be visible, asynchronous unreact 2023-05-27 12:01:13 +02:00
Jeremy Kescher
38f39b422a
Add missing authorization to ReactService 2023-05-27 12:01:13 +02:00
neatchee
f08f3c9eb8
Restore loc files for non-English languages; CrowdIn should handle this 2023-05-27 12:01:13 +02:00
Jeremy Kescher
7f1b0f43e9
Update emoji reaction patches 2023-05-27 12:01:13 +02:00
neatchee
9133f5af9d
Fix placement of reactions bar for new threading UI 2023-05-27 12:01:13 +02:00
Jeremy Kescher
83e1c8e742
Migrate emoji reactions 2023-05-27 12:01:13 +02:00
neatchee
8e71bfde83
Remove old .js locale files accidentally restored during rebase 2023-05-27 12:01:13 +02:00
Ivan Rodriguez
1987dd766a
Keep emoji picker within screen bounds
Adds the `flip` prop to `<Overlay>`. Fixes #40
2023-05-27 12:01:13 +02:00
neatchee
bbce42a7cb
Fix rebase issues 2023-05-27 12:01:13 +02:00
neatchee
ee4e497cc6
Per PR suggestion, split name and domain, and look for emoji ID, for unreact, so remote emoji's can be unreacted 2023-05-27 12:01:13 +02:00
fef
9c69772dc6
move emoji reaction strings to locales-glitch 2023-05-27 12:01:13 +02:00
Jeremy Kescher
e8c9054e74
Fix status reactions preventing an on_cascade delete 2023-05-27 12:01:13 +02:00
fef
5e46bec485
bypass reaction limit for foreign accounts 2023-05-27 12:01:13 +02:00
fef
5ec5a782d4
fix 404 when reacting with Keycap Number Sign
The Unicode sequence for this emoji starts with an
ASCII # character, which the browser's URI parser
truncates before sending the request to the
backend.
2023-05-27 12:01:13 +02:00
fef
8d9105e4c2
fix status action bar after upstream changes 2023-05-27 12:01:13 +02:00
fef
4226a5ddc8
fix schema after rebase 2023-05-27 12:01:13 +02:00