feat: uin转换优化&poke支持重写

This commit is contained in:
手瓜一十雪
2024-07-11 12:28:11 +08:00
parent 9a0aca1e60
commit 14cd4dcb9f
6 changed files with 75 additions and 43 deletions

View File

@@ -205,7 +205,25 @@ export class NTQQUserApi {
5000,
[Uid]
);
return ret.uinInfo.get(Uid);
let uin = ret.uinInfo.get(Uid);
if (!uin) {
//从Buddy缓存获取Uin
Array.from(friends.values()).forEach((t) => {
if (t.uid == Uid) {
uin = t.uin;
}
})
}
if (!uin) {
uin = (await NTQQUserApi.getUserDetailInfo(Uid)).uin; //从QQ Native 转换
}
if (!uin) {
uin = (await NTQQFriendApi.getFriends(false)).find((t) => { t.uid == Uid })?.uin; //从QQ Native 缓存转换
}
if (!uin) {
uin = (await NTQQFriendApi.getFriends(true)).find((t) => { t.uid == Uid })?.uin; //从QQ Native 非缓存转换
}
return uin;
}
static async getUserDetailInfoByUin(Uin: string) {
return NTEventDispatch.CallNoListenerEvent

View File

@@ -30,6 +30,7 @@ export enum ElementType {
VIDEO = 5,
FACE = 6,
REPLY = 7,
GreyTip = 8,//Poke别叫戳一搓了 官方名字拍一拍 戳一戳是另一个名字
ARK = 10,
MFACE = 11,
MARKDOWN = 14
@@ -289,6 +290,7 @@ export interface GrayTipElement {
templId: string;
};
jsonGrayTipElement: {
busiId?: number;
jsonStr: string;
};
}