mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 04:45:46 +00:00
Merge pull request #442 from pk5ls20/feat/better-forward-msg
feat: better fake forwardMsg display
This commit is contained in:
commit
e818e79d20
@ -363,6 +363,10 @@ export class PacketMultiMsgElement extends IPacketMsgElement<SendStructLongMsgEl
|
||||
this.message = message ?? [];
|
||||
}
|
||||
|
||||
get isGroupMsg(): boolean {
|
||||
return this.message.some(msg => msg.groupId !== undefined);
|
||||
}
|
||||
|
||||
get JSON() {
|
||||
const id = crypto.randomUUID();
|
||||
return {
|
||||
@ -387,7 +391,11 @@ export class PacketMultiMsgElement extends IPacketMsgElement<SendStructLongMsgEl
|
||||
text: `${packetMsg.senderName}: ${packetMsg.msg.map(msg => msg.toPreview()).join('')}`,
|
||||
})),
|
||||
resid: this.resid,
|
||||
source: "聊天记录", // TODO:
|
||||
source: this.isGroupMsg ? "群聊的聊天记录" :
|
||||
this.message.length
|
||||
? Array.from(new Set(this.message.map(msg => msg.senderName)))
|
||||
.join('和') + '的聊天记录'
|
||||
: '聊天记录',
|
||||
summary: `查看${this.message.length}条转发消息`,
|
||||
uniseq: id,
|
||||
}
|
||||
|
@ -114,9 +114,7 @@ export class PacketPacker {
|
||||
}
|
||||
}
|
||||
);
|
||||
this.logger.logDebug("packUploadForwardMsg LONGMSGRESULT!!!", this.toHexStr(longMsgResultData));
|
||||
const payload = zlib.gzipSync(Buffer.from(longMsgResultData));
|
||||
// this.logger.logDebug("packUploadForwardMsg PAYLOAD!!!", payload);
|
||||
const req = new NapProtoMsg(SendLongMsgReq).encode(
|
||||
{
|
||||
info: {
|
||||
|
Loading…
Reference in New Issue
Block a user