Only include natively supported protocol contacts in meta-groups

This commit is contained in:
Hypolite Petovan 2019-07-16 20:23:19 -04:00
parent 8485874a87
commit 4e427f615b
1 changed files with 11 additions and 2 deletions

View File

@ -8,6 +8,7 @@ use Friendica\BaseModule;
use Friendica\BaseObject;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
@ -332,7 +333,11 @@ class Group extends BaseObject
$key = array_search(self::FOLLOWERS, $group_ids);
if ($key !== false) {
$followersStmt = Contact::select(['id'], ['uid' => $uid, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]]);
$followersStmt = Contact::select(['id'], [
'uid' => $uid,
'rel' => [Contact::FOLLOWER, Contact::FRIEND],
'protocol' => Protocol::NATIVE_SUPPORT,
]);
while($follower = DBA::fetch($followersStmt)) {
$return[] = $follower['id'];
@ -343,7 +348,11 @@ class Group extends BaseObject
$key = array_search(self::MUTUALS, $group_ids);
if ($key !== false) {
$mutualsStmt = Contact::select(['id'], ['uid' => $uid, 'rel' => [Contact::FRIEND]]);
$mutualsStmt = Contact::select(['id'], [
'uid' => $uid,
'rel' => [Contact::FRIEND],
'protocol' => Protocol::NATIVE_SUPPORT,
]);
while($mutual = DBA::fetch($mutualsStmt)) {
$return[] = $mutual['id'];