4 * Server-side functions which handle message moderation.
16 #include <sys/types.h>
24 #include "sysdep_decls.h"
25 #include "citserver.h"
29 #include "dynloader.h"
42 void cmd_mmod(char *argbuf) {
45 struct SuppMsgInfo smi;
46 int is_message_in_room;
48 /* user must be at least a Room Aide to moderate */
49 if (CtdlAccessCheck(ac_room_aide)) return;
51 msgnum = extract_long(argbuf, 0);
52 newlevel = extract_int(argbuf, 1);
54 if ( (newlevel < (-63)) || (newlevel > (+63)) ) {
55 cprintf("%d %d is not a valid moderation level.\n",
56 ERROR+ILLEGAL_VALUE, newlevel);
60 is_message_in_room = CtdlForEachMessage(MSGS_EQ, msgnum, (-127),
61 NULL, NULL, NULL, NULL);
62 if (!is_message_in_room) {
63 cprintf("%d Message %ld is not in this room.\n",
64 ERROR+ILLEGAL_VALUE, msgnum);
68 GetSuppMsgInfo(&smi, msgnum);
69 smi.smi_mod = newlevel;
72 cprintf("%d Message %ld is moderated to %d\n", OK, msgnum, newlevel);
76 char *Dynamic_Module_Init(void)
78 CtdlRegisterProtoHook(cmd_mmod, "MMOD", "Moderate a message");