Complete channel-closing behaviour
We now emit appropriate signals and return a non-error status code when a channel is closed.
This commit is contained in:
@@ -19,7 +19,7 @@ impl telepathy::Channel for Channel {
|
|||||||
.send(DbusAction::CloseChannel(self.path()))
|
.send(DbusAction::CloseChannel(self.path()))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
Err(MethodErr::no_arg())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated
|
// Deprecated
|
||||||
|
@@ -353,12 +353,22 @@ impl Connection {
|
|||||||
actq.send(DbusAction::Signal(legacy_sig.to_emit_message(&path)))
|
actq.send(DbusAction::Signal(legacy_sig.to_emit_message(&path)))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
DbusAction::CloseChannel(path) => {
|
DbusAction::CloseChannel(chan_path) => {
|
||||||
println!("*** Closing channel {}", path.clone());
|
println!("*** Closing channel {}", chan_path.clone());
|
||||||
let _chan = Arc::clone(&chans).write().unwrap().remove(&path);
|
let _chan = Arc::clone(&chans).write().unwrap().remove(&chan_path);
|
||||||
let t2 = tree.clone();
|
let t2 = tree.clone();
|
||||||
t2.lock().unwrap().remove(&path);
|
t2.lock().unwrap().remove(&chan_path);
|
||||||
// TODO: emit signals
|
|
||||||
|
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) => {
|
DbusAction::IncomingMessage(chat_id, msg_id) => {
|
||||||
println!("*** Incoming message: {} {}", chat_id, msg_id);
|
println!("*** Incoming message: {} {}", chat_id, msg_id);
|
||||||
|
Reference in New Issue
Block a user