* <Q>uiet mode client side command to set/clear DEXP mode.
* <K>nown rooms list displays through the paginator.
$Log$
+Revision 1.488 2000/03/15 03:04:51 ajc
+* Added DEXP server command to disable incoming express messages.
+* <Q>uiet mode client side command to set/clear DEXP mode.
+* <K>nown rooms list displays through the paginator.
+
Revision 1.487 2000/03/12 00:21:35 ajc
* Removed the semi-broken "chat room" functionality in the chat system, and
replaced it with direct mapping to the actual Citadel room the user is in.
Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Initial CVS import
-
check_message_base();
break;
+ case 84:
+ quiet_mode();
+ break;
+
case 50:
enter_config(2);
break;
cmd=52,0,&.,&Skip ^r^c goto:
cmd=56,0,&Page a user
cmd=58,0,&Mail
+cmd=84,0,&Quiet mode
#
# We implement both <.G>oto and <J>ump commands which do the same thing, in
# order to please a wider audience of users. Remove one if you want to.
+
+void quiet_mode(void) {
+ int qstate;
+ char buf[256];
+
+ serv_puts("DEXP 2");
+ serv_gets(buf);
+ if (buf[0]!='2') {
+ printf("%s\n", &buf[4]);
+ return;
+ }
+ qstate = atoi(&buf[4]);
+ if (qstate == 0) qstate = 1;
+ else qstate = 0;
+ sprintf(buf, "DEXP %d", qstate);
+ serv_puts(buf);
+ serv_gets(buf);
+ if (buf[0]!='2') {
+ printf("%s\n", &buf[4]);
+ return;
+ }
+ qstate = atoi(&buf[4]);
+ if (qstate) {
+ printf("Quiet mode enabled (no other users may page you)\n");
+ }
+ else {
+ printf("Quiet mode disabled (other users may page you)\n");
+ }
+}
/* $Id$ */
void chatmode(void);
void page_user(void);
+void quiet_mode(void);
int pattern(char *search, char *patn);
int file_checksum(char *filename);
int nukedir(char *dirname);
+int checkpagin(int lp, int pagin, int height);
extern unsigned room_flags;
extern char room_name[];
extern char floorlist[128][256];
+int knlinecount;
+
void load_floorlist(void) {
int a;
strcpy(rmname, rp->rlname);
f = rp->rlflags;
if ((c + strlen(rmname) + 4) > screenwidth) {
+
+ /* line break, check the paginator */
printf("\n");
+ knlinecount = knlinecount + 1;
+ knlinecount = checkpagin(knlinecount,
+ ((userflags & US_PAGINATOR) ? 1 : 0),
+ screenheight);
+
c = 1;
}
if (f & QR_MAILBOX) {
int a;
load_floorlist();
+ knlinecount = 0;
if (kn_floor_mode == 0) {
color(BRIGHT_CYAN);
printf("\n Rooms with unread messages:\n");
+ knlinecount = knlinecount + 2;
listrms("LKRN");
color(BRIGHT_CYAN);
printf("\n\n No unseen messages in:\n");
+ knlinecount = knlinecount + 3;
listrms("LKRO");
printf("\n");
+ knlinecount = knlinecount + 1;
}
if (kn_floor_mode == 1) {
color(BRIGHT_CYAN);
printf("\n Rooms with unread messages on %s:\n",
floorlist[(int)curr_floor]);
+ knlinecount = knlinecount + 2;
sprintf(buf,"LKRN %d",curr_floor);
listrms(buf);
color(BRIGHT_CYAN);
printf("\n\n Rooms with no new messages on %s:\n",
floorlist[(int)curr_floor]);
+ knlinecount = knlinecount + 3;
sprintf(buf,"LKRO %d",curr_floor);
listrms(buf);
color(BRIGHT_CYAN);
printf("\n\n Other floors:\n");
+ knlinecount = knlinecount + 3;
list_other_floors();
printf("\n");
+ knlinecount = knlinecount + 1;
}
if (kn_floor_mode == 2) {
for (a=0; a<128; ++a) if (floorlist[a][0]!=0) {
color(BRIGHT_CYAN);
printf("\n Rooms on %s:\n",floorlist[a]);
+ knlinecount = knlinecount + 2;
sprintf(buf,"LKRA %d",a);
listrms(buf);
printf("\n");
+ knlinecount = knlinecount + 1;
}
}
-char *Dynamic_Module_Init(void)
-{
- CtdlRegisterProtoHook(cmd_chat, "CHAT", "Begin real-time chat");
- CtdlRegisterProtoHook(cmd_pexp, "PEXP", "Poll for express messages");
- CtdlRegisterProtoHook(cmd_gexp, "GEXP", "Get express messages");
- CtdlRegisterProtoHook(cmd_sexp, "SEXP", "Send an express message");
- CtdlRegisterSessionHook(delete_express_messages, EVT_STOP);
- CtdlRegisterXmsgHook(send_express_message, XMSG_PRI_LOCAL);
- return "$Id$";
-}
-
void allwrite(char *cmdbuf, int flag, char *username)
{
FILE *fp;
else
un = ccptr->usersupp.fullname;
- if ((!strcasecmp(un, x_user))
- || (!strcasecmp(x_user, "broadcast"))) {
+ if ( ((!strcasecmp(un, x_user))
+ || (!strcasecmp(x_user, "broadcast")))
+ && ((ccptr->disable_exp == 0)
+ || (CC->usersupp.axlevel >= 6)) ) {
if (do_send) {
newmsg = (struct ExpressMessage *)
mallok(sizeof (struct ExpressMessage));
if (!strcmp(x_msg, "-")) {
message_sent = PerformXmsgHooks(lun, x_user, "");
if (message_sent == 0) {
- cprintf("%d No user '%s' logged in.\n", ERROR, x_user);
+ cprintf("%d '%s' is not logged in "
+ "or is not accepting pages.\n",
+ ERROR, x_user);
return;
}
cprintf("%d Transmit message (will deliver to %d users)\n",
}
}
+
+
+
+/*
+ * Enter or exit paging-disabled mode
+ */
+void cmd_dexp(char *argbuf)
+{
+ int new_state;
+
+ if (!CC->logged_in) {
+ cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
+ return;
+ }
+
+ new_state = extract_int(argbuf, 0);
+ if ((new_state == 0) || (new_state == 1)) {
+ CC->disable_exp = new_state;
+ }
+ cprintf("%d %d\n", OK, CC->disable_exp);
+ }
+
+
+
+
+
+char *Dynamic_Module_Init(void)
+{
+ CtdlRegisterProtoHook(cmd_chat, "CHAT", "Begin real-time chat");
+ CtdlRegisterProtoHook(cmd_pexp, "PEXP", "Poll for express messages");
+ CtdlRegisterProtoHook(cmd_gexp, "GEXP", "Get express messages");
+ CtdlRegisterProtoHook(cmd_sexp, "SEXP", "Send an express message");
+ CtdlRegisterProtoHook(cmd_dexp, "DEXP", "Disable express messages");
+ CtdlRegisterSessionHook(delete_express_messages, EVT_STOP);
+ CtdlRegisterXmsgHook(send_express_message, XMSG_PRI_LOCAL);
+ return "$Id$";
+}
+
/* A linked list of all express messages sent to us. */
struct ExpressMessage *FirstExpressMessage;
+ int disable_exp; /* Set to 1 to disable incoming pages */
/* Masquerade... */
char fake_username[32]; /* Fake username <bc> */
0 to respectively set or clear the flag. When the "scheduled shutdown" flag is
set, the server will be shut down when there are no longer any users logged in.
Any value other than 0 or 1 will not change the flag, only report its state.
-No users will be kicked off the system, and in fact the server is still available
-for new connections. The command returns ERROR if it fails; otherwise, it
-returns OK followed by a number representing the current state of the flag.
+No users will be kicked off the system, and in fact the server is still
+available for new connections. The command returns ERROR if it fails;
+otherwise, it returns OK followed by a number representing the current state
+of the flag.
EMSG (Enter a system MeSsaGe)
Verify, via the long way, that all message referenmce counts are correct. If
the user has permission to do this then LISTING_FOLLOWS is returned, followed
by a transcript of the run. Otherwise ERROR is returned.
+
+
+ DEXP (Disable EXPress messages)
+ DEXP sets or clears the "disable express messages" flag. Pass this command a
+1 or 0 to respectively set or clear the flag. When the "disable express
+messages" flag is set, no one except Aides may send the user express messages.
+Any value other than 0 or 1 will not change the flag, only report its state.
+The command returns ERROR if it fails; otherwise, it returns OK followed by a
+number representing the current state of the flag.
+
+