Fix default landing mechanism
[citadel.git] / webcit / roomlist.c
index 869a594fa8952f4543873e140ff7444746aa719e..d45db6dc8d999c6b6f3484092d8aeb210f316a2d 100644 (file)
@@ -427,6 +427,7 @@ HashList *GetThisRoomPossibleMAlias(StrBuf *Target, WCTemplputParams *TP)
        HashList *Domains;
        StrBuf *Line;
        StrBuf *Token;
+       StrBuf *RoomName;
        HashList *PossibleAliases = NULL;
        
        const char *pComma;
@@ -441,12 +442,15 @@ HashList *GetThisRoomPossibleMAlias(StrBuf *Target, WCTemplputParams *TP)
                return NULL;
        PossibleAliases = NewHash(1, NULL);
        Line = NewStrBuf();
+       RoomName = NewStrBufDup(WCC->CurRoom.name);
+       StrBufAsciify(RoomName, '_');
+       StrBufReplaceChars(RoomName, ' ', '_');
 
        AppendPossibleAliasWithDomain(PossibleAliases,
                                      &n,
                                      Domains,
                                      HKEY("room_"),
-                                     SKEY(WCC->CurRoom.name));
+                                     SKEY(RoomName));
 
 
        serv_puts("GNET "FILE_MAILALIAS);
@@ -502,7 +506,7 @@ HashList *GetThisRoomPossibleMAlias(StrBuf *Target, WCTemplputParams *TP)
                AppendImportantMessage(_("Higher access is required to access this function."), -1);
 
        FreeStrBuf(&Line);
-
+       FreeStrBuf(&RoomName);
        return PossibleAliases;
 }
 
@@ -869,13 +873,13 @@ int ConditionalRoomIsRESTSubRoom(StrBuf *Target, WCTemplputParams *TP)
        urlp = GetCount(WCC->Directory);
        delta = Folder->nRoomNameParts - urlp + 1;
 
-       syslog(0, "\n->%s: %d - %ld ", 
+       syslog(LOG_DEBUG, "\n->%s: %d - %ld ", 
               ChrPtr(Folder->name), 
               urlp, 
               Folder->nRoomNameParts);
        /* list only the floors which are in relation to the dav_depth header */
        if (WCC->Hdr->HR.dav_depth != delta) {
-               syslog(0, "1\n");
+               syslog(LOG_DEBUG, "1\n");
                return 0;
        }
 
@@ -895,7 +899,7 @@ int ConditionalRoomIsRESTSubRoom(StrBuf *Target, WCTemplputParams *TP)
                        {
                                DeleteHashPos(&it);
 
-                               syslog(0, "3\n");
+                               syslog(LOG_DEBUG, "3\n");
                                return 0;
                        }
                        Dir = (StrBuf*) vDir;
@@ -903,7 +907,7 @@ int ConditionalRoomIsRESTSubRoom(StrBuf *Target, WCTemplputParams *TP)
                                   ChrPtr(Dir)) != 0)
                        {
                                DeleteHashPos(&it);
-                               syslog(0, "4\n");
+                               syslog(LOG_DEBUG, "4\n");
                                return 0;
                        }
                }
@@ -917,7 +921,7 @@ int ConditionalRoomIsRESTSubRoom(StrBuf *Target, WCTemplputParams *TP)
                {
                        DeleteHashPos(&it);
                        
-                       syslog(0, "5\n");
+                       syslog(LOG_DEBUG, "5\n");
                        return WCC->Hdr->HR.dav_depth == 1;
                }
                DeleteHashPos(&it);