Fix notifications in UI, added new API for fetching account relationships
This commit is contained in:
parent
4bec613897
commit
e46abc71ca
11 changed files with 91 additions and 17 deletions
|
@ -127,6 +127,14 @@ class Account < ApplicationRecord
|
|||
nil
|
||||
end
|
||||
|
||||
def self.following_map(target_account_ids, account_id)
|
||||
Follow.where(target_account_id: target_account_ids).where(account_id: account_id).map { |f| [f.target_account_id, true] }.to_h
|
||||
end
|
||||
|
||||
def self.followed_by_map(target_account_ids, account_id)
|
||||
Follow.where(account_id: target_account_ids).where(target_account_id: account_id).map { |f| [f.account_id, true] }.to_h
|
||||
end
|
||||
|
||||
before_create do
|
||||
if local?
|
||||
keypair = OpenSSL::PKey::RSA.new(Rails.env.test? ? 1024 : 2048)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue