Commit fe151e7f fe151e7f99d98ad02398f0621dcc5e76bb536d42 by Sergey Poznyakoff

(mh_annotate): New function.

1 parent 1335f254
...@@ -290,3 +290,4 @@ int mh_disposition __P((const char *filename)); ...@@ -290,3 +290,4 @@ int mh_disposition __P((const char *filename));
290 int mh_usedraft __P((const char *filename)); 290 int mh_usedraft __P((const char *filename));
291 int mh_file_copy __P((const char *from, const char *to)); 291 int mh_file_copy __P((const char *from, const char *to));
292 292
293 void mh_annotate __P((message_t msg, char *field, char *text, int date));
......
...@@ -818,5 +818,31 @@ mh_install (char *name, int automode) ...@@ -818,5 +818,31 @@ mh_install (char *name, int automode)
818 exit (1); 818 exit (1);
819 } 819 }
820 } 820 }
821 821
822 void
823 mh_annotate (message_t msg, char *field, char *text, int date)
824 {
825 header_t hdr;
826 attribute_t attr;
822 827
828 if (message_get_header (msg, &hdr))
829 return;
830
831 if (date)
832 {
833 time_t t;
834 struct tm *tm;
835 char datebuf[80];
836 t = time (NULL);
837 tm = localtime (&t);
838 strftime (datebuf, sizeof datebuf, "%a, %d %b %Y %H:%M:%S %Z", tm);
839
840 header_set_value (hdr, field, datebuf, 0);
841 }
842
843 if (text)
844 header_set_value (hdr, field, text, 0);
845 message_get_attribute (msg, &attr);
846 attribute_set_modified (attr);
847 }
848
......