feat: Allow plugins to signal to deactivate themselves

Necessary when a plugin is unsupported
This commit is contained in:
Michael Aaron Murphy 2021-08-20 18:44:22 +02:00
parent 5ce96c624b
commit 6efad71f0e
3 changed files with 14 additions and 2 deletions

View file

@ -25,7 +25,11 @@ impl Type for Item {
pub async fn main() {
let connection = match Connection::new_session() {
Ok(conn) => conn,
Err(_) => return,
Err(_) => {
let mut out = async_stdout();
let _ = crate::send(&mut out, PluginResponse::Deactivate);
return;
}
};
let mut app = App::new(connection, async_stdout());