Mail rooms now hide their owner-prefix from the client.
authorArt Cancro <ajc@citadel.org>
Thu, 22 Oct 1998 02:25:59 +0000 (02:25 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 22 Oct 1998 02:25:59 +0000 (02:25 +0000)
citadel/ChangeLog
citadel/room_ops.c
citadel/room_ops.h
citadel/user_ops.c

index cceec5badd18d8578d6b96f2e15ddc5c3cf8c545..2f8a5eebe2dc34622ce77425af250142628bbc16 100644 (file)
@@ -1,3 +1,6 @@
+Wed Oct 21 22:24:48 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * Mail rooms now hide their owner-prefix from the client.
+
 1998-10-20 Nathan Bryant <bryant@cs.usm.maine.edu>
        * Makefile.tmpl: fix to build client with old Configure script
        * configure.in: autologin defaults to enabled if crypt() is available
index 5a2a317c9b431e0f4870b2164e65479644715787..fe722e7825c45abe9505a0b03343c3a102c37cc7 100644 (file)
@@ -459,6 +459,29 @@ void GetExpirePolicy(struct ExpirePolicy *epbuf, struct quickroom *qrbuf) {
        }
 
 
+/*
+ * Back-back-end for all room listing commands
+ */
+void list_roomname(struct quickroom *qrbuf) {
+       char truncated_roomname[ROOMNAMELEN];
+
+       /* For mailbox rooms, chop off the owner prefix */
+       if (qrbuf->QRflags & QR_MAILBOX) {
+               strcpy(truncated_roomname, qrbuf->QRname);
+               strcpy(truncated_roomname, &truncated_roomname[11]);
+               cprintf("%s", truncated_roomname);
+               }
+
+       /* For all other rooms, just display the name in its entirety */
+       else {  
+               cprintf("%s", qrbuf->QRname);
+               }
+
+       /* ...and now the other parameters */
+       cprintf("|%u|%d\n",
+               qrbuf->QRflags,qrbuf->QRfloor);
+       }
+
 
 /* 
  * cmd_lrms()   -  List all accessible rooms, known or forgotten
@@ -468,8 +491,7 @@ void cmd_lrms_backend(struct quickroom *qrbuf) {
             & (UA_KNOWN | UA_ZAPPED)))
        && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
           ||((CC->FloorBeingSearched)<0)) ) 
-               cprintf("%s|%u|%d\n",
-                       qrbuf->QRname,qrbuf->QRflags,qrbuf->QRfloor);
+               list_roomname(qrbuf);
        }
 
 void cmd_lrms(char *argbuf)
@@ -503,8 +525,7 @@ void cmd_lkra_backend(struct quickroom *qrbuf) {
             & (UA_KNOWN)))
        && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
           ||((CC->FloorBeingSearched)<0)) ) 
-               cprintf("%s|%u|%d\n",
-                       qrbuf->QRname,qrbuf->QRflags,qrbuf->QRfloor);
+               list_roomname(qrbuf);
        }
 
 void cmd_lkra(char *argbuf)
@@ -541,8 +562,7 @@ void cmd_lkrn_backend(struct quickroom *qrbuf) {
           && (ra & UA_HASNEWMSGS)
           && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
              ||((CC->FloorBeingSearched)<0)) )
-               cprintf("%s|%u|%d\n",
-                       qrbuf->QRname,qrbuf->QRflags,qrbuf->QRfloor);
+               list_roomname(qrbuf);
        }
 
 void cmd_lkrn(char *argbuf)
@@ -579,8 +599,7 @@ void cmd_lkro_backend(struct quickroom *qrbuf) {
           && ((ra & UA_HASNEWMSGS)==0)
           && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
              ||((CC->FloorBeingSearched)<0)) )
-               cprintf("%s|%u|%d\n",
-                       qrbuf->QRname,qrbuf->QRflags,qrbuf->QRfloor);
+               list_roomname(qrbuf);
        }
 
 void cmd_lkro(char *argbuf)
@@ -617,8 +636,7 @@ void cmd_lzrm_backend(struct quickroom *qrbuf) {
           && (ra & UA_ZAPPED)
           && ((qrbuf->QRfloor == (CC->FloorBeingSearched))
              ||((CC->FloorBeingSearched)<0)) )
-               cprintf("%s|%u|%d\n",
-                       qrbuf->QRname,qrbuf->QRflags,qrbuf->QRfloor);
+               list_roomname(qrbuf);
        }
 
 void cmd_lzrm(char *argbuf)
@@ -654,6 +672,7 @@ void usergoto(char *where, int display_result)
        int raideflag;
        int newmailcount = 0;
        struct visit vbuf;
+       char truncated_roomname[ROOMNAMELEN];
 
        strcpy(CC->quickroom.QRname, where);
        getroom(&CC->quickroom, where);
@@ -690,9 +709,14 @@ void usergoto(char *where, int display_result)
           || (CC->usersupp.axlevel>=6) )  raideflag = 1;
        else raideflag = 0;
 
+       strcpy(truncated_roomname, CC->quickroom.QRname);
+       if (CC->quickroom.QRflags & QR_MAILBOX) {
+               strcpy(truncated_roomname, &truncated_roomname[11]);
+               }
+
        if (display_result) cprintf("%d%c%s|%d|%d|%d|%d|%ld|%ld|%d|%d|%d|%d\n",
                OK,check_express(),
-               CC->quickroom.QRname,
+               truncated_roomname,
                new_messages, total_messages,
                info,CC->quickroom.QRflags,
                CC->quickroom.QRhighest,
@@ -717,7 +741,9 @@ void cmd_goto(char *gargs)
        int c;
        int ok = 0;
        int ra;
-       char bbb[ROOMNAMELEN],towhere[256],password[256];
+       char augmented_roomname[256];
+       char towhere[256];
+       char password[256];
 
        if ((!(CC->logged_in)) && (!(CC->internal_pgm))) {
                cprintf("%d not logged in\n",ERROR+NOT_LOGGED_IN);
@@ -727,7 +753,6 @@ void cmd_goto(char *gargs)
        extract(towhere,gargs,0);
        extract(password,gargs,1);
 
-       c=0;
        getuser(&CC->usersupp, CC->curr_user);
 
        if (!strcasecmp(towhere, "_BASEROOM_"))
@@ -740,13 +765,24 @@ void cmd_goto(char *gargs)
                strcpy(towhere, config.c_twitroom);
 
 
-       /* let internal programs go directly to any room */
-       if (((CC->internal_pgm))&&(!strcasecmp(bbb,towhere))) {
-               usergoto(towhere, 1);
-               return;
+       /* First try a regular match */
+       c = getroom(&QRscratch, towhere);
+
+       /* Then try a mailbox name match */
+       if (c != 0) {
+               MailboxName(augmented_roomname, &CC->usersupp, towhere);
+               c = getroom(&QRscratch, augmented_roomname);
+               if (c == 0) strcpy(towhere, augmented_roomname);
                }
 
-       if (getroom(&QRscratch, towhere) == 0) {
+       /* And if the room was found... */
+       if (c == 0) {
+
+               /* let internal programs go directly to any room */
+               if (CC->internal_pgm) {
+                       usergoto(towhere, 1);
+                       return;
+                       }
 
                /* See if there is an existing user/room relationship */
                ra = CtdlRoomAccess(&QRscratch, &CC->usersupp);
index 77aac6828dc31a2c8d0b56debba8ff38c026c24c..a1305cb45a5a292e5fe39b4d4a89a9a868c763ee 100644 (file)
@@ -47,3 +47,4 @@ void ForEachRoom(void (*CallBack)(struct quickroom *EachRoom));
 void assoc_file_name(char *buf, struct quickroom *qrbuf, char *prefix);
 void delete_room(struct quickroom *qrbuf);
 void GetExpirePolicy(struct ExpirePolicy *epbuf, struct quickroom *qrbuf);
+void list_roomname(struct quickroom *qrbuf);
index c01f080d96c46f4e7007633f427a80ad0fba4bd2..41ce4a8c9fea3591ab1ae78a93607de04ba9b402 100644 (file)
@@ -432,8 +432,6 @@ void cmd_pass(char *buf)
                strproc(password);
                strproc(CC->usersupp.password);
                code = strcasecmp(CC->usersupp.password,password);
-               lprintf(9, "Got <%s>, looking for <%s>\n",
-                       password, CC->usersupp.password);
                }
        else {
                p = (struct passwd *)getpwuid(CC->usersupp.USuid);