core: add PRIV_SEND_MESSAGE

This commit is contained in:
undefined committed 2021-05-28 22:52:12 +08:00
1 parent be2b1c5524
commit 01d6d48c74
5 files changed
+12 -3

No files matched your search

+1
View File
@@ -372,6 +372,7 @@ class HomeMessagesHandler extends Handler {
@param('uid', Types.Int)
@param('content', Types.Content)
async postSend(domainId: string, uid: number, content: string) {
this.checkPriv(PRIV.PRIV_SEND_MESSAGE);
const udoc = await user.getById('system', uid);
if (!udoc) throw new UserNotFoundError(uid);
if (udoc.avatar) udoc.avatarUrl = avatar(udoc.avatar);