aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-02-21 07:47:27 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-04-22 18:21:13 +0800
commit8509734ff9579ef922305b0e6dd5e28dfec8009c (patch)
tree0fc4e573021ff327cc96849c8c297be6f7cf4c3c
parent2c9b0fdb4a5e4187e4bee87a4a12a1d5ddb98bb6 (diff)
downloadgsoc2013-empathy-8509734ff9579ef922305b0e6dd5e28dfec8009c.tar
gsoc2013-empathy-8509734ff9579ef922305b0e6dd5e28dfec8009c.tar.gz
gsoc2013-empathy-8509734ff9579ef922305b0e6dd5e28dfec8009c.tar.bz2
gsoc2013-empathy-8509734ff9579ef922305b0e6dd5e28dfec8009c.tar.lz
gsoc2013-empathy-8509734ff9579ef922305b0e6dd5e28dfec8009c.tar.xz
gsoc2013-empathy-8509734ff9579ef922305b0e6dd5e28dfec8009c.tar.zst
gsoc2013-empathy-8509734ff9579ef922305b0e6dd5e28dfec8009c.zip
Simplify empathy_contact_get_account
-rw-r--r--libempathy/empathy-contact.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index a44abfe68..379109285 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -527,10 +527,7 @@ empathy_contact_get_account (EmpathyContact *contact)
priv = GET_PRIV (contact);
- if (priv->account != NULL)
- return priv->account;
-
- if (priv->tp_contact != NULL)
+ if (priv->account == NULL && priv->tp_contact != NULL)
{
EmpathyAccountManager *manager;
TpConnection *connection;
@@ -539,12 +536,11 @@ empathy_contact_get_account (EmpathyContact *contact)
manager = empathy_account_manager_dup_singleton ();
connection = tp_contact_get_connection (priv->tp_contact);
priv->account = empathy_account_manager_get_account (manager, connection);
+ g_object_ref (priv->account);
g_object_unref (manager);
-
- return g_object_ref (priv->account);
}
- return NULL;
+ return priv->account;
}
TpConnection *