/*
- * $Id$
* room listings and filters.
*/
HashList *GetWhoKnowsHash(StrBuf *Target, WCTemplputParams *TP)
{
- wcsession *WCC = WC;
StrBuf *Line;
StrBuf *Token;
long State;
if (GetServerStatus(Line, &State) == 1)
{
Whok = NewHash(1, Flathash);
- while(!Done && StrBuf_ServGetln(Line))
+ while(!Done && (StrBuf_ServGetln(Line) >= 0) )
if ( (StrLength(Line)==3) &&
!strcmp(ChrPtr(Line), "000"))
{
}
}
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);
StrBufTCP_read_line(Buf, &WC->serv_sock, 0, &Err); /* '100', we hope */
if (GetServerStatus(Buf, NULL) == 1)
{
- while(!Done && StrBuf_ServGetln(Buf))
+ while(!Done && StrBuf_ServGetln(Buf) >= 0)
if ( (StrLength(Buf)==3) &&
!strcmp(ChrPtr(Buf), "000"))
{
return WCC->Rooms;
}
+HashList *GetRoomListHashLPRM(StrBuf *Target, WCTemplputParams *TP)
+{
+ serv_puts("LPRM");
+ return GetRoomListHash(Target, TP);
+}
+
void FlushIgnetCfgs(folder *room)
{
FreeStrBuf(&room->Directory);
FreeStrBuf(&room->RoomAide);
FreeStrBuf(&room->XInfoText);
+ room->XHaveInfoTextLoaded = 0;
FreeStrBuf(&room->name);
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) == 1)
{
- while(!Done && StrBuf_ServGetln(Buf))
+ while(!Done && (StrBuf_ServGetln(Buf) >= 0))
if ( (StrLength(Buf)==3) &&
!strcmp(ChrPtr(Buf), "000"))
{
const char *Pos = NULL;
int Done = 0;
- while(!Done && StrBuf_ServGetln(Line))
+ while(!Done && (StrBuf_ServGetln(Line) >= 0))
if ( (StrLength(Line)==3) &&
!strcmp(ChrPtr(Line), "000"))
{
}
}
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];
}
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;
urlp = GetCount(WCC->Directory);
delta = Folder->nRoomNameParts - urlp + 1;
- lprintf(0, "\n->%s: %ld - %ld ", ChrPtr(Folder->name), urlp,
- Folder->nRoomNameParts);
+ syslog(0, "\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) {
- lprintf(0, "1\n");
+ syslog(0, "1\n");
return 0;
}
{
DeleteHashPos(&it);
- lprintf(0, "3\n");
+ syslog(0, "3\n");
return 0;
}
Dir = (StrBuf*) vDir;
ChrPtr(Dir)) != 0)
{
DeleteHashPos(&it);
- lprintf(0, "4\n");
+ syslog(0, "4\n");
return 0;
}
}
{
DeleteHashPos(&it);
- lprintf(0, "5\n");
+ syslog(0, "5\n");
return WCC->Hdr->HR.dav_depth == 1;
}
DeleteHashPos(&it);
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);