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-03-01 23:44:46 +0300
committerEion Robb <eion@robbmob.com>2015-03-01 23:44:46 +0300
commitb44285eeb6f48491cad39a0f0b564bcb687ec7e3 (patch)
treee1228a9f30cb84a94199400c31e31b2ed4562711
parentd7ca43c2b29fe84d86215ccb9f82b1606ec19c09 (diff)
SkypeWeb : Fix for crash when IM/chat messages are remotely deleted
-rw-r--r--skypeweb/skypeweb_messages.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/skypeweb/skypeweb_messages.c b/skypeweb/skypeweb_messages.c
index 1fd8580..097d3ea 100644
--- a/skypeweb/skypeweb_messages.c
+++ b/skypeweb/skypeweb_messages.c
@@ -65,6 +65,7 @@ static void
process_message_resource(SkypeWebAccount *sa, JsonObject *resource)
{
const gchar *clientmessageid = json_object_get_string_member(resource, "clientmessageid");
+ const gchar *skypeeditedid = json_object_get_string_member(resource, "skypeeditedid");
const gchar *messagetype = json_object_get_string_member(resource, "messagetype");
const gchar *from = json_object_get_string_member(resource, "from");
const gchar *content = json_object_get_string_member(resource, "content");
@@ -79,6 +80,7 @@ process_message_resource(SkypeWebAccount *sa, JsonObject *resource)
if (clientmessageid && *clientmessageid && g_hash_table_remove(sa->sent_messages_hash, clientmessageid)) {
// We sent this message from here already
+ g_strfreev(messagetype_parts);
return;
}
@@ -103,13 +105,15 @@ process_message_resource(SkypeWebAccount *sa, JsonObject *resource)
skypeweb_get_thread_users(sa, chatname);
}
- if (g_str_equal(messagetype, "RichText") || g_str_equal(messagetype, "Text")) {
+ if ((g_str_equal(messagetype, "RichText") || g_str_equal(messagetype, "Text")) && content && *content) {
gchar *html;
gint64 skypeemoteoffset = 0;
if (json_object_has_member(resource, "skypeemoteoffset"))
skypeemoteoffset = atoi(json_object_get_string_member(resource, "skypeemoteoffset"));
+ //TODO if (skypeeditedid && *skypeeditedid) { ... }
+
if (g_str_equal(messagetype, "Text")) {
gchar *temp = skypeweb_meify(content, skypeemoteoffset);
html = purple_markup_escape_text(temp, -1);
@@ -195,13 +199,15 @@ process_message_resource(SkypeWebAccount *sa, JsonObject *resource)
} else if (g_str_equal(messagetype_parts[1], "Typing")) {
serv_got_typing(sa->pc, from, 7, PURPLE_TYPING);
}
- } else if (g_str_equal(messagetype, "RichText") || g_str_equal(messagetype, "Text")) {
+ } else if ((g_str_equal(messagetype, "RichText") || g_str_equal(messagetype, "Text")) && content && *content) {
gchar *html;
gint64 skypeemoteoffset = 0;
if (json_object_has_member(resource, "skypeemoteoffset"))
skypeemoteoffset = atoi(json_object_get_string_member(resource, "skypeemoteoffset"));
+ //TODO if (skypeeditedid && *skypeeditedid) { ... }
+
if (g_str_equal(messagetype, "Text")) {
gchar *temp = skypeweb_meify(content, skypeemoteoffset);
html = purple_markup_escape_text(temp, -1);