From 0a340853090cad4df87d90d3e38e121d90030de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkin=20Alp=20G=C3=BCney?= Date: Sat, 16 Jul 2022 11:23:09 +0300 Subject: [PATCH] Revert "Send offline group in LazyRequest (#778)" (#787) This reverts commit 614cfdc85cfa8903bf7432e770bd4aba41c51b5f. --- gateway/src/opcodes/LazyRequest.ts | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/gateway/src/opcodes/LazyRequest.ts b/gateway/src/opcodes/LazyRequest.ts index 2bff1fd3..2156070f 100644 --- a/gateway/src/opcodes/LazyRequest.ts +++ b/gateway/src/opcodes/LazyRequest.ts @@ -41,9 +41,6 @@ async function getMembers(guild_id: string, range: [number, number]) { .map((m) => m.roles) .flat() .unique((r: Role) => r.id); - member_roles.push(member_roles.splice(member_roles.findIndex(x => x.id == guild_id))[0]); // move @everyone/online to bottom - - const offlineItems = []; for (const role of member_roles) { // @ts-ignore @@ -66,7 +63,7 @@ async function getMembers(guild_id: string, range: [number, number]) { const session = member.user.sessions.first(); // TODO: properly mock/hide offline/invisible status - const item = { + items.push({ member: { ...member, roles, @@ -77,35 +74,16 @@ async function getMembers(guild_id: string, range: [number, number]) { user: { id: member.user.id }, }, }, - } - - if (!member?.user?.sessions || !member.user.sessions.length) { - offlineItems.push(item); - group.count--; - continue; - } - - items.push(item); + }); } members = other_members; } - if (offlineItems.length) { - const group = { - count: offlineItems.length, - id: "offline", - }; - items.push({ group }); - groups.push(group); - - items.push(...offlineItems); - } - return { items, groups, range, - members: items.map((x) => 'member' in x ? x.member : undefined).filter(x => !!x), + members: items.map((x) => x.member).filter((x) => x), }; }