You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that issue #84 already covers one specific case of this: links to Users, which should be displayed as a special UserTag widget.
This issue covers one other type of matrix.to links:
Specific events, e.g., https://matrix.to/#/#matrix:matrix.org/$1448831580433WbpiJ:jki.re
Note that direct links to messages can have other parameters in the URL, such as https://matrix.to/#/!nCULugmcNjxWftdWKg:matrix.org/$5ACiF5sT29-mPyxc3vVviMj4ouaZYHVPMRfzarmso1s?via=matrix.org
Links to a message
We should create a MessageTag widget similar to the RoomTag widget mentioned above, which looks like this in Element:
Upon click, we should determine which room the linked message belongs to. If the current user has already joined that room, we should open that room's timeline view and then attempt to jump to the event in that room with the given EventId.
That message should be highlighted temporarily for emphasis.
If the user has not yet joined the room containing that linked message, we should open the same room preview as we do for direct links to the room itself. In this case, I don't think there's any other actions we can take -- but we should investigate whether it's possible to obtain a preview of a specific message without having joined that room.
Important Note: it is a common case for a user to be unable to view a specific message, as it may have occurred before they had the permissions to view messages in that room. So we must handle that error case gracefully; here's what Element shows in that case:
Difficulty surrounding timeline focus mode
For this, we need to temporarily create a new timeline that is focused on the specific linked-to event. This is difficult because although the Matrix SDK claims it supports changing the focus mode of a given timeline, it does not actually support that, so we cannot simply re-use an existing timeline for the room containing that event.
Thus, we have to create a new separate timeline instance using TimelineBuilder::with_focus() (using TimelineFocus::Event), and then just use that new timeline instance as a temporary way to preview this Event.
The text was updated successfully, but these errors were encountered:
kevinaboos
changed the title
Properly handle matrix.to links for a specific event
Properly handle matrix.to links to a specific event (message)
Oct 31, 2024
@kevinaboos Should we create three different tags for each of them or combine them into one tag and display them in a single tag, since they all look similar?
those are three different tags, but of course you can create one underlying view for a "pill" UI element that gets re-used for all three tag types. That would be a good way to implement it.
tyreseluo
added a commit
to tyreseluo/robrix
that referenced
this issue
Nov 20, 2024
These links are special and should be handled via in-app actions rather than by opening them as a regular URL in the system browser.
There is a separate issue for handling
matrix.to
links to a specific Room, which is easier: #87Implementation
Currently, Robrix just ignores
matrix.to
links that are clicked on, as seen in the code here:robrix/src/home/room_screen.rs
Lines 857 to 868 in 61f4994
Note that issue #84 already covers one specific case of this: links to Users, which should be displayed as a special
UserTag
widget.This issue covers one other type of
matrix.to
links:https://matrix.to/#/#matrix:matrix.org/$1448831580433WbpiJ:jki.re
https://matrix.to/#/!nCULugmcNjxWftdWKg:matrix.org/$5ACiF5sT29-mPyxc3vVviMj4ouaZYHVPMRfzarmso1s?via=matrix.org
Links to a message
We should create a
MessageTag
widget similar to theRoomTag
widget mentioned above, which looks like this in Element:Upon click, we should determine which room the linked message belongs to. If the current user has already joined that room, we should open that room's timeline view and then attempt to jump to the event in that room with the given
EventId
.That message should be highlighted temporarily for emphasis.
If the user has not yet joined the room containing that linked message, we should open the same room preview as we do for direct links to the room itself. In this case, I don't think there's any other actions we can take -- but we should investigate whether it's possible to obtain a preview of a specific message without having joined that room.
Important Note: it is a common case for a user to be unable to view a specific message, as it may have occurred before they had the permissions to view messages in that room. So we must handle that error case gracefully; here's what Element shows in that case:
Difficulty surrounding timeline focus mode
For this, we need to temporarily create a new timeline that is focused on the specific linked-to event. This is difficult because although the Matrix SDK claims it supports changing the focus mode of a given timeline, it does not actually support that, so we cannot simply re-use an existing timeline for the room containing that event.
Thus, we have to create a new separate timeline instance using
TimelineBuilder::with_focus()
(usingTimelineFocus::Event
), and then just use that new timeline instance as a temporary way to preview this Event.The text was updated successfully, but these errors were encountered: