$Log$
+ Revision 625.23 2004/09/16 01:46:40 ajc
+ * CRE8 command: allow setting default view during room creation
+
Revision 625.22 2004/09/15 03:02:47 ajc
* Add an SMTP MSA listener (separate port, requires auth)
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
check_ref_counts();
lprintf(CTDL_INFO, "Creating base rooms (if necessary)\n");
- create_room(BASEROOM, 0, "", 0, 1, 0);
- create_room(AIDEROOM, 3, "", 0, 1, 0);
- create_room(SYSCONFIGROOM, 3, "", 0, 1, 0);
- create_room(config.c_twitroom, 0, "", 0, 1, 0);
+ create_room(BASEROOM, 0, "", 0, 1, 0, VIEW_BBS);
+ create_room(AIDEROOM, 3, "", 0, 1, 0, VIEW_BBS);
+ create_room(SYSCONFIGROOM, 3, "", 0, 1, 0, VIEW_BBS);
+ create_room(config.c_twitroom, 0, "", 0, 1, 0, VIEW_BBS);
/* The "Local System Configuration" room doesn't need to be visible */
if (lgetroom(&qrbuf, SYSCONFIGROOM) == 0) {
aide_message(buf);
if (strlen(config.c_logpages) > 0)
- create_room(config.c_logpages, 3, "", 0, 1, 1);
+ create_room(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
}
else if (!strcasecmp(cmd, "GETSYS")) {
if (getroom(&qrbuf, roomname) != 0) {
create_room(roomname,
( (is_mailbox != NULL) ? 5 : 3 ),
- "", 0, 1, 0);
+ "", 0, 1, 0, VIEW_BBS);
}
/* If the caller specified this object as unique, delete all
* other objects of this type that are currently in the room.
char *new_room_pass,
int new_room_floor,
int really_create,
- int avoid_access)
+ int avoid_access,
+ int new_room_view)
{
struct ctdlroom qrbuf;
qrbuf.QRhighest = 0L; /* No messages in this room yet */
time(&qrbuf.QRgen); /* Use a timestamp as the generation number */
qrbuf.QRfloor = new_room_floor;
+ qrbuf.QRdefaultview = new_room_view;
/* save what we just did... */
putroom(&qrbuf);
int new_room_type;
char new_room_pass[SIZ];
int new_room_floor;
+ int new_room_view;
char aaa[SIZ];
unsigned newflags;
struct floor *fl;
new_room_type = extract_int(args, 2);
extract(new_room_pass, args, 3);
avoid_access = extract_int(args, 5);
+ new_room_view = extract_int(args, 6);
new_room_pass[9] = 0;
new_room_floor = 0;
/* Check to make sure the requested room name doesn't already exist */
newflags = create_room(new_room_name,
new_room_type, new_room_pass, new_room_floor,
- 0, avoid_access);
+ 0, avoid_access, new_room_view);
if (newflags == 0) {
cprintf("%d '%s' already exists.\n",
ERROR + ALREADY_EXISTS, new_room_name);
/* If we reach this point, the room needs to be created. */
newflags = create_room(new_room_name,
- new_room_type, new_room_pass, new_room_floor, 1, 0);
+ new_room_type, new_room_pass, new_room_floor, 1, 0,
+ new_room_view);
/* post a message in Aide> describing the new room */
safestrncpy(aaa, new_room_name, sizeof aaa);
char *new_room_pass,
int new_room_floor,
int really_create,
- int avoid_access);
+ int avoid_access,
+ int new_room_view);
void cmd_cre8 (char *args);
void cmd_einf (char *ok);
void cmd_lflr (void);
struct visit vbuf;
/* Create the calendar room if it doesn't already exist */
- create_room(USERCALENDARROOM, 4, "", 0, 1, 0);
+ create_room(USERCALENDARROOM, 4, "", 0, 1, 0, VIEW_CALENDAR);
/* Set expiration policy to manual; otherwise objects will be lost! */
if (lgetroom(&qr, USERCALENDARROOM)) {
return;
}
qr.QRep.expire_mode = EXPIRE_MANUAL;
- qr.QRdefaultview = 3; /* 3 = calendar view */
+ qr.QRdefaultview = VIEW_CALENDAR; /* 3 = calendar view */
lputroom(&qr);
/* Set the view to a calendar view */
CtdlSetRelationship(&vbuf, &CC->user, &qr);
/* Create the tasks list room if it doesn't already exist */
- create_room(USERTASKSROOM, 4, "", 0, 1, 0);
+ create_room(USERTASKSROOM, 4, "", 0, 1, 0, VIEW_TASKS);
/* Set expiration policy to manual; otherwise objects will be lost! */
if (lgetroom(&qr, USERTASKSROOM)) {
return;
}
qr.QRep.expire_mode = EXPIRE_MANUAL;
- qr.QRdefaultview = 4; /* 4 = tasks view */
+ qr.QRdefaultview = VIEW_TASKS; /* 4 = tasks view */
lputroom(&qr);
/* Set the view to a task list view */
/* Save a copy of the message in the sender's log room,
* creating the room if necessary.
*/
- create_room(PAGELOGROOM, 4, "", 0, 1, 0);
+ create_room(PAGELOGROOM, 4, "", 0, 1, 0, VIEW_BBS);
msgnum = CtdlSubmitMsg(logmsg, NULL, PAGELOGROOM);
/* Now save a copy in the global log room, if configured */
if (strlen(config.c_logpages) > 0) {
- create_room(config.c_logpages, 3, "", 0, 1, 1);
+ create_room(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0);
}
* but we've already supplied the namespace prefix.
*/
while (sl != NULL) {
- create_room(sl->roomname, 5, "", 0, 1, 1);
+ create_room(sl->roomname, 5, "", 0, 1, 1, VIEW_BBS);
CtdlSaveMsgPointerInRoom(sl->roomname, msgnum, 0);
sptr = sl->next;
free(sl);
struct ctdlroom qrbuf;
char mailboxname[ROOMNAMELEN];
MailboxName(mailboxname, us, MAILROOM);
- create_room(mailboxname, 4, "", 0, 1, 1);
+ create_room(mailboxname, 4, "", 0, 1, 1, VIEW_BBS);
if (getroom(&qrbuf, mailboxname) != 0) return;
lprintf(CTDL_DEBUG, "Got %s\n", qrbuf.QRname);
*/
lprintf(CTDL_INFO, "Create new room <%s> on floor <%d> with type <%d>\n",
roomname, floornum, newroomtype);
- ret = create_room(roomname, newroomtype, "", floornum, 1, 0);
+ ret = create_room(roomname, newroomtype, "", floornum, 1, 0, VIEW_BBS);
if (ret == 0) {
cprintf
("%s NO Mailbox already exists, or create failed\r\n",
* (already did that) and create a new inbox.
*/
if (!strcasecmp(parms[2], "INBOX")) {
- create_room(MAILROOM, 4, "", 0, 1, 0);
+ create_room(MAILROOM, 4, "", 0, 1, 0, VIEW_BBS);
}
/* Otherwise, do the subfolders. Build a list of rooms to rename... */
* Create the room. This will silently fail if the room already
* exists, and that's perfectly ok, because we want it to exist.
*/
- create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1, 0);
+ create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1, 0, VIEW_BBS);
/*
* Make sure it's set to be a "system room" so it doesn't show up
struct visit vbuf;
/* Create the calendar room if it doesn't already exist */
- create_room(USERCONTACTSROOM, 4, "", 0, 1, 0);
+ create_room(USERCONTACTSROOM, 4, "", 0, 1, 0, VIEW_ADDRESSBOOK);
/* Set expiration policy to manual; otherwise objects will be lost! */
if (lgetroom(&qr, USERCONTACTSROOM)) {
return;
}
qr.QRep.expire_mode = EXPIRE_MANUAL;
- qr.QRdefaultview = 2; /* 2 = address book view */
+ qr.QRdefaultview = VIEW_ADDRESSBOOK; /* 2 = address book view */
lputroom(&qr);
/* Set the view to a calendar view */
CtdlRegisterNetprocHook(vcard_extract_from_network);
/* Create the Global ADdress Book room if necessary */
- create_room(ADDRESS_BOOK_ROOM, 3, "", 0, 1, 0);
+ create_room(ADDRESS_BOOK_ROOM, 3, "", 0, 1, 0, VIEW_ADDRESSBOOK);
/* Set expiration policy to manual; otherwise objects will be lost! */
if (!lgetroom(&qr, ADDRESS_BOOK_ROOM)) {
qr.QRep.expire_mode = EXPIRE_MANUAL;
- qr.QRdefaultview = 2; /* 2 = address book view */
+ qr.QRdefaultview = VIEW_ADDRESSBOOK; /* 2 = address book view */
lputroom(&qr);
}
3 - Password for new room (if it is a type 2 room)
4 - Floor number on which the room should reside (optional)
5 - Set to 1 to avoid automatically gaining access to the created room.
+ 6 - The default "view" for the room.
If the create flag is set to 1, the room is created (unless something
went wrong and an ERROR return is sent), and the server returns OK, but
/* Create any personal rooms required by the system.
* (Technically, MAILROOM should be there already, but just in case...)
*/
- create_room(MAILROOM, 4, "", 0, 1, 0);
- create_room(SENTITEMS, 4, "", 0, 1, 0);
+ create_room(MAILROOM, 4, "", 0, 1, 0, VIEW_BBS);
+ create_room(SENTITEMS, 4, "", 0, 1, 0, VIEW_BBS);
/* Run any startup routines registered by loadable modules */
PerformSessionHooks(EVT_LOGIN);
* Make the latter an invisible system room.
*/
MailboxName(mailboxname, sizeof mailboxname, &usbuf, MAILROOM);
- create_room(mailboxname, 5, "", 0, 1, 1);
+ create_room(mailboxname, 5, "", 0, 1, 1, VIEW_BBS);
MailboxName(mailboxname, sizeof mailboxname, &usbuf, USERCONFIGROOM);
- create_room(mailboxname, 5, "", 0, 1, 1);
+ create_room(mailboxname, 5, "", 0, 1, 1, VIEW_BBS);
if (lgetroom(&qrbuf, mailboxname) == 0) {
qrbuf.QRflags2 |= QR2_SYSTEM;
lputroom(&qrbuf);