Commit graph

11344 commits

Author SHA1 Message Date
Plastikmensch
03845b0be2
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-07-07 21:57:40 +02:00
Plastikmensch
21975a11fd
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-07-07 21:57:40 +02:00
Plastikmensch
762d9bbb97
Add custom_emoji to reacted?
Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-07-07 21:57:40 +02:00
Jeremy Kescher
029e18f9b8
ReactionsController: Don't check for status reaction existence in destroy
UnreactService checks for its existence in the background anyway, so remove redundant checks.
2023-07-07 21:57:40 +02:00
Jeremy Kescher
4cb90c6bf0
Fix invalidating status reactions when they already exist
Co-authored-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-07-07 21:57:40 +02:00
Jeremy Kescher
cf6e8134f5
Fix visible reactions setting not applying 2023-07-07 21:57:40 +02:00
Jeremy Kescher
13657de04e
eslint fix 2023-07-07 21:57:40 +02:00
Jeremy Kescher
b6a646d10c
Remove further leftover makeCustomEmojiMap references 2023-07-07 21:57:40 +02:00
Jeremy Kescher
c781b34278
Run rubocop -a 2023-07-07 21:57:40 +02:00
Jeremy Kescher
31d9da6172
Removed unused imports in status_container.js 2023-07-07 21:57:40 +02:00
Jeremy Kescher
87d8579fa4
Add back missing visibleReactions variable to both initial_state.js files 2023-07-07 21:57:40 +02:00
Jeremy Kescher
0839dcdc7b
Add missing visible_reactions to vanilla initial_state typedef 2023-07-07 21:57:40 +02:00
Jeremy Kescher
0fe3bc4309
Fix max_reactions typedef 2023-07-07 21:57:40 +02:00
neatchee
290e1cb42d
Remove stale/missed references to makeCustomEmojiMap / EmojiMap 2023-07-07 21:57:40 +02:00
Jeremy Kescher
9268c0923d
Reactions: Return 404 when status should not be visible, asynchronous unreact 2023-07-07 21:57:40 +02:00
Jeremy Kescher
6e0d17cc7d
Add missing authorization to ReactService 2023-07-07 21:57:40 +02:00
neatchee
c47aa90717
Restore loc files for non-English languages; CrowdIn should handle this 2023-07-07 21:57:40 +02:00
Jeremy Kescher
bcab2d89ca
Update emoji reaction patches 2023-07-07 21:57:40 +02:00
neatchee
f214cd2938
Fix placement of reactions bar for new threading UI 2023-07-07 21:57:40 +02:00
Jeremy Kescher
c6d04be51a
Migrate emoji reactions 2023-07-07 21:57:40 +02:00
neatchee
08264918bf
Remove old .js locale files accidentally restored during rebase 2023-07-07 21:57:40 +02:00
Ivan Rodriguez
76da89a262
Keep emoji picker within screen bounds
Adds the `flip` prop to `<Overlay>`. Fixes #40
2023-07-07 21:57:40 +02:00
neatchee
8a0264bdf4
Fix rebase issues 2023-07-07 21:57:40 +02:00
neatchee
253c489177
Per PR suggestion, split name and domain, and look for emoji ID, for unreact, so remote emoji's can be unreacted 2023-07-07 21:57:40 +02:00
fef
370a5d2cd1
bypass reaction limit for foreign accounts 2023-07-07 21:57:40 +02:00
fef
1a85f0274e
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-07-07 21:57:40 +02:00
fef
ff712b7aa5
fix status action bar after upstream changes 2023-07-07 21:57:39 +02:00
fef
168cb08ba6
delete reaction notifications when deleting status 2023-07-07 21:57:39 +02:00
fef
3540af41db
support reacting with foreign custom emojis 2023-07-07 21:57:39 +02:00
fef
0b6cb441ad
properly disable reactions when not logged in 2023-07-07 21:57:39 +02:00
fef
4b9075e65b
serialize custom emoji reactions properly for AP
Akkoma and possibly others expect the `tag` field
in an EmojiReact activity to be an array, not just
a single object, so it's being wrapped into one
now.  I'm not entirely sure whether this is the
idiomatic way of doing it tbh, but it works fine.
2023-07-07 21:57:39 +02:00
fef
04fa964a10
also disable reaction buttons in vanilla flavour 2023-07-07 21:57:39 +02:00
fef
695d93adf9
disable reaction button when not signed in 2023-07-07 21:57:39 +02:00
fef
53e8307a6b
fix image for new custom emoji reactions 2023-07-07 21:57:39 +02:00
fef
a5c96afeac
display external custom emoji reactions properly
Using an emoji map was completely unnecessary in
the first place, because the reaction list from
the API response includes URLs for every custom
emoji anyway.  The reaction list now also contains
a boolean field indicating whether it is an
external custom emoji, which is required because
people should only be able to react with Unicode
emojis and local custom ones, not with custom
emojis from other servers.
2023-07-07 21:57:39 +02:00
fef
56617243b5
handle incoming custom emoji reactions properly 2023-07-07 21:57:39 +02:00
fef
4026e40b32
support Undo action for EmojiReaction 2023-07-07 21:57:39 +02:00
fef
2cf232c1ac
download remote custom emojis from reactions
Emoji reactions containing custom emojis from
remote instances were assumed to already have
been downloaded and stored in the database.
This might obviously not be the case.
2023-07-07 21:57:39 +02:00
fef
c38ce09d74
sanitize setting for number of visible reactions
This is kind of a hack, but the lack of
validation for settings unfortunately makes it
necessary.
2023-07-07 21:57:39 +02:00
Jeremy Kescher
3c84fc19d4
Add reaction limit to instance serializer 2023-07-07 21:57:39 +02:00
fef
9ea349ea92
fix padding on posts without reactions
The margins of the elements above and below the
main reaction list element overlapped before
reactions were added.  Adding display: none to
empty reaction bars restores this exact look.
2023-07-07 21:57:39 +02:00
fef
a05d93da6d
rename nop handler to handleNoOp
This also adds the comment in action_bar.js to
status_action_bar.js, clarifying that a future
version could improve this code by modifying
EmojiPickerDropdown.
2023-07-07 21:57:39 +02:00
fef
ef97a35161
cleanup JS imports and other minor stuff 2023-07-07 21:57:39 +02:00
fef
01cc5133e0
remove unnecessary parameter 2023-07-07 21:57:39 +02:00
fef
b978e10bef
change reaction api to match other interactions
Status reactions had an API similar to that of
announcement reactions, using PUT and DELETE at a
single endpoint.  I believe that for statuses, it
makes more sense to follow the convention of the
other interactions and use separate POST endpoints
for create and destroy respectively.
2023-07-07 21:57:39 +02:00
fef
5d94cbfc31
fix reaction deletion bug and clean up controller
Turns out the strange error where it would delete
the wrong reaction occurred because I forgot to
pass the emoji name to the query, which resulted
in the database deleting the first reaction it
found.  Also, this removes the unused set_reaction
callback and includes the Authorization module for
the status reactions controller.
2023-07-07 21:57:39 +02:00
fef
f1c26962f0
remove outdated comments 2023-07-07 21:57:39 +02:00
fef
82c137c726
clean up new imports in vanilla flavour 2023-07-07 21:57:39 +02:00
fef
3313ab8651
rebase with upstream 2023-07-07 21:57:39 +02:00
fef
956321b863
make number of visible reactions a vanilla setting
Reactions will be backported to the vanilla
flavour, which requires all related settings to
be accessible from the vanilla settings page
rather than the glitch specific settings modal.
2023-07-07 21:57:39 +02:00