0
0
Fork 0

Adding hashtags

This commit is contained in:
Eugen Rochko 2016-11-05 15:20:05 +01:00
parent 62292797ec
commit 48b9619439
33 changed files with 305 additions and 62 deletions

View file

@ -23,8 +23,8 @@ class FeedManager
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)
def broadcast(timeline_id, options = {})
ActionCable.server.broadcast("timeline:#{timeline_id}", options)
end
def trim(type, account_id)

View file

@ -2,6 +2,7 @@ require 'singleton'
class Formatter
include Singleton
include RoutingHelper
include ActionView::Helpers::TextHelper
include ActionView::Helpers::SanitizeHelper
@ -52,7 +53,7 @@ class Formatter
def hashtag_html(match)
prefix, affix = match.split('#')
"#{prefix}<a href=\"#\" class=\"mention hashtag\">#<span>#{affix}</span></a>"
"#{prefix}<a href=\"#{tag_url(affix.downcase)}\" class=\"mention hashtag\">#<span>#{affix}</span></a>"
end
def mention_html(match, account)