handle*: support encrypted message requests properly#305
Merged
Conversation
Previously incoming notifications that a pending message request thread was deleted/declined were silently dropped. Treat them the same as LSDeleteThread and emit a chat delete event.
tulir
reviewed
Jul 21, 2026
| } | ||
| if waKey, ok := tm.m.hybridThreadMap.Get(fbKey); ok { | ||
| return waKey | ||
| } |
Member
There was a problem hiding this comment.
Is this map actually needed? If it's only for LSDeletePartialThread, just let it fall back to the db instead of maintaining a separate cache
Comment on lines
+285
to
+291
| fbThreadKey, messageRequest, err := evt.m.Main.DB.GetHybridThreadInfoByJID(ctx, evt.m.UserLogin.ID, metaid.ParseFBPortalID(evt.GetPortalKey().ID)) | ||
| if err != nil { | ||
| zerolog.Ctx(ctx).Warn().Err(err).Msg("Failed to restore hybrid thread info") | ||
| } else if fbThreadKey != 0 { | ||
| info.MessageRequest = ptr.Ptr(messageRequest) | ||
| info.ExtraUpdates = bridgev2.MergeExtraUpdaters(info.ExtraUpdates, setFBThreadKey(fbThreadKey)) | ||
| } |
Member
There was a problem hiding this comment.
This looks like it should be inside makeWADirectChatInfo?
| case table.ENCRYPTED_OVER_WA_ONE_TO_ONE: | ||
| if meta.FBThreadKey != 0 { | ||
| return metaCapsWithE2EDelete | ||
| } |
Member
There was a problem hiding this comment.
Capabilities don't need to differentiate this unless there are legitimate cases where we won't have the FB thread key
tulir
reviewed
Jul 21, 2026
|
|
||
| func (m *MetaConnector) GetBridgeInfoVersion() (info, caps int) { | ||
| return 1, 15 | ||
| return 1, 16 |
Member
There was a problem hiding this comment.
The cap ID should also be updated to actually have it resend
Co-authored-by: Tulir Asokan <tulir@maunium.net>
tulir
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.