Skip to content

Commit

Permalink
fix: emoji reaction (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
icarus-ai authored Dec 8, 2024
1 parent 6a5fe2a commit 988dab1
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion client/event/group.go
Original file line number Diff line number Diff line change
@@ -101,6 +101,7 @@ type (
GroupEvent
TargetSeq uint32
IsAdd bool
IsEmoji bool
Code string
Count uint32
}
@@ -344,14 +345,16 @@ func (g *GroupReactionEvent) ResolveUin(f func(uid string, groupUin ...uint32) u
}

func ParseGroupReactionEvent(event *message.GroupReaction) *GroupReactionEvent {
code := event.Data.Data.Data.Data.Code
return &GroupReactionEvent{
GroupEvent: GroupEvent{
GroupUin: event.GroupUid,
UserUID: event.Data.Data.Data.Data.OperatorUid,
},
TargetSeq: event.Data.Data.Data.Target.Sequence,
IsAdd: event.Data.Data.Data.Data.Type == 1,
Code: event.Data.Data.Data.Data.Code,
IsEmoji: len(code) > 3,
Code: code,
Count: event.Data.Data.Data.Data.Count,
}
}
2 changes: 1 addition & 1 deletion client/packets/oidb/set_group_reaction.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ func BuildSetGroupReactionReq(groupUin, sequence uint32, code string, isAdd bool
GroupUin: groupUin,
Sequence: sequence,
Code: proto.Some(code),
Field5: true,
Type: utils.Ternary[uint32](len(code) > 3, 2, 1),
Field6: false,
Field7: false,
}
2 changes: 1 addition & 1 deletion client/packets/pb/service/oidb/OidbSvcTrpcTcp0x9082.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/packets/pb/service/oidb/OidbSvcTrpcTcp0x9082.proto
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ message OidbSvcTrpcTcp0x9082 {
uint32 GroupUin = 2;
uint32 Sequence = 3;
optional string Code = 4;
bool Field5 = 5;
uint32 Type = 5; // 1 face 2 emoji
bool Field6 = 6;
bool Field7 = 7;
}

0 comments on commit 988dab1

Please sign in to comment.