[empathy] Simplify empathy_contact_get_account



commit 8509734ff9579ef922305b0e6dd5e28dfec8009c
Author: Xavier Claessens <xclaesse gmail com>
Date:   Sat Feb 21 00:47:27 2009 +0100

    Simplify empathy_contact_get_account
---
 libempathy/empathy-contact.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index a44abfe..3791092 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 *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]