Fossil SCM

Show the time of the most recent digest on the email notification status.

drh 2021-06-08 18:20 trunk
Commit d34a8a2cd1c32c556d2ffe37a736551b38abd5b0961957103f7856aec3c1c8bc
1 file changed +11
+11
--- src/stat.c
+++ src/stat.c
@@ -60,10 +60,11 @@
6060
void stats_for_email(void){
6161
const char *zDest = db_get("email-send-method",0);
6262
int nSub, nASub, nPend, nDPend;
6363
const char *zDir, *zDb, *zCmd, *zRelay;
6464
int iCutoff;
65
+ double rDigest;
6566
@ <tr><th>Outgoing&nbsp;Email:</th><td>
6667
if( fossil_strcmp(zDest,"pipe")==0
6768
&& (zCmd = db_get("email-send-command",0))!=0
6869
){
6970
@ Piped to command "%h(zCmd)"
@@ -117,10 +118,20 @@
117118
nASub = db_int(0, "SELECT count(*) FROM subscriber WHERE sverified"
118119
" AND NOT sdonotcall AND length(ssub)>1"
119120
" AND lastContact>=%d;", iCutoff);
120121
@ %,d(nASub) active, %,d(nSub) total
121122
@ </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
+ }
122133
}
123134
124135
/*
125136
** WEBPAGE: stat
126137
**
127138
--- 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&nbsp;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&nbsp;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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button