summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2009-09-28 14:19:32 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2009-09-28 14:41:09 +0100
commit5750c1ead1e2e594b39697776aa92d299cf6af95 (patch)
tree18155e829c9c69fa600d42da9d6c35f0437c2662
parent09dff83e4c10b1e361964a311a11beb67a452401 (diff)
account-manager: signal account-validity-changed to FALSE for accounts not in the hash table
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--telepathy-glib/account-manager.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/telepathy-glib/account-manager.c b/telepathy-glib/account-manager.c
index 8df01bd20..c779f35a4 100644
--- a/telepathy-glib/account-manager.c
+++ b/telepathy-glib/account-manager.c
@@ -335,25 +335,17 @@ _tp_account_manager_validity_changed_cb (TpAccountManager *proxy,
TpAccountManagerPrivate *priv = manager->priv;
TpAccount *account;
+ account = tp_account_manager_ensure_account (manager, path);
+
+ g_object_ref (account);
+
if (!valid)
- {
- account = g_hash_table_lookup (priv->accounts, path);
+ g_hash_table_remove (priv->accounts, path);
- if (account != NULL)
- {
- g_object_ref (account);
- g_hash_table_remove (priv->accounts, account);
- g_signal_emit (manager, signals[ACCOUNT_VALIDITY_CHANGED], 0,
- account, valid);
- g_object_unref (account);
- }
- }
- else
- {
- account = tp_account_manager_ensure_account (manager, path);
- g_signal_emit (manager, signals[ACCOUNT_VALIDITY_CHANGED], 0,
- account, valid);
- }
+ g_signal_emit (manager, signals[ACCOUNT_VALIDITY_CHANGED], 0,
+ account, valid);
+
+ g_object_unref (account);
}
static void