From c289dc18ce15e60e94e82d9df9fec9dfce8ef7d4 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 28 Nov 2007 15:55:59 +0000 Subject: Request new Text Channel if the contact is online again and CM don't 2007-11-28 Xavier Claessens * 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 --- libempathy-gtk/empathy-private-chat.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'libempathy-gtk/empathy-private-chat.c') diff --git a/libempathy-gtk/empathy-private-chat.c b/libempathy-gtk/empathy-private-chat.c index 30f46ad8b..81b804d05 100644 --- a/libempathy-gtk/empathy-private-chat.c +++ b/libempathy-gtk/empathy-private-chat.c @@ -33,10 +33,13 @@ #include #include +#include + #include #include #include #include +#include #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"); -- cgit v1.2.3