# HG changeset patch # User Elliott Sales de Andrade # Date 1250998339 0 # Node ID c51d9e31ec22c8bbe709e1e06e1229b17341bcbb # Parent 36c6601d650af7f7d604d5d68ec6910fe3d170f3# Parent 208f4d20ac5d3c6c092ed6a43cb9dec37e1f8d89 merge of '375487659d7425062cb32079e5be08ac45951bd8' and '458e696572314f8fd2d259d40713ad955dd82581' diff -r 36c6601d650a -r c51d9e31ec22 PLUGIN_HOWTO --- a/PLUGIN_HOWTO Sun Aug 23 03:31:52 2009 +0000 +++ b/PLUGIN_HOWTO Sun Aug 23 03:32:19 2009 +0000 @@ -1,6 +1,6 @@ For information on writing a plugin for Purple, Pidgin or Finch, go -http://developer.pidgin.im and click on API. From there, see the HOWTOs in the -"Related Pages" section. +http://developer.pidgin.im and click on API. From there, see the +HOWTOs in the "Related Pages" section. You can also generate this documentation locally by installing doxygen and graphviz dot, then running "make docs" in the diff -r 36c6601d650a -r c51d9e31ec22 finch/plugins/grouping.c --- a/finch/plugins/grouping.c Sun Aug 23 03:31:52 2009 +0000 +++ b/finch/plugins/grouping.c Sun Aug 23 03:32:19 2009 +0000 @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #define PURPLE_PLUGIN diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/bonjour/bonjour_ft.c --- a/libpurple/protocols/bonjour/bonjour_ft.c Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/bonjour/bonjour_ft.c Sun Aug 23 03:32:19 2009 +0000 @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include "internal.h" #include "util.h" diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/bonjour/bonjour_ft.h --- a/libpurple/protocols/bonjour/bonjour_ft.h Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/bonjour/bonjour_ft.h Sun Aug 23 03:32:19 2009 +0000 @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef _BONJOUR_FT_H_ #define _BONJOUR_FT_H_ diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/jabber/data.c --- a/libpurple/protocols/jabber/data.c Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/jabber/data.c Sun Aug 23 03:32:19 2009 +0000 @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ #include diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/jabber/data.h --- a/libpurple/protocols/jabber/data.h Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/jabber/data.h Sun Aug 23 03:32:19 2009 +0000 @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ #ifndef PURPLE_JABBER_DATA_H diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/jabber/ibb.c --- a/libpurple/protocols/jabber/ibb.c Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/jabber/ibb.c Sun Aug 23 03:32:19 2009 +0000 @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ #include "internal.h" diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/jabber/ibb.h --- a/libpurple/protocols/jabber/ibb.h Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/jabber/ibb.h Sun Aug 23 03:32:19 2009 +0000 @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ #ifndef PURPLE_JABBER_IBB_H_ diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/msn/cmdproc.h --- a/libpurple/protocols/msn/cmdproc.h Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/msn/cmdproc.h Sun Aug 23 03:32:19 2009 +0000 @@ -71,6 +71,4 @@ void msn_cmdproc_process_payload(MsnCmdProc *cmdproc, char *payload, int payload_len); -void msn_cmdproc_disconnect(MsnCmdProc *cmdproc); - #endif /* _MSN_CMDPROC_H_ */ diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/msn/contact.c --- a/libpurple/protocols/msn/contact.c Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/msn/contact.c Sun Aug 23 03:32:19 2009 +0000 @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include "msn.h" diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/msn/contact.h --- a/libpurple/protocols/msn/contact.h Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/msn/contact.h Sun Aug 23 03:32:19 2009 +0000 @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef _MSN_CONTACT_H_ #define _MSN_CONTACT_H_ diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/msn/oim.c --- a/libpurple/protocols/msn/oim.c Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/msn/oim.c Sun Aug 23 03:32:19 2009 +0000 @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include "msn.h" #include "soap.h" diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/msn/oim.h --- a/libpurple/protocols/msn/oim.h Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/msn/oim.h Sun Aug 23 03:32:19 2009 +0000 @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef _MSN_OIM_H_ #define _MSN_OIM_H_ diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/msn/soap.c --- a/libpurple/protocols/msn/soap.c Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/msn/soap.c Sun Aug 23 03:32:19 2009 +0000 @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include "internal.h" diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/msn/soap.h --- a/libpurple/protocols/msn/soap.h Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/msn/soap.h Sun Aug 23 03:32:19 2009 +0000 @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef _MSN_SOAP_H diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/qq/qq_crypt.c --- a/libpurple/protocols/qq/qq_crypt.c Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/qq/qq_crypt.c Sun Aug 23 03:32:19 2009 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * * * QQ encryption algorithm diff -r 36c6601d650a -r c51d9e31ec22 libpurple/protocols/qq/qq_crypt.h --- a/libpurple/protocols/qq/qq_crypt.h Sun Aug 23 03:31:52 2009 +0000 +++ b/libpurple/protocols/qq/qq_crypt.h Sun Aug 23 03:32:19 2009 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef _QQ_CRYPT_H_ diff -r 36c6601d650a -r c51d9e31ec22 pidgin/gtkmedia.h --- a/pidgin/gtkmedia.h Sun Aug 23 03:31:52 2009 +0000 +++ b/pidgin/gtkmedia.h Sun Aug 23 03:32:19 2009 +0000 @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __GTKMEDIA_H_ diff -r 36c6601d650a -r c51d9e31ec22 pidgin/gtknotify.c --- a/pidgin/gtknotify.c Sun Aug 23 03:31:52 2009 +0000 +++ b/pidgin/gtknotify.c Sun Aug 23 03:32:19 2009 +0000 @@ -60,6 +60,7 @@ { PurpleAccount *account; PurplePounce *pounce; + char *pouncee; } PidginNotifyPounceData; @@ -155,6 +156,7 @@ -1); gtk_tree_store_remove(dialog->treemodel, &iter); + g_free(pounce_data->pouncee); g_free(pounce_data); } @@ -173,8 +175,29 @@ PIDGIN_POUNCE_DATA, &pounce_data, -1); - if (pounce_data != NULL) + if (pounce_data != NULL) { + g_free(pounce_data->pouncee); g_free(pounce_data); + } +} + +static void +open_im_foreach(GtkTreeModel *model, GtkTreePath *path, + GtkTreeIter *iter, gpointer data) +{ + PidginNotifyPounceData *pounce_data; + + gtk_tree_model_get(model, iter, + PIDGIN_POUNCE_DATA, &pounce_data, + -1); + + if (pounce_data != NULL) { + PurpleConversation *conv; + + conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, + pounce_data->account, pounce_data->pouncee); + purple_conversation_present(conv); + } } static void @@ -211,6 +234,17 @@ } static void +pounce_response_open_ims() +{ + GtkTreeSelection *selection; + + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(pounce_dialog->treeview)); + gtk_tree_selection_selected_foreach(selection, open_im_foreach, pounce_dialog); + + pounce_response_dismiss(); +} + +static void pounce_response_edit_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) { @@ -246,6 +280,9 @@ case GTK_RESPONSE_DELETE_EVENT: pounce_response_close(dialog); break; + case GTK_RESPONSE_YES: + pounce_response_open_ims(); + break; case GTK_RESPONSE_NO: pounce_response_dismiss(); break; @@ -261,68 +298,53 @@ pounce_row_selected_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data) { - GtkTreeIter iter; GtkTreeSelection *selection; - gboolean selected; - GList *list; + int count; selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(pounce_dialog->treeview)); - selected = gtk_tree_selection_get_selected(selection, - NULL, &iter); + count = gtk_tree_selection_count_selected_rows(selection); - if (selected) { - PurplePounce *pounce; + if (count == 0) { + gtk_widget_set_sensitive(pounce_dialog->open_button, FALSE); + gtk_widget_set_sensitive(pounce_dialog->edit_button, FALSE); + gtk_widget_set_sensitive(pounce_dialog->dismiss_button, FALSE); + } else if (count == 1) { + GList *pounces; + GList *list; PidginNotifyPounceData *pounce_data; + GtkTreeIter iter; - list = purple_pounces_get_all(); - + list = gtk_tree_selection_get_selected_rows(selection, NULL); + gtk_tree_model_get_iter(GTK_TREE_MODEL(pounce_dialog->treemodel), + &iter, list->data); gtk_tree_model_get(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter, PIDGIN_POUNCE_DATA, &pounce_data, -1); - - gtk_widget_set_sensitive(pounce_dialog->edit_button, FALSE); + g_list_foreach(list, (GFunc)gtk_tree_path_free, NULL); + g_list_free(list); - for (; list != NULL; list = list->next) { - pounce = list->data; + pounces = purple_pounces_get_all(); + for (; pounces != NULL; pounces = pounces->next) { + PurplePounce *pounce = pounces->data; if (pounce == pounce_data->pounce) { gtk_widget_set_sensitive(pounce_dialog->edit_button, TRUE); break; } } + gtk_widget_set_sensitive(pounce_dialog->open_button, TRUE); gtk_widget_set_sensitive(pounce_dialog->dismiss_button, TRUE); } else { + gtk_widget_set_sensitive(pounce_dialog->open_button, TRUE); gtk_widget_set_sensitive(pounce_dialog->edit_button, FALSE); - gtk_widget_set_sensitive(pounce_dialog->dismiss_button, FALSE); + gtk_widget_set_sensitive(pounce_dialog->dismiss_button, TRUE); } } static void -pounce_row_activated_cb(GtkTreeView *tv, GtkTreePath *path, - GtkTreeViewColumn *col, gpointer data) -{ - PidginNotifyPounceData *pounce_data; - PurpleAccount *account; - GtkTreeIter iter; - - if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter, path)) - return; - - gtk_tree_model_get(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter, - PIDGIN_POUNCE_DATA, &pounce_data, -1); - - account = pounce_data->account; - - purple_conversation_new(PURPLE_CONV_TYPE_IM, account, - purple_account_get_username(account)); - - pounce_response_dismiss(); -} - -static void reset_mail_dialog(GtkDialog *unused) { if (mail_dialog->in_use) @@ -1388,6 +1410,7 @@ pounce_data->account = account; pounce_data->pounce = pounce; + pounce_data->pouncee = g_strdup(purple_pounce_get_pouncee(pounce)); gtk_tree_store_append(pounce_dialog->treemodel, &iter, NULL); @@ -1511,6 +1534,11 @@ gtk_window_set_title(GTK_WINDOW(dialog), _("New Pounces")); button = gtk_dialog_add_button(GTK_DIALOG(dialog), + _("IM"), GTK_RESPONSE_YES); + gtk_widget_set_sensitive(button, FALSE); + spec_dialog->open_button = button; + + button = gtk_dialog_add_button(GTK_DIALOG(dialog), _("Dismiss"), GTK_RESPONSE_NO); gtk_widget_set_sensitive(button, FALSE); spec_dialog->dismiss_button = button; @@ -1563,11 +1591,11 @@ gtk_label_set_markup(GTK_LABEL(label), _("You have pounced!")); sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(spec_dialog->treeview)); - gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); + gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE); g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(pounce_row_selected_cb), NULL); g_signal_connect(G_OBJECT(spec_dialog->treeview), "row-activated", - G_CALLBACK(pounce_row_activated_cb), NULL); + G_CALLBACK(pounce_response_open_ims), NULL); } gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);