* When sending mail, copy to the sender's "Sent Items>" room instead of to
authorArt Cancro <ajc@citadel.org>
Mon, 3 Dec 2001 01:50:18 +0000 (01:50 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 3 Dec 2001 01:50:18 +0000 (01:50 +0000)
  the sender's "Mail>" room.

citadel/ChangeLog
citadel/citserver.c
citadel/msgbase.c
citadel/msgbase.h
citadel/sysconfig.h
citadel/user_ops.c

index 464d897100e74c19331865318b41b7c2f75ab698..8774438fa0f987790e49ac968138a1a1dce62c77 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index 562cd8905f4301417dcb32af5b8202989a3a2062..c03f9cdfe6f2f1f9b5dc83e81e82e3f988a3a99c 100644 (file)
@@ -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();
                }
index 2f5c10128f0c7fe1bbd872a8025cdfb009eacac1..42491c8cc1f7646da801ae2fcb128c60a4f363a8 100644 (file)
@@ -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)
index d928117e70beac5a738081b55753a758b5677f40..01bbb97919e74c5a4ab4431a4d87010d77221cd7 100644 (file)
@@ -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);
index 588796f48d1960dfb837e47e828342b66dee166f..f2d79b21d69ef15930daeb3556aad28421b54bdb 100644 (file)
  */
 #define BASEROOM               "Lobby"
 #define MAILROOM               "Mail"
+#define SENTITEMS              "Sent Items"
 #define AIDEROOM               "Aide"
 #define USERCONFIGROOM         "My Citadel Config"
 #define USERCALENDARROOM       "My Calendar"
index 23a305131f3211cfdc004138acffb95d1c83644e..f154425078d9b29f2ec4bec8c1b8ea9eb5e1228a 100644 (file)
@@ -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);
 }