mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 02:05:28 +00:00
Only members that have access to a channel should appear on the member sidebar
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user