/soc/2015/jgeboski/facebook: fc5bdd312c37: facebook: fixed MIME ...

James Geboski jgeboski at gmail.com
Tue Aug 18 00:12:38 EDT 2015


Changeset: fc5bdd312c371b21092c49fbf3ab6859676cf73e
Author:	 James Geboski <jgeboski at gmail.com>
Date:	 2015-08-18 00:12 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/fc5bdd312c37

Description:

facebook: fixed MIME types being required

diffstat:

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

diffs (39 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
@@ -1223,7 +1223,7 @@ fb_api_message_parse_attach(FbApi *api, 
 	JsonNode *xode;
 
 	values = fb_json_values_new(root);
-	fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE, "$.mimeType");
+	fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE, "$.mimeType");
 	fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE,
 	                   "$.imageMetadata.imageURIMap.0");
 	fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE, "$.xmaGraphQL");
@@ -1235,7 +1235,7 @@ fb_api_message_parse_attach(FbApi *api, 
 		str = fb_json_values_next_str(values, NULL);
 		url = fb_json_values_next_str(values, NULL);
 
-		if (g_str_has_prefix(str, "image/")) {
+		if ((str != NULL) && g_str_has_prefix(str, "image/")) {
 			msg->text = g_strdup(url);
 			mptr = fb_api_message_dup(msg, FALSE);
 			msgs = g_slist_prepend(msgs, mptr);
@@ -2069,7 +2069,7 @@ fb_api_cb_unread_parse_attach(FbApi *api
 	gpointer mptr;
 
 	values = fb_json_values_new(root);
-	fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE, "$.mimetype");
+	fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE, "$.mimetype");
 	fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE,
 	                   "$.image_full_screen.uri");
 	fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE, "$.filename");
@@ -2079,7 +2079,7 @@ fb_api_cb_unread_parse_attach(FbApi *api
 		str = fb_json_values_next_str(values, NULL);
 		url = fb_json_values_next_str(values, NULL);
 
-		if (g_str_has_prefix(str, "image/")) {
+		if ((str != NULL) && g_str_has_prefix(str, "image/")) {
 			msg->text = g_strdup(url);
 			mptr = fb_api_message_dup(msg, FALSE);
 			msgs = g_slist_prepend(msgs, mptr);



More information about the Commits mailing list