Fix searchability=4 error
This commit is contained in:
parent
399606a55c
commit
e726982065
3 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ class Account < ApplicationRecord
|
|||
|
||||
enum protocol: { ostatus: 0, activitypub: 1 }
|
||||
enum suspension_origin: { local: 0, remote: 1 }, _prefix: true
|
||||
enum searchability: { public: 0, unlisted: 1, private: 2, direct: 3, limited: 4, public_unlisted: 10 }, _suffix: :searchability
|
||||
enum searchability: { public: 0, private: 1, direct: 2, limited: 3, unsupported: 4, public_unlisted: 10 }, _suffix: :searchability
|
||||
|
||||
validates :username, presence: true
|
||||
validates_with UniqueUsernameValidator, if: -> { will_save_change_to_username? }
|
||||
|
|
|
@ -388,7 +388,7 @@ class Status < ApplicationRecord
|
|||
# searchability || Status.searchabilities.invert.fetch([Account.searchabilities[account.searchability], Status.visibilities[visibility] || 0].max, nil) || 'direct'
|
||||
# Reactions only (generic: direct)
|
||||
return searchability if searchability
|
||||
return account.searchability if account.local? && account.searchability
|
||||
return account.searchability if account.local? && account.searchability && !account.unsupported_searchability?
|
||||
|
||||
'direct'
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
|||
include FormattingHelper
|
||||
|
||||
attributes :id, :username, :acct, :display_name, :locked, :bot, :discoverable, :group, :created_at,
|
||||
:note, :url, :avatar, :avatar_static, :header, :header_static, :searchability, :subscribable,
|
||||
:note, :url, :avatar, :avatar_static, :header, :header_static, :subscribable,
|
||||
:followers_count, :following_count, :statuses_count, :last_status_at, :other_settings,
|
||||
:noindex
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue