]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-tp-chat.c
include telepathy-glib.h
[empathy.git] / libempathy / empathy-tp-chat.c
index 6dc1a3277c61ccac3512b9e687e17b9b86135223..39ed8e2ab82fa4ea63db96498bba3122fb5acac0 100644 (file)
@@ -22,8 +22,6 @@
 
 #include <string.h>
 
-#include <telepathy-glib/telepathy-glib.h>
-
 #include <extensions/extensions.h>
 
 #include "empathy-tp-chat.h"
@@ -500,7 +498,7 @@ list_pending_messages (EmpathyTpChat *self)
 {
   GList *messages, *l;
 
-  messages = tp_text_channel_get_pending_messages (TP_TEXT_CHANNEL (self));
+  messages = tp_text_channel_dup_pending_messages (TP_TEXT_CHANNEL (self));
 
   for (l = messages; l != NULL; l = g_list_next (l))
     {
@@ -509,7 +507,7 @@ list_pending_messages (EmpathyTpChat *self)
       handle_incoming_message (self, message, FALSE);
     }
 
-  g_list_free (messages);
+  g_list_free_full (messages, g_object_unref);
 }
 
 static void
@@ -1119,7 +1117,7 @@ empathy_tp_chat_get_account (EmpathyTpChat *self)
 
   g_return_val_if_fail (EMPATHY_IS_TP_CHAT (self), NULL);
 
-  connection = tp_channel_borrow_connection (TP_CHANNEL (self));
+  connection = tp_channel_get_connection (TP_CHANNEL (self));
 
   return tp_connection_get_account (connection);
 }
@@ -1287,7 +1285,7 @@ tp_chat_prepare_ready_async (TpProxy *proxy,
   self->priv->ready_result = g_simple_async_result_new (G_OBJECT (self),
     callback, user_data, tp_chat_prepare_ready_async);
 
-  connection = tp_channel_borrow_connection (channel);
+  connection = tp_channel_get_connection (channel);
 
   if (tp_proxy_has_interface_by_id (self,
         TP_IFACE_QUARK_CHANNEL_INTERFACE_PASSWORD))