about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-09-02 14:01:23 +0200
committerGitHub <noreply@github.com>2017-09-02 14:01:23 +0200
commit1b5806b74475213ae45b483d08a29daa40988f84 (patch)
tree7969ae4b382b7a02511d415a5fc0bbfd5c1c046c /app/services
parent1b1e025b41e9ad83e76208f8a6c8f7044fde68b7 (diff)
Define missing JSON-LD properties (#4767)
Using _: property names is discouraged, as in the future,
canonicalization may throw an error when encountering that instead
of discarding it silently like it does now.

We are defining some ActivityStreams properties which we expect
to land in ActivityStreams eventually, to ensure that future versions
of Mastodon will remain compatible with this even once that happens.
Those would be `locked`, `sensitive` and `Hashtag`

We are defining a custom context inline for some properties which we
do not expect to land in any other context. `atomUri`, `inReplyToAtomUri`
and `conversation` are part of the custom defined OStatus context.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/activitypub/fetch_remote_status_service.rb4
-rw-r--r--app/services/activitypub/process_account_service.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/services/activitypub/fetch_remote_status_service.rb b/app/services/activitypub/fetch_remote_status_service.rb
index c114515cd..68ca58d62 100644
--- a/app/services/activitypub/fetch_remote_status_service.rb
+++ b/app/services/activitypub/fetch_remote_status_service.rb
@@ -25,8 +25,8 @@ class ActivityPub::FetchRemoteStatusService < BaseService
   def activity_json
     if %w(Note Article).include? @json['type']
       {
-        'type' => 'Create',
-        'actor' => first_of_value(@json['attributedTo']),
+        'type'   => 'Create',
+        'actor'  => first_of_value(@json['attributedTo']),
         'object' => @json,
       }
     else
diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb
index 99f9dbdc2..44798d051 100644
--- a/app/services/activitypub/process_account_service.rb
+++ b/app/services/activitypub/process_account_service.rb
@@ -50,7 +50,7 @@ class ActivityPub::ProcessAccountService < BaseService
     @account.avatar_remote_url   = image_url('icon')
     @account.header_remote_url   = image_url('image')
     @account.public_key          = public_key || ''
-    @account.locked              = @json['_:locked'] || false
+    @account.locked              = @json['locked'] || false
     @account.save!
   end