make sure the thread filter option won't affect your own threads or those you're participating in
parent
7cfc0f0dce
commit
e11196775f
|
@ -42,6 +42,7 @@ module FilterHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_thread(account_id, conversation_id)
|
def filter_thread(account_id, conversation_id)
|
||||||
|
return if Status.where(account_id: account_id, conversation_id: conversation_id).exists?
|
||||||
Redis.cache.sadd("filtered_threads:#{account_id}", conversation_id)
|
Redis.cache.sadd("filtered_threads:#{account_id}", conversation_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,11 @@ class PostStatusService < BaseService
|
||||||
VISIBILITY_RANK[@visibility] < VISIBILITY_RANK[@in_reply_to.visibility]
|
VISIBILITY_RANK[@visibility] < VISIBILITY_RANK[@in_reply_to.visibility]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def unfilter_thread_on_reply
|
||||||
|
return if @in_reply_to.nil?
|
||||||
|
Redis.cache.srem("filtered_threads:#{@account.id}", @in_reply_to.conversation_id)
|
||||||
|
end
|
||||||
|
|
||||||
def set_local_only
|
def set_local_only
|
||||||
@local_only = true if @account.user_always_local_only? || @in_reply_to&.local_only
|
@local_only = true if @account.user_always_local_only? || @in_reply_to&.local_only
|
||||||
end
|
end
|
||||||
|
@ -136,6 +141,7 @@ class PostStatusService < BaseService
|
||||||
set_initial_visibility
|
set_initial_visibility
|
||||||
limit_visibility_if_silenced
|
limit_visibility_if_silenced
|
||||||
limit_visibility_to_reply
|
limit_visibility_to_reply
|
||||||
|
unfilter_thread_on_reply
|
||||||
|
|
||||||
@sensitive = (@account.user_defaults_to_sensitive? || @options[:spoiler_text].present?) if @sensitive.nil?
|
@sensitive = (@account.user_defaults_to_sensitive? || @options[:spoiler_text].present?) if @sensitive.nil?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue