mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 13:01:14 +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 ?? [];
|
this.message = message ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isGroupMsg(): boolean {
|
||||||
|
return this.message.some(msg => msg.groupId !== undefined);
|
||||||
|
}
|
||||||
|
|
||||||
get JSON() {
|
get JSON() {
|
||||||
const id = crypto.randomUUID();
|
const id = crypto.randomUUID();
|
||||||
return {
|
return {
|
||||||
@ -387,7 +391,11 @@ export class PacketMultiMsgElement extends IPacketMsgElement<SendStructLongMsgEl
|
|||||||
text: `${packetMsg.senderName}: ${packetMsg.msg.map(msg => msg.toPreview()).join('')}`,
|
text: `${packetMsg.senderName}: ${packetMsg.msg.map(msg => msg.toPreview()).join('')}`,
|
||||||
})),
|
})),
|
||||||
resid: this.resid,
|
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}条转发消息`,
|
summary: `查看${this.message.length}条转发消息`,
|
||||||
uniseq: id,
|
uniseq: id,
|
||||||
}
|
}
|
||||||
|
@ -114,9 +114,7 @@ export class PacketPacker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.logger.logDebug("packUploadForwardMsg LONGMSGRESULT!!!", this.toHexStr(longMsgResultData));
|
|
||||||
const payload = zlib.gzipSync(Buffer.from(longMsgResultData));
|
const payload = zlib.gzipSync(Buffer.from(longMsgResultData));
|
||||||
// this.logger.logDebug("packUploadForwardMsg PAYLOAD!!!", payload);
|
|
||||||
const req = new NapProtoMsg(SendLongMsgReq).encode(
|
const req = new NapProtoMsg(SendLongMsgReq).encode(
|
||||||
{
|
{
|
||||||
info: {
|
info: {
|
||||||
|
Loading…
Reference in New Issue
Block a user