feat: Add pm
This commit is contained in:
@@ -19,7 +19,8 @@ import {
|
||||
ServerAccessError,
|
||||
kickServerUser,
|
||||
ensureServerMembership,
|
||||
unbanServerUser
|
||||
unbanServerUser,
|
||||
countServerMemberships
|
||||
} from '../services/server-access.service';
|
||||
import {
|
||||
buildAppInviteUrl,
|
||||
@@ -78,6 +79,7 @@ function normalizeServerChannels(value: unknown): ServerChannelPayload[] {
|
||||
|
||||
async function enrichServer(server: ServerPayload, sourceUrl?: string) {
|
||||
const owner = await getUserById(server.ownerId);
|
||||
const userCount = await countServerMemberships(server.id);
|
||||
const { passwordHash, ...publicServer } = server;
|
||||
|
||||
return {
|
||||
@@ -85,7 +87,8 @@ async function enrichServer(server: ServerPayload, sourceUrl?: string) {
|
||||
hasPassword: server.hasPassword ?? !!passwordHash,
|
||||
ownerName: owner?.displayName,
|
||||
sourceUrl,
|
||||
userCount: server.currentUsers
|
||||
currentUsers: userCount,
|
||||
userCount
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user