diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-07-21 01:44:16 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:44:01 -0500 |
commit | 263ead73616dba43a0337c2a3edaf96a6382d533 (patch) | |
tree | ca47a9366dbbdf95018c55bde32b59d6b05c8299 /app/presenters | |
parent | 21de9efc2d89ce8dbb9edb997f8a3b99f831d05a (diff) |
[Feature] Add post and thread (un)hiding to backend
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/status_relationships_presenter.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/presenters/status_relationships_presenter.rb b/app/presenters/status_relationships_presenter.rb index 3cc905a75..260ea48fe 100644 --- a/app/presenters/status_relationships_presenter.rb +++ b/app/presenters/status_relationships_presenter.rb @@ -4,6 +4,8 @@ class StatusRelationshipsPresenter attr_reader :reblogs_map, :favourites_map, :mutes_map, :pins_map, :bookmarks_map + attr_reader :hidden_conversations_map, :hidden_statuses_map + def initialize(statuses, current_account_id = nil, **options) if current_account_id.nil? @reblogs_map = {} @@ -11,6 +13,9 @@ class StatusRelationshipsPresenter @bookmarks_map = {} @mutes_map = {} @pins_map = {} + + @hidden_conversations_map = {} + @hidden_statuses_map = {} else statuses = statuses.compact status_ids = statuses.flat_map { |s| [s.id, s.reblog_of_id] }.uniq.compact @@ -22,6 +27,9 @@ class StatusRelationshipsPresenter @bookmarks_map = Status.bookmarks_map(status_ids, current_account_id).merge(options[:bookmarks_map] || {}) @mutes_map = Status.mutes_map(conversation_ids, current_account_id).merge(options[:mutes_map] || {}) @pins_map = Status.pins_map(pinnable_status_ids, current_account_id).merge(options[:pins_map] || {}) + + @hidden_conversations_map = Status.hidden_conversations_map(conversation_ids, current_account_id).merge(options[:hidden_conversations_map] || {}) + @hidden_statuses_map = Status.hidden_statuses_map(status_ids, current_account_id).merge(options[:hidden_statuses_map] || {}) end end end |