diff --git a/src/padfoot/channel/channel.rs b/src/padfoot/channel/channel.rs index 28167ee..0db0336 100644 --- a/src/padfoot/channel/channel.rs +++ b/src/padfoot/channel/channel.rs @@ -19,7 +19,7 @@ impl telepathy::Channel for Channel { .send(DbusAction::CloseChannel(self.path())) .unwrap(); - Err(MethodErr::no_arg()) + Ok(()) } // Deprecated diff --git a/src/padfoot/connection.rs b/src/padfoot/connection.rs index 8babf36..074c504 100644 --- a/src/padfoot/connection.rs +++ b/src/padfoot/connection.rs @@ -353,12 +353,22 @@ impl Connection { actq.send(DbusAction::Signal(legacy_sig.to_emit_message(&path))) .unwrap(); } - DbusAction::CloseChannel(path) => { - println!("*** Closing channel {}", path.clone()); - let _chan = Arc::clone(&chans).write().unwrap().remove(&path); + DbusAction::CloseChannel(chan_path) => { + println!("*** Closing channel {}", chan_path.clone()); + let _chan = Arc::clone(&chans).write().unwrap().remove(&chan_path); let t2 = tree.clone(); - t2.lock().unwrap().remove(&path); - // TODO: emit signals + t2.lock().unwrap().remove(&chan_path); + + let requests_sig = telepathy::ConnectionInterfaceRequestsChannelClosed { + removed: chan_path.clone(), + }; + + let legacy_sig = telepathy::ChannelClosed {}; + + actq.send(DbusAction::Signal(requests_sig.to_emit_message(&path))) + .unwrap(); + actq.send(DbusAction::Signal(legacy_sig.to_emit_message(&chan_path))) + .unwrap(); } DbusAction::IncomingMessage(chat_id, msg_id) => { println!("*** Incoming message: {} {}", chat_id, msg_id);