Compare commits

...
8 Commits
Author SHA1 Message Date
手瓜一十雪 1dcf2ef0c6 fix: error handle
Build Action / Build-LiteLoader (push) Waiting to run
Build Action / Build-Shell (push) Waiting to run
Build Release / check-version (push) Waiting to run
2024-11-28 09:53:50 +08:00
Mlikiowa 3642c65e8c release: v4.2.2 2024-11-27 12:39:03 +00:00
手瓜一十雪 40e105994a fix: pic size
Build Action / Build-LiteLoader (push) Waiting to run
Build Action / Build-Shell (push) Waiting to run
Build Release / check-version (push) Waiting to run
2024-11-27 20:38:39 +08:00
Mlikiowa f2ee973882 release: v4.2.1 2024-11-27 11:07:43 +00:00
手瓜一十雪 3aa30792bf Merge branch 'main' of https://github.com/NapNeko/NapCatQQ
Build Action / Build-LiteLoader (push) Waiting to run
Build Action / Build-Shell (push) Waiting to run
Build Release / check-version (push) Waiting to run
2024-11-27 19:07:11 +08:00
手瓜一十雪 6e336fa78e fix: 合并丢失 2024-11-27 19:07:01 +08:00
Mlikiowa 900027a6b7 release: v4.2.0 2024-11-27 10:55:36 +00:00
手瓜一十雪 38bdca2409 fix: qrcode login 2024-11-27 18:51:54 +08:00
7 changed files with 47 additions and 30 deletions

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
"name": "NapCatQQ",
"slug": "NapCat.Framework",
"description": "高性能的 OneBot 11 协议实现",
"version": "4.1.21",
"version": "4.2.2",
"icon": "./logo.png",
"authors": [
{
+8 -4
View File
@@ -58,6 +58,9 @@ let qrcodeUrl: string = '';
const selectAccount = async (accountName: string): Promise<void> => {
const { result, errMsg } = await qqLoginManager.setQuickLogin(accountName);
if (result) {
if (heartBeatTimer) {
clearInterval(heartBeatTimer);
}
await MessagePlugin.success('登录成功即将跳转');
await router.push({ path: '/dashboard/basic-info' });
} else {
@@ -85,10 +88,11 @@ const HeartBeat = async (): Promise<void> => {
if (heartBeatTimer) {
clearInterval(heartBeatTimer);
}
//判断是否已经调转
if (router.currentRoute.value.path !== '/dashboard/basic-info') {
return;
}
// //判断是否已经调转
// if (router.currentRoute.value.path !== '/dashboard/basic-info') {
// return;
// }
await MessagePlugin.success('登录成功即将跳转');
await router.push({ path: '/dashboard/basic-info' });
} else if (isLogined?.qrcodeurl && qrcodeUrl !== isLogined.qrcodeurl) {
qrcodeUrl = isLogined.qrcodeurl;
+6
View File
@@ -12,6 +12,9 @@
<t-form-item label="启用本地文件到URL" name="enableLocalFile2Url" class="form-item">
<t-switch v-model="otherConfig.enableLocalFile2Url" />
</t-form-item>
<t-form-item label="启用上报解析合并消息" name="parseMultMsg" class="form-item">
<t-switch v-model="otherConfig.parseMultMsg" />
</t-form-item>
</t-form>
<div class="button-container">
<t-button @click="saveConfig">保存</t-button>
@@ -30,6 +33,7 @@ import { QQLoginManager } from '@/backend/shell';
const otherConfig = ref<Partial<OneBotConfig>>({
musicSignUrl: '',
enableLocalFile2Url: false,
parseMultMsg: true
});
const labelAlign = ref<string>();
@@ -59,6 +63,7 @@ const loadConfig = async () => {
if (userConfig) {
otherConfig.value.musicSignUrl = userConfig.musicSignUrl;
otherConfig.value.enableLocalFile2Url = userConfig.enableLocalFile2Url;
otherConfig.value.parseMultMsg = userConfig.parseMultMsg;
}
} catch (error) {
console.error('Error loading config:', error);
@@ -71,6 +76,7 @@ const saveConfig = async () => {
if (userConfig) {
userConfig.musicSignUrl = otherConfig.value.musicSignUrl || '';
userConfig.enableLocalFile2Url = otherConfig.value.enableLocalFile2Url ?? false;
userConfig.parseMultMsg = otherConfig.value.parseMultMsg ?? true;
const success = await setOB11Config(userConfig);
if (success) {
MessagePlugin.success('配置保存成功');
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "napcat",
"private": true,
"type": "module",
"version": "4.1.21",
"version": "4.2.2",
"scripts": {
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
"build:shell": "npm run build:webui && vite build --mode shell || exit 1",
+1 -1
View File
@@ -1 +1 @@
export const napCatVersion = '4.1.21';
export const napCatVersion = '4.2.2';
+5 -5
View File
@@ -3,12 +3,12 @@ import { PicType } from '../types';
export async function getFileTypeForSendType(picPath: string): Promise<PicType> {
const fileTypeResult = (await fileType.fileTypeFromFile(picPath))?.ext ?? 'jpg';
const picTypeMap: { [key: string]: PicType } = {
'webp': PicType.NEWPIC_WEBP,
//'webp': PicType.NEWPIC_WEBP,
'gif': PicType.NEWPIC_GIF,
'png': PicType.NEWPIC_APNG,
'jpg': PicType.NEWPIC_JPEG,
'jpeg': PicType.NEWPIC_JPEG,
'bmp': PicType.NEWPIC_BMP,
// 'png': PicType.NEWPIC_APNG,
// 'jpg': PicType.NEWPIC_JPEG,
// 'jpeg': PicType.NEWPIC_JPEG,
// 'bmp': PicType.NEWPIC_BMP,
};
return picTypeMap[fileTypeResult] ?? PicType.NEWPIC_JPEG;
}
+25 -18
View File
@@ -213,7 +213,7 @@ export class NapCatOneBot11Adapter {
if (networkChange === OB11NetworkReloadType.NetWorkClose) {
await this.networkManager.closeSomeAdaterWhenOpen([existingAdapter]);
}
} else if(adapterConfig.enable) {
} else if (adapterConfig.enable) {
const newAdapter = new adapterClass(adapterConfig.name, adapterConfig, this.core, this.actions);
await this.networkManager.registerAdapterAndOpen(newAdapter);
}
@@ -266,23 +266,30 @@ export class NapCatOneBot11Adapter {
};
msgListener.onAddSendMsg = async (msg) => {
if (msg.sendStatus == SendStatusType.KSEND_STATUS_SENDING) {
await this.core.eventWrapper.registerListen('NodeIKernelMsgListener/onMsgInfoListUpdate', (msgList: RawMessage[]) => {
const report = msgList.find((e) =>
e.senderUin == this.core.selfInfo.uin && e.sendStatus == SendStatusType.KSEND_STATUS_SUCCESS && e.msgId === msg.msgId
);
return !!report;
}, 1, 300);
msg.id = MessageUnique.createUniqueMsgId(
{
chatType: msg.chatType,
peerUid: msg.peerUid,
guildId: '',
},
msg.msgId
);
//此时上报的seq不是对的 不过对onebot业务无影响
this.emitMsg(msg);
try {
if (msg.sendStatus == SendStatusType.KSEND_STATUS_SENDING) {
const [updatemsgs] = await this.core.eventWrapper.registerListen('NodeIKernelMsgListener/onMsgInfoListUpdate', (msgList: RawMessage[]) => {
const report = msgList.find((e) =>
e.senderUin == this.core.selfInfo.uin && e.sendStatus !== SendStatusType.KSEND_STATUS_SENDING && e.msgId === msg.msgId
);
return !!report;
}, 1, 10 * 60 * 1000);
// 10分钟 超时
const updatemsg = updatemsgs.find((e) => e.msgId === msg.msgId);
if (updatemsg?.sendStatus == SendStatusType.KSEND_STATUS_SUCCESS || updatemsg?.sendStatus == SendStatusType.KSEND_STATUS_SUCCESS_NOSEQ) {
updatemsg.id = MessageUnique.createUniqueMsgId(
{
chatType: updatemsg.chatType,
peerUid: updatemsg.peerUid,
guildId: '',
},
updatemsg.msgId
);
this.emitMsg(updatemsg);
}
}
} catch (error) {
this.context.logger.logError('处理发送消息失败', error);
}
};
msgListener.onMsgRecall = async (chatType: ChatType, uid: string, msgSeq: string) => {