about summary refs log tree commit diff
path: root/app/services/fan_out_on_write_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-10-07 23:44:58 +0200
committerGitHub <noreply@github.com>2018-10-07 23:44:58 +0200
commit774ac473736cbf348827cf6d861e7fbbb72d7623 (patch)
treec8ce87b43cd8fa58f7124a8a6baf93a71cb274e8 /app/services/fan_out_on_write_service.rb
parent25744d43b0c9ae58227e1e46ac9e2b33a7944925 (diff)
Add conversations API (#8832)
* Add conversations API

* Add web UI for conversations

* Add test for conversations API

* Add tests for ConversationAccount

* Improve web UI

* Rename ConversationAccount to AccountConversation

* Remove conversations on block and mute

* Change last_status_id to be a denormalization of status_ids

* Add optimistic locking
Diffstat (limited to 'app/services/fan_out_on_write_service.rb')
-rw-r--r--app/services/fan_out_on_write_service.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index 5efd3edb2..ab520276b 100644
--- a/app/services/fan_out_on_write_service.rb
+++ b/app/services/fan_out_on_write_service.rb
@@ -13,6 +13,7 @@ class FanOutOnWriteService < BaseService
     if status.direct_visibility?
       deliver_to_mentioned_followers(status)
       deliver_to_direct_timelines(status)
+      deliver_to_own_conversation(status)
     else
       deliver_to_followers(status)
       deliver_to_lists(status)
@@ -99,6 +100,11 @@ class FanOutOnWriteService < BaseService
     status.mentions.includes(:account).each do |mention|
       Redis.current.publish("timeline:direct:#{mention.account.id}", @payload) if mention.account.local?
     end
+
     Redis.current.publish("timeline:direct:#{status.account.id}", @payload) if status.account.local?
   end
+
+  def deliver_to_own_conversation(status)
+    AccountConversation.add_status(status.account, status)
+  end
 end