Progress on DMs

Progress on DMs
This commit is contained in:
mgabdev
2020-12-19 01:33:33 -05:00
parent 47cd60f851
commit 7ec426e3d8
38 changed files with 447 additions and 197 deletions

View File

@@ -12,6 +12,8 @@ class AccountRelationshipsPresenter
@followed_by = cached[:followed_by].merge(Account.followed_by_map(@uncached_account_ids, @current_account_id))
@blocking = cached[:blocking].merge(Account.blocking_map(@uncached_account_ids, @current_account_id))
@blocked_by = cached[:blocked_by].merge(Account.blocked_by_map(@uncached_account_ids, @current_account_id))
# @chat_blocking = cached[:chat_blocking].merge(Account.chat_blocking_map(@uncached_account_ids, @current_account_id))
# @chat_blocked_by = cached[:chat_blocked_by].merge(Account.chat_blocked_by_map(@uncached_account_ids, @current_account_id))
@muting = cached[:muting].merge(Account.muting_map(@uncached_account_ids, @current_account_id))
@requested = cached[:requested].merge(Account.requested_map(@uncached_account_ids, @current_account_id))
@@ -21,15 +23,14 @@ class AccountRelationshipsPresenter
@followed_by.merge!(options[:followed_by_map] || {})
@blocking.merge!(options[:blocking_map] || {})
@blocked_by.merge!(options[:blocked_by_map] || {})
# @chat_blocking.merge!(options[:chat_blocking_map] || {})
# @chat_blocked_by.merge!(options[:chat_blocked_by_map] || {})
@muting.merge!(options[:muting_map] || {})
@requested.merge!(options[:requested_map] || {})
end
private
# : todo :
# chat muting, chat blocking
def cached
return @cached if defined?(@cached)
@@ -38,6 +39,8 @@ class AccountRelationshipsPresenter
followed_by: {},
blocking: {},
blocked_by: {},
# chat_blocking: {},
# chat_blocked_by: {},
muting: {},
requested: {},
}
@@ -64,6 +67,8 @@ class AccountRelationshipsPresenter
followed_by: { account_id => followed_by[account_id] },
blocking: { account_id => blocking[account_id] },
blocked_by: { account_id => blocked_by[account_id] },
# chat_blocking: { account_id => chat_blocking[account_id] },
# chat_blocked_by: { account_id => chat_blocked_by[account_id] },
muting: { account_id => muting[account_id] },
requested: { account_id => requested[account_id] },
}