Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Lagrange.Core/Internal/Service/Message/PushMessageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ private static void ProcessEvent0x210(Span<byte> payload, PushMsg msg, List<Prot
}
break;
}
case Event0x210SubType.FriendRecallPoke:
{
// 0AC6010A40088BF5FDC7041218755F37787A33324D66583368634D6A737573337742706D6728E2FBEDF9053218755F667132684B3132624267306F7735637A57685A667267122508900410C10218C10220C1AFAD9F0128B9DAE0A101309DA4A3C10660C1AFAD9F81808080021A5B0A0012570A18755F37787A33324D66583368634D6A737573337742706D6720A5082889A3C9FC041218755F667132684B3132624267306F7735637A57685A6672671A18755F37787A33324D66583368634D6A737573337742706D67180122360A0E33302E3138382E3234372E32333310FE9D011A2010900418B9DAE0A10120C1AFAD9F818080800230C1023801408BF5FDC7044801
break;
}
default:
{
break;
Expand Down Expand Up @@ -382,5 +387,6 @@ private enum Event0x210SubType
ServicePinChanged = 199, // e.g: My computer | QQ Wallet | ...
FriendPokeNotice = 290,
GroupKickNotice = 212,
FriendRecallPoke = 321,
}
}
2 changes: 1 addition & 1 deletion Lagrange.Core/Message/Entity/ForwardEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ IEnumerable<Elem> PackElement(bool additional)

void IMessageEntity.SetSelfUid(string selfUid) => _selfUid = selfUid;

string IMessageEntity.ToPreviewString() => $"[Forward] {{ {Chain.ToPreviewString()} }}";
string IMessageEntity.ToPreviewString() => $"[Forward] {{ {Chain.Sequence} }}";

string IMessageEntity.ToPreviewText() => "";
}
1 change: 1 addition & 0 deletions Lagrange.Core/Message/Filter/MessageFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ internal static class MessageFilter
static MessageFilter()
{
_rules = new IMessageFilterRule[] {
new AtBeforeReplyInOldClient(),
new ForwardTrailingAtAndTextFilterRule(),
new MultiMsgTrailingXmlFilterRule(),
new OldAndInvalidImageFilterRule(),
Expand Down
18 changes: 18 additions & 0 deletions Lagrange.Core/Message/Filter/Rule/AtBeforeReplyInOldClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

using Lagrange.Core.Message.Entity;

namespace Lagrange.Core.Message.Filter.Rule;

public class AtBeforeReplyInOldClient : IMessageFilterRule
{
public IEnumerable<int> Apply(MessageChain chain)
{
if (chain.Count < 3) return Array.Empty<int>();
if (chain[0] is not MentionEntity mention) return Array.Empty<int>();
if (chain[1] is not TextEntity { Text: " " }) return Array.Empty<int>();
if (chain[2] is not ForwardEntity forward) return Array.Empty<int>();
if (mention.Uin != forward.TargetUin) return Array.Empty<int>();

return new int[] { 0, 1 };
}
}