From 4088cdde5b52e5e3f267fb37311f5310406cf9d1 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Wed, 13 Sep 2017 17:36:20 +0100 Subject: [PATCH 1/3] Make AS data more general --- app/Services/ActivityStreamsService.php | 8 ++++---- config/user.php | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 config/user.php diff --git a/app/Services/ActivityStreamsService.php b/app/Services/ActivityStreamsService.php index 6d948ea0..0a40ae61 100644 --- a/app/Services/ActivityStreamsService.php +++ b/app/Services/ActivityStreamsService.php @@ -12,8 +12,8 @@ class ActivityStreamsService '@context' => 'https://www.w3.org/ns/activitystreams', 'id' => config('app.url'), 'type' => 'Person', - 'name' => config('app.display_name'), - 'preferredUsername' => 'jonnybarnes', + 'name' => config('user.displayname'), + 'preferredUsername' => config('user.username'), ]); return response($data)->header('Content-Type', 'application/activity+json'); @@ -23,7 +23,7 @@ class ActivityStreamsService { $data = json_encode([ '@context' => 'https://www.w3.org/ns/activitystreams', - 'summary' => 'Jonny added a note to his microblog', + 'summary' => strtok(config('user.displayname'), ' ') . ' added a note to his microblog', 'type' => 'Add', 'published' => $note->updated_at->toW3cString(), 'actor' => [ @@ -33,7 +33,7 @@ class ActivityStreamsService 'url' => config('app.url'), 'image' => [ 'type' => 'Link', - 'href' => config('app.url') . '/assets/img/jmb-bw.jpg', + 'href' => config('app.url') . '/assets/img/profile.jpg', 'mediaType' => '/image/jpeg', ], ], diff --git a/config/user.php b/config/user.php new file mode 100644 index 00000000..89a7502e --- /dev/null +++ b/config/user.php @@ -0,0 +1,7 @@ + env('DISPLAY_NAME'), + + 'username' => env('USER_NAME'), +]; From 9ace4100bca31e5ff9ad390e67ec41b5d9a22a56 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Wed, 13 Sep 2017 17:36:48 +0100 Subject: [PATCH 2/3] better pronoun --- app/Services/ActivityStreamsService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/ActivityStreamsService.php b/app/Services/ActivityStreamsService.php index 0a40ae61..51806ebd 100644 --- a/app/Services/ActivityStreamsService.php +++ b/app/Services/ActivityStreamsService.php @@ -23,7 +23,7 @@ class ActivityStreamsService { $data = json_encode([ '@context' => 'https://www.w3.org/ns/activitystreams', - 'summary' => strtok(config('user.displayname'), ' ') . ' added a note to his microblog', + 'summary' => strtok(config('user.displayname'), ' ') . ' added a note to their microblog', 'type' => 'Add', 'published' => $note->updated_at->toW3cString(), 'actor' => [ From d6e30206c0ec3fe5952b4c96b0f604f26dfd0c59 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Wed, 13 Sep 2017 17:49:41 +0100 Subject: [PATCH 3/3] Bump version number to 0.7.2 --- changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog.md b/changelog.md index d631dbdb..4c35cb98 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # Changelog +## Version 0.7.2 (2017-09-13) + - Small AS2.0 improvements + ## Version 0.7.1 (2017-09-13) - Add content-negotiated AS data for homepage and single notes