Fix stop emoji reaction streaming to user settings
This commit is contained in:
parent
7d237611d9
commit
dbc34a8213
16 changed files with 55 additions and 19 deletions
|
@ -977,6 +977,8 @@ Rails/ThreeStateBooleanColumn:
|
|||
- 'db/migrate/20230314081013_add_group_allow_private_message_to_accounts.rb'
|
||||
- 'db/migrate/20230412005311_add_markdown_to_statuses.rb'
|
||||
- 'db/migrate/20230412073021_add_markdown_to_status_edits.rb'
|
||||
- 'db/migrate/20230428111230_add_emoji_reaction_streaming_to_accounts.rb'
|
||||
- 'db/migrate/20230510004621_remove_stop_emoji_reaction_streaming_from_accounts.rb'
|
||||
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
|
|
|
@ -20,7 +20,7 @@ class Settings::ProfilesController < Settings::BaseController
|
|||
private
|
||||
|
||||
def account_params
|
||||
params.require(:account).permit(:display_name, :note, :avatar, :header, :locked, :my_actor_type, :searchability, :dissubscribable, :stop_emoji_reaction_streaming, :group_allow_private_message, :discoverable, :hide_collections, fields_attributes: [:name, :value])
|
||||
params.require(:account).permit(:display_name, :note, :avatar, :header, :locked, :my_actor_type, :searchability, :dissubscribable, :group_allow_private_message, :discoverable, :hide_collections, fields_attributes: [:name, :value])
|
||||
end
|
||||
|
||||
def set_account
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
# group_allow_private_message :boolean
|
||||
# searchability :integer default("private"), not null
|
||||
# dissubscribable :boolean default(FALSE), not null
|
||||
# stop_emoji_reaction_streaming :boolean default(FALSE)
|
||||
#
|
||||
|
||||
class Account < ApplicationRecord
|
||||
|
|
|
@ -43,6 +43,10 @@ module HasUserSettings
|
|||
settings['send_without_domain_blocks']
|
||||
end
|
||||
|
||||
def setting_stop_emoji_reaction_streaming
|
||||
settings['stop_emoji_reaction_streaming']
|
||||
end
|
||||
|
||||
def setting_unfollow_modal
|
||||
settings['web.unfollow_modal']
|
||||
end
|
||||
|
|
|
@ -20,6 +20,7 @@ class UserSettings
|
|||
setting :reject_public_unlisted_subscription, default: false
|
||||
setting :reject_unlisted_subscription, default: false
|
||||
setting :send_without_domain_blocks, default: false
|
||||
setting :stop_emoji_reaction_streaming, default: false
|
||||
|
||||
namespace :web do
|
||||
setting :crop_images, default: true
|
||||
|
|
|
@ -33,3 +33,7 @@
|
|||
= ff.input :'interactions.must_be_follower', wrapper: :with_label, label: I18n.t('simple_form.labels.interactions.must_be_follower')
|
||||
= ff.input :'interactions.must_be_following', wrapper: :with_label, label: I18n.t('simple_form.labels.interactions.must_be_following')
|
||||
= ff.input :'interactions.must_be_following_dm', wrapper: :with_label, label: I18n.t('simple_form.labels.interactions.must_be_following_dm')
|
||||
|
||||
.fields-group
|
||||
= f.simple_fields_for :settings, current_user.settings do |ff|
|
||||
= ff.input :stop_emoji_reaction_streaming, as: :boolean, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_stop_emoji_reaction_streaming'), hint: I18n.t('simple_form.hints.defaults.setting_stop_emoji_reaction_streaming')
|
||||
|
|
|
@ -41,9 +41,6 @@
|
|||
.fields-group
|
||||
= f.input :dissubscribable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.dissubscribable')
|
||||
|
||||
.fields-group
|
||||
= f.input :stop_emoji_reaction_streaming, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.stop_emoji_reaction_streaming')
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
.fields-row
|
||||
|
|
|
@ -12,12 +12,12 @@ class DeliveryEmojiReactionWorker
|
|||
status = Status.find(status_id.to_i)
|
||||
|
||||
if status.present?
|
||||
scope_status(status).where.not(stop_emoji_reaction_streaming: true).find_each do |account|
|
||||
redis.publish("timeline:#{account.id}", payload_json) if redis.exists?("subscribed:timeline:#{account.id}")
|
||||
scope_status(status).includes(:user).find_each do |account|
|
||||
redis.publish("timeline:#{account.id}", payload_json) if !account.user&.setting_stop_emoji_reaction_streaming && redis.exists?("subscribed:timeline:#{account.id}")
|
||||
end
|
||||
|
||||
if !([:public, :unlisted, :public_unlisted].include?(status.visibility.to_sym)) && status.account_id != my_account_id &&
|
||||
redis.exists?("subscribed:timeline:#{status.account_id}")
|
||||
if [:public, :unlisted, :public_unlisted].exclude?(status.visibility.to_sym) && status.account_id != my_account_id &&
|
||||
redis.exists?("subscribed:timeline:#{status.account_id}")
|
||||
redis.publish("timeline:#{status.account_id}", payload_json)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -226,6 +226,7 @@ en:
|
|||
setting_reject_unlisted_subscription: Reject sending unlisted posts to Misskey, Calckey
|
||||
setting_send_without_domain_blocks: Send your post to all server with administrator set as rejecting-post-server for protect you [DEPRECATED]
|
||||
setting_show_application: Disclose application used to send posts
|
||||
setting_stop_emoji_reaction_streaming: Disable stamp streamings
|
||||
setting_system_font_ui: Use system's default font
|
||||
setting_theme: Site theme
|
||||
setting_trends: Show today's trends
|
||||
|
|
|
@ -65,6 +65,7 @@ ja:
|
|||
setting_public_post_to_unlisted: 未対応のサードパーティアプリからもローカル公開で投稿できますが、公開投稿はWeb以外できなくなります
|
||||
setting_reject_unlisted_subscription: Misskeyやそのフォーク(Calckeyなど)は、フォローしていないアカウントの「未収載」投稿を **購読・検索** することができます。これはkmyblueの挙動と異なります。そのようなサーバーのうち管理人が指定したものに、指定した公開範囲の投稿を「フォロワーのみ」として配送します。ただし構造上、完璧な対応は困難でたまに未収載として配信されること、ご理解ください
|
||||
setting_show_application: 投稿するのに使用したアプリが投稿の詳細ビューに表示されるようになります
|
||||
setting_stop_emoji_reaction_streaming: 通信容量の節約に役立ちます
|
||||
setting_use_blurhash: ぼかしはメディアの色を元に生成されますが、細部は見えにくくなっています
|
||||
setting_use_pending_items: 新着があってもタイムラインを自動的にスクロールしないようにします
|
||||
username: アルファベット大文字と小文字、数字、アンダーバー「_」が使えます
|
||||
|
@ -230,6 +231,7 @@ ja:
|
|||
setting_reject_unlisted_subscription: 管理者の指定したサーバーに「未収載」投稿を「フォロワーのみ」に変換して配送する
|
||||
setting_send_without_domain_blocks: 管理人の設定した配送停止設定を拒否する (非推奨)
|
||||
setting_show_application: 送信したアプリを開示する
|
||||
setting_stop_emoji_reaction_streaming: スタンプのストリーミングを停止する
|
||||
setting_system_font_ui: システムのデフォルトフォントを使う
|
||||
setting_theme: サイトテーマ
|
||||
setting_trends: 本日のトレンドタグを表示する
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMinEmojisToAccountStatusesCleanupPolicies < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :account_statuses_cleanup_policies, :min_emojis, :integer
|
||||
add_column :account_statuses_cleanup_policies, :keep_self_emoji, :boolean, default: true, null: false
|
||||
change_table :account_statuses_cleanup_policies, bulk: true do |t|
|
||||
t.integer :min_emojis
|
||||
t.boolean :keep_self_emoji, default: true, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
class AddDissubscribableToAccounts < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :antennas, :with_media_only, :boolean, null: false, default: false
|
||||
add_index :antennas, :with_media_only
|
||||
add_column :accounts, :dissubscribable, :boolean, null: false, default: false
|
||||
safety_assured do
|
||||
add_column :antennas, :with_media_only, :boolean, null: false, default: false
|
||||
add_index :antennas, :with_media_only
|
||||
add_column :accounts, :dissubscribable, :boolean, null: false, default: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRejectFavouriteToDomainBlocks < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :domain_blocks, :reject_favourite, :boolean, null: false, default: false
|
||||
add_column :domain_blocks, :reject_reply, :boolean, null: false, default: false
|
||||
change_table :domain_blocks, bulk: true do |t|
|
||||
t.boolean :reject_favourite, null: false, default: false
|
||||
t.boolean :reject_reply, null: false, default: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddEmojiReactionStreamingToAccounts < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :accounts, :stop_emoji_reaction_streaming, :boolean, default: false
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveStopEmojiReactionStreamingFromAccounts < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
safety_assured do
|
||||
remove_column :accounts, :stop_emoji_reaction_streaming
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
safety_assured do
|
||||
add_column :accounts, :stop_emoji_reaction_streaming, :boolean, null: true, default: false
|
||||
end
|
||||
end
|
||||
end
|
|
@ -12,7 +12,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2023_05_10_000439) do
|
||||
ActiveRecord::Schema.define(version: 2023_05_10_004621) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -194,7 +194,6 @@ ActiveRecord::Schema.define(version: 2023_05_10_000439) do
|
|||
t.boolean "group_allow_private_message"
|
||||
t.integer "searchability", default: 2, null: false
|
||||
t.boolean "dissubscribable", default: false, null: false
|
||||
t.boolean "stop_emoji_reaction_streaming", default: false
|
||||
t.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin
|
||||
t.index "lower((username)::text), COALESCE(lower((domain)::text), ''::text)", name: "index_accounts_on_username_and_domain_lower", unique: true
|
||||
t.index ["moved_to_account_id"], name: "index_accounts_on_moved_to_account_id", where: "(moved_to_account_id IS NOT NULL)"
|
||||
|
@ -1484,4 +1483,4 @@ ActiveRecord::Schema.define(version: 2023_05_10_000439) do
|
|||
|
||||
end
|
||||
|
||||
# rubocop:enable all
|
||||
#rubocop:enable all
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue