Re: Timestamp on Sent Messages

Xavier Nodet <[email protected]>
Newsgroups gmane.mail.mahogany.devel
Message-ID <[email protected]>
On Mon, 1 Dec 2003 23:04:02 +0100 (Romance Standard Time) Vadim Zeitlin <[email protected]> wrote:

> On Mon, 1 Dec 2003 03:03:03 -0800 (PST) Michael A Chase <[email protected]> wrote:

> MAC> I recently sent an email that had been sitting in the Drafts folder for
> MAC> a week.  The timestamp reflected when I first saved the message, not
> MAC> when I sent it.
>
>  This is a bug.

The attached patch corrects it.

-- 
Xavier Nodet
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." - Benjamin Franklin, 1759.
SetDateWhenSending.patch (text/plain, 1.2 KB)
cvs -z3 diff -u -wb -- src\mail\SendMessageCC.cpp (in directory U:\src\M\)
Index: src/mail/SendMessageCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/SendMessageCC.cpp,v
retrieving revision 1.230
diff -u -w -b -r1.230 SendMessageCC.cpp
--- src/mail/SendMessageCC.cpp	4 Oct 2004 12:30:22 -0000	1.230
+++ src/mail/SendMessageCC.cpp	19 Jul 2005 10:39:02 -0000
@@ -1271,7 +1271,9 @@
    //
    // NB: we do allow the user to override the date header because this is
    //     useful when editing a previously postponed message
-   if ( !HasHeaderEntry(_T("Date")) )
+   // NB: If the message is not a resend, we'll add the Date header when
+   //     sending the message (and not when saving it as Draft)
+   if ( m_Envelope->remail && !HasHeaderEntry(_T("Date")) )
    {
       char tmpbuf[MAILTMPLEN];
       rfc822_date (tmpbuf);
@@ -1326,6 +1328,10 @@
          // contents (which is highly undesirable!)
          RemoveHeaderEntry(_T("X-BCC"));
       }
+      
+      char tmpbuf[MAILTMPLEN];
+      rfc822_date (tmpbuf);
+      m_Envelope->date = (unsigned char *)cpystr(tmpbuf);
    }
 
    // +4: 1 for X-Mailer, 1 for X-Face, 1 for reply to and 1 for the
signature.asc (application/pgp-signature, 205 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32) - GPGrelay v0.959

iD8DBQBC3O3jFK6OUIeqvjQRAp7tAJ9OBRdcWbAY7pKQ1OzSyE90U2PIlgCeKR/2
i2ZQ07e9DGKwfXSeBLuxRcI=
=BJMc
-----END PGP SIGNATURE-----
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.