🐛 fix member sidebar
This commit is contained in:
parent
e434334a21
commit
2c5959874e
@ -30,7 +30,7 @@ export class Server {
|
|||||||
|
|
||||||
async setupSchema() {
|
async setupSchema() {
|
||||||
// TODO: adjust expireAfterSeconds -> lower
|
// TODO: adjust expireAfterSeconds -> lower
|
||||||
await db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 });
|
await Promise.all([db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 })]);
|
||||||
}
|
}
|
||||||
|
|
||||||
async listen(): Promise<void> {
|
async listen(): Promise<void> {
|
||||||
|
@ -14,6 +14,7 @@ import { Send } from "../util/Send";
|
|||||||
import WebSocket from "../util/WebSocket";
|
import WebSocket from "../util/WebSocket";
|
||||||
import { check } from "./instanceOf";
|
import { check } from "./instanceOf";
|
||||||
|
|
||||||
|
// TODO: check permission and only show roles/members that have access to this channel
|
||||||
// TODO: config: if want to list all members (even those who are offline) sorted by role, or just those who are online
|
// TODO: config: if want to list all members (even those who are offline) sorted by role, or just those who are online
|
||||||
|
|
||||||
export async function onLazyRequest(this: WebSocket, { d }: Payload) {
|
export async function onLazyRequest(this: WebSocket, { d }: Payload) {
|
||||||
@ -41,7 +42,7 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) {
|
|||||||
let: { id: "$id" },
|
let: { id: "$id" },
|
||||||
pipeline: [
|
pipeline: [
|
||||||
{ $match: { $expr: { $in: ["$$id", "$roles"] } } },
|
{ $match: { $expr: { $in: ["$$id", "$roles"] } } },
|
||||||
{ $limit: 1 },
|
{ $limit: 100 },
|
||||||
{
|
{
|
||||||
$lookup: {
|
$lookup: {
|
||||||
from: "users",
|
from: "users",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user