mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: revert get_friends_with_category return type
This commit is contained in:
parent
b58a194c8a
commit
8f6d26b65c
@ -54,21 +54,21 @@ export class NTQQFriendApi {
|
|||||||
uids.push(
|
uids.push(
|
||||||
...buddyListV2.flatMap(item => {
|
...buddyListV2.flatMap(item => {
|
||||||
item.buddyUids.forEach(uid => {
|
item.buddyUids.forEach(uid => {
|
||||||
categoryMap.set(uid, { categoryId: item.categoryId, categroyName: item.categroyName });
|
categoryMap.set(uid, { categoryId: item.categoryId, categoryName: item.categroyName });
|
||||||
});
|
});
|
||||||
return item.buddyUids;
|
return item.buddyUids;
|
||||||
}));
|
}));
|
||||||
const data = await this.core.eventWrapper.callNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
const data = await this.core.eventWrapper.callNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
||||||
'NodeIKernelProfileService/getCoreAndBaseInfo', 5000, 'nodeStore', uids,
|
'NodeIKernelProfileService/getCoreAndBaseInfo', 5000, 'nodeStore', uids,
|
||||||
);
|
);
|
||||||
return Array.from(data).map(([key, value]) => {
|
return buddyListV2.map(category => ({
|
||||||
const category = categoryMap.get(key);
|
categoryId: category.categoryId,
|
||||||
return category ? {
|
categorySortId: category.categorySortId,
|
||||||
...value,
|
categoryName: category.categroyName,
|
||||||
categoryId: category.categoryId,
|
categoryMbCount: category.categroyMbCount,
|
||||||
categroyName: category.categroyName,
|
onlineCount: category.onlineCount,
|
||||||
} : value;
|
buddyList: category.buddyUids.map(uid => data.get(uid)!).filter(value => value),
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
async isBuddy(uid: string) {
|
async isBuddy(uid: string) {
|
||||||
|
@ -176,10 +176,7 @@ export interface SimpleInfo {
|
|||||||
intimate: any | null;
|
intimate: any | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FriendV2 extends SimpleInfo {
|
export type FriendV2 = SimpleInfo;
|
||||||
categoryId?: number;
|
|
||||||
categroyName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SelfStatusInfo {
|
export interface SelfStatusInfo {
|
||||||
uid: string;
|
uid: string;
|
||||||
|
@ -8,7 +8,10 @@ export class GetFriendWithCategory extends BaseAction<void, any> {
|
|||||||
async _handle(payload: void) {
|
async _handle(payload: void) {
|
||||||
if (this.CoreContext.context.basicInfoWrapper.requireMinNTQQBuild('26702')) {
|
if (this.CoreContext.context.basicInfoWrapper.requireMinNTQQBuild('26702')) {
|
||||||
//全新逻辑
|
//全新逻辑
|
||||||
return OB11Constructor.friendsV2(await this.CoreContext.apis.FriendApi.getBuddyV2ExWithCate(true));
|
return (await this.CoreContext.apis.FriendApi.getBuddyV2ExWithCate(true)).map(category => ({
|
||||||
|
...category,
|
||||||
|
buddyList: OB11Constructor.friendsV2(category.buddyList),
|
||||||
|
}));
|
||||||
} else {
|
} else {
|
||||||
throw new Error('this ntqq version not support, must be 26702 or later');
|
throw new Error('this ntqq version not support, must be 26702 or later');
|
||||||
}
|
}
|
||||||
|
@ -656,8 +656,6 @@ export class OB11Constructor {
|
|||||||
remark: friend.coreInfo.nick,
|
remark: friend.coreInfo.nick,
|
||||||
sex: sexValue,
|
sex: sexValue,
|
||||||
level: 0,
|
level: 0,
|
||||||
categroyName: friend.categroyName,
|
|
||||||
categoryId: friend.categoryId,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
|
@ -7,7 +7,7 @@ export interface OB11User {
|
|||||||
age?: number;
|
age?: number;
|
||||||
qid?: string;
|
qid?: string;
|
||||||
login_days?: number;
|
login_days?: number;
|
||||||
categroyName?: string;
|
categoryName?: string;
|
||||||
categoryId?: number;
|
categoryId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user