From 8672fe68de859968c00739f0075a1d38b9696a23 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Fri, 6 Aug 2010 18:55:04 +0000 Subject: [PATCH] * new tokens for THISROOM:MSGS:NEW THISROOM:MSGS:TOTAL --- webcit/roomops.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/webcit/roomops.c b/webcit/roomops.c index 970c4a0c8..ea6acbef2 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1033,6 +1033,23 @@ void tmplput_CurrentRoomDefView(StrBuf *Target, WCTemplputParams *TP) 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) { @@ -3494,6 +3511,9 @@ InitModule_ROOMOPS 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); -- 2.30.2