|
|
|
|
@ -98,19 +98,19 @@ class GroupsSearchController extends Controller
|
|
|
|
|
->take(10)
|
|
|
|
|
->get()
|
|
|
|
|
->filter(function ($p) use ($group) {
|
|
|
|
|
return $group->isMember($p->profile_id) == false;
|
|
|
|
|
return $group->isMember($p->id) == false;
|
|
|
|
|
})
|
|
|
|
|
->filter(function ($p) use ($group, $pid) {
|
|
|
|
|
return GroupInvitation::whereGroupId($group->id)
|
|
|
|
|
->whereFromProfileId($pid)
|
|
|
|
|
->whereToProfileId($p->profile_id)
|
|
|
|
|
->whereToProfileId($p->id)
|
|
|
|
|
->exists() == false;
|
|
|
|
|
})
|
|
|
|
|
->map(function ($gm) use ($gid) {
|
|
|
|
|
$a = AccountService::get($gm->profile_id);
|
|
|
|
|
$a = AccountService::get($gm->id);
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
'id' => (string) $gm->profile_id,
|
|
|
|
|
'id' => (string) $gm->id,
|
|
|
|
|
'username' => $a['acct'],
|
|
|
|
|
'url' => url("/groups/{$gid}/user/{$a['id']}?rf=group_search"),
|
|
|
|
|
];
|
|
|
|
|
@ -132,7 +132,6 @@ class GroupsSearchController extends Controller
|
|
|
|
|
if (str_starts_with($q, 'https://')) {
|
|
|
|
|
$res = Helpers::getSignedFetch($q);
|
|
|
|
|
if ($res && $res = json_decode($res, true)) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if ($res && isset($res['type']) && in_array($res['type'], ['Group', 'Note', 'Page'])) {
|
|
|
|
|
if ($res['type'] === 'Group') {
|
|
|
|
|
|