mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
optimize
This commit is contained in:
parent
828b20e0e8
commit
f0d8c851d4
@ -19,7 +19,7 @@ declare module 'cordis' {
|
||||
export class NTQQGroupApi extends Service {
|
||||
static inject = ['ntWindowApi']
|
||||
|
||||
private groupMembers: Map<string, Map<string, GroupMember>> = new Map<string, Map<string, GroupMember>>()
|
||||
public groupMembers: Map<string, Map<string, GroupMember>> = new Map<string, Map<string, GroupMember>>()
|
||||
|
||||
constructor(protected ctx: Context) {
|
||||
super(ctx, 'ntGroupApi', true)
|
||||
|
@ -3,7 +3,7 @@ import { User, UserDetailInfoByUin, UserDetailInfoByUinV2, UserDetailInfoListene
|
||||
import { getBuildVersion } from '@/common/utils'
|
||||
import { getSession } from '@/ntqqapi/wrapper'
|
||||
import { RequestUtil } from '@/common/utils/request'
|
||||
import { NodeIKernelProfileService, UserDetailSource, ProfileBizType, forceFetchClientKeyRetType } from '../services'
|
||||
import { NodeIKernelProfileService, UserDetailSource, ProfileBizType } from '../services'
|
||||
import { NodeIKernelProfileListener } from '../listeners'
|
||||
import { NTEventDispatch } from '@/common/utils/eventTask'
|
||||
import { Time } from 'cosmokit'
|
||||
@ -17,7 +17,7 @@ declare module 'cordis' {
|
||||
}
|
||||
|
||||
export class NTQQUserApi extends Service {
|
||||
static inject = ['ntFriendApi']
|
||||
static inject = ['ntFriendApi', 'ntGroupApi']
|
||||
|
||||
constructor(protected ctx: Context) {
|
||||
super(ctx, 'ntUserApi', true)
|
||||
@ -191,6 +191,17 @@ export class NTQQUserApi extends Service {
|
||||
const session = getSession()
|
||||
// 通用转换开始尝试
|
||||
let uid = (await session?.getUixConvertService().getUid([uin]))?.uidInfo.get(uin)
|
||||
if (!uid) {
|
||||
for (const membersList of this.ctx.ntGroupApi.groupMembers.values()) { //从群友列表转
|
||||
for (const member of membersList.values()) {
|
||||
if (member.uin === uin) {
|
||||
uid = member.uid
|
||||
break
|
||||
}
|
||||
}
|
||||
if (uid) break
|
||||
}
|
||||
}
|
||||
if (!uid) {
|
||||
let unveifyUid = (await this.getUserDetailInfoByUin(uin)).info.uid //从QQ Native 特殊转换 方法三
|
||||
if (unveifyUid.indexOf('*') == -1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user