Bot nameplates (#7391)
* Store actor type in database * Add bot nameplate to web UI, add setting to preferences, API, AP Fix #7365 * Fix code style issues
This commit is contained in:
parent
0f0cc3f2eb
commit
42cd363542
15 changed files with 48 additions and 6 deletions
|
@ -45,6 +45,7 @@
|
|||
# moved_to_account_id :bigint(8)
|
||||
# featured_collection_url :string
|
||||
# fields :jsonb
|
||||
# actor_type :string
|
||||
#
|
||||
|
||||
class Account < ApplicationRecord
|
||||
|
@ -149,6 +150,16 @@ class Account < ApplicationRecord
|
|||
moved_to_account_id.present?
|
||||
end
|
||||
|
||||
def bot?
|
||||
%w(Application Service).include? actor_type
|
||||
end
|
||||
|
||||
alias bot bot?
|
||||
|
||||
def bot=(val)
|
||||
self.actor_type = ActiveModel::Type::Boolean.new.cast(val) ? 'Service' : 'Person'
|
||||
end
|
||||
|
||||
def acct
|
||||
local? ? username : "#{username}@#{domain}"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue