From 8509734ff9579ef922305b0e6dd5e28dfec8009c Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sat, 21 Feb 2009 00:47:27 +0100 Subject: [PATCH] Simplify empathy_contact_get_account --- libempathy/empathy-contact.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index a44abfe6..37910928 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 * -- 2.39.2