scr_printf("No room '%s'.\n", towhere);
return;
}
- room = NULL;
r = CtdlIPCGotoRoom(ipc, bbb, "", &room, aaa);
}
if (r / 100 != 1 && r / 100 != 2) {
}
status_line(ipc->ServInfo.humannode, ipc->ServInfo.site_location,
room_name, secure, newmailcount);
+ free(room);
}
/* Goto next room having unread messages.
flist = flist->next;
free(fptr);
}
+ if (room) free(room);
}
updatelsa(ipc);
}
}
+
+ /* Free the room list */
+ while (listing) {
+ mptr = listing->next;
+ free(listing);
+ listing = mptr;
+ };
+
dotgoto(ipc, rmname, 1, 0);
}
if (floorlist[0][0] == 0)
load_floorlist(ipc);
+ empty_keep_going:
+
if (direction == 0) { /* Previous floor */
if (curr_floor) tofloor = curr_floor - 1;
else tofloor = 127;
}
gotofloor(ipc, floorlist[tofloor], mode);
+ if (curr_floor != tofloor) { /* gotofloor failed */
+ curr_floor = tofloor;
+ goto empty_keep_going;
+ }
}
/*
strcat(retbuf, &sortbuf[i*SIZ]);
if (i<(rows-1)) strcat(retbuf, "\n");
}
+ free(listing);
+ free(sortbuf);
return(retbuf);
}
int home=0;
char relhome[PATH_MAX]="";
char ctdldir[PATH_MAX]=CTDLDIR;
-
+
calc_dirs_n_files(relh, home, relhome, ctdldir);
dotgoto(ipc, "_BASEROOM_", 1, 0);
/* Main loop for the system... user is logged in. */
+ free(uglist[0]);
uglistsize = 0;
if (newnow == 1)
break;
case 110: /* <+> Next room */
- gotoroomstep(ipc, 1, 0);
+ gotoroomstep(ipc, 1, 0);
break;
case 111: /* <-> Previous room */
system_info(ipc);
break;
+ case 120: /* .KAnonymous */
+ dotknown(ipc, 0, NULL);
+ break;
+
+ case 121: /* .KDirectory */
+ dotknown(ipc, 1, NULL);
+ break;
+
+ case 122: /* .KMatch */
+ dotknown(ipc, 2, argbuf);
+ break;
+
+ case 123: /* .KpreferredOnly */
+ dotknown(ipc, 3, NULL);
+ break;
+
+ case 124: /* .KPrivate */
+ dotknown(ipc, 4, NULL);
+ break;
+
+ case 125: /* .KRead only */
+ dotknown(ipc, 5, NULL);
+ break;
+
+ case 126: /* .KShared */
+ dotknown(ipc, 6, NULL);
+ break;
+
default: /* allow some math on the command */
/* commands 100... to 100+MAX_EDITORS-1 will
call the appropriate editor... in other
cmd=59,0,&;,&Configure floor mode
cmd=60,0,&;,&Goto floor:
+cmd=60,0,&.,&Enter,&Floor:
cmd=61,0,&;,&Skip to floor:
cmd=62,0,&;,&Zap (forget) floor
cmd=63,2,&;,&Aide,&Create floor
cmd=118,0,&.,skip to &>Next floor
cmd=119,0,&.,skip to &<Previous floor
+cmd=120,0,&.,&Known,&Anonymous rooms
+cmd=121,0,&.,&Known,&Directory rooms
+cmd=68,0,&.,&Known,&Floors
+cmd=49,0,&.,&Known,room &Info
+cmd=122,0,&.,&Known,&Match rooms:
+cmd=123,0,&.,&Known,preferred &Only rooms
+cmd=124,0,&.,&Known,&Private rooms
+cmd=125,0,&.,&Known,&Read only rooms
+cmd=126,0,&.,&Known,&Shared rooms
+cmd=19,0,&.,&Known,&Zapped rooms
+
#
# Command 69 allows the user to enter a server command directly. It is
# primarily for testing and not intended for general use. Usually there
}
}
*listing = march;
+ if (bbb) free(bbb);
return ret;
}
rret[0]->RRfloor = extract_int(cret, 10);
} else {
free(*rret);
+ *rret = NULL;
}
+ free(aaa);
return ret;
}
}
}
+ if (listing) free(listing);
return ret;
}
for (cptr = cmdlist; cptr != NULL; cptr = cptr->next) {
if (cmdmatch(cmdbuf, cptr, cmdpos)) {
for (a = 0; a < 5; ++a) {
- pprintf("%s ", cmd_expand(cptr->c_keys[a], 1));
+ keyopt(cmd_expand(cptr->c_keys[a], 1));
+ pprintf(" ");
}
pprintf("\n");
}
}
+ sigcaught = 0;
pprintf("\n%s%c ", room_name, room_prompt(room_flags));
got = 0;
color(DIM_WHITE);
for (i=0; i<strlen(buf); ++i) {
if (buf[i]=='<') {
- scr_putc(buf[i]);
+ pprintf("%c", buf[i]);
color(BRIGHT_MAGENTA);
} else {
- if (buf[i]=='>') {
+ if (buf[i]=='>'&& buf[i+1] != '>') {
color(DIM_WHITE);
}
- scr_putc(buf[i]);
+ pprintf("%c", buf[i]);
}
}
color(DIM_WHITE);
scr_printf("*** %d additional messages have been entered "
"in this room by other users.\n", b);
}
+ free(message.text);
return(0);
}
One of:
<E>nter
+ <K>nown
<R>ead
<A>ide options (aides only)
<G>oto: (type room name)
<H>elp: (type name of help file)
<Z>apped rooms list
<T>erminate
-
+ <+>, <-> skip to next, previous room
+ <>>, <<> skip to next, previous floor
<B>io
<C>onfiguration
message with <E>ditor
+ <F>loor
re<G>istration
<M>essage
<P>assword
/*
* Common code for all room listings
*/
-static void listrms(struct march *listing, int new_only, int floor_only)
+static void listrms(struct march *listing, int new_only, int floor_only, unsigned int flags, char *match)
{
struct march *mptr;
struct ctdlroomlisting *rl = NULL;
&& (mptr->march_floor != floor_only))
list_it = 0;
+ if (flags && (mptr->march_flags & flags) == 0)
+ list_it = 0;
+
+ if (match && (pattern(mptr->march_name, match) == -1))
+ list_it = 0;
+
if (list_it) {
rp = malloc(sizeof(struct ctdlroomlisting));
strncpy(rp->rlname, mptr->march_name, ROOMNAMELEN);
if (kn_floor_mode == 0) {
color(BRIGHT_CYAN);
pprintf("\n Rooms with unread messages:\n");
- listrms(listing, LISTRMS_NEW_ONLY, -1);
+ listrms(listing, LISTRMS_NEW_ONLY, -1, 0, NULL);
color(BRIGHT_CYAN);
pprintf("\n\n No unseen messages in:\n");
- listrms(listing, LISTRMS_OLD_ONLY, -1);
+ listrms(listing, LISTRMS_OLD_ONLY, -1, 0, NULL);
pprintf("\n");
}
color(BRIGHT_CYAN);
pprintf("\n Rooms with unread messages on %s:\n",
floorlist[(int) curr_floor]);
- listrms(listing, LISTRMS_NEW_ONLY, curr_floor);
+ listrms(listing, LISTRMS_NEW_ONLY, curr_floor, 0, NULL);
color(BRIGHT_CYAN);
pprintf("\n\n Rooms with no new messages on %s:\n",
floorlist[(int) curr_floor]);
- listrms(listing, LISTRMS_OLD_ONLY, curr_floor);
+ listrms(listing, LISTRMS_OLD_ONLY, curr_floor, 0, NULL);
color(BRIGHT_CYAN);
pprintf("\n\n Other floors:\n");
list_other_floors();
color(BRIGHT_CYAN);
pprintf("\n Rooms on %s:\n",
floorlist[a]);
- listrms(listing, LISTRMS_ALL, a);
+ listrms(listing, LISTRMS_ALL, a, 0, NULL);
pprintf("\n");
}
}
color(BRIGHT_CYAN);
pprintf("\n Forgotten public rooms:\n");
- listrms(listing, LISTRMS_ALL, -1);
+ listrms(listing, LISTRMS_ALL, -1, 0, NULL);
pprintf("\n");
/* Free the room list */
IFNEXPERT hit_any_key(ipc);
}
+void dotknown(CtdlIPC *ipc, int what, char *match)
+{ /* list rooms according to attribute */
+ struct march *listing = NULL;
+ struct march *mptr;
+ int r; /* IPC response code */
+ char buf[SIZ];
+
+ /* Ask the server for a room list */
+ r = CtdlIPCKnownRooms(ipc, AllAccessibleRooms, (-1), &listing, buf);
+ if (r / 100 != 1) {
+ listing = NULL;
+ }
+
+ color(BRIGHT_CYAN);
+
+ switch (what) {
+ case 0:
+ pprintf("\n Anonymous rooms:\n");
+ listrms(listing, LISTRMS_ALL, -1, QR_ANONONLY|QR_ANONOPT, NULL);
+ pprintf("\n");
+ break;
+ case 1:
+ pprintf("\n Directory rooms:\n");
+ listrms(listing, LISTRMS_ALL, -1, QR_DIRECTORY, NULL);
+ pprintf("\n");
+ break;
+ case 2:
+ pprintf("\n Matching \"%s\" rooms:\n", match);
+ listrms(listing, LISTRMS_ALL, -1, 0, match);
+ pprintf("\n");
+ break;
+ case 3:
+ pprintf("\n Preferred only rooms:\n");
+ listrms(listing, LISTRMS_ALL, -1, QR_PREFONLY, NULL);
+ pprintf("\n");
+ break;
+ case 4:
+ pprintf("\n Private rooms:\n");
+ listrms(listing, LISTRMS_ALL, -1, QR_PRIVATE, NULL);
+ pprintf("\n");
+ break;
+ case 5:
+ pprintf("\n Read only rooms:\n");
+ listrms(listing, LISTRMS_ALL, -1, QR_READONLY, NULL);
+ pprintf("\n");
+ break;
+ case 6:
+ pprintf("\n Shared rooms:\n");
+ listrms(listing, LISTRMS_ALL, -1, QR_NETWORK, NULL);
+ pprintf("\n");
+ break;
+ }
+
+ /* Free the room list */
+ while (listing) {
+ mptr = listing->next;
+ free(listing);
+ listing = mptr;
+ };
+
+ color(DIM_WHITE);
+ IFNEXPERT hit_any_key(ipc);
+}
+
int set_room_attr(CtdlIPC *ipc, unsigned int ibuf, char *prompt, unsigned int sbit)
{
extract_token(flnm, buf, 1, '|', sizeof flnm);
pprintf("\nDirectory of %s on %s\n", flnm, comment);
pprintf("-----------------------\n");
- while (*listing && strlen(listing)) {
+ while (listing && *listing && strlen(listing)) {
extract_token(buf, listing, 0, '\n', sizeof buf);
remove_token(listing, 0, '\n');
pprintf("%s\n%14s %8s %s\n", flnm, "", flsz,
comment);
}
+ if (listing) free(listing);
}
void whoknows(CtdlIPC *ipc);
void enterinfo(CtdlIPC *ipc);
void knrooms(CtdlIPC *ipc, int kn_floor_mode);
+void dotknown(CtdlIPC *ipc, int what, char *match);
void load_floorlist(CtdlIPC *ipc);
void create_floor(CtdlIPC *ipc);
void edit_floor(CtdlIPC *ipc);
imap_free_transmitted_message();
gettimeofday(&tv2, NULL);
- lprintf(CTDL_DEBUG, "IMAP %s took %ld microseconds\n",
+ lprintf(CTDL_DEBUG, "IMAP %s %s took %ld microseconds\n",
parms[1],
+ (!strcasecmp(parms[1], "uid") ? parms[2] : ""),
(tv2.tv_usec + (tv2.tv_sec * 1000000)) - (tv1.tv_usec + (tv1.tv_sec * 1000000))
);
}