Only members that have access to a channel should appear on the member sidebar
parent
aed351abd3
commit
69d18fb3cc
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue