fix: report first temp msg

This commit is contained in:
linyuchen
2024-03-31 21:45:17 +08:00
parent 655225e027
commit 0c59371ed1
5 changed files with 87 additions and 33 deletions

View File

@@ -27,17 +27,27 @@ export class NTQQMsgApi {
})
}
static async activateGroupChat(groupCode: string) {
static async activateChat(peer: Peer) {
// await this.fetchRecentContact();
// await sleep(500);
return await callNTQQApi<GeneralCallResult>({
methodName: NTQQApiMethod.ADD_ACTIVE_CHAT,
args: [{peer:{peerUid: groupCode, chatType: ChatType.group}, cnt: 20}, null]
methodName: NTQQApiMethod.ACTIVE_CHAT_PREVIEW,
args: [{peer, cnt: 20}, null]
})
}
static async activateChatAndGetHistory(peer: Peer) {
// await this.fetchRecentContact();
// await sleep(500);
return await callNTQQApi<GeneralCallResult>({
methodName: NTQQApiMethod.ACTIVE_CHAT_HISTORY,
// 参数似乎不是这样
args: [{peer, cnt: 20}, null]
})
}
static async getMsgHistory(peer: Peer, msgId: string, count: number) {
// 消息时间从旧到新
return await callNTQQApi<GeneralCallResult & {msgList: RawMessage[]}>({
methodName: isQQ998 ? NTQQApiMethod.HISTORY_MSG_998 : NTQQApiMethod.HISTORY_MSG,
methodName: isQQ998 ? NTQQApiMethod.ACTIVE_CHAT_HISTORY : NTQQApiMethod.HISTORY_MSG,
args: [{
peer,
msgId,