about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-12 18:22:43 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-12 18:22:43 +0200
commitce29624c6df83699a01808d68c19a2492864ffe8 (patch)
tree822f151d24ab6c04f20b0926f6290621c476e032 /app/lib
parent3d566279cb84aba6d07eaadebda6c059f2a58657 (diff)
Fixing image upload limits, allowing webm, merge/unmerge events trigger
timeline reload in UI, other small fixes
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/feed_manager.rb6
-rw-r--r--app/lib/formatter.rb2
2 files changed, 6 insertions, 2 deletions
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