-/*
- * Server functions which perform operations on room objects.
- *
- * Copyright (c) 1987-2021 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+// Server functions which perform operations on room objects.
+//
+// Copyright (c) 1987-2022 by the citadel.org team
+//
+// This program is open source software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 3.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
-/*
- * Determine whether the currently logged in session has permission to read
- * messages in the current room.
- */
+// Determine whether the currently logged in session has permission to read
+// messages in the current room.
-/*
- * Check to see whether we have permission to post a message in the current
- * room. Returns a *CITADEL ERROR CODE* and puts a message in errmsgbuf, or
- * returns 0 on success.
- */
+// Check to see whether we have permission to post a message in the current
+// room. Returns a *CITADEL ERROR CODE* and puts a message in errmsgbuf, or
+// returns 0 on success.
- /*
- * 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.
- */
+ // 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.
strcpy(errmsgbuf, "OK to reply here");
return(0);
}
if ( (ra & UA_REPLYALLOWED) && (!is_reply) ) {
strcpy(errmsgbuf, "OK to reply here");
return(0);
}
if ( (ra & UA_REPLYALLOWED) && (!is_reply) ) {
snprintf(errmsgbuf, n, "You may only reply to existing messages here.");
return (ERROR + HIGHER_ACCESS_REQUIRED);
}
snprintf(errmsgbuf, n, "You may only reply to existing messages here.");
return (ERROR + HIGHER_ACCESS_REQUIRED);
}
-
- /* User is allowed to post in the room unless:
- * - User is not validated
- * - User has no net privileges and it is a shared network room
- * - It is a read-only room
- * - It is a blog room (in which case we only allow replies to existing messages)
- */
+ // User is allowed to post in the room unless:
+ // - User is not validated
+ // - User has no net privileges and it is a shared network room
+ // - It is a read-only room
+ // - It is a blog room (in which case we only allow replies to existing messages)
- /* If "collaborative deletion" is active for this room, any user who can post
- * is also allowed to delete
- */
+ // If "collaborative deletion" is active for this room, any user who can post
+ // is also allowed to delete
if (roombuf->QRflags2 & QR2_COLLABDEL) {
if (retval & UA_POSTALLOWED) {
retval = retval | UA_DELETEALLOWED;
if (roombuf->QRflags2 & QR2_COLLABDEL) {
if (retval & UA_POSTALLOWED) {
retval = retval | UA_DELETEALLOWED;
if ( (userbuf->axlevel >= AxAideU)
&& (roombuf->QRflags & QR_MAILBOX)
) {
retval = retval | UA_GOTOALLOWED | UA_POSTALLOWED | UA_REPLYALLOWED;
}
if ( (userbuf->axlevel >= AxAideU)
&& (roombuf->QRflags & QR_MAILBOX)
) {
retval = retval | UA_GOTOALLOWED | UA_POSTALLOWED | UA_REPLYALLOWED;
}
/*
* Make the specified room the current room for this session. No validation
* or access control is done here -- the caller should make sure that the
/*
* Make the specified room the current room for this session. No validation
* or access control is done here -- the caller should make sure that the
netcfg_keyname(configdbkeyname, qrbuf->QRnumber);
CtdlDelConfig(configdbkeyname);
netcfg_keyname(configdbkeyname, qrbuf->QRnumber);
CtdlDelConfig(configdbkeyname);
CtdlDeleteMessages(qrbuf->QRname, NULL, 0, "");
CtdlDeleteMessages(qrbuf->QRname, NULL, 0, "");
lgetfloor(&flbuf, (int) (qrbuf->QRfloor));
flbuf.f_ref_count = flbuf.f_ref_count - 1;
lputfloor(&flbuf, (int) (qrbuf->QRfloor));
lgetfloor(&flbuf, (int) (qrbuf->QRfloor));
flbuf.f_ref_count = flbuf.f_ref_count - 1;
lputfloor(&flbuf, (int) (qrbuf->QRfloor));