with_files
);
svcallback("VIEWOMATIC", embed_view_o_matic);
- svcallback("START", offer_start_page);
do_template("roombanner", NULL);
/* roombanner contains this for mobile */
StrBufAppendTemplate(Target, TP, WCC->CurRoom.XAPass, 1);
}
+void LoadXRoomXCountFiles(void)
+{
+ wcsession *WCC = WC;
+ StrBuf *Buf;
+ int Done = 0;
+
+ if (WCC->CurRoom.XHaveDownloadCount)
+ return;
+
+ WCC->CurRoom.XHaveDownloadCount = 1;
+
+ Buf = NewStrBuf();
+ serv_puts("RDIR");
+ StrBuf_ServGetln(Buf);
+ if (GetServerStatus(Buf, NULL) == 1) {
+
+ while (!Done && StrBuf_ServGetln(Buf)>=0) {
+ if ( (StrLength(Buf)==3) &&
+ !strcmp(ChrPtr(Buf), "000"))
+ Done = 1;
+ else
+ WCC->CurRoom.XDownloadCount++;
+ }
+ }
+
+ FreeStrBuf (&Buf);
+}
+
+void tmplput_CurrentRoomXNFiles(StrBuf *Target, WCTemplputParams *TP)
+{
+ wcsession *WCC = WC;
+
+ LoadXRoomXCountFiles();
+
+ StrBufAppendPrintf(Target, "%d", WCC->CurRoom.XDownloadCount);
+}
+
+void tmplput_CurrentRoomX_FileString(StrBuf *Target, WCTemplputParams *TP)
+{
+ wcsession *WCC = WC;
+
+ LoadXRoomXCountFiles();
+
+ if (WCC->CurRoom.XDownloadCount == 1)
+ StrBufAppendBufPlain(Target, _("file"), -1, 0);
+ else
+ StrBufAppendBufPlain(Target, _("files"), -1, 0);
+}
+
void tmplput_CurrentRoomPass(StrBuf *Target, WCTemplputParams *TP)
{
wcsession *WCC = WC;
StrBufAppendPrintf(Target, "%d", WCC->CurRoom.DefView);
}
+void tmplput_CurrentRoom_nNewMessages(StrBuf *Target, WCTemplputParams *TP)
+{
+ wcsession *WCC = WC;
+
+ LoadRoomXA();
+
+ StrBufAppendPrintf(Target, "%d", WCC->CurRoom.nNewMessages);
+}
+
+void tmplput_CurrentRoom_nTotalMessages(StrBuf *Target, WCTemplputParams *TP)
+{
+ wcsession *WCC = WC;
+
+ LoadRoomXA();
+
+ StrBufAppendPrintf(Target, "%d", WCC->CurRoom.nTotalMessages);
+}
int ConditionalThisRoomOrder(StrBuf *Target, WCTemplputParams *TP)
{
RegisterConditional(HKEY("COND:ROOM:FLAG:UA"), 0, ConditionalRoomHas_UAFlag, CTX_ROOMS);
RegisterIterator("ITERATE:THISROOM:WHO_KNOWS", 0, NULL, GetWhoKnowsHash, NULL, DeleteHash, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
+ RegisterNamespace("THISROOM:MSGS:NEW", 0, 0, tmplput_CurrentRoom_nNewMessages, NULL, CTX_NONE);
+ RegisterNamespace("THISROOM:MSGS:TOTAL", 0, 0, tmplput_CurrentRoom_nTotalMessages, NULL, CTX_NONE);
+
RegisterNamespace("THISROOM:FLOOR:NAME", 0, 1, tmplput_CurrentRoomFloorName, NULL, CTX_NONE);
RegisterNamespace("THISROOM:AIDE", 0, 1, tmplput_CurrentRoomAide, NULL, CTX_NONE);
RegisterNamespace("THISROOM:PASS", 0, 1, tmplput_CurrentRoomPass, NULL, CTX_NONE);
RegisterConditional(HKEY("COND:THISROOM:DEFAULT_VIEW"), 0, ConditionalThisRoomDefView, CTX_NONE);
RegisterConditional(HKEY("COND:THISROOM:HAVE_PIC"), 0, ConditionalThisRoomXHavePic, CTX_NONE);
RegisterConditional(HKEY("COND:THISROOM:HAVE_INFOTEXT"), 0, ConditionalThisRoomXHaveInfoText, CTX_NONE);
-
+ RegisterNamespace("THISROOM:FILES:N", 0, 1, tmplput_CurrentRoomXNFiles, NULL, CTX_NONE);
+ RegisterNamespace("THISROOM:FILES:STR", 0, 1, tmplput_CurrentRoomX_FileString, NULL, CTX_NONE);
REGISTERTokenParamDefine(QR_PERMANENT);
REGISTERTokenParamDefine(QR_INUSE);