From c861f6fdd9d08c6d3ba50f5540c64b765f7bb1dd Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Sat, 9 May 2020 11:48:13 +0100 Subject: [PATCH] Displays the protocol in empathy --- .../icons/hicolor/scalable/apps/im-delta.svg | 167 ++++++++++++++++++ share/managers/padfoot.manager | 11 -- share/telepathy/managers/padfoot.manager | 12 ++ src/padfoot/connection_manager.rs | 16 +- 4 files changed, 191 insertions(+), 15 deletions(-) create mode 100644 share/icons/hicolor/scalable/apps/im-delta.svg delete mode 100644 share/managers/padfoot.manager create mode 100644 share/telepathy/managers/padfoot.manager diff --git a/share/icons/hicolor/scalable/apps/im-delta.svg b/share/icons/hicolor/scalable/apps/im-delta.svg new file mode 100644 index 0000000..819f903 --- /dev/null +++ b/share/icons/hicolor/scalable/apps/im-delta.svg @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/share/managers/padfoot.manager b/share/managers/padfoot.manager deleted file mode 100644 index 05499f0..0000000 --- a/share/managers/padfoot.manager +++ /dev/null @@ -1,11 +0,0 @@ -[ConnectionManager] -Name = padfoot -BusName = org.freedesktop.Telepathy.ConnectionManager.padfoot -ObjectPath = /org/freedesktop/Telepathy/ConnectionManager/padfoot - -[Protocol delta] -param-account = s required -param-password = s required secret - -EnglishName=Delta Chat -Icon=delta diff --git a/share/telepathy/managers/padfoot.manager b/share/telepathy/managers/padfoot.manager new file mode 100644 index 0000000..e6fd59f --- /dev/null +++ b/share/telepathy/managers/padfoot.manager @@ -0,0 +1,12 @@ +[ConnectionManager] +Name=padfoot +BusName=org.freedesktop.Telepathy.ConnectionManager.padfoot +ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/padfoot +Interfaces= + +[Protocol delta] +param-account=s required +param-password=s required secret +Interfaces= +EnglishName=Delta Chat +Icon=im-delta diff --git a/src/padfoot/connection_manager.rs b/src/padfoot/connection_manager.rs index c42d290..18c7cea 100644 --- a/src/padfoot/connection_manager.rs +++ b/src/padfoot/connection_manager.rs @@ -37,6 +37,8 @@ const FLAG_SECRET: u32 = 8; impl telepathy::ConnectionManager for ConnectionManager { fn get_parameters(&self, protocol: &str) -> Result, tree::MethodErr> { + println!("CM::get_parameters({})", protocol); + if protocol != PROTO { return Err(tree::MethodErr::no_arg()); // FIXME: should be NotImplemented? } @@ -59,21 +61,27 @@ impl telepathy::ConnectionManager for ConnectionManager { } fn list_protocols(&self) -> Result, tree::MethodErr> { + println!("CM::list_protocols()"); + Ok(vec![PROTO.to_string()]) } fn request_connection( &self, - _protocol: &str, - _parameters: HashMap<&str, arg::Variant>>, + protocol: &str, + parameters: HashMap<&str, arg::Variant>>, ) -> Result<(String, dbus::Path<'static>), tree::MethodErr> { + println!("CM::request_connection({}, {:?})", protocol, parameters); + Err(tree::MethodErr::no_arg()) } fn protocols(&self) -> Result, tree::MethodErr> { + println!("CM::protocols()"); + // If this map is empty or missing, clients SHOULD fall back to - // calling ListProtocol and GetParameters - Ok(HashMap::new()) + // calling ListProtocols and GetParameters + Err(tree::MethodErr::no_arg()) } fn interfaces(&self) -> Result, tree::MethodErr> {