From 5324df2fe08ece901d34271afc56ac41e5100fbf Mon Sep 17 00:00:00 2001 From: Chandni Verma Date: Mon, 28 Feb 2011 05:07:31 +0530 Subject: Send full message for the default chat parted on part command --- libempathy/empathy-tp-chat.c | 3 +++ src/empathy-chat-window.c | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index a56c08a32..87540f21a 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -1837,6 +1837,9 @@ empathy_tp_chat_leave (EmpathyTpChat *self, { EmpathyTpChatPriv *priv = GET_PRIV (self); + DEBUG ("Leaving channel %s with message \"%s\"", + tp_channel_get_identifier (priv->channel), message); + tp_channel_leave_async (priv->channel, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, message, tp_channel_leave_async_cb, self); } diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 8da1cc2f2..b7bb6c874 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -1499,7 +1499,20 @@ chat_window_command_part (EmpathyChat *chat, empathy_tp_chat_leave (empathy_chat_get_tp_chat (chat_to_be_parted), strv[2]); } else { - empathy_tp_chat_leave (empathy_chat_get_tp_chat (chat), strv[1]); + gchar *message; + + /* Going by the syntax of PART command: + * + * /PART [] [] + * + * Chatroom-ID is not a must to specify a reason. + * If strv[1] (chatroom-ID) is not a valid identifier for a connected + * MUC then the current chatroom should be parted and srtv[1] should + * be treated as part of the optional part-message. */ + message = g_strconcat (strv[1], " ", strv[2], NULL); + empathy_tp_chat_leave (empathy_chat_get_tp_chat (chat), message); + + g_free (message); } } -- cgit v1.2.3