diff --git a/src/components/navigation/right/MemberSidebar.tsx b/src/components/navigation/right/MemberSidebar.tsx index 88e71b95..91531113 100644 --- a/src/components/navigation/right/MemberSidebar.tsx +++ b/src/components/navigation/right/MemberSidebar.tsx @@ -90,29 +90,31 @@ function useEntries( const sort = member?.nickname ?? u.username; const entry = [u, sort] as [User, string]; - if (!u.online || u.status?.presence === "Invisible") { - categories.offline.push(entry); - } else { - if (isServer) { - // Sort users into hoisted roles here. - if (member?.roles && roles) { - let success = false; - for (const role of roleList) { - if (member.roles.includes(role)) { - categories[role].push(entry); - success = true; - break; - } - } - - if (success) return; - } + if (member?.hasPermission(channel, "ViewChannel")) { + if (!u.online || u.status?.presence === "Invisible") { + categories.offline.push(entry); } else { - // Sort users into "participants" list here. - // For voice calls. - } + if (isServer) { + // Sort users into hoisted roles here. + if (member?.roles && roles) { + let success = false; + for (const role of roleList) { + if (member.roles.includes(role)) { + categories[role].push(entry); + success = true; + break; + } + } - categories.online.push(entry); + if (success) return; + } + } else { + // Sort users into "participants" list here. + // For voice calls. + } + + categories.online.push(entry); + } } });