forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add Support for Emoji Reactions (Replaces #1980) #2127
Closed
Closed
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
9fccc8c
add backend support for status emoji reactions
fef1312 671fb4c
add frontend for emoji reactions
fef1312 56cb7ff
show reactions in detailed status view
fef1312 a1685c4
federate emoji reactions
fef1312 6646d36
remove accidentally created file
fef1312 4f4237c
make status reaction count limit configurable
fef1312 6bd0646
make frontend fetch reaction limit
fef1312 f61c649
cherry-pick emoji reaction changes
fef1312 c96110a
move react button to action bar
fef1312 256a07e
handle misskey reactions properly
fef1312 0ae702a
fix padding for reaction button
fef1312 9868231
cleanup backend emoji reaction code
fef1312 299b501
cleanup frontend emoji reaction code
fef1312 4951abe
fix reaction margins and paddings
fef1312 78e0e74
limit number of reactions displayed
fef1312 b6f8093
change default reaction limit to 1
fef1312 c3a18c6
make number of displayed reactions a setting
fef1312 573f12e
make number of visible reactions a vanilla setting
fef1312 7403e91
rebase with upstream
fef1312 49c8048
clean up new imports in vanilla flavour
fef1312 a8afee5
remove outdated comments
fef1312 946debe
fix reaction deletion bug and clean up controller
fef1312 be710b6
change reaction api to match other interactions
fef1312 490c1a2
remove unnecessary parameter
fef1312 4452ddb
cleanup JS imports and other minor stuff
fef1312 9f6a880
rename nop handler to handleNoOp
fef1312 8aadf99
fix padding on posts without reactions
fef1312 d5ccf3b
Add reaction limit to instance serializer
kescherCode d820510
sanitize setting for number of visible reactions
fef1312 16e08e1
download remote custom emojis from reactions
fef1312 7349a5a
support Undo action for EmojiReaction
fef1312 dbbfea1
handle incoming custom emoji reactions properly
fef1312 d0f3f64
display external custom emoji reactions properly
fef1312 eac272d
run i18n-tasks normalize
fef1312 799fb28
fix image for new custom emoji reactions
fef1312 6a1c438
disable reaction button when not signed in
fef1312 588315a
also disable reaction buttons in vanilla flavour
fef1312 13b5375
serialize custom emoji reactions properly for AP
fef1312 f6b1ec0
properly disable reactions when not logged in
fef1312 3eab0d0
support reacting with foreign custom emojis
fef1312 215a76c
delete reaction notifications when deleting status
fef1312 ed60e5b
fix schema after rebase
fef1312 4761bd3
fix status action bar after upstream changes
fef1312 79ff467
fix 404 when reacting with Keycap Number Sign
fef1312 275a67b
bypass reaction limit for foreign accounts
fef1312 b753263
Fix status reactions preventing an on_cascade delete
kescherCode 49b25c5
move emoji reaction strings to locales-glitch
fef1312 2664621
Per PR suggestion, split name and domain, and look for emoji ID, for …
neatchee 98eab31
Fix rebase issues
neatchee b78ea8b
Keep emoji picker within screen bounds
f718c02
Remove old .js locale files accidentally restored during rebase
neatchee 0c23022
Migrate emoji reactions
kescherCode 34f9e54
Fix appearance/show.html.haml
kescherCode 759a277
Fix placement of reactions bar for new threading UI
neatchee 7d7eff8
Restoring missing db migrate for reactions. How did this even go miss…
neatchee e0db7dc
Update emoji reaction patches
kescherCode fa0a5a7
Restore loc files for non-English languages; CrowdIn should handle this
neatchee b0b593d
Add missing authorization to ReactService
kescherCode ec687d7
Remove failing skip_before_action from v1/custom_emojis_controller.rb
kescherCode 4bd3c80
Reactions: Return 404 when status should not be visible, asynchronous…
kescherCode 2a8b66a
Fix missed merge conflict text in version.rb
neatchee 730878a
Remove stale/missed references to makeCustomEmojiMap / EmojiMap
neatchee eb68f62
Revert "Fix missed merge conflict text in version.rb"
neatchee 5bd0c35
Revert "Fix appearance/show.html.haml"
neatchee f560ee4
Fix appearance/show.html.haml
neatchee 924e858
Merge remote-tracking branch 'glitch-soc/main' into feat/emoji_reactions
neatchee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::V1::Statuses::ReactionsController < Api::BaseController | ||
include Authorization | ||
|
||
before_action -> { doorkeeper_authorize! :write, :'write:favourites' } | ||
before_action :require_user! | ||
before_action :set_status, only: [:create] | ||
|
||
def create | ||
ReactService.new.call(current_account, @status, params[:id]) | ||
render json: @status, serializer: REST::StatusSerializer | ||
end | ||
|
||
def destroy | ||
react = current_account.status_reactions.find_by(status_id: params[:status_id], name: params[:id]) | ||
|
||
if react | ||
@status = react.status | ||
UnreactWorker.perform_async(current_account.id, @status.id, params[:id]) | ||
else | ||
@status = Status.find(params[:status_id]) | ||
authorize @status, :show? | ||
end | ||
|
||
render json: @status, serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new([@status], current_account.id, reactions_map: { @status.id => false }) | ||
rescue Mastodon::NotPermittedError | ||
not_found | ||
end | ||
|
||
private | ||
|
||
def set_status | ||
@status = Status.find(params[:status_id]) | ||
authorize @status, :show? | ||
rescue Mastodon::NotPermittedError | ||
not_found | ||
end | ||
end |
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this also a catstodon specific thing to allow anyone to copy custom emojis? (@kescherCode )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is and should not be in here.