fix: buddylist

This commit is contained in:
手瓜一十雪 2025-11-07 19:29:39 +08:00
parent 202338a160
commit a000ffdf0d
2 changed files with 75 additions and 58 deletions

View File

@ -17,8 +17,14 @@ export class NTQQFriendApi {
async getBuddyV2SimpleInfoMap () { async getBuddyV2SimpleInfoMap () {
const buddyService = this.context.session.getBuddyService(); const buddyService = this.context.session.getBuddyService();
let uids: string[] = [];
if (this.core.context.basicInfoWrapper.requireMinNTQQBuild('40990')) {
const buddyListV2NT = await buddyService.getBuddyListV2('0', true, BuddyListReqType.KNOMAL);
uids = buddyListV2NT.data.flatMap(item => item.buddyUids);
} else {
const buddyListV2 = await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL); const buddyListV2 = await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL);
const uids = buddyListV2.data.flatMap(item => item.buddyUids); uids = buddyListV2.data.flatMap(item => item.buddyUids);
}
return await this.core.eventWrapper.callNoListenerEvent( return await this.core.eventWrapper.callNoListenerEvent(
'NodeIKernelProfileService/getCoreAndBaseInfo', 'NodeIKernelProfileService/getCoreAndBaseInfo',
'nodeStore', 'nodeStore',

View File

@ -10,9 +10,20 @@ export interface NodeIKernelBuddyService {
categroyName: string, categroyName: string,
categroyMbCount: number, categroyMbCount: number,
onlineCount: number, onlineCount: number,
buddyUids: Array<string> buddyUids: Array<string>;
}>
}>; }>;
}>;
getBuddyListV2 (callFrom: string, isPullRefresh: boolean, reqType: BuddyListReqType): Promise<GeneralCallResult & {
data: Array<{
categoryId: number,
categorySortId: number,
categroyName: string,
categroyMbCount: number,
onlineCount: number,
buddyUids: Array<string>;
}>;
}>;
getBuddyListFromCache (reqType: BuddyListReqType): Promise<Array< getBuddyListFromCache (reqType: BuddyListReqType): Promise<Array<
{ {
@ -21,7 +32,7 @@ export interface NodeIKernelBuddyService {
categroyName: string, // 分类名 categroyName: string, // 分类名
categroyMbCount: number, // 不懂 categroyMbCount: number, // 不懂
onlineCount: number, // 在线数目 onlineCount: number, // 在线数目
buddyUids: Array<string>// Uids buddyUids: Array<string>;// Uids
}>>; }>>;
addKernelBuddyListener (listener: NodeIKernelBuddyListener): number; addKernelBuddyListener (listener: NodeIKernelBuddyListener): number;
@ -36,7 +47,7 @@ export interface NodeIKernelBuddyService {
getBuddyRemark (uid: number): string; getBuddyRemark (uid: number): string;
setBuddyRemark(param: { uid: string, remark: string, signInfo?: unknown }): void; setBuddyRemark (param: { uid: string, remark: string, signInfo?: unknown; }): void;
getAvatarUrl (uid: number): string; getAvatarUrl (uid: number): string;
@ -118,7 +129,7 @@ export interface NodeIKernelBuddyService {
reportDoubtBuddyReqUnread (): void; reportDoubtBuddyReqUnread (): void;
getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise<GeneralCallResult & { arkMsg: string }>; getBuddyRecommendContactArkJson (uid: string, phoneNumber: string): Promise<GeneralCallResult & { arkMsg: string; }>;
isNull (): boolean; isNull (): boolean;
} }