This commit is contained in:
idranme 2024-08-22 06:23:35 +08:00
parent 8b57ebd7de
commit b3b8f9cd72
No known key found for this signature in database
GPG Key ID: 926F7B5B668E495F
3 changed files with 6 additions and 6 deletions
src
main
ntqqapi/api

@ -341,7 +341,7 @@ function onLoad() {
} }
}) })
/*registerReceiveHook<FriendRequestNotify>(ReceiveCmdS.FRIEND_REQUEST, async (payload) => { registerReceiveHook<FriendRequestNotify>(ReceiveCmdS.FRIEND_REQUEST, async (payload) => {
for (const req of payload.data.buddyReqs) { for (const req of payload.data.buddyReqs) {
if (!!req.isInitiator || (req.isDecide && req.reqType !== BuddyReqType.KMEINITIATORWAITPEERCONFIRM)) { if (!!req.isInitiator || (req.isDecide && req.reqType !== BuddyReqType.KMEINITIATORWAITPEERCONFIRM)) {
continue continue
@ -349,7 +349,7 @@ function onLoad() {
let userId = 0 let userId = 0
try { try {
const requesterUin = await NTQQUserApi.getUinByUid(req.friendUid) const requesterUin = await NTQQUserApi.getUinByUid(req.friendUid)
userId = parseInt(requesterUin!) userId = parseInt(requesterUin)
} catch (e) { } catch (e) {
log('获取加好友者QQ号失败', e) log('获取加好友者QQ号失败', e)
} }
@ -362,7 +362,7 @@ function onLoad() {
) )
postOb11Event(friendRequestEvent) postOb11Event(friendRequestEvent)
} }
})*/ })
} }
let startTime = 0 // 毫秒 let startTime = 0 // 毫秒

@ -98,12 +98,12 @@ export class NTQQGroupApi {
) )
return notifies return notifies
} else { } else {
return await invoke<GroupNotifies>({ return (await invoke<GroupNotifies>({
methodName: NTMethod.GET_GROUP_NOTICE, methodName: NTMethod.GET_GROUP_NOTICE,
cbCmd: ReceiveCmdS.GROUP_NOTIFY, cbCmd: ReceiveCmdS.GROUP_NOTIFY,
afterFirstCmd: false, afterFirstCmd: false,
args: [{ doubt: false, startSeq: '', number: num }, null], args: [{ doubt: false, startSeq: '', number: num }, null],
}) })).notifies
} }
} }

@ -11,7 +11,7 @@ function generateMsgId() {
const buffer = Buffer.alloc(8) const buffer = Buffer.alloc(8)
buffer.writeUInt32BE(timestamp, 0) buffer.writeUInt32BE(timestamp, 0)
buffer.writeUInt32BE(random, 4) buffer.writeUInt32BE(random, 4)
const msgId = BigInt("0x" + buffer.toString('hex')).toString() const msgId = BigInt('0x' + buffer.toString('hex')).toString()
return msgId return msgId
} }