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.
160160Join the focused preview room.
161161.It Sy ":join [room]"
162162Join 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.
163165.It Sy ":knock"
164166Request to join the focused preview room.
165167.It Sy ":knock accept [user]"
src/windows/mod.rs +7 −2
@@ -21,6 +21,7 @@ use modalkit_ratatui::list::{List, ListCursor, ListItem, ListState};
2121
2222use crate::base::{RoomNeeds, SortColumn, SortFieldRoom, SortFieldUser, SortOrder, UnreadInfo};
2323use crate::prelude::*;
24use crate::resolve_mxid;
2425use crate::windows::room::{RoomState, room_command};
2526use crate::windows::verify::VerifyItem;
2627use crate::windows::welcome::WelcomeState;
@@ -1050,9 +1051,13 @@ impl Window<IambInfo> for IambWindow {
10501051 } else {
10511052 store.application.worker.create_dm(user_id.to_owned())?.into()
10521053 }
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);
10531060 } else {
1054 // XXX: support passing matrix uris to `:join`
1055
10561061 return Err(UIError::Failure("Could not parse room identifier".to_string()));
10571062 };
10581063