summaryrefslogtreecommitdiff
path: root/mail/elm+ME/files/patch-mailmsg2.c
blob: d58011e12a8fe7feb1972d6770f4234527da8b0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--- src/mailmsg2.c.orig	Wed Aug  4 19:07:35 2004
+++ src/mailmsg2.c	Wed Aug 25 01:44:23 2004
@@ -486,6 +486,7 @@
 	} else if (
 		   (forwarding || mime_attach || copy_msg)) { 
 	    struct string * From_buffer = NULL;
+	    struct string * Date_buffer = NULL;
 	    struct addr_item *p;
 	    
 	    if (hdr->from) {
@@ -504,7 +505,22 @@
 		    }
 		}
 	    }
-	    
+
+	    if (hdr->time_sent) {
+		char date_buf[SLEN];
+
+		Date_buffer = new_string(display_charset);
+		add_ascii_to_string(Date_buffer,
+				    s2us(elm_date_str(date_buf,
+						      hdr->time_sent +
+						      hdr->tz_offset,
+						      sizeof date_buf)));
+		if (hdr->time_zone[0]) {
+		    add_ascii_to_string(Date_buffer, s2us(" "));
+		    add_ascii_to_string(Date_buffer, s2us(hdr->time_zone));
+		}
+	    }
+
 	    if (!cur_editcharset)
 		cur_editcharset = display_charset;
 
@@ -523,15 +539,18 @@
 				     hdr->env_from);
 		    
 		} else if (attribution[0] && hdr) {
+		    char * date = us2s(stream_from_string(Date_buffer,1,NULL));
+
 		    if (From_buffer) {
 			struct string * tmp1 = convert_string(cur_editcharset,
 							      From_buffer,1);
 			char * str = us2s(stream_from_string(tmp1,1,NULL));
-			fprintf(reply, attribution, str);
+			fprintf(reply, attribution, str, date);
 			free(str);
 			free_string(&tmp1);
 		    } else
-			fprintf(reply, attribution, hdr->env_from);
+			fprintf(reply, attribution, hdr->env_from, date);
+		    free(date);
 		    fputc('\n', reply);
 		}
 		if (edit_message && mailbox_file) {
@@ -621,6 +640,8 @@
 
 	    if (From_buffer)
 		free_string(&From_buffer);
+	    if (Date_buffer)
+		free_string(&Date_buffer);
 
 	} else  { 
 	    /* make referenced message as edited message */