element-hq / element-hq/element-meta
History sharing: suppress "shared by Bob" message when Bob was the original sender
- Dominant language
- No language data
- Stars
- 112
- Forks
- 25
- Avg merge
- 6h 6m
- Merged PRs (30d)
- 4
Description
https://github.com/element-hq/element-meta/issues/2877 adds words like `Bob (@bob:example.com) shared this message with you` to messages where the key was shared via MSC4268.
This is somewhat meaningless when Bob was, in fact, the original sender, and it occurs to me that, in this case, we do not need to show the (i) icon at all.
I think we can best manage this with some tweaks on the rust side:
* First, stop setting `imported` on sessions imported from MSC4268 bundles. Instead, rely on `forwarder_data` to indicate that we didn't get the key directly. This will mean updating all of the call sites of `InboundGroupSession.has_been_imported` to take note of `forwarder_data`. (Incidentally, there is an [outdated TODO](https://github.com/matrix-org/matrix-rust-sdk/blob/42a5910d8f7feb52ba951098e66eb8883405be7d/crates/matrix-sdk-crypto/src/olm/group_sessions/inbound.rs#L789-L790) we should clean up)
* In `get_room_event_verification_state`, look for `forwarder_data.user_id` being the same as `sender`, and handle it the same as `sender_data` being `SenderData::SenderUnverified` or `SenderData::SenderVerified`, as approprieatte
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in crates/matrix-sdk-crypto/src/olm/group_sessions/inbound.rs, including the outdated TODO around the mentioned lines, then find all call sites of InboundGroupSession.has_been_imported and inspect get_room_event_verification_state. Update MSC4268 handling to use forwarder_data, and treat a matching forwarder_data.user_id and sender appropriately so the shared-by message and info icon are suppressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100