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

@ -19,6 +19,7 @@ Procedure when bumping the version number:
- Authentication dialog for password-protected rooms - Authentication dialog for password-protected rooms
- Error popups in rooms when something goes wrong - Error popups in rooms when something goes wrong
- `--ephemeral` flag that prevents cove from storing data permanently - `--ephemeral` flag that prevents cove from storing data permanently
- Key binding to download more logs
### Changed ### Changed
- Reduced amount of unnecessary redraws - Reduced amount of unnecessary redraws

View file

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

View file

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