]> git.0d.be Git - empathy.git/commitdiff
Send full message for the default chat parted on part command
authorChandni Verma <chandniverma2112@gmail.com>
Sun, 27 Feb 2011 23:37:31 +0000 (05:07 +0530)
committerChandni Verma <chandniverma2112@gmail.com>
Sun, 8 May 2011 23:31:28 +0000 (05:01 +0530)
libempathy/empathy-tp-chat.c
src/empathy-chat-window.c

index a56c08a3286dd4426d1fea176eb8c444c4645fb2..87540f21adc868ef309449b9c2395b41f268e7d0 100644 (file)
@@ -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);
 }
index 8da1cc2f252327faf64ed280dc1e6353148dc610..b7bb6c8740a63b99552fa29ec1c2801582459e98 100644 (file)
@@ -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>] [<reason>]
+                *
+                * 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);
        }
 }