[evolution-patches] [Fwd: Re: [Evolution] timezone in the header of a reply quote]



Alternative (and preferred) patch to the previous one... we don't just
quote the Date: header intact; we reformat it. But we do retain the
timezone from the original mail, which is surely the right thing to
do...

-- 
dwmw2
--- Begin Message ---
Received: from phoenix.infradead.org ([213.86.99.234]) by
	pentafluge.infradead.org with esmtp (Exim 4.14 #3 (Red Hat Linux)) id
	19ncu4-0006dJ-L2 for <dwmw2 pentafluge infradead org>; Fri, 15 Aug 2003
	12:37:56 +0100
Received: from listsmx.ximian.com ([141.154.95.15]) by
	phoenix.infradead.org with esmtp (Exim 4.10) id 19nctq-0002Qe-00 for
	dwmw2 infradead org; Fri, 15 Aug 2003 12:37:42 +0100
Received: from headcheese.ximian.com (localhost [127.0.0.1]) by
	listsmx.ximian.com (Postfix) with ESMTP id 80CAD124518; Fri, 15 Aug 2003
	07:37:04 -0400 (EDT)
Received: by listsmx.ximian.com (Postfix, from userid 38) id 6FB2D124514;
	Fri, 15 Aug 2003 07:36:13 -0400 (EDT)
Received: from executor.cambridge.redhat.com (unknown [213.86.99.237]) by
	listsmx.ximian.com (Postfix) with ESMTP id 0713F124513 for
	<evolution lists ximian com>; Fri, 15 Aug 2003 07:36:11 -0400 (EDT)
Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com
	[172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id
	6ACE963D66; Fri, 15 Aug 2003 12:36:10 +0100 (BST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
	hades.cambridge.redhat.com (8.12.9/8.11.0) with ESMTP id h7FBa9Lh032517;
	Fri, 15 Aug 2003 12:36:09 +0100
From: David Woodhouse <dwmw2 infradead org>
To: Martin List-Petersen <martin list-petersen se>
Cc: Andreas =?ISO-8859-1?Q?W=FCst?= <awuest swissonline ch>, Evolution Mailinglist <evolution lists ximian com>
In-Reply-To: <1060941439 26545 58 camel loke>
References: <1060885784 23771 5 camel loke>
	 <1060886868 10490 9 camel tazmanian-devil boston ximian com>
	 <1060888767 23788 12 camel loke>
	 <1060889218 19345 2 camel tazmanian-devil boston ximian com>
	 <1060889124 23771 15 camel loke>  <1060938780 744 10 camel andrewII>
	 <1060941439 26545 58 camel loke>
Message-Id: <1060947369 32490 6 camel hades cambridge redhat com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.4 (1.4.4-3dwmw2) 
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
Sender: evolution-admin lists ximian com
Errors-To: evolution-admin lists ximian com
X-BeenThere: evolution lists ximian com
X-Mailman-Version: 2.0.13
Precedence: bulk
List-Help: <mailto:evolution-request lists ximian com?subject=help>
List-Post: <mailto:evolution lists ximian com>
List-Subscribe: <http://lists.ximian.com/mailman/listinfo/evolution>,
	<mailto:evolution-request lists ximian com?subject=subscribe>
List-Id: Evolution users mailing list. <evolution.lists.ximian.com>
List-Unsubscribe: <http://lists.ximian.com/mailman/listinfo/evolution>,
	<mailto:evolution-request lists ximian com?subject=unsubscribe>
List-Archive: <http://lists.ximian.com/archives/public/evolution/>
Date: Fri, 15 Aug 2003 12:36:09 +0100
Subject: Re: [Evolution] timezone in the header of a reply quote
X-Spam-Status: No, hits=-2.9 required=5.0
	tests=AWL,IN_REP_TO,KNOWN_MAILING_LIST,PATCH_UNIFIED_DIFF,
	QUOTED_EMAIL_TEXT,REFERENCES,SIGNATURE_SHORT_SPARSE, SPAM_PHRASE_03_05
	version=2.44
X-Spam-Level: 
X-SA-Exim-Scanned: Yes
X-Pentafluge-Mail-From: <evolution-admin lists ximian com>
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Fri, 2003-08-15 at 09:55 +0200, Martin List-Petersen wrote:
> It is that direction, that i thought in, especially some people not
> might want to have the timezone info.

If anyone expresses a preference to omit timezone info, please do us all
a favour by taking them out back and shooting them. A time in any form
without unambiguous (preferably numeric) timezone info is completely
pointless.

> On Fri, 2003-08-15 at 02:18, Not Zed wrote:
> > You are talking about the timezone IN the message you're replying to? 

No, he's not -- since Evolution (brokenly IMHO) converts the time to the
replier's localtime in attributions. Patch to fix this below (I much
prefer this over the trivial one I just sent to just include the local
timezone after the bogus conversion).

I _think_ it's OK just to use gmtime and add the offset with %%+05d. Not
enough coffee yet this morning, er, afternoon...

--- mail/mail-callbacks.c~	Wed Jul  9 17:18:29 2003
+++ mail/mail-callbacks.c	Fri Aug 15 12:26:57 2003
@@ -995,6 +995,7 @@
 	GConfClient *gconf;
 	EIterator *iter;
 	time_t date;
+	int date_ofs;
 	char *url;
 	
 	gconf = mail_config_get_gconf_client ();
@@ -1189,9 +1190,13 @@
 			name = _("an unknown sender");
 		}
 		
-		date = camel_mime_message_get_date (message, NULL);
-		e_utf8_strftime (format, sizeof (format), _("On %a, %Y-%m-%d at %H:%M, %%s wrote:"), localtime (&date));
-		text = mail_tool_quote_message (message, format, name && *name ? name : address);
+		date = camel_mime_message_get_date (message, &date_ofs);
+		/* Convert to UTC */
+		date -= (date_ofs / 100) * 60;
+		date -= date_ofs % 100;
+
+		e_utf8_strftime (format, sizeof (format), _("On %a, %Y-%m-%d at %H:%M %%+05d, %%s wrote:"), gmtime (&date));
+		text = mail_tool_quote_message (message, format, date_ofs, name && *name ? name : address);
 		mail_ignore (composer, name, address);
 		if (text) {
 			e_msg_composer_set_body_text (composer, text);


-- 
dwmw2

_______________________________________________
evolution maillist  -  evolution lists ximian com
http://lists.ximian.com/mailman/listinfo/evolution

--- End Message ---


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]