Feat/Implement QQ Online File/Folder and Flash Transfer support (#1541)
* feat: implement QQ online file transfer and flash transfer support * fix: change OnlineFile OB11Message data * fix: add fileSize and isDir to OB11MessageOnlineFile * fix: resolve typescript strict mode errors
This commit is contained in:
1 parent
772f07c58b
commit
75236dd50c
35 files changed
+1831
-23
No files matched your search
@@ -328,6 +328,38 @@ export class NapCatOneBot11Adapter {
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 加入在线文件的listener
|
||||
*/
|
||||
msgListener.onRecvOnlineFileMsg = async (msg: RawMessage[]) => {
|
||||
if (!this.networkManager.hasActiveAdapters()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const m of msg) {
|
||||
// this.context.logger.logMessage(m, this.core.selfInfo);
|
||||
|
||||
if (this.bootTime > parseInt(m.msgTime)) {
|
||||
this.context.logger.logDebug(`在线文件消息时间${m.msgTime}早于启动时间${this.bootTime},忽略上报`);
|
||||
continue;
|
||||
}
|
||||
|
||||
m.id = MessageUnique.createUniqueMsgId(
|
||||
{
|
||||
chatType: m.chatType,
|
||||
peerUid: m.peerUid,
|
||||
guildId: '',
|
||||
},
|
||||
m.msgId
|
||||
);
|
||||
|
||||
await this.emitMsg(m).catch((e) =>
|
||||
this.context.logger.logError('处理在线文件消息失败', e)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
msgListener.onAddSendMsg = async (msg) => {
|
||||
try {
|
||||
if (msg.sendStatus === SendStatusType.KSEND_STATUS_SENDING) {
|
||||
|
||||
Reference in new issue
Block a user