X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=c7a120f457ef018acfaf4c50aca08122ce798a4e;hb=389a466b184940620c9aef0e3d06f0c458015aa3;hp=c252f5ff0d4b57f643c2dfd5046eae96dafda2a2;hpb=6feba01910d1fa3e1ce5ec232bce54aaf900cd6f;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index c252f5ff0..c7a120f45 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -3939,30 +3939,36 @@ int CtdlDoIHavePermissionToPostInThisRoom( if ((CC->user.axlevel < AxProbU) && ((CC->room.QRflags & QR_MAILBOX) == 0)) { - snprintf(errmsgbuf, n, "Need to be validated to enter " - "(except in %s> to sysop)", MAILROOM); + snprintf(errmsgbuf, n, "Need to be validated to enter (except in %s> to sysop)", MAILROOM); return (ERROR + HIGHER_ACCESS_REQUIRED); } CtdlRoomAccess(&CC->room, &CC->user, &ra, NULL); - if ( (!(ra & UA_POSTALLOWED)) && (ra & UA_REPLYALLOWED) && (!is_reply) ) { + if (ra & UA_POSTALLOWED) { + strcpy(errmsgbuf, "OK to post or reply here"); + return(0); + } + + if ( (ra & UA_REPLYALLOWED) && (is_reply) ) { /* * To be thorough, we ought to check to see if the message they are * replying to is actually a valid one in this room, but unless this * actually becomes a problem we'll go with high performance instead. */ - snprintf(errmsgbuf, n, "You may only reply to existing messages here."); - return (ERROR + HIGHER_ACCESS_REQUIRED); + strcpy(errmsgbuf, "OK to reply here"); + return(0); } - else if (!(ra & UA_POSTALLOWED)) { - snprintf(errmsgbuf, n, "Higher access is required to post in this room."); + if ( (ra & UA_REPLYALLOWED) && (!is_reply) ) { + /* Clarify what happened with a better error message */ + snprintf(errmsgbuf, n, "You may only reply to existing messages here."); return (ERROR + HIGHER_ACCESS_REQUIRED); } - strcpy(errmsgbuf, "Ok"); - return(0); + snprintf(errmsgbuf, n, "Higher access is required to post in this room."); + return (ERROR + HIGHER_ACCESS_REQUIRED); + }