refactor: MsgId
This commit is contained in:
1 parent
2ed01773b7
commit
5f7874af8f
18 files changed
+90
-104
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { NTQQMsgApi } from '@/core/apis';
|
||||
import { ActionName } from '../types';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { dbUtil } from '@/common/utils/db';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
@@ -23,9 +23,9 @@ class DeleteMsg extends BaseAction<Payload, void> {
|
||||
actionName = ActionName.DeleteMsg;
|
||||
PayloadSchema = SchemaData;
|
||||
protected async _handle(payload: Payload) {
|
||||
const msg = await dbUtil.getMsgByShortId(Number(payload.message_id));
|
||||
const msg = await MessageUnique.getMsgIdAndPeerByShortId(Number(payload.message_id));
|
||||
if (msg) {
|
||||
await NTQQMsgApi.recallMsg({ peerUid: msg.peerUid, chatType: msg.chatType }, [msg.msgId]);
|
||||
await NTQQMsgApi.recallMsg(msg.Peer, [msg.MsgId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user