* Set up a private "Sent/Received Pages" room for each user
authorArt Cancro <ajc@citadel.org>
Fri, 17 Mar 2000 16:26:58 +0000 (16:26 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 17 Mar 2000 16:26:58 +0000 (16:26 +0000)
citadel/ChangeLog
citadel/network/mail.sysinfo
citadel/serv_chat.c
citadel/serv_chat.h
citadel/sysconfig.h

index 680521d00c589c65ccfe29bcb38f73e55476a6bb..b720e40fdd3193b4ab919370817ce1470282814a 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 1.491  2000/03/17 16:26:57  ajc
+ * Set up a private "Sent/Received Pages" room for each user
+
  Revision 1.490  2000/03/17 04:11:24  ajc
  * Moved bio-related commands out to a loadable module
 
@@ -1753,4 +1756,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index 7905a6eec3bd771b0843075a80e73052a13c814b..c18500367352beb0dbc5e9ebbefc127d35289eb0 100644 (file)
@@ -1,72 +1,70 @@
-future
+ctestsys
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <catchat> to map
-gdom or system <catchat> to map
-humannode The Future BBS
-lastcontact 952979823 Mon Mar 13 15:37:03 2000
+phonenum US 612 470 9635
+gdom MN
+humannode C-86 Test System
+lastcontact 953174223 Wed Mar 15 21:37:03 2000
 
-catchat
+bccs
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <rundale> to map
-gdom or system <rundale> to map
-humannode 'Cat Chat
-lastcontact 952138915 Fri Mar  3 22:01:55 2000
+phonenum netproc[7145]: Adding non-neighbor system <internet> to map
+gdom or system <internet> to map
+humannode BCCS
+lastcontact 953246224 Thu Mar 16 17:37:04 2000
 
-rundale
-use uncnsrd
-phonenum US 609 854 9135
-gdom NJ
-humannode Rundale
-lastcontact 952138909 Fri Mar  3 22:01:49 2000
+internet
+uum %s
+humannode Internet Gateway
+lastcontact 953307423 Fri Mar 17 10:37:03 2000
 
-jacs
-use uncnsrd
-phonenum US6093461224
-gdom NJ
-humannode JACS
-lastcontact 952839428 Sun Mar 12 00:37:08 2000
+uncnsrd
+bin Mail
+phonenum US 914 244 3252
+humannode Uncensored
+lastcontact 953282223 Fri Mar 17 03:37:03 2000
 
-dogpound2
-use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <sbn> to map
-gdom or system <sbn> to map
-humannode Dog Pound BBS II
-lastcontact 952958224 Mon Mar 13 09:37:04 2000
+test
+bin Mail
 
-sbn
-use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <feathers> to map
-gdom or system <feathers> to map
-humannode Super BBS Network
-lastcontact 952138908 Fri Mar  3 22:01:48 2000
+tux
+bin Mail
+phonenum US 800 555 1212
+humannode My System
+lastcontact 951540103 Fri Feb 25 23:41:43 2000
 
-feathers
+tesseract
+bin Mail
+phonenum US 800 555 1212
+humannode Tesseract Project
+lastcontact 953307423 Fri Mar 17 10:37:03 2000
+
+pixel
 use uncnsrd
-phonenum CA (604) 589-8539
-gdom BC
-humannode Feathers & Furballs
-lastcontact 952925823 Mon Mar 13 00:37:03 2000
+phonenum netproc[4026]: Adding non-neighbor system <tesseract> to map
+gdom or system <tesseract> to map
+humannode PixelBBS
+lastcontact 953271423 Fri Mar 17 00:37:03 2000
 
-charis
+barbaria
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <gateway> to map
-gdom or system <gateway> to map
-humannode MascotSpeak
-lastcontact 952138904 Fri Mar  3 22:01:44 2000
+phonenum netproc[4026]: Adding non-neighbor system <pixel> to map
+gdom or system <pixel> to map
+humannode Barbaria
+lastcontact 952138915 Fri Mar  3 22:01:55 2000
 
-gateway
+haven
 use uncnsrd
-phonenum US (609) 931-3014
-gdom NJ
-humannode Gateway
-lastcontact 952138913 Fri Mar  3 22:01:53 2000
+phonenum netproc[4026]: Adding non-neighbor system <barbaria> to map
+gdom or system <barbaria> to map
+humannode Haven BBS
+lastcontact 952879023 Sun Mar 12 11:37:03 2000
 
-amigazon
+mnmensa
 use uncnsrd
-phonenum US (609) 953 8159
-gdom NJ
-humannode The Amiga Zone
-lastcontact 952720625 Fri Mar 10 15:37:05 2000
+phonenum US (612) 757-7307
+gdom MN
+humannode MN-Mensa
+lastcontact 952138905 Fri Mar  3 22:01:45 2000
 
 cbbs
 use uncnsrd
@@ -75,71 +73,73 @@ gdom Cinci
 humannode The CBBS
 lastcontact 952138903 Fri Mar  3 22:01:43 2000
 
-mnmensa
+amigazon
 use uncnsrd
-phonenum US (612) 757-7307
-gdom MN
-humannode MN-Mensa
-lastcontact 952138905 Fri Mar  3 22:01:45 2000
+phonenum US (609) 953 8159
+gdom NJ
+humannode The Amiga Zone
+lastcontact 952720625 Fri Mar 10 15:37:05 2000
 
-haven
+gateway
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <barbaria> to map
-gdom or system <barbaria> to map
-humannode Haven BBS
-lastcontact 952879023 Sun Mar 12 11:37:03 2000
+phonenum US (609) 931-3014
+gdom NJ
+humannode Gateway
+lastcontact 952138913 Fri Mar  3 22:01:53 2000
 
-barbaria
+charis
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <pixel> to map
-gdom or system <pixel> to map
-humannode Barbaria
-lastcontact 952138915 Fri Mar  3 22:01:55 2000
+phonenum netproc[4026]: Adding non-neighbor system <gateway> to map
+gdom or system <gateway> to map
+humannode MascotSpeak
+lastcontact 952138904 Fri Mar  3 22:01:44 2000
 
-pixel
+feathers
 use uncnsrd
-phonenum netproc[4026]: Adding non-neighbor system <tesseract> to map
-gdom or system <tesseract> to map
-humannode PixelBBS
-lastcontact 952904223 Sun Mar 12 18:37:03 2000
-
-tesseract
-bin Mail
-phonenum US 800 555 1212
-humannode Tesseract Project
-lastcontact 953138227 Wed Mar 15 11:37:07 2000
+phonenum CA (604) 589-8539
+gdom BC
+humannode Feathers & Furballs
+lastcontact 952925823 Mon Mar 13 00:37:03 2000
 
-tux
-bin Mail
-phonenum US 800 555 1212
-humannode My System
-lastcontact 951540103 Fri Feb 25 23:41:43 2000
+sbn
+use uncnsrd
+phonenum netproc[4026]: Adding non-neighbor system <feathers> to map
+gdom or system <feathers> to map
+humannode Super BBS Network
+lastcontact 952138908 Fri Mar  3 22:01:48 2000
 
-test
-bin Mail
+dogpound2
+use uncnsrd
+phonenum netproc[4026]: Adding non-neighbor system <sbn> to map
+gdom or system <sbn> to map
+humannode Dog Pound BBS II
+lastcontact 953217423 Thu Mar 16 09:37:03 2000
 
-uncnsrd
-bin Mail
-phonenum US 914 244 3252
-humannode Uncensored
-lastcontact 953087823 Tue Mar 14 21:37:03 2000
+jacs
+use uncnsrd
+phonenum US6093461224
+gdom NJ
+humannode JACS
+lastcontact 952839428 Sun Mar 12 00:37:08 2000
 
-internet
-uum %s
-humannode Internet Gateway
-lastcontact 953138227 Wed Mar 15 11:37:07 2000
+rundale
+use uncnsrd
+phonenum US 609 854 9135
+gdom NJ
+humannode Rundale
+lastcontact 952138909 Fri Mar  3 22:01:49 2000
 
-bccs
+catchat
 use uncnsrd
-phonenum netproc[7145]: Adding non-neighbor system <internet> to map
-gdom or system <internet> to map
-humannode BCCS
-lastcontact 952943824 Mon Mar 13 05:37:04 2000
+phonenum netproc[4026]: Adding non-neighbor system <rundale> to map
+gdom or system <rundale> to map
+humannode 'Cat Chat
+lastcontact 952138915 Fri Mar  3 22:01:55 2000
 
-ctestsys
+future
 use uncnsrd
-phonenum US 612 470 9635
-gdom MN
-humannode C-86 Test System
-lastcontact 953102223 Wed Mar 15 01:37:03 2000
+phonenum netproc[4026]: Adding non-neighbor system <catchat> to map
+gdom or system <catchat> to map
+humannode The Future BBS
+lastcontact 952979823 Mon Mar 13 15:37:03 2000
 
index 91ba6f9e7a3dc179ec3c8fa36d0fd78c15e0be72..d1b4db02a79545a1881b29ea748c40a4fbff45d7 100644 (file)
@@ -30,6 +30,8 @@
 #include "dynloader.h"
 #include "tools.h"
 #include "msgbase.h"
+#include "user_ops.h"
+#include "room_ops.h"
 
 struct ChatLine *ChatQueue = NULL;
 int ChatLastMsg = 0;
@@ -453,12 +455,20 @@ void cmd_gexp(char *argbuf) {
  */
 int send_express_message(char *lun, char *x_user, char *x_msg)
 {
-       int message_sent = 0;
+       int message_sent = 0;           /* number of successful sends */
+
        struct CitContext *ccptr;
        struct ExpressMessage *newmsg, *findend;
        char *un;
        size_t msglen = 0;
-       int do_send = 0;
+       int do_send = 0;                /* set to 1 to actually page, not
+                                        * just check to see if we can.
+                                        */
+       struct savelist *sl = NULL;     /* list of rooms to save this page */
+       struct savelist *sptr;
+       struct CtdlMessage *logmsg;
+       char roomname[ROOMNAMELEN];
+       long msgnum;
 
        if (strlen(x_msg) > 0) {
                msglen = strlen(x_msg) + 4;
@@ -498,6 +508,16 @@ int send_express_message(char *lun, char *x_user, char *x_msg)
                                                findend = findend->next;
                                        findend->next = newmsg;
                                }
+
+                               /* and log it ... */
+                               if (ccptr != CC) {
+                                       sptr = (struct savelist *)
+                                               malloc(sizeof(struct savelist));
+                                       sptr->next = sl;
+                                       MailboxName(sptr->roomname,
+                                               &ccptr->usersupp, PAGELOGROOM);
+                                       sl = sptr;
+                               }
                        }
                        ++message_sent;
                }
@@ -505,8 +525,35 @@ int send_express_message(char *lun, char *x_user, char *x_msg)
        end_critical_section(S_SESSION_TABLE);
 
        /* Log the page to disk if configured to do so  */
-       if ((strlen(config.c_logpages) > 0) && (do_send) ) {
-               quickie_message(lun, x_user, config.c_logpages, x_msg);
+       if ( (do_send) && (message_sent) ) {
+
+               logmsg = mallok(sizeof(struct CtdlMessage));
+               memset(logmsg, 0, sizeof(struct CtdlMessage));
+               logmsg->cm_magic = CTDLMESSAGE_MAGIC;
+               logmsg->cm_anon_type = MES_NORMAL;
+               logmsg->cm_format_type = 0;
+               logmsg->cm_fields['A'] = strdoop(lun);
+               logmsg->cm_fields['N'] = strdoop(NODENAME);
+               logmsg->cm_fields['O'] = strdoop(PAGELOGROOM);
+               logmsg->cm_fields['R'] = strdoop(x_user);
+               logmsg->cm_fields['M'] = strdoop(x_msg);
+
+               MailboxName(roomname, &CC->usersupp, PAGELOGROOM);
+               create_room(roomname, 4, "", 0);
+               msgnum = CtdlSaveMsg(logmsg, "", roomname, MES_LOCAL);
+               if (strlen(config.c_logpages) > 0) {
+                       create_room(config.c_logpages, 3, "", 0);
+                       CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0);
+               }
+               while (sl != NULL) {
+                       create_room(sl->roomname, 4, "", 0);
+                       CtdlSaveMsgPointerInRoom(sl->roomname, msgnum, 0);
+                       sptr = sl->next;
+                       phree(sl);
+                       sl = sptr;
+               }
+
+               CtdlFreeMessage(logmsg);
        }
 
        return (message_sent);
index 18222f5dc1c0ade238452c67fec8d441cb0e0a86..d5e9d34cd2988c7c0dd12b3c67847a982fb7146d 100644 (file)
@@ -9,3 +9,8 @@ void cmd_sexp (char *argbuf);
 void delete_express_messages(void);
 void cmd_gexp(char *);
 int send_express_message(char *, char *, char *);
+
+struct savelist {
+       struct savelist *next;
+       char roomname[ROOMNAMELEN];
+};
index 6a772177aaf03c4f6b8ba9ea32e0a110b97bb006..dd445ce9d67b966160b3707e7143d6e26b7d1f4b 100644 (file)
@@ -96,5 +96,6 @@
 #define MAILROOM               "Mail"
 #define AIDEROOM               "Aide"
 #define USERCONFIGROOM         "My Citadel Config"
+#define PAGELOGROOM            "Sent/Received Pages"
 #define SYSCONFIGROOM          "Local System Configuration"
 #define SMTP_SPOOLOUT_ROOM     "__CitadelSMTPspoolout__"