A bit more progress on channels

This commit is contained in:
2020-05-17 00:49:46 +01:00
parent 09afdf51a4
commit 7003b56ce6
9 changed files with 224 additions and 162 deletions

View File

@@ -13,13 +13,12 @@ use crate::telepathy;
// FIXME: I'm assuming that all channels will be of type text and 1-1 for now.
#[derive(Debug)]
pub struct Channel {
pub path: dbus::Path<'static>,
}
// "This SHOULD NOT include the channel type and channel interface itself"
pub fn channel_interfaces() -> Vec<String> {
vec![
"org.freedesktop.Telepathy.Channel.Interface.Messages".to_string(),
]
vec!["org.freedesktop.Telepathy.Channel.Interface.Messages".to_string()]
}
type Result<T> = std::result::Result<T, dbus::tree::MethodErr>;
@@ -37,8 +36,7 @@ impl Channel {
let messages_iface =
telepathy::channel_interface_messages_server(&f, (), move |_| c_rc2.clone());
let type_text_iface =
telepathy::channel_type_text_server(&f, (), move |_| c_rc.clone());
let type_text_iface = telepathy::channel_type_text_server(&f, (), move |_| c_rc.clone());
tree = tree.add(
f.object_path("", ())