diff options
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/activitypub/activity/create.rb | 3 | ||||
-rw-r--r-- | app/lib/feed_manager.rb | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index d2bbd26d5..fbb4624e3 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -383,7 +383,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity return Conversation.find_by(id: OStatus::TagManager.instance.unique_tag_to_local_id(uri, 'Conversation')) if OStatus::TagManager.instance.local_id?(uri) begin - Conversation.find_or_create_by!(uri: uri) + conversation = Conversation.find_by(uri: uri) + Conversation.create!(uri: uri, account: @account, public: %i(public unlisted).include?(visibility_from_audience)) if conversation.nil? rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotUnique retry end diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index 92c125c0f..49db68119 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -56,6 +56,7 @@ class FeedManager should_filter &&= status.account_id == list.account_id should_filter &&= !list.show_all_replies? should_filter &&= !(list.show_list_replies? && ListAccount.where(list_id: list.id, account_id: status.in_reply_to_account_id).exists?) + should_filter &&= !(list.show_list_replies? && status.conversation&.account_id.present? && ListAccount.where(list_id: list.id, account_id: status.conversation.account_id).exists?) return false if should_filter end @@ -248,11 +249,13 @@ class FeedManager check_for_blocks = crutches[:active_mentions][status.id] || [] check_for_blocks.concat([status.account_id]) + check_for_blocks.concat([status.conversation.account_id]) unless status.conversation&.account_id.nil? check_for_blocks.concat([[status.in_reply_to_account_id]]) if status.reply? if status.reblog? check_for_blocks.concat([status.reblog.account_id]) check_for_blocks.concat(crutches[:active_mentions][status.reblog_of_id] || []) + check_for_blocks.concat([status.reblog.conversation.account_id]) unless status.reblog.conversation&.account_id.nil? check_for_blocks.concat([[status.reblog.in_reply_to_account_id]]) if status.reblog.reply? end @@ -260,6 +263,7 @@ class FeedManager if status.reply? && !status.in_reply_to_account_id.nil? # Filter out if it's a reply should_filter = !crutches[:following][status.in_reply_to_account_id] # and I'm not following the person it's a reply to + should_filter &&= !crutches[:following][status.conversation&.account_id] # and I'm not following the thread owner should_filter &&= receiver_id != status.in_reply_to_account_id # and it's not a reply to me should_filter &&= status.account_id != status.in_reply_to_account_id # and it's not a self-reply |