mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 07:50:25 +00:00
Refactor packet client and update message history actions
Replaced LRUCache with Map for callback and event management in packet clients, and standardized callback hash usage. Updated GetFriendMsgHistory and GetGroupMsgHistory actions to use snake_case for payload keys. Modified OneBotMsgApi to support disabling URL retrieval for ptt elements via a new parameter.
This commit is contained in:
@@ -444,7 +444,7 @@ export class OneBotMsgApi {
|
||||
};
|
||||
},
|
||||
|
||||
pttElement: async (element, msg, elementWrapper) => {
|
||||
pttElement: async (element, msg, elementWrapper, { disableGetUrl }) => {
|
||||
const peer = {
|
||||
chatType: msg.chatType,
|
||||
peerUid: msg.peerUid,
|
||||
@@ -452,7 +452,7 @@ export class OneBotMsgApi {
|
||||
};
|
||||
const fileCode = FileNapCatOneBotUUID.encode(peer, msg.msgId, elementWrapper.elementId, '', element.fileName);
|
||||
let pttUrl = '';
|
||||
if (this.core.apis.PacketApi.packetStatus) {
|
||||
if (this.core.apis.PacketApi.packetStatus && !disableGetUrl) {
|
||||
try {
|
||||
pttUrl = await registerResource(
|
||||
'ptt-url-get',
|
||||
|
||||
Reference in New Issue
Block a user