From 89f56875555882a824fa8e3f64559ec817f44d3c Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 11 Nov 1998 23:29:08 +0000 Subject: [PATCH] * citserver.c, msgbase.c, user_ops.c: hide the owner-prefix of mail rooms in a couple more places: set_wtmpsupp() and make_message() --- citadel/ChangeLog | 2 ++ citadel/citmail.c | 4 ++-- citadel/citserver.c | 21 +++++++++++++++++++-- citadel/citserver.h | 1 + citadel/msgbase.c | 10 +++++++++- citadel/user_ops.c | 3 +++ 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 82f152d19..95127e73e 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,5 +1,7 @@ Wed Nov 11 17:57:39 EST 1998 Art Cancro * 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 * serv_upgrade.c: fix uninitialized variable diff --git a/citadel/citmail.c b/citadel/citmail.c index 60f7c3573..9581ca199 100644 --- a/citadel/citmail.c +++ b/citadel/citmail.c @@ -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); diff --git a/citadel/citserver.c b/citadel/citserver.c index a678f1396..d6f5be50e 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -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(""); + } + 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); } diff --git a/citadel/citserver.h b/citadel/citserver.h index 9d6ef1286..a07682c34 100644 --- a/citadel/citserver.h +++ b/citadel/citserver.h @@ -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); diff --git a/citadel/msgbase.c b/citadel/msgbase.c index f6cbf4b9e..e1322aeaa 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -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 */ diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 69e0b3302..212ac5d63 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -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], -- 2.30.2