feat: report self message

This commit is contained in:
Wesley F. Young 2024-09-07 09:53:24 +08:00
parent c2646dabad
commit 7a5d7dd49e
2 changed files with 8 additions and 5 deletions

View File

@ -10,5 +10,6 @@
"interval": 30000
}
}
}
},
"reportSelfMessage": false
}

View File

@ -47,11 +47,13 @@ export class NapCatLaanaAdapter {
registerEvents() {
this.core.eventChannel.on('message/receive', async (msg) => {
const msgOrEmpty = await this.utils.msg.rawMessageToLaana(msg);
if (!msgOrEmpty) {
return;
await this.networkManager.emitMessage(await this.utils.msg.rawMessageToLaana(msg));
});
this.core.eventChannel.on('message/send', async (msg) => {
if (this.configLoader.configData.reportSelfMessage) {
await this.networkManager.emitMessage(await this.utils.msg.rawMessageToLaana(msg));
}
await this.networkManager.emitMessage(msgOrEmpty);
});
}
}