about summary refs log tree commit diff
path: root/app/services/activitypub
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-05-07 19:51:00 +0200
committerGitHub <noreply@github.com>2021-05-07 19:51:00 +0200
commit50f8ee2e07e0a8a0ab8971543cb6544c8d6c5f5d (patch)
tree2d0f4954a3077e3e0bb2d02f671af41b69672e2a /app/services/activitypub
parenta346912030012dc1451249373ff7ef1a61016517 (diff)
parente08b31a70624fe069d2f26bf2078a69e2d48f6aa (diff)
Merge pull request #1526 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/activitypub')
-rw-r--r--app/services/activitypub/fetch_remote_key_service.rb2
-rw-r--r--app/services/activitypub/process_account_service.rb3
2 files changed, 4 insertions, 1 deletions
diff --git a/app/services/activitypub/fetch_remote_key_service.rb b/app/services/activitypub/fetch_remote_key_service.rb
index df17d9079..c48288b3b 100644
--- a/app/services/activitypub/fetch_remote_key_service.rb
+++ b/app/services/activitypub/fetch_remote_key_service.rb
@@ -5,6 +5,8 @@ class ActivityPub::FetchRemoteKeyService < BaseService
 
   # Returns account that owns the key
   def call(uri, id: true, prefetched_body: nil)
+    return if uri.blank?
+
     if prefetched_body.nil?
       if id
         @json = fetch_resource_without_id_validation(uri)
diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb
index 6afeb92d6..bb2e8f665 100644
--- a/app/services/activitypub/process_account_service.rb
+++ b/app/services/activitypub/process_account_service.rb
@@ -87,6 +87,7 @@ class ActivityPub::ProcessAccountService < BaseService
     @account.url                     = url || @uri
     @account.uri                     = @uri
     @account.actor_type              = actor_type
+    @account.created_at              = @json['published'] if @json['published'].present?
   end
 
   def set_immediate_attributes!
@@ -101,7 +102,7 @@ class ActivityPub::ProcessAccountService < BaseService
   end
 
   def set_fetchable_key!
-    @account.public_key        = public_key || ''
+    @account.public_key = public_key || ''
   end
 
   def set_fetchable_attributes!