Fossil SCM
Fix the "fossil chat send" command so that it sends the lmtime query parameter so that the chat display shows an appropriate local time.
Commit
62d67ed9a52e0fbffae5847ed923ce436422eabd22cf88e45197ced3aba89de2
Parent
1814f528de4987e…
1 file changed
+7
+7
| --- src/chat.c | ||
| +++ src/chat.c | ||
| @@ -757,10 +757,11 @@ | ||
| 757 | 757 | const char *zMsg = find_option("message","m",1); |
| 758 | 758 | int allowUnsafe = find_option("unsafe",0,0)!=0; |
| 759 | 759 | const int mFlags = HTTP_GENERIC | HTTP_QUIET | HTTP_NOCOMPRESS; |
| 760 | 760 | int i; |
| 761 | 761 | const char *zPw; |
| 762 | + char *zLMTime; | |
| 762 | 763 | Blob up, down, fcontent; |
| 763 | 764 | char zBoundary[80]; |
| 764 | 765 | sqlite3_uint64 r[3]; |
| 765 | 766 | if( zFilename==0 && zMsg==0 ){ |
| 766 | 767 | fossil_fatal("must have --message or --file or both"); |
| @@ -779,10 +780,16 @@ | ||
| 779 | 780 | blob_init(&down, 0, 0); |
| 780 | 781 | sqlite3_randomness(sizeof(r),r); |
| 781 | 782 | sqlite3_snprintf(sizeof(zBoundary),zBoundary, |
| 782 | 783 | "--------%016llu%016llu%016llu", r[0], r[1], r[2]); |
| 783 | 784 | blob_appendf(&up, "%s", zBoundary); |
| 785 | + zLMTime = db_text(0, | |
| 786 | + "SELECT strftime('%%Y-%%m-%%dT%%H:%%M:%%S','now','localtime')"); | |
| 787 | + if( zLMTime ){ | |
| 788 | + blob_appendf(&up,"\r\nContent-Disposition: form-data; name=\"lmtime\"\r\n" | |
| 789 | + "\r\n%z\r\n%s", zLMTime, zBoundary); | |
| 790 | + } | |
| 784 | 791 | if( g.url.user && g.url.user[0] ){ |
| 785 | 792 | blob_appendf(&up,"\r\nContent-Disposition: form-data; name=\"resid\"\r\n" |
| 786 | 793 | "\r\n%z\r\n%s", obscure(g.url.user), zBoundary); |
| 787 | 794 | } |
| 788 | 795 | zPw = g.url.passwd; |
| 789 | 796 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -757,10 +757,11 @@ | |
| 757 | const char *zMsg = find_option("message","m",1); |
| 758 | int allowUnsafe = find_option("unsafe",0,0)!=0; |
| 759 | const int mFlags = HTTP_GENERIC | HTTP_QUIET | HTTP_NOCOMPRESS; |
| 760 | int i; |
| 761 | const char *zPw; |
| 762 | Blob up, down, fcontent; |
| 763 | char zBoundary[80]; |
| 764 | sqlite3_uint64 r[3]; |
| 765 | if( zFilename==0 && zMsg==0 ){ |
| 766 | fossil_fatal("must have --message or --file or both"); |
| @@ -779,10 +780,16 @@ | |
| 779 | blob_init(&down, 0, 0); |
| 780 | sqlite3_randomness(sizeof(r),r); |
| 781 | sqlite3_snprintf(sizeof(zBoundary),zBoundary, |
| 782 | "--------%016llu%016llu%016llu", r[0], r[1], r[2]); |
| 783 | blob_appendf(&up, "%s", zBoundary); |
| 784 | if( g.url.user && g.url.user[0] ){ |
| 785 | blob_appendf(&up,"\r\nContent-Disposition: form-data; name=\"resid\"\r\n" |
| 786 | "\r\n%z\r\n%s", obscure(g.url.user), zBoundary); |
| 787 | } |
| 788 | zPw = g.url.passwd; |
| 789 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -757,10 +757,11 @@ | |
| 757 | const char *zMsg = find_option("message","m",1); |
| 758 | int allowUnsafe = find_option("unsafe",0,0)!=0; |
| 759 | const int mFlags = HTTP_GENERIC | HTTP_QUIET | HTTP_NOCOMPRESS; |
| 760 | int i; |
| 761 | const char *zPw; |
| 762 | char *zLMTime; |
| 763 | Blob up, down, fcontent; |
| 764 | char zBoundary[80]; |
| 765 | sqlite3_uint64 r[3]; |
| 766 | if( zFilename==0 && zMsg==0 ){ |
| 767 | fossil_fatal("must have --message or --file or both"); |
| @@ -779,10 +780,16 @@ | |
| 780 | blob_init(&down, 0, 0); |
| 781 | sqlite3_randomness(sizeof(r),r); |
| 782 | sqlite3_snprintf(sizeof(zBoundary),zBoundary, |
| 783 | "--------%016llu%016llu%016llu", r[0], r[1], r[2]); |
| 784 | blob_appendf(&up, "%s", zBoundary); |
| 785 | zLMTime = db_text(0, |
| 786 | "SELECT strftime('%%Y-%%m-%%dT%%H:%%M:%%S','now','localtime')"); |
| 787 | if( zLMTime ){ |
| 788 | blob_appendf(&up,"\r\nContent-Disposition: form-data; name=\"lmtime\"\r\n" |
| 789 | "\r\n%z\r\n%s", zLMTime, zBoundary); |
| 790 | } |
| 791 | if( g.url.user && g.url.user[0] ){ |
| 792 | blob_appendf(&up,"\r\nContent-Disposition: form-data; name=\"resid\"\r\n" |
| 793 | "\r\n%z\r\n%s", obscure(g.url.user), zBoundary); |
| 794 | } |
| 795 | zPw = g.url.passwd; |
| 796 |