]> git.0d.be Git - empathy.git/blobdiff - libempathy/gossip-utils.c
Fix indentation Fix not returning the contact in tp_contact_list_find()
[empathy.git] / libempathy / gossip-utils.c
index 668898712030f44dc5afda4309b3b7139dd08aa5..6ab70ce4a059d53b731342b9235c933855fdedb4 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <libxml/uri.h>
 #include <libmissioncontrol/mc-account.h>
+#include <libtelepathy/tp-helpers.h>
 
 #include "gossip-debug.h"
 #include "gossip-utils.h"
@@ -431,20 +432,18 @@ gossip_account_equal (gconstpointer a,
        return g_str_equal (name_a, name_b);
 }
 
-GossipContact *
-gossip_get_own_contact_from_contact (GossipContact  *contact)
+MissionControl *
+gossip_mission_control_new (void)
 {
-       EmpathyContactManager *manager;
-       McAccount             *account;
-       GossipContact         *own_contact;
+       static MissionControl *mc = NULL;
 
-       g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), NULL);
-
-       manager = empathy_contact_manager_new ();
-       account = gossip_contact_get_account (contact);
-       own_contact = empathy_contact_manager_get_own (manager, account);
-       g_object_unref (manager);
+       if (!mc) {
+               mc = mission_control_new (tp_get_bus ());
+               g_object_add_weak_pointer (G_OBJECT (mc), (gpointer) &mc);
+       } else {
+               g_object_ref (mc);
+       }
 
-       return own_contact;
+       return mc;
 }