diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-09 19:16:27 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-09 19:16:27 +0100 |
commit | c5e03a2e0d7eac132a5d62d1d7d523a6969697cc (patch) | |
tree | 64beb72b535d9375653e01af7cfd7e9da428421f /app/channels/application_cable | |
parent | 448ab18a201c902b4e7a1aa468c352c20d034989 (diff) |
Status removal is broadcast to public/hashtag timelines too
Diffstat (limited to 'app/channels/application_cable')
-rw-r--r-- | app/channels/application_cable/channel.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb index d27b058fb..43adadbd9 100644 --- a/app/channels/application_cable/channel.rb +++ b/app/channels/application_cable/channel.rb @@ -4,14 +4,17 @@ module ApplicationCable def hydrate_status(encoded_message) message = ActiveSupport::JSON.decode(encoded_message) - status = Status.find_by(id: message['id']) + + return [nil, message] if message['type'] == 'delete' + + status = Status.find_by(id: message['id']) message['message'] = FeedManager.instance.inline_render(current_user.account, status) [status, message] end def filter?(status) - status.nil? || current_user.account.blocking?(status.account) || (status.reblog? && current_user.account.blocking?(status.reblog.account)) + !status.nil? && (current_user.account.blocking?(status.account) || (status.reblog? && current_user.account.blocking?(status.reblog.account))) end end end |