about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-24 13:34:51 +0200
committerThibaut Girka <thib@sitedethib.com>2018-08-24 15:10:34 +0200
commit246c313d457397f412f9fb5eed3ee02cf5d9a561 (patch)
tree4c8d12cc031476870a918bec3b3000f899101a32 /app/serializers
parent0ddf439999b05b5dfd6d5a5257327fa7d3565e65 (diff)
parenta2cabf3f4af9271d8bfdb13c1ae2b7a8b4e6fb88 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
	app/controllers/application_controller.rb

Changed instance theme selection by instance flavour selection.
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/activitypub/actor_serializer.rb4
-rw-r--r--app/serializers/web/notification_serializer.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb
index 41c9aa44e..5054bd683 100644
--- a/app/serializers/activitypub/actor_serializer.rb
+++ b/app/serializers/activitypub/actor_serializer.rb
@@ -93,11 +93,11 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
   end
 
   def avatar_exists?
-    object.avatar.exists?
+    object.avatar?
   end
 
   def header_exists?
-    object.header.exists?
+    object.header?
   end
 
   def manually_approves_followers
diff --git a/app/serializers/web/notification_serializer.rb b/app/serializers/web/notification_serializer.rb
index 43ba4d92a..ee83ec8b2 100644
--- a/app/serializers/web/notification_serializer.rb
+++ b/app/serializers/web/notification_serializer.rb
@@ -33,7 +33,7 @@ class Web::NotificationSerializer < ActiveModel::Serializer
   end
 
   def body
-    str = truncate(strip_tags(object.target_status&.spoiler_text&.presence || object.target_status&.text || object.from_account.note), length: 140)
-    HTMLEntities.new.decode(str.to_str) # Do not encode entities, since this value will not be used in HTML
+    str = strip_tags(object.target_status&.spoiler_text&.presence || object.target_status&.text || object.from_account.note)
+    truncate(HTMLEntities.new.decode(str.to_str), length: 140) # Do not encode entities, since this value will not be used in HTML
   end
 end