adium.1-3: e5795f98: pidgin-facebookchat at r719.

zacw at adiumx.com zacw at adiumx.com
Tue Jan 12 22:15:42 EST 2010


-----------------------------------------------------------------
Revision: e5795f98bf9277e74fc709d47460123997c51696
Ancestor: 98d707575d4d55bfac04c528ca99c42bc84f8163
Author: zacw at adiumx.com
Date: 2010-01-13T03:14:21
Branch: im.pidgin.adium.1-3
URL: http://d.pidgin.im/viewmtn/revision/info/e5795f98bf9277e74fc709d47460123997c51696

Modified files:
        libpurple/protocols/facebook/facebook.nsi
        libpurple/protocols/facebook/fb_blist.c
        libpurple/protocols/facebook/fb_connection.c
        libpurple/protocols/facebook/fb_conversation.c
        libpurple/protocols/facebook/fb_friendlist.c
        libpurple/protocols/facebook/fb_info.c
        libpurple/protocols/facebook/fb_managefriends.c
        libpurple/protocols/facebook/fb_managefriends.h
        libpurple/protocols/facebook/fb_messages.c
        libpurple/protocols/facebook/libfacebook.c
        libpurple/protocols/facebook/libfacebook.h
        libpurple/protocols/facebook/pidgin-facebookchat.rc
        libpurple/protocols/facebook/rss.xml

ChangeLog: 

pidgin-facebookchat at r719.


-------------- next part --------------
============================================================
--- libpurple/protocols/facebook/facebook.nsi	0a2bccf4de2f00e5527eac5cbc0facb8be28bf11
+++ libpurple/protocols/facebook/facebook.nsi	909394612268d37159a9853b011b2d14d25bceca
@@ -6,7 +6,7 @@ SetCompress off
 ; todo: SetBrandingImage
 ; HM NIS Edit Wizard helper defines
 !define PRODUCT_NAME "pidgin-facebookchat"
-!define PRODUCT_VERSION "1.62"
+!define PRODUCT_VERSION "1.64"
 !define PRODUCT_PUBLISHER "Eion Robb"
 !define PRODUCT_WEB_SITE "http://pidgin-facebookchat.googlecode.com/"
 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
