From d645e264ff51ff4c20cd31c9a3ecd100ad3495aa Mon Sep 17 00:00:00 2001 From: Il Harper Date: Fri, 23 Aug 2024 12:07:30 +0800 Subject: [PATCH] feat(event): adapt `onProfileDetailInfoChanged` payload --- .../src/definitions/profileService.ts | 10 +++ packages/engine-chronocat-api/src/handler.ts | 7 +- .../engine-chronocat-event/src/handler.ts | 7 +- packages/red/src/redEntity.ts | 85 +++++++++++++++++-- packages/red/src/redIpcEntity.ts | 3 + 5 files changed, 102 insertions(+), 10 deletions(-) diff --git a/packages/engine-chronocat-api/src/definitions/profileService.ts b/packages/engine-chronocat-api/src/definitions/profileService.ts index 9745720..e06e08b 100644 --- a/packages/engine-chronocat-api/src/definitions/profileService.ts +++ b/packages/engine-chronocat-api/src/definitions/profileService.ts @@ -9,3 +9,13 @@ export const getUserSimpleInfo = define< }, ] >('ns-ntApi-2', 'nodeIKernelProfileService/getUserSimpleInfo') + +export const getUserDetailInfoWithBizInfo = define< + unknown, + [ + { + uid: string + keys: [0] + }, + ] +>('ns-ntApi-2', 'nodeIKernelProfileService/getUserDetailInfoWithBizInfo') diff --git a/packages/engine-chronocat-api/src/handler.ts b/packages/engine-chronocat-api/src/handler.ts index 0b699ee..1930ac8 100644 --- a/packages/engine-chronocat-api/src/handler.ts +++ b/packages/engine-chronocat-api/src/handler.ts @@ -155,13 +155,16 @@ const responseDispatcher = async ( case 'nodeIKernelGroupService/getNextMemberList': { // const authData = await ctx.chronocat.getAuthData() - const { profiles, infos } = payload as OnProfileChanged + const { profiles, infos, info } = payload as OnProfileChanged // if (profiles.get(authData.uid)) // selfProfile.value = profiles.get(authData.uid) + if (info) ctx.chronocat.uix.add(info.uid, info.uin) + const profile = profiles ?? infos - for (const [uid, { uin }] of profile) ctx.chronocat.uix.add(uid, uin) + if (profile) + for (const [uid, { uin }] of profile) ctx.chronocat.uix.add(uid, uin) return } diff --git a/packages/engine-chronocat-event/src/handler.ts b/packages/engine-chronocat-event/src/handler.ts index e64d237..ec1c369 100644 --- a/packages/engine-chronocat-event/src/handler.ts +++ b/packages/engine-chronocat-event/src/handler.ts @@ -125,13 +125,16 @@ const dispatcher = async ( case 'nodeIKernelGroupService/getNextMemberList': { // const authData = await ctx.chronocat.getAuthData() - const { profiles, infos } = payload as OnProfileChanged + const { profiles, infos, info } = payload as OnProfileChanged // if (profiles.get(authData.uid)) // selfProfile.value = profiles.get(authData.uid) + if (info) ctx.chronocat.uix.add(info.uid, info.uin) + const profile = profiles ?? infos - for (const [uid, { uin }] of profile) ctx.chronocat.uix.add(uid, uin) + if (profile) + for (const [uid, { uin }] of profile) ctx.chronocat.uix.add(uid, uin) return } diff --git a/packages/red/src/redEntity.ts b/packages/red/src/redEntity.ts index 6b9ee41..633800a 100644 --- a/packages/red/src/redEntity.ts +++ b/packages/red/src/redEntity.ts @@ -1,23 +1,60 @@ export interface Profile { uid: string + + /** + * 无情况下为空字符串 + */ qid: string + uin: string + nick: string + + /** + * 无情况下为空字符串 + */ remark: string + + /** + * 无情况下为空字符串 + */ longNick: string + + /** + * 一般为空字符串 + */ avatarUrl: string + + /** + * 不显示情况下为 0 + */ birthday_year: number + + /** + * 不显示情况下为 0 + */ birthday_month: number + + /** + * 不显示情况下为 0 + */ birthday_day: number - sex: number - topTime: string + + sex: number // 255 + + topTime: string // '0' + + /** + * 是否拉黑 + */ isBlock: boolean + isMsgDisturb: boolean isSpecialCareOpen: boolean isSpecialCareZone: boolean ringId: string - status: number - extStatus: number + status: number // 10 + extStatus: number // 0 categoryId: number onlyChat: boolean qzoneNotWatch: boolean @@ -26,8 +63,6 @@ export interface Profile { yearVipFlag: boolean svipFlag: boolean vipLevel: number - - // 以下为 >9.9.1 添加 qidianMasterFlag: number qidianCrewFlag: number qidianCrewFlag2: number @@ -35,6 +70,44 @@ export interface Profile { zplanCoupleSceneId: number teenagerFlag: number studyFlag: number + constellation: number // 0 + shengXiao: number // 0 + kBloodType: number // 0 + homeTown: string // '' + makeFriendCareer: number // 0 + pos: string // '' + eMail: string // '' + phoneNum: string // '' + college: string // '' + country: string // '' + province: string // '' + city: string // '' + postCode: string // '' + address: string // '' + regTime: number // 0 + interest: string // '' + termType: number // 65793 + labels: unknown[] + qqLevel: { + crownNum: number // 0 + sunNum: number // 0 + moonNum: number // 0 + starNum: number // 0 + } + isHideQQLevel: number // 0 + privilegeIcon: { + jumpUrl: string // '' + openIconList: unknown[] + closeIconList: unknown[] + } + isHidePrivilegeIcon: number // 0 + photoWall: { + picList: unknown[] + } + recommendImgFlag: number // 0 + disableEmojiShortCuts: number // 0 + pendantId: string // '0' + vipNameColorId: string // '0' } export interface Member { diff --git a/packages/red/src/redIpcEntity.ts b/packages/red/src/redIpcEntity.ts index 88fb8dd..eb2aa05 100644 --- a/packages/red/src/redIpcEntity.ts +++ b/packages/red/src/redIpcEntity.ts @@ -25,12 +25,15 @@ export interface OnProfileChanged { ][] & { get: (uid: string) => Profile } + infos: [ string, { uin: string }, ][] + + info: Profile } export interface OnMemberInfoChange {