diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-03-04 01:15:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-04 01:15:29 +0100 |
commit | f03148f441d8dfc1856451c4faa00b5e26b6e199 (patch) | |
tree | 3d39c780306ee52a48b3c3d1ae30ecf600ba962d /app/lib | |
parent | 3637a0101e1f5095397f190e88f281d603797c32 (diff) | |
parent | d9c3109bb67f64c671573b1bab02132c6214509b (diff) |
Merge pull request #1712 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/activitypub/activity/announce.rb | 2 | ||||
-rw-r--r-- | app/lib/activitypub/activity/follow.rb | 4 | ||||
-rw-r--r-- | app/lib/activitypub/activity/like.rb | 2 | ||||
-rw-r--r-- | app/lib/activitypub/activity/update.rb | 5 | ||||
-rw-r--r-- | app/lib/formatter.rb | 2 |
5 files changed, 6 insertions, 9 deletions
diff --git a/app/lib/activitypub/activity/announce.rb b/app/lib/activitypub/activity/announce.rb index 7cd5a41e8..0674b1083 100644 --- a/app/lib/activitypub/activity/announce.rb +++ b/app/lib/activitypub/activity/announce.rb @@ -35,7 +35,7 @@ class ActivityPub::Activity::Announce < ActivityPub::Activity def distribute # Notify the author of the original status if that status is local - NotifyService.new.call(@status.reblog.account, :reblog, @status) if reblog_of_local_account?(@status) && !reblog_by_following_group_account?(@status) + LocalNotificationWorker.perform_async(@status.reblog.account_id, @status.id, 'Status', 'reblog') if reblog_of_local_account?(@status) && !reblog_by_following_group_account?(@status) # Distribute into home and list feeds ::DistributionWorker.perform_async(@status.id) if @options[:override_timestamps] || @status.within_realtime_window? diff --git a/app/lib/activitypub/activity/follow.rb b/app/lib/activitypub/activity/follow.rb index 4efb84b8c..97e41ab78 100644 --- a/app/lib/activitypub/activity/follow.rb +++ b/app/lib/activitypub/activity/follow.rb @@ -31,10 +31,10 @@ class ActivityPub::Activity::Follow < ActivityPub::Activity follow_request = FollowRequest.create!(account: @account, target_account: target_account, uri: @json['id']) if target_account.locked? || @account.silenced? - NotifyService.new.call(target_account, :follow_request, follow_request) + LocalNotificationWorker.perform_async(target_account.id, follow_request.id, 'FollowRequest', 'follow_request') else AuthorizeFollowService.new.call(@account, target_account) - NotifyService.new.call(target_account, :follow, ::Follow.find_by(account: @account, target_account: target_account)) + LocalNotificationWorker.perform_async(target_account.id, ::Follow.find_by(account: @account, target_account: target_account).id, 'Follow', 'follow') end end diff --git a/app/lib/activitypub/activity/like.rb b/app/lib/activitypub/activity/like.rb index ebbda15b9..aa1dc3040 100644 --- a/app/lib/activitypub/activity/like.rb +++ b/app/lib/activitypub/activity/like.rb @@ -8,7 +8,7 @@ class ActivityPub::Activity::Like < ActivityPub::Activity favourite = original_status.favourites.create!(account: @account) - NotifyService.new.call(original_status.account, :favourite, favourite) + LocalNotificationWorker.perform_async(original_status.account_id, favourite.id, 'Favourite', 'favourite') Trends.statuses.register(original_status) end end diff --git a/app/lib/activitypub/activity/update.rb b/app/lib/activitypub/activity/update.rb index 0bfead55b..36ad5f446 100644 --- a/app/lib/activitypub/activity/update.rb +++ b/app/lib/activitypub/activity/update.rb @@ -26,11 +26,6 @@ class ActivityPub::Activity::Update < ActivityPub::Activity return if @status.nil? - forwarder.forward! if forwarder.forwardable? ActivityPub::ProcessStatusUpdateService.new.call(@status, @object) end - - def forwarder - @forwarder ||= ActivityPub::Forwarder.new(@account, @json, @status) - end end diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index 94d149da3..dfa493ed5 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -90,6 +90,8 @@ class Formatter end def simplified_format(account, **options) + return '' if account.note.blank? + html = account.local? ? linkify(account.note) : reformat(account.note) html = encode_custom_emojis(html, account.emojis, options[:autoplay]) if options[:custom_emojify] html.html_safe # rubocop:disable Rails/OutputSafety |