about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorAnthony Bellew <anthonyreflected@gmail.com>2017-01-25 20:53:57 -0700
committerGitHub <noreply@github.com>2017-01-25 20:53:57 -0700
commit3d890c407356c8e0e7dd9b64e8e232ededcff8e8 (patch)
treea22df9a8737250f97a6024943af3445a163917b3 /app/helpers
parentfebe2449bb14f3d877fb934ceb6d52e320712bac (diff)
parent905c82917959a5afe24cb85c62c0b0ba13f0da8b (diff)
Merge pull request #3 from tootsuite/master
Updating to current
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/atom_builder_helper.rb13
-rw-r--r--app/helpers/home_helper.rb2
-rw-r--r--app/helpers/settings_helper.rb4
-rw-r--r--app/helpers/stream_entries_helper.rb8
4 files changed, 19 insertions, 8 deletions
diff --git a/app/helpers/atom_builder_helper.rb b/app/helpers/atom_builder_helper.rb
index 036a72166..c08d80ea0 100644
--- a/app/helpers/atom_builder_helper.rb
+++ b/app/helpers/atom_builder_helper.rb
@@ -41,7 +41,8 @@ module AtomBuilderHelper
     xml['activity'].send('verb', TagManager::VERBS[verb])
   end
 
-  def content(xml, content)
+  def content(xml, content, warning = nil)
+    xml.summary(warning) unless warning.blank?
     xml.content({ type: 'html' }, content) unless content.blank?
   end
 
@@ -153,12 +154,20 @@ module AtomBuilderHelper
     portable_contact xml, account
   end
 
+  def rich_content(xml, activity)
+    if activity.is_a?(Status)
+      content xml, conditionally_formatted(activity), activity.spoiler_text
+    else
+      content xml, conditionally_formatted(activity)
+    end
+  end
+
   def include_entry(xml, stream_entry)
     unique_id      xml, stream_entry.created_at, stream_entry.activity_id, stream_entry.activity_type
     published_at   xml, stream_entry.created_at
     updated_at     xml, stream_entry.updated_at
     title          xml, stream_entry.title
-    content        xml, conditionally_formatted(stream_entry.activity)
+    rich_content   xml, stream_entry.activity
     verb           xml, stream_entry.verb
     link_self      xml, account_stream_entry_url(stream_entry.account, stream_entry, format: 'atom')
     link_alternate xml, account_stream_entry_url(stream_entry.account, stream_entry)
diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb
index 6f87c7b72..d3c6b13a6 100644
--- a/app/helpers/home_helper.rb
+++ b/app/helpers/home_helper.rb
@@ -3,8 +3,6 @@
 module HomeHelper
   def default_props
     {
-      token: @token,
-      account: render(file: 'api/v1/accounts/show', locals: { account: current_user.account }, formats: :json),
       locale: I18n.locale,
     }
   end
diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
index fa569e73a..aed8770c8 100644
--- a/app/helpers/settings_helper.rb
+++ b/app/helpers/settings_helper.rb
@@ -14,4 +14,8 @@ module SettingsHelper
   def human_locale(locale)
     HUMAN_LOCALES[locale]
   end
+
+  def hash_to_object(hash)
+    HashObject.new(hash)
+  end
 end
diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb
index ae2f575b5..15601a079 100644
--- a/app/helpers/stream_entries_helper.rb
+++ b/app/helpers/stream_entries_helper.rb
@@ -15,10 +15,10 @@ module StreamEntriesHelper
 
   def entry_classes(status, is_predecessor, is_successor, include_threads)
     classes = ['entry']
-    classes << 'entry-reblog' if status.reblog?
-    classes << 'entry-predecessor' if is_predecessor
-    classes << 'entry-successor' if is_successor
-    classes << 'entry-center' if include_threads
+    classes << 'entry-reblog u-repost-of h-cite' if status.reblog?
+    classes << 'entry-predecessor u-in-reply-to h-cite' if is_predecessor
+    classes << 'entry-successor u-comment h-cite' if is_successor
+    classes << 'entry-center h-entry' if include_threads
     classes.join(' ')
   end