about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/feed_manager.rb1
-rw-r--r--app/lib/formatter.rb3
2 files changed, 3 insertions, 1 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index 028fc5218..7069026e3 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -30,6 +30,7 @@ class FeedManager
   end
 
   def broadcast(timeline_id, options = {})
+    options[:queued_at] = (Time.now.to_f * 1000.0).to_i
     ActionCable.server.broadcast("timeline:#{timeline_id}", options)
   end
 
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index ff2a16f1b..044407a6c 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -68,8 +68,9 @@ class Formatter
     prefix = url.match(/\Ahttps?:\/\/(www\.)?/).to_s
     text   = url[prefix.length, 30]
     suffix = url[prefix.length + 30..-1]
+    cutoff = url[prefix.length..-1].length > 30
 
-    "<a rel=\"nofollow noopener\" target=\"_blank\" href=\"#{url}\"><span class=\"invisible\">#{prefix}</span><span class=\"ellipsis\">#{text}</span><span class=\"invisible\">#{suffix}</span></a>"
+    "<a rel=\"nofollow noopener\" target=\"_blank\" href=\"#{url}\"><span class=\"invisible\">#{prefix}</span><span class=\"#{cutoff ? 'ellipsis' : ''}\">#{text}</span><span class=\"invisible\">#{suffix}</span></a>"
   end
 
   def hashtag_html(match)