mirror of
https://github.com/friendica/friendica
synced 2025-09-04 20:09:55 +02:00
Add user meta-groups for followers and mutual contacts
- Both Group::expand and Item::enumeratePermissions now have a user id parameter to expand meta-groups
This commit is contained in:
parent
c6a806b9e1
commit
0579252362
7 changed files with 89 additions and 31 deletions
|
@ -6,6 +6,7 @@ use Friendica\App;
|
|||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Model\Group;
|
||||
use Friendica\Model\Item;
|
||||
|
||||
function lockview_content(App $a)
|
||||
|
@ -67,6 +68,19 @@ function lockview_content(App $a)
|
|||
$l = [];
|
||||
|
||||
if (count($allowed_groups)) {
|
||||
$key = array_search(Group::FOLLOWERS, $allowed_groups);
|
||||
if ($key !== false) {
|
||||
$l[] = '<b>' . L10n::t('Followers') . '</b>';
|
||||
unset($allowed_groups[$key]);
|
||||
}
|
||||
|
||||
$key = array_search(Group::MUTUALS, $allowed_groups);
|
||||
if ($key !== false) {
|
||||
$l[] = '<b>' . L10n::t('Mutuals') . '</b>';
|
||||
unset($allowed_groups[$key]);
|
||||
}
|
||||
|
||||
|
||||
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
|
||||
DBA::escape(implode(', ', $allowed_groups))
|
||||
);
|
||||
|
@ -89,6 +103,18 @@ function lockview_content(App $a)
|
|||
}
|
||||
|
||||
if (count($deny_groups)) {
|
||||
$key = array_search(Group::FOLLOWERS, $deny_groups);
|
||||
if ($key !== false) {
|
||||
$l[] = '<b><strike>' . L10n::t('Followers') . '</strike></b>';
|
||||
unset($deny_groups[$key]);
|
||||
}
|
||||
|
||||
$key = array_search(Group::MUTUALS, $deny_groups);
|
||||
if ($key !== false) {
|
||||
$l[] = '<b><strike>' . L10n::t('Mutuals') . '</strike></b>';
|
||||
unset($deny_groups[$key]);
|
||||
}
|
||||
|
||||
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
|
||||
DBA::escape(implode(', ', $deny_groups))
|
||||
);
|
||||
|
|
|
@ -643,7 +643,7 @@ function networkThreadedView(App $a, $update, $parent)
|
|||
// NOTREACHED
|
||||
}
|
||||
|
||||
$contacts = Group::expand([$gid]);
|
||||
$contacts = Group::expand(local_user(), [$gid]);
|
||||
|
||||
if ((is_array($contacts)) && count($contacts)) {
|
||||
$contact_str_self = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue