This commit is contained in:
idranme
2024-10-13 23:42:01 +08:00
parent d43612b2a3
commit dbd71d4376
3 changed files with 6 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ export class NTQQFriendApi extends Service {
return Object.values(data.userSimpleInfos).filter(v => uids.includes(v.uid!)) return Object.values(data.userSimpleInfos).filter(v => uids.includes(v.uid!))
} }
/** uid => uin */ /** uid -> uin */
async getBuddyIdMap(refresh = false): Promise<Map<string, string>> { async getBuddyIdMap(refresh = false): Promise<Map<string, string>> {
const retMap: Map<string, string> = new Map() const retMap: Map<string, string> = new Map()
const data = await invoke<{ const data = await invoke<{

View File

@@ -52,7 +52,7 @@ export class NTQQMsgApi extends Service {
} }
async getMsgHistory(peer: Peer, msgId: string, cnt: number, queryOrder = false) { async getMsgHistory(peer: Peer, msgId: string, cnt: number, queryOrder = false) {
// 默认情况下消息时间从旧到 // 默认情况下消息时间从新到旧
return await invoke(NTMethod.HISTORY_MSG, [{ peer, msgId, cnt, queryOrder }]) return await invoke(NTMethod.HISTORY_MSG, [{ peer, msgId, cnt, queryOrder }])
} }
@@ -93,7 +93,7 @@ export class NTQQMsgApi extends Service {
const uniqueId = await this.generateMsgUniqueId(destPeer.chatType) const uniqueId = await this.generateMsgUniqueId(destPeer.chatType)
destPeer.guildId = uniqueId destPeer.guildId = uniqueId
const data = await invoke<{ msgList: RawMessage[] }>( const data = await invoke<{ msgList: RawMessage[] }>(
'nodeIKernelMsgService/forwardMsg', 'nodeIKernelMsgService/forwardMsgWithComment',
[{ [{
msgIds, msgIds,
srcContact: srcPeer, srcContact: srcPeer,
@@ -111,7 +111,8 @@ export class NTQQMsgApi extends Service {
} }
} }
return false return false
} },
timeout: 3000
} }
) )
delete destPeer.guildId delete destPeer.guildId

View File

@@ -178,7 +178,7 @@ export class NTQQUserApi extends Service {
if (uin) return uin if (uin) return uin
uin = (await invoke('nodeIKernelUixConvertService/getUin', [{ uids: [uid] }])).uinInfo.get(uid) uin = (await invoke('nodeIKernelUixConvertService/getUin', [{ uids: [uid] }])).uinInfo.get(uid)
if (uin) return uin if (uin) return uin
uin = (await this.ctx.ntFriendApi.getBuddyIdMap(true)).get(uid) uin = (await this.ctx.ntFriendApi.getBuddyIdMap()).get(uid)
if (uin) return uin if (uin) return uin
uin = (await this.getUserDetailInfo(uid)).uin uin = (await this.getUserDetailInfo(uid)).uin
return uin return uin