Add rooms keybindings around autojoin rooms
This commit is contained in:
parent
a091855ea3
commit
03ddc5eb9b
2 changed files with 24 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ Procedure when bumping the version number:
|
||||||
- `euph.rooms.<name>.password` config option
|
- `euph.rooms.<name>.password` config option
|
||||||
- Key binding to change rooms sort order
|
- Key binding to change rooms sort order
|
||||||
- Key bindings to connect to/disconnect from all rooms
|
- Key bindings to connect to/disconnect from all rooms
|
||||||
|
- Key bindings to connect to autojoin rooms/disconnect from non-autojoin rooms
|
||||||
- Key bindings to move to parent/root message
|
- Key bindings to move to parent/root message
|
||||||
- Key bindings to view and open links in a message
|
- Key bindings to view and open links in a message
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -295,6 +295,8 @@ impl Rooms {
|
||||||
bindings.binding("C", "connect to all rooms");
|
bindings.binding("C", "connect to all rooms");
|
||||||
bindings.binding("d", "disconnect from selected room");
|
bindings.binding("d", "disconnect from selected room");
|
||||||
bindings.binding("D", "disconnect from all rooms");
|
bindings.binding("D", "disconnect from all rooms");
|
||||||
|
bindings.binding("a", "connect to all autojoin room");
|
||||||
|
bindings.binding("A", "disconnect from all non-autojoin rooms");
|
||||||
bindings.binding("n", "connect to new room");
|
bindings.binding("n", "connect to new room");
|
||||||
bindings.binding("X", "delete room");
|
bindings.binding("X", "delete room");
|
||||||
bindings.empty();
|
bindings.empty();
|
||||||
|
|
@ -369,6 +371,27 @@ impl Rooms {
|
||||||
room.disconnect();
|
room.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
key!('a') => {
|
||||||
|
for (name, options) in &self.config.euph.rooms {
|
||||||
|
if options.autojoin {
|
||||||
|
self.get_or_insert_room(name.clone()).connect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
key!('A') => {
|
||||||
|
for (name, room) in &mut self.euph_rooms {
|
||||||
|
let autojoin = self
|
||||||
|
.config
|
||||||
|
.euph
|
||||||
|
.rooms
|
||||||
|
.get(name)
|
||||||
|
.map(|r| r.autojoin)
|
||||||
|
.unwrap_or(false);
|
||||||
|
if !autojoin {
|
||||||
|
room.disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
key!('n') => self.state = State::Connect(EditorState::new()),
|
key!('n') => self.state = State::Connect(EditorState::new()),
|
||||||
key!('X') => {
|
key!('X') => {
|
||||||
// TODO Check whether user wanted this via popup
|
// TODO Check whether user wanted this via popup
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue