From 17e70a436063d7e2f0135d1bd9a84c9a2f29edc3 Mon Sep 17 00:00:00 2001 From: pk5ls20 Date: Fri, 18 Oct 2024 04:49:38 +0800 Subject: [PATCH] feat: add more msgElement --- src/core/packet/msg/element.ts | 54 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/core/packet/msg/element.ts b/src/core/packet/msg/element.ts index f5dae1cf..0135edb0 100644 --- a/src/core/packet/msg/element.ts +++ b/src/core/packet/msg/element.ts @@ -220,12 +220,6 @@ export class PacketMsgFaceElement extends IPacketMsgElement { } } -export class PacketMsgPttElement extends IPacketMsgElement { - constructor(element: SendPttElement) { - super(element); - } -} - export class PacketMsgVideoElement extends IPacketMsgElement { constructor(element: SendVideoElement) { super(element); @@ -238,6 +232,12 @@ export class PacketMsgFileElement extends IPacketMsgElement { } } +export class PacketMsgPttElement extends IPacketMsgElement { + constructor(element: SendPttElement) { + super(element); + } +} + export class PacketMsgLightAppElement extends IPacketMsgElement { payload: string; @@ -258,28 +258,28 @@ export class PacketMsgLightAppElement extends IPacketMsgElement } } +export class PacketMsgMarkDownElement extends IPacketMsgElement { + content: string; + + constructor(element: SendMarkdownElement) { + super(element); + this.content = element.markdownElement.content; + } + + buildElement(): NapProtoEncodeStructType[] { + return [{ + commonElem: { + serviceType: 45, + pbElem: new NapProtoMsg(MarkdownData).encode({ + content: this.content + }), + businessType: 1 + } + }] + } +} + // TODO: -// export class PacketMsgMarkDownElement extends IPacketMsgElement { -// content: string; -// -// constructor(element: SendMarkdownElement) { -// super(element); -// this.content = element.markdownElement.content; -// } -// -// buildElement(): NapProtoEncodeStructType[] { -// return [{ -// commonElem: { -// serviceType: 45, -// pbElem: new NapProtoMsg(MarkdownData).encode({ -// content: this.content -// }), -// businessType: 1 -// } -// }] -// } -// } -// // export class PacketMsgLongMsgElement extends IPacketMsgElement { // resid: string; //