/soc/2015/jgeboski/facebook: fb0b92c3533e: facebook: support all...
James Geboski
jgeboski at gmail.com
Mon Aug 10 01:43:50 EDT 2015
Changeset: fb0b92c3533e786fc0f2fbc592f94ab7908ddac2
Author: James Geboski <jgeboski at gmail.com>
Date: 2015-08-10 01:43 -0400
Branch: facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/fb0b92c3533e
Description:
facebook: support all XMA messages
diffstat:
libpurple/protocols/facebook/api.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diffs (38 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
@@ -910,6 +910,7 @@ static gchar *
fb_api_message_parse_xma(FbApi *api, JsonNode *root, GError **error)
{
const gchar *str;
+ const gchar *url;
FbHttpParams *params;
FbJsonValues *values;
gchar *ret;
@@ -929,18 +930,16 @@ fb_api_message_parse_xma(FbApi *api, Jso
}
str = fb_json_values_next_str(values, NULL);
-
- if (!purple_strequal(str, "ExternalUrl")) {
- fb_util_debug_warning("Unknown XMA type %s", str);
- fb_json_values_free(values);
- return NULL;
+ url = fb_json_values_next_str(values, NULL);
+
+ if (purple_strequal(str, "ExternalUrl")) {
+ params = fb_http_params_new_parse(url, TRUE);
+ ret = fb_http_params_dup_str(params, "u", NULL);
+ fb_http_params_free(params);
+ } else {
+ ret = g_strdup(url);
}
- str = fb_json_values_next_str(values, NULL);
- params = fb_http_params_new_parse(str, TRUE);
- ret = fb_http_params_dup_str(params, "u", NULL);
- fb_http_params_free(params);
-
fb_json_values_free(values);
return ret;
}
More information about the Commits
mailing list