about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-03-30 12:36:24 +0100
committerThibaut Girka <thib@sitedethib.com>2019-03-30 12:36:24 +0100
commit4444d8f9b3fac33caf3d4732e5f6112c5321d6ea (patch)
treec1fc1d30ed47bdc324fc7acddaaf40bf0a5a28d3 /app/serializers
parentb6fa500806f68d5394174e1f341dc61e3578760e (diff)
parent51625d3423051edb65081a7203bdbe52224d35f3 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/activitypub/actor_serializer.rb24
1 files changed, 22 insertions, 2 deletions
diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb
index 4b982b955..0644219fb 100644
--- a/app/serializers/activitypub/actor_serializer.rb
+++ b/app/serializers/activitypub/actor_serializer.rb
@@ -6,7 +6,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
   context :security
 
   context_extensions :manually_approves_followers, :featured, :also_known_as,
-                     :moved_to, :property_value, :hashtag, :emoji
+                     :moved_to, :property_value, :hashtag, :emoji, :identity_proof
 
   attributes :id, :type, :following, :followers,
              :inbox, :outbox, :featured,
@@ -115,7 +115,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
   end
 
   def virtual_attachments
-    object.fields
+    object.fields + object.identity_proofs.active
   end
 
   def moved_to
@@ -158,4 +158,24 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
       Formatter.instance.format_field(object.account, object.value)
     end
   end
+
+  class AccountIdentityProofSerializer < ActivityPub::Serializer
+    attributes :type, :name, :signature_algorithm, :signature_value
+
+    def type
+      'IdentityProof'
+    end
+
+    def name
+      object.provider_username
+    end
+
+    def signature_algorithm
+      object.provider
+    end
+
+    def signature_value
+      object.token
+    end
+  end
 end