From: Art Cancro Date: Mon, 3 Dec 2001 01:50:18 +0000 (+0000) Subject: * When sending mail, copy to the sender's "Sent Items>" room instead of to X-Git-Tag: v7.86~6712 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=700c851c8cb12c5ebe9469e74a012fe79d703f13 * When sending mail, copy to the sender's "Sent Items>" room instead of to the sender's "Mail>" room. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 464d89710..8774438fa 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 580.87 2001/12/03 01:50:17 ajc + * When sending mail, copy to the sender's "Sent Items>" room instead of to + the sender's "Mail>" room. + Revision 580.86 2001/12/02 23:36:24 ajc * On a new system, set the default new user level to 4 instead of 1. @@ -2904,4 +2908,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citserver.c b/citadel/citserver.c index 562cd8905..c03f9cdfe 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -1033,10 +1033,6 @@ void do_command_loop(void) { cmd_ent0(&cmdbuf[5]); } - else if (!strncasecmp(cmdbuf,"ENT3",4)) { - cmd_ent3(&cmdbuf[5]); - } - else if (!strncasecmp(cmdbuf,"RINF",4)) { cmd_rinf(); } diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 2f5c10128..42491c8cc 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -1736,7 +1736,7 @@ long CtdlSaveMsg(struct CtdlMessage *msg, /* message to save */ } } - lprintf(9, "Recipient is <%s>\n", recipient); + lprintf(9, "Recipient is <%s>, mailtype is %d\n", recipient, mailtype); /* Learn about what's inside, because it's what's inside that counts */ lprintf(9, "Learning what's inside\n"); @@ -1777,6 +1777,9 @@ long CtdlSaveMsg(struct CtdlMessage *msg, /* message to save */ lprintf(9, "Switching rooms\n"); strcpy(hold_rm, CC->quickroom.QRname); strcpy(actual_rm, CC->quickroom.QRname); + if (strlen(recipient) > 0) { + strcpy(actual_rm, SENTITEMS); + } /* If the user is a twit, move to the twit room for posting */ lprintf(9, "Handling twit stuff\n"); @@ -2278,109 +2281,6 @@ void cmd_ent0(char *entargs) -/* - * message entry - mode 3 (raw) - */ -void cmd_ent3(char *entargs) -{ - char recp[SIZ]; - int a; - int e = 0; - int valid_msg = 1; - unsigned char ch, which_field; - struct usersupp tempUS; - long msglen; - struct CtdlMessage *msg; - char *tempbuf; - - if (CC->internal_pgm == 0) { - cprintf("%d This command is for internal programs only.\n", - ERROR); - return; - } - - /* See if there's a recipient, but make sure it's a real one */ - extract(recp, entargs, 1); - for (a = 0; a < strlen(recp); ++a) - if (!isprint(recp[a])) - strcpy(&recp[a], &recp[a + 1]); - while (isspace(recp[0])) - strcpy(recp, &recp[1]); - while (isspace(recp[strlen(recp) - 1])) - recp[strlen(recp) - 1] = 0; - - /* If we're in Mail, check the recipient */ - if (strlen(recp) > 0) { - e = alias(recp); /* alias and mail type */ - if ((recp[0] == 0) || (e == MES_ERROR)) { - cprintf("%d Unknown address - cannot send message.\n", - ERROR + NO_SUCH_USER); - return; - } - if (e == MES_LOCAL) { - a = getuser(&tempUS, recp); - if (a != 0) { - cprintf("%d No such user.\n", - ERROR + NO_SUCH_USER); - return; - } - } - } - - /* At this point, message has been approved. */ - if (extract_int(entargs, 0) == 0) { - cprintf("%d OK to send\n", OK); - return; - } - - msglen = extract_long(entargs, 2); - msg = mallok(sizeof(struct CtdlMessage)); - if (msg == NULL) { - cprintf("%d Out of memory\n", ERROR+INTERNAL_ERROR); - return; - } - - memset(msg, 0, sizeof(struct CtdlMessage)); - tempbuf = mallok(msglen); - if (tempbuf == NULL) { - cprintf("%d Out of memory\n", ERROR+INTERNAL_ERROR); - phree(msg); - return; - } - - cprintf("%d %ld\n", SEND_BINARY, msglen); - - client_read((char*)&ch, 1); /* 0xFF magic number */ - msg->cm_magic = CTDLMESSAGE_MAGIC; - client_read((char*)&ch, 1); /* anon type */ - msg->cm_anon_type = ch; - client_read((char*)&ch, 1); /* format type */ - msg->cm_format_type = ch; - msglen = msglen - 3; - - while (msglen > 0) { - client_read((char*)&which_field, 1); - if (!isalpha(which_field)) valid_msg = 0; - --msglen; - tempbuf[0] = 0; - do { - client_read((char*)&ch, 1); - --msglen; - a = strlen(tempbuf); - tempbuf[a+1] = 0; - tempbuf[a] = ch; - } while ( (ch != 0) && (msglen > 0) ); - if (valid_msg) - msg->cm_fields[which_field] = strdoop(tempbuf); - } - - msg->cm_flags = CM_SKIP_HOOKS; - if (valid_msg) CtdlSaveMsg(msg, recp, "", e); - CtdlFreeMessage(msg); - phree(tempbuf); -} - - /* * API function to delete messages which match a set of criteria * (returns the actual number of messages deleted) diff --git a/citadel/msgbase.h b/citadel/msgbase.h index d928117e7..01bbb9791 100644 --- a/citadel/msgbase.h +++ b/citadel/msgbase.h @@ -60,7 +60,6 @@ void loadtroom (void); long CtdlSaveMsg(struct CtdlMessage *, char *, char *, int); void quickie_message (char *, char *, char *, char *); void cmd_ent0 (char *entargs); -void cmd_ent3 (char *entargs); void cmd_dele (char *delstr); void cmd_move (char *args); void GetMetaData(struct MetaData *, long); diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 588796f48..f2d79b21d 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -109,6 +109,7 @@ */ #define BASEROOM "Lobby" #define MAILROOM "Mail" +#define SENTITEMS "Sent Items" #define AIDEROOM "Aide" #define USERCONFIGROOM "My Citadel Config" #define USERCALENDARROOM "My Calendar" diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 23a305131..f15442507 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -400,10 +400,16 @@ void session_startup(void) } lputuser(&CC->usersupp); - /* Run any cleanup routines registered by loadable modules */ + /* Run any startup routines registered by loadable modules */ PerformSessionHooks(EVT_LOGIN); - usergoto(BASEROOM, 0, NULL, NULL); /* Enter the lobby */ + /* Create any personal rooms required by the system */ + create_room(SENTITEMS, 4, "", 0, 1); + + /* Enter the lobby */ + usergoto(BASEROOM, 0, NULL, NULL); + + /* Record this login in the Citadel log */ rec_log(CL_LOGIN, CC->curr_user); }