Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[citadel.git] / webcit / roomlist.c
index d52351a23409d6f35cc598784ef0a0596ae3eb9a..5ade41ead4365c3069c5a69b2fe8577cc1ed3e6f 100644 (file)
@@ -7,7 +7,6 @@
 
 HashList *GetWhoKnowsHash(StrBuf *Target, WCTemplputParams *TP)
 {
-       wcsession *WCC = WC;
        StrBuf *Line;
        StrBuf *Token;
        long State;
@@ -42,8 +41,7 @@ HashList *GetWhoKnowsHash(StrBuf *Target, WCTemplputParams *TP)
                        }
        }
        else if (State == 550)
-               StrBufAppendBufPlain(WCC->ImportantMsg,
-                                    _("Higher access is required to access this function."), -1, 0);
+               AppendImportantMessage(_("Higher access is required to access this function."), -1);
 
 
        FreeStrBuf(&Line);
@@ -166,6 +164,12 @@ HashList *GetRoomListHashLKRA(StrBuf *Target, WCTemplputParams *TP)
        return WCC->Rooms;
 }
 
+HashList *GetRoomListHashLPRM(StrBuf *Target, WCTemplputParams *TP) 
+{
+       serv_puts("LPRM");
+       return GetRoomListHash(Target, TP);
+}
+
 
 void FlushIgnetCfgs(folder *room)
 {
@@ -387,9 +391,10 @@ HashList *GetNetConfigHash(StrBuf *Target, WCTemplputParams *TP)
                        }
        }
        else if (State == 550)
-               StrBufAppendBufPlain(WCC->ImportantMsg,
-                                    _("Higher access is required to access this function."), -1, 0);
+               AppendImportantMessage(_("Higher access is required to access this function."), -1);
 
+       FreeStrBuf(&Line);
+       FreeStrBuf(&Token);
 
        return WCC->CurRoom.IgnetCfgs[WantThisOne];
 }
@@ -590,7 +595,7 @@ int CompareRooms(const folder *room1, const folder *room2)
 int ConditionalRoomIsRESTSubRoom(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession  *WCC = WC;
-       folder     *Folder = (folder *)CTX;
+       folder     *Folder = (folder *)CTX(CTX_ROOMS);
        HashPos    *it;
        StrBuf     * Dir;
        void       *vDir;
@@ -682,6 +687,10 @@ InitModule_ROOMLIST
        RegisterIterator("LFLR", 0, NULL, GetFloorListHash, NULL, NULL, CTX_FLOORS, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
        RegisterIterator("LKRA", 0, NULL, GetRoomListHashLKRA, NULL, NULL, CTX_ROOMS, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
        RegisterIterator("LZRM", 0, NULL, GetZappedRoomListHash, NULL, DeleteHash, CTX_ROOMS, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
+       RegisterIterator("LPRM", 0, NULL, GetRoomListHashLPRM, NULL, DeleteHash, CTX_ROOMS, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
+
+
+
 
        RegisterConditional(HKEY("COND:ROOM:REST:ISSUBROOM"), 0, ConditionalRoomIsRESTSubRoom, CTX_ROOMS);