/soc/2015/jgeboski/facebook: 600f41974cb3: facebook: fixed non-f...

James Geboski <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 600f41974cb3383b2a0d578d0cd873adfec81734
Author:	 James Geboski <[email protected]>
Date:	 2015-08-02 13:01 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/600f41974cb3

Description:

facebook: fixed non-friends being added as buddies

diffstat:

 libpurple/protocols/facebook/api.c |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (29 lines):

diff --git a/libpurple/protocols/facebook/api.c b/libpurple/protocols/facebook/api.c
--- a/libpurple/protocols/facebook/api.c
+++ b/libpurple/protocols/facebook/api.c
@@ -1102,6 +1102,7 @@ fb_api_cb_contacts(PurpleHttpConnection 
 	FbApi *api = data;
 	FbApiUser user;
 	FbHttpParams *params;
+	gboolean friend;
 	gchar *str;
 	gchar *writeid = NULL;
 	GError *err = NULL;
@@ -1133,6 +1134,17 @@ fb_api_cb_contacts(PurpleHttpConnection 
 		                               &err);
 		FB_API_ERROR_CHK(api, err, goto finish);
 
+		str = fb_json_node_get_str(node, "$.represented_profile"
+				                  ".friendship_status", &err);
+		FB_API_ERROR_CHK(api, err, goto finish);
+
+		friend = g_ascii_strcasecmp(str, "ARE_FRIENDS") == 0;
+		g_free(str);
+
+		if (!friend) {
+			continue;
+		}
+
 		str = fb_json_node_get_str(node, "$.represented_profile.id",
 		                           NULL);
 

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.