mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
73a859be04 | ||
![]() |
63bcee01a1 | ||
![]() |
85b4966ba8 |
@@ -4,7 +4,7 @@
|
||||
"name": "NapCatQQ",
|
||||
"slug": "NapCat.Framework",
|
||||
"description": "高性能的 OneBot 11 协议实现",
|
||||
"version": "3.4.3",
|
||||
"version": "3.4.4",
|
||||
"icon": "./logo.png",
|
||||
"authors": [
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "3.4.3",
|
||||
"version": "3.4.4",
|
||||
"scripts": {
|
||||
"build:framework": "vite build --mode framework",
|
||||
"build:shell": "vite build --mode shell",
|
||||
|
@@ -1 +1 @@
|
||||
export const napCatVersion = '3.4.3';
|
||||
export const napCatVersion = '3.4.4';
|
||||
|
@@ -311,51 +311,37 @@ export class NapCatOneBot11Adapter {
|
||||
}
|
||||
};
|
||||
|
||||
//const msgIdSend = new LRUCache<string, boolean>(100);
|
||||
const msgIdSend = new LRUCache<string, number>(100);
|
||||
const recallMsgs = new LRUCache<string, boolean>(100);
|
||||
msgListener.onAddSendMsg = async msg => {
|
||||
if (msg.sendStatus == SendStatusType.KSEND_STATUS_SUCCESS) {
|
||||
this.apis.MsgApi.parseMessage(msg)
|
||||
.then((ob11Msg) => {
|
||||
if (!ob11Msg) return;
|
||||
ob11Msg.target_id = parseInt(msg.peerUin);
|
||||
if (this.configLoader.configData.reportSelfMessage) {
|
||||
msg.id = MessageUnique.createUniqueMsgId({
|
||||
chatType: msg.chatType,
|
||||
peerUid: msg.peerUid,
|
||||
guildId: '',
|
||||
}, msg.msgId);
|
||||
this.emitMsg(msg);
|
||||
} else {
|
||||
// logOB11Message(this.core, ob11Msg);
|
||||
}
|
||||
});
|
||||
if (msg.sendStatus == SendStatusType.KSEND_STATUS_SENDING) {
|
||||
msgIdSend.put(msg.msgId, 0);
|
||||
}
|
||||
};
|
||||
msgListener.onMsgInfoListUpdate = async msgList => {
|
||||
this.emitRecallMsg(msgList, recallMsgs)
|
||||
.catch(e => this.context.logger.logError.bind(this.context.logger)('处理消息失败', e));
|
||||
// for (const msg of msgList.filter(e => e.senderUin == this.core.selfInfo.uin)) {
|
||||
// if (msg.sendStatus == SendStatusType.KSEND_STATUS_SUCCESS && !msgIdSend.get(msg.msgId)) {
|
||||
// msgIdSend.put(msg.msgId, true);
|
||||
// // 完成后再post
|
||||
// this.apis.MsgApi.parseMessage(msg)
|
||||
// .then((ob11Msg) => {
|
||||
// if (!ob11Msg) return;
|
||||
// ob11Msg.target_id = parseInt(msg.peerUin);
|
||||
// if (this.configLoader.configData.reportSelfMessage) {
|
||||
// msg.id = MessageUnique.createUniqueMsgId({
|
||||
// chatType: msg.chatType,
|
||||
// peerUid: msg.peerUid,
|
||||
// guildId: '',
|
||||
// }, msg.msgId);
|
||||
// this.emitMsg(msg);
|
||||
// } else {
|
||||
// // logOB11Message(this.core, ob11Msg);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
for (const msg of msgList.filter(e => e.senderUin == this.core.selfInfo.uin)) {
|
||||
if (msg.sendStatus == SendStatusType.KSEND_STATUS_SUCCESS && msgIdSend.get(msg.msgId) == 0) {
|
||||
msgIdSend.put(msg.msgId, 1);
|
||||
// 完成后再post
|
||||
this.apis.MsgApi.parseMessage(msg)
|
||||
.then((ob11Msg) => {
|
||||
if (!ob11Msg) return;
|
||||
ob11Msg.target_id = parseInt(msg.peerUin);
|
||||
if (this.configLoader.configData.reportSelfMessage) {
|
||||
msg.id = MessageUnique.createUniqueMsgId({
|
||||
chatType: msg.chatType,
|
||||
peerUid: msg.peerUid,
|
||||
guildId: '',
|
||||
}, msg.msgId);
|
||||
this.emitMsg(msg);
|
||||
} else {
|
||||
// logOB11Message(this.core, ob11Msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.context.session.getMsgService().addKernelMsgListener(
|
||||
|
@@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) {
|
||||
SettingItem(
|
||||
'<span id="napcat-update-title">Napcat</span>',
|
||||
void 0,
|
||||
SettingButton("V3.4.3", "napcat-update-button", "secondary")
|
||||
SettingButton("V3.4.4", "napcat-update-button", "secondary")
|
||||
)
|
||||
]),
|
||||
SettingList([
|
||||
|
Reference in New Issue
Block a user