CVS: sylpheedclaws/sylpheed-claws/src wizard.c,1.1.2.39,1.1.2.40

[email protected]
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /pack/anoncvs/sylpheedclaws/sylpheed-claws/src
In directory sunsite.dk:/tmp/cvs-serv20928/src

Modified Files:
      Tag: gtk2
	wizard.c 
Log Message:
2006-12-05 [paul]	2.6.1cvs4

	* src/wizard.c
		encode headers
		Thanks to Colin 

Index: wizard.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/Attic/wizard.c,v
retrieving revision 1.1.2.39
retrieving revision 1.1.2.40
diff -u -d -r1.1.2.39 -r1.1.2.40
--- wizard.c	2006/11/30 12:43:38	1.1.2.39
+++ wizard.c	2006/12/05 09:22:12	1.1.2.40
@@ -447,15 +447,23 @@
 	gchar *head=NULL;
 	gchar *body=NULL;
 	gchar *msg=NULL;
-	gchar *subj=NULL;
 	const gchar *mailbox = gtk_entry_get_text(GTK_ENTRY(wizard->mailbox_name));
 	Folder *folder = folder_find_from_path(mailbox);
 	FolderItem *inbox = folder ? folder->inbox:NULL;
 	gchar *file = get_tmp_file();
+	gchar enc_from_name[BUFFSIZE], enc_to_name[BUFFSIZE], enc_subject[BUFFSIZE];
 	
 	get_rfc822_date(buf_date, sizeof(buf_date));
 
-	subj = g_strdup_printf(_("Welcome to Claws Mail "));
+	conv_encode_header_full(enc_subject, sizeof(enc_subject), 
+			_("Welcome to Claws Mail "),
+			strlen("Subject: "), FALSE, CS_INTERNAL);
+	conv_encode_header_full(enc_to_name, sizeof(enc_to_name), 
+			gtk_entry_get_text(GTK_ENTRY(wizard->full_name)),
+			strlen("To: "), TRUE, CS_INTERNAL);
+	conv_encode_header_full(enc_from_name, sizeof(enc_from_name), 
+			_("Claws Mail Team"),
+			strlen("From: "), TRUE, CS_INTERNAL);
 
 	head = g_strdup_printf(
 		"From: %s <%s>\n"
@@ -465,11 +473,11 @@
 		"X-Face: %s\n"
 		"Face: %s\n"
 		"Content-Type: text/plain; charset=UTF-8\n",
-		_("Claws Mail Team"),
+		enc_from_name,
 		USERS_ML_ADDR,
-		gtk_entry_get_text(GTK_ENTRY(wizard->full_name)),
+		enc_to_name,
 		gtk_entry_get_text(GTK_ENTRY(wizard->email)),
-		buf_date, subj, XFACE, FACE);
+		buf_date, enc_subject, XFACE, FACE);
 	body = g_strdup_printf(
 		_("\n"
 		"Welcome to Claws Mail\n"
@@ -524,7 +532,6 @@
 		MsgFlags flags = { MSG_UNREAD|MSG_NEW, 0};
 		folder_item_add_msg(inbox, file, &flags, FALSE);
 	}
-	g_free(subj);
 	g_free(head);
 	g_free(body);
 	g_free(msg);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.