telepathy-glib: future-account: give a warning when creating the account again

Jonny Lamb jonny at kemper.freedesktop.org
Thu May 10 07:41:19 PDT 2012


Module: telepathy-glib
Branch: master
Commit: 3987baa5a05b7561cbfab17c1a667e0595f597a3
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=3987baa5a05b7561cbfab17c1a667e0595f597a3

Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date:   Fri Apr 27 15:51:51 2012 +0100

future-account: give a warning when creating the account again

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>

---

 telepathy-glib/future-account.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/telepathy-glib/future-account.c b/telepathy-glib/future-account.c
index 1301737..04c4f5d 100644
--- a/telepathy-glib/future-account.c
+++ b/telepathy-glib/future-account.c
@@ -112,6 +112,7 @@ struct _TpFutureAccountPrivate {
   TpAccountManager *account_manager;
 
   GSimpleAsyncResult *result;
+  gboolean created;
 
   gchar *cm_name;
   gchar *proto_name;
@@ -1066,6 +1067,8 @@ tp_future_account_create_account_cb (TpAccountManager *proxy,
       return;
     }
 
+  priv->created = TRUE;
+
   account = tp_simple_client_factory_ensure_account (
       tp_proxy_get_factory (proxy), account_path, NULL, &e);
 
@@ -1138,6 +1141,9 @@ tp_future_account_create_account_async (TpFutureAccount *self,
       return;
     }
 
+  if (priv->created)
+    WARNING ("trying to create an account which has already been created");
+
   priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
       tp_future_account_create_account_async);
 



More information about the telepathy-commits mailing list