From 33a781807e5ac677c59620f0e688835908dfde01 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 28 Sep 2016 11:48:34 +0200 Subject: [PATCH] Revert "chat.c: avoid crashing when sending too big uri" This fix is bad as it will hide any message greater than 1000 characters. The root cause of the original problem is probably not understood. This reverts commit 545d9ac09f5cb30f0bc3ea4fdde34d2ed1d610cd. --- gtk/chat.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gtk/chat.c b/gtk/chat.c index b572648bd..17c15d364 100644 --- a/gtk/chat.c +++ b/gtk/chat.c @@ -186,7 +186,7 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from, } // Inserts message body and tags URIs as hypertext links - if(message && strlen(message)<1000 /*limit to 1000 chars because overwise it might crash with big messages, such as ":B:B:B:B:B" x 10000*/) { + if(message) { g_regex_match(uri_regex, message, 0, &match_info); while(g_match_info_matches(match_info)) { g_match_info_fetch_pos(match_info, 0, &start, &end); @@ -198,8 +198,6 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from, if((size_t)pos < strlen(message)) write_body(buffer, &iter, &message[pos], -1, me, FALSE); gtk_text_buffer_insert(buffer,&iter,"\n",-1); g_match_info_free(match_info); - } else { - ms_warning("Skipping highlighting too big message '%s'", message); } g_hash_table_insert(table,GUINT_TO_POINTER(linphone_chat_message_get_storage_id(msg)),GINT_TO_POINTER(gtk_text_iter_get_line(&iter)));