Fossil SCM
Skip private forum posts in both CLI and web RSS feeds.
Commit
647c424f405f14f975bb549163acf2b98ff02cf82fe532cd5348fb5209afb697
Parent
2b9f8fbb7aab99a…
1 file changed
+17
-9
+17
-9
| --- src/rss.c | ||
| +++ src/rss.c | ||
| @@ -220,20 +220,19 @@ | ||
| 220 | 220 | Blob *pOut, |
| 221 | 221 | char **pzAltLink, |
| 222 | 222 | int rid, |
| 223 | 223 | const char *zEType, |
| 224 | 224 | const char *zBase, |
| 225 | - const char *zTop, | |
| 226 | - int bFilterPrivate | |
| 225 | + const char *zTop | |
| 227 | 226 | ){ |
| 228 | 227 | Manifest *pPost = 0; |
| 229 | 228 | int rc = 0; |
| 230 | 229 | Blob normalized = BLOB_INITIALIZER; |
| 231 | 230 | if( pzAltLink ) *pzAltLink = 0; |
| 232 | 231 | if( pOut==0 || zEType==0 ) return 0; |
| 233 | 232 | if( zEType[0]=='f' ){ |
| 234 | - if( bFilterPrivate && content_is_private(rid) ) return -1; | |
| 233 | + if( content_is_private(rid) ) return -1; | |
| 235 | 234 | pPost = manifest_get(rid, CFTYPE_FORUM, 0); |
| 236 | 235 | if( pPost ){ |
| 237 | 236 | forum_render_to_html(pOut, pPost->zMimetype, pPost->zWiki); |
| 238 | 237 | } |
| 239 | 238 | }else if( zEType[0]=='e' ){ |
| @@ -480,16 +479,18 @@ | ||
| 480 | 479 | if( zTagList ){ |
| 481 | 480 | zSuffix = mprintf(" (tags: %s)", zTagList); |
| 482 | 481 | } |
| 483 | 482 | |
| 484 | 483 | bHasContent = rss_render_item_html(&contentHtml, &zTechnoteId, rid, zEType, |
| 485 | - blob_str(&base), blob_str(&top), | |
| 486 | - !g.perm.ModForum); | |
| 484 | + blob_str(&base), blob_str(&top)); | |
| 487 | 485 | if( bHasContent<0 ){ |
| 488 | - free(zDate); | |
| 489 | - free(zSuffix); | |
| 490 | - continue; | |
| 486 | + if( zEType[0]=='f' && !g.perm.ModForum ){ | |
| 487 | + free(zDate); | |
| 488 | + free(zSuffix); | |
| 489 | + continue; | |
| 490 | + } | |
| 491 | + bHasContent = 0; | |
| 491 | 492 | } |
| 492 | 493 | @ <item> |
| 493 | 494 | @ <title>%s(zPrefix)%h(zCom)%h(zSuffix)</title> |
| 494 | 495 | if( zTechnoteId!=0 ){ |
| 495 | 496 | @ <link>%s(g.zBaseURL)/info/%s(zTechnoteId)</link> |
| @@ -723,11 +724,18 @@ | ||
| 723 | 724 | if( zTagList ){ |
| 724 | 725 | zSuffix = mprintf(" (tags: %s)", zTagList); |
| 725 | 726 | } |
| 726 | 727 | |
| 727 | 728 | bHasContent = rss_render_item_html(&contentHtml, &zTechnoteId, rid, zEType, |
| 728 | - blob_str(&base), blob_str(&top), 0); | |
| 729 | + blob_str(&base), blob_str(&top)); | |
| 730 | + if( bHasContent<0 ){ | |
| 731 | + free(zTechnoteId); | |
| 732 | + blob_reset(&contentHtml); | |
| 733 | + free(zDate); | |
| 734 | + free(zSuffix); | |
| 735 | + continue; | |
| 736 | + } | |
| 729 | 737 | fossil_print("<item>"); |
| 730 | 738 | fossil_print("<title>%s%h%h</title>\n", zPrefix, zCom, zSuffix); |
| 731 | 739 | if( zTechnoteId!=0 ){ |
| 732 | 740 | fossil_print("<link>%s/info/%s</link>\n", zBaseURL, zTechnoteId); |
| 733 | 741 | }else{ |
| 734 | 742 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -220,20 +220,19 @@ | |
| 220 | Blob *pOut, |
| 221 | char **pzAltLink, |
| 222 | int rid, |
| 223 | const char *zEType, |
| 224 | const char *zBase, |
| 225 | const char *zTop, |
| 226 | int bFilterPrivate |
| 227 | ){ |
| 228 | Manifest *pPost = 0; |
| 229 | int rc = 0; |
| 230 | Blob normalized = BLOB_INITIALIZER; |
| 231 | if( pzAltLink ) *pzAltLink = 0; |
| 232 | if( pOut==0 || zEType==0 ) return 0; |
| 233 | if( zEType[0]=='f' ){ |
| 234 | if( bFilterPrivate && content_is_private(rid) ) return -1; |
| 235 | pPost = manifest_get(rid, CFTYPE_FORUM, 0); |
| 236 | if( pPost ){ |
| 237 | forum_render_to_html(pOut, pPost->zMimetype, pPost->zWiki); |
| 238 | } |
| 239 | }else if( zEType[0]=='e' ){ |
| @@ -480,16 +479,18 @@ | |
| 480 | if( zTagList ){ |
| 481 | zSuffix = mprintf(" (tags: %s)", zTagList); |
| 482 | } |
| 483 | |
| 484 | bHasContent = rss_render_item_html(&contentHtml, &zTechnoteId, rid, zEType, |
| 485 | blob_str(&base), blob_str(&top), |
| 486 | !g.perm.ModForum); |
| 487 | if( bHasContent<0 ){ |
| 488 | free(zDate); |
| 489 | free(zSuffix); |
| 490 | continue; |
| 491 | } |
| 492 | @ <item> |
| 493 | @ <title>%s(zPrefix)%h(zCom)%h(zSuffix)</title> |
| 494 | if( zTechnoteId!=0 ){ |
| 495 | @ <link>%s(g.zBaseURL)/info/%s(zTechnoteId)</link> |
| @@ -723,11 +724,18 @@ | |
| 723 | if( zTagList ){ |
| 724 | zSuffix = mprintf(" (tags: %s)", zTagList); |
| 725 | } |
| 726 | |
| 727 | bHasContent = rss_render_item_html(&contentHtml, &zTechnoteId, rid, zEType, |
| 728 | blob_str(&base), blob_str(&top), 0); |
| 729 | fossil_print("<item>"); |
| 730 | fossil_print("<title>%s%h%h</title>\n", zPrefix, zCom, zSuffix); |
| 731 | if( zTechnoteId!=0 ){ |
| 732 | fossil_print("<link>%s/info/%s</link>\n", zBaseURL, zTechnoteId); |
| 733 | }else{ |
| 734 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -220,20 +220,19 @@ | |
| 220 | Blob *pOut, |
| 221 | char **pzAltLink, |
| 222 | int rid, |
| 223 | const char *zEType, |
| 224 | const char *zBase, |
| 225 | const char *zTop |
| 226 | ){ |
| 227 | Manifest *pPost = 0; |
| 228 | int rc = 0; |
| 229 | Blob normalized = BLOB_INITIALIZER; |
| 230 | if( pzAltLink ) *pzAltLink = 0; |
| 231 | if( pOut==0 || zEType==0 ) return 0; |
| 232 | if( zEType[0]=='f' ){ |
| 233 | if( content_is_private(rid) ) return -1; |
| 234 | pPost = manifest_get(rid, CFTYPE_FORUM, 0); |
| 235 | if( pPost ){ |
| 236 | forum_render_to_html(pOut, pPost->zMimetype, pPost->zWiki); |
| 237 | } |
| 238 | }else if( zEType[0]=='e' ){ |
| @@ -480,16 +479,18 @@ | |
| 479 | if( zTagList ){ |
| 480 | zSuffix = mprintf(" (tags: %s)", zTagList); |
| 481 | } |
| 482 | |
| 483 | bHasContent = rss_render_item_html(&contentHtml, &zTechnoteId, rid, zEType, |
| 484 | blob_str(&base), blob_str(&top)); |
| 485 | if( bHasContent<0 ){ |
| 486 | if( zEType[0]=='f' && !g.perm.ModForum ){ |
| 487 | free(zDate); |
| 488 | free(zSuffix); |
| 489 | continue; |
| 490 | } |
| 491 | bHasContent = 0; |
| 492 | } |
| 493 | @ <item> |
| 494 | @ <title>%s(zPrefix)%h(zCom)%h(zSuffix)</title> |
| 495 | if( zTechnoteId!=0 ){ |
| 496 | @ <link>%s(g.zBaseURL)/info/%s(zTechnoteId)</link> |
| @@ -723,11 +724,18 @@ | |
| 724 | if( zTagList ){ |
| 725 | zSuffix = mprintf(" (tags: %s)", zTagList); |
| 726 | } |
| 727 | |
| 728 | bHasContent = rss_render_item_html(&contentHtml, &zTechnoteId, rid, zEType, |
| 729 | blob_str(&base), blob_str(&top)); |
| 730 | if( bHasContent<0 ){ |
| 731 | free(zTechnoteId); |
| 732 | blob_reset(&contentHtml); |
| 733 | free(zDate); |
| 734 | free(zSuffix); |
| 735 | continue; |
| 736 | } |
| 737 | fossil_print("<item>"); |
| 738 | fossil_print("<title>%s%h%h</title>\n", zPrefix, zCom, zSuffix); |
| 739 | if( zTechnoteId!=0 ){ |
| 740 | fossil_print("<link>%s/info/%s</link>\n", zBaseURL, zTechnoteId); |
| 741 | }else{ |
| 742 |