Only members that have access to a channel should appear on the member sidebar

pull/1140/head
Gannicus 2024-04-04 15:13:14 -04:00
parent aed351abd3
commit 69d18fb3cc
1 changed files with 23 additions and 21 deletions

View File

@ -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);
}
}
});