Fossil SCM
Show the time of the most recent digest on the email notification status.
Commit
d34a8a2cd1c32c556d2ffe37a736551b38abd5b0961957103f7856aec3c1c8bc
Parent
fe178faa44f3f97…
1 file changed
+11
+11
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -60,10 +60,11 @@ | ||
| 60 | 60 | void stats_for_email(void){ |
| 61 | 61 | const char *zDest = db_get("email-send-method",0); |
| 62 | 62 | int nSub, nASub, nPend, nDPend; |
| 63 | 63 | const char *zDir, *zDb, *zCmd, *zRelay; |
| 64 | 64 | int iCutoff; |
| 65 | + double rDigest; | |
| 65 | 66 | @ <tr><th>Outgoing Email:</th><td> |
| 66 | 67 | if( fossil_strcmp(zDest,"pipe")==0 |
| 67 | 68 | && (zCmd = db_get("email-send-command",0))!=0 |
| 68 | 69 | ){ |
| 69 | 70 | @ Piped to command "%h(zCmd)" |
| @@ -117,10 +118,20 @@ | ||
| 117 | 118 | nASub = db_int(0, "SELECT count(*) FROM subscriber WHERE sverified" |
| 118 | 119 | " AND NOT sdonotcall AND length(ssub)>1" |
| 119 | 120 | " AND lastContact>=%d;", iCutoff); |
| 120 | 121 | @ %,d(nASub) active, %,d(nSub) total |
| 121 | 122 | @ </td></tr> |
| 123 | + rDigest = db_double(-1.0, "SELECT (julianday('now') - value)*24.0" | |
| 124 | + " FROM config WHERE name='email-last-digest'"); | |
| 125 | + if( rDigest>0.0 ){ | |
| 126 | + @ <tr><th>Last Digest:</th><td>Approximately \ | |
| 127 | + if( rDigest>48.0 ){ | |
| 128 | + @ %.1f(rDigest/24.0) days ago</td> | |
| 129 | + }else{ | |
| 130 | + @ %.1f(rDigest) hours ago</td> | |
| 131 | + } | |
| 132 | + } | |
| 122 | 133 | } |
| 123 | 134 | |
| 124 | 135 | /* |
| 125 | 136 | ** WEBPAGE: stat |
| 126 | 137 | ** |
| 127 | 138 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -60,10 +60,11 @@ | |
| 60 | void stats_for_email(void){ |
| 61 | const char *zDest = db_get("email-send-method",0); |
| 62 | int nSub, nASub, nPend, nDPend; |
| 63 | const char *zDir, *zDb, *zCmd, *zRelay; |
| 64 | int iCutoff; |
| 65 | @ <tr><th>Outgoing Email:</th><td> |
| 66 | if( fossil_strcmp(zDest,"pipe")==0 |
| 67 | && (zCmd = db_get("email-send-command",0))!=0 |
| 68 | ){ |
| 69 | @ Piped to command "%h(zCmd)" |
| @@ -117,10 +118,20 @@ | |
| 117 | nASub = db_int(0, "SELECT count(*) FROM subscriber WHERE sverified" |
| 118 | " AND NOT sdonotcall AND length(ssub)>1" |
| 119 | " AND lastContact>=%d;", iCutoff); |
| 120 | @ %,d(nASub) active, %,d(nSub) total |
| 121 | @ </td></tr> |
| 122 | } |
| 123 | |
| 124 | /* |
| 125 | ** WEBPAGE: stat |
| 126 | ** |
| 127 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -60,10 +60,11 @@ | |
| 60 | void stats_for_email(void){ |
| 61 | const char *zDest = db_get("email-send-method",0); |
| 62 | int nSub, nASub, nPend, nDPend; |
| 63 | const char *zDir, *zDb, *zCmd, *zRelay; |
| 64 | int iCutoff; |
| 65 | double rDigest; |
| 66 | @ <tr><th>Outgoing Email:</th><td> |
| 67 | if( fossil_strcmp(zDest,"pipe")==0 |
| 68 | && (zCmd = db_get("email-send-command",0))!=0 |
| 69 | ){ |
| 70 | @ Piped to command "%h(zCmd)" |
| @@ -117,10 +118,20 @@ | |
| 118 | nASub = db_int(0, "SELECT count(*) FROM subscriber WHERE sverified" |
| 119 | " AND NOT sdonotcall AND length(ssub)>1" |
| 120 | " AND lastContact>=%d;", iCutoff); |
| 121 | @ %,d(nASub) active, %,d(nSub) total |
| 122 | @ </td></tr> |
| 123 | rDigest = db_double(-1.0, "SELECT (julianday('now') - value)*24.0" |
| 124 | " FROM config WHERE name='email-last-digest'"); |
| 125 | if( rDigest>0.0 ){ |
| 126 | @ <tr><th>Last Digest:</th><td>Approximately \ |
| 127 | if( rDigest>48.0 ){ |
| 128 | @ %.1f(rDigest/24.0) days ago</td> |
| 129 | }else{ |
| 130 | @ %.1f(rDigest) hours ago</td> |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | /* |
| 136 | ** WEBPAGE: stat |
| 137 | ** |
| 138 |