Do not send mails to disabled group members (#1751)
This commit is contained in:
Родитель
c0ac030ab1
Коммит
1135e9dbef
|
@ -57,8 +57,13 @@ class Group extends UserGroupClass {
|
|||
$members = [];
|
||||
|
||||
foreach (array_keys(self::getContainer()->query(IGroupManager::class)->displayNamesInGroup($this->id)) as $member) {
|
||||
$members[] = new User($member);
|
||||
$newMember = new User($member);
|
||||
|
||||
if ($newMember->IsEnabled()) {
|
||||
$members[] = $newMember;
|
||||
}
|
||||
}
|
||||
|
||||
return $members;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ class User extends UserGroupClass {
|
|||
$this->language = \OC::$server->getConfig()->getUserValue($this->id, 'core', 'lang');
|
||||
}
|
||||
|
||||
public function getUserIsDisabled(): bool {
|
||||
public function isEnabled(): bool {
|
||||
return $this->user->isEnabled();
|
||||
}
|
||||
|
||||
|
|
|
@ -191,19 +191,19 @@ class UserGroupClass implements \JsonSerializable {
|
|||
|
||||
[$result, $more] = self::getContainer()->query(ISearch::class)->search($query, $types, false, 200, 0);
|
||||
|
||||
foreach ($result['users'] as $item) {
|
||||
foreach (($result['users'] ?? []) as $item) {
|
||||
$items[] = new User($item['value']['shareWith']);
|
||||
}
|
||||
|
||||
foreach ($result['exact']['users'] as $item) {
|
||||
foreach (($result['exact']['users'] ?? []) as $item) {
|
||||
$items[] = new User($item['value']['shareWith']);
|
||||
}
|
||||
|
||||
foreach ($result['groups'] as $item) {
|
||||
foreach (($result['groups'] ?? []) as $item) {
|
||||
$items[] = new Group($item['value']['shareWith']);
|
||||
}
|
||||
|
||||
foreach ($result['exact']['groups'] as $item) {
|
||||
foreach (($result['exact']['groups'] ?? []) as $item) {
|
||||
$items[] = new Group($item['value']['shareWith']);
|
||||
}
|
||||
|
||||
|
@ -211,10 +211,10 @@ class UserGroupClass implements \JsonSerializable {
|
|||
$items = array_merge($items, ContactGroup::search($query));
|
||||
|
||||
if (Circle::isEnabled()) {
|
||||
foreach ($result['circles'] as $item) {
|
||||
foreach (($result['circles'] ?? []) as $item) {
|
||||
$items[] = new Circle($item['value']['shareWith']);
|
||||
}
|
||||
foreach ($result['exact']['circles'] as $item) {
|
||||
foreach (($result['exact']['circles'] ?? []) as $item) {
|
||||
$items[] = new Circle($item['value']['shareWith']);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче