Open room present link with p
This commit is contained in:
parent
20186bda5c
commit
acb03b1f09
2 changed files with 15 additions and 1 deletions
|
|
@ -14,6 +14,9 @@ Procedure when bumping the version number:
|
|||
|
||||
## Unreleased
|
||||
|
||||
### Added
|
||||
- Key binding to open present page
|
||||
|
||||
### Changed
|
||||
- Always connect to &rl2dev in ephemeral mode
|
||||
- Reduce amount of messages per &rl2dev log request
|
||||
|
|
|
|||
|
|
@ -388,6 +388,7 @@ impl EuphRoom {
|
|||
// Inspecting messages
|
||||
bindings.binding("i", "inspect message");
|
||||
bindings.binding("I", "show message links");
|
||||
bindings.binding("ctrl+p", "open room's plugh.de/present page");
|
||||
}
|
||||
|
||||
async fn handle_room_input_event(&mut self, event: &InputEvent, status: &RoomStatus) -> bool {
|
||||
|
|
@ -425,7 +426,7 @@ impl EuphRoom {
|
|||
_ => {}
|
||||
}
|
||||
|
||||
// Inspecting messages
|
||||
// Always applicable
|
||||
match event {
|
||||
key!('i') => {
|
||||
if let Some(id) = self.chat.cursor().await {
|
||||
|
|
@ -443,6 +444,16 @@ impl EuphRoom {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
key!(Ctrl + 'p') => {
|
||||
let link = format!("https://plugh.de/present/{}/", self.vault.room());
|
||||
if let Err(error) = open::that(&link) {
|
||||
self.popups.push_front(RoomPopup::Error {
|
||||
description: format!("Failed to open link: {link}"),
|
||||
reason: format!("{error}"),
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue