* citserver.c, msgbase.c, user_ops.c: hide the owner-prefix of mail
authorArt Cancro <ajc@citadel.org>
Wed, 11 Nov 1998 23:29:08 +0000 (23:29 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 11 Nov 1998 23:29:08 +0000 (23:29 +0000)
          rooms in a couple more places: set_wtmpsupp() and make_message()

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

index 82f152d1963aa5ca4b27664967db77e5c1dfee86..95127e73eb5d71bd297e9bd9e4aeffef671b13dc 100644 (file)
@@ -1,5 +1,7 @@
 Wed Nov 11 17:57:39 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * citserver.c: slight changes to cmd_rchg() and cmd_hchg() [crashes]
+       * citserver.c, msgbase.c, user_ops.c: hide the owner-prefix of mail
+         rooms in a couple more places: set_wtmpsupp() and make_message()
 
 1998-11-11 Nathan Bryant <bryant@cs.usm.maine.edu>
        * serv_upgrade.c: fix uninitialized variable
index 60f7c35733990abc855c3a75ba3230c8e0bb33f9..9581ca1996d7e091ae58354224b09b49e2b7967b 100644 (file)
@@ -372,7 +372,7 @@ void do_citmail(char recp[], int dtype) {
                strcpy(recp, "");
                }
        else {
-               strcpy(targetroom, "Mail");
+               strcpy(targetroom, MAILROOM);
                }
 
        time(&now);
@@ -404,7 +404,7 @@ void do_citmail(char recp[], int dtype) {
                fprintf(temp, "O%s%c", targetroom, 0);
                }
        else {
-               fprintf(temp, "OMail%c", 0);
+               fprintf(temp, "O%s%c", MAILROOM, 0);
                }
 
        fprintf(temp,"N%s%c", nodebuf, 0);
index a678f13963797e9b4cb8b9f9f0853a9af3b7d420..d6f5be50ea7c10fe7d72045f548dcbc91215330d 100644 (file)
@@ -145,6 +145,23 @@ void set_wtmpsupp(char *newtext)
        }
 
 
+/*
+ * call set_wtmpsupp() with the name of the current room, modified a bit...
+ */
+void set_wtmpsupp_to_current_room() {
+       if (CC->quickroom.QRflags & QR_PRIVATE) {
+               set_wtmpsupp("<private room>");
+               }
+       else if (CC->quickroom.QRflags & QR_MAILBOX) {
+               set_wtmpsupp(&CC->quickroom.QRname[11]);
+               }
+       else {
+               set_wtmpsupp(CC->quickroom.QRname);
+               }
+       }
+
+
+
 /*
  * cmd_info()  -  tell the client about this server
  */
@@ -297,7 +314,7 @@ void cmd_iden(char *argbuf)
                strncpy(CC->cs_host,from_host,24);
                CC->cs_host[24] = 0;
                }
-       set_wtmpsupp(CC->quickroom.QRname);
+       set_wtmpsupp_to_current_room();
 
        syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
                dev_code,
@@ -339,7 +356,7 @@ void cmd_stel(char *cmdbuf)
                        CC->cs_flags = CC->cs_flags|CS_STEALTH;
                }
 
-       set_wtmpsupp(CC->quickroom.QRname);
+       set_wtmpsupp_to_current_room();
        cprintf("%d Ok\n",OK);
        }
 
index 9d6ef1286172f9d5b5935e2f93910c7b725e9c93..a07682c34aa446d2dfeb183dc64570791e873c63 100644 (file)
@@ -3,6 +3,7 @@ void master_startup (void);
 void master_cleanup (void);
 void cleanup_stuff (void *arg);
 void set_wtmpsupp (char *newtext);
+void set_wtmpsupp_to_current_room(void);
 void cmd_info (void);
 void cmd_rchg (char *newroomname);
 void cmd_hchg (char *newhostname);
index f6cbf4b9e4974106385007cd13e8898cd4ea2a1c..e1322aeaa00fea8a5ce5aa6d96873ced919bf48a 100644 (file)
@@ -848,6 +848,7 @@ void make_message(
        /* Don't confuse the poor folks if it's not routed mail. */
        strcpy(dest_node, "");
 
+
        /* If net_type is M_BINARY, split out the destination node. */
        if (net_type == M_BINARY) {
                strcpy(dest_node,NODENAME);
@@ -878,7 +879,14 @@ void make_message(
           fprintf(fp,"A%s%c",fake_name,0);
        else
           fprintf(fp,"A%s%c",author->fullname,0);      /* author */
-       fprintf(fp,"O%s%c",CC->quickroom.QRname,0);     /* room */
+
+       if (CC->quickroom.QRflags & QR_MAILBOX) {       /* room */
+               fprintf(fp,"O%s%c", &CC->quickroom.QRname[11], 0);
+               }
+       else {
+               fprintf(fp,"O%s%c",CC->quickroom.QRname,0);
+               }
+
        fprintf(fp,"N%s%c",NODENAME,0);                 /* nodename */
        fprintf(fp,"H%s%c",HUMANNODE,0);                /* human nodename */
 
index 69e0b33022d549992033ff0157b113d5781e8f7e..212ac5d63fcd3f04357730056187e6b441800792 100644 (file)
@@ -232,12 +232,15 @@ void PurgeStaleRelationships(void) {
                else {
                        purge = 0;
                        }
+
+               /*
                lprintf(9, "U/R REL: <%s> <%ld> <%ld> <%d> %s\n",
                        visits[a].v_roomname,
                        visits[a].v_generation,
                        visits[a].v_lastseen,
                        visits[a].v_flags,
                        (purge ? "**purging**" : "") );
+               */
 
                if (purge) {
                        memcpy(&visits[a], &visits[a+1],