]> git.0d.be Git - empathy.git/commitdiff
Request new Text Channel if the contact is online again and CM don't
authorXavier Claessens <xclaesse@gmail.com>
Wed, 28 Nov 2007 15:55:59 +0000 (15:55 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Wed, 28 Nov 2007 15:55:59 +0000 (15:55 +0000)
2007-11-28  Xavier Claessens  <xclaesse@gmail.com>

* libempathy-gtk/empathy-private-chat.c: Request new Text Channel if
the contact is online again and CM don't support offline message.

svn path=/trunk/; revision=450

ChangeLog
libempathy-gtk/empathy-private-chat.c

index 5c2c62568243a376a0a76444a7909ceaad372c1a..e923af9e64f5e4b599c1cc2a7ce315a958f33e04 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-28  Xavier Claessens  <xclaesse@gmail.com>
+
+       * libempathy-gtk/empathy-private-chat.c: Request new Text Channel if
+       the contact is online again and CM don't support offline message.
+
 2007-11-22  Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/empathy-group-chat.c: use ":" instead of "," for nick
index 30f46ad8bf0d2dc1fe187d1350799d3c0143e049..81b804d05aab441c3939b469f2d9a4d3f01d903c 100644 (file)
 #include <glade/glade.h>
 #include <glib/gi18n.h>
 
+#include <libmissioncontrol/mission-control.h>
+
 #include <libempathy/empathy-debug.h>
 #include <libempathy/empathy-tp-chat.h>
 #include <libempathy/empathy-tp-contact-list.h>
 #include <libempathy/empathy-contact-factory.h>
+#include <libempathy/empathy-utils.h>
 
 #include "empathy-private-chat.h"
 #include "empathy-chat-view.h"
@@ -171,7 +174,7 @@ private_chat_create_ui (EmpathyPrivateChat *chat)
 
 static void
 private_chat_contact_presence_updated_cb (EmpathyContact     *contact,
-                                         GParamSpec        *param,
+                                         GParamSpec         *param,
                                          EmpathyPrivateChat *chat)
 {
        EmpathyPrivateChatPriv *priv;
@@ -206,6 +209,21 @@ private_chat_contact_presence_updated_cb (EmpathyContact     *contact,
                }
 
                priv->is_online = TRUE;
+
+               /* If offline message is not supported by CM we need to
+                * request a new Text Channel. */
+               if (!empathy_chat_is_connected (EMPATHY_CHAT (chat))) {
+                       MissionControl *mc;
+
+                       mc = empathy_mission_control_new ();
+                       mission_control_request_channel (mc,
+                                                        empathy_contact_get_account (contact),
+                                                        TP_IFACE_CHANNEL_TYPE_TEXT,
+                                                        empathy_contact_get_handle (contact),
+                                                        TP_HANDLE_TYPE_CONTACT,
+                                                        NULL, NULL);
+                       g_object_unref (mc);
+               }
        }
 
        g_signal_emit_by_name (chat, "status-changed");