Fix member list for sidebar + the feature where only users with viewchannel perms are displayed within the member sidebar

pull/1140/head
Gannicus 2024-04-05 19:52:47 -04:00
parent 69d18fb3cc
commit d9f8603b13
1 changed files with 5 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite";
import { useParams } from "react-router-dom";
import { Channel, Server, User, API } from "revolt.js";
import { useEffect, useLayoutEffect, useState } from "preact/hooks";
import { useEffect, useState } from "preact/hooks";
import {
useSession,
@ -90,7 +90,10 @@ function useEntries(
const sort = member?.nickname ?? u.username;
const entry = [u, sort] as [User, string];
if (member?.hasPermission(channel, "ViewChannel")) {
if (
member?.hasPermission(channel, "ViewChannel") ||
channel.recipient_ids?.includes(u._id)
) {
if (!u.online || u.status?.presence === "Invisible") {
categories.offline.push(entry);
} else {