============================================================
--- libpurple/protocols/facebook/fb_blist.c	a26776243a31152e02bde9a0405a45db552c5121
+++ libpurple/protocols/facebook/fb_blist.c	3574e613239518dc6b50c192632e0b956e2e3635
@@ -115,18 +115,32 @@ static void process_buddy_icon(FacebookA
 {
 	FacebookBuddy *fbuddy;
 	gchar *buddy_icon_url;
+	gchar *icon_host;
+	gchar *icon_path, *real_path;
+	gchar *search_tmp;
 
 	fbuddy = buddy->proto_data;
 	
 	/* Set the buddy icon (if it hasn't changed) */
 	buddy_icon_url = g_strdup(json_node_get_string(json_object_get_member(
 			userInfo, "thumbSrc")));
+	/* Seperate the URL into pieces */
+	purple_url_parse(buddy_icon_url, &icon_host, NULL, &icon_path, NULL, NULL);
+	g_free(buddy_icon_url);
+	
+	if (icon_path != NULL && icon_path[0] != '/')
+	{
+		/* Slap a / at the front of that badboy */
+		real_path = g_strconcat("/", icon_path, NULL);
+		g_free(icon_path);
+		icon_path = real_path;
+	}
+	
 	if (fbuddy->thumb_url == NULL ||
-	    !g_str_equal(fbuddy->thumb_url, buddy_icon_url))
+	    !g_str_equal(fbuddy->thumb_url, icon_path))
 	{
 		g_free(fbuddy->thumb_url);
-		if (g_str_equal(buddy_icon_url,
-			"http://static.ak.fbcdn.net/pics/q_silhouette.gif"))
+		if (g_str_equal(icon_path, "/pics/q_silhouette.gif"))
 		{
 			fbuddy->thumb_url = NULL;
 			/* User has no icon */
@@ -135,23 +149,22 @@ static void process_buddy_icon(FacebookA
 		}
 		else
 		{
-			gchar *search_tmp;
+			fbuddy->thumb_url = g_strdup(icon_path);
 
-			fbuddy->thumb_url = g_strdup(buddy_icon_url);
-
-			/* small icon at http://profile.ak.facebook.com/profile6/1845/74/q800753867_2878.jpg */
-			/* bigger icon at http://profile.ak.facebook.com/profile6/1845/74/n800753867_2878.jpg */
-			search_tmp = strstr(buddy_icon_url, "/q");
+			/* small icon at /profile6/1845/74/q800753867_2878.jpg */
+			/* bigger icon at /profile6/1845/74/n800753867_2878.jpg */
+			search_tmp = strstr(icon_path, "/q");
 			if (search_tmp)
-				*(search_tmp + 1) = 'n';
-				
+				*(search_tmp + 1) = 'n';			
+			purple_debug_info("facebook", "buddy %s has a new buddy icon at http://%s%s\n", buddy->name, icon_host, icon_path);
 			/* Fetch their icon */
-			fb_post_or_get(fba, FB_METHOD_GET, "profile.ak.facebook.com",
-					buddy_icon_url, NULL,
+			fb_post_or_get(fba, FB_METHOD_GET, icon_host,
+					icon_path, NULL,
 					buddy_icon_cb, g_strdup(purple_buddy_get_name(buddy)), FALSE);
 		}
 	}
-	g_free(buddy_icon_url);
+	g_free(icon_host);
+	g_free(icon_path);
 }
 
 static void process_buddies(FacebookAccount *fba, GHashTable *online_buddies_list,
@@ -283,6 +296,7 @@ static void got_status_stream_cb(Faceboo
 
 	parser = fb_get_parser(data, data_len);
 	if (parser == NULL) {
+		purple_debug_info("facebook", "could not parse\n");
 		return;
 	}
 	
@@ -291,6 +305,7 @@ static void got_status_stream_cb(Faceboo
 	objnode = fb_get_json_object(parser, &error);
 	
 	if (error || !json_object_has_member(objnode, "payload")) {
+		purple_debug_info("facebook", "no payload\n");
 		json_parser_free(parser);
 		return;
 	}
@@ -298,17 +313,6 @@ static void got_status_stream_cb(Faceboo
 	objnode = json_node_get_object(json_object_get_member(
 			objnode, "payload"));
 	
-	new_latest = json_node_get_int(json_object_get_member(
-			objnode, "newestStoryTime"));
-	
-	if (!new_latest)
-	{
-		json_parser_free(parser);
-		return;
-	}
-	
-	fba->last_status_timestamp = new_latest;
-	
 	html = json_node_get_string(json_object_get_member(
 			objnode, "html"));
 	//purple_debug_misc("facebook", "html data\n%s\n", html);
@@ -331,10 +335,12 @@ static void got_status_stream_cb(Faceboo
 			uid_length++;
 		}
 		uid_string = g_strndup(uid_string, uid_length);
+		purple_debug_info("facebook", "uid: %s\n", uid_string);
 		
 		//find message:
-		//class="UIStory_Message"> ... </span>
-		message_string = strstr(message, "UIStory_Message");
+		// last index of
+		// /a> ... <
+		message_string = g_strrstr(message, "/a>");
 		if (!message_string)
 		{
 			g_free(uid_string);
@@ -347,7 +353,8 @@ static void got_status_stream_cb(Faceboo
 			continue;
 		}
 		message_string += 1;
-		message_string = g_strndup(message_string, strstr(message_string, "</span>")-message_string);
+		message_string = g_strndup(message_string, g_strrstr(message_string, "<")-message_string);
+		purple_debug_info("facebook", "message: %s\n", message_string);
 		
 		buddy = purple_find_buddy(fba->account, uid_string);
 		if (buddy && buddy->proto_data)
@@ -355,6 +362,8 @@ static void got_status_stream_cb(Faceboo
 			fbuddy = buddy->proto_data;
 			g_free(fbuddy->status);
 			
+			fbuddy->status = purple_strreplace(message_string, "&hearts;", "?");
+			g_free(message_string); message_string = fbuddy->status;
 			fbuddy->status = purple_markup_strip_html(message_string);
 			
 			purple_prpl_got_user_status(fba->account, buddy->name,
@@ -368,6 +377,15 @@ static void got_status_stream_cb(Faceboo
 	}
 	g_strfreev(messages);
 	
+	new_latest = json_node_get_int(json_object_get_member(
+			objnode, "newestStoryTime"));
+	if (!new_latest)
+	{
+		purple_debug_info("facebook", "no newestStoryTime\n");
+	} else {
+		fba->last_status_timestamp = new_latest;
+	}
+	
 	json_parser_free(parser);
 }
 
@@ -498,9 +516,9 @@ gboolean fb_get_buddy_list(gpointer data
 	fba = data;
 
 	postdata = g_strdup_printf(
-			"user=%" G_GINT64_FORMAT "&popped_out=true&force_render=true&buddy_list=1&__a=1&post_form_id_source=AsyncRequest&post_form_id=%s&fb_dtsg=%s",
+			"user=%" G_GINT64_FORMAT "&popped_out=true&force_render=true&buddy_list=1&__a=1&post_form_id_source=AsyncRequest&post_form_id=%s&fb_dtsg=%s&notifications=1",
 			fba->uid, fba->post_form_id?fba->post_form_id:"(null)", fba->dtsg?fba->dtsg:"(null)");
-	fb_post_or_get(fba, FB_METHOD_POST, NULL, "/ajax/chat/buddy_list.php",
+	fb_post_or_get(fba, FB_METHOD_POST, NULL, "/ajax/presence/update.php",
 			postdata, got_buddy_list_cb, NULL, FALSE);
 	g_free(postdata);
 	
============================================================
--- libpurple/protocols/facebook/fb_connection.c	33973e7de9483646796ea2e4c476ccc886ce0df6
+++ libpurple/protocols/facebook/fb_connection.c	c1ecafbe42cd0342e8d0ab24a052e0258c85e3d5
@@ -93,12 +93,10 @@ static gchar *fb_gunzip(const guchar *gz
 
 	g_free(data_buffer);	
 
-	gchar *output_data = g_strdup(output_string->str);
-	*len_ptr = output_string->len;
+	if (len_ptr)
+		*len_ptr = output_string->len;
 
-	g_string_free(output_string, TRUE);
-
-	return output_data;
+	return g_string_free(output_string, FALSE);
 }
 #endif
 
============================================================
--- libpurple/protocols/facebook/fb_conversation.c	20f34f5ff69959ab8ca5cc9e0d3eab7a485cfedc
+++ libpurple/protocols/facebook/fb_conversation.c	74b428320820601cd596b8496f17af90b5631045
@@ -182,7 +182,7 @@ void fb_history_fetch(FacebookAccount *f
 		min_time = 0;
 	}
 
-	gchar *url = g_strdup_printf("/ajax/chat/history.php?id=%s", who);
+	gchar *url = g_strdup_printf("/ajax/chat/history.php?id=%s&__a=1", who);
 	fb_post_or_get(
 		fba, FB_METHOD_GET, NULL, url, NULL, fb_history_fetch_cb,
 		g_strdup_printf("%lld", (long long int) min_time), FALSE);
@@ -203,8 +203,9 @@ void fb_conversation_closed(PurpleConnec
 	/* notify server that we closed the chat window */
 	/* close_chat=589039771&window_id=3168919846&
 	 * post_form_id=c258fe42460c7e8b61e242a37ef05afc */
-	postdata = g_strdup_printf("close_chat=%s&post_form_id=%s", who,
-			fba->post_form_id);
+	postdata = g_strdup_printf("close_chat=%s&post_form_id=%s&fb_dtsg=%s&"
+			"post_form_id_source=AsyncRequest&__a=1", who,
+			fba->post_form_id, fba->dtsg);
 	fb_post_or_get(fba, FB_METHOD_POST, NULL, "/ajax/chat/settings.php",
 			postdata, NULL, NULL, FALSE);
 	g_free(postdata);
============================================================
--- libpurple/protocols/facebook/fb_friendlist.c	66a6aeac0aba11a6919cf7a0a09db77e79a80d56
+++ libpurple/protocols/facebook/fb_friendlist.c	008d6195eb30a403d41c4755c98c5402de4fac31
@@ -455,8 +455,9 @@ GList *fb_get_buddies_friend_list (Faceb
 
 		group_name = purple_group_get_name(purple_buddy_get_group(
 					(PurpleBuddy *)cur->data));
-
-		g_hash_table_insert(cur_groups, g_utf8_strdown(group_name, -1), cur->data);
+		group_name = purple_normalize_nocase(NULL, group_name);
+		
+		g_hash_table_insert(cur_groups, g_strdup(group_name), cur->data);
 	}
 	g_slist_free(buddies);
 
@@ -483,9 +484,9 @@ GList *fb_get_buddies_friend_list (Faceb
 	for (cur_buddy = final_buddies; cur_buddy != NULL;
 	     cur_buddy = cur_buddy->next)
 	{
-		g_hash_table_remove(cur_groups, purple_normalize_nocase(NULL, 
-			purple_group_get_name(purple_buddy_get_group(
-				(PurpleBuddy *)cur_buddy->data))));
+		const gchar *group_name = purple_group_get_name(purple_buddy_get_group(
+					(PurpleBuddy *)cur_buddy->data));
+		g_hash_table_remove(cur_groups, purple_normalize_nocase(NULL, group_name));
 	}
 
 	// Delete remaining buddies to maintain sync state with server.
============================================================
--- libpurple/protocols/facebook/fb_info.c	b41f1bf46271eaa87317bdaa410b13abde797e7a
+++ libpurple/protocols/facebook/fb_info.c	ddcf349b1b8238ecd2ee0a9729a599b8d73fafda
@@ -66,7 +66,7 @@ static void fb_get_info_cb(FacebookAccou
 	FacebookBuddy *fbuddy = NULL;
 
 	purple_debug_info("facebook", "get_info_cb\n");
-	purple_debug_info("facebook", "%s\n", data);
+	purple_debug_misc("facebook", "%s\n", data);
 
 	buddy = purple_find_buddy(fba->account, uid);
 	if (buddy)
@@ -74,49 +74,32 @@ static void fb_get_info_cb(FacebookAccou
 		fbuddy = buddy->proto_data;
 	}
 	
-	user_info = purple_notify_user_info_new();
-
-	/* Insert link to profile at top */
-	value_tmp = g_strdup_printf("<a href=\"http://www.facebook.com/profile.php?id=%s\">%s</a>",
-			uid, _("View web profile"));
-	purple_notify_user_info_add_pair(user_info, NULL, value_tmp);
-	purple_notify_user_info_add_section_break(user_info);
-	g_free(value_tmp);
-
 	/* look from <div id="info_tab" class="info_tab"> */
 	/* until </div></div></div></div> */
 	search_start = g_strstr_len(data, data_len, "<div id=\"info_tab\" class=\"info_tab\">");
 	if (search_start == NULL)
 	{
-		search_start = g_strstr_len(data, data_len, "http:\\/\\/");
+		search_start = g_strstr_len(data, data_len, "window.location.replace(\"http:\\/\\/www.facebook.com\\");
 		if (search_start)
 		{
-			search_end = strstr(search_start, "\"");
+			search_start += strlen("window.location.replace(\"http:\\/\\/www.facebook.com\\");
+			search_end = strchr(search_start, '"');
 			value_tmp = g_strndup(search_start, search_end - search_start);
-			value_tmp2 = value_tmp;
 			if (value_tmp) {
-				char * buf = g_new(char, strlen(value_tmp) + 1); 
-				char * url = buf;
-				while(*value_tmp) { 
-				if (*value_tmp=='\\') {
-						// skip escape char 
-						*buf++ = value_tmp[1]; 
-						value_tmp += 2; 
-					} else { 
-						*buf++ = *value_tmp++; 
-					}
-				}
-				*buf = 0;
-				purple_debug_info("facebook", "info url: %s\n", url);
-				fb_post_or_get(fba->pc->proto_data, FB_METHOD_GET, NULL, url, NULL, fb_get_info_cb, g_strdup(uid), FALSE);
-				g_free(uid);
-				g_free(url);
-				g_free(value_tmp2);
+				purple_debug_info("facebook", "info url: %s\n", value_tmp);
+				fb_post_or_get(fba, FB_METHOD_GET, NULL, value_tmp, NULL, fb_get_info_cb, uid, FALSE);
+				g_free(value_tmp);
 				return;
 			}
 		}
 		purple_debug_warning("facebook",
 				"could not find user info, showing default");
+		user_info = purple_notify_user_info_new();
+		value_tmp = g_strdup_printf("<a href=\"http://www.facebook.com/profile.php?id=%s\">%s</a>",
+				uid, _("View web profile"));
+		purple_notify_user_info_add_pair(user_info, NULL, value_tmp);
+		purple_notify_user_info_add_section_break(user_info);
+		g_free(value_tmp);
 		purple_notify_userinfo(fba->pc, uid, user_info, NULL, NULL);
 		purple_notify_user_info_destroy(user_info);
 		g_free(uid);
@@ -124,6 +107,15 @@ static void fb_get_info_cb(FacebookAccou
 	}
 	search_end = strstr(search_start, "</div></div></div></div>");
 
+	user_info = purple_notify_user_info_new();
+
+	/* Insert link to profile at top */
+	value_tmp = g_strdup_printf("<a href=\"http://www.facebook.com/profile.php?id=%s\">%s</a>",
+			uid, _("View web profile"));
+	purple_notify_user_info_add_pair(user_info, NULL, value_tmp);
+	purple_notify_user_info_add_section_break(user_info);
+	g_free(value_tmp);
+
 	value_tmp = g_strstr_len(data, data_len, "<title>Facebook | ");
 	if (value_tmp)
 	{
============================================================
--- libpurple/protocols/facebook/fb_managefriends.c	372e3781799c1dbca5671830f39567e0b1283b6d
+++ libpurple/protocols/facebook/fb_managefriends.c	711a945a595b2c353cfa8991e9546b7b90828048
@@ -35,8 +35,10 @@ static void fb_auth_accept_cb(gpointer d
 	buddy_uid = g_strdup_printf("%" G_GINT64_FORMAT, fbuddy->uid);
 
 	postdata = g_strdup_printf(
-			"type=friend_add&id=%s&action=accept&post_form_id=%s",
-			buddy_uid, fba->post_form_id);
+			"type=friend_connect&id=%s&actions[accept]=Confirm&"
+			"post_form_id=%s&fb_dtsg=%s&confirm=%s&"
+			"post_form_id_source=AsyncRequest&__a=1",
+			buddy_uid, fba->post_form_id, fba->dtsg, buddy_uid);
 	fb_post_or_get(fba, FB_METHOD_POST, NULL, "/ajax/reqs.php",
 			postdata, NULL, NULL, FALSE);
 
@@ -61,8 +63,10 @@ static void fb_auth_reject_cb(gpointer d
 	buddy_uid = g_strdup_printf("%" G_GINT64_FORMAT, fbuddy->uid);
 
 	postdata = g_strdup_printf(
-			"type=friend_add&id=%s&action=reject&post_form_id=%s",
-			buddy_uid, fba->post_form_id);
+			"type=friend_connect&id=%s&action=reject&"
+			"post_form_id=%s&fb_dtsg=%s&"
+			"post_form_id_source=AsyncRequest&__a=1",
+			buddy_uid, fba->post_form_id, fba->dtsg);
 	fb_post_or_get(fba, FB_METHOD_POST, NULL, "/ajax/reqs.php",
 			postdata, NULL, NULL, FALSE);
 
@@ -80,7 +84,7 @@ static void fb_check_friend_request_cb(F
 	const char *name_pre_text = "<td class=\"info\"><a ";
 	const char *msg_pre_text = "<div class=\"personal_msg\"><span>";
 	gchar *uid;
-	gint32 uid_int;
+	gint64 uid_int;
 	gchar *name;
 	gchar *msg;
 	gchar *msg_plain;
@@ -143,7 +147,6 @@ static void fb_check_friend_request_cb(F
 		g_hash_table_insert(fba->auth_buddies, uid, NULL);
 		
 		g_free(name);
-		g_free(uid);
 		g_free(msg_plain);		
 	}
 }
@@ -166,7 +169,6 @@ void fb_add_buddy(PurpleConnection *pc, 
 void fb_add_buddy(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group)
 {
 	gchar *postdata;
-	gchar *url;
 	FacebookAccount *fba = pc->proto_data;
 	gchar *buddy_tmp;
 
@@ -192,15 +194,40 @@ void fb_add_buddy(PurpleConnection *pc, 
 
 	buddy_tmp = g_strdup(purple_url_encode(buddy->name));
 	postdata = g_strdup_printf(
-			"confirmed=1&add=Add+Friend&action=follow_up&uid=%s&flids=&flid_name=&source=search&is_from_whitelist=0&message=&failed_captcha=0&post_form_id=%s",
-			buddy_tmp, fba->post_form_id);
-	url = g_strdup_printf("/ajax/addfriend.php?id=%s", buddy_tmp);
+			"user=%" G_GINT64_FORMAT "&profile_id=%s&message=&"
+			"source=&submit=1&post_form_id=%s&fb_dtsg=%s&"
+			"post_form_id_source=AsyncRequest&__a=1",
+			fba->uid, buddy_tmp, fba->post_form_id, fba->dtsg);
 	g_free(buddy_tmp);
 
-	fb_post_or_get(fba, FB_METHOD_POST, NULL, url, postdata,
-			NULL, NULL, FALSE);
+	fb_post_or_get(fba, FB_METHOD_POST, NULL, "/ajax/profile/connect.php",
+			postdata, NULL, NULL, FALSE);
 
 	g_free(postdata);
-	g_free(url);
 }
 
+void fb_buddy_delete(PurpleConnection *pc, PurpleBuddy *buddy,
+		PurpleGroup *group)
+{
+	FacebookAccount *fba = pc->proto_data;
+	gchar *buddy_tmp, *postdata;
+
+	//This function removes a buddy from our friends list on facebook
+	//and shouldn't really be used
+	if (!purple_account_get_bool(fba->account, "facebook_manage_friends", FALSE)) {
+		purple_debug_warning("facebook", "attempted to add %s but was blocked\n", buddy->name);
+		return;
+	}
+
+	buddy_tmp = g_strdup(purple_url_encode(buddy->name));
+	postdata = g_strdup_printf(
+			"uid=%s&post_form_id=%s&fb_dtsg=%s&"
+			"post_form_id_source=AsyncRequest&__a=1",
+			buddy_tmp, fba->post_form_id, fba->dtsg);
+	g_free(buddy_tmp);
+
+	fb_post_or_get(fba, FB_METHOD_POST, NULL, "/ajax/profile/removefriend.php",
+			postdata, NULL, NULL, FALSE);
+
+	g_free(postdata);
+}
============================================================
--- libpurple/protocols/facebook/fb_managefriends.h	ab2e2fa893d242f300bcb6009f10880879279b2b
+++ libpurple/protocols/facebook/fb_managefriends.h	7273887ad32b467c8a644c5be09c1fa3cea0c80e
@@ -25,5 +25,6 @@ void fb_add_buddy(PurpleConnection *pc, 
 
 gboolean fb_check_friend_requests(gpointer data);
 void fb_add_buddy(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group);
+void fb_buddy_delete(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group);
 
 #endif /* FACEBOOK_MANAGEFRIENDS_H */
============================================================
--- libpurple/protocols/facebook/fb_messages.c	db485285cc61b901a8cfb8f38564c8d805dd7004
+++ libpurple/protocols/facebook/fb_messages.c	9e4b7c098e5407d1d6eafbf51c9f3cc4773e2a24
@@ -455,7 +455,7 @@ gboolean fb_reconnect(FacebookAccount *f
 
 gboolean fb_reconnect(FacebookAccount *fba)
 {
-	gchar *url = g_strdup_printf("/ajax/presence/reconnect.php?reason=7&post_form_id=%s", fba->post_form_id);
+	gchar *url = g_strdup_printf("/ajax/presence/reconnect.php?reason=7&post_form_id=%s&__a=1", fba->post_form_id);
 	fb_post_or_get(fba, FB_METHOD_GET, NULL, url, NULL, got_reconnect_json, NULL, FALSE);
 	g_free(url);
 	
============================================================
--- libpurple/protocols/facebook/libfacebook.c	2d32ec731cd3af31e053880370477b39222df7fa
+++ libpurple/protocols/facebook/libfacebook.c	fa11c84086db93bf96b87de14a10d37ddc540995
@@ -225,7 +225,7 @@ static void fb_login_cb(FacebookAccount 
 {
 	gchar *user_cookie;
 	
-	if (len && g_strstr_len(response, len, "captcha"))
+	if (len && g_strstr_len(response, len, "captcha") && !purple_account_get_bool(fba->account, "ignore-facebook-captcha", FALSE))
 	{
 		purple_debug_info("facebook", "captcha page: %s\n", response);
 
@@ -402,7 +402,6 @@ static void fb_close(PurpleConnection *p
 static void fb_close(PurpleConnection *pc)
 {
 	FacebookAccount *fba;
-	gchar *postdata;
 	GSList *buddies;
 
 	purple_debug_info("facebook", "disconnecting account\n");
@@ -427,37 +426,6 @@ static void fb_close(PurpleConnection *p
 		buddies = g_slist_delete_link(buddies, buddies);
 	}
 
-	/* Tell Facebook that we've logged out. */
-	/*
-	 * TODO
-	 * This doesn't actually work because the request is non-blocking
-	 * and we're in the process of logging out.  So we start making a
-	 * connection but then libpurple immediately cancels the attempt
-	 * and frees everything.
-	 *
-	 * There are two ways to fix this:
-	 * 1. We could make this request, but not pass in fba or reference
-	 *    any other data.  The request could complete normally even
-	 *    after this account has logged out, since it really doesn't
-	 *    need access to the PurpleConnection or the FacebookAccount.
-	 *
-	 * 2. The close prpl callback could be changed in libpurple so that
-	 *    protocol plugins can have a chance to make network requests
-	 *    and do other long cleanup operations.  So the call to
-	 *    prpl->close() would become asynchronous.  It tells the
-	 *    protocol plugin to begin the shutdown sequence, and the
-	 *    protocol plugin tells the core when it's finished.
-	 */
-	if (fba->post_form_id)
-		postdata = g_strdup_printf(
-				"visibility=false&post_form_id=%s",
-				fba->post_form_id);
-	else
-		postdata = g_strdup("visibility=false");
-	fb_post_or_get(fba, FB_METHOD_POST, NULL, "/ajax/chat/settings.php",
-			postdata, NULL, NULL, FALSE);
-	g_free(postdata);
-
 	if (fba->friend_request_timer) {
 		purple_timeout_remove(fba->friend_request_timer);
 	}
============================================================
--- libpurple/protocols/facebook/libfacebook.h	b56c2baea512f6680c01f5ea2c85cbbab5f1f51d
+++ libpurple/protocols/facebook/libfacebook.h	f4be461d1adef3dd6cec62c050ba9e9f3953f3cf
@@ -21,7 +21,7 @@
 #ifndef LIBFACEBOOK_H
 #define LIBFACEBOOK_H
 
-#define FACEBOOK_PLUGIN_VERSION "1.62"
+#define FACEBOOK_PLUGIN_VERSION "1.64"
 #define FACEBOOK_PLUGIN_ID "prpl-bigbrownchunx-facebookim"
 #define FACEBOOK_CAPTCHA_SITE "6LezHAAAAAAAADqVjseQ3ctG3ocfQs2Elo1FTa_a"
 
============================================================
--- libpurple/protocols/facebook/pidgin-facebookchat.rc	9d0c53b057522ae3de5007d9121259ce641eb8f6
+++ libpurple/protocols/facebook/pidgin-facebookchat.rc	7315a1099a7e1134eee2f5d9079b10f38583caeb
@@ -1,7 +1,7 @@ 1 VERSIONINFO
 
 1 VERSIONINFO
-FILEVERSION 1,62,0,0
-PRODUCTVERSION 1,62,0,0
+FILEVERSION 1,64,0,0
+PRODUCTVERSION 1,64,0,0
 FILEOS 0x40004 // VOS_NT_WINDOWS32
 FILETYPE 0x2 // VFT_DLL
 {
@@ -12,8 +12,8 @@ BLOCK "StringFileInfo"
 		VALUE "CompanyName", "Eion Robb\0"
 		VALUE "FileDescription",  "Facebook Chat plugin for Pidgin\0"
 		VALUE "ProductName", "pidgin-facebookchat\0"
-		VALUE "FileVersion", "1.62\0"
-		VALUE "ProductVersion", "1.62\0"
+		VALUE "FileVersion", "1.64\0"
+		VALUE "ProductVersion", "1.64\0"
 		VALUE "InternalName", "pidgin-facebookchat\0"
 		VALUE "OriginalFilename", "libfacebook.dll\0"
 		VALUE "Comments", "http://pidgin-facebookchat.googlecode.com/\0"
============================================================
--- libpurple/protocols/facebook/rss.xml	baa5c5a1ad452cb3c2f2b341993062adf99d7f29
+++ libpurple/protocols/facebook/rss.xml	97f9a9d18c7f743a7e020ccaaf5775eea643c543
@@ -13,6 +13,36 @@
 			<width>48</width><height>48</height>
 		</image>
 		<item>
+			<title>Version 1.64</title>
+			<link>http://code.google.com/p/pidgin-facebookchat/issues/detail?id=24#c52</link>
+			<description><![CDATA[I've just dropped v1.64 out for download at<br/>
+			<a href="http://code.google.com/p/pidgin-facebookchat/wiki/Downloads">http://code.google.com/p/pidgin-facebookchat/wiki/Downloads</a><br/>
+			<br/>
+			It fixes up some really annoying things like buddy icons not working and some strange status message stuffs.<br/>
+			<br/>
+			Changelog:<br/>
+			<a href="http://code.google.com/p/pidgin-facebookchat/wiki/Changelog">http://code.google.com/p/pidgin-facebookchat/wiki/Changelog</a><br/>
+			<br/>
+			(Apologies to rss feed subscribers for the slow post) ]]></description>
+			<pubDate>Fri 4 December 2009 17:43:30 +1300</pubDate>
+			<guid isPermaLink="true">http://code.google.com/p/pidgin-facebookchat/issues/detail?id=24#c52</guid>
+		</item>
+		<item>
+			<title>Version 1.63</title>
+			<link>http://code.google.com/p/pidgin-facebookchat/issues/detail?id=24#c51</link>
+			<description><![CDATA[Just pushed out v1.63 which fixes up a few of the little annoying things that didn't 
+			work since the last update.<br/>
+			Status messages are back, inbox notifications are back, friend accept/reject/add is 
+			back.<br/>
+			<br/>
+			Download as usual from<br/>
+			<a href="http://code.google.com/p/pidgin-facebookchat/wiki/Downloads">
+			http://code.google.com/p/pidgin-facebookchat/wiki/Downloads</a>
+			]]></description>
+			<pubDate>Sat, 14 November 2009 12:21:52 +1300</pubDate>
+			<guid isPermaLink="true">http://code.google.com/p/pidgin-facebookchat/issues/detail?id=24#c51</guid>
+		</item>
+		<item>
 			<title>Version 1.62</title>
 			<link>http://code.google.com/p/pidgin-facebookchat/issues/detail?id=24#c50</link>
 			<description><![CDATA[Some of you fancy people might have noticed that the plugin hasn't been doing too well over the last few hours.<br/>


More information about the Commits mailing list