Fossil SCM

Setup and Admin users that are in the subscriber table were getting email alerts only if they had explicit moderator capabilities set. Those with bare "s" or "a" weren't getting notified.

wyoung 2018-09-26 18:39 trunk
Commit 1d3dd1d917acdae7f6e210fdce7176b614167637cd99a6fd551650768122b571
1 file changed +9 -6
+9 -6
--- src/alerts.c
+++ src/alerts.c
@@ -2426,18 +2426,21 @@
24262426
int nHit = 0;
24272427
for(p=pEvents; p; p=p->pNext){
24282428
if( strchr(zSub,p->type)==0 ) continue;
24292429
if( p->needMod ){
24302430
/* For events that require moderator approval, only send an alert
2431
- ** if the recipient is a moderator for that type of event */
2431
+ ** if the recipient is a moderator for that type of event. Setup
2432
+ ** and Admin users always get notified. */
24322433
char xType = '*';
2433
- switch( p->type ){
2434
- case 'f': xType = '5'; break;
2435
- case 't': xType = 'q'; break;
2436
- case 'w': xType = 'l'; break;
2434
+ if( strpbrk(zCap,"as")==0 ){
2435
+ switch( p->type ){
2436
+ case 'f': xType = '5'; break;
2437
+ case 't': xType = 'q'; break;
2438
+ case 'w': xType = 'l'; break;
2439
+ }
2440
+ if( strchr(zCap,xType)==0 ) continue;
24372441
}
2438
- if( strchr(zCap,xType)==0 ) continue;
24392442
}else if( strchr(zCap,'s')!=0 || strchr(zCap,'a')!=0 ){
24402443
/* Setup and admin users can get any notification that does not
24412444
** require moderation */
24422445
}else{
24432446
/* Other users only see the alert if they have sufficient
24442447
--- src/alerts.c
+++ src/alerts.c
@@ -2426,18 +2426,21 @@
2426 int nHit = 0;
2427 for(p=pEvents; p; p=p->pNext){
2428 if( strchr(zSub,p->type)==0 ) continue;
2429 if( p->needMod ){
2430 /* For events that require moderator approval, only send an alert
2431 ** if the recipient is a moderator for that type of event */
 
2432 char xType = '*';
2433 switch( p->type ){
2434 case 'f': xType = '5'; break;
2435 case 't': xType = 'q'; break;
2436 case 'w': xType = 'l'; break;
 
 
 
2437 }
2438 if( strchr(zCap,xType)==0 ) continue;
2439 }else if( strchr(zCap,'s')!=0 || strchr(zCap,'a')!=0 ){
2440 /* Setup and admin users can get any notification that does not
2441 ** require moderation */
2442 }else{
2443 /* Other users only see the alert if they have sufficient
2444
--- src/alerts.c
+++ src/alerts.c
@@ -2426,18 +2426,21 @@
2426 int nHit = 0;
2427 for(p=pEvents; p; p=p->pNext){
2428 if( strchr(zSub,p->type)==0 ) continue;
2429 if( p->needMod ){
2430 /* For events that require moderator approval, only send an alert
2431 ** if the recipient is a moderator for that type of event. Setup
2432 ** and Admin users always get notified. */
2433 char xType = '*';
2434 if( strpbrk(zCap,"as")==0 ){
2435 switch( p->type ){
2436 case 'f': xType = '5'; break;
2437 case 't': xType = 'q'; break;
2438 case 'w': xType = 'l'; break;
2439 }
2440 if( strchr(zCap,xType)==0 ) continue;
2441 }
 
2442 }else if( strchr(zCap,'s')!=0 || strchr(zCap,'a')!=0 ){
2443 /* Setup and admin users can get any notification that does not
2444 ** require moderation */
2445 }else{
2446 /* Other users only see the alert if they have sufficient
2447

Keyboard Shortcuts

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