Remove the buddy pounces api
This feature has more or less been stalkerware since its inception and the
only useful feature that came of it was offline message emulation which isn't
necessary for most networks nowadays.
Testing Done:
Compiled and ran locally.
Reviewed at https://reviews.imfreedom.org/r/322/
--- a/ChangeLog.API Sat Jan 02 21:58:08 2021 -0600
+++ b/ChangeLog.API Sat Jan 02 22:05:09 2021 -0600
@@ -373,6 +373,7 @@
* PurpleEventLoopUiOps. Manually drive the GLib event loop
yourself. See GLib Main Event Loop docs.
* purple_fd_get_ip. Use GSocket instead.
* purple_get_host_name. Use g_get_host_name, instead.
* purple_get_tzoff_str(). Use g_date_time_format, instead.
* purple_ip_address_is_valid, purple_ipv4_address_is_valid, and
@@ -436,7 +437,39 @@
* purple_plugins_unregister_unload_notify_cb
* purple_plugins_unload_all
+ * purple_pounce_action_get_attribute + * purple_pounce_action_is_enabled + * purple_pounce_action_register + * purple_pounce_action_set_attribute + * purple_pounce_action_set_enabled + * purple_pounce_destroy + * purple_pounce_destroy_all_by_account + * purple_pounce_destroy_all_by_buddy + * purple_pounce_execute + * purple_pounce_get_data + * purple_pounce_get_events + * purple_pounce_get_options + * purple_pounce_get_pouncee + * purple_pounce_get_pouncer + * purple_pounce_get_save + * purple_pounce_set_data + * purple_pounce_set_events + * purple_pounce_set_options + * purple_pounce_set_pouncee + * purple_pounce_set_pouncer + * purple_pounce_set_save + * purple_pounces_get_all + * purple_pounces_get_all_for_ui + * purple_pounces_get_handle + * purple_pounces_register_handler + * purple_pounces_uninit + * purple_pounces_unregister_handler * PurpleProxyConnectFunction
@@ -665,6 +698,11 @@
* pidgin_menu_position_func_helper
* pidgin_mini_dialog_links_supported
* pidgin_pixbuf_toolbar_button_from_stock
+ * pidgin_pounce_editor_show + * pidgin_pounces_get_handle + * pidgin_pounces_manager_hide + * pidgin_pounces_manager_show * pidgin_protocol_option_menu_get_selected
* pidgin_set_custom_buddy_icon
* pidgin_set_sensitive_if_input
@@ -705,6 +743,12 @@
* gnt_ui_uninit renamed to finch_ui_uninit
+ * finch_pounce_editor_show + * finch_pounces_get_handle + * finch_pounces_manager_hide + * finch_pounces_manager_show * finch_sound_get_active_profile
* finch_sound_get_profiles
--- a/doc/finch3.1.in Sat Jan 02 21:58:08 2021 -0600
+++ b/doc/finch3.1.in Sat Jan 02 22:05:09 2021 -0600
@@ -212,7 +212,7 @@
into this workspace. These are matched as substrings. Window titles take precedence over
-window-titles = Preferences;Pounce
+window-titles = Preferences --- a/doc/pidgin3.1.in Sat Jan 02 21:58:08 2021 -0600
+++ b/doc/pidgin3.1.in Sat Jan 02 22:05:09 2021 -0600
@@ -116,11 +116,6 @@
Sends a file to the selected buddy (only available on protocols that support
-A Buddy Pounce is a configurable automated action to be performed when the
-buddy's state changes. This will open the \fBBuddy Pounce\fR dialog, which
-will be discussed later.
Pidgin is capable of automatically logging messages. These logs are
either plain text files (with a .txt extension) or html files (with a
@@ -479,19 +474,6 @@
button allows creation of a new saved status, and the \fIClose\fR button closes
-A Buddy Pounce is an automated trigger that occurs when a buddy returns to
-a normal state from an away state. The \fBBuddy Pounce\fR dialog box
-can be activated by selecting the \fIBuddy Pounce\fR option from the
-\fBTools\fR menu. From this dialog, new pounces can be created with the
-\fBAdd\fR button and existing pounces can be removed with the \fBDelete\fR
-button. A pounce can be set to occur on any combination of the
-events listed, and any combination of actions can result. If \fIPounce
-only when my status is not Available\fR is checked, the pounce will occur
-only if the user is set to a non-available status, such as invisible, do not
-disturb, away, etc. If \fIRecurring\fR is checked, the pounce will remain
-until removed by the \fBDelete\fR button.
Pidgin 2.5.0 introduced support for custom smilies on those protocols for which
interested contributors have developed support. The custom smiley manager can
@@ -530,8 +512,6 @@
\fI~/.purple/accounts.xml\fR: information about the user's accounts.
- \fI~/.purple/pounces.xml\fR: stores the user's buddy pounces.
\fI~/.purple/prefs.xml\fR: Pidgin's configuration file.
\fI~/.purple/status.xml\fR: stores the user's away messages.
--- a/doc/reference/finch/finch-docs.xml Sat Jan 02 21:58:08 2021 -0600
+++ b/doc/reference/finch/finch-docs.xml Sat Jan 02 22:05:09 2021 -0600
@@ -25,7 +25,6 @@
<xi:include href="xml/gntaccount.xml" />
<xi:include href="xml/gntblist.xml" />
- <xi:include href="xml/gntpounce.xml" />
<xi:include href="xml/gntconn.xml" />
<xi:include href="xml/gntconv.xml" />
<xi:include href="xml/gntdebug.xml" />
--- a/doc/reference/libpurple/libpurple-docs.xml Sat Jan 02 21:58:08 2021 -0600
+++ b/doc/reference/libpurple/libpurple-docs.xml Sat Jan 02 22:05:09 2021 -0600
@@ -35,7 +35,6 @@
<xi:include href="xml/buddy.xml" />
<xi:include href="xml/buddylist.xml" />
<xi:include href="xml/buddyicon.xml" />
- <xi:include href="xml/pounce.xml" />
<xi:include href="xml/chat.xml" />
<xi:include href="xml/circularbuffer.xml" />
<xi:include href="xml/contact.xml" />
--- a/doc/reference/pidgin/pidgin-docs.xml Sat Jan 02 21:58:08 2021 -0600
+++ b/doc/reference/pidgin/pidgin-docs.xml Sat Jan 02 22:05:09 2021 -0600
@@ -35,7 +35,6 @@
<xi:include href="xml/gtknickcolors.xml" />
<xi:include href="xml/gtknotify.xml" />
<xi:include href="xml/gtkpluginpref.xml" />
- <xi:include href="xml/gtkpounce.xml" />
<xi:include href="xml/gtkprefs.xml" />
<xi:include href="xml/gtkprivacy.xml" />
<xi:include href="xml/gtkrequest.xml" />
--- a/finch/gntblist.c Sat Jan 02 21:58:08 2021 -0600
+++ b/finch/gntblist.c Sat Jan 02 22:05:09 2021 -0600
@@ -34,7 +34,6 @@
#define PREF_ROOT "/finch/blist"
@@ -1106,17 +1105,6 @@
-finch_blist_pounce_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node)
- if (PURPLE_IS_CONTACT(node))
- b = purple_contact_get_priority_buddy((PurpleContact *)node);
- b = (PurpleBuddy *)node;
- finch_pounce_editor_show(purple_buddy_get_account(b), purple_buddy_get_name(b), NULL);
toggle_block_buddy(GntMenuItem *item, gpointer buddy)
gboolean block = gnt_menuitem_check_get_checked(GNT_MENU_ITEM_CHECK(item));
@@ -1154,9 +1142,6 @@
PURPLE_CALLBACK(finch_blist_get_buddy_info_cb), buddy);
- add_custom_action(menu, _("Add Buddy Pounce"),
- PURPLE_CALLBACK(finch_blist_pounce_node_cb), buddy);
if (PURPLE_IS_PROTOCOL_XFER(protocol))
if (purple_protocol_xfer_can_receive(
--- a/finch/gntconv.c Sat Jan 02 21:58:08 2021 -0600
+++ b/finch/gntconv.c Sat Jan 02 22:05:09 2021 -0600
@@ -37,7 +37,6 @@
@@ -406,15 +405,6 @@
-add_pounce_cb(GntMenuItem *item, gpointer ggconv)
- FinchConv *ggc = ggconv;
- finch_pounce_editor_show(
- purple_conversation_get_account(ggc->active_conv),
- purple_conversation_get_name(ggc->active_conv), NULL);
get_info_cb(GntMenuItem *item, gpointer ggconv)
@@ -614,10 +604,6 @@
gnt_menuitem_set_callback(item, get_info_cb, ggc);
- item = gnt_menuitem_new(_("Add Buddy Pounce..."));
- gnt_menu_add_item(GNT_MENU(sub), item);
- gnt_menuitem_set_callback(item, add_pounce_cb, ggc);
if (PURPLE_IS_PROTOCOL_XFER(protocol) &&
purple_protocol_xfer_can_receive(
PURPLE_PROTOCOL_XFER(protocol),
--- a/finch/gntpounce.c Sat Jan 02 21:58:08 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,964 +0,0 @@
- * Finch is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * 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 02111-1301 USA
-#include <glib/gi18n-lib.h>
- PurpleAccount *account;
- GntWidget *account_menu;
- GntWidget *buddy_entry;
- /* Pounce When Buddy... */
- GntWidget *away_return;
- GntWidget *idle_return;
- GntWidget *stop_typing;
- GntWidget *message_recv;
- GntWidget *popup_entry;
- GntWidget *send_msg_entry;
- GntWidget *exec_cmd_entry;
- GntWidget *save_pounce;
- GntWidget *save_button;
-} PurpleGntPounceDialog;
- GntWidget *modify_button;
- GntWidget *delete_button;
-static PouncesManager *pounces_manager = NULL;
-/**************************************************************************
- **************************************************************************/
-delete_win_cb(GntWidget *w, PurpleGntPounceDialog *dialog)
- gnt_widget_destroy(dialog->window);
-cancel_cb(GntWidget *w, PurpleGntPounceDialog *dialog)
- gnt_widget_destroy(dialog->window);
-add_pounce_to_treeview(GntTree *tree, PurplePounce *pounce)
- PurpleAccount *account;
- account = purple_pounce_get_pouncer(pounce);
- pouncer = purple_account_get_username(account);
- pouncee = purple_pounce_get_pouncee(pounce);
- gnt_tree_add_row_last(tree, pounce,
- gnt_tree_create_row(tree, pouncer, pouncee), NULL);
-populate_pounces_list(PouncesManager *dialog)
- gnt_tree_remove_all(GNT_TREE(dialog->tree));
- for (pounces = purple_pounces_get_all_for_ui(FINCH_UI); pounces != NULL;
- pounces = g_list_delete_link(pounces, pounces))
- add_pounce_to_treeview(GNT_TREE(dialog->tree), pounces->data);
- /* Rebuild the pounces list if the pounces manager is open */
- if (pounces_manager != NULL)
- populate_pounces_list(pounces_manager);
-signed_on_off_cb(PurpleConnection *gc, gpointer user_data)
-setup_buddy_list_suggestion(GntEntry *entry, gboolean offline)
- PurpleBlistNode *node = purple_blist_get_default_root();
- for (; node; node = purple_blist_node_next(node, offline)) {
- if (!PURPLE_IS_BUDDY(node))
- gnt_entry_add_suggest(entry, purple_buddy_get_name((PurpleBuddy*)node));
-save_pounce_cb(GntWidget *w, PurpleGntPounceDialog *dialog)
- const char *message, *command, *reason;
- PurplePounceEvent events = PURPLE_POUNCE_NONE;
- PurplePounceOption options = PURPLE_POUNCE_OPTION_NONE;
- name = gnt_entry_get_text(GNT_ENTRY(dialog->buddy_entry));
- purple_notify_error(NULL, NULL,
- _("Please enter a buddy to pounce."), NULL, NULL);
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->on_away)))
- options |= PURPLE_POUNCE_OPTION_AWAY;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->signon)))
- events |= PURPLE_POUNCE_SIGNON;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->signoff)))
- events |= PURPLE_POUNCE_SIGNOFF;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->away)))
- events |= PURPLE_POUNCE_AWAY;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->away_return)))
- events |= PURPLE_POUNCE_AWAY_RETURN;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->idle)))
- events |= PURPLE_POUNCE_IDLE;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->idle_return)))
- events |= PURPLE_POUNCE_IDLE_RETURN;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->typing)))
- events |= PURPLE_POUNCE_TYPING;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->typed)))
- events |= PURPLE_POUNCE_TYPED;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->stop_typing)))
- events |= PURPLE_POUNCE_TYPING_STOPPED;
- if (gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->message_recv)))
- events |= PURPLE_POUNCE_MESSAGE_RECEIVED;
- message = gnt_entry_get_text(GNT_ENTRY(dialog->send_msg_entry));
- command = gnt_entry_get_text(GNT_ENTRY(dialog->exec_cmd_entry));
- reason = gnt_entry_get_text(GNT_ENTRY(dialog->popup_entry));
- if (*reason == '\0') reason = NULL;
- if (*message == '\0') message = NULL;
- if (*command == '\0') command = NULL;
- if (dialog->pounce == NULL) {
- dialog->pounce = purple_pounce_new(FINCH_UI, dialog->account,
- name, events, options);
- purple_pounce_set_events(dialog->pounce, events);
- purple_pounce_set_options(dialog->pounce, options);
- purple_pounce_set_pouncer(dialog->pounce, dialog->account);
- purple_pounce_set_pouncee(dialog->pounce, name);
- purple_pounce_action_set_enabled(dialog->pounce, "open-window",
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->open_win)));
- purple_pounce_action_set_enabled(dialog->pounce, "popup-notify",
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->popup)));
- purple_pounce_action_set_enabled(dialog->pounce, "send-message",
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->send_msg)));
- purple_pounce_action_set_enabled(dialog->pounce, "execute-command",
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->exec_cmd)));
- purple_pounce_action_set_attribute(dialog->pounce, "send-message",
- purple_pounce_action_set_attribute(dialog->pounce, "execute-command",
- purple_pounce_action_set_attribute(dialog->pounce, "popup-notify",
- /* Set the defaults for next time. */
- purple_prefs_set_bool("/finch/pounces/default_actions/open-window",
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->open_win)));
- purple_prefs_set_bool("/finch/pounces/default_actions/popup-notify",
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->popup)));
- purple_prefs_set_bool("/finch/pounces/default_actions/send-message",
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->send_msg)));
- purple_prefs_set_bool("/finch/pounces/default_actions/execute-command",
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->exec_cmd)));
- purple_pounce_set_save(dialog->pounce,
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->save_pounce)));
- purple_pounce_set_pouncer(dialog->pounce,
- (PurpleAccount *)gnt_combo_box_get_selected_data(GNT_COMBO_BOX(dialog->account_menu)));
- gnt_widget_destroy(dialog->window);
-finch_pounce_editor_show(PurpleAccount *account, const char *name,
- PurplePounce *cur_pounce)
- PurpleGntPounceDialog *dialog;
- GntWidget *hbox, *vbox;
- g_return_if_fail((cur_pounce != NULL) ||
- (purple_accounts_get_all() != NULL));
- dialog = g_new0(PurpleGntPounceDialog, 1);
- if (cur_pounce != NULL) {
- dialog->pounce = cur_pounce;
- dialog->account = purple_pounce_get_pouncer(cur_pounce);
- } else if (account != NULL) {
- dialog->account = account;
- GList *connections = purple_connections_get_all();
- if (connections != NULL) {
- gc = (PurpleConnection *)connections->data;
- dialog->account = purple_connection_get_account(gc);
- dialog->account = purple_accounts_get_all()->data;
- /* Create the window. */
- dialog->window = window = gnt_vbox_new(FALSE);
- gnt_box_set_pad(GNT_BOX(window), 0);
- gnt_box_set_toplevel(GNT_BOX(window), TRUE);
- gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_LEFT);
- gnt_box_set_title(GNT_BOX(window),
- ? _("New Buddy Pounce") : _("Edit Buddy Pounce")));
- g_signal_connect(G_OBJECT(window), "destroy",
- G_CALLBACK(delete_win_cb), dialog);
- gnt_box_add_widget(GNT_BOX(window), gnt_label_new_with_format(_("Pounce on Whom"), GNT_TEXT_FLAG_BOLD));
- gnt_box_add_widget(GNT_BOX(window), gnt_label_new(_("Account:")));
- dialog->account_menu = combo = gnt_combo_box_new();
- list = purple_accounts_get_all();
- for (; list; list = list->next)
- PurpleAccount *account;
- text = g_strdup_printf("%s (%s)",
- purple_account_get_username(account),
- purple_account_get_protocol_name(account));
- gnt_combo_box_add_data(GNT_COMBO_BOX(combo), account, text);
- gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), dialog->account);
- gnt_box_add_widget(GNT_BOX(window), combo);
- hbox = gnt_hbox_new(FALSE);
- gnt_box_add_widget(GNT_BOX(hbox), gnt_label_new(_("Buddy name:")));
- dialog->buddy_entry = gnt_entry_new(NULL);
- gnt_box_add_widget(GNT_BOX(hbox), dialog->buddy_entry);
- setup_buddy_list_suggestion(GNT_ENTRY(dialog->buddy_entry), TRUE);
- gnt_box_add_widget(GNT_BOX(window), hbox);
- if (cur_pounce != NULL) {
- gnt_entry_set_text(GNT_ENTRY(dialog->buddy_entry),
- purple_pounce_get_pouncee(cur_pounce));
- } else if (name != NULL) {
- gnt_entry_set_text(GNT_ENTRY(dialog->buddy_entry), name);
- /* Create the event frame */
- gnt_box_add_widget(GNT_BOX(window), gnt_line_new(FALSE));
- gnt_box_add_widget(GNT_BOX(window), gnt_label_new_with_format(_("Pounce When Buddy..."), GNT_TEXT_FLAG_BOLD));
- dialog->signon = gnt_check_box_new(_("Signs on"));
- dialog->signoff = gnt_check_box_new(_("Signs off"));
- dialog->away = gnt_check_box_new(_("Goes away"));
- dialog->away_return = gnt_check_box_new(_("Returns from away"));
- dialog->idle = gnt_check_box_new(_("Becomes idle"));
- dialog->idle_return = gnt_check_box_new(_("Is no longer idle"));
- dialog->typing = gnt_check_box_new(_("Starts typing"));
- dialog->typed = gnt_check_box_new(_("Pauses while typing"));
- dialog->stop_typing = gnt_check_box_new(_("Stops typing"));
- dialog->message_recv = gnt_check_box_new(_("Sends a message"));
- hbox = gnt_hbox_new(TRUE);
- gnt_box_set_pad(GNT_BOX(hbox), 2);
- vbox = gnt_vbox_new(FALSE);
- gnt_box_set_pad(GNT_BOX(vbox), 0);
- gnt_box_add_widget(GNT_BOX(hbox), vbox);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->signon);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->away);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->idle);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->typing);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->stop_typing);
- vbox = gnt_vbox_new(FALSE);
- gnt_box_set_pad(GNT_BOX(vbox), 0);
- gnt_box_add_widget(GNT_BOX(hbox), vbox);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->signoff);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->away_return);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->idle_return);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->typed);
- gnt_box_add_widget(GNT_BOX(vbox), dialog->message_recv);
- gnt_box_add_widget(GNT_BOX(window), hbox);
- /* Create the "Action" frame. */
- gnt_box_add_widget(GNT_BOX(window), gnt_line_new(FALSE));
- gnt_box_add_widget(GNT_BOX(window), gnt_label_new_with_format(_("Action"), GNT_TEXT_FLAG_BOLD));
- dialog->open_win = gnt_check_box_new(_("Open an IM window"));
- dialog->popup = gnt_check_box_new(_("Pop up a notification"));
- dialog->send_msg = gnt_check_box_new(_("Send a message"));
- dialog->exec_cmd = gnt_check_box_new(_("Execute a command"));
- dialog->send_msg_entry = gnt_entry_new(NULL);
- dialog->exec_cmd_entry = gnt_entry_new(NULL);
- dialog->popup_entry = gnt_entry_new(NULL);
- dialog->exec_cmd_entry = gnt_entry_new(NULL);
- hbox = gnt_hbox_new(FALSE);
- gnt_box_add_widget(GNT_BOX(hbox), dialog->open_win);
- gnt_box_add_widget(GNT_BOX(window), hbox);
- hbox = gnt_hbox_new(FALSE);
- gnt_box_add_widget(GNT_BOX(hbox), dialog->popup);
- gnt_box_add_widget(GNT_BOX(hbox), dialog->popup_entry);
- gnt_box_add_widget(GNT_BOX(window), hbox);
- hbox = gnt_hbox_new(FALSE);
- gnt_box_add_widget(GNT_BOX(hbox), dialog->send_msg);
- gnt_box_add_widget(GNT_BOX(hbox), dialog->send_msg_entry);
- gnt_box_add_widget(GNT_BOX(window), hbox);
- hbox = gnt_hbox_new(FALSE);
- gnt_box_add_widget(GNT_BOX(hbox), dialog->exec_cmd);
- gnt_box_add_widget(GNT_BOX(hbox), dialog->exec_cmd_entry);
- gnt_box_add_widget(GNT_BOX(window), hbox);
- gnt_box_add_widget(GNT_BOX(window), gnt_line_new(FALSE));
- gnt_box_add_widget(GNT_BOX(window), gnt_label_new_with_format(_("Options"), GNT_TEXT_FLAG_BOLD));
- dialog->on_away = gnt_check_box_new(_("Pounce only when my status is not Available"));
- gnt_box_add_widget(GNT_BOX(window), dialog->on_away);
- dialog->save_pounce = gnt_check_box_new(_("Recurring"));
- gnt_box_add_widget(GNT_BOX(window), dialog->save_pounce);
- gnt_box_add_widget(GNT_BOX(window), gnt_line_new(FALSE));
- /* Now the button box! */
- bbox = gnt_hbox_new(FALSE);
- button = gnt_button_new(_("Cancel"));
- gnt_box_add_widget(GNT_BOX(bbox), button);
- g_signal_connect(G_OBJECT(button), "activate",
- G_CALLBACK(cancel_cb), dialog);
- dialog->save_button = button = gnt_button_new(_("Save"));
- gnt_box_add_widget(GNT_BOX(bbox), button);
- g_signal_connect(G_OBJECT(button), "activate",
- G_CALLBACK(save_pounce_cb), dialog);
- gnt_box_add_widget(GNT_BOX(window), bbox);
- /* Set the values of stuff. */
- if (cur_pounce != NULL)
- PurplePounceEvent events = purple_pounce_get_events(cur_pounce);
- PurplePounceOption options = purple_pounce_get_options(cur_pounce);
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->on_away),
- (options & PURPLE_POUNCE_OPTION_AWAY));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->signon),
- (events & PURPLE_POUNCE_SIGNON));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->signoff),
- (events & PURPLE_POUNCE_SIGNOFF));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->away),
- (events & PURPLE_POUNCE_AWAY));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->away_return),
- (events & PURPLE_POUNCE_AWAY_RETURN));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->idle),
- (events & PURPLE_POUNCE_IDLE));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->idle_return),
- (events & PURPLE_POUNCE_IDLE_RETURN));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->typing),
- (events & PURPLE_POUNCE_TYPING));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->typed),
- (events & PURPLE_POUNCE_TYPED));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->stop_typing),
- (events & PURPLE_POUNCE_TYPING_STOPPED));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->message_recv),
- (events & PURPLE_POUNCE_MESSAGE_RECEIVED));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->open_win),
- purple_pounce_action_is_enabled(cur_pounce, "open-window"));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->popup),
- purple_pounce_action_is_enabled(cur_pounce, "popup-notify"));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->send_msg),
- purple_pounce_action_is_enabled(cur_pounce, "send-message"));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->exec_cmd),
- purple_pounce_action_is_enabled(cur_pounce, "execute-command"));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->save_pounce),
- purple_pounce_get_save(cur_pounce));
- if ((value = purple_pounce_action_get_attribute(cur_pounce,
- gnt_entry_set_text(GNT_ENTRY(dialog->send_msg_entry), value);
- if ((value = purple_pounce_action_get_attribute(cur_pounce,
- gnt_entry_set_text(GNT_ENTRY(dialog->popup_entry), value);
- if ((value = purple_pounce_action_get_attribute(cur_pounce,
- gnt_entry_set_text(GNT_ENTRY(dialog->exec_cmd_entry), value);
- PurpleBuddy *buddy = NULL;
- buddy = purple_blist_find_buddy(account, name);
- /* Set some defaults */
- gnt_check_box_set_checked(
- GNT_CHECK_BOX(dialog->signon), TRUE);
- if (!PURPLE_BUDDY_IS_ONLINE(buddy)) {
- gnt_check_box_set_checked(
- GNT_CHECK_BOX(dialog->signon), TRUE);
- gboolean default_set = FALSE;
- PurplePresence *presence = purple_buddy_get_presence(buddy);
- if (purple_presence_is_idle(presence))
- gnt_check_box_set_checked(
- GNT_CHECK_BOX(dialog->idle_return), TRUE);
- if (!purple_presence_is_available(presence))
- gnt_check_box_set_checked(
- GNT_CHECK_BOX(dialog->away_return), TRUE);
- gnt_check_box_set_checked(
- GNT_CHECK_BOX(dialog->signon), TRUE);
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->open_win),
- purple_prefs_get_bool("/finch/pounces/default_actions/open-window"));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->popup),
- purple_prefs_get_bool("/finch/pounces/default_actions/popup-notify"));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->send_msg),
- purple_prefs_get_bool("/finch/pounces/default_actions/send-message"));
- gnt_check_box_set_checked(GNT_CHECK_BOX(dialog->exec_cmd),
- purple_prefs_get_bool("/finch/pounces/default_actions/execute-command"));
- gnt_widget_show(window);
-pounces_manager_destroy_cb(GntWidget *widget, gpointer user_data)
- PouncesManager *dialog = user_data;
- finch_pounces_manager_hide();
-pounces_manager_add_cb(GntButton *button, gpointer user_data)
- if (purple_accounts_get_all() == NULL) {
- purple_notify_error(NULL, _("Cannot create pounce"),
- _("You do not have any accounts."),
- _("You must create an account first before you can create a pounce."), NULL);
- finch_pounce_editor_show(NULL, NULL, NULL);
-pounces_manager_modify_cb(GntButton *button, gpointer user_data)
- PouncesManager *dialog = user_data;
- PurplePounce *pounce = gnt_tree_get_selection_data(GNT_TREE(dialog->tree));
- finch_pounce_editor_show(NULL, NULL, pounce);
-pounces_manager_delete_confirm_cb(PurplePounce *pounce)
- gnt_tree_remove(GNT_TREE(pounces_manager->tree), pounce);
- purple_request_close_with_handle(pounce);
- purple_pounce_destroy(pounce);
-pounces_manager_delete_cb(GntButton *button, gpointer user_data)
- PouncesManager *dialog = user_data;
- PurpleAccount *account;
- const char *pouncer, *pouncee;
- pounce = (PurplePounce *)gnt_tree_get_selection_data(GNT_TREE(dialog->tree));
- account = purple_pounce_get_pouncer(pounce);
- pouncer = purple_account_get_username(account);
- pouncee = purple_pounce_get_pouncee(pounce);
- buf = g_strdup_printf(_("Are you sure you want to delete the pounce on %s for %s?"), pouncee, pouncer);
- purple_request_action(pounce, NULL, buf, NULL, 0,
- purple_request_cpar_from_account(account), pounce, 2,
- _("Delete"), pounces_manager_delete_confirm_cb,
-pounces_manager_close_cb(GntButton *button, gpointer user_data)
- finch_pounces_manager_hide();
-finch_pounces_manager_show(void)
- PouncesManager *dialog;
- if (pounces_manager != NULL) {
- gnt_window_present(pounces_manager->window);
- pounces_manager = dialog = g_new0(PouncesManager, 1);
- dialog->window = win = gnt_vbox_new(FALSE);
- gnt_box_set_toplevel(GNT_BOX(win), TRUE);
- gnt_box_set_title(GNT_BOX(win), _("Buddy Pounces"));
- gnt_box_set_pad(GNT_BOX(win), 0);
- g_signal_connect(G_OBJECT(win), "destroy",
- G_CALLBACK(pounces_manager_destroy_cb), dialog);
- /* List of saved buddy pounces */
- dialog->tree = tree = GNT_WIDGET(gnt_tree_new_with_columns(2));
- gnt_tree_set_column_titles(GNT_TREE(tree), "Account", "Pouncee", NULL);
- gnt_tree_set_show_title(GNT_TREE(tree), TRUE);
- gnt_box_add_widget(GNT_BOX(win), tree);
- bbox = gnt_hbox_new(FALSE);
- button = gnt_button_new(_("Add"));
- gnt_box_add_widget(GNT_BOX(bbox), button);
- gnt_util_set_trigger_widget(tree, GNT_KEY_INS, button);
- g_signal_connect(G_OBJECT(button), "activate",
- G_CALLBACK(pounces_manager_add_cb), dialog);
- button = gnt_button_new(_("Modify"));
- dialog->modify_button = button;
- gnt_box_add_widget(GNT_BOX(bbox), button);
- g_signal_connect(G_OBJECT(button), "activate",
- G_CALLBACK(pounces_manager_modify_cb), dialog);
- button = gnt_button_new(_("Delete"));
- dialog->delete_button = button;
- gnt_box_add_widget(GNT_BOX(bbox), button);
- gnt_util_set_trigger_widget(tree, GNT_KEY_DEL, button);
- g_signal_connect(G_OBJECT(button), "activate",
- G_CALLBACK(pounces_manager_delete_cb), dialog);
- button = gnt_button_new(_("Close"));
- gnt_box_add_widget(GNT_BOX(bbox), button);
- gnt_widget_show(button);
- g_signal_connect(G_OBJECT(button), "activate",
- G_CALLBACK(pounces_manager_close_cb), dialog);
- gnt_box_add_widget(GNT_BOX(win), bbox);
- populate_pounces_list(pounces_manager);
-finch_pounces_manager_hide(void)
- if (pounces_manager == NULL)
- if (pounces_manager->window != NULL)
- gnt_widget_destroy(pounces_manager->window);
- purple_signals_disconnect_by_handle(pounces_manager);
- g_free(pounces_manager);
- pounces_manager = NULL;
-pounce_cb(PurplePounce *pounce, PurplePounceEvent events, void *data)
- PurpleIMConversation *im;
- PurpleAccount *account;
- pouncee = purple_pounce_get_pouncee(pounce);
- account = purple_pounce_get_pouncer(pounce);
- buddy = purple_blist_find_buddy(account, pouncee);
- alias = purple_buddy_get_alias(buddy);
- if (purple_pounce_action_is_enabled(pounce, "open-window"))
- if (!purple_conversations_find_im_with_account(pouncee, account))
- purple_im_conversation_new(account, pouncee);
- if (purple_pounce_action_is_enabled(pounce, "popup-notify"))
- const char *name_shown;
- PurplePounceEvent event;
- {PURPLE_POUNCE_TYPING, _("%s has started typing to you (%s)")},
- {PURPLE_POUNCE_TYPED, _("%s has paused while typing to you (%s)")},
- {PURPLE_POUNCE_SIGNON, _("%s has signed on (%s)")},
- {PURPLE_POUNCE_IDLE_RETURN, _("%s has returned from being idle (%s)")},
- {PURPLE_POUNCE_AWAY_RETURN, _("%s has returned from being away (%s)")},
- {PURPLE_POUNCE_TYPING_STOPPED, _("%s has stopped typing to you (%s)")},
- {PURPLE_POUNCE_SIGNOFF, _("%s has signed off (%s)")},
- {PURPLE_POUNCE_IDLE, _("%s has become idle (%s)")},
- {PURPLE_POUNCE_AWAY, _("%s has gone away. (%s)")},
- {PURPLE_POUNCE_MESSAGE_RECEIVED, _("%s has sent you a message. (%s)")},
- reason = purple_pounce_action_get_attribute(pounce, "popup-notify",
- * Here we place the protocol name in the pounce dialog to lessen
- * confusion about what protocol a pounce is for.
- for (i = 0; messages[i].format != NULL; i++) {
- if (messages[i].event & events) {
- tmp = g_strdup_printf(messages[i].format, alias,
- purple_account_get_protocol_name(account));
- tmp = g_strdup(_("Unknown pounce event. Please report this!"));
- * Ok here is where I change the second argument, title, from
- * NULL to the account alias if we have it or the account
- * name if that's all we have
- if ((name_shown = purple_account_get_private_alias(account)) == NULL)
- name_shown = purple_account_get_username(account);
- purple_notify_info(NULL, name_shown, tmp, purple_date_format_full(NULL), NULL);
- char *tmp2 = g_strdup_printf("%s\n\n%s", reason, purple_date_format_full(NULL));
- purple_notify_info(NULL, name_shown, tmp, tmp2, NULL);
- if (purple_pounce_action_is_enabled(pounce, "send-message"))
- message = purple_pounce_action_get_attribute(pounce, "send-message",
- const gchar *me = purple_account_get_name_for_display(account);
- im = purple_conversations_find_im_with_account(pouncee, account);
- im = purple_im_conversation_new(account, pouncee);
- pmsg = purple_message_new_outgoing(me, pouncee, message, 0);
- purple_serv_send_im(purple_account_get_connection(account), pmsg);
- purple_conversation_write_message(PURPLE_CONVERSATION(im), pmsg);
- g_object_unref(G_OBJECT(pmsg));
- if (purple_pounce_action_is_enabled(pounce, "execute-command"))
- purple_debug_error("gntpounce", "execute-command is not supported on this OS");
- command = purple_pounce_action_get_attribute(pounce,
- "execute-command", "command");
- char *localecmd = g_locale_from_utf8(command, -1, NULL,
- args[2] = (char *)localecmd;
- if (purple_pounce_action_is_enabled(pounce, "play-beep"))
-free_pounce(PurplePounce *pounce)
-new_pounce(PurplePounce *pounce)
- purple_pounce_action_register(pounce, "open-window");
- purple_pounce_action_register(pounce, "popup-notify");
- purple_pounce_action_register(pounce, "send-message");
- purple_pounce_action_register(pounce, "execute-command");
- purple_pounce_action_register(pounce, "play-beep");
-finch_pounces_get_handle()
-finch_pounces_init(void)
- purple_pounces_register_handler(FINCH_UI, pounce_cb, new_pounce,
- purple_prefs_add_none("/finch/pounces");
- purple_prefs_add_none("/finch/pounces/default_actions");
- purple_prefs_add_bool("/finch/pounces/default_actions/open-window",
- purple_prefs_add_bool("/finch/pounces/default_actions/popup-notify",
- purple_prefs_add_bool("/finch/pounces/default_actions/send-message",
- purple_prefs_add_bool("/finch/pounces/default_actions/execute-command",
- purple_prefs_add_bool("/finch/pounces/default_actions/play-beep",
- purple_prefs_add_none("/finch/pounces/dialog");
- purple_signal_connect(purple_connections_get_handle(), "signed-on",
- finch_pounces_get_handle(),
- PURPLE_CALLBACK(signed_on_off_cb), NULL);
- purple_signal_connect(purple_connections_get_handle(), "signed-off",
- finch_pounces_get_handle(),
- PURPLE_CALLBACK(signed_on_off_cb), NULL);
-/* XXX: There's no such thing in pidgin. Perhaps there should be?
- * For sure, we don't need purple_pounces_unregister_handler -
- * it's wiped in purple_pounces_uninit.
-void finch_pounces_uninit()
- purple_signals_disconnect_by_handle(finch_pounces_get_handle());
--- a/finch/gntpounce.h Sat Jan 02 21:58:08 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
- * Finch is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * 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 02111-1301 USA
-#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION)
-# error "only <finch.h> may be included directly"
- * @section_id: finch-gntpounce
- * @short_description: <filename>gntpounce.h</filename>
- * @title: Buddy Pounce API
- * finch_pounce_editor_show:
- * @account: The optional account to use.
- * @name: The optional name to pounce on.
- * @cur_pounce: The current buddy pounce, if editing an existing one.
- * Displays a New Buddy Pounce or Edit Buddy Pounce dialog.
-void finch_pounce_editor_show(PurpleAccount *account, const char *name,
- PurplePounce *cur_pounce);
- * finch_pounces_manager_show:
- * Shows the pounces manager window.
-void finch_pounces_manager_show(void);
- * finch_pounces_manager_hide:
- * Hides the pounces manager window.
-void finch_pounces_manager_hide(void);
- * finch_pounces_get_handle:
- * Returns the GNT pounces handle
- * Returns: (transfer none): The handle to the GNT pounces system
-void *finch_pounces_get_handle(void);
- * Initializes the GNT pounces subsystem.
-void finch_pounces_init(void);
- * finch_pounces_uninit:
- * Uninitializes the GNT pounces subsystem.
-void finch_pounces_uninit(void);
-#endif /* FINCH_POUNCE_H */
--- a/finch/gntui.c Sat Jan 02 21:58:08 2021 -0600
+++ b/finch/gntui.c Sat Jan 02 22:05:09 2021 -0600
@@ -38,7 +38,6 @@
@@ -80,9 +79,6 @@
purple_request_set_ui_ops(finch_request_get_ui_ops());
@@ -99,7 +95,6 @@
gnt_register_action(_("Accounts"), finch_accounts_show_all);
gnt_register_action(_("Buddy List"), finch_blist_show);
- gnt_register_action(_("Buddy Pounces"), finch_pounces_manager_show);
gnt_register_action(_("Debug Window"), finch_debug_window_show);
gnt_register_action(_("File Transfers"), finch_xfer_dialog_show);
gnt_register_action(_("Plugins"), finch_plugins_show_all);
@@ -131,8 +126,6 @@
purple_request_set_ui_ops(NULL);
- finch_pounces_uninit();
--- a/finch/meson.build Sat Jan 02 21:58:08 2021 -0600
+++ b/finch/meson.build Sat Jan 02 22:05:09 2021 -0600
@@ -113,7 +113,6 @@
@@ -136,7 +135,6 @@
--- a/libpurple/account.c Sat Jan 02 21:58:08 2021 -0600
+++ b/libpurple/account.c Sat Jan 02 22:05:09 2021 -0600
@@ -28,7 +28,6 @@
#include "purpleaccountpresence.h"
#include "purplecredentialmanager.h"
--- a/libpurple/accounts.c Sat Jan 02 21:58:08 2021 -0600
+++ b/libpurple/accounts.c Sat Jan 02 22:05:09 2021 -0600
@@ -27,7 +27,6 @@
#include "purplecredentialmanager.h"
#include "purpleprivate.h"
@@ -659,9 +658,6 @@
- /* Remove this account's pounces */
- purple_pounce_destroy_all_by_account(account);
/* This will cause the deletion of an old buddy icon. */
purple_buddy_icons_set_account_icon(account, NULL, 0);
--- a/libpurple/buddylist.c Sat Jan 02 21:58:08 2021 -0600
+++ b/libpurple/buddylist.c Sat Jan 02 22:05:09 2021 -0600
@@ -28,7 +28,6 @@
#include "conversation.h"
#include "purpleprivate.h"
@@ -1495,9 +1494,6 @@
klass->remove_node(purplebuddylist, node);
- /* Remove this buddy's pounces */
- purple_pounce_destroy_all_by_buddy(buddy);
/* Signal that the buddy has been removed before freeing the memory for it */
purple_signal_emit(purple_blist_get_handle(), "blist-node-removed",
PURPLE_BLIST_NODE(buddy));
--- a/libpurple/core.c Sat Jan 02 21:58:08 2021 -0600
+++ b/libpurple/core.c Sat Jan 02 22:05:09 2021 -0600
@@ -35,7 +35,6 @@
#include "purpleprivate.h"
@@ -176,7 +175,6 @@
@@ -223,7 +221,6 @@
_purple_smiley_custom_uninit();
_purple_smiley_parser_uninit();
- purple_pounces_uninit();
purple_conversations_uninit();
@@ -373,7 +370,6 @@
MIGRATE_TO_XDG_DIR(purple_config_dir(), "blist.xml");
MIGRATE_TO_XDG_DIR(purple_config_dir(), "fs-codec.conf");
MIGRATE_TO_XDG_DIR(purple_config_dir(), "fs-element.conf");
- MIGRATE_TO_XDG_DIR(purple_config_dir(), "pounces.xml");
MIGRATE_TO_XDG_DIR(purple_config_dir(), "prefs.xml");
MIGRATE_TO_XDG_DIR(purple_config_dir(), "smileys.xml");
MIGRATE_TO_XDG_DIR(purple_config_dir(), "status.xml");
--- a/libpurple/meson.build Sat Jan 02 21:58:08 2021 -0600
+++ b/libpurple/meson.build Sat Jan 02 22:05:09 2021 -0600
@@ -40,7 +40,6 @@
@@ -129,7 +128,6 @@
--- a/libpurple/plugins/meson.build Sat Jan 02 21:58:08 2021 -0600
+++ b/libpurple/plugins/meson.build Sat Jan 02 22:05:09 2021 -0600
@@ -27,11 +27,6 @@
install : true, install_dir : PURPLE_PLUGINDIR)
- offlinemsg = library('offlinemsg', 'offlinemsg.c',
- dependencies : [libpurple_dep],
- install : true, install_dir : PURPLE_PLUGINDIR)
psychic = library('psychic', 'psychic.c',
dependencies : [libpurple_dep],
--- a/libpurple/plugins/offlinemsg.c Sat Jan 02 21:58:08 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +0,0 @@
- * Offline Message Emulation - Save messages sent to an offline user as pounce
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 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
-#include <glib/gi18n-lib.h>
-#define PLUGIN_ID "core-plugin_pack-offlinemsg"
-#define PLUGIN_NAME N_("Offline Message Emulation")
-#define PLUGIN_CATEGORY N_("Utility")
-#define PLUGIN_STATIC_NAME offlinemsg
-#define PLUGIN_SUMMARY N_("Save messages sent to an offline user as pounce.")
-#define PLUGIN_DESCRIPTION N_("Save messages sent to an offline user as pounce.")
-#define PLUGIN_AUTHORS {"Sadrul H Chowdhury <sadrul@users.sourceforge.net>", NULL}
-#define PREF_PREFIX "/plugins/core/" PLUGIN_ID
-#define PREF_ALWAYS PREF_PREFIX "/always"
-typedef struct _OfflineMsg OfflineMsg;
-} OfflineMessageSetting;
- PurpleAccount *account;
- PurpleConversation *conv;
-discard_data(OfflineMsg *offline)
- g_free(offline->message);
-cancel_poune(OfflineMsg *offline)
- g_object_set_data(G_OBJECT(offline->conv), "plugin_pack:offlinemsg",
- GINT_TO_POINTER(OFFLINE_MSG_NO));
- purple_conversation_send_with_flags(offline->conv, offline->message, 0);
-record_pounce(OfflineMsg *offline)
- PurplePounceEvent event;
- PurplePounceOption option;
- PurpleConversation *conv;
- PurpleMessage *message;
- me = purple_account_get_name_for_display(offline->account);
- event = PURPLE_POUNCE_SIGNON;
- option = PURPLE_POUNCE_OPTION_NONE;
- pounce = purple_pounce_new(purple_core_get_ui(), offline->account, offline->who,
- purple_pounce_action_set_enabled(pounce, "send-message", TRUE);
- temp = g_strdup_printf("(%s) %s", _("Offline message"),
- purple_pounce_action_set_attribute(pounce, "send-message", "message",
- if (!g_object_get_data(G_OBJECT(conv), "plugin_pack:offlinemsg")) {
- purple_conversation_write_system_message(conv,
- _("The rest of the messages will be saved "
- "as pounces. You can edit/delete the pounce from the `Buddy "
- "Pounce' dialog."), 0);
- g_object_set_data(G_OBJECT(conv), "plugin_pack:offlinemsg",
- GINT_TO_POINTER(OFFLINE_MSG_YES));
- message = purple_message_new_outgoing(me, offline->who, offline->message, 0);
- purple_conversation_write_message(conv, message);
- g_object_unref(G_OBJECT(message));
-sending_msg_cb(PurpleAccount *account, PurpleMessage *msg, gpointer handle)
- PurpleConversation *conv;
- OfflineMessageSetting setting;
- const gchar *who = purple_message_get_recipient(msg);
- if (purple_message_is_empty(msg))
- buddy = purple_blist_find_buddy(account, who);
- if (purple_presence_is_online(purple_buddy_get_presence(buddy)))
- if (purple_account_supports_offline_message(account, buddy))
- purple_debug_info("offlinemsg", "Account \"%s\" supports offline messages.\n",
- purple_account_get_username(account));
- conv = PURPLE_CONVERSATION(purple_conversations_find_im_with_account(who, account));
- setting = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), "plugin_pack:offlinemsg"));
- if (setting == OFFLINE_MSG_NO)
- offline = g_new0(OfflineMsg, 1);
- offline->account = account;
- offline->who = g_strdup(who);
- offline->message = g_strdup(purple_message_get_contents(msg));
- purple_message_set_contents(msg, NULL);
- if (purple_prefs_get_bool(PREF_ALWAYS) || setting == OFFLINE_MSG_YES)
- record_pounce(offline);
- else if (setting == OFFLINE_MSG_NONE)
- ask = g_strdup_printf(_("\"%s\" is currently offline. Do you want to save the "
- "rest of the messages in a pounce and automatically send them "
- "when \"%s\" logs back in?"), who, who);
- purple_request_action(handle, _("Offline Message"), ask,
- _("You can edit/delete the pounce from the `Buddy Pounces' dialog"),
- 0, purple_request_cpar_from_conversation(offline->conv),
- _("Yes"), record_pounce,
- _("No"), cancel_poune);
-static PurplePluginPrefFrame *
-get_plugin_pref_frame(PurplePlugin *plugin)
- PurplePluginPrefFrame *frame;
- PurplePluginPref *pref;
- frame = purple_plugin_pref_frame_new();
- pref = purple_plugin_pref_new_with_label(_("Save offline messages in pounce"));
- purple_plugin_pref_frame_add(frame, pref);
- pref = purple_plugin_pref_new_with_name_and_label(PREF_ALWAYS,
- _("Do not ask. Always save in pounce."));
- purple_plugin_pref_frame_add(frame, pref);
-static PurplePluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = PLUGIN_AUTHORS;
- return purple_plugin_info_new(
- "version", DISPLAY_VERSION,
- "category", PLUGIN_CATEGORY,
- "summary", PLUGIN_SUMMARY,
- "description", PLUGIN_DESCRIPTION,
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
- "pref-frame-cb", get_plugin_pref_frame,
-plugin_load(PurplePlugin *plugin, GError **error)
- purple_prefs_add_none(PREF_PREFIX);
- purple_prefs_add_bool(PREF_ALWAYS, FALSE);
- purple_signal_connect_priority(purple_conversations_get_handle(), "sending-im-msg",
- plugin, PURPLE_CALLBACK(sending_msg_cb), plugin, PURPLE_SIGNAL_PRIORITY_HIGHEST);
-plugin_unload(PurplePlugin *plugin, GError **error)
-PURPLE_PLUGIN_INIT(PLUGIN_STATIC_NAME, plugin_query, plugin_load, plugin_unload);
--- a/libpurple/pounce.c Sat Jan 02 21:58:08 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1206 +0,0 @@
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * 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 02111-1301 USA
-#include "conversation.h"
- * A buddy pounce structure.
- * Buddy pounces are actions triggered by a buddy-related event. For
- * example, a sound can be played or an IM window opened when a buddy
- * signs on or returns from away. Such responses are handled in the
- * UI. The events themselves are done in the core.
- char *ui_type; /* The type of UI. */
- PurplePounceEvent events; /* The event(s) to pounce on. */
- PurplePounceOption options; /* The pounce options */
- PurpleAccount *pouncer; /* The user who is pouncing. */
- char *pouncee; /* The buddy to pounce on. */
- GHashTable *actions; /* The registered actions. */
- gboolean save; /* Whether or not the pounce should
- be saved after activation. */
- void *data; /* Pounce-specific data. */
- PurplePounceEvent events;
- PurplePounceOption options;
-} PurplePounceActionData;
- void (*new_pounce)(PurplePounce *);
- void (*free_pounce)(PurplePounce *);
-static GHashTable *pounce_handlers = NULL;
-static GList *pounces = NULL;
-static guint save_timer = 0;
-static gboolean pounces_loaded = FALSE;
-/*********************************************************************
- * Private utility functions *
- *********************************************************************/
-static PurplePounceActionData *
-find_action_data(const PurplePounce *pounce, const char *name)
- PurplePounceActionData *action;
- g_return_val_if_fail(pounce != NULL, NULL);
- g_return_val_if_fail(name != NULL, NULL);
- action = g_hash_table_lookup(pounce->actions, name);
-free_action_data(gpointer data)
- PurplePounceActionData *action_data = data;
- g_free(action_data->name);
- g_hash_table_destroy(action_data->atts);
-/*********************************************************************
- *********************************************************************/
-action_parameter_to_xmlnode(gpointer key, gpointer value, gpointer user_data)
- const char *name, *param_value;
- PurpleXmlNode *node, *child;
- name = (const char *)key;
- param_value = (const char *)value;
- node = (PurpleXmlNode *)user_data;
- child = purple_xmlnode_new_child(node, "param");
- purple_xmlnode_set_attrib(child, "name", name);
- purple_xmlnode_insert_data(child, param_value, -1);
-action_parameter_list_to_xmlnode(gpointer key, gpointer value, gpointer user_data)
- PurplePounceActionData *action_data;
- PurpleXmlNode *node, *child;
- action = (const char *)key;
- action_data = (PurplePounceActionData *)value;
- node = (PurpleXmlNode *)user_data;
- if (!action_data->enabled)
- child = purple_xmlnode_new_child(node, "action");
- purple_xmlnode_set_attrib(child, "type", action);
- g_hash_table_foreach(action_data->atts, action_parameter_to_xmlnode, child);
-add_event_to_xmlnode(PurpleXmlNode *node, const char *type)
- child = purple_xmlnode_new_child(node, "event");
- purple_xmlnode_set_attrib(child, "type", type);
-add_option_to_xmlnode(PurpleXmlNode *node, const char *type)
- child = purple_xmlnode_new_child(node, "option");
- purple_xmlnode_set_attrib(child, "type", type);
-pounce_to_xmlnode(PurplePounce *pounce)
- PurpleXmlNode *node, *child;
- PurpleAccount *pouncer;
- PurplePounceEvent events;
- PurplePounceOption options;
- pouncer = purple_pounce_get_pouncer(pounce);
- events = purple_pounce_get_events(pounce);
- options = purple_pounce_get_options(pounce);
- node = purple_xmlnode_new("pounce");
- purple_xmlnode_set_attrib(node, "ui", pounce->ui_type);
- child = purple_xmlnode_new_child(node, "account");
- purple_xmlnode_set_attrib(child, "protocol", purple_account_get_protocol_id(pouncer));
- purple_xmlnode_insert_data(child,
- purple_normalize(pouncer, purple_account_get_username(pouncer)), -1);
- child = purple_xmlnode_new_child(node, "pouncee");
- purple_xmlnode_insert_data(child, purple_pounce_get_pouncee(pounce), -1);
- /* Write pounce options */
- child = purple_xmlnode_new_child(node, "options");
- if (options & PURPLE_POUNCE_OPTION_AWAY)
- add_option_to_xmlnode(child, "on-away");
- /* Write pounce events */
- child = purple_xmlnode_new_child(node, "events");
- if (events & PURPLE_POUNCE_SIGNON)
- add_event_to_xmlnode(child, "sign-on");
- if (events & PURPLE_POUNCE_SIGNOFF)
- add_event_to_xmlnode(child, "sign-off");
- if (events & PURPLE_POUNCE_AWAY)
- add_event_to_xmlnode(child, "away");
- if (events & PURPLE_POUNCE_AWAY_RETURN)
- add_event_to_xmlnode(child, "return-from-away");
- if (events & PURPLE_POUNCE_IDLE)
- add_event_to_xmlnode(child, "idle");
- if (events & PURPLE_POUNCE_IDLE_RETURN)
- add_event_to_xmlnode(child, "return-from-idle");
- if (events & PURPLE_POUNCE_TYPING)
- add_event_to_xmlnode(child, "start-typing");
- if (events & PURPLE_POUNCE_TYPED)
- add_event_to_xmlnode(child, "typed");
- if (events & PURPLE_POUNCE_TYPING_STOPPED)
- add_event_to_xmlnode(child, "stop-typing");
- if (events & PURPLE_POUNCE_MESSAGE_RECEIVED)
- add_event_to_xmlnode(child, "message-received");
- /* Write pounce actions */
- child = purple_xmlnode_new_child(node, "actions");
- g_hash_table_foreach(pounce->actions, action_parameter_list_to_xmlnode, child);
- if (purple_pounce_get_save(pounce))
- purple_xmlnode_new_child(node, "save");
-pounces_to_xmlnode(void)
- PurpleXmlNode *node, *child;
- node = purple_xmlnode_new("pounces");
- purple_xmlnode_set_attrib(node, "version", "1.0");
- for (cur = purple_pounces_get_all(); cur != NULL; cur = cur->next)
- child = pounce_to_xmlnode(cur->data);
- purple_xmlnode_insert_child(node, child);
- purple_debug_error("pounce", "Attempted to save buddy pounces before "
- node = pounces_to_xmlnode();
- data = purple_xmlnode_to_formatted_str(node, NULL);
- purple_util_write_data_to_config_file("pounces.xml", data, -1);
- purple_xmlnode_free(node);
-schedule_pounces_save(void)
- save_timer = g_timeout_add_seconds(5, save_cb, NULL);
-/*********************************************************************
- *********************************************************************/
-free_parser_data(gpointer user_data)
- PounceParserData *data = user_data;
- if (data->buffer != NULL)
- g_string_free(data->buffer, TRUE);
- g_free(data->protocol_id);
- g_free(data->event_type);
- g_free(data->option_type);
- g_free(data->action_name);
- g_free(data->param_name);
- g_free(data->account_name);
-start_element_handler(GMarkupParseContext *context,
- const gchar *element_name,
- const gchar **attribute_names,
- const gchar **attribute_values,
- gpointer user_data, GError **error)
- PounceParserData *data = user_data;
- atts = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
- for (i = 0; attribute_names[i] != NULL; i++) {
- g_hash_table_insert(atts, g_strdup(attribute_names[i]),
- g_strdup(attribute_values[i]));
- if (data->buffer != NULL) {
- g_string_free(data->buffer, TRUE);
- if (purple_strequal(element_name, "pounce")) {
- const char *ui = g_hash_table_lookup(atts, "ui");
- purple_debug(PURPLE_DEBUG_ERROR, "pounce",
- "Unset 'ui' parameter for pounce!\n");
- data->ui_name = g_strdup(ui);
- else if (purple_strequal(element_name, "account")) {
- const char *protocol_id = g_hash_table_lookup(atts, "protocol");
- if (protocol_id == NULL) {
- purple_debug(PURPLE_DEBUG_ERROR, "pounce",
- "Unset 'protocol' parameter for account!\n");
- data->protocol_id = g_strdup(protocol_id);
- else if (purple_strequal(element_name, "option")) {
- const char *type = g_hash_table_lookup(atts, "type");
- purple_debug(PURPLE_DEBUG_ERROR, "pounce",
- "Unset 'type' parameter for option!\n");
- data->option_type = g_strdup(type);
- else if (purple_strequal(element_name, "event")) {
- const char *type = g_hash_table_lookup(atts, "type");
- purple_debug(PURPLE_DEBUG_ERROR, "pounce",
- "Unset 'type' parameter for event!\n");
- data->event_type = g_strdup(type);
- else if (purple_strequal(element_name, "action")) {
- const char *type = g_hash_table_lookup(atts, "type");
- purple_debug(PURPLE_DEBUG_ERROR, "pounce",
- "Unset 'type' parameter for action!\n");
- data->action_name = g_strdup(type);
- else if (purple_strequal(element_name, "param")) {
- const char *param_name = g_hash_table_lookup(atts, "name");
- if (param_name == NULL) {
- purple_debug(PURPLE_DEBUG_ERROR, "pounce",
- "Unset 'name' parameter for param!\n");
- data->param_name = g_strdup(param_name);
- g_hash_table_destroy(atts);
-end_element_handler(GMarkupParseContext *context, const gchar *element_name,
- gpointer user_data, GError **error)
- PounceParserData *data = user_data;
- if (data->buffer != NULL) {
- buffer = g_string_free(data->buffer, FALSE);
- if (purple_strequal(element_name, "account")) {
- g_free(data->account_name);
- data->account_name = g_strdup(buffer);
- else if (purple_strequal(element_name, "pouncee")) {
- data->pouncee = g_strdup(buffer);
- else if (purple_strequal(element_name, "option")) {
- if (purple_strequal(data->option_type, "on-away"))
- data->options |= PURPLE_POUNCE_OPTION_AWAY;
- g_free(data->option_type);
- data->option_type = NULL;
- else if (purple_strequal(element_name, "event")) {
- if (purple_strequal(data->event_type, "sign-on"))
- data->events |= PURPLE_POUNCE_SIGNON;
- else if (purple_strequal(data->event_type, "sign-off"))
- data->events |= PURPLE_POUNCE_SIGNOFF;
- else if (purple_strequal(data->event_type, "away"))
- data->events |= PURPLE_POUNCE_AWAY;
- else if (purple_strequal(data->event_type, "return-from-away"))
- data->events |= PURPLE_POUNCE_AWAY_RETURN;
- else if (purple_strequal(data->event_type, "idle"))
- data->events |= PURPLE_POUNCE_IDLE;
- else if (purple_strequal(data->event_type, "return-from-idle"))
- data->events |= PURPLE_POUNCE_IDLE_RETURN;
- else if (purple_strequal(data->event_type, "start-typing"))
- data->events |= PURPLE_POUNCE_TYPING;
- else if (purple_strequal(data->event_type, "typed"))
- data->events |= PURPLE_POUNCE_TYPED;
- else if (purple_strequal(data->event_type, "stop-typing"))
- data->events |= PURPLE_POUNCE_TYPING_STOPPED;
- else if (purple_strequal(data->event_type, "message-received"))
- data->events |= PURPLE_POUNCE_MESSAGE_RECEIVED;
- g_free(data->event_type);
- data->event_type = NULL;
- else if (purple_strequal(element_name, "action")) {
- if (data->pounce != NULL) {
- purple_pounce_action_register(data->pounce, data->action_name);
- purple_pounce_action_set_enabled(data->pounce, data->action_name, TRUE);
- g_free(data->action_name);
- data->action_name = NULL;
- else if (purple_strequal(element_name, "param")) {
- if (data->pounce != NULL) {
- purple_pounce_action_set_attribute(data->pounce, data->action_name,
- data->param_name, buffer);
- g_free(data->param_name);
- data->param_name = NULL;
- else if (purple_strequal(element_name, "events")) {
- PurpleAccount *account;
- account = purple_accounts_find(data->account_name, data->protocol_id);
- g_free(data->account_name);
- g_free(data->protocol_id);
- data->account_name = NULL;
- data->protocol_id = NULL;
- purple_debug(PURPLE_DEBUG_ERROR, "pounce",
- "Account for pounce not found!\n");
- * This pounce has effectively been removed, so make
- * sure that we save the changes to pounces.xml
- schedule_pounces_save();
- purple_debug(PURPLE_DEBUG_INFO, "pounce",
- "Creating pounce: %s, %s\n", data->ui_name,
- data->pounce = purple_pounce_new(data->ui_name, account,
- data->pouncee, data->events,
- else if (purple_strequal(element_name, "save")) {
- if (data->pounce != NULL)
- purple_pounce_set_save(data->pounce, TRUE);
- else if (purple_strequal(element_name, "pounce")) {
- g_free(data->protocol_id);
- g_free(data->event_type);
- g_free(data->option_type);
- g_free(data->action_name);
- g_free(data->param_name);
- g_free(data->account_name);
- data->protocol_id = NULL;
- data->event_type = NULL;
- data->option_type = NULL;
- data->action_name = NULL;
- data->param_name = NULL;
- data->account_name = NULL;
-text_handler(GMarkupParseContext *context, const gchar *text,
- gsize text_len, gpointer user_data, GError **error)
- PounceParserData *data = user_data;
- if (data->buffer == NULL)
- data->buffer = g_string_new_len(text, text_len);
- g_string_append_len(data->buffer, text, text_len);
-static GMarkupParser pounces_parser =
-purple_pounces_load(void)
- gchar *filename = g_build_filename(purple_config_dir(), "pounces.xml", NULL);
- gchar *contents = NULL;
- GMarkupParseContext *context;
- PounceParserData *parser_data;
- if (filename == NULL) {
- if (!g_file_get_contents(filename, &contents, &length, &error)) {
- purple_debug(PURPLE_DEBUG_ERROR, "pounce",
- "Error reading pounces: %s\n", error->message);
- parser_data = g_new0(PounceParserData, 1);
- context = g_markup_parse_context_new(&pounces_parser, 0,
- parser_data, free_parser_data);
- if (!g_markup_parse_context_parse(context, contents, length, NULL)) {
- g_markup_parse_context_free(context);
- if (!g_markup_parse_context_end_parse(context, NULL)) {
- purple_debug(PURPLE_DEBUG_ERROR, "pounce", "Error parsing %s\n",
- g_markup_parse_context_free(context);
- g_markup_parse_context_free(context);
-purple_pounce_new(const char *ui_type, PurpleAccount *pouncer,
- const char *pouncee, PurplePounceEvent event,
- PurplePounceOption option)
- PurplePounceHandler *handler;
- g_return_val_if_fail(ui_type != NULL, NULL);
- g_return_val_if_fail(pouncer != NULL, NULL);
- g_return_val_if_fail(pouncee != NULL, NULL);
- g_return_val_if_fail(event != 0, NULL);
- pounce = g_new0(PurplePounce, 1);
- pounce->ui_type = g_strdup(ui_type);
- pounce->pouncer = pouncer;
- pounce->pouncee = g_strdup(pouncee);
- pounce->events = event;
- pounce->options = option;
- pounce->actions = g_hash_table_new_full(g_str_hash, g_str_equal,
- g_free, free_action_data);
- handler = g_hash_table_lookup(pounce_handlers, pounce->ui_type);
- if (handler != NULL && handler->new_pounce != NULL)
- handler->new_pounce(pounce);
- pounces = g_list_append(pounces, pounce);
- schedule_pounces_save();
-purple_pounce_destroy(PurplePounce *pounce)
- PurplePounceHandler *handler;
- g_return_if_fail(pounce != NULL);
- handler = g_hash_table_lookup(pounce_handlers, pounce->ui_type);
- pounces = g_list_remove(pounces, pounce);
- g_free(pounce->ui_type);
- g_free(pounce->pouncee);
- g_hash_table_destroy(pounce->actions);
- if (handler != NULL && handler->free_pounce != NULL)
- handler->free_pounce(pounce);
- schedule_pounces_save();
-purple_pounce_destroy_all_by_account(PurpleAccount *account)
- PurpleAccount *pouncer;
- g_return_if_fail(account != NULL);
- for (l = purple_pounces_get_all(); l != NULL; l = l_next)
- pounce = (PurplePounce *)l->data;
- pouncer = purple_pounce_get_pouncer(pounce);
- if (pouncer == account)
- purple_pounce_destroy(pounce);
-purple_pounce_destroy_all_by_buddy(PurpleBuddy *buddy)
- const char *pouncee, *bname;
- PurpleAccount *pouncer, *bacct;
- g_return_if_fail(buddy != NULL);
- bacct = purple_buddy_get_account(buddy);
- bname = purple_buddy_get_name(buddy);
- for (l = purple_pounces_get_all(); l != NULL; l = l_next) {
- pounce = (PurplePounce *)l->data;
- pouncer = purple_pounce_get_pouncer(pounce);
- pouncee = purple_pounce_get_pouncee(pounce);
- if ( (pouncer == bacct) && (purple_strequal(pouncee, bname)) )
- purple_pounce_destroy(pounce);
-purple_pounce_set_events(PurplePounce *pounce, PurplePounceEvent events)
- g_return_if_fail(pounce != NULL);
- g_return_if_fail(events != PURPLE_POUNCE_NONE);
- pounce->events = events;
- schedule_pounces_save();
-purple_pounce_set_options(PurplePounce *pounce, PurplePounceOption options)
- g_return_if_fail(pounce != NULL);
- pounce->options = options;
- schedule_pounces_save();
-purple_pounce_set_pouncer(PurplePounce *pounce, PurpleAccount *pouncer)
- g_return_if_fail(pounce != NULL);
- g_return_if_fail(pouncer != NULL);
- pounce->pouncer = pouncer;
- schedule_pounces_save();
-purple_pounce_set_pouncee(PurplePounce *pounce, const char *pouncee)
- g_return_if_fail(pounce != NULL);
- g_return_if_fail(pouncee != NULL);
- g_free(pounce->pouncee);
- pounce->pouncee = g_strdup(pouncee);
- schedule_pounces_save();
-purple_pounce_set_save(PurplePounce *pounce, gboolean save)
- g_return_if_fail(pounce != NULL);
- schedule_pounces_save();
-purple_pounce_action_register(PurplePounce *pounce, const char *name)
- PurplePounceActionData *action_data;
- g_return_if_fail(pounce != NULL);
- g_return_if_fail(name != NULL);
- if (g_hash_table_lookup(pounce->actions, name) != NULL)
- action_data = g_new0(PurplePounceActionData, 1);
- action_data->name = g_strdup(name);
- action_data->enabled = FALSE;
- action_data->atts = g_hash_table_new_full(g_str_hash, g_str_equal,
- g_hash_table_insert(pounce->actions, g_strdup(name), action_data);
- schedule_pounces_save();
-purple_pounce_action_set_enabled(PurplePounce *pounce, const char *action,
- PurplePounceActionData *action_data;
- g_return_if_fail(pounce != NULL);
- g_return_if_fail(action != NULL);
- action_data = find_action_data(pounce, action);
- g_return_if_fail(action_data != NULL);
- action_data->enabled = enabled;
- schedule_pounces_save();
-purple_pounce_action_set_attribute(PurplePounce *pounce, const char *action,
- const char *attr, const char *value)
- PurplePounceActionData *action_data;
- g_return_if_fail(pounce != NULL);
- g_return_if_fail(action != NULL);
- g_return_if_fail(attr != NULL);
- action_data = find_action_data(pounce, action);
- g_return_if_fail(action_data != NULL);
- g_hash_table_remove(action_data->atts, attr);
- g_hash_table_insert(action_data->atts, g_strdup(attr),
- schedule_pounces_save();
-purple_pounce_set_data(PurplePounce *pounce, void *data)
- g_return_if_fail(pounce != NULL);
- schedule_pounces_save();
-purple_pounce_get_events(const PurplePounce *pounce)
- g_return_val_if_fail(pounce != NULL, PURPLE_POUNCE_NONE);
-purple_pounce_get_options(const PurplePounce *pounce)
- g_return_val_if_fail(pounce != NULL, PURPLE_POUNCE_OPTION_NONE);
- return pounce->options;
-purple_pounce_get_pouncer(const PurplePounce *pounce)
- g_return_val_if_fail(pounce != NULL, NULL);
- return pounce->pouncer;
-purple_pounce_get_pouncee(const PurplePounce *pounce)
- g_return_val_if_fail(pounce != NULL, NULL);
- return pounce->pouncee;
-purple_pounce_get_save(const PurplePounce *pounce)
- g_return_val_if_fail(pounce != NULL, FALSE);
-purple_pounce_action_is_enabled(const PurplePounce *pounce, const char *action)
- PurplePounceActionData *action_data;
- g_return_val_if_fail(pounce != NULL, FALSE);
- g_return_val_if_fail(action != NULL, FALSE);
- action_data = find_action_data(pounce, action);
- g_return_val_if_fail(action_data != NULL, FALSE);
- return action_data->enabled;
-purple_pounce_action_get_attribute(const PurplePounce *pounce,
- const char *action, const char *attr)
- PurplePounceActionData *action_data;
- g_return_val_if_fail(pounce != NULL, NULL);
- g_return_val_if_fail(action != NULL, NULL);
- g_return_val_if_fail(attr != NULL, NULL);
- action_data = find_action_data(pounce, action);
- g_return_val_if_fail(action_data != NULL, NULL);
- return g_hash_table_lookup(action_data->atts, attr);
-purple_pounce_get_data(const PurplePounce *pounce)
- g_return_val_if_fail(pounce != NULL, NULL);
-purple_pounce_execute(PurpleAccount *pouncer, const char *pouncee,
- PurplePounceEvent events)
- PurplePounceHandler *handler;
- PurplePresence *presence;
- g_return_if_fail(pouncer != NULL);
- g_return_if_fail(pouncee != NULL);
- g_return_if_fail(events != PURPLE_POUNCE_NONE);
- norm_pouncee = g_strdup(purple_normalize(pouncer, pouncee));
- for (l = purple_pounces_get_all(); l != NULL; l = l_next)
- pounce = (PurplePounce *)l->data;
- presence = purple_account_get_presence(pouncer);
- if ((purple_pounce_get_events(pounce) & events) &&
- (purple_pounce_get_pouncer(pounce) == pouncer) &&
- !purple_utf8_strcasecmp(purple_normalize(pouncer, purple_pounce_get_pouncee(pounce)),
- (pounce->options == PURPLE_POUNCE_OPTION_NONE ||
- (pounce->options & PURPLE_POUNCE_OPTION_AWAY &&
- !purple_presence_is_available(presence))))
- handler = g_hash_table_lookup(pounce_handlers, pounce->ui_type);
- if (handler != NULL && handler->cb != NULL)
- handler->cb(pounce, events, purple_pounce_get_data(pounce));
- if (!purple_pounce_get_save(pounce))
- purple_pounce_destroy(pounce);
-purple_find_pounce(PurpleAccount *pouncer, const char *pouncee,
- PurplePounceEvent events)
- PurplePounce *pounce = NULL;
- g_return_val_if_fail(pouncer != NULL, NULL);
- g_return_val_if_fail(pouncee != NULL, NULL);
- g_return_val_if_fail(events != PURPLE_POUNCE_NONE, NULL);
- norm_pouncee = g_strdup(purple_normalize(pouncer, pouncee));
- for (l = purple_pounces_get_all(); l != NULL; l = l->next)
- pounce = (PurplePounce *)l->data;
- if ((purple_pounce_get_events(pounce) & events) &&
- (purple_pounce_get_pouncer(pounce) == pouncer) &&
- !purple_utf8_strcasecmp(purple_normalize(pouncer, purple_pounce_get_pouncee(pounce)),
-purple_pounces_register_handler(const char *ui, PurplePounceCb cb,
- void (*new_pounce)(PurplePounce *pounce),
- void (*free_pounce)(PurplePounce *pounce))
- PurplePounceHandler *handler;
- g_return_if_fail(ui != NULL);
- g_return_if_fail(cb != NULL);
- handler = g_new0(PurplePounceHandler, 1);
- handler->ui = g_strdup(ui);
- handler->new_pounce = new_pounce;
- handler->free_pounce = free_pounce;
- g_hash_table_insert(pounce_handlers, g_strdup(ui), handler);
-purple_pounces_unregister_handler(const char *ui)
- g_return_if_fail(ui != NULL);
- g_hash_table_remove(pounce_handlers, ui);
-purple_pounces_get_all(void)
-GList *purple_pounces_get_all_for_ui(const char *ui)
- GList *list = NULL, *iter;
- g_return_val_if_fail(ui != NULL, NULL);
- for (iter = pounces; iter; iter = iter->next) {
- PurplePounce *pounce = iter->data;
- if (purple_strequal(pounce->ui_type, ui))
- list = g_list_prepend(list, pounce);
- list = g_list_reverse(list);
-free_pounce_handler(gpointer user_data)
- PurplePounceHandler *handler = (PurplePounceHandler *)user_data;
-buddy_state_cb(PurpleBuddy *buddy, PurplePounceEvent event)
- PurpleAccount *account = purple_buddy_get_account(buddy);
- const gchar *name = purple_buddy_get_name(buddy);
- purple_pounce_execute(account, name, event);
-buddy_status_changed_cb(PurpleBuddy *buddy, PurpleStatus *old_status,
- PurpleAccount *account = purple_buddy_get_account(buddy);
- const gchar *name = purple_buddy_get_name(buddy);
- gboolean old_available, available;
- available = purple_status_is_available(status);
- old_available = purple_status_is_available(old_status);
- if (available && !old_available)
- purple_pounce_execute(account, name, PURPLE_POUNCE_AWAY_RETURN);
- else if (!available && old_available)
- purple_pounce_execute(account, name, PURPLE_POUNCE_AWAY);
-buddy_idle_changed_cb(PurpleBuddy *buddy, gboolean old_idle, gboolean idle)
- PurpleAccount *account = purple_buddy_get_account(buddy);
- const gchar *name = purple_buddy_get_name(buddy);
- purple_pounce_execute(account, name, PURPLE_POUNCE_IDLE);
- else if (!idle && old_idle)
- purple_pounce_execute(account, name, PURPLE_POUNCE_IDLE_RETURN);
-buddy_typing_cb(PurpleAccount *account, const char *name, void *data)
- PurpleIMConversation *im;
- im = purple_conversations_find_im_with_account(name, account);
- PurpleIMTypingState state;
- PurplePounceEvent event;
- state = purple_im_conversation_get_typing_state(im);
- if (state == PURPLE_IM_TYPED)
- event = PURPLE_POUNCE_TYPED;
- else if (state == PURPLE_IM_NOT_TYPING)
- event = PURPLE_POUNCE_TYPING_STOPPED;
- event = PURPLE_POUNCE_TYPING;
- purple_pounce_execute(account, name, event);
-received_message_cb(PurpleAccount *account, const char *name, void *data)
- purple_pounce_execute(account, name, PURPLE_POUNCE_MESSAGE_RECEIVED);
-purple_pounces_get_handle(void)
- static int pounce_handle;
-purple_pounces_init(void)
- void *handle = purple_pounces_get_handle();
- void *blist_handle = purple_blist_get_handle();
- void *conv_handle = purple_conversations_get_handle();
- pounce_handlers = g_hash_table_new_full(g_str_hash, g_str_equal,
- g_free, free_pounce_handler);
- purple_signal_connect(blist_handle, "buddy-idle-changed",
- handle, PURPLE_CALLBACK(buddy_idle_changed_cb), NULL);
- purple_signal_connect(blist_handle, "buddy-status-changed",
- handle, PURPLE_CALLBACK(buddy_status_changed_cb), NULL);
- purple_signal_connect(blist_handle, "buddy-signed-on",
- handle, PURPLE_CALLBACK(buddy_state_cb),
- GINT_TO_POINTER(PURPLE_POUNCE_SIGNON));
- purple_signal_connect(blist_handle, "buddy-signed-off",
- handle, PURPLE_CALLBACK(buddy_state_cb),
- GINT_TO_POINTER(PURPLE_POUNCE_SIGNOFF));
- purple_signal_connect(conv_handle, "buddy-typing",
- handle, PURPLE_CALLBACK(buddy_typing_cb), NULL);
- purple_signal_connect(conv_handle, "buddy-typed",
- handle, PURPLE_CALLBACK(buddy_typing_cb), NULL);
- purple_signal_connect(conv_handle, "buddy-typing-stopped",
- handle, PURPLE_CALLBACK(buddy_typing_cb), NULL);
- purple_signal_connect(conv_handle, "received-im-msg",
- handle, PURPLE_CALLBACK(received_message_cb), NULL);
- g_source_remove(save_timer);
- purple_signals_disconnect_by_handle(purple_pounces_get_handle());
- g_hash_table_destroy(pounce_handlers);
- pounce_handlers = NULL;
--- a/libpurple/pounce.h Sat Jan 02 21:58:08 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,407 +0,0 @@
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * 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 02111-1301 USA
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
- * @section_id: libpurple-pounce
- * @short_description: <filename>pounce.h</filename>
- * @title: Buddy Pounce API
-typedef struct _PurplePounce PurplePounce;
- * @PURPLE_POUNCE_NONE: No events.
- * @PURPLE_POUNCE_SIGNON: The buddy signed on.
- * @PURPLE_POUNCE_SIGNOFF: The buddy signed off.
- * @PURPLE_POUNCE_AWAY: The buddy went away.
- * @PURPLE_POUNCE_AWAY_RETURN: The buddy returned from away.
- * @PURPLE_POUNCE_IDLE: The buddy became idle.
- * @PURPLE_POUNCE_IDLE_RETURN: The buddy is no longer idle.
- * @PURPLE_POUNCE_TYPING: The buddy started typing.
- * @PURPLE_POUNCE_TYPED: The buddy has entered text.
- * @PURPLE_POUNCE_TYPING_STOPPED: The buddy stopped typing.
- * @PURPLE_POUNCE_MESSAGE_RECEIVED: The buddy sent a message.
- * Events that trigger buddy pounces.
- PURPLE_POUNCE_NONE = 0x000,
- PURPLE_POUNCE_SIGNON = 0x001,
- PURPLE_POUNCE_SIGNOFF = 0x002,
- PURPLE_POUNCE_AWAY = 0x004,
- PURPLE_POUNCE_AWAY_RETURN = 0x008,
- PURPLE_POUNCE_IDLE = 0x010,
- PURPLE_POUNCE_IDLE_RETURN = 0x020,
- PURPLE_POUNCE_TYPING = 0x040,
- PURPLE_POUNCE_TYPED = 0x080,
- PURPLE_POUNCE_TYPING_STOPPED = 0x100,
- PURPLE_POUNCE_MESSAGE_RECEIVED = 0x200
- * @PURPLE_POUNCE_OPTION_NONE: No Option
- * @PURPLE_POUNCE_OPTION_AWAY: Pounce only when away
- PURPLE_POUNCE_OPTION_NONE = 0x00,
- PURPLE_POUNCE_OPTION_AWAY = 0x01
- * @pounce: The #PurplePounce.
- * @event: The #PurplePounceEvent.
-typedef void (*PurplePounceCb)(PurplePounce *pounce, PurplePounceEvent event, void *data);
-/**************************************************************************/
-/**************************************************************************/
- * @ui_type: The type of UI the pounce is for.
- * @pouncer: The account that will pounce.
- * @pouncee: The buddy to pounce on.
- * @event: The event(s) to pounce on.
- * @option: Pounce options.
- * Creates a new buddy pounce.
- * Returns: (transfer full): The new buddy pounce structure.
-PurplePounce *purple_pounce_new(const char *ui_type, PurpleAccount *pouncer,
- const char *pouncee, PurplePounceEvent event,
- PurplePounceOption option);
- * purple_pounce_destroy:
- * @pounce: The buddy pounce.
- * Destroys a buddy pounce.
-void purple_pounce_destroy(PurplePounce *pounce);
- * purple_pounce_destroy_all_by_account:
- * @account: The account to remove all pounces from.
- * Destroys all buddy pounces for the account
-void purple_pounce_destroy_all_by_account(PurpleAccount *account);
- * purple_pounce_destroy_all_by_buddy:
- * @buddy: The buddy whose pounces are to be removed
- * Destroys all buddy pounces for a buddy
-void purple_pounce_destroy_all_by_buddy(PurpleBuddy *buddy);
- * purple_pounce_set_events:
- * @pounce: The buddy pounce.
- * @events: The events to watch for.
- * Sets the events a pounce should watch for.
-void purple_pounce_set_events(PurplePounce *pounce, PurplePounceEvent events);
- * purple_pounce_set_options:
- * @pounce: The buddy pounce.
- * @options: The options for the pounce.
- * Sets the options for a pounce.
-void purple_pounce_set_options(PurplePounce *pounce, PurplePounceOption options);
- * purple_pounce_set_pouncer:
- * @pounce: The buddy pounce.
- * @pouncer: The account that will pounce.
- * Sets the account that will do the pouncing.
-void purple_pounce_set_pouncer(PurplePounce *pounce, PurpleAccount *pouncer);
- * purple_pounce_set_pouncee:
- * @pounce: The buddy pounce.
- * @pouncee: The buddy to pounce on.
- * Sets the buddy a pounce should pounce on.
-void purple_pounce_set_pouncee(PurplePounce *pounce, const char *pouncee);
- * purple_pounce_set_save:
- * @pounce: The buddy pounce.
- * @save: %TRUE if the pounce should be saved, or %FALSE otherwise.
- * Sets whether or not the pounce should be saved after execution.
-void purple_pounce_set_save(PurplePounce *pounce, gboolean save);
- * purple_pounce_action_register:
- * @pounce: The buddy pounce.
- * @name: The action name.
- * Registers an action type for the pounce.
-void purple_pounce_action_register(PurplePounce *pounce, const char *name);
- * purple_pounce_action_set_enabled:
- * @pounce: The buddy pounce.
- * @action: The name of the action.
- * @enabled: The enabled state.
- * Enables or disables an action for a pounce.
-void purple_pounce_action_set_enabled(PurplePounce *pounce, const char *action,
- * purple_pounce_action_set_attribute:
- * @pounce: The buddy pounce.
- * @action: The action name.
- * @attr: The attribute name.
- * Sets a value for an attribute in an action.
- * If @value is %NULL, the value will be unset.
-void purple_pounce_action_set_attribute(PurplePounce *pounce, const char *action,
- const char *attr, const char *value);
- * purple_pounce_set_data:
- * @pounce: The buddy pounce.
- * @data: Data specific to the pounce.
- * Sets the pounce-specific data.
-void purple_pounce_set_data(PurplePounce *pounce, void *data);
- * purple_pounce_get_events:
- * @pounce: The buddy pounce.
- * Returns the events a pounce should watch for.
- * Returns: The events the pounce is watching for.
-PurplePounceEvent purple_pounce_get_events(const PurplePounce *pounce);
- * purple_pounce_get_options:
- * @pounce: The buddy pounce.
- * Returns the options for a pounce.
- * Returns: The options for the pounce.
-PurplePounceOption purple_pounce_get_options(const PurplePounce *pounce);
- * purple_pounce_get_pouncer:
- * @pounce: The buddy pounce.
- * Returns the account that will do the pouncing.
- * Returns: (transfer none): The account that will pounce.
-PurpleAccount *purple_pounce_get_pouncer(const PurplePounce *pounce);
- * purple_pounce_get_pouncee:
- * @pounce: The buddy pounce.
- * Returns the buddy a pounce should pounce on.
- * Returns: The buddy to pounce on.
-const char *purple_pounce_get_pouncee(const PurplePounce *pounce);
- * purple_pounce_get_save:
- * @pounce: The buddy pounce.
- * Returns whether or not the pounce should save after execution.
- * Returns: %TRUE if the pounce should be saved after execution, or
-gboolean purple_pounce_get_save(const PurplePounce *pounce);
- * purple_pounce_action_is_enabled:
- * @pounce: The buddy pounce.
- * @action: The action name.
- * Returns whether or not an action is enabled.
- * Returns: %TRUE if the action is enabled, or %FALSE otherwise.
-gboolean purple_pounce_action_is_enabled(const PurplePounce *pounce,
- * purple_pounce_action_get_attribute:
- * @pounce: The buddy pounce.
- * @action: The action name.
- * @attr: The attribute name.
- * Returns the value for an attribute in an action.
- * Returns: The attribute value, if it exists, or %NULL.
-const char *purple_pounce_action_get_attribute(const PurplePounce *pounce,
- * purple_pounce_get_data:
- * @pounce: The buddy pounce.
- * Returns the pounce-specific data.
- * Returns: The data specific to a buddy pounce.
-void *purple_pounce_get_data(const PurplePounce *pounce);
- * purple_pounce_execute:
- * @pouncer: The account that will do the pouncing.
- * @pouncee: The buddy that is being pounced.
- * @events: The events that triggered the pounce.
- * Executes a pounce with the specified pouncer, pouncee, and event type.
-void purple_pounce_execute(PurpleAccount *pouncer, const char *pouncee,
- PurplePounceEvent events);
-/**************************************************************************/
-/* Buddy Pounce Subsystem API */
-/**************************************************************************/
- * @pouncer: The account to match against.
- * @pouncee: The buddy to match against.
- * @events: The event(s) to match against.
- * Finds a pounce with the specified event(s) and buddy.
- * Returns: (transfer none): The pounce if found, or %NULL otherwise.
-PurplePounce *purple_find_pounce(PurpleAccount *pouncer,
- const char *pouncee, PurplePounceEvent events);
- * purple_pounces_register_handler:
- * @cb: (scope call): The callback function.
- * @new_pounce: The function called when a pounce is created.
- * @free_pounce: The function called when a pounce is freed.
- * Registers a pounce handler for a UI.
-void purple_pounces_register_handler(const char *ui, PurplePounceCb cb,
- void (*new_pounce)(PurplePounce *pounce),
- void (*free_pounce)(PurplePounce *pounce));
- * purple_pounces_unregister_handler:
- * Unregisters a pounce handle for a UI.
-void purple_pounces_unregister_handler(const char *ui);
- * purple_pounces_get_all:
- * Returns a list of all registered buddy pounces.
- * Returns: (element-type PurplePounce) (transfer none): The list of buddy pounces.
-GList *purple_pounces_get_all(void);
- * purple_pounces_get_all_for_ui:
- * @ui: The ID of the UI using the core.
- * Returns a list of registered buddy pounces for the ui-type.
- * Returns: (element-type PurplePounce) (transfer container): The list of buddy pounces.
-GList *purple_pounces_get_all_for_ui(const char *ui);
- * purple_pounces_get_handle:
- * Returns the buddy pounce subsystem handle.
- * Returns: The subsystem handle.
-void *purple_pounces_get_handle(void);
- * Initializes the pounces subsystem.
-void purple_pounces_init(void);
- * purple_pounces_uninit:
- * Uninitializes the pounces subsystem.
-void purple_pounces_uninit(void);
-#endif /* PURPLE_POUNCE_H */
--- a/pidgin/gtkblist.c Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/gtkblist.c Sat Jan 02 22:05:09 2021 -0600
@@ -32,7 +32,6 @@
#include "gtkstatusbox.h"
@@ -713,12 +712,6 @@
gtk_tree_path_free(path);
-static void gtk_blist_menu_bp_cb(GtkWidget *w, PurpleBuddy *b)
- pidgin_pounce_editor_show(purple_buddy_get_account(b),
- purple_buddy_get_name(b), NULL);
static void gtk_blist_menu_showlog_cb(GtkWidget *w, PurpleBlistNode *node)
@@ -1557,9 +1550,6 @@
- pidgin_new_menu_item(menu, _("Add Buddy _Pounce..."), NULL,
- G_CALLBACK(gtk_blist_menu_bp_cb), buddy);
if (node->parent && node->parent->child->next &&
!sub && !contact_expanded) {
pidgin_new_menu_item(menu, _("View _Log"), NULL,
--- a/pidgin/gtkconv.c Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/gtkconv.c Sat Jan 02 22:05:09 2021 -0600
@@ -46,7 +46,6 @@
@@ -943,18 +942,6 @@
-menu_add_pounce_cb(GtkAction *action, gpointer data)
- PidginConvWindow *win = data;
- PurpleConversation *conv;
- conv = pidgin_conv_window_get_active_gtkconv(win)->active_conv;
- pidgin_pounce_editor_show(purple_conversation_get_account(conv),
- purple_conversation_get_name(conv), NULL);
menu_alias_cb(GtkAction *action, gpointer data)
PidginConvWindow *win = data;
@@ -2423,7 +2410,6 @@
{ "SendFile", PIDGIN_STOCK_TOOLBAR_SEND_FILE, N_("Se_nd File..."), NULL, NULL, G_CALLBACK(menu_send_file_cb) },
{ "GetAttention", PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, N_("Get _Attention"), NULL, NULL, G_CALLBACK(menu_get_attention_cb) },
- { "AddBuddyPounce", NULL, N_("Add Buddy _Pounce..."), NULL, NULL, G_CALLBACK(menu_add_pounce_cb) },
{ "GetInfo", PIDGIN_STOCK_TOOLBAR_USER_INFO, N_("_Get Info"), "<control>O", NULL, G_CALLBACK(menu_get_info_cb) },
{ "Invite", NULL, N_("In_vite..."), NULL, NULL, G_CALLBACK(menu_invite_cb) },
{ "MoreMenu", NULL, N_("M_ore"), NULL, NULL, NULL },
@@ -2467,7 +2453,6 @@
"<menuitem action='SendFile'/>"
"<menuitem action='GetAttention'/>"
- "<menuitem action='AddBuddyPounce'/>"
"<menuitem action='GetInfo'/>"
"<menuitem action='Invite'/>"
"<menu action='MoreMenu'/>"
@@ -2864,10 +2849,6 @@
gtk_ui_manager_get_action(win->menu->ui,
"/Conversation/ConversationMenu/GetAttention");
- win->menu->add_pounce =
- gtk_ui_manager_get_action(win->menu->ui,
- "/Conversation/ConversationMenu/AddBuddyPounce");
@@ -4848,7 +4829,6 @@
gtk_action_set_visible(win->menu->view_log, TRUE);
gtk_action_set_visible(win->menu->send_file, TRUE);
gtk_action_set_visible(win->menu->get_attention, TRUE);
- gtk_action_set_visible(win->menu->add_pounce, TRUE);
gtk_action_set_visible(win->menu->get_info, TRUE);
gtk_action_set_visible(win->menu->invite, FALSE);
gtk_action_set_visible(win->menu->alias, TRUE);
@@ -4877,7 +4857,6 @@
gtk_action_set_visible(win->menu->view_log, TRUE);
gtk_action_set_visible(win->menu->send_file, FALSE);
gtk_action_set_visible(win->menu->get_attention, FALSE);
- gtk_action_set_visible(win->menu->add_pounce, FALSE);
gtk_action_set_visible(win->menu->get_info, FALSE);
gtk_action_set_visible(win->menu->invite, TRUE);
gtk_action_set_visible(win->menu->alias, TRUE);
@@ -4939,7 +4918,6 @@
/* Deal with menu items */
gtk_action_set_sensitive(win->menu->view_log, TRUE);
- gtk_action_set_sensitive(win->menu->add_pounce, TRUE);
gtk_action_set_sensitive(win->menu->get_info, (PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, get_info)));
gtk_action_set_sensitive(win->menu->invite, (PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, invite)));
gtk_action_set_sensitive(win->menu->insert_link, (features & PURPLE_CONNECTION_FLAG_HTML));
@@ -4981,7 +4959,6 @@
gtk_action_set_sensitive(win->menu->view_log, TRUE);
gtk_action_set_sensitive(win->menu->send_file, FALSE);
gtk_action_set_sensitive(win->menu->get_attention, FALSE);
- gtk_action_set_sensitive(win->menu->add_pounce, TRUE);
gtk_action_set_sensitive(win->menu->get_info, FALSE);
gtk_action_set_sensitive(win->menu->invite, FALSE);
gtk_action_set_sensitive(win->menu->alias, FALSE);
@@ -6464,7 +6441,6 @@
--- a/pidgin/gtkconvwin.h Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/gtkconvwin.h Sat Jan 02 22:05:09 2021 -0600
@@ -57,7 +57,6 @@
GtkAction *get_attention;
--- a/pidgin/gtknotify.c Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/gtknotify.c Sat Jan 02 22:05:09 2021 -0600
@@ -28,7 +28,6 @@
@@ -51,14 +50,6 @@
-} PidginNotifyPounceData;
- PurpleAccount *account;
@@ -82,18 +73,6 @@
@@ -114,12 +93,10 @@
static PidginNotifyDialog *mail_dialog = NULL;
-static PidginNotifyDialog *pounce_dialog = NULL;
static PidginNotifyDialog *pidgin_create_notification_dialog(PidginNotifyType type);
static void *pidgin_notify_emails(PurpleConnection *gc, size_t count, gboolean detailed,
@@ -136,225 +113,6 @@
-pounce_response_close(PidginNotifyDialog *dialog)
- PidginNotifyPounceData *pounce_data;
- while (gtk_tree_model_get_iter_first(
- GTK_TREE_MODEL(pounce_dialog->treemodel), &iter)) {
- gtk_tree_model_get(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter,
- PIDGIN_POUNCE_DATA, &pounce_data,
- gtk_tree_store_remove(dialog->treemodel, &iter);
- g_free(pounce_data->pouncee);
- gtk_widget_destroy(pounce_dialog->dialog);
-delete_foreach(GtkTreeModel *model, GtkTreePath *path,
- GtkTreeIter *iter, gpointer data)
- PidginNotifyPounceData *pounce_data;
- gtk_tree_model_get(model, iter,
- PIDGIN_POUNCE_DATA, &pounce_data,
- if (pounce_data != NULL) {
- g_free(pounce_data->pouncee);
-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,
- if (pounce_data != NULL) {
- PurpleIMConversation *im;
- im = purple_im_conversation_new(pounce_data->account, pounce_data->pouncee);
- purple_conversation_present(PURPLE_CONVERSATION(im));
-append_to_list(GtkTreeModel *model, GtkTreePath *path,
- GtkTreeIter *iter, gpointer data)
- *list = g_list_prepend(*list, gtk_tree_path_copy(path));
-pounce_response_dismiss()
- GtkTreeModel *model = GTK_TREE_MODEL(pounce_dialog->treemodel);
- GtkTreeSelection *selection;
- GtkTreeIter new_selection;
- gboolean found_selection = FALSE;
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(pounce_dialog->treeview));
- gtk_tree_selection_selected_foreach(selection, delete_foreach, pounce_dialog);
- gtk_tree_selection_selected_foreach(selection, append_to_list, &list);
- g_return_if_fail(list != NULL);
- if (list->next == NULL) {
- gtk_tree_model_get_iter(model, &new_selection, list->data);
- if (gtk_tree_model_iter_next(model, &new_selection))
- found_selection = TRUE;
- /* This is the last thing in the list */
- /* Because gtk_tree_model_iter_prev doesn't exist... */
- gtk_tree_model_get_iter(model, &new_selection, list->data);
- path = gtk_tree_model_get_path(model, &new_selection);
- if (gtk_tree_path_prev(path)) {
- gtk_tree_model_get_iter(model, &new_selection, path);
- found_selection = TRUE;
- gtk_tree_path_free(path);
- if (gtk_tree_model_get_iter(model, &iter, list->data)) {
- gtk_tree_store_remove(GTK_TREE_STORE(pounce_dialog->treemodel), &iter);
- gtk_tree_path_free(list->data);
- list = g_list_delete_link(list, list);
- if (gtk_tree_model_get_iter_first(model, &iter)) {
- gtk_tree_selection_select_iter(selection, &new_selection);
- gtk_tree_selection_select_iter(selection, &iter);
- pounce_response_close(pounce_dialog);
-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();
-pounce_response_edit_cb(GtkTreeModel *model, GtkTreePath *path,
- GtkTreeIter *iter, gpointer data)
- PidginNotifyPounceData *pounce_data;
- PidginNotifyDialog *dialog = (PidginNotifyDialog*)data;
- list = purple_pounces_get_all();
- gtk_tree_model_get(GTK_TREE_MODEL(dialog->treemodel), iter,
- PIDGIN_POUNCE_DATA, &pounce_data,
- if (g_list_find(list, pounce_data->pounce) != NULL) {
- pidgin_pounce_editor_show(pounce_data->account, NULL, pounce_data->pounce);
- purple_debug_warning("gtknotify", "Pounce was destroyed.\n");
-pounce_response_cb(GtkDialog *dlg, gint id, PidginNotifyDialog *dialog)
- GtkTreeSelection *selection = NULL;
- case GTK_RESPONSE_CLOSE:
- case GTK_RESPONSE_DELETE_EVENT:
- pounce_response_close(dialog);
- pounce_response_open_ims();
- pounce_response_dismiss();
- case GTK_RESPONSE_APPLY:
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
- gtk_tree_selection_selected_foreach(selection, pounce_response_edit_cb,
-pounce_row_selected_cb(GtkTreeView *tv, GtkTreePath *path,
- GtkTreeViewColumn *col, gpointer data)
- GtkTreeSelection *selection;
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(pounce_dialog->treeview));
- count = gtk_tree_selection_count_selected_rows(selection);
- 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) {
- PidginNotifyPounceData *pounce_data;
- list = gtk_tree_selection_get_selected_rows(selection, NULL);
- gtk_tree_model_get_iter(GTK_TREE_MODEL(pounce_dialog->treemodel),
- gtk_tree_model_get(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter,
- PIDGIN_POUNCE_DATA, &pounce_data,
- g_list_free_full(list, (GDestroyNotify)gtk_tree_path_free);
- pounces = purple_pounces_get_all();
- if (g_list_find(pounces, pounce_data->pounce) != NULL) {
- gtk_widget_set_sensitive(pounce_dialog->edit_button, TRUE);
- gtk_widget_set_sensitive(pounce_dialog->open_button, TRUE);
- gtk_widget_set_sensitive(pounce_dialog->dismiss_button, TRUE);
- 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, TRUE);
reset_mail_dialog(gpointer unused)
g_return_if_fail(mail_dialog != NULL);
@@ -1236,49 +994,6 @@
-pidgin_notify_pounce_add(PurpleAccount *account, PurplePounce *pounce,
- const char *alias, const char *event, const char *message, const char *date)
- PidginNotifyPounceData *pounce_data;
- gboolean first = (pounce_dialog == NULL);
- if (pounce_dialog == NULL)
- pounce_dialog = pidgin_create_notification_dialog(PIDGIN_NOTIFY_POUNCE);
- icon = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_SMALL);
- pounce_data = g_new(PidginNotifyPounceData, 1);
- 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);
- gtk_tree_store_set(pounce_dialog->treemodel, &iter,
- PIDGIN_POUNCE_ICON, icon,
- PIDGIN_POUNCE_ALIAS, alias,
- PIDGIN_POUNCE_EVENT, event,
- PIDGIN_POUNCE_TEXT, (message != NULL)? message : _("No message"),
- PIDGIN_POUNCE_DATE, date,
- PIDGIN_POUNCE_DATA, pounce_data,
- GtkTreeSelection *selection =
- gtk_tree_view_get_selection(GTK_TREE_VIEW(pounce_dialog->treeview));
- gtk_tree_selection_select_iter(selection, &iter);
- gtk_widget_show_all(pounce_dialog->dialog);
static PidginNotifyDialog *
pidgin_create_notification_dialog(PidginNotifyType type)
@@ -1300,12 +1015,6 @@
model = gtk_tree_store_new(COLUMNS_PIDGIN_MAIL,
GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER);
- } else if (type == PIDGIN_NOTIFY_POUNCE) {
- g_return_val_if_fail(pounce_dialog == NULL, pounce_dialog);
- model = gtk_tree_store_new(COLUMNS_PIDGIN_POUNCE,
- GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_POINTER);
dialog = gtk_dialog_new();
@@ -1368,80 +1077,6 @@
label = gtk_label_new(NULL);
gtk_label_set_markup(GTK_LABEL(label), _("<span weight=\"bold\" size=\"larger\">You have mail!</span>"));
- } else if (type == PIDGIN_NOTIFY_POUNCE) {
- 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),
- PIDGIN_STOCK_MODIFY, GTK_RESPONSE_APPLY);
- gtk_widget_set_sensitive(button, FALSE);
- spec_dialog->edit_button = button;
- /* Translators: Make sure you translate "Dismiss" differently than
- "close"! This string is used in the "You have pounced" dialog
- that appears when one of your Buddy Pounces is triggered. In
- this context "Dismiss" means "I acknowledge that I've seen that
- this pounce was triggered--remove it from this list." Translating
- it as "Remove" is acceptable if you can't think of a more precise
- button = gtk_dialog_add_button(GTK_DIALOG(dialog), _("Dismiss"),
- gtk_widget_set_sensitive(button, FALSE);
- spec_dialog->dismiss_button = button;
- g_signal_connect(G_OBJECT(dialog), "response",
- G_CALLBACK(pounce_response_cb), spec_dialog);
- column = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(column, _("Buddy"));
- gtk_tree_view_column_set_resizable(column, TRUE);
- rend = gtk_cell_renderer_pixbuf_new();
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_set_attributes(column, rend, "pixbuf", PIDGIN_POUNCE_ICON, NULL);
- rend = gtk_cell_renderer_text_new();
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_add_attribute(column, rend, "text", PIDGIN_POUNCE_ALIAS);
- gtk_tree_view_append_column(GTK_TREE_VIEW(spec_dialog->treeview), column);
- column = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(column, _("Event"));
- gtk_tree_view_column_set_resizable(column, TRUE);
- rend = gtk_cell_renderer_text_new();
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_add_attribute(column, rend, "text", PIDGIN_POUNCE_EVENT);
- gtk_tree_view_append_column(GTK_TREE_VIEW(spec_dialog->treeview), column);
- column = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(column, _("Message"));
- gtk_tree_view_column_set_resizable(column, TRUE);
- rend = gtk_cell_renderer_text_new();
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_add_attribute(column, rend, "text", PIDGIN_POUNCE_TEXT);
- gtk_tree_view_append_column(GTK_TREE_VIEW(spec_dialog->treeview), column);
- column = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(column, _("Date"));
- gtk_tree_view_column_set_resizable(column, TRUE);
- rend = gtk_cell_renderer_text_new();
- gtk_tree_view_column_pack_start(column, rend, FALSE);
- gtk_tree_view_column_add_attribute(column, rend, "text", PIDGIN_POUNCE_DATE);
- gtk_tree_view_append_column(GTK_TREE_VIEW(spec_dialog->treeview), column);
- label = gtk_label_new(NULL);
- gtk_label_set_markup(GTK_LABEL(label), _("<span weight=\"bold\" size=\"larger\">You have pounced!</span>"));
- sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(spec_dialog->treeview));
- 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_response_open_ims), NULL);
gtk_dialog_add_button(GTK_DIALOG(dialog),
--- a/pidgin/gtknotify.h Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/gtknotify.h Sat Jan 02 22:05:09 2021 -0600
@@ -37,20 +37,6 @@
- * pidgin_notify_pounce_add:
- * @account: The account
- * @alias: The buddy alias
- * @event: Event description
- * @message: Pounce message
- * Adds a buddy pounce to the buddy pounce dialog
-void pidgin_notify_pounce_add(PurpleAccount *account, PurplePounce *pounce,
- const char *alias, const char *event, const char *message, const char *date);
* pidgin_notify_get_ui_ops:
* Returns the UI operations structure for GTK+ notification functions.
--- a/pidgin/gtkpounce.c Sat Jan 02 21:58:08 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1485 +0,0 @@
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * 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 02111-1301 USA
-#include <glib/gi18n-lib.h>
-#include "pidginstock.h"
-#include "pidginaccountchooser.h"
-#include "pidginaccountstore.h"
-#include "pidgindialog.h"
-#include "pidgintalkatu.h"
-#include <gdk/gdkkeysyms.h>
- * These are used for the GtkTreeView when you're scrolling through
- * all your saved pounces.
- /* Hidden column containing the PurplePounce */
- POUNCES_MANAGER_COLUMN_POUNCE,
- POUNCES_MANAGER_COLUMN_ICON,
- POUNCES_MANAGER_COLUMN_TARGET,
- POUNCES_MANAGER_COLUMN_ACCOUNT,
- POUNCES_MANAGER_COLUMN_RECURRING,
- POUNCES_MANAGER_NUM_COLUMNS
- PurpleAccount *account;
- GtkWidget *account_menu;
- GtkWidget *buddy_entry;
- /* Pounce When Buddy... */
- GtkWidget *away_return;
- GtkWidget *idle_return;
- GtkWidget *stop_typing;
- GtkWidget *message_recv;
- GtkWidget *popup_entry;
- GtkWidget *send_msg_entry;
- GtkTextBuffer *send_msg_buffer;
- GtkWidget *exec_cmd_entry;
- GtkWidget *exec_cmd_browse;
- GtkWidget *save_pounce;
- GtkWidget *save_button;
- GtkWidget *modify_button;
- GtkWidget *delete_button;
-static PouncesManager *pounces_manager = NULL;
-/**************************************************************************
- **************************************************************************/
-delete_win_cb(GtkWidget *w, GdkEventAny *e, PidginPounceDialog *dialog)
- gtk_widget_destroy(dialog->window);
-cancel_cb(GtkWidget *w, PidginPounceDialog *dialog)
- delete_win_cb(NULL, NULL, dialog);
-pounce_update_entry_fields(void *user_data, const char *filename)
- GtkWidget *entry = (GtkWidget *)user_data;
- gtk_entry_set_text(GTK_ENTRY(entry), filename);
-filesel(GtkWidget *widget, gpointer data)
- entry = (GtkWidget *)data;
- name = gtk_entry_get_text(GTK_ENTRY(entry));
- purple_request_file(entry, _("Select a file"), name, FALSE,
- G_CALLBACK(pounce_update_entry_fields), NULL, NULL, entry);
- g_signal_connect_swapped(G_OBJECT(entry), "destroy",
- G_CALLBACK(purple_request_close_with_handle), entry);
-add_pounce_to_treeview(GtkListStore *model, PurplePounce *pounce)
- PurpleAccount *account;
- account = purple_pounce_get_pouncer(pounce);
- pixbuf = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_MEDIUM);
- pouncer = purple_account_get_username(account);
- pouncee = purple_pounce_get_pouncee(pounce);
- recurring = purple_pounce_get_save(pounce);
- gtk_list_store_append(model, &iter);
- gtk_list_store_set(model, &iter,
- POUNCES_MANAGER_COLUMN_POUNCE, pounce,
- POUNCES_MANAGER_COLUMN_ICON, pixbuf,
- POUNCES_MANAGER_COLUMN_TARGET, pouncee,
- POUNCES_MANAGER_COLUMN_ACCOUNT, pouncer,
- POUNCES_MANAGER_COLUMN_RECURRING, recurring,
- g_object_unref(pixbuf);
-populate_pounces_list(PouncesManager *dialog)
- gtk_list_store_clear(dialog->model);
- for (pounces = purple_pounces_get_all_for_ui(PIDGIN_UI); pounces != NULL;
- pounces = g_list_delete_link(pounces, pounces))
- add_pounce_to_treeview(dialog->model, pounces->data);
- /* Rebuild the pounces list if the pounces manager is open */
- if (pounces_manager != NULL)
- populate_pounces_list(pounces_manager);
-signed_on_off_cb(PurpleConnection *gc, gpointer user_data)
-save_pounce_cb(GtkWidget *w, PidginPounceDialog *dialog)
- const char *command, *reason;
- PurplePounceEvent events = PURPLE_POUNCE_NONE;
- PurplePounceOption options = PURPLE_POUNCE_OPTION_NONE;
- name = gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry));
- purple_notify_error(NULL, NULL, _("Please enter a buddy to "
- "pounce."), NULL, NULL);
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->on_away)))
- options |= PURPLE_POUNCE_OPTION_AWAY;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->signon)))
- events |= PURPLE_POUNCE_SIGNON;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->signoff)))
- events |= PURPLE_POUNCE_SIGNOFF;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->away)))
- events |= PURPLE_POUNCE_AWAY;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->away_return)))
- events |= PURPLE_POUNCE_AWAY_RETURN;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->idle)))
- events |= PURPLE_POUNCE_IDLE;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->idle_return)))
- events |= PURPLE_POUNCE_IDLE_RETURN;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->typing)))
- events |= PURPLE_POUNCE_TYPING;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->typed)))
- events |= PURPLE_POUNCE_TYPED;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->stop_typing)))
- events |= PURPLE_POUNCE_TYPING_STOPPED;
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->message_recv)))
- events |= PURPLE_POUNCE_MESSAGE_RECEIVED;
- message = talkatu_markup_get_html(dialog->send_msg_buffer, NULL);
- command = gtk_entry_get_text(GTK_ENTRY(dialog->exec_cmd_entry));
- reason = gtk_entry_get_text(GTK_ENTRY(dialog->popup_entry));
- if (*reason == '\0') reason = NULL;
- if (*message == '\0') {
- if (*command == '\0') command = NULL;
- /* If the pounce has already been triggered, let's pretend it is a new one */
- if (dialog->pounce != NULL
- && g_list_find(purple_pounces_get_all(), dialog->pounce) == NULL) {
- purple_debug_info("gtkpounce", "Saving pounce that no longer exists; creating new pounce.\n");
- if (dialog->pounce == NULL)
- dialog->pounce = purple_pounce_new(PIDGIN_UI, dialog->account,
- name, events, options);
- purple_pounce_set_events(dialog->pounce, events);
- purple_pounce_set_options(dialog->pounce, options);
- purple_pounce_set_pouncer(dialog->pounce, dialog->account);
- purple_pounce_set_pouncee(dialog->pounce, name);
- purple_pounce_action_set_enabled(dialog->pounce, "open-window",
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->open_win)));
- purple_pounce_action_set_enabled(dialog->pounce, "popup-notify",
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->popup)));
- purple_pounce_action_set_enabled(dialog->pounce, "send-message",
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->send_msg)));
- purple_pounce_action_set_enabled(dialog->pounce, "execute-command",
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd)));
- purple_pounce_action_set_attribute(dialog->pounce, "send-message",
- purple_pounce_action_set_attribute(dialog->pounce, "execute-command",
- purple_pounce_action_set_attribute(dialog->pounce, "popup-notify",
- /* Set the defaults for next time. */
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/open-window",
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->open_win)));
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/popup-notify",
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->popup)));
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/send-message",
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->send_msg)));
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/execute-command",
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd)));
- purple_pounce_set_save(dialog->pounce,
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->save_pounce)));
- delete_win_cb(NULL, NULL, dialog);
-entry_key_press_cb(GtkWidget *widget, GdkEventKey *event,
- PidginPounceDialog *dialog)
- if ((event->keyval == GDK_KEY_Return)
- || (event->keyval == GDK_KEY_KP_Enter)) {
- save_pounce_cb(widget, dialog);
-pounce_choose_cb(GtkWidget *w, PidginPounceDialog *dialog)
- PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(w);
- dialog->account = pidgin_account_chooser_get_selected(chooser);
-buddy_changed_cb(GtkEntry *entry, PidginPounceDialog *dialog)
- if (dialog->save_button == NULL)
- gtk_widget_set_sensitive(dialog->save_button,
- *gtk_entry_get_text(entry) != '\0');
-message_recv_toggle(GtkButton *message_recv, GtkWidget *send_msg)
- gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(message_recv));
- gtk_widget_set_sensitive(send_msg, !active);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(send_msg), FALSE);
-pounce_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y,
- GtkSelectionData *sd, guint info, guint t, gpointer data)
- PidginPounceDialog *dialog;
- GdkAtom target = gtk_selection_data_get_target(sd);
- const guchar *sd_data = gtk_selection_data_get_data(sd);
- if (target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE))
- PurpleBlistNode *node = NULL;
- memcpy(&node, sd_data, sizeof(node));
- if (PURPLE_IS_CONTACT(node))
- buddy = purple_contact_get_priority_buddy((PurpleContact *)node);
- else if (PURPLE_IS_BUDDY(node))
- buddy = (PurpleBuddy *)node;
- dialog = (PidginPounceDialog *)data;
- gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), purple_buddy_get_name(buddy));
- dialog->account = purple_buddy_get_account(buddy);
- pidgin_account_chooser_set_selected(
- PIDGIN_ACCOUNT_CHOOSER(dialog->account_menu),
- purple_buddy_get_account(buddy));
- gtk_drag_finish(dc, TRUE, (gdk_drag_context_get_actions(dc) == GDK_ACTION_MOVE), t);
- else if (target == gdk_atom_intern("application/x-im-contact", FALSE))
- PurpleAccount *account;
- if (pidgin_parse_x_im_contact((const char *)sd_data, FALSE, &account,
- &protocol, &username, NULL))
- purple_notify_error(NULL, NULL,
- _("You are not currently signed on with an account that "
- "can add that buddy."), NULL, NULL);
- dialog = (PidginPounceDialog *)data;
- gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), username);
- dialog->account = account;
- pidgin_account_chooser_set_selected(
- PIDGIN_ACCOUNT_CHOOSER(dialog->account_menu), account);
- gtk_drag_finish(dc, TRUE, (gdk_drag_context_get_actions(dc) == GDK_ACTION_MOVE), t);
-static const GtkTargetEntry dnd_targets[] =
- {"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, 0},
- {"application/x-im-contact", 0, 1}
-reset_send_msg_entry(PidginPounceDialog *dialog, GtkWidget *dontcare)
- PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(dialog->account_menu);
- PurpleAccount *account = pidgin_account_chooser_get_selected(chooser);
- if(GTK_IS_TEXT_BUFFER(dialog->send_msg_buffer)) {
- g_object_unref(dialog->send_msg_buffer);
- dialog->send_msg_buffer = NULL;
- PurpleConnection *pc = purple_account_get_connection(account);
- dialog->send_msg_buffer = pidgin_talkatu_buffer_new_for_connection(pc);
- if(dialog->send_msg_buffer == NULL) {
- dialog->send_msg_buffer = talkatu_buffer_new(NULL);
- gtk_text_view_set_buffer(GTK_TEXT_VIEW(dialog->send_msg_entry), dialog->send_msg_buffer);
-pidgin_pounce_editor_show(PurpleAccount *account, const char *name,
- PurplePounce *cur_pounce)
- PidginPounceDialog *dialog;
- GtkWidget *vbox1, *vbox2;
- g_return_if_fail((cur_pounce != NULL) ||
- (purple_accounts_get_all() != NULL));
- dialog = g_new0(PidginPounceDialog, 1);
- if (cur_pounce != NULL)
- dialog->pounce = cur_pounce;
- dialog->account = purple_pounce_get_pouncer(cur_pounce);
- else if (account != NULL)
- dialog->account = account;
- GList *connections = purple_connections_get_all();
- if (connections != NULL)
- gc = (PurpleConnection *)connections->data;
- dialog->account = purple_connection_get_account(gc);
- dialog->account = purple_accounts_get_all()->data;
- sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
- /* Create the window. */
- dialog->window = window = gtk_dialog_new();
- gtk_window_set_title(GTK_WINDOW(window), (cur_pounce == NULL ? _("Add Buddy Pounce") : _("Modify Buddy Pounce")));
- gtk_window_set_role(GTK_WINDOW(window), "buddy_pounce");
- g_signal_connect(G_OBJECT(window), "delete_event",
- G_CALLBACK(delete_win_cb), dialog);
- /* Get the parent vbox for everything. */
- vbox1 = gtk_dialog_get_content_area(GTK_DIALOG(window));
- /* Create the vbox that will contain all the prefs stuff. */
- vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
- gtk_box_pack_start(GTK_BOX(vbox1), vbox2, TRUE, TRUE, 0);
- /* Create the "Pounce on Whom" frame. */
- frame = pidgin_make_frame(vbox2, _("Pounce on Whom"));
- hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
- gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0);
- label = gtk_label_new_with_mnemonic(_("_Account:"));
- gtk_label_set_xalign(GTK_LABEL(label), 0);
- gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
- gtk_widget_show(label);
- gtk_size_group_add_widget(sg, label);
- dialog->account_menu = pidgin_account_chooser_new();
- model = GTK_TREE_MODEL(pidgin_account_store_new());
- gtk_combo_box_set_model(GTK_COMBO_BOX(dialog->account_menu), model);
- g_object_unref(G_OBJECT(model));
- pidgin_account_chooser_set_selected(
- PIDGIN_ACCOUNT_CHOOSER(dialog->account_menu), dialog->account);
- g_signal_connect(dialog->account_menu, "changed",
- G_CALLBACK(pounce_choose_cb), dialog);
- gtk_box_pack_start(GTK_BOX(hbox), dialog->account_menu, FALSE, FALSE, 0);
- gtk_widget_show(dialog->account_menu);
- pidgin_set_accessible_label(dialog->account_menu, GTK_LABEL(label));
- hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
- gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0);
- label = gtk_label_new_with_mnemonic(_("_Buddy name:"));
- gtk_label_set_xalign(GTK_LABEL(label), 0);
- gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
- gtk_widget_show(label);
- gtk_size_group_add_widget(sg, label);
- dialog->buddy_entry = gtk_entry_new();
- pidgin_setup_screenname_autocomplete(dialog->buddy_entry, dialog->account_menu, pidgin_screenname_autocomplete_default_filter, GINT_TO_POINTER(FALSE));
- gtk_box_pack_start(GTK_BOX(hbox), dialog->buddy_entry, TRUE, TRUE, 0);
- gtk_widget_show(dialog->buddy_entry);
- g_signal_connect(G_OBJECT(dialog->buddy_entry), "changed",
- G_CALLBACK(buddy_changed_cb), dialog);
- pidgin_set_accessible_label(dialog->buddy_entry, GTK_LABEL(label));
- if (cur_pounce != NULL) {
- gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry),
- purple_pounce_get_pouncee(cur_pounce));
- else if (name != NULL) {
- gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), name);
- /* Create the "Pounce When Buddy..." frame. */
- frame = pidgin_make_frame(vbox2, _("Pounce When Buddy..."));
- gtk_container_add(GTK_CONTAINER(frame), grid);
- gtk_grid_set_column_spacing(GTK_GRID(grid), 12);
- gtk_check_button_new_with_mnemonic(_("Si_gns on"));
- gtk_check_button_new_with_mnemonic(_("Signs o_ff"));
- gtk_check_button_new_with_mnemonic(_("Goes a_way"));
- gtk_check_button_new_with_mnemonic(_("Ret_urns from away"));
- gtk_check_button_new_with_mnemonic(_("Becomes _idle"));
- gtk_check_button_new_with_mnemonic(_("Is no longer i_dle"));
- gtk_check_button_new_with_mnemonic(_("Starts _typing"));
- gtk_check_button_new_with_mnemonic(_("P_auses while typing"));
- gtk_check_button_new_with_mnemonic(_("Stops t_yping"));
- gtk_check_button_new_with_mnemonic(_("Sends a _message"));
- gtk_widget_set_valign(dialog->message_recv, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->signon, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->signoff, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->away, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->away_return, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->idle, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->idle_return, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->typing, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->typed, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->stop_typing, GTK_ALIGN_CENTER);
- gtk_grid_attach(GTK_GRID(grid), dialog->message_recv, 0, 0, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->signon, 0, 1, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->signoff, 0, 2, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->away, 1, 0, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->away_return, 1, 1, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->idle, 1, 2, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->idle_return, 2, 0, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->typing, 2, 1, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->typed, 2, 2, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->stop_typing, 3, 0, 1, 1);
- gtk_widget_show(dialog->signon);
- gtk_widget_show(dialog->signoff);
- gtk_widget_show(dialog->away);
- gtk_widget_show(dialog->away_return);
- gtk_widget_show(dialog->idle);
- gtk_widget_show(dialog->idle_return);
- gtk_widget_show(dialog->typing);
- gtk_widget_show(dialog->typed);
- gtk_widget_show(dialog->stop_typing);
- gtk_widget_show(dialog->message_recv);
- /* Create the "Action" frame. */
- frame = pidgin_make_frame(vbox2, _("Action"));
- gtk_container_add(GTK_CONTAINER(frame), grid);
- gtk_grid_set_column_spacing(GTK_GRID(grid), 12);
- = gtk_check_button_new_with_mnemonic(_("Ope_n an IM window"));
- = gtk_check_button_new_with_mnemonic(_("_Pop up a notification"));
- = gtk_check_button_new_with_mnemonic(_("Send a _message"));
- = gtk_check_button_new_with_mnemonic(_("E_xecute a command"));
- editor = talkatu_editor_new();
- dialog->send_msg_entry = talkatu_editor_get_input(TALKATU_EDITOR(editor));
- reset_send_msg_entry(dialog, NULL);
- dialog->exec_cmd_entry = gtk_entry_new();
- dialog->popup_entry = gtk_entry_new();
- dialog->exec_cmd_browse = gtk_button_new_with_mnemonic(_("Brows_e..."));
- gtk_widget_set_sensitive(editor, FALSE);
- gtk_widget_set_sensitive(dialog->exec_cmd_entry, FALSE);
- gtk_widget_set_sensitive(dialog->popup_entry, FALSE);
- gtk_widget_set_sensitive(dialog->exec_cmd_browse, FALSE);
- sg = gtk_size_group_new(GTK_SIZE_GROUP_VERTICAL);
- gtk_size_group_add_widget(sg, dialog->open_win);
- gtk_size_group_add_widget(sg, dialog->popup);
- gtk_size_group_add_widget(sg, dialog->popup_entry);
- gtk_size_group_add_widget(sg, dialog->exec_cmd);
- gtk_size_group_add_widget(sg, dialog->exec_cmd_entry);
- gtk_size_group_add_widget(sg, dialog->exec_cmd_browse);
- gtk_widget_set_valign(dialog->open_win, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->popup, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->popup_entry, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->send_msg, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(editor, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->exec_cmd, GTK_ALIGN_CENTER);
- gtk_widget_set_valign(dialog->exec_cmd_entry, GTK_ALIGN_CENTER);
- gtk_widget_set_hexpand(dialog->exec_cmd_browse, TRUE);
- gtk_widget_set_valign(dialog->exec_cmd_browse, GTK_ALIGN_CENTER);
- gtk_grid_attach(GTK_GRID(grid), dialog->open_win, 0, 0, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->popup, 0, 1, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->popup_entry, 1, 1, 4, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->send_msg, 0, 2, 5, 1);
- gtk_grid_attach(GTK_GRID(grid), editor, 0, 3, 5, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->exec_cmd, 0, 4, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->exec_cmd_entry, 1, 4, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), dialog->exec_cmd_browse, 2, 4, 1, 1);
- gtk_grid_set_row_spacing(GTK_GRID(grid), 3);
- gtk_widget_show(dialog->open_win);
- gtk_widget_show(dialog->popup);
- gtk_widget_show(dialog->popup_entry);
- gtk_widget_show(dialog->send_msg);
- gtk_widget_show(editor);
- gtk_widget_show(dialog->exec_cmd);
- gtk_widget_show(dialog->exec_cmd_entry);
- gtk_widget_show(dialog->exec_cmd_browse);
- g_signal_connect(G_OBJECT(dialog->message_recv), "clicked",
- G_CALLBACK(message_recv_toggle),
- g_object_bind_property(dialog->send_msg, "active",
- g_object_bind_property(dialog->popup, "active",
- dialog->popup_entry, "sensitive",
- g_object_bind_property(dialog->exec_cmd, "active",
- dialog->exec_cmd_entry, "sensitive",
- g_object_bind_property(dialog->exec_cmd, "active",
- dialog->exec_cmd_browse, "sensitive",
- g_signal_connect(G_OBJECT(dialog->exec_cmd_browse), "clicked",
- dialog->exec_cmd_entry);
- g_signal_connect_swapped(G_OBJECT(dialog->send_msg_entry), "format-cleared",
- G_CALLBACK(reset_send_msg_entry), dialog);
- g_signal_connect_swapped(G_OBJECT(dialog->account_menu), "changed",
- G_CALLBACK(reset_send_msg_entry), dialog);
- g_signal_connect(G_OBJECT(dialog->send_msg_entry), "key-press-event",
- G_CALLBACK(entry_key_press_cb), dialog);
- g_signal_connect(G_OBJECT(dialog->popup_entry), "activate",
- G_CALLBACK(save_pounce_cb), dialog);
- g_signal_connect(G_OBJECT(dialog->exec_cmd_entry), "activate",
- G_CALLBACK(save_pounce_cb), dialog);
- /* Create the "Options" frame. */
- frame = pidgin_make_frame(vbox2, _("Options"));
- gtk_container_add(GTK_CONTAINER(frame), grid);
- gtk_grid_set_column_spacing(GTK_GRID(grid), 12);
- gtk_check_button_new_with_mnemonic(_("P_ounce only when my status is not Available"));
- gtk_widget_set_valign(dialog->on_away, GTK_ALIGN_CENTER);
- gtk_grid_attach(GTK_GRID(grid), dialog->on_away, 0, 0, 1, 1);
- dialog->save_pounce = gtk_check_button_new_with_mnemonic(
- gtk_widget_set_valign(dialog->save_pounce, GTK_ALIGN_CENTER);
- gtk_grid_attach(GTK_GRID(grid), dialog->save_pounce, 0, 1, 1, 1);
- gtk_widget_show(dialog->on_away);
- gtk_widget_show(dialog->save_pounce);
- button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- g_signal_connect(G_OBJECT(button), "clicked",
- G_CALLBACK(cancel_cb), dialog);
- dialog->save_button = button = gtk_dialog_add_button(GTK_DIALOG(window),
- (cur_pounce == NULL ? GTK_STOCK_ADD : GTK_STOCK_SAVE),
- g_signal_connect(G_OBJECT(button), "clicked",
- G_CALLBACK(save_pounce_cb), dialog);
- if (*gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry)) == '\0')
- gtk_widget_set_sensitive(button, FALSE);
- /* Setup drag-and-drop */
- gtk_drag_dest_set(window,
- GTK_DEST_DEFAULT_MOTION |
- sizeof(dnd_targets) / sizeof(GtkTargetEntry),
- gtk_drag_dest_set(dialog->buddy_entry,
- GTK_DEST_DEFAULT_MOTION |
- sizeof(dnd_targets) / sizeof(GtkTargetEntry),
- g_signal_connect(G_OBJECT(window), "drag_data_received",
- G_CALLBACK(pounce_dnd_recv), dialog);
- g_signal_connect(G_OBJECT(dialog->buddy_entry), "drag_data_received",
- G_CALLBACK(pounce_dnd_recv), dialog);
- /* Set the values of stuff. */
- if (cur_pounce != NULL)
- PurplePounceEvent events = purple_pounce_get_events(cur_pounce);
- PurplePounceOption options = purple_pounce_get_options(cur_pounce);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->on_away),
- (options & PURPLE_POUNCE_OPTION_AWAY));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->signon),
- (events & PURPLE_POUNCE_SIGNON));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->signoff),
- (events & PURPLE_POUNCE_SIGNOFF));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->away),
- (events & PURPLE_POUNCE_AWAY));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->away_return),
- (events & PURPLE_POUNCE_AWAY_RETURN));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->idle),
- (events & PURPLE_POUNCE_IDLE));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->idle_return),
- (events & PURPLE_POUNCE_IDLE_RETURN));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->typing),
- (events & PURPLE_POUNCE_TYPING));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->typed),
- (events & PURPLE_POUNCE_TYPED));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->stop_typing),
- (events & PURPLE_POUNCE_TYPING_STOPPED));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->message_recv),
- (events & PURPLE_POUNCE_MESSAGE_RECEIVED));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->open_win),
- purple_pounce_action_is_enabled(cur_pounce, "open-window"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->popup),
- purple_pounce_action_is_enabled(cur_pounce, "popup-notify"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->send_msg),
- purple_pounce_action_is_enabled(cur_pounce, "send-message"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd),
- purple_pounce_action_is_enabled(cur_pounce, "execute-command"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->save_pounce),
- purple_pounce_get_save(cur_pounce));
- if ((value = purple_pounce_action_get_attribute(cur_pounce,
- talkatu_markup_set_html(TALKATU_BUFFER(dialog->send_msg_buffer), value, -1);
- if ((value = purple_pounce_action_get_attribute(cur_pounce,
- gtk_entry_set_text(GTK_ENTRY(dialog->popup_entry), value);
- if ((value = purple_pounce_action_get_attribute(cur_pounce,
- gtk_entry_set_text(GTK_ENTRY(dialog->exec_cmd_entry), value);
- PurpleBuddy *buddy = NULL;
- buddy = purple_blist_find_buddy(account, name);
- /* Set some defaults */
- gtk_toggle_button_set_active(
- GTK_TOGGLE_BUTTON(dialog->signon), TRUE);
- if (!PURPLE_BUDDY_IS_ONLINE(buddy))
- gtk_toggle_button_set_active(
- GTK_TOGGLE_BUTTON(dialog->signon), TRUE);
- gboolean default_set = FALSE;
- PurplePresence *presence = purple_buddy_get_presence(buddy);
- if (purple_presence_is_idle(presence))
- gtk_toggle_button_set_active(
- GTK_TOGGLE_BUTTON(dialog->idle_return), TRUE);
- if (!purple_presence_is_available(presence))
- gtk_toggle_button_set_active(
- GTK_TOGGLE_BUTTON(dialog->away_return), TRUE);
- gtk_toggle_button_set_active(
- GTK_TOGGLE_BUTTON(dialog->signon), TRUE);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->open_win),
- purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/open-window"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->popup),
- purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/popup-notify"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->send_msg),
- purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/send-message"));
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd),
- purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/execute-command"));
- gtk_widget_show(vbox2);
- gtk_widget_show(window);
-pounces_manager_configure_cb(GtkWidget *widget, GdkEventConfigure *event, PouncesManager *dialog)
- if (gtk_widget_get_visible(widget)) {
- purple_prefs_set_int(PIDGIN_PREFS_ROOT "/pounces/dialog/width", event->width);
- purple_prefs_set_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height", event->height);
-pounces_manager_find_pounce(GtkTreeIter *iter, PurplePounce *pounce)
- GtkTreeModel *model = GTK_TREE_MODEL(pounces_manager->model);
- if (!gtk_tree_model_get_iter_first(model, iter))
- gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &p, -1);
- while (gtk_tree_model_iter_next(model, iter))
- gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &p, -1);
-pounces_manager_destroy_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
- PouncesManager *dialog = user_data;
- pidgin_pounces_manager_hide();
-pounces_manager_connection_cb(PurpleConnection *gc, GtkWidget *add_button)
- gtk_widget_set_sensitive(add_button, (purple_connections_get_all() != NULL));
-pounces_manager_add_cb(GtkButton *button, gpointer user_data)
- pidgin_pounce_editor_show(NULL, NULL, NULL);
-pounces_manager_modify_foreach(GtkTreeModel *model, GtkTreePath *path,
- GtkTreeIter *iter, gpointer user_data)
- gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &pounce, -1);
- pidgin_pounce_editor_show(NULL, NULL, pounce);
-pounces_manager_modify_cb(GtkButton *button, gpointer user_data)
- PouncesManager *dialog = user_data;
- GtkTreeSelection *selection;
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
- gtk_tree_selection_selected_foreach(selection, pounces_manager_modify_foreach, user_data);
-pounces_manager_delete_confirm_cb(PurplePounce *pounce)
- if (pounces_manager && pounces_manager_find_pounce(&iter, pounce))
- gtk_list_store_remove(pounces_manager->model, &iter);
- purple_request_close_with_handle(pounce);
- purple_pounce_destroy(pounce);
-pounces_manager_delete_foreach(GtkTreeModel *model, GtkTreePath *path,
- GtkTreeIter *iter, gpointer user_data)
- PurpleAccount *account;
- const char *pouncer, *pouncee;
- gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &pounce, -1);
- account = purple_pounce_get_pouncer(pounce);
- pouncer = purple_account_get_username(account);
- pouncee = purple_pounce_get_pouncee(pounce);
- buf = g_strdup_printf(_("Are you sure you want to delete the pounce on %s for %s?"), pouncee, pouncer);
- purple_request_action(pounce, NULL, buf, NULL, 0,
- purple_request_cpar_from_account(account),
- pounce, 2, _("Delete"), pounces_manager_delete_confirm_cb,
-pounces_manager_delete_cb(GtkButton *button, gpointer user_data)
- PouncesManager *dialog = user_data;
- GtkTreeSelection *selection;
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
- gtk_tree_selection_selected_foreach(selection, pounces_manager_delete_foreach, user_data);
-pounces_manager_close_cb(GtkButton *button, gpointer user_data)
- pidgin_pounces_manager_hide();
-pounce_selected_cb(GtkTreeSelection *sel, gpointer user_data)
- PouncesManager *dialog = user_data;
- num_selected = gtk_tree_selection_count_selected_rows(sel);
- gtk_widget_set_sensitive(dialog->modify_button, (num_selected > 0));
- gtk_widget_set_sensitive(dialog->delete_button, (num_selected > 0));
-pounce_double_click_cb(GtkTreeView *treeview, GdkEventButton *event, gpointer user_data)
- PouncesManager *dialog = user_data;
- /* Figure out which node was clicked */
- if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, NULL, NULL, NULL))
- gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path);
- gtk_tree_path_free(path);
- gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, POUNCES_MANAGER_COLUMN_POUNCE, &pounce, -1);
- if ((pounce != NULL) && (event->button == GDK_BUTTON_PRIMARY) &&
- (event->type == GDK_2BUTTON_PRESS))
- pidgin_pounce_editor_show(NULL, NULL, pounce);
-pounces_manager_recurring_cb(GtkCellRendererToggle *renderer, gchar *path_str,
- PouncesManager *dialog = user_data;
- GtkTreeModel *model = GTK_TREE_MODEL(dialog->model);
- gtk_tree_model_get_iter_from_string(model, &iter, path_str);
- gtk_tree_model_get(model, &iter,
- POUNCES_MANAGER_COLUMN_POUNCE, &pounce,
- POUNCES_MANAGER_COLUMN_RECURRING, &recurring,
- purple_pounce_set_save(pounce, !recurring);
-search_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data)
- gtk_tree_model_get(model, iter, column, &haystack, -1);
- result = (purple_strcasestr(haystack, key) == NULL);
-create_pounces_list(PouncesManager *dialog)
- GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
- /* Create the list model */
- dialog->model = gtk_list_store_new(POUNCES_MANAGER_NUM_COLUMNS,
- /* Create the treeview */
- treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->model));
- g_object_unref(G_OBJECT(dialog->model));
- dialog->treeview = treeview;
- sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
- gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE);
- g_signal_connect(G_OBJECT(sel), "changed",
- G_CALLBACK(pounce_selected_cb), dialog);
- /* Handle double-clicking */
- g_signal_connect(G_OBJECT(treeview), "button_press_event",
- G_CALLBACK(pounce_double_click_cb), dialog);
- gtk_widget_show(treeview);
- column = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(column, _("Pounce Target"));
- gtk_tree_view_column_set_resizable(column, TRUE);
- gtk_tree_view_column_set_min_width(column, 200);
- gtk_tree_view_column_set_sort_column_id(column,
- POUNCES_MANAGER_COLUMN_TARGET);
- gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
- renderer = gtk_cell_renderer_pixbuf_new();
- gtk_tree_view_column_pack_start(column, renderer, FALSE);
- gtk_tree_view_column_add_attribute(column, renderer, "pixbuf",
- POUNCES_MANAGER_COLUMN_ICON);
- renderer = gtk_cell_renderer_text_new();
- gtk_tree_view_column_pack_start(column, renderer, TRUE);
- gtk_tree_view_column_add_attribute(column, renderer, "text",
- POUNCES_MANAGER_COLUMN_TARGET);
- column = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(column, _("Account"));
- gtk_tree_view_column_set_resizable(column, TRUE);
- gtk_tree_view_column_set_min_width(column, 200);
- gtk_tree_view_column_set_sort_column_id(column,
- POUNCES_MANAGER_COLUMN_ACCOUNT);
- gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
- renderer = gtk_cell_renderer_text_new();
- gtk_tree_view_column_pack_start(column, renderer, TRUE);
- gtk_tree_view_column_add_attribute(column, renderer, "text",
- POUNCES_MANAGER_COLUMN_ACCOUNT);
- renderer = gtk_cell_renderer_toggle_new();
- column = gtk_tree_view_column_new_with_attributes(_("Recurring"), renderer,
- "active", POUNCES_MANAGER_COLUMN_RECURRING, NULL);
- gtk_tree_view_column_set_sort_column_id(column,
- POUNCES_MANAGER_COLUMN_RECURRING);
- gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
- g_signal_connect(G_OBJECT(renderer), "toggled",
- G_CALLBACK(pounces_manager_recurring_cb), dialog);
- /* Enable CTRL+F searching */
- gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview), POUNCES_MANAGER_COLUMN_TARGET);
- gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(treeview), search_func, NULL, NULL);
- /* Sort the pouncee column by default */
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(dialog->model),
- POUNCES_MANAGER_COLUMN_TARGET,
- populate_pounces_list(dialog);
- return pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, -1);
-pidgin_pounces_manager_show(void)
- PouncesManager *dialog;
- if (pounces_manager != NULL) {
- gtk_window_present(GTK_WINDOW(pounces_manager->window));
- pounces_manager = dialog = g_new0(PouncesManager, 1);
- width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/pounces/dialog/width");
- height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height");
- dialog->window = win = pidgin_dialog_new(_("Buddy Pounces"), 0, "pounces", TRUE);
- gtk_window_set_default_size(GTK_WINDOW(win), width, height);
- g_signal_connect(G_OBJECT(win), "delete_event",
- G_CALLBACK(pounces_manager_destroy_cb), dialog);
- g_signal_connect(G_OBJECT(win), "configure_event",
- G_CALLBACK(pounces_manager_configure_cb), dialog);
- vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, 12);
- /* List of saved buddy pounces */
- list = create_pounces_list(dialog);
- gtk_box_pack_start(GTK_BOX(vbox), list, TRUE, TRUE, 0);
- button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_ADD, G_CALLBACK(pounces_manager_add_cb), dialog);
- gtk_widget_set_sensitive(button, (purple_accounts_get_all() != NULL));
- purple_signal_connect(purple_connections_get_handle(), "signed-on",
- pounces_manager, PURPLE_CALLBACK(pounces_manager_connection_cb), button);
- purple_signal_connect(purple_connections_get_handle(), "signed-off",
- pounces_manager, PURPLE_CALLBACK(pounces_manager_connection_cb), button);
- button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_MODIFY, G_CALLBACK(pounces_manager_modify_cb), dialog);
- gtk_widget_set_sensitive(button, FALSE);
- dialog->modify_button = button;
- button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_DELETE, G_CALLBACK(pounces_manager_delete_cb), dialog);
- gtk_widget_set_sensitive(button, FALSE);
- dialog->delete_button = button;
- pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE, G_CALLBACK(pounces_manager_close_cb), dialog);
-pidgin_pounces_manager_hide(void)
- if (pounces_manager == NULL)
- if (pounces_manager->window != NULL)
- gtk_widget_destroy(pounces_manager->window);
- purple_signals_disconnect_by_handle(pounces_manager);
- g_free(pounces_manager);
- pounces_manager = NULL;
-pounce_cb(PurplePounce *pounce, PurplePounceEvent events, void *data)
- PurpleIMConversation *im;
- PurpleAccount *account;
- pouncee = purple_pounce_get_pouncee(pounce);
- account = purple_pounce_get_pouncer(pounce);
- buddy = purple_blist_find_buddy(account, pouncee);
- alias = purple_buddy_get_alias(buddy);
- if (purple_pounce_action_is_enabled(pounce, "open-window"))
- if (!purple_conversations_find_im_with_account(pouncee, account))
- purple_im_conversation_new(account, pouncee);
- if (purple_pounce_action_is_enabled(pounce, "popup-notify"))
- reason = purple_pounce_action_get_attribute(pounce, "popup-notify",
- * Here we place the protocol name in the pounce dialog to lessen
- * confusion about what protocol a pounce is for.
- (events & PURPLE_POUNCE_TYPING) ?
- (events & PURPLE_POUNCE_TYPED) ?
- _("Paused while typing") :
- (events & PURPLE_POUNCE_SIGNON) ?
- (events & PURPLE_POUNCE_IDLE_RETURN) ?
- _("Returned from being idle") :
- (events & PURPLE_POUNCE_AWAY_RETURN) ?
- _("Returned from being away") :
- (events & PURPLE_POUNCE_TYPING_STOPPED) ?
- (events & PURPLE_POUNCE_SIGNOFF) ?
- (events & PURPLE_POUNCE_IDLE) ?
- (events & PURPLE_POUNCE_AWAY) ?
- (events & PURPLE_POUNCE_MESSAGE_RECEIVED) ?
- _("Unknown.... Please report this!")
- pidgin_notify_pounce_add(account, pounce, alias, tmp, reason,
- purple_date_format_full(NULL));
- if (purple_pounce_action_is_enabled(pounce, "send-message"))
- message = purple_pounce_action_get_attribute(pounce, "send-message",
- im = purple_conversations_find_im_with_account(pouncee, account);
- me = purple_account_get_name_for_display(account);
- im = purple_im_conversation_new(account, pouncee);
- pmsg = purple_message_new_outgoing(me, pouncee, message, 0);
- purple_serv_send_im(purple_account_get_connection(account), pmsg);
- purple_conversation_write_message(PURPLE_CONVERSATION(im), pmsg);
- g_object_unref(G_OBJECT(pmsg));
- if (purple_pounce_action_is_enabled(pounce, "execute-command"))
- command = purple_pounce_action_get_attribute(pounce,
- "execute-command", "command");
- if (!g_spawn_command_line_async(command, &error)) {
- purple_debug_error("gtkpounce",
- "pounce command could not be launched: %s\n",
-free_pounce(PurplePounce *pounce)
-new_pounce(PurplePounce *pounce)
- purple_pounce_action_register(pounce, "open-window");
- purple_pounce_action_register(pounce, "popup-notify");
- purple_pounce_action_register(pounce, "send-message");
- purple_pounce_action_register(pounce, "execute-command");
-pidgin_pounces_get_handle() {
-pidgin_pounces_init(void)
- purple_pounces_register_handler(PIDGIN_UI, pounce_cb, new_pounce,
- purple_prefs_add_none(PIDGIN_PREFS_ROOT "/pounces");
- purple_prefs_add_none(PIDGIN_PREFS_ROOT "/pounces/default_actions");
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/open-window",
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/popup-notify",
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/send-message",
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/execute-command",
- purple_prefs_add_none(PIDGIN_PREFS_ROOT "/pounces/dialog");
- purple_prefs_add_int(PIDGIN_PREFS_ROOT "/pounces/dialog/width", 520);
- purple_prefs_add_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height", 321);
- purple_signal_connect(purple_connections_get_handle(), "signed-on",
- pidgin_pounces_get_handle(),
- PURPLE_CALLBACK(signed_on_off_cb), NULL);
- purple_signal_connect(purple_connections_get_handle(), "signed-off",
- pidgin_pounces_get_handle(),
- PURPLE_CALLBACK(signed_on_off_cb), NULL);
--- a/pidgin/gtkpounce.h Sat Jan 02 21:58:08 2021 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * 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 02111-1301 USA
-#if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
-# error "only <pidgin.h> may be included directly"
-#ifndef _PIDGINPOUNCE_H_
-#define _PIDGINPOUNCE_H_
- * @section_id: pidgin-gtkpounce
- * @short_description: <filename>gtkpounce.h</filename>
- * @title: Buddy Pounce API
- * pidgin_pounce_editor_show:
- * @account: The optional account to use.
- * @name: The optional name to pounce on.
- * @cur_pounce: The current buddy pounce, if editing an existing one.
- * Displays a New Buddy Pounce or Edit Buddy Pounce dialog.
-void pidgin_pounce_editor_show(PurpleAccount *account, const char *name,
- PurplePounce *cur_pounce);
- * pidgin_pounces_manager_show:
- * Shows the pounces manager window.
-void pidgin_pounces_manager_show(void);
- * pidgin_pounces_manager_hide:
- * Hides the pounces manager window.
-void pidgin_pounces_manager_hide(void);
- * pidgin_pounces_get_handle:
- * Returns the gtkpounces handle
- * Returns: The handle to the GTK+ pounces system
-void *pidgin_pounces_get_handle(void);
- * Initializes the GTK+ pounces subsystem.
-void pidgin_pounces_init(void);
-#endif /* _PIDGINPOUNCE_H_ */
--- a/pidgin/libpidgin.c Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/libpidgin.c Sat Jan 02 22:05:09 2021 -0600
@@ -41,7 +41,6 @@
@@ -190,7 +189,6 @@
pidgin_conversations_init();
--- a/pidgin/meson.build Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/meson.build Sat Jan 02 22:05:09 2021 -0600
@@ -14,7 +14,6 @@
@@ -86,7 +85,6 @@
--- a/pidgin/pidginapplication.c Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/pidginapplication.c Sat Jan 02 22:05:09 2021 -0600
@@ -36,7 +36,6 @@
@@ -189,13 +188,6 @@
-pidgin_application_buddy_pounces(GSimpleAction *simple, GVariant *parameter,
- pidgin_pounces_manager_show();
pidgin_application_custom_smiley(GSimpleAction *simple, GVariant *parameter,
@@ -322,9 +314,6 @@
.activate = pidgin_application_add_group,
- .name = "buddy-pounces",
- .activate = pidgin_application_buddy_pounces,
.activate = pidgin_application_custom_smiley,
--- a/pidgin/pidginstock.c Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/pidginstock.c Sat Jan 02 22:05:09 2021 -0600
@@ -72,7 +72,6 @@
{ PIDGIN_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES },
{ PIDGIN_STOCK_ADD, NULL, GTK_STOCK_ADD },
{ PIDGIN_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE },
- { PIDGIN_STOCK_POUNCE, NULL, GTK_STOCK_REDO },
{ PIDGIN_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO },
{ PIDGIN_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE },
{ PIDGIN_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE },
--- a/pidgin/pidginstock.h Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/pidginstock.h Sat Jan 02 22:05:09 2021 -0600
@@ -61,7 +61,6 @@
#define PIDGIN_STOCK_ADD "pidgin-add"
#define PIDGIN_STOCK_OPEN_MAIL "pidgin-stock-open-mail"
#define PIDGIN_STOCK_PAUSE "pidgin-pause"
-#define PIDGIN_STOCK_POUNCE "pidgin-pounce"
#define PIDGIN_STOCK_SIGN_OFF "pidgin-sign-off"
#define PIDGIN_STOCK_SIGN_ON "pidgin-sign-on"
#define PIDGIN_STOCK_TEXT_NORMAL "pidgin-text-normal"
--- a/pidgin/resources/BuddyList/menu.ui Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/resources/BuddyList/menu.ui Sat Jan 02 22:05:09 2021 -0600
@@ -224,15 +224,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
- <object class="GtkMenuItem" id="buddy_pounces">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="action_name">app.buddy-pounces</property>
- <property name="label" translatable="yes">Buddy _Pounces</property>
- <property name="use_underline">True</property>
<object class="GtkMenuItem" id="custom_smileys">
<property name="visible">True</property>
<property name="can_focus">False</property>
--- a/pidgin/resources/Conversations/menu.ui Sat Jan 02 21:58:08 2021 -0600
+++ b/pidgin/resources/Conversations/menu.ui Sat Jan 02 22:05:09 2021 -0600
@@ -63,10 +63,6 @@
<attribute name="action">win.get-attention</attribute>
- <attribute name="label" translatable="yes">Add Buddy _Pounce...</attribute>
- <attribute name="action">win.add-buddy-pounce</attribute>
<attribute name="label" translatable="yes">_Get Info</attribute>
<attribute name="action">win.clear-history</attribute>
<attribute name="accel"><Primary>O</attribute>
--- a/po/POTFILES.in Sat Jan 02 21:58:08 2021 -0600
+++ b/po/POTFILES.in Sat Jan 02 22:05:09 2021 -0600
@@ -10,7 +10,6 @@
@@ -74,10 +73,8 @@
libpurple/plugins/keyrings/secretservice.c
libpurple/plugins/keyrings/wincred.c
libpurple/plugins/log_reader.c
-libpurple/plugins/offlinemsg.c
libpurple/plugins/psychic.c
libpurple/plugins/statenotify.c
libpurple/protocols/bonjour/bonjour.c
@@ -317,7 +314,6 @@