Skip to content

Commit

Permalink
fixes JSON representation of posts
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle committed Apr 13, 2019
1 parent 8d91b21 commit 8b1367a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
**Donate link:** https://notiz.blog/donate/
**Tags:** OStatus, fediverse, activitypub, activitystream
**Requires at least:** 4.7
**Tested up to:** 5.1.1
**Stable tag:** 0.7.1
**Tested up to:** 5.2
**Stable tag:** 0.7.2
**Requires PHP:** 5.6
**License:** MIT
**License URI:** http://opensource.org/licenses/MIT
Expand Down Expand Up @@ -62,6 +62,10 @@ To implement:

Project maintained on github at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub).

### 0.7.2 ###

* fixes JSON representation of posts https://merveilles.town/@xuv/101907542498716956

### 0.7.1 ###

* fixed inbox problems with pleroma
Expand Down
2 changes: 1 addition & 1 deletion activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: ActivityPub
* Plugin URI: https://github.com/pfefferle/wordpress-activitypub/
* Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.
* Version: 0.7.1
* Version: 0.7.2
* Author: Matthias Pfefferle
* Author URI: https://notiz.blog/
* License: MIT
Expand Down
6 changes: 3 additions & 3 deletions languages/activitypub.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is distributed under the MIT.
msgid ""
msgstr ""
"Project-Id-Version: ActivityPub 0.7.1\n"
"Project-Id-Version: ActivityPub 0.7.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/activitypub\n"
"POT-Creation-Date: 2019-03-14 22:10:06+00:00\n"
"POT-Creation-Date: 2019-04-13 18:07:11+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -106,7 +106,7 @@ msgstr ""

#: includes/rest/class-followers.php:46 includes/rest/class-followers.php:49
#: includes/rest/class-following.php:46 includes/rest/class-following.php:49
#: includes/rest/class-outbox.php:47 includes/rest/class-outbox.php:50
#: includes/rest/class-outbox.php:45 includes/rest/class-outbox.php:48
#: includes/rest/class-webfinger.php:61
msgid "User not found"
msgstr ""
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: pfefferle
Donate link: https://notiz.blog/donate/
Tags: OStatus, fediverse, activitypub, activitystream
Requires at least: 4.7
Tested up to: 5.1.1
Stable tag: 0.7.1
Tested up to: 5.2
Stable tag: 0.7.2
Requires PHP: 5.6
License: MIT
License URI: http://opensource.org/licenses/MIT
Expand Down Expand Up @@ -62,6 +62,10 @@ To implement:

Project maintained on github at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub).

= 0.7.2 =

* fixes JSON representation of posts https://merveilles.town/@xuv/101907542498716956

= 0.7.1 =

* fixed inbox problems with pleroma
Expand Down
5 changes: 2 additions & 3 deletions templates/json-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
$post = get_post();

$activitypub_post = new \Activitypub\Post( $post );
$activitypub_activity = new \Activitypub\Activity( 'Create', \Activitypub\Activity::TYPE_FULL );
$activitypub_activity->from_post( $activitypub_post->to_array() );
$json = array_merge( array( '@context' => \Activitypub\get_context() ), $activitypub_post->to_array() );

// filter output
$json = apply_filters( 'activitypub_json_post_array', $activitypub_activity->to_array() );
$json = apply_filters( 'activitypub_json_post_array', $json );

/*
* Action triggerd prior to the ActivityPub profile being created and sent to the client
Expand Down

0 comments on commit 8b1367a

Please sign in to comment.