summary refs log tree commit diff
path: root/src/models/Channel.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-08 00:27:23 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-08 00:27:23 +0200
commitc73cab2d03bb351ca65fdb9b7956307dca566ca2 (patch)
tree0edb48cdf6366834898aed8e9ab3aeb307170d0f /src/models/Channel.ts
parent1.3.40 (diff)
downloadserver-c73cab2d03bb351ca65fdb9b7956307dca566ca2.tar.xz
:lock: fix exposing user in channel.recipients
Diffstat (limited to 'src/models/Channel.ts')
-rw-r--r--src/models/Channel.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/models/Channel.ts b/src/models/Channel.ts

index a77e492d..1dd05896 100644 --- a/src/models/Channel.ts +++ b/src/models/Channel.ts
@@ -1,7 +1,7 @@ import { Schema, model, Types, Document } from "mongoose"; import db from "../util/Database"; import toBigInt from "../util/toBigInt"; -import { UserModel } from "./User"; +import { PublicUserProjection, UserModel } from "./User"; // @ts-ignore export interface AnyChannel extends Channel, DMChannel, TextChannel, VoiceChannel { @@ -42,7 +42,7 @@ ChannelSchema.virtual("recipients", { localField: "recipient_ids", foreignField: "id", justOne: false, - autopopulate: true, + autopopulate: { select: PublicUserProjection }, }); ChannelSchema.set("removeResponse", ["recipient_ids"]);