From: Michael Date: Mon, 2 Dec 2019 23:04:11 +0000 (+0000) Subject: Group selection: Respect "pubmail" and ignore atchived or blocked contacts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fd706cf9a7a0c4700838a1f00b12d8fd37323b7c;p=friendica.git Group selection: Respect "pubmail" and ignore atchived or blocked contacts --- diff --git a/src/Model/Group.php b/src/Model/Group.php index 64b868466a..3be2a80e56 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -328,13 +328,28 @@ class Group extends BaseObject } $return = []; + $pubmail = false; + $networks = Protocol::SUPPORT_PRIVATE; + + $mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', $uid]); + if (DBA::isResult($mailacct)) { + $pubmail = $mailacct['pubmail']; + } + + if (!$pubmail) { + $networks = array_diff($networks, [Protocol::MAIL]); + } $key = array_search(self::FOLLOWERS, $group_ids); if ($key !== false) { $followers = Contact::selectToArray(['id'], [ 'uid' => $uid, 'rel' => [Contact::FOLLOWER, Contact::FRIEND], - 'network' => Protocol::SUPPORT_PRIVATE, + 'network' => $networks, + 'contact-type' => [Contact::TYPE_UNKNOWN, Contact::TYPE_PERSON], + 'archive' => false, + 'pending' => false, + 'blocked' => false, ]); foreach ($followers as $follower) { @@ -349,7 +364,11 @@ class Group extends BaseObject $mutuals = Contact::selectToArray(['id'], [ 'uid' => $uid, 'rel' => [Contact::FRIEND], - 'network' => Protocol::SUPPORT_PRIVATE, + 'network' => $networks, + 'contact-type' => [Contact::TYPE_UNKNOWN, Contact::TYPE_PERSON], + 'archive' => false, + 'pending' => false, + 'blocked' => false, ]); foreach ($mutuals as $mutual) {