From 9dbdbe692285c70d2b2bf713f2b21b156a87055c Mon Sep 17 00:00:00 2001 From: Chandni Verma Date: Sat, 26 Feb 2011 04:29:46 +0530 Subject: Fire a "part-command-entered" signal from libempathy-gtk/empathy-chat.c to be caught in src/empathy-chat-window.c Fixes linking issues: https://bugzilla.gnome.org/show_bug.cgi?id=643295 --- src/empathy-chat-window.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 94f93e2bf..8da1cc2f2 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -1482,6 +1482,27 @@ chat_window_new_message_cb (EmpathyChat *chat, chat_window_icon_update (priv, TRUE); } +static void +chat_window_command_part (EmpathyChat *chat, + GStrv strv) +{ + EmpathyChat *chat_to_be_parted; + + if (strv[1] == NULL) { + empathy_tp_chat_leave (empathy_chat_get_tp_chat (chat), ""); + return; + } + chat_to_be_parted = empathy_chat_window_find_chat ( + empathy_chat_get_account (chat), strv[1]); + + if (chat_to_be_parted != NULL) { + 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]); + } +} + static GtkNotebook * notebook_create_window_cb (GtkNotebook *source, GtkWidget *page, @@ -1567,6 +1588,9 @@ chat_window_page_added_cb (GtkNotebook *notebook, g_signal_connect (chat, "new-message", G_CALLBACK (chat_window_new_message_cb), window); + g_signal_connect (chat, "part-command-entered", + G_CALLBACK (chat_window_command_part), + NULL); g_signal_connect (chat, "notify::tp-chat", G_CALLBACK (chat_window_update_chat_tab), window); -- cgit v1.2.3