]> git.0d.be Git - empathy.git/blobdiff - src/empathy-invite-participant-dialog.c
roster-window: fix crash if empathy_chatroom_manager_find() failed
[empathy.git] / src / empathy-invite-participant-dialog.c
index d92b531ea5f7c58a25a6299f4ec188879c0caed2..437d8e6b7358bab9242923906201f0c59df889d3 100644 (file)
  */
 
 #include "config.h"
-
-#include <glib/gi18n.h>
-#include <folks/folks-telepathy.h>
-
 #include "empathy-invite-participant-dialog.h"
 
-#include <libempathy/empathy-utils.h>
+#include <glib/gi18n.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
 
-#include <libempathy-gtk/empathy-contact-chooser.h>
-#include <libempathy-gtk/empathy-individual-view.h>
-#include <libempathy-gtk/empathy-ui-utils.h>
+#include "empathy-contact-chooser.h"
+#include "empathy-utils.h"
 
 G_DEFINE_TYPE (EmpathyInviteParticipantDialog,
     empathy_invite_participant_dialog, GTK_TYPE_DIALOG);
@@ -114,7 +110,7 @@ get_tp_contact_for_chat (EmpathyInviteParticipantDialog *self,
 {
   TpConnection *chat_conn;
 
-  chat_conn = tp_channel_borrow_connection (TP_CHANNEL (self->priv->tp_chat));
+  chat_conn = tp_channel_get_connection (TP_CHANNEL (self->priv->tp_chat));
   if (chat_conn == NULL)
     return NULL;
 
@@ -150,16 +146,17 @@ filter_individual (EmpathyContactChooser *chooser,
   for (l = members; l != NULL; l = g_list_next (l))
     {
       EmpathyContact *member = l->data;
-      TpHandle handle;
+      TpContact *owner;
 
-      /* Try to get the non-channel specific handle. */
-      handle = tp_channel_group_get_handle_owner (
+      /* Try to get the non-channel specific contact. */
+      owner = tp_channel_group_get_contact_owner (
           TP_CHANNEL (self->priv->tp_chat),
-          empathy_contact_get_handle (member));
-      if (handle == 0)
-        handle = empathy_contact_get_handle (member);
+          empathy_contact_get_tp_contact (member));
+
+      if (owner == NULL)
+        owner = empathy_contact_get_tp_contact (member);
 
-      if (handle == tp_contact_get_handle (contact))
+      if (owner == contact)
         {
           display = FALSE;
           break;
@@ -176,7 +173,7 @@ has_contact_list (EmpathyInviteParticipantDialog *self)
 {
   TpConnection *conn;
 
-  conn = tp_channel_borrow_connection (TP_CHANNEL (self->priv->tp_chat));
+  conn = tp_channel_get_connection (TP_CHANNEL (self->priv->tp_chat));
 
   return tp_proxy_has_interface_by_id (conn,
       TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST);