mirror of
https://github.com/friendica/friendica
synced 2024-11-09 23:02:54 +00:00
Merge pull request #14354 from annando/issue-14121
Issue 14121: Don't display contacts from unavailable networks via API
This commit is contained in:
commit
7801d3efe8
2 changed files with 8 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon\Accounts;
|
namespace Friendica\Module\Api\Mastodon\Accounts;
|
||||||
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Content\Widget;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -75,6 +75,9 @@ class Followers extends BaseApi
|
||||||
$params['order'] = ['pid'];
|
$params['order'] = ['pid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$networks = Widget::unavailableNetworks();
|
||||||
|
$condition = DBA::mergeConditions($condition, array_merge(["NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")"], $networks));
|
||||||
|
|
||||||
$accounts = [];
|
$accounts = [];
|
||||||
|
|
||||||
foreach (Contact::selectAccountToArray(['pid'], $condition, $params) as $follower) {
|
foreach (Contact::selectAccountToArray(['pid'], $condition, $params) as $follower) {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon\Accounts;
|
namespace Friendica\Module\Api\Mastodon\Accounts;
|
||||||
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Content\Widget;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -75,6 +75,9 @@ class Following extends BaseApi
|
||||||
$params['order'] = ['pid'];
|
$params['order'] = ['pid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$networks = Widget::unavailableNetworks();
|
||||||
|
$condition = DBA::mergeConditions($condition, array_merge(["NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")"], $networks));
|
||||||
|
|
||||||
$accounts = [];
|
$accounts = [];
|
||||||
|
|
||||||
foreach (Contact::selectAccountToArray(['pid'], $condition, $params) as $follower) {
|
foreach (Contact::selectAccountToArray(['pid'], $condition, $params) as $follower) {
|
||||||
|
|
Loading…
Reference in a new issue