eion/purple-hangouts

Fix for failing event stream on Linux
draft
2018-11-09, Eion Robb
3a80700b1722
Parents 049ac73c448d
Children 093d3ebe807d
Fix for failing event stream on Linux
Fixes issue #187
--- a/hangouts_connection.c Wed Oct 24 17:12:15 2018 +1300
+++ b/hangouts_connection.c Fri Nov 09 10:25:16 2018 +1300
@@ -482,7 +482,7 @@
postdata = g_string_new(NULL);
if (map_list != NULL) {
map_list_len = json_array_get_length(map_list);
- g_string_append_printf(postdata, "count=%ud&", map_list_len);
+ g_string_append_printf(postdata, "count=%u&", map_list_len);
g_string_append(postdata, "ofs=0&");
for(i = 0; i < map_list_len; i++) {
JsonObject *obj = json_array_get_object_element(map_list, i);
--- a/hangouts_conversation.c Wed Oct 24 17:12:15 2018 +1300
+++ b/hangouts_conversation.c Fri Nov 09 10:25:16 2018 +1300
@@ -1434,7 +1434,7 @@
if (filename != NULL) {
filename = g_path_get_basename(filename);
} else {
- filename = g_strdup_printf("purple%ud.%s", g_random_int(), purple_image_get_extension(image));
+ filename = g_strdup_printf("purple%u.%s", g_random_int(), purple_image_get_extension(image));
}
postdata = g_strdup_printf("{\"protocolVersion\":\"0.8\",\"createSessionRequest\":{\"fields\":[{\"external\":{\"name\":\"file\",\"filename\":\"%s\",\"put\":{},\"size\":%" G_GSIZE_FORMAT "}},{\"inlined\":{\"name\":\"client\",\"content\":\"hangouts\",\"contentType\":\"text/plain\"}}]}}", filename, (gsize) purple_image_get_data_size(image));
--- a/hangouts_events.c Wed Oct 24 17:12:15 2018 +1300
+++ b/hangouts_events.c Fri Nov 09 10:25:16 2018 +1300
@@ -538,7 +538,7 @@
image = purple_image_new_from_data(g_memdup(response_data, response_size), response_size);
image_id = purple_image_store_add(image);
escaped_image_url = g_markup_escape_text(purple_http_request_get_url(purple_http_conn_get_request(connection)), -1);
- msg = g_strdup_printf("<a href='%s'>View full image <img id='%ud' src='%s' /></a>", url, image_id, escaped_image_url);
+ msg = g_strdup_printf("<a href='%s'>View full image <img id='%u' src='%s' /></a>", url, image_id, escaped_image_url);
msg_flags |= PURPLE_MESSAGE_IMAGES;
if (g_hash_table_contains(ha->group_chats, conv_id)) {
--- a/hangouts_pblite.c Wed Oct 24 17:12:15 2018 +1300
+++ b/hangouts_pblite.c Fri Nov 09 10:25:16 2018 +1300
@@ -503,7 +503,7 @@
const ProtobufCEnumValue *enum_value = protobuf_c_enum_descriptor_get_value(enum_descriptor, *member);
node = json_node_new(JSON_NODE_VALUE);
if (enum_value == NULL) {
- gchar *unknown_text = g_strdup_printf("UNKNOWN ENUM VALUE %ud", *member);
+ gchar *unknown_text = g_strdup_printf("UNKNOWN ENUM VALUE %u", *member);
json_node_set_string(node, unknown_text);
g_free(unknown_text);
} else {