From 9d55529318a285ced484b9216df9064914d6f790 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 21 Mar 2016 17:02:16 +0100 Subject: Fix text color in dashboard inputs, sanitize remote status content in UI, simplify FanOutOnWriteService, add /api/accounts/lookup method --- app/helpers/api/accounts/lookup_helper.rb | 2 ++ app/helpers/stream_entries_helper.rb | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 app/helpers/api/accounts/lookup_helper.rb (limited to 'app/helpers') diff --git a/app/helpers/api/accounts/lookup_helper.rb b/app/helpers/api/accounts/lookup_helper.rb new file mode 100644 index 000000000..5caf0e28c --- /dev/null +++ b/app/helpers/api/accounts/lookup_helper.rb @@ -0,0 +1,2 @@ +module Api::Accounts::LookupHelper +end diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb index b044e8a61..28fc41ed5 100644 --- a/app/helpers/stream_entries_helper.rb +++ b/app/helpers/stream_entries_helper.rb @@ -27,4 +27,12 @@ module StreamEntriesHelper def favourited_by_me_class(status) user_signed_in? && current_user.account.favourited?(status) ? 'favourited' : '' end + + def content_for_status(actual_status) + if actual_status.local? + linkify(actual_status) + else + sanitize(actual_status.content, tags: %w(a br p), attributes: %w(href rel)) + end + end end -- cgit