Skip to content

Commit b209104

Browse files
committed
finally fixed contact list
1 parent b486094 commit b209104

File tree

10 files changed

+40
-22
lines changed

10 files changed

+40
-22
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
**Donate link:** https://notiz.blog/donate/
44
**Tags:** OStatus, fediverse, activitypub, activitystream
55
**Requires at least:** 4.7
6-
**Tested up to:** 5.1.0
7-
**Stable tag:** 0.4.0
6+
**Tested up to:** 5.1
7+
**Stable tag:** 0.4.1
88
**Requires PHP:** 5.6
99
**License:** MIT
1010
**License URI:** http://opensource.org/licenses/MIT
@@ -55,6 +55,10 @@ To implement:
5555

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

58+
### 0.4.1 ###
59+
60+
* finally fixed contact list
61+
5862
### 0.4.0 ###
5963

6064
* added settings to enable/disable hashtag support

activitypub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: ActivityPub
44
* Plugin URI: https://github.com/pfefferle/wordpress-activitypub/
55
* Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.
6-
* Version: 0.4.0
6+
* Version: 0.4.1
77
* Author: Matthias Pfefferle
88
* Author URI: https://notiz.blog/
99
* License: MIT

bin/deploy.sh

100644100755
File mode changed.

bin/install-wp-tests.sh

100644100755
File mode changed.

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"php": ">=5.3.0",
77
"composer/installers": "~1.0"
88
},
9+
"require-dev": {
10+
"phpunit/phpunit": "^5.5"
11+
},
912
"license": "MIT",
1013
"authors": [
1114
{

includes/class-db-activitypub-followers.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,15 @@ public static function get_followers( $author_id ) {
99
return $followers;
1010
}
1111

12-
if ( count( $array ) == count( $array, COUNT_RECURSIVE ) ) {
13-
return $followers;
14-
}
15-
1612
foreach ( $followers as $key => $follower ) {
1713
if (
1814
is_array( $follower ) &&
1915
isset( $follower['type'] ) &&
2016
'Person' === $follower['type'] &&
2117
isset( $follower['id'] ) &&
22-
true === filter_var( $follower['id'], FILTER_VALIDATE_URL )
18+
false !== filter_var( $follower['id'], FILTER_VALIDATE_URL )
2319
) {
24-
unset( $followers[$key] );
25-
$followers[] = $follower['id'];
20+
$followers[$key] = $follower['id'];
2621
}
2722
}
2823

@@ -38,7 +33,7 @@ public static function add_follower( $actor, $author_id ) {
3833
isset( $actor['type'] ) &&
3934
'Person' === $actor['type'] &&
4035
isset( $actor['id'] ) &&
41-
true === filter_var( $actor['id'], FILTER_VALIDATE_URL )
36+
false !== filter_var( $actor['id'], FILTER_VALIDATE_URL )
4237
) {
4338
$actor = $actor['id'];
4439
}

languages/activitypub.pot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the MIT.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: ActivityPub 0.4.0\n"
5+
"Project-Id-Version: ActivityPub 0.4.1\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/activitypub\n"
7-
"POT-Creation-Date: 2019-02-17 20:46:19+00:00\n"
7+
"POT-Creation-Date: 2019-02-19 13:29:42+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -66,7 +66,7 @@ msgstr ""
6666
msgid "Fediverse"
6767
msgstr ""
6868

69-
#: includes/class-db-activitypub-followers.php:46
69+
#: includes/class-db-activitypub-followers.php:41
7070
msgid "Unknown Actor schema"
7171
msgstr ""
7272

readme.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Contributors: pfefferle
33
Donate link: https://notiz.blog/donate/
44
Tags: OStatus, fediverse, activitypub, activitystream
55
Requires at least: 4.7
6-
Tested up to: 5.1.0
7-
Stable tag: 0.4.0
6+
Tested up to: 5.1
7+
Stable tag: 0.4.1
88
Requires PHP: 5.6
99
License: MIT
1010
License URI: http://opensource.org/licenses/MIT
@@ -55,6 +55,10 @@ To implement:
5555

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

58+
= 0.4.1 =
59+
60+
* finally fixed contact list
61+
5862
= 0.4.0 =
5963

6064
* added settings to enable/disable hashtag support
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
class Test_Db_Activitypub_Followers extends WP_UnitTestCase {
3+
public function test_get_followers() {
4+
$followers = array( 'https://example.com/author/jon', 'https://example.org/author/doe' );
5+
$followers[] = array(
6+
'type' => 'Person',
7+
'id' => 'http://sally.example.org',
8+
'name' => 'Sally Smith',
9+
);
10+
update_user_meta( 1, 'activitypub_followers', $followers );
11+
12+
$db_followers = Db_Activitypub_Followers::get_followers( 1 );
13+
14+
$this->assertEquals( 3, count( $db_followers ) );
15+
16+
$this->assertSame( array( 'https://example.com/author/jon', 'https://example.org/author/doe', 'http://sally.example.org' ), $db_followers );
17+
}
18+
}

tests/test.php

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)