Skip to content

Commit c0c2e21

Browse files
committed
message,send: move messageContextInfo outside deviceSentMessage
1 parent 0898c45 commit c0c2e21

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

message.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ func (cli *Client) handleProtocolMessage(info *types.MessageInfo, msg *waE2E.Mes
550550
}
551551

552552
func (cli *Client) processProtocolParts(info *types.MessageInfo, msg *waE2E.Message) {
553+
cli.storeMessageSecret(info, msg)
553554
// Hopefully sender key distribution messages and protocol messages can't be inside ephemeral messages
554555
if msg.GetDeviceSentMessage().GetMessage() != nil {
555556
msg = msg.GetDeviceSentMessage().GetMessage()
@@ -566,7 +567,6 @@ func (cli *Client) processProtocolParts(info *types.MessageInfo, msg *waE2E.Mess
566567
if msg.GetProtocolMessage() != nil {
567568
cli.handleProtocolMessage(info, msg)
568569
}
569-
cli.storeMessageSecret(info, msg)
570570
}
571571

572572
func (cli *Client) storeMessageSecret(info *types.MessageInfo, msg *waE2E.Message) {

send.go

+1
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,7 @@ func marshalMessage(to types.JID, message *waE2E.Message) (plaintext, dsmPlainte
993993
DestinationJID: proto.String(to.String()),
994994
Message: message,
995995
},
996+
MessageContextInfo: message.MessageContextInfo,
996997
})
997998
if err != nil {
998999
err = fmt.Errorf("failed to marshal message (for own devices): %w", err)

0 commit comments

Comments
 (0)