finally fixed contact list
This commit is contained in:
parent
b4860943a5
commit
b209104fdd
10 changed files with 40 additions and 22 deletions
|
@ -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.0
|
||||
**Stable tag:** 0.4.0
|
||||
**Tested up to:** 5.1
|
||||
**Stable tag:** 0.4.1
|
||||
**Requires PHP:** 5.6
|
||||
**License:** MIT
|
||||
**License URI:** http://opensource.org/licenses/MIT
|
||||
|
@ -55,6 +55,10 @@ To implement:
|
|||
|
||||
Project maintained on github at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub).
|
||||
|
||||
### 0.4.1 ###
|
||||
|
||||
* finally fixed contact list
|
||||
|
||||
### 0.4.0 ###
|
||||
|
||||
* added settings to enable/disable hashtag support
|
||||
|
|
|
@ -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.4.0
|
||||
* Version: 0.4.1
|
||||
* Author: Matthias Pfefferle
|
||||
* Author URI: https://notiz.blog/
|
||||
* License: MIT
|
||||
|
|
0
bin/deploy.sh
Normal file → Executable file
0
bin/deploy.sh
Normal file → Executable file
0
bin/install-wp-tests.sh
Normal file → Executable file
0
bin/install-wp-tests.sh
Normal file → Executable file
|
@ -6,6 +6,9 @@
|
|||
"php": ">=5.3.0",
|
||||
"composer/installers": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.5"
|
||||
},
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
|
|
|
@ -9,20 +9,15 @@ class Db_Activitypub_Followers {
|
|||
return $followers;
|
||||
}
|
||||
|
||||
if ( count( $array ) == count( $array, COUNT_RECURSIVE ) ) {
|
||||
return $followers;
|
||||
}
|
||||
|
||||
foreach ( $followers as $key => $follower ) {
|
||||
if (
|
||||
is_array( $follower ) &&
|
||||
isset( $follower['type'] ) &&
|
||||
'Person' === $follower['type'] &&
|
||||
isset( $follower['id'] ) &&
|
||||
true === filter_var( $follower['id'], FILTER_VALIDATE_URL )
|
||||
false !== filter_var( $follower['id'], FILTER_VALIDATE_URL )
|
||||
) {
|
||||
unset( $followers[$key] );
|
||||
$followers[] = $follower['id'];
|
||||
$followers[$key] = $follower['id'];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +33,7 @@ class Db_Activitypub_Followers {
|
|||
isset( $actor['type'] ) &&
|
||||
'Person' === $actor['type'] &&
|
||||
isset( $actor['id'] ) &&
|
||||
true === filter_var( $actor['id'], FILTER_VALIDATE_URL )
|
||||
false !== filter_var( $actor['id'], FILTER_VALIDATE_URL )
|
||||
) {
|
||||
$actor = $actor['id'];
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
# This file is distributed under the MIT.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: ActivityPub 0.4.0\n"
|
||||
"Project-Id-Version: ActivityPub 0.4.1\n"
|
||||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/activitypub\n"
|
||||
"POT-Creation-Date: 2019-02-17 20:46:19+00:00\n"
|
||||
"POT-Creation-Date: 2019-02-19 13:29:42+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
@ -66,7 +66,7 @@ msgstr ""
|
|||
msgid "Fediverse"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class-db-activitypub-followers.php:46
|
||||
#: includes/class-db-activitypub-followers.php:41
|
||||
msgid "Unknown Actor schema"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -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.0
|
||||
Stable tag: 0.4.0
|
||||
Tested up to: 5.1
|
||||
Stable tag: 0.4.1
|
||||
Requires PHP: 5.6
|
||||
License: MIT
|
||||
License URI: http://opensource.org/licenses/MIT
|
||||
|
@ -55,6 +55,10 @@ To implement:
|
|||
|
||||
Project maintained on github at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub).
|
||||
|
||||
= 0.4.1 =
|
||||
|
||||
* finally fixed contact list
|
||||
|
||||
= 0.4.0 =
|
||||
|
||||
* added settings to enable/disable hashtag support
|
||||
|
|
18
tests/test-class-db-activitypub-followers.php
Normal file
18
tests/test-class-db-activitypub-followers.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
class Test_Db_Activitypub_Followers extends WP_UnitTestCase {
|
||||
public function test_get_followers() {
|
||||
$followers = array( 'https://example.com/author/jon', 'https://example.org/author/doe' );
|
||||
$followers[] = array(
|
||||
'type' => 'Person',
|
||||
'id' => 'http://sally.example.org',
|
||||
'name' => 'Sally Smith',
|
||||
);
|
||||
update_user_meta( 1, 'activitypub_followers', $followers );
|
||||
|
||||
$db_followers = Db_Activitypub_Followers::get_followers( 1 );
|
||||
|
||||
$this->assertEquals( 3, count( $db_followers ) );
|
||||
|
||||
$this->assertSame( array( 'https://example.com/author/jon', 'https://example.org/author/doe', 'http://sally.example.org' ), $db_followers );
|
||||
}
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
class Test extends WP_UnitTestCase {
|
||||
public function test() {
|
||||
$this->assertTrue( true );
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue