Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/skype4pidgin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEion Robb <eion@robbmob.com>2015-08-10 00:50:04 +0300
committerEion Robb <eion@robbmob.com>2015-08-10 00:50:04 +0300
commit774525bab286d5cfc0b871a6d15404e08cbda462 (patch)
tree589cbb61a95f4cc43e36df055010583552f75fda
parent0c354d57caf1f279bbeadf80a3a57cfda3cb6217 (diff)
SkypeWeb : Potential fix for inline images not downloading
-rw-r--r--skypeweb/skypeweb_contacts.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/skypeweb/skypeweb_contacts.c b/skypeweb/skypeweb_contacts.c
index ea63bee..1810a41 100644
--- a/skypeweb/skypeweb_contacts.c
+++ b/skypeweb/skypeweb_contacts.c
@@ -94,7 +94,18 @@ skypeweb_got_imagemessage(PurpleUtilFetchUrlData *url_data, gpointer user_data,
gint icon_id;
gchar *msg_tmp;
- if (!url_text || !url_text[0] || url_text[0] == '{' || url_text[0] == '<')
+ if (url_text == NULL && url_data->data_len) {
+ gchar *location;
+ location = skypeweb_string_get_chunk(url_data->webdata, url_data->data_len, "Location: https://", "/");
+ if (location && *location) {
+ PurpleConnection *pc = purple_conversation_get_connection(conv);
+ skypeweb_download_uri_to_conv(purple_connection_get_protocol_data(pc), location, conv);
+ g_free(location);
+ }
+ return;
+ }
+
+ if (!url_text || !len || url_text[0] == '{' || url_text[0] == '<')
return;
if (error_message && *error_message)
@@ -114,6 +125,7 @@ skypeweb_download_uri_to_conv(SkypeWebAccount *sa, const gchar *uri, PurpleConve
{
gchar *headers;
gchar *path, *host;
+ PurpleUtilFetchUrlData *requestdata;
purple_url_parse(uri, &host, NULL, &path, NULL, NULL);
headers = g_strdup_printf("GET /%s HTTP/1.0\r\n"
@@ -124,7 +136,8 @@ skypeweb_download_uri_to_conv(SkypeWebAccount *sa, const gchar *uri, PurpleConve
"\r\n\r\n",
path, sa->skype_token, host);
- purple_util_fetch_url_request(sa->account, uri, TRUE, NULL, FALSE, headers, FALSE, -1, skypeweb_got_imagemessage, conv);
+ requestdata = purple_util_fetch_url_request(sa->account, uri, TRUE, NULL, FALSE, headers, FALSE, -1, skypeweb_got_imagemessage, conv);
+ requestdata->num_times_redirected = 10; /* Prevent following redirects */
g_free(headers);
g_free(host);