1
0
Fork 0
forked from gitea/glitch-bird

Merge remote-tracking branch 'kescherCode/feature/emoji_reactions' into merge/kescherCode/emoji_reactions

This commit is contained in:
neatchee 2023-05-27 18:35:53 -07:00
commit aa1281f524
9 changed files with 114 additions and 12 deletions

View file

@ -836,6 +836,15 @@ class Status extends ImmutablePureComponent {
canReact={this.context.identity.signedIn}
/>
<StatusReactions
statusId={status.get('id')}
reactions={status.get('reactions')}
numVisible={visibleReactions}
addReaction={this.props.onReactionAdd}
removeReaction={this.props.onReactionRemove}
canReact={this.context.identity.signedIn}
/>
{!isCollapsed || !(muted || !settings.getIn(['collapsed', 'show_action_bar'])) ? (
<StatusActionBar
status={status}

View file

@ -7,6 +7,7 @@ import StatusContent from 'flavours/glitch/components/status_content';
import MediaGallery from 'flavours/glitch/components/media_gallery';
import AttachmentList from 'flavours/glitch/components/attachment_list';
import { Link } from 'react-router-dom';
import { injectIntl } from 'react-intl';
import Card from './card';
import ImmutablePureComponent from 'react-immutable-pure-component';
import Video from 'flavours/glitch/features/video';
@ -20,7 +21,6 @@ import { AnimatedNumber } from 'flavours/glitch/components/animated_number';
import PictureInPicturePlaceholder from 'flavours/glitch/components/picture_in_picture_placeholder';
import EditedTimestamp from 'flavours/glitch/components/edited_timestamp';
import StatusReactions from 'flavours/glitch/components/status_reactions';
import { injectIntl } from 'react-intl';
class DetailedStatus extends ImmutablePureComponent {

View file

@ -78,6 +78,15 @@
],
"path": "app/javascript/flavours/glitch/components/notification_purge_buttons.json"
},
{
"descriptors": [
{
"defaultMessage": "React",
"id": "status.react"
}
],
"path": "app/javascript/flavours/glitch/components/status_action_bar.json"
},
{
"descriptors": [
{
@ -119,6 +128,15 @@
],
"path": "app/javascript/flavours/glitch/components/status_icons.json"
},
{
"descriptors": [
{
"defaultMessage": "{name} reacted to your status",
"id": "notification.reaction"
}
],
"path": "app/javascript/flavours/glitch/components/status_prepend.json"
},
{
"descriptors": [
{
@ -907,6 +925,24 @@
],
"path": "app/javascript/flavours/glitch/features/local_settings/page/index.json"
},
{
"descriptors": [
{
"defaultMessage": "Reactions:",
"id": "notifications.column_settings.reaction"
}
],
"path": "app/javascript/flavours/glitch/features/notifications/components/column_settings.json"
},
{
"descriptors": [
{
"defaultMessage": "Reactions",
"id": "notifications.filter.reactions"
}
],
"path": "app/javascript/flavours/glitch/features/notifications/components/filter_bar.json"
},
{
"descriptors": [
{
@ -960,6 +996,15 @@
],
"path": "app/javascript/flavours/glitch/features/reblogs/index.json"
},
{
"descriptors": [
{
"defaultMessage": "React",
"id": "status.react"
}
],
"path": "app/javascript/flavours/glitch/features/status/components/action_bar.json"
},
{
"descriptors": [
{
@ -1114,5 +1159,50 @@
}
],
"path": "app/javascript/flavours/glitch/features/ui/index.json"
},
{
"descriptors": [
{
"defaultMessage": "React",
"id": "status.react"
}
],
"path": "app/javascript/mastodon/components/status_action_bar.json"
},
{
"descriptors": [
{
"defaultMessage": "Reactions:",
"id": "notifications.column_settings.reaction"
}
],
"path": "app/javascript/mastodon/features/notifications/components/column_settings.json"
},
{
"descriptors": [
{
"defaultMessage": "Reactions",
"id": "notifications.filter.reactions"
}
],
"path": "app/javascript/mastodon/features/notifications/components/filter_bar.json"
},
{
"descriptors": [
{
"defaultMessage": "{name} reacted to your status",
"id": "notification.reaction"
}
],
"path": "app/javascript/mastodon/features/notifications/components/notification.json"
},
{
"descriptors": [
{
"defaultMessage": "React",
"id": "status.react"
}
],
"path": "app/javascript/mastodon/features/status/components/action_bar.json"
}
]

View file

@ -76,16 +76,13 @@
"navigation_bar.misc": "Misc",
"notification.markForDeletion": "Mark for deletion",
"notification.reaction": "{name} reacted to your post",
"notifications.column_settings.reaction": "Reactions:",
"notifications.column_settings.notification_grouping.category": "Notification Grouping",
"notifications.column_settings.notification_grouping.reaction": "Group Reactions",
"notifications.column_settings.notification_grouping.favourite": "Group Favourites",
"notifications.column_settings.notification_grouping.boost": "Group Boosts",
"notification_purge.btn_all": "Select\nall",
"notification_purge.btn_apply": "Clear\nselected",
"notification_purge.btn_invert": "Invert\nselection",
"notification_purge.btn_none": "Select\nnone",
"notification_purge.start": "Enter notification cleaning mode",
"notifications.column_settings.reaction": "Reactions:",
"notifications.filter.reactions": "Reactions",
"notifications.marked_clear": "Clear selected notifications",
"notifications.marked_clear_confirmation": "Are you sure you want to permanently clear all selected notifications?",
"notifications.others": "others",
@ -207,6 +204,7 @@
"status.in_reply_to": "This toot is a reply",
"status.is_poll": "This toot is a poll",
"status.local_only": "Only visible from your instance",
"status.react": "React",
"status.sensitive_toggle": "Click to view",
"status.uncollapse": "Uncollapse",
"web_app_crash.change_your_settings": "Change your {settings}",

View file

@ -10,7 +10,7 @@ class ActivityPub::Activity::EmojiReact < ActivityPub::Activity
if /^:.*:$/.match?(name)
name.delete! ':'
custom_emoji = process_emoji_tags(@json['tag'])
custom_emoji = process_emoji_tags(name, @json['tag'])
return if custom_emoji.nil?
end

View file

@ -24,7 +24,7 @@ class ActivityPub::Activity::Like < ActivityPub::Activity
if /^:.*:$/.match?(name)
name.delete! ':'
custom_emoji = process_emoji_tags(@json['tag'])
custom_emoji = process_emoji_tags(name, @json['tag'])
return false if custom_emoji.nil? # invalid custom emoji, treat it as a regular like
end

View file

@ -44,6 +44,11 @@ en:
title: User verification
generic:
use_this: Use this
notification_mailer:
reaction:
body: "%{name} reacted to your post:"
subject: "%{name} reacted to your post"
title: New reaction
settings:
flavours: Flavours
notification_mailer:

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateStatusReactions < ActiveRecord::Migration[6.1]
def change
create_table :status_reactions do |t|

View file

@ -1,5 +1,3 @@
require 'rails_helper'
# frozen_string_literal: true
RSpec.describe StatusReaction, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
require 'rails_helper'