mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: #539
This commit is contained in:
parent
ded53cd348
commit
d4fbbd6711
@ -1,5 +1,5 @@
|
|||||||
import { ChatType, GetFileListParam, Peer, RawMessage, SendMessageElement, SendStatusType } from '@/core/entities';
|
import { ChatType, GetFileListParam, Peer, RawMessage, SendMessageElement, SendStatusType } from '@/core/entities';
|
||||||
import { InstanceContext, NapCatCore } from '@/core';
|
import { GroupFileInfoUpdateItem, InstanceContext, NapCatCore } from '@/core';
|
||||||
import { GeneralCallResult } from '@/core/services/common';
|
import { GeneralCallResult } from '@/core/services/common';
|
||||||
|
|
||||||
export class NTQQMsgApi {
|
export class NTQQMsgApi {
|
||||||
@ -25,9 +25,11 @@ export class NTQQMsgApi {
|
|||||||
async sendShowInputStatusReq(peer: Peer, eventType: number) {
|
async sendShowInputStatusReq(peer: Peer, eventType: number) {
|
||||||
return this.context.session.getMsgService().sendShowInputStatusReq(peer.chatType, eventType, peer.peerUid);
|
return this.context.session.getMsgService().sendShowInputStatusReq(peer.chatType, eventType, peer.peerUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getSourceOfReplyMsgV2(peer: Peer, clientSeq: string, time: string) {
|
async getSourceOfReplyMsgV2(peer: Peer, clientSeq: string, time: string) {
|
||||||
return this.context.session.getMsgService().getSourceOfReplyMsgV2(peer, clientSeq, time);
|
return this.context.session.getMsgService().getSourceOfReplyMsgV2(peer, clientSeq, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMsgEmojiLikesList(peer: Peer, msgSeq: string, emojiId: string, emojiType: string, count: number = 20) {
|
async getMsgEmojiLikesList(peer: Peer, msgSeq: string, emojiId: string, emojiType: string, count: number = 20) {
|
||||||
//注意此处emojiType 可选值一般为1-2 2好像是unicode表情dec值 大部分情况 Taged Mlikiowa
|
//注意此处emojiType 可选值一般为1-2 2好像是unicode表情dec值 大部分情况 Taged Mlikiowa
|
||||||
return this.context.session.getMsgService().getMsgEmojiLikesList(peer, msgSeq, emojiId, emojiType, '', false, count);
|
return this.context.session.getMsgService().getMsgEmojiLikesList(peer, msgSeq, emojiId, emojiType, '', false, count);
|
||||||
@ -136,19 +138,29 @@ export class NTQQMsgApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getGroupFileList(GroupCode: string, params: GetFileListParam) {
|
async getGroupFileList(GroupCode: string, params: GetFileListParam) {
|
||||||
const [, groupFileListResult] = await this.core.eventWrapper.callNormalEventV2(
|
const item: GroupFileInfoUpdateItem[] = [];
|
||||||
'NodeIKernelRichMediaService/getGroupFileList',
|
let index = params.startIndex;
|
||||||
'NodeIKernelMsgListener/onGroupFileInfoUpdate',
|
while (true) {
|
||||||
[
|
params.startIndex = index;
|
||||||
GroupCode,
|
const [, groupFileListResult] = await this.core.eventWrapper.callNormalEventV2(
|
||||||
params,
|
'NodeIKernelRichMediaService/getGroupFileList',
|
||||||
],
|
'NodeIKernelMsgListener/onGroupFileInfoUpdate',
|
||||||
() => true,
|
[
|
||||||
() => true, // 应当通过 groupFileListResult 判断
|
GroupCode,
|
||||||
1,
|
params,
|
||||||
5000,
|
],
|
||||||
);
|
() => true,
|
||||||
return groupFileListResult.item;
|
() => true, // 应当通过 groupFileListResult 判断
|
||||||
|
1,
|
||||||
|
5000,
|
||||||
|
);
|
||||||
|
if (!groupFileListResult?.item?.length) break;
|
||||||
|
item.push(...groupFileListResult.item);
|
||||||
|
if (groupFileListResult.isEnd) break;
|
||||||
|
if (item.length === params.fileCount) break;
|
||||||
|
index = groupFileListResult.nextIndex;
|
||||||
|
}
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMsgHistory(peer: Peer, msgId: string, count: number, isReverseOrder: boolean = false) {
|
async getMsgHistory(peer: Peer, msgId: string, count: number, isReverseOrder: boolean = false) {
|
||||||
|
@ -29,50 +29,10 @@ export interface GroupFileInfoUpdateParamType {
|
|||||||
retMsg: string;
|
retMsg: string;
|
||||||
clientWording: string;
|
clientWording: string;
|
||||||
isEnd: boolean;
|
isEnd: boolean;
|
||||||
item: Array<{
|
item: Array<GroupFileInfoUpdateItem>;
|
||||||
peerId: string;
|
allFileCount: number;
|
||||||
type: number;
|
nextIndex: number;
|
||||||
folderInfo?: {
|
reqId: number;
|
||||||
folderId: string;
|
|
||||||
parentFolderId: string;
|
|
||||||
folderName: string;
|
|
||||||
createTime: number;
|
|
||||||
modifyTime: number;
|
|
||||||
createUin: string;
|
|
||||||
creatorName: string;
|
|
||||||
totalFileCount: number;
|
|
||||||
modifyUin: string;
|
|
||||||
modifyName: string;
|
|
||||||
usedSpace: string;
|
|
||||||
},
|
|
||||||
fileInfo?: {
|
|
||||||
fileModelId: string;
|
|
||||||
fileId: string;
|
|
||||||
fileName: string;
|
|
||||||
fileSize: string;
|
|
||||||
busId: number;
|
|
||||||
uploadedSize: string;
|
|
||||||
uploadTime: number;
|
|
||||||
deadTime: number;
|
|
||||||
modifyTime: number;
|
|
||||||
downloadTimes: number;
|
|
||||||
sha: string;
|
|
||||||
sha3: string;
|
|
||||||
md5: string;
|
|
||||||
uploaderLocalPath: string;
|
|
||||||
uploaderName: string;
|
|
||||||
uploaderUin: string;
|
|
||||||
parentFolderId: string;
|
|
||||||
localPath: string;
|
|
||||||
transStatus: number;
|
|
||||||
transType: number;
|
|
||||||
elementId: string;
|
|
||||||
isFolder: boolean;
|
|
||||||
},
|
|
||||||
}>;
|
|
||||||
allFileCount: string;
|
|
||||||
nextIndex: string;
|
|
||||||
reqId: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// {
|
// {
|
||||||
@ -83,6 +43,49 @@ export interface GroupFileInfoUpdateParamType {
|
|||||||
// fromNick: '拾xxxx,
|
// fromNick: '拾xxxx,
|
||||||
// sig: '0x'
|
// sig: '0x'
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
export interface GroupFileInfoUpdateItem {
|
||||||
|
peerId: string;
|
||||||
|
type: number;
|
||||||
|
folderInfo?: {
|
||||||
|
folderId: string;
|
||||||
|
parentFolderId: string;
|
||||||
|
folderName: string;
|
||||||
|
createTime: number;
|
||||||
|
modifyTime: number;
|
||||||
|
createUin: string;
|
||||||
|
creatorName: string;
|
||||||
|
totalFileCount: number;
|
||||||
|
modifyUin: string;
|
||||||
|
modifyName: string;
|
||||||
|
usedSpace: string;
|
||||||
|
},
|
||||||
|
fileInfo?: {
|
||||||
|
fileModelId: string;
|
||||||
|
fileId: string;
|
||||||
|
fileName: string;
|
||||||
|
fileSize: string;
|
||||||
|
busId: number;
|
||||||
|
uploadedSize: string;
|
||||||
|
uploadTime: number;
|
||||||
|
deadTime: number;
|
||||||
|
modifyTime: number;
|
||||||
|
downloadTimes: number;
|
||||||
|
sha: string;
|
||||||
|
sha3: string;
|
||||||
|
md5: string;
|
||||||
|
uploaderLocalPath: string;
|
||||||
|
uploaderName: string;
|
||||||
|
uploaderUin: string;
|
||||||
|
parentFolderId: string;
|
||||||
|
localPath: string;
|
||||||
|
transStatus: number;
|
||||||
|
transType: number;
|
||||||
|
elementId: string;
|
||||||
|
isFolder: boolean;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
export interface TempOnRecvParams {
|
export interface TempOnRecvParams {
|
||||||
sessionType: number,//1
|
sessionType: number,//1
|
||||||
chatType: ChatType,//100
|
chatType: ChatType,//100
|
||||||
|
Loading…
x
Reference in New Issue
Block a user