finn@lemmy.world to Fediverse@lemmy.worldEnglish · 2 years agoDecentralization Revolution: Reclaiming the Internet's True Vision from Big Tech's Grasplemmy.worldimagemessage-square21fedilinkarrow-up1132arrow-down11 cross-posted to: [email protected]
arrow-up1131arrow-down1imageDecentralization Revolution: Reclaiming the Internet's True Vision from Big Tech's Grasplemmy.worldfinn@lemmy.world to Fediverse@lemmy.worldEnglish · 2 years agomessage-square21fedilink cross-posted to: [email protected]
minus-squarepnpbios@lemmy.worldlinkfedilinkEnglisharrow-up0arrow-down1·2 years agoI think there should be a middleware layer for posts and comments, where you can write a number of custom routines. func onNewPost( (user, post, commitFn, rejectFn) => { if( user.karma < 100) {rejectFn("Not enough karma to post here.")} if( post.length < 100) {rejectFn("Post is too short.")} commitFn(user, post); });
I think there should be a middleware layer for posts and comments, where you can write a number of custom routines.
func onNewPost( (user, post, commitFn, rejectFn) => { if( user.karma < 100) {rejectFn("Not enough karma to post here.")} if( post.length < 100) {rejectFn("Post is too short.")} commitFn(user, post); });