Add key binding to download more logs

This commit is contained in:
Joscha 2022-08-22 21:15:04 +02:00
parent 4956027027
commit 669e52a2ee
3 changed files with 14 additions and 0 deletions

View file

@ -458,6 +458,12 @@ impl Room {
.map_err(|_| Error::Stopped)
}
pub fn log(&self) -> Result<(), Error> {
self.event_tx
.send(Event::RequestLogs)
.map_err(|_| Error::Stopped)
}
pub fn nick(&self, name: String) -> Result<(), Error> {
self.event_tx
.send(Event::Nick(name))

View file

@ -284,6 +284,7 @@ impl EuphRoom {
}
Some(Status::Joined(_)) => {
bindings.binding("n", "change nick");
bindings.binding("m", "download more messages");
bindings.binding("A", "show account ui");
true
}
@ -337,6 +338,12 @@ impl EuphRoom {
self.state = State::Nick(nick::new(joined));
true
}
key!('m') => {
if let Some(room) = &self.room {
let _ = room.log();
}
true
}
key!('A') => {
self.state = State::Account(AccountUiState::new());
true