Bridge pinned messages between WhatsApp and Matrix#905
Open
kalix127 wants to merge 2 commits intomautrix:mainfrom
Open
Bridge pinned messages between WhatsApp and Matrix#905kalix127 wants to merge 2 commits intomautrix:mainfrom
kalix127 wants to merge 2 commits intomautrix:mainfrom
Conversation
This was referenced Mar 28, 2026
This was referenced Mar 29, 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.
Summary
This PR adds support for bridging pinned messages between WhatsApp and Matrix in both directions.
WhatsApp to Matrix
When a message is pinned or unpinned on WhatsApp, the bridge updates the room's
m.room.pinned_eventsstate event in Matrix instead of sending a text notice. The target message's Matrix event ID is looked up from the bridge database. If the message is not found in the database (e.g. predates the bridge), the pin is silently ignored.Matrix to WhatsApp
When a user pins or unpins a message from a Matrix client, the bridge diffs the old and new pinned event lists and sends the corresponding
PinInChatMessageto WhatsApp. Room power levels form.room.pinned_eventsare set when creating new portal rooms so users can pin from Matrix clients.This direction depends on two upstream changes:
PinHandlingNetworkAPIto bridgev2)getEditAttributefor pin messages)Files changed
pkg/connector/wamsgtype.go: AddedPinInChatMessagemessage type detectionpkg/connector/handlewhatsapp.go: AddedhandleWAPinInChat()for WhatsApp to Matrix pin state updatespkg/connector/handlematrix.go: AddedHandleMatrixPinChange()andsendPinInChat()for Matrix to WhatsApppkg/connector/capabilities.go: AddedStatePinnedEventsto room state featurespkg/connector/chatinfo.go: AddedStatePinnedEventspower levels for DM and group roomsCloses #731
Checklist