add option to show raw world timeline
parent
3e8d7fd5f8
commit
ba51d3f135
|
@ -20,6 +20,7 @@ class UserSettingsDecorator
|
||||||
user.settings['default_privacy'] = default_privacy_preference if change?('setting_default_privacy')
|
user.settings['default_privacy'] = default_privacy_preference if change?('setting_default_privacy')
|
||||||
user.settings['default_local'] = default_local_preference if change?('setting_default_local')
|
user.settings['default_local'] = default_local_preference if change?('setting_default_local')
|
||||||
user.settings['always_local'] = always_local_preference if change?('setting_always_local')
|
user.settings['always_local'] = always_local_preference if change?('setting_always_local')
|
||||||
|
user.settings['rawr_federated'] = rawr_federated_preference if change?('setting_rawr_federated')
|
||||||
user.settings['default_sensitive'] = default_sensitive_preference if change?('setting_default_sensitive')
|
user.settings['default_sensitive'] = default_sensitive_preference if change?('setting_default_sensitive')
|
||||||
user.settings['default_language'] = default_language_preference if change?('setting_default_language')
|
user.settings['default_language'] = default_language_preference if change?('setting_default_language')
|
||||||
user.settings['unfollow_modal'] = unfollow_modal_preference if change?('setting_unfollow_modal')
|
user.settings['unfollow_modal'] = unfollow_modal_preference if change?('setting_unfollow_modal')
|
||||||
|
@ -61,6 +62,10 @@ class UserSettingsDecorator
|
||||||
boolean_cast_setting 'setting_always_local'
|
boolean_cast_setting 'setting_always_local'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def rawr_federated_preference
|
||||||
|
boolean_cast_setting 'setting_rawr_federated'
|
||||||
|
end
|
||||||
|
|
||||||
def default_sensitive_preference
|
def default_sensitive_preference
|
||||||
boolean_cast_setting 'setting_default_sensitive'
|
boolean_cast_setting 'setting_default_sensitive'
|
||||||
end
|
end
|
||||||
|
|
|
@ -351,25 +351,29 @@ class Status < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_public_timeline(account = nil, local_only = false)
|
def as_public_timeline(account = nil, local_only = false)
|
||||||
# instead of our ftl being a noisy irrelevant firehose
|
if account.present? && account&.user&.setting_rawr_federated
|
||||||
# only show public stuff boosted by the community
|
query = timeline_scope(local_only).without_replies
|
||||||
query = Status.network
|
else
|
||||||
if local_only then
|
# instead of our ftl being a noisy irrelevant firehose
|
||||||
# we don't want to change the ltl
|
# only show public stuff boosted by the community
|
||||||
query = query
|
query = Status.network
|
||||||
.with_public_visibility
|
if local_only then
|
||||||
.without_replies
|
# we don't want to change the ltl
|
||||||
.without_reblogs
|
query = query
|
||||||
else # but on the ftl
|
.with_public_visibility
|
||||||
query = query.without_replies unless Setting.show_replies_in_public_timelines
|
.without_replies
|
||||||
# grab the stuff we boosted
|
.without_reblogs
|
||||||
subquery = query.reblogs.select(:reblog_of_id)
|
else # but on the ftl
|
||||||
.reorder(nil)
|
query = query.without_replies unless Setting.show_replies_in_public_timelines
|
||||||
.distinct
|
# grab the stuff we boosted
|
||||||
# map those ids to actual statuses
|
subquery = query.reblogs.select(:reblog_of_id)
|
||||||
# THIS QUERY IS EXPENSIVE AS FUCK!!!!!!!
|
.reorder(nil)
|
||||||
# but it does the job
|
.distinct
|
||||||
query = Status.where(id: subquery).with_public_visibility
|
# map those ids to actual statuses
|
||||||
|
# THIS QUERY IS EXPENSIVE AS FUCK!!!!!!!
|
||||||
|
# but it does the job
|
||||||
|
query = Status.where(id: subquery).with_public_visibility
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
apply_timeline_filters(query, account, local_only)
|
apply_timeline_filters(query, account, local_only)
|
||||||
|
|
|
@ -102,7 +102,7 @@ class User < ApplicationRecord
|
||||||
|
|
||||||
has_many :session_activations, dependent: :destroy
|
has_many :session_activations, dependent: :destroy
|
||||||
|
|
||||||
delegate :auto_play_gif, :default_local, :always_local, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal,
|
delegate :auto_play_gif, :default_local, :always_local, :rawr_federated, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal,
|
||||||
:reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :display_media, :hide_network, :hide_followers_count,
|
:reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :display_media, :hide_network, :hide_followers_count,
|
||||||
:expand_spoilers, :default_language, :aggregate_reblogs, :show_application, :default_content_type, to: :settings, prefix: :setting, allow_nil: false
|
:expand_spoilers, :default_language, :aggregate_reblogs, :show_application, :default_content_type, to: :settings, prefix: :setting, allow_nil: false
|
||||||
|
|
||||||
|
@ -196,6 +196,10 @@ class User < ApplicationRecord
|
||||||
settings.always_local || false
|
settings.always_local || false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def setting_rawr_federated
|
||||||
|
settings.rawr_federated || false
|
||||||
|
end
|
||||||
|
|
||||||
def allows_digest_emails?
|
def allows_digest_emails?
|
||||||
settings.notification_emails['digest']
|
settings.notification_emails['digest']
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,6 +33,9 @@
|
||||||
|
|
||||||
%hr#settings_other/
|
%hr#settings_other/
|
||||||
|
|
||||||
|
.fields-group
|
||||||
|
= f.input :setting_rawr_federated, as: :boolean, wrapper: :with_label
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :setting_noindex, as: :boolean, wrapper: :with_label
|
= f.input :setting_noindex, as: :boolean, wrapper: :with_label
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,7 @@ en:
|
||||||
setting_default_privacy: Post privacy
|
setting_default_privacy: Post privacy
|
||||||
setting_default_local: Default to Monsterpit-only roars (in Glitch flavour)
|
setting_default_local: Default to Monsterpit-only roars (in Glitch flavour)
|
||||||
setting_always_local: Don't send your roars outside Monsterpit
|
setting_always_local: Don't send your roars outside Monsterpit
|
||||||
|
setting_rawr_federated: Show raw world timeline (may contain offensive content!)
|
||||||
setting_default_sensitive: Always mark media as sensitive
|
setting_default_sensitive: Always mark media as sensitive
|
||||||
setting_delete_modal: Show confirmation dialog before deleting a roar
|
setting_delete_modal: Show confirmation dialog before deleting a roar
|
||||||
setting_display_media: Media display
|
setting_display_media: Media display
|
||||||
|
|
Loading…
Reference in New Issue