feat & fix: add video msg pack & upload, fix some bugs in uploading c2c elements

This commit is contained in:
pk5ls20
2024-10-23 06:14:48 +08:00
parent 5190b26399
commit 4082b651c5
8 changed files with 586 additions and 20 deletions

View File

@@ -12,7 +12,7 @@ import { LogWrapper } from "@/common/log";
import { SendLongMsgResp } from "@/core/packet/proto/message/action";
import { PacketMsg } from "@/core/packet/msg/message";
import { OidbSvcTrpcTcp0x6D6Response } from "@/core/packet/proto/oidb/Oidb.0x6D6";
import { PacketMsgPicElement } from "@/core/packet/msg/element";
import { PacketMsgPicElement, PacketMsgVideoElement } from "@/core/packet/msg/element";
interface OffsetType {
@@ -118,7 +118,13 @@ export class NTQQPacketApi {
if (e instanceof PacketMsgPicElement) {
reqList.push(this.packetSession?.highwaySession.uploadImage({
chatType: groupUin ? ChatType.KCHATTYPEGROUP : ChatType.KCHATTYPEC2C,
peerUid: String(groupUin) ? String(groupUin) : this.core.selfInfo.uid
peerUid: groupUin ? String(groupUin) : this.core.selfInfo.uid
}, e));
}
if (e instanceof PacketMsgVideoElement) {
reqList.push(this.packetSession?.highwaySession.uploadVideo({
chatType: groupUin ? ChatType.KCHATTYPEGROUP : ChatType.KCHATTYPEC2C,
peerUid: groupUin ? String(groupUin) : this.core.selfInfo.uid
}, e));
}
}