[Commits] [SCM] claws branch, master, updated. 3.16.0-95-g4729e80

wwp at claws-mail.org wwp at claws-mail.org
Sat Mar 17 21:54:02 CET 2018


The branch, master has been updated
       via  4729e80f93dc31db4b6f9bf4ecdee4095f15ea94 (commit)
      from  e51a6cfaf7e19475fcd93aa69d02031db44c0ba5 (commit)

Summary of changes:
 src/plugins/vcalendar/vcalendar.c |   27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)


- Log -----------------------------------------------------------------
commit 4729e80f93dc31db4b6f9bf4ecdee4095f15ea94
Author: wwp <wwp at free.fr>
Date:   Sat Mar 17 21:53:20 2018 +0100

    Don't compute charset unless necessary (vcalviewer_get_uid_from_mimeinfo()),
    don't compute charset at all when not used (vcalviewer_get_request_values(),
    vcalviewer_get_reply_values(), de facto solves CID 1372373), possible remnants
    of an old implementation that I couldn't even found in log.

diff --git a/src/plugins/vcalendar/vcalendar.c b/src/plugins/vcalendar/vcalendar.c
index 88c2fea..9fd68df 100644
--- a/src/plugins/vcalendar/vcalendar.c
+++ b/src/plugins/vcalendar/vcalendar.c
@@ -652,18 +652,18 @@ gchar *vcalviewer_get_uid_from_mimeinfo(MimeInfo *mimeinfo)
 	gchar *res = NULL;
 	VCalEvent *event = NULL;
 
-	if (!charset)
-		charset = CS_WINDOWS_1252;
-	
-	if (!strcasecmp(charset, CS_ISO_8859_1))
-		charset = CS_WINDOWS_1252;
-
 	if (procmime_get_part(tmpfile, mimeinfo) < 0) {
 		g_warning("Can't get mimepart file");	
 		g_free(tmpfile);
 		return NULL;
 	}
 	
+	if (!charset)
+		charset = CS_WINDOWS_1252;
+
+	if (!strcasecmp(charset, CS_ISO_8859_1))
+		charset = CS_WINDOWS_1252;
+
 	compstr = file_read_to_str(tmpfile);
 	
 	event = vcal_get_event_from_ical(compstr, charset);
@@ -680,22 +680,14 @@ gchar *vcalviewer_get_uid_from_mimeinfo(MimeInfo *mimeinfo)
 static void vcalviewer_get_request_values(VCalViewer *vcalviewer, MimeInfo *mimeinfo, gboolean is_todo) 
 {
 	VCalEvent *saved_event = NULL;
-	const gchar *charset = procmime_mimeinfo_get_parameter(mimeinfo, "charset");
 	const gchar *saveme =  procmime_mimeinfo_get_parameter(mimeinfo, "vcalsave");
 	
 	if (!vcalviewer->event)
 		return;
 
-	if (!charset)
-		charset = CS_WINDOWS_1252;
-	
-	if (!strcasecmp(charset, CS_ISO_8859_1))
-		charset = CS_WINDOWS_1252;
-
 	/* see if we have it registered and more recent */
 	saved_event = vcal_manager_load_event(vcalviewer->event->uid);
 	if (saved_event && saved_event->sequence >= vcalviewer->event->sequence) {
-		charset = CS_INTERNAL;
 		saved_event->method = vcalviewer->event->method;
 		vcalviewer_display_event(vcalviewer, saved_event);
 		vcal_manager_free_event(saved_event);
@@ -714,7 +706,6 @@ static void vcalviewer_get_request_values(VCalViewer *vcalviewer, MimeInfo *mime
 
 static void vcalviewer_get_reply_values(VCalViewer *vcalviewer, MimeInfo *mimeinfo) 
 {
-	const gchar *charset = procmime_mimeinfo_get_parameter(mimeinfo, "charset");
 	VCalEvent *saved_event = NULL;
 	gchar *attendee = NULL, *label = NULL;
 	Answer *answer = NULL;
@@ -722,12 +713,6 @@ static void vcalviewer_get_reply_values(VCalViewer *vcalviewer, MimeInfo *mimein
 	if (!vcalviewer->event)
 		return;
 
-	if (!charset)
-		charset = CS_WINDOWS_1252;
-	
-	if (!strcasecmp(charset, CS_ISO_8859_1))
-		charset = CS_WINDOWS_1252;
-
 	if (!vcalviewer->event->answers || g_slist_length(vcalviewer->event->answers) > 1) {
 		g_warning("strange, no answers or more than one");
 	} 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list