Add a very broken ContactList + outgoing channel implementation

Right now, messages don't show on the padfoot side any more, but they
do get sent and received successfully on the other side, and empathy
can manage contacts now, so I'm calling it an overall win.
This commit is contained in:
2020-05-21 02:30:47 +01:00
parent aae7607c7f
commit 15174ea03f
7 changed files with 245 additions and 66 deletions

View File

@@ -1,4 +1,4 @@
use crate::padfoot::{var_str, VarArg};
use crate::padfoot::{var_str, var_u32, VarArg};
use crate::telepathy;
use dbus::tree::MethodErr;
@@ -48,18 +48,17 @@ impl telepathy::ConnectionInterfaceContacts for Connection {
"org.freedesktop.Telepathy.Connection.Interface.Avatars/token".to_string(),
var_str("".to_string()),
);
/*
// TODO: we need to publish DBUS services on these endpoints
props.insert(
"org.freedesktop.Telepathy.Connection.Interface.ContactList/publish".to_string(),
var_arg(Box::new(4)),
);
props.insert(
"org.freedesktop.Telepathy.Connection.Interface.ContactList/subscribe".to_string(),
var_arg(Box::new(4)),
);
*/
props.insert(
"org.freedesktop.Telepathy.Connection.Interface.ContactList/publish".to_string(),
var_u32(4), // YES (faking it for now)
);
props.insert(
"org.freedesktop.Telepathy.Connection.Interface.ContactList/subscribe".to_string(),
var_u32(4), // YES (faking it for now)
);
out.insert(*id, props);
}
@@ -101,7 +100,7 @@ impl telepathy::ConnectionInterfaceContacts for Connection {
Ok(vec![
"org.freedesktop.Telepathy.Connection".to_string(),
"org.freedesktop.Telepathy.Connection.Interface.Avatars".to_string(),
// "org.freedesktop.Telepathy.Connection.Interface.ContactList".to_string(),
"org.freedesktop.Telepathy.Connection.Interface.ContactList".to_string(),
])
}
}