- Don't return early if contact isn't part of any group in PermissionSet::get
}
DBA::close($stmt);
+ // Meta-groups
+ $contact = Contact::getById($cid, ['rel']);
+ if ($contact['rel'] == Contact::FOLLOWER || $contact['rel'] == Contact::FRIEND) {
+ $return[] = self::FOLLOWERS;
+ }
+
+ if ($contact['rel'] == Contact::FRIEND) {
+ $return[] = self::MUTUALS;
+ }
+
return $return;
}
$groups = Group::getIdsByContactId($contact_id);
}
- if (empty($groups) || !is_array($groups)) {
- return [];
- }
-
$group_str = '<<>>'; // should be impossible to match
-
- foreach ($groups as $g) {
- $group_str .= '|<' . intval($g) . '>';
+ foreach ($groups as $group_id) {
+ $group_str .= '|<' . preg_quote($group_id) . '>';
}
$contact_str = '<' . $contact_id . '>';