1
0
mirror of https://github.com/funamitech/mastodon synced 2024-11-27 14:29:03 +09:00

Merge branch 'pr2462'

This commit is contained in:
Noa Himesaka 2024-07-09 23:38:21 +09:00
commit cb12947c42
4 changed files with 12 additions and 5 deletions

View File

@ -23,6 +23,7 @@ import { DisplayName } from '../../../components/display_name';
import MediaGallery from '../../../components/media_gallery';
import StatusContent from '../../../components/status_content';
import StatusReactions from '../../../components/status_reactions';
import { visibleReactions } from '../../../initial_state';
import Audio from '../../audio';
import scheduleIdleTask from '../../ui/util/schedule_idle_task';
import Video from '../../video';
@ -311,13 +312,13 @@ class DetailedStatus extends ImmutablePureComponent {
{...statusContentProps}
/>
<StatusReactions
{visibleReactions > 0 && (<StatusReactions
statusId={status.get('id')}
reactions={status.get('reactions')}
addReaction={this.props.onReactionAdd}
removeReaction={this.props.onReactionRemove}
canReact={this.props.identity.signedIn}
/>
/>)}
<div className='detailed-status__meta'>
<div className='detailed-status__meta__line'>

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class ActivityPub::Activity::EmojiReact < ActivityPub::Activity
CUSTOM_EMOJI_REGEX = /^:[^:]+:$/
def perform
original_status = status_from_uri(object_uri)
name = @json['content']
@ -8,7 +10,7 @@ class ActivityPub::Activity::EmojiReact < ActivityPub::Activity
!original_status.account.local? ||
delete_arrived_first?(@json['id'])
if /^:.*:$/.match?(name)
if CUSTOM_EMOJI_REGEX.match?(name)
name.delete! ':'
custom_emoji = process_emoji_tags(name, @json['tag'])

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class ActivityPub::Activity::Like < ActivityPub::Activity
CUSTOM_EMOJI_REGEX = /^:[^:]+:$/
def perform
original_status = status_from_uri(object_uri)
return if original_status.nil? || !original_status.account.local? || delete_arrived_first?(@json['id'])
@ -23,7 +25,7 @@ class ActivityPub::Activity::Like < ActivityPub::Activity
name = @json['content'] || @json['_misskey_reaction']
return false if name.nil?
if /^:.*:$/.match?(name)
if CUSTOM_EMOJI_REGEX.match?(name)
name.delete! ':'
custom_emoji = process_emoji_tags(name, @json['tag'])

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class ActivityPub::Activity::Undo < ActivityPub::Activity
CUSTOM_EMOJI_REGEX = /^:[^:]+:$/
def perform
case @object['type']
when 'Announce'
@ -125,7 +127,7 @@ class ActivityPub::Activity::Undo < ActivityPub::Activity
return if status.nil? || !status.account.local?
if /^:.*:$/.match?(name)
if CUSTOM_EMOJI_REGEX.match?(name)
name.delete! ':'
custom_emoji = process_emoji_tags(name, @object['tag'])