Fossil SCM

Do not show the status-change control in the forum if the post is still pending moderation, as setting the status then will tag an artifact which will be deleted if moderation rejects the post.

stephan 2026-06-03 14:15 UTC trunk
Commit 449bb3bc6ed37f38d67cb1432f6b708c7563bb4c74f2cb8ccec126c78a5d378a
1 file changed +1
--- src/forum.c
+++ src/forum.c
@@ -865,10 +865,11 @@
865865
/*
866866
** Returns true if the current user is authorized to set forum post
867867
** fpid's status.
868868
*/
869869
static int forum_may_set_status(int fpid){
870
+ if( moderation_pending(fpid) ) return 0;
870871
return g.perm.Admin
871872
|| g.perm.ModForum
872873
|| (login_is_individual()
873874
&& forumpost_is_owner(fpid, 0));
874875
}
875876
--- src/forum.c
+++ src/forum.c
@@ -865,10 +865,11 @@
865 /*
866 ** Returns true if the current user is authorized to set forum post
867 ** fpid's status.
868 */
869 static int forum_may_set_status(int fpid){
 
870 return g.perm.Admin
871 || g.perm.ModForum
872 || (login_is_individual()
873 && forumpost_is_owner(fpid, 0));
874 }
875
--- src/forum.c
+++ src/forum.c
@@ -865,10 +865,11 @@
865 /*
866 ** Returns true if the current user is authorized to set forum post
867 ** fpid's status.
868 */
869 static int forum_may_set_status(int fpid){
870 if( moderation_pending(fpid) ) return 0;
871 return g.perm.Admin
872 || g.perm.ModForum
873 || (login_is_individual()
874 && forumpost_is_owner(fpid, 0));
875 }
876

Keyboard Shortcuts

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