Skip to content

Commit

Permalink
[Core] fix emoji reaction (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
CrackTC authored Dec 6, 2024
1 parent d9630a7 commit 07cab5b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Lagrange.Core/Internal/Event/Action/GroupAddReactionEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ internal class GroupAddReactionEvent : ProtocolEvent

public string Code { get; } = string.Empty;

public bool IsEmoji => Code.Length > 3;

private GroupAddReactionEvent(uint groupUin, uint sequence, string code) : base(true)
{
GroupUin = groupUin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ internal class GroupReduceReactionEvent : ProtocolEvent

public string Code { get; } = string.Empty;

public bool IsEmoji => Code.Length > 3;

private GroupReduceReactionEvent(uint groupUin, uint sequence, string code) : base(true)
{
GroupUin = groupUin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class OidbSvcTrpcTcp0x9082

[ProtoMember(4)] public string? Code { get; set; }

[ProtoMember(5)] public bool Field5 { get; set; } // true
[ProtoMember(5)] public uint Type { get; set; } // 1 Face 2 Emoji

[ProtoMember(6)] public bool Field6 { get; set; } // false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected override bool Build(GroupAddReactionEvent input, BotKeystore keystore,
GroupUin = input.GroupUin,
Sequence = input.Sequence,
Code = input.Code,
Field5 = true,
Type = input.IsEmoji ? 2u : 1u,
Field6 = false,
Field7 = false
}, 0x9082, 1, false, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected override bool Build(GroupReduceReactionEvent input, BotKeystore keysto
GroupUin = input.GroupUin,
Sequence = input.Sequence,
Code = input.Code,
Field5 = true,
Type = input.IsEmoji ? 2u : 1u,
Field6 = false,
Field7 = false
}, 0x9082, 2, false, true);
Expand Down

0 comments on commit 07cab5b

Please sign in to comment.