From ce29624c6df83699a01808d68c19a2492864ffe8 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 12 Sep 2016 18:22:43 +0200 Subject: Fixing image upload limits, allowing webm, merge/unmerge events trigger timeline reload in UI, other small fixes --- app/lib/feed_manager.rb | 6 +++++- app/lib/formatter.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app/lib') diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index 230e0789d..86acd39d9 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -17,7 +17,11 @@ class FeedManager def push(timeline_type, account, status) redis.zadd(key(timeline_type, account.id), status.id, status.id) trim(timeline_type, account.id) - ActionCable.server.broadcast("timeline:#{account.id}", type: 'update', timeline: timeline_type, message: inline_render(account, status)) + broadcast(account.id, type: 'update', timeline: timeline_type, message: inline_render(account, status)) + end + + def broadcast(account_id, options = {}) + ActionCable.server.broadcast("timeline:#{account_id}", options) end def trim(type, account_id) diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index ad0f022a7..959ede95e 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -35,7 +35,7 @@ class Formatter def link_mentions(html, mentions) html.gsub(Account::MENTION_RE) do |match| acct = Account::MENTION_RE.match(match)[1] - mention = mentions.find { |mention| mention.account.acct.eql?(acct) } + mention = mentions.find { |item| item.account.acct.eql?(acct) } mention.nil? ? match : mention_html(match, mention.account) end -- cgit