[Telepathy-commits] [telepathy-mission-control/master] Invalidate proxy when account removed

mardy mardy at 64d1ce6a-1406-0410-9ac8-afed03b27183
Mon Nov 17 00:05:13 PST 2008


When an account is removed, invalidate the TpProxy.

git-svn-id: https://projects.maemo.org/svn/chavo/trunk/framework/open/telepathy-mission-control@20536 64d1ce6a-1406-0410-9ac8-afed03b27183
---
 libmcclient/mc-account.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libmcclient/mc-account.c b/libmcclient/mc-account.c
index ffc7775..150bd46 100644
--- a/libmcclient/mc-account.c
+++ b/libmcclient/mc-account.c
@@ -107,6 +107,14 @@ static McIfaceDescription iface_description = {
 };
 
 
+static void
+on_account_removed (TpProxy *proxy, gpointer user_data, GObject *weak_object)
+{
+    GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED,
+	"Account was removed" };
+    tp_proxy_invalidate (proxy, &e);
+}
+
 static inline void
 set_presence_gvalue (GValue *value, TpConnectionPresenceType type,
 		     const gchar *status, const gchar *message)
@@ -170,6 +178,8 @@ constructor (GType type,
     if (!parse_object_path (account))
 	return NULL;
 
+    mc_cli_account_connect_to_removed (account, on_account_removed,
+				       NULL, NULL, NULL, NULL);
     return (GObject *) account;
 }
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list