Fossil SCM
Bug fixes in the alert sending backoffice task. Hopefully this will start sending email notifications to people correctly.
Commit
2917bedadae3827c7fdb9e3c37ef4d69fe34fcdbdc1a5a482d13d315b9d1b798
Parent
6b025921965a7ee…
1 file changed
+4
-3
+4
-3
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -3089,27 +3089,28 @@ | ||
| 3089 | 3089 | " suname" /* 4 */ |
| 3090 | 3090 | " FROM subscriber LEFT JOIN user ON (login=suname)" |
| 3091 | 3091 | " WHERE sverified" |
| 3092 | 3092 | " AND NOT sdonotcall" |
| 3093 | 3093 | " AND sdigest IS %s" |
| 3094 | - " AND coalesce(subscriber.lastContact,subscriber.mtime)>=%d", | |
| 3094 | + " AND coalesce(subscriber.lastContact*86400,subscriber.mtime)>=%d", | |
| 3095 | 3095 | zDigest/*safe-for-%s*/, |
| 3096 | 3096 | db_get_int("email-renew-cutoff",0) |
| 3097 | 3097 | ); |
| 3098 | 3098 | while( db_step(&q)==SQLITE_ROW ){ |
| 3099 | 3099 | const char *zCode = db_column_text(&q, 0); |
| 3100 | 3100 | const char *zSub = db_column_text(&q, 2); |
| 3101 | 3101 | const char *zEmail = db_column_text(&q, 1); |
| 3102 | 3102 | const char *zCap = db_column_text(&q, 3); |
| 3103 | + const char *zUser = db_column_text(&q, 4); | |
| 3103 | 3104 | int nHit = 0; |
| 3104 | 3105 | for(p=pEvents; p; p=p->pNext){ |
| 3105 | 3106 | if( strchr(zSub,p->type)==0 ){ |
| 3106 | 3107 | if( p->type!='f' ) continue; |
| 3107 | 3108 | if( strchr(zSub,'n')!=0 && (p->zPriors==0 || p->zPriors[0]==0) ){ |
| 3108 | 3109 | /* 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) ){ | |
| 3111 | 3112 | /* A follow-up to a post written by the user: accept */ |
| 3112 | 3113 | }else{ |
| 3113 | 3114 | continue; |
| 3114 | 3115 | } |
| 3115 | 3116 | } |
| 3116 | 3117 |
| --- 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 |