Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit 5b5e09e

Browse files
authored
[Core] fix private chat Forward with additional information (#842)
1 parent 442cefb commit 5b5e09e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Lagrange.Core/Message/Entity/ForwardEntity.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ public ForwardEntity(MessageChain chain)
3838
Chain = chain;
3939
}
4040

41-
IEnumerable<Elem> IMessageEntity.PackElement() => PackElement(true);
41+
IEnumerable<Elem> IMessageEntity.PackElement() => PackElement(false);
4242

43-
IEnumerable<Elem> IMessageEntity.PackFakeElement() => PackElement(false);
43+
IEnumerable<Elem> IMessageEntity.PackFakeElement() => PackElement(true);
4444

45-
IEnumerable<Elem> PackElement(bool additional)
45+
IEnumerable<Elem> PackElement(bool fake)
4646
{
47-
byte[] bytes = ProtoExt.SerializeToBytes(MessagePacker.BuildFake(Chain, _selfUid));
4847
var result = new List<Elem> {
4948
new() {
5049
SrcMsg = new SrcMsg {
@@ -57,13 +56,13 @@ IEnumerable<Elem> PackElement(bool additional)
5756
MessageId = MessageId,
5857
SenderUid = Uid,
5958
}),
60-
SourceMsg = !additional ? bytes : null,
59+
SourceMsg = fake ? ProtoExt.SerializeToBytes(MessagePacker.BuildFake(Chain, _selfUid)) : null,
6160
ToUin = 0
6261
}
6362
},
6463
};
6564

66-
if (additional && ClientSequence != 0)
65+
if (!fake && ClientSequence == 0)
6766
{
6867
result.Add(new Elem
6968
{
@@ -72,8 +71,8 @@ IEnumerable<Elem> PackElement(bool additional)
7271
Str = "not null",
7372
PbReserve = ProtoExt.SerializeToBytes(new MentionExtra
7473
{
75-
Type = 1,
76-
Uin = TargetUin,
74+
Type = 2,
75+
Uid = Chain.Uid!,
7776
})
7877
}
7978
});

0 commit comments

Comments
 (0)