Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix message replies in e2e threads #57

Merged
merged 1 commit into from
May 7, 2024
Merged

Fix message replies in e2e threads #57

merged 1 commit into from
May 7, 2024

Conversation

javiercr
Copy link
Member

@javiercr javiercr commented May 7, 2024

In an e2e encrypted conversation/thread, message replies sent through the bridge were not rendered in Messenger web/desktop (while they were rendered in the Messenger mobile app).

Debugging the service worker for messenger.com, we can compare an incoming reply message sent from the official Messenger web client (left) to one sent from mautrix/meta bridge (right):

Untitled 2

From this, we can infer that quotedMessage.remoteJid is not needed (which, btw, used to have the same value as quotedMessage.participant).

@javiercr javiercr requested a review from tulir May 7, 2024 14:50
@@ -101,8 +101,7 @@ func (mc *MessageConverter) ToWhatsApp(
var meta waMsgApplication.MessageApplication_Metadata
if replyTo := mc.GetMetaReply(ctx, content); replyTo != nil {
meta.QuotedMessage = &waMsgApplication.MessageApplication_Metadata_QuotedMessage{
StanzaID: replyTo.ReplyMessageId,
RemoteJID: mc.GetData(ctx).JID().String(),
StanzaID: replyTo.ReplyMessageId,
// TODO: this is hacky since it hardcodes the server
// TODO 2: should this be included for DMs?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tulir does this clear this TODO?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, the TODO is for the Participant field

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh actually it might clear the second one if you've confirmed DMs are supposed to have that field. I think on WhatsApp the same field is meant for groups (and RemoteJID is used for DM recipient or group ID)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the screenshot in the PR description it seems that the Participant field is indeed required.

@javiercr javiercr merged commit c92240b into main May 7, 2024
11 checks passed
@javiercr javiercr deleted the fix/e2e-msg-replies branch May 7, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants