Commit 4963b25ab8

4963b25ab88e92d5f439302ef824436ad5dbd720

parent: 3908d948da

Unregistered key

vaw <git@nlih.de> · 2026-10-01 22:19 UTC
committer: <noreply@github.com>

Support matrix uris with `:join` (#773)

Layout: unified · split

docs/iamb.1 +2
@@ -160,6 +160,8 @@ Send an invitation to a user to join the currently focused room.
160Join the focused preview room. 160Join the focused preview room.
161.It Sy ":join [room]" 161.It Sy ":join [room]"
162Join a room or open it if you are already joined. 162Join a room or open it if you are already joined.
163This accepts a room id, room alias, user id, matrix uri, or matrix.to link.
164If the argument refers to a user, a dm room with them is opened/created.
163.It Sy ":knock" 165.It Sy ":knock"
164Request to join the focused preview room. 166Request to join the focused preview room.
165.It Sy ":knock accept [user]" 167.It Sy ":knock accept [user]"
src/windows/mod.rs +7 −2
@@ -21,6 +21,7 @@ use modalkit_ratatui::list::{List, ListCursor, ListItem, ListState};
21 21
22use crate::base::{RoomNeeds, SortColumn, SortFieldRoom, SortFieldUser, SortOrder, UnreadInfo}; 22use crate::base::{RoomNeeds, SortColumn, SortFieldRoom, SortFieldUser, SortOrder, UnreadInfo};
23use crate::prelude::*; 23use crate::prelude::*;
24use crate::resolve_mxid;
24use crate::windows::room::{RoomState, room_command}; 25use crate::windows::room::{RoomState, room_command};
25use crate::windows::verify::VerifyItem; 26use crate::windows::verify::VerifyItem;
26use crate::windows::welcome::WelcomeState; 27use crate::windows::welcome::WelcomeState;
@@ -1050,9 +1051,13 @@ impl Window<IambInfo> for IambWindow {
1050 } else { 1051 } else {
1051 store.application.worker.create_dm(user_id.to_owned())?.into() 1052 store.application.worker.create_dm(user_id.to_owned())?.into()
1052 } 1053 }
1054 } else if let Ok(uri) = MatrixUri::parse(name.as_str()) {
1055 let id = resolve_mxid(store, uri.id().to_owned(), uri.via().to_owned())?;
1056 return IambWindow::open(id, store);
1057 } else if let Ok(uri) = MatrixToUri::parse(name.as_str()) {
1058 let id = resolve_mxid(store, uri.id().to_owned(), uri.via().to_owned())?;
1059 return IambWindow::open(id, store);
1053 } else { 1060 } else {
1054 // XXX: support passing matrix uris to `:join`
1055
1056 return Err(UIError::Failure("Could not parse room identifier".to_string())); 1061 return Err(UIError::Failure("Could not parse room identifier".to_string()));
1057 }; 1062 };
1058 1063