Fossil SCM

Bug fixes in the alert sending backoffice task. Hopefully this will start sending email notifications to people correctly.

drh 2023-12-13 18:50 trunk
Commit 2917bedadae3827c7fdb9e3c37ef4d69fe34fcdbdc1a5a482d13d315b9d1b798
1 file changed +4 -3
+4 -3
--- src/alerts.c
+++ src/alerts.c
@@ -3089,27 +3089,28 @@
30893089
" suname" /* 4 */
30903090
" FROM subscriber LEFT JOIN user ON (login=suname)"
30913091
" WHERE sverified"
30923092
" AND NOT sdonotcall"
30933093
" AND sdigest IS %s"
3094
- " AND coalesce(subscriber.lastContact,subscriber.mtime)>=%d",
3094
+ " AND coalesce(subscriber.lastContact*86400,subscriber.mtime)>=%d",
30953095
zDigest/*safe-for-%s*/,
30963096
db_get_int("email-renew-cutoff",0)
30973097
);
30983098
while( db_step(&q)==SQLITE_ROW ){
30993099
const char *zCode = db_column_text(&q, 0);
31003100
const char *zSub = db_column_text(&q, 2);
31013101
const char *zEmail = db_column_text(&q, 1);
31023102
const char *zCap = db_column_text(&q, 3);
3103
+ const char *zUser = db_column_text(&q, 4);
31033104
int nHit = 0;
31043105
for(p=pEvents; p; p=p->pNext){
31053106
if( strchr(zSub,p->type)==0 ){
31063107
if( p->type!='f' ) continue;
31073108
if( strchr(zSub,'n')!=0 && (p->zPriors==0 || p->zPriors[0]==0) ){
31083109
/* New post: accepted */
3109
- }else if( strchr(zSub,'r')!=0
3110
- && alert_in_priors(db_column_text(&q,4), p->zPriors) ){
3110
+ }else if( strchr(zSub,'r')!=0 && zUser!=0
3111
+ && alert_in_priors(zUser, p->zPriors) ){
31113112
/* A follow-up to a post written by the user: accept */
31123113
}else{
31133114
continue;
31143115
}
31153116
}
31163117
--- src/alerts.c
+++ src/alerts.c
@@ -3089,27 +3089,28 @@
3089 " suname" /* 4 */
3090 " FROM subscriber LEFT JOIN user ON (login=suname)"
3091 " WHERE sverified"
3092 " AND NOT sdonotcall"
3093 " AND sdigest IS %s"
3094 " AND coalesce(subscriber.lastContact,subscriber.mtime)>=%d",
3095 zDigest/*safe-for-%s*/,
3096 db_get_int("email-renew-cutoff",0)
3097 );
3098 while( db_step(&q)==SQLITE_ROW ){
3099 const char *zCode = db_column_text(&q, 0);
3100 const char *zSub = db_column_text(&q, 2);
3101 const char *zEmail = db_column_text(&q, 1);
3102 const char *zCap = db_column_text(&q, 3);
 
3103 int nHit = 0;
3104 for(p=pEvents; p; p=p->pNext){
3105 if( strchr(zSub,p->type)==0 ){
3106 if( p->type!='f' ) continue;
3107 if( strchr(zSub,'n')!=0 && (p->zPriors==0 || p->zPriors[0]==0) ){
3108 /* New post: accepted */
3109 }else if( strchr(zSub,'r')!=0
3110 && alert_in_priors(db_column_text(&q,4), p->zPriors) ){
3111 /* A follow-up to a post written by the user: accept */
3112 }else{
3113 continue;
3114 }
3115 }
3116
--- src/alerts.c
+++ src/alerts.c
@@ -3089,27 +3089,28 @@
3089 " suname" /* 4 */
3090 " FROM subscriber LEFT JOIN user ON (login=suname)"
3091 " WHERE sverified"
3092 " AND NOT sdonotcall"
3093 " AND sdigest IS %s"
3094 " AND coalesce(subscriber.lastContact*86400,subscriber.mtime)>=%d",
3095 zDigest/*safe-for-%s*/,
3096 db_get_int("email-renew-cutoff",0)
3097 );
3098 while( db_step(&q)==SQLITE_ROW ){
3099 const char *zCode = db_column_text(&q, 0);
3100 const char *zSub = db_column_text(&q, 2);
3101 const char *zEmail = db_column_text(&q, 1);
3102 const char *zCap = db_column_text(&q, 3);
3103 const char *zUser = db_column_text(&q, 4);
3104 int nHit = 0;
3105 for(p=pEvents; p; p=p->pNext){
3106 if( strchr(zSub,p->type)==0 ){
3107 if( p->type!='f' ) continue;
3108 if( strchr(zSub,'n')!=0 && (p->zPriors==0 || p->zPriors[0]==0) ){
3109 /* New post: accepted */
3110 }else if( strchr(zSub,'r')!=0 && zUser!=0
3111 && alert_in_priors(zUser, p->zPriors) ){
3112 /* A follow-up to a post written by the user: accept */
3113 }else{
3114 continue;
3115 }
3116 }
3117

Keyboard Shortcuts

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