qulogic/pidgin

Remove Facebook (XMPP) account option and support code
release-2.x.y
2016-10-05, Mike Ruprecht
be8d0f7d0041
Remove Facebook (XMPP) account option and support code

This patch removes the Facebook (XMPP) account option and any remaining
supporting code. According to https://developers.facebook.com/docs/chat
the Facebook XMPP Chat API service was ended April 30th, 2015. This code
has already been removed in Pidgin 3, and replaced with a new in-tree
version which uses a different mechanism. There is a backported version
which can be found at https://github.com/dequis/purple-facebook/wiki

This patch intentionally leaves the protocol icon, so that the
backported version mentioned above doesn't need to ship its own.
--- a/ChangeLog Wed Oct 05 15:53:43 2016 -0500
+++ b/ChangeLog Wed Oct 05 16:19:47 2016 -0500
@@ -21,6 +21,11 @@
It can be found here: https://github.com/EionRobb/funyahoo-plusplus
This also removes support for Yahoo! Japan. According to
http://messenger.yahoo.co.jp/ the service ended March 26th, 2014.
+ * Remove the Facebook (XMPP) account option. According to
+ https://developers.facebook.com/docs/chat the XMPP Chat API service
+ ended April 30th, 2015. A new protocol plugin has been written,
+ using a different method, to support Facebook. It can be found at
+ https://github.com/dequis/purple-facebook/wiki
General
* Replaced instances of d.pidgin.im with developer.pidgin.im and updated the
--- a/libpurple/protocols/jabber/Makefile.am Wed Oct 05 15:53:43 2016 -0500
+++ b/libpurple/protocols/jabber/Makefile.am Wed Oct 05 16:19:47 2016 -0500
@@ -27,8 +27,6 @@
data.h \
disco.c \
disco.h \
- facebook_roster.c \
- facebook_roster.h \
google/gmail.c \
google/gmail.h \
google/google.c \
--- a/libpurple/protocols/jabber/Makefile.mingw Wed Oct 05 15:53:43 2016 -0500
+++ b/libpurple/protocols/jabber/Makefile.mingw Wed Oct 05 16:19:47 2016 -0500
@@ -55,7 +55,6 @@
chat.c \
data.c \
disco.c \
- facebook_roster.c \
google/gmail.c \
google/google.c \
google/google_presence.c \
--- a/libpurple/protocols/jabber/facebook_roster.c Wed Oct 05 15:53:43 2016 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/**
- * purple
- *
- * 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
- * source distribution.
- *
- * 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 "facebook_roster.h"
-
-#include "roster.h"
-
-#include "internal.h"
-
-void
-jabber_facebook_roster_cleanup(JabberStream *js, xmlnode *query)
-{
- PurpleAccount *account = purple_connection_get_account(js->gc);
- xmlnode *item;
- GSList *local_buddies;
- GHashTable *remove_buddies;
- GHashTableIter it;
- PurpleBuddy *buddy;
- const gchar *jid;
-
- if (js->facebook_roster_cleanup_performed)
- return;
- js->facebook_roster_cleanup_performed = TRUE;
-
- /* mark all local buddies as "to be removed" */
- remove_buddies = g_hash_table_new_full(g_str_hash, g_str_equal,
- g_free, NULL);
- local_buddies = purple_find_buddies(account, NULL);
- for (; local_buddies; local_buddies = g_slist_delete_link(
- local_buddies, local_buddies))
- {
- buddy = local_buddies->data;
-
- g_hash_table_insert(remove_buddies, g_strdup(jabber_normalize(
- account, purple_buddy_get_name(buddy))), buddy);
- }
-
- /* un-mark all remote buddies */
- for (item = xmlnode_get_child(query, "item"); item;
- item = xmlnode_get_next_twin(item))
- {
- jid = xmlnode_get_attrib(item, "jid");
-
- g_hash_table_remove(remove_buddies,
- jabber_normalize(account, jid));
- }
-
- /* remove all not-remote buddies */
- g_hash_table_iter_init(&it, remove_buddies);
- while (g_hash_table_iter_next(&it, (gpointer*)&jid, (gpointer*)&buddy)) {
- const gchar *alias = purple_buddy_get_local_buddy_alias(buddy);
- item = xmlnode_new_child(query, "item");
- xmlnode_set_namespace(item, xmlnode_get_namespace(query));
- xmlnode_set_attrib(item, "jid", jid);
- xmlnode_set_attrib(item, "subscription", "remove");
- if (alias)
- xmlnode_set_attrib(item, "name", alias);
- }
-
- g_hash_table_destroy(remove_buddies);
-}
-
-gboolean
-jabber_facebook_roster_incoming(JabberStream *js, xmlnode *item)
-{
- PurpleAccount *account = purple_connection_get_account(js->gc);
- const gchar *jid, *subscription;
- gchar *jid_norm;
- PurpleBuddy *buddy;
- PurpleGroup *buddy_group;
- xmlnode *group;
- const gchar *alias;
-
- subscription = xmlnode_get_attrib(item, "subscription");
-
- /* Skip entries added with jabber_facebook_roster_cleanup */
- if (g_strcmp0(subscription, "remove") == 0)
- return TRUE;
-
- jid = xmlnode_get_attrib(item, "jid");
- jid_norm = g_strdup(jabber_normalize(account, jid));
- buddy = purple_find_buddy(account, jid);
- g_free(jid_norm);
-
- /* Facebook forces "Facebook Friends" group */
- while ((group = xmlnode_get_child(item, "group")) != NULL)
- xmlnode_free(group);
- group = xmlnode_new_child(item, "group");
- xmlnode_set_namespace(group, xmlnode_get_namespace(item));
-
- /* We don't have that buddy on the list, add him to the default group */
- if (!buddy) {
- xmlnode_insert_data(group,
- JABBER_ROSTER_DEFAULT_GROUP, -1);
- return TRUE;
- }
-
- /* Facebook forces buddy real name as alias */
- alias = purple_buddy_get_local_buddy_alias(buddy);
- if (alias)
- xmlnode_set_attrib(item, "name", alias);
-
- /* Add buddy to his group */
- buddy_group = purple_buddy_get_group(buddy);
- if (g_strcmp0(purple_group_get_name(buddy_group), _("Buddies")) == 0)
- buddy_group = NULL;
- if (buddy_group) {
- xmlnode_insert_data(group,
- purple_group_get_name(buddy_group), -1);
- } else {
- xmlnode_insert_data(group,
- JABBER_ROSTER_DEFAULT_GROUP, -1);
- }
-
- return TRUE;
-}
--- a/libpurple/protocols/jabber/facebook_roster.h Wed Oct 05 15:53:43 2016 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/**
- * purple
- *
- * 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
- * source distribution.
- *
- * 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
- */
-#ifndef PURPLE_XMPP_FACEBOOK_ROSTER_H_
-#define PURPLE_XMPP_FACEBOOK_ROSTER_H_
-
-#include "jabber.h"
-
-/* removes deleted buddies from the list */
-void
-jabber_facebook_roster_cleanup(JabberStream *js, xmlnode *query);
-
-/* ignores facebook roster quirks */
-gboolean
-jabber_facebook_roster_incoming(JabberStream *js, xmlnode *item);
-
-#endif /* PURPLE_XMPP_FACEBOOK_ROSTER_H_ */
--- a/libpurple/protocols/jabber/jabber.c Wed Oct 05 15:53:43 2016 -0500
+++ b/libpurple/protocols/jabber/jabber.c Wed Oct 05 16:19:47 2016 -0500
@@ -934,12 +934,6 @@
js->gc = gc;
js->fd = -1;
- if (g_strcmp0("prpl-facebook-xmpp",
- purple_account_get_protocol_id(account)) == 0)
- {
- js->server_caps |= JABBER_CAP_FACEBOOK;
- }
-
user = g_strdup(purple_account_get_username(account));
/* jabber_id_new doesn't accept "user@domain/" as valid */
slash = strchr(user, '/');
--- a/libpurple/protocols/jabber/jabber.h Wed Oct 05 15:53:43 2016 -0500
+++ b/libpurple/protocols/jabber/jabber.h Wed Oct 05 16:19:47 2016 -0500
@@ -49,8 +49,6 @@
JABBER_CAP_ITEMS = 1 << 14,
JABBER_CAP_ROSTER_VERSIONING = 1 << 15,
- JABBER_CAP_FACEBOOK = 1 << 16,
-
JABBER_CAP_RETRIEVED = 1 << 31
} JabberCapabilities;
@@ -284,9 +282,6 @@
gchar *google_relay_host;
GList *google_relay_requests; /* the HTTP requests to get */
/* relay info */
-
- /* facebook quirks */
- gboolean facebook_roster_cleanup_performed;
};
typedef gboolean (JabberFeatureEnabled)(JabberStream *js, const gchar *namespace);
--- a/libpurple/protocols/jabber/roster.c Wed Oct 05 15:53:43 2016 -0500
+++ b/libpurple/protocols/jabber/roster.c Wed Oct 05 16:19:47 2016 -0500
@@ -27,7 +27,6 @@
#include "buddy.h"
#include "chat.h"
-#include "facebook_roster.h"
#include "google/google.h"
#include "google/google_roster.h"
#include "presence.h"
@@ -212,18 +211,11 @@
js->currently_parsing_roster_push = TRUE;
- if (js->server_caps & JABBER_CAP_FACEBOOK)
- jabber_facebook_roster_cleanup(js, query);
-
for(item = xmlnode_get_child(query, "item"); item; item = xmlnode_get_next_twin(item))
{
const char *jid, *name, *subscription, *ask;
JabberBuddy *jb;
- if (js->server_caps & JABBER_CAP_FACEBOOK)
- if (!jabber_facebook_roster_incoming(js, item))
- continue;
-
subscription = xmlnode_get_attrib(item, "subscription");
jid = xmlnode_get_attrib(item, "jid");
name = xmlnode_get_attrib(item, "name");
--- a/libpurple/prpl.c Wed Oct 05 15:53:43 2016 -0500
+++ b/libpurple/prpl.c Wed Oct 05 16:19:47 2016 -0500
@@ -634,8 +634,7 @@
* but may be used in the future.
*/
if (g_strcmp0(id, "prpl-xmpp") == 0 ||
- g_strcmp0(id, "prpl-gtalk") == 0 ||
- g_strcmp0(id, "prpl-facebook-xmpp") == 0)
+ g_strcmp0(id, "prpl-gtalk") == 0)
{
id = "prpl-jabber";
}
--- a/pidgin/gtkaccount.c Wed Oct 05 15:53:43 2016 -0500
+++ b/pidgin/gtkaccount.c Wed Oct 05 16:19:47 2016 -0500
@@ -577,10 +577,6 @@
!strcmp(purple_account_user_split_get_text(split), _("Domain")))
value = "gmail.com";
- if (value == NULL && g_object_get_data(G_OBJECT(item), "fakefacebook") &&
- !strcmp(purple_account_user_split_get_text(split), _("Domain")))
- value = "chat.facebook.com";
-
if (value != NULL)
gtk_entry_set_text(GTK_ENTRY(entry), value);
}
@@ -776,7 +772,7 @@
{
PurpleAccountOption *option;
PurpleAccount *account;
- GtkWidget *vbox, *check, *entry, *combo, *menu, *item;
+ GtkWidget *vbox, *check, *entry, *combo;
GList *list, *node;
gint i, idx, int_value;
GtkListStore *model;
@@ -815,9 +811,6 @@
gtk_label_new_with_mnemonic(_("Ad_vanced")), 1);
gtk_widget_show(vbox);
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(dialog->protocol_menu));
- item = gtk_menu_get_active(GTK_MENU(menu));
-
for (l = dialog->prpl_info->protocol_options; l != NULL; l = l->next)
{
option = (PurpleAccountOption *)l->data;
@@ -932,10 +925,6 @@
model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
opt_entry->widget = combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model));
- if (g_object_get_data(G_OBJECT(item), "fakefacebook") &&
- !strcmp(opt_entry->setting, "connection_security"))
- str_value = "opportunistic_tls";
-
/* Loop through list of PurpleKeyValuePair items */
for (node = list; node != NULL; node = node->next) {
if (node->data != NULL) {
--- a/pidgin/gtkutils.c Wed Oct 05 15:53:43 2016 -0500
+++ b/pidgin/gtkutils.c Wed Oct 05 16:19:47 2016 -0500
@@ -677,7 +677,7 @@
GdkPixbuf *pixbuf = NULL;
GtkSizeGroup *sg;
GList *p;
- const char *gtalk_name = NULL, *facebook_name = NULL;
+ const char *gtalk_name = NULL;
int i;
aop_menu = g_malloc0(sizeof(AopMenu));
@@ -688,7 +688,6 @@
if (purple_find_prpl("prpl-jabber")) {
gtalk_name = _("Google Talk");
- facebook_name = _("Facebook (XMPP)");
}
for (p = purple_plugins_get_protocols(), i = 0;
@@ -720,29 +719,6 @@
i++;
}
- if (facebook_name && strcmp(facebook_name, plugin->info->name) < 0) {
- char *filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols",
- "16", "facebook.png", NULL);
- GtkWidget *item;
-
- pixbuf = pidgin_pixbuf_new_from_file(filename);
- g_free(filename);
-
- gtk_menu_shell_append(GTK_MENU_SHELL(aop_menu->menu),
- item = aop_menu_item_new(sg, pixbuf, facebook_name, "prpl-jabber", "protocol"));
- g_object_set_data(G_OBJECT(item), "fakefacebook", GINT_TO_POINTER(1));
-
- if (pixbuf)
- g_object_unref(pixbuf);
-
- /* libpurple3 compatibility */
- if (g_strcmp0(default_proto_id, "prpl-facebook-xmpp") == 0)
- aop_menu->default_item = i;
-
- facebook_name = NULL;
- i++;
- }
-
pixbuf = pidgin_create_prpl_icon_from_prpl(plugin, PIDGIN_PRPL_ICON_SMALL, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(aop_menu->menu),
--- a/po/POTFILES.in Wed Oct 05 15:53:43 2016 -0500
+++ b/po/POTFILES.in Wed Oct 05 16:19:47 2016 -0500
@@ -95,7 +95,6 @@
libpurple/protocols/jabber/bosh.c
libpurple/protocols/jabber/buddy.c
libpurple/protocols/jabber/chat.c
-libpurple/protocols/jabber/facebook_roster.c
libpurple/protocols/jabber/jabber.c
libpurple/protocols/jabber/jutil.c
libpurple/protocols/jabber/libxmpp.c