Lower NTQQ build check from 41679 to 39038
Update NTQQFriendApi to use a lower minimum NTQQ build threshold (39038) when deciding which buddyListV2 API path to call. The change replaces occurrences of '41679' with '39038' in packages/napcat-core/apis/friend.ts (affecting getBuddyV2SimpleInfoMap and the buddyListV2 retrieval logic) to broaden compatibility with older NTQQ builds.
This commit is contained in:
1 parent
c3b29f1ee6
commit
0e0ae213bf
1 file changed
+2
-2
@@ -18,7 +18,7 @@ export class NTQQFriendApi {
|
|||||||
async getBuddyV2SimpleInfoMap () {
|
async getBuddyV2SimpleInfoMap () {
|
||||||
const buddyService = this.context.session.getBuddyService();
|
const buddyService = this.context.session.getBuddyService();
|
||||||
let uids: string[] = [];
|
let uids: string[] = [];
|
||||||
if (this.core.context.basicInfoWrapper.requireMinNTQQBuild('41679')) {
|
if (this.core.context.basicInfoWrapper.requireMinNTQQBuild('39038')) {
|
||||||
const buddyListV2NT = await buddyService.getBuddyListV2('0', true, BuddyListReqType.KNOMAL);
|
const buddyListV2NT = await buddyService.getBuddyListV2('0', true, BuddyListReqType.KNOMAL);
|
||||||
uids = buddyListV2NT.data.flatMap(item => item.buddyUids);
|
uids = buddyListV2NT.data.flatMap(item => item.buddyUids);
|
||||||
} else {
|
} else {
|
||||||
@@ -55,7 +55,7 @@ export class NTQQFriendApi {
|
|||||||
const buddyService = this.context.session.getBuddyService();
|
const buddyService = this.context.session.getBuddyService();
|
||||||
let uids: string[] = [];
|
let uids: string[] = [];
|
||||||
let buddyListV2: Awaited<ReturnType<typeof buddyService.getBuddyListV2>>['data'];
|
let buddyListV2: Awaited<ReturnType<typeof buddyService.getBuddyListV2>>['data'];
|
||||||
if (this.core.context.basicInfoWrapper.requireMinNTQQBuild('41679')) {
|
if (this.core.context.basicInfoWrapper.requireMinNTQQBuild('39038')) {
|
||||||
buddyListV2 = (await buddyService.getBuddyListV2('0', true, BuddyListReqType.KNOMAL)).data;
|
buddyListV2 = (await buddyService.getBuddyListV2('0', true, BuddyListReqType.KNOMAL)).data;
|
||||||
uids = buddyListV2.flatMap(item => item.buddyUids);
|
uids = buddyListV2.flatMap(item => item.buddyUids);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user