Fossil

Check-in [1d3dd1d9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:1d3dd1d917acdae7f6e210fdce7176b614167637cd99a6fd551650768122b571
User & Date: wyoung 2018-09-26 18:39:20
Context
2018-09-26
18:45
"New Message" -> "New Thread" in forum. check-in: e11d3917 user: wyoung tags: trunk
18:39
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. check-in: 1d3dd1d9 user: wyoung tags: trunk
14:04
Enable the chronological forum display for all users able to read the forum. Make chronological the default display mode for mobile devices, as determined by the user-agent string. check-in: c720327a user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/alerts.c.

2424
2425
2426
2427
2428
2429
2430
2431

2432

2433
2434
2435
2436
2437
2438

2439
2440
2441
2442
2443
2444
2445
    const char *zEmail = db_column_text(&q, 1);
    const char *zCap = db_column_text(&q, 3);
    int nHit = 0;
    for(p=pEvents; p; p=p->pNext){
      if( strchr(zSub,p->type)==0 ) continue;
      if( p->needMod ){
        /* For events that require moderator approval, only send an alert
        ** if the recipient is a moderator for that type of event */

        char xType = '*';

        switch( p->type ){
          case 'f':  xType = '5';  break;
          case 't':  xType = 'q';  break;
          case 'w':  xType = 'l';  break;
        }
        if( strchr(zCap,xType)==0 ) continue;

      }else if( strchr(zCap,'s')!=0 || strchr(zCap,'a')!=0 ){
        /* Setup and admin users can get any notification that does not
        ** require moderation */
      }else{
        /* Other users only see the alert if they have sufficient
        ** privilege to view the event itself */
        char xType = '*';







|
>

>
|
|
|
|
|
|
>







2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
    const char *zEmail = db_column_text(&q, 1);
    const char *zCap = db_column_text(&q, 3);
    int nHit = 0;
    for(p=pEvents; p; p=p->pNext){
      if( strchr(zSub,p->type)==0 ) continue;
      if( p->needMod ){
        /* For events that require moderator approval, only send an alert
        ** if the recipient is a moderator for that type of event.  Setup
        ** and Admin users always get notified. */
        char xType = '*';
        if( strpbrk(zCap,"as")==0 ){
          switch( p->type ){
            case 'f':  xType = '5';  break;
            case 't':  xType = 'q';  break;
            case 'w':  xType = 'l';  break;
          }
          if( strchr(zCap,xType)==0 ) continue;
        }
      }else if( strchr(zCap,'s')!=0 || strchr(zCap,'a')!=0 ){
        /* Setup and admin users can get any notification that does not
        ** require moderation */
      }else{
        /* Other users only see the alert if they have sufficient
        ** privilege to view the event itself */
        char xType = '*';