]> code.citadel.org Git - citadel.git/commitdiff
fix for above
authorArt Cancro <ajc@citadel.org>
Tue, 25 Oct 2005 03:10:18 +0000 (03:10 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 25 Oct 2005 03:10:18 +0000 (03:10 +0000)
citadel/msgbase.c
citadel/room_ops.c
citadel/room_ops.h

index dfb033cef4da19bb58661dfe4652144e46ac6378..88bcff6b42114c2db92644c3b3986b411b98d204 100644 (file)
@@ -3362,6 +3362,7 @@ void cmd_move(char *args)
 
        num = extract_long(args, 0);
        extract_token(targ, args, 1, '|', sizeof targ);
+       convert_room_name_macros(targ, sizeof targ);
        targ[ROOMNAMELEN - 1] = 0;
        is_copy = extract_int(args, 2);
 
index 46490bd9dd0702c783681ec3f83aff7cc3746e91..3d90b405c23564edbd64dd9112d3ba070516f0a9 100644 (file)
@@ -910,6 +910,37 @@ void usergoto(char *where, int display_result, int transiently,
 }
 
 
+/*
+ * Handle some of the macro named rooms
+ */
+void convert_room_name_macros(char *towhere, size_t maxlen) {
+       if (!strcasecmp(towhere, "_BASEROOM_")) {
+               safestrncpy(towhere, config.c_baseroom, maxlen);
+       }
+       else if (!strcasecmp(towhere, "_MAIL_")) {
+               safestrncpy(towhere, MAILROOM, maxlen);
+       }
+       else if (!strcasecmp(towhere, "_TRASH_")) {
+               safestrncpy(towhere, USERTRASHROOM, maxlen);
+       }
+       else if (!strcasecmp(towhere, "_BITBUCKET_")) {
+               safestrncpy(towhere, config.c_twitroom, maxlen);
+       }
+       else if (!strcasecmp(towhere, "_CALENDAR_")) {
+               safestrncpy(towhere, USERCALENDARROOM, maxlen);
+       }
+       else if (!strcasecmp(towhere, "_TASKS_")) {
+               safestrncpy(towhere, USERTASKSROOM, maxlen);
+       }
+       else if (!strcasecmp(towhere, "_CONTACTS_")) {
+               safestrncpy(towhere, USERCONTACTSROOM, maxlen);
+       }
+       else if (!strcasecmp(towhere, "_NOTES_")) {
+               safestrncpy(towhere, USERNOTESROOM, maxlen);
+       }
+}
+
+
 /* 
  * cmd_goto()  -  goto a new room
  */
@@ -935,30 +966,7 @@ void cmd_goto(char *gargs)
        /*
         * Handle some of the macro named rooms
         */
-       if (!strcasecmp(towhere, "_BASEROOM_")) {
-               safestrncpy(towhere, config.c_baseroom, sizeof towhere);
-       }
-       else if (!strcasecmp(towhere, "_MAIL_")) {
-               safestrncpy(towhere, MAILROOM, sizeof towhere);
-       }
-       else if (!strcasecmp(towhere, "_TRASH_")) {
-               safestrncpy(towhere, USERTRASHROOM, sizeof towhere);
-       }
-       else if (!strcasecmp(towhere, "_BITBUCKET_")) {
-               safestrncpy(towhere, config.c_twitroom, sizeof towhere);
-       }
-       else if (!strcasecmp(towhere, "_CALENDAR_")) {
-               safestrncpy(towhere, USERCALENDARROOM, sizeof towhere);
-       }
-       else if (!strcasecmp(towhere, "_TASKS_")) {
-               safestrncpy(towhere, USERTASKSROOM, sizeof towhere);
-       }
-       else if (!strcasecmp(towhere, "_CONTACTS_")) {
-               safestrncpy(towhere, USERCONTACTSROOM, sizeof towhere);
-       }
-       else if (!strcasecmp(towhere, "_NOTES_")) {
-               safestrncpy(towhere, USERNOTESROOM, sizeof towhere);
-       }
+       convert_room_name_macros(towhere, sizeof towhere);
 
        /* First try a regular match */
        c = getroom(&QRscratch, towhere);
index f5b820a7fd23a95713fbe0243f751279ed606d20..b0fef7fb5560709b304c41403e493261f6183ad7 100644 (file)
@@ -60,6 +60,7 @@ void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
 int CtdlDoIHavePermissionToDeleteThisRoom(struct ctdlroom *qr);
 
 int CtdlRenameRoom(char *old_name, char *new_name, int new_floor);
+void convert_room_name_macros(char *towhere, size_t maxlen);
 /*
  * Possible return values for CtdlRenameRoom()
  */