pidgin/pidgin

Parents d75e434521a5
Children 717284e4e2dc
Don't allow adding a buddy to prpls that don't have an add_buddy callback. Fixes #4061
--- a/COPYRIGHT Wed Mar 07 23:53:17 2018 -0600
+++ b/COPYRIGHT Thu Mar 08 00:03:29 2018 -0600
@@ -409,6 +409,7 @@
John Oyler
Matt Pandina
Laszlo Pandy
+Paradox
Giulio 'Twain28' Pascali
Ricardo Fernandez Pascual
Riley Patterson
--- a/ChangeLog Wed Mar 07 23:53:17 2018 -0600
+++ b/ChangeLog Thu Mar 08 00:03:29 2018 -0600
@@ -38,6 +38,7 @@
* Fix matching unicode smilies. (#17232 gnubfx PR #262 Daniel Kamil Kozar)
* Correctly update mute/unmute status when the remote side mutes/unmutes us. (#17273 PR #302 David Woodhouse)
* Rework the status icon blinking to not used deprecated API. (#17174 zelch PR #264 Daniel Kamil Kozar)
+ * Don't allow adding a buddy to protocols that don't have an add_buddy callback. (#4061 Paradox)
Finch:
* Fix handling of search results (#17238 David Woodhouse)
--- a/pidgin/gtkblist.c Wed Mar 07 23:53:17 2018 -0600
+++ b/pidgin/gtkblist.c Thu Mar 08 00:03:29 2018 -0600
@@ -935,6 +935,17 @@
}
static gboolean
+add_buddy_account_filter_func(PurpleAccount *account)
+{
+ PurpleConnection *gc = purple_account_get_connection(account);
+ PurplePluginProtocolInfo *prpl_info = NULL;
+
+ prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+
+ return (prpl_info->add_buddy != NULL);
+}
+
+static gboolean
chat_account_filter_func(PurpleAccount *account)
{
PurpleConnection *gc = purple_account_get_connection(account);
@@ -7098,7 +7109,7 @@
account,
_("Add Buddy"), "add_buddy",
_("Add a buddy.\n"),
- G_CALLBACK(add_buddy_select_account_cb), NULL,
+ G_CALLBACK(add_buddy_select_account_cb), add_buddy_account_filter_func,
G_CALLBACK(add_buddy_cb));
gtk_dialog_add_buttons(GTK_DIALOG(data->rq_data.window),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
--- a/pidgin/gtkconv.c Wed Mar 07 23:53:17 2018 -0600
+++ b/pidgin/gtkconv.c Thu Mar 08 00:03:29 2018 -0600
@@ -1685,7 +1685,7 @@
g_object_set_data_full(G_OBJECT(button), "user_data", g_strdup(who), g_free);
}
- if (!is_me && prpl_info && !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
+ if (!is_me && prpl_info && !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME) && (prpl_info->add-buddy != NULL)) {
if ((buddy = purple_find_buddy(conv->account, who)) != NULL)
button = pidgin_new_item_from_stock(menu, _("Remove"), GTK_STOCK_REMOVE,
G_CALLBACK(menu_chat_add_remove_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);