From c8478eaa335c1f089c2b2dfc58019ff9ba10f9d7 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 8 Mar 2024 01:45:18 +0200 Subject: [PATCH] Try adding SIM payload when sending reactions --- libgm/gmproto/client.pb.go | 27 ++++++++++++++++++--------- libgm/gmproto/client.pb.raw | Bin 6165 -> 6219 bytes libgm/gmproto/client.proto | 1 + portal.go | 1 + 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/libgm/gmproto/client.pb.go b/libgm/gmproto/client.pb.go index 425506a..fc81144 100644 --- a/libgm/gmproto/client.pb.go +++ b/libgm/gmproto/client.pb.go @@ -2697,6 +2697,7 @@ type SendReactionRequest struct { MessageID string `protobuf:"bytes,1,opt,name=messageID,proto3" json:"messageID,omitempty"` ReactionData *ReactionData `protobuf:"bytes,2,opt,name=reactionData,proto3" json:"reactionData,omitempty"` Action SendReactionRequest_Action `protobuf:"varint,3,opt,name=action,proto3,enum=client.SendReactionRequest_Action" json:"action,omitempty"` + SIMPayload *SIMPayload `protobuf:"bytes,4,opt,name=SIMPayload,proto3" json:"SIMPayload,omitempty"` } func (x *SendReactionRequest) Reset() { @@ -2752,6 +2753,13 @@ func (x *SendReactionRequest) GetAction() SendReactionRequest_Action { return SendReactionRequest_UNSPECIFIED } +func (x *SendReactionRequest) GetSIMPayload() *SIMPayload { + if x != nil { + return x.SIMPayload + } + return nil +} + type SendReactionResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3324,15 +3332,16 @@ var file_client_proto_depIdxs = []int32{ 4, // 37: client.SendMessageResponse.status:type_name -> client.SendMessageResponse.Status 70, // 38: client.SendReactionRequest.reactionData:type_name -> conversations.ReactionData 5, // 39: client.SendReactionRequest.action:type_name -> client.SendReactionRequest.Action - 57, // 40: client.TypingUpdateRequest.data:type_name -> client.TypingUpdateRequest.Data - 52, // 41: client.ReceiveMessagesRequest.UnknownEmptyObject2.unknown:type_name -> client.ReceiveMessagesRequest.UnknownEmptyObject1 - 60, // 42: client.AckMessageRequest.Message.device:type_name -> authentication.Device - 18, // 43: client.GetThumbnailResponse.Thumbnail.data:type_name -> client.ThumbnailData - 44, // [44:44] is the sub-list for method output_type - 44, // [44:44] is the sub-list for method input_type - 44, // [44:44] is the sub-list for extension type_name - 44, // [44:44] is the sub-list for extension extendee - 0, // [0:44] is the sub-list for field type_name + 67, // 40: client.SendReactionRequest.SIMPayload:type_name -> settings.SIMPayload + 57, // 41: client.TypingUpdateRequest.data:type_name -> client.TypingUpdateRequest.Data + 52, // 42: client.ReceiveMessagesRequest.UnknownEmptyObject2.unknown:type_name -> client.ReceiveMessagesRequest.UnknownEmptyObject1 + 60, // 43: client.AckMessageRequest.Message.device:type_name -> authentication.Device + 18, // 44: client.GetThumbnailResponse.Thumbnail.data:type_name -> client.ThumbnailData + 45, // [45:45] is the sub-list for method output_type + 45, // [45:45] is the sub-list for method input_type + 45, // [45:45] is the sub-list for extension type_name + 45, // [45:45] is the sub-list for extension extendee + 0, // [0:45] is the sub-list for field type_name } func init() { file_client_proto_init() } diff --git a/libgm/gmproto/client.pb.raw b/libgm/gmproto/client.pb.raw index a024fab3a9277619ff424e2f05fb65456c36d5d3..451ef995ee1bacfe3a49a0597e11159d5dea6fd0 100644 GIT binary patch delta 23 fcmbPgaN1x)ohZ{HrpXPW8zxT^GTUq*_LLC-ZZind delta 19 bcmX?YFx6l~ohZ{A#>ow$8#bqjJ!J#{Q1%Dl diff --git a/libgm/gmproto/client.proto b/libgm/gmproto/client.proto index 1ae10c2..886260d 100644 --- a/libgm/gmproto/client.proto +++ b/libgm/gmproto/client.proto @@ -297,6 +297,7 @@ message SendReactionRequest { string messageID = 1; conversations.ReactionData reactionData = 2; Action action = 3; + settings.SIMPayload SIMPayload = 4; } message SendReactionResponse { diff --git a/portal.go b/portal.go index e739faf..67fd497 100644 --- a/portal.go +++ b/portal.go @@ -2108,6 +2108,7 @@ func (portal *Portal) handleMatrixReaction(sender *User, evt *event.Event) error MessageID: msg.ID, ReactionData: gmproto.MakeReactionData(emoji), Action: action, + SIMPayload: sender.GetSIM(portal.OutgoingID).GetSIMData().GetSIMPayload(), }) if err != nil { return fmt.Errorf("failed to send reaction: %w", err)