From: Wilfried Göesgens Date: Fri, 6 Aug 2010 18:55:04 +0000 (+0000) Subject: * new tokens for THISROOM:MSGS:NEW THISROOM:MSGS:TOTAL X-Git-Tag: v8.01~949 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=8672fe68de859968c00739f0075a1d38b9696a23 * new tokens for THISROOM:MSGS:NEW THISROOM:MSGS:TOTAL --- 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);