avoid calling GETR for the number of total/read messages
[citadel.git] / webcit / roomtokens.c
1 /*
2  * Lots of different room-related operations.
3  */
4
5 #include "webcit.h"
6 #include "webserver.h"
7
8
9 /*
10  * Embed the room banner
11  *
12  * got                  The information returned from a GOTO server command
13  * navbar_style         Determines which navigation buttons to display
14  *
15  */
16 void tmplput_roombanner(StrBuf *Target, WCTemplputParams *TP)
17 {
18         wcsession *WCC = WC;
19         
20         /* refresh current room states... */
21         /* dosen't work??? gotoroom(NULL); */
22         wc_printf("<div id=\"banner\">\n");
23
24         /* The browser needs some information for its own use */
25         wc_printf("<script type=\"text/javascript\">    \n"
26                   "     room_is_trash = %d;             \n"
27                   "</script>\n",
28                   ((WC->CurRoom.RAFlags & UA_ISTRASH) != 0)
29                 );
30
31         /*
32          * If the user happens to select the "make this my start page" link,
33          * we want it to remember the URL as a "/dotskip" one instead of
34          * a "skip" or "gotonext" or something like that.
35          */
36         if (WCC->Hdr->this_page == NULL) {
37                 WCC->Hdr->this_page = NewStrBuf();
38         }
39         StrBufPrintf(WCC->Hdr->this_page, 
40                      "dotskip?room=%s",
41                      ChrPtr(WC->CurRoom.name)
42                 );
43
44         do_template("roombanner", NULL);
45         /* roombanner contains this for mobile */
46         if (WC->is_mobile)
47                 return;
48
49         do_template("navbar", NULL);
50         wc_printf("</div>\n");
51 }
52
53
54 /*******************************************************************************
55  ********************** FLOOR Tokens *******************************************
56  ******************************************************************************/
57 void tmplput_FLOOR_ID(StrBuf *Target, WCTemplputParams *TP) 
58 {
59         Floor *myFloor = (Floor *)CTX;
60
61         StrBufAppendPrintf(Target, "%d", myFloor->ID);
62 }
63 void tmplput_ROOM_FLOORID(StrBuf *Target, WCTemplputParams *TP) 
64 {
65         folder *Folder = (folder *)CTX;
66         StrBufAppendPrintf(Target, "%d", Folder->floorid);
67 }
68 void tmplput_ROOM_FLOOR_ID(StrBuf *Target, WCTemplputParams *TP) 
69 {
70         folder *Folder = (folder *)CTX;
71         const Floor *pFloor = Folder->Floor;
72
73         if (pFloor == NULL)
74                 return;
75
76         StrBufAppendPrintf(Target, "%d", pFloor->ID);
77 }
78
79 void tmplput_ROOM_FLOOR_NAME(StrBuf *Target, WCTemplputParams *TP) 
80 {
81         folder *Folder = (folder *)CTX;
82         const Floor *pFloor = Folder->Floor;
83
84         if (pFloor == NULL)
85                 return;
86
87         StrBufAppendTemplate(Target, TP, pFloor->Name, 0);
88 }
89 void tmplput_ThisRoomFloorName(StrBuf *Target, WCTemplputParams *TP) 
90 {
91         wcsession *WCC = WC;
92         folder *Folder = &WCC->CurRoom;
93         const Floor *pFloor;
94
95         if (Folder == NULL)
96                 return;
97
98         pFloor = Folder->Floor;
99         if (pFloor == NULL)
100                 return;
101
102         StrBufAppendTemplate(Target, TP, pFloor->Name, 0);
103 }
104 void tmplput_FLOOR_NAME(StrBuf *Target, WCTemplputParams *TP) 
105 {
106         Floor *myFloor = (Floor *)CTX;
107
108         StrBufAppendTemplate(Target, TP, myFloor->Name, 0);
109 }
110
111 void tmplput_FLOOR_NROOMS(StrBuf *Target, WCTemplputParams *TP) 
112 {
113         Floor *myFloor = (Floor *)CTX;
114
115         StrBufAppendPrintf(Target, "%d", myFloor->NRooms);
116 }
117 void tmplput_ROOM_FLOOR_NROOMS(StrBuf *Target, WCTemplputParams *TP) 
118 {
119         folder *Folder = (folder *)CTX;
120         const Floor *pFloor = Folder->Floor;
121
122         if (pFloor == NULL)
123                 return;
124         StrBufAppendPrintf(Target, "%d", pFloor->NRooms);
125 }
126 int ConditionalFloorHaveNRooms(StrBuf *Target, WCTemplputParams *TP)
127 {
128         Floor *MyFloor = (Floor *)CTX;
129         int HaveN;
130
131         HaveN = GetTemplateTokenNumber(Target, TP, 0, 0);
132
133         return HaveN == MyFloor->NRooms;
134 }
135
136 int ConditionalFloorIsRESTSubFloor(StrBuf *Target, WCTemplputParams *TP)
137 {
138         wcsession  *WCC = WC;
139         Floor *MyFloor = (Floor *)CTX;
140         /** if we have dav_depth the client just wants the subfloors */
141         if ((WCC->Hdr->HR.dav_depth == 1) && 
142             (GetCount(WCC->Directory) == 0))
143                 return 1;
144         return WCC->CurrentFloor == MyFloor;
145 }
146 int ConditionalFloorIsSUBROOM(StrBuf *Target, WCTemplputParams *TP)
147 {
148         wcsession  *WCC = WC;
149         Floor *MyFloor = (Floor *)CTX;
150
151         return WCC->CurRoom.floorid == MyFloor->ID;
152 }
153
154
155 int ConditionalFloorIsVirtual(StrBuf *Target, WCTemplputParams *TP)
156 {
157         Floor *MyFloor = (Floor *)CTX;
158
159         return MyFloor->ID == VIRTUAL_MY_FLOOR;
160 }
161
162
163
164 /*******************************************************************************
165  ********************** ROOM Tokens ********************************************
166  ******************************************************************************/
167 /**** Name ******/
168 void tmplput_RoomName(StrBuf *Target, WCTemplputParams *TP)
169 {
170         StrBufAppendTemplate(Target, TP, WC->CurRoom.name, 0);
171 }
172 void tmplput_current_room(StrBuf *Target, WCTemplputParams *TP)
173 {
174         wcsession *WCC = WC;
175
176         if (WCC != NULL)
177                 StrBufAppendTemplate(Target, TP, 
178                                      WCC->CurRoom.name, 
179                                      0); 
180 }
181 void tmplput_ROOM_NAME(StrBuf *Target, WCTemplputParams *TP) 
182 {
183         folder *Folder = (folder *)CTX;
184
185         if (Folder == NULL)
186         {
187                 wcsession *WCC = WC;
188
189                 if (WCC == NULL)
190                         return;
191                 Folder = &WCC->CurRoom;
192         }
193         StrBufAppendTemplate(Target, TP, Folder->name, 0);
194 }
195 void tmplput_ROOM_BASENAME(StrBuf *Target, WCTemplputParams *TP) 
196 {
197         folder *room = (folder *)CTX;
198
199         if (room->nRoomNameParts > 1)
200                 StrBufAppendTemplate(Target, TP, 
201                                       room->RoomNameParts[room->nRoomNameParts - 1], 0);
202         else 
203                 StrBufAppendTemplate(Target, TP, room->name, 0);
204 }
205 void tmplput_ROOM_LEVEL_N_TIMES(StrBuf *Target, WCTemplputParams *TP) 
206 {
207         folder *room = (folder *)CTX;
208         int i;
209         const char *AppendMe;
210         long AppendMeLen;
211
212
213         if (room->nRoomNameParts > 1)
214         {
215                 GetTemplateTokenString(Target, TP, 0, &AppendMe, &AppendMeLen);
216                 for (i = 0; i < room->nRoomNameParts; i++)
217                         StrBufAppendBufPlain(Target, AppendMe, AppendMeLen, 0);
218         }
219 }
220 int ConditionalRoomIsInbox(StrBuf *Target, WCTemplputParams *TP)
221 {
222         folder *Folder = (folder *)CTX;
223         return Folder->is_inbox;
224 }
225
226 /****** Properties ******/
227 int ConditionalThisRoomHas_QRFlag(StrBuf *Target, WCTemplputParams *TP)
228 {
229         long QR_CheckFlag;
230         wcsession *WCC = WC;
231         
232         QR_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
233         if (QR_CheckFlag == 0)
234                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
235                                  "requires one of the #\"QR*\"- defines or an integer flag 0 is invalid!");
236         
237         if (WCC == NULL)
238                 return 0;
239
240         if ((TP->Tokens->Params[2]->MaskBy == eOR) ||
241             (TP->Tokens->Params[2]->MaskBy == eNO))
242                 return (WCC->CurRoom.QRFlags & QR_CheckFlag) != 0;
243         else
244                 return (WCC->CurRoom.QRFlags & QR_CheckFlag) == QR_CheckFlag;
245 }
246 int ConditionalRoomHas_QRFlag(StrBuf *Target, WCTemplputParams *TP)
247 {
248         long QR_CheckFlag;
249         folder *Folder = (folder *)(TP->Context);
250
251         QR_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
252         if (QR_CheckFlag == 0)
253                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
254                                  "requires one of the #\"QR*\"- defines or an integer flag 0 is invalid!");
255
256         if ((TP->Tokens->Params[2]->MaskBy == eOR) ||
257             (TP->Tokens->Params[2]->MaskBy == eNO))
258                 return (Folder->QRFlags & QR_CheckFlag) != 0;
259         else
260                 return (Folder->QRFlags & QR_CheckFlag) == QR_CheckFlag;
261 }
262 void tmplput_ROOM_QRFLAGS(StrBuf *Target, WCTemplputParams *TP) 
263 {
264         folder *Folder = (folder *)CTX;
265         StrBufAppendPrintf(Target, "%d", Folder->QRFlags);
266 }
267
268
269 int ConditionalThisRoomHas_QRFlag2(StrBuf *Target, WCTemplputParams *TP)
270 {
271         long QR2_CheckFlag;
272         wcsession *WCC = WC;
273         
274         QR2_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
275         if (QR2_CheckFlag == 0)
276                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
277                                  "requires one of the #\"QR2*\"- defines or an integer flag 0 is invalid!");
278
279         
280         if (WCC == NULL)
281                 return 0;
282
283         if ((TP->Tokens->Params[2]->MaskBy == eOR) ||
284             (TP->Tokens->Params[2]->MaskBy == eNO))
285                 return (WCC->CurRoom.QRFlags2 & QR2_CheckFlag) != 0;
286         else
287                 return (WCC->CurRoom.QRFlags2 & QR2_CheckFlag) == QR2_CheckFlag;
288 }
289 int ConditionalRoomHas_QRFlag2(StrBuf *Target, WCTemplputParams *TP)
290 {
291         long QR2_CheckFlag;
292         folder *Folder = (folder *)(TP->Context);
293
294         QR2_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
295         if (QR2_CheckFlag == 0)
296                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
297                                  "requires one of the #\"QR2*\"- defines or an integer flag 0 is invalid!");
298         return ((Folder->QRFlags2 & QR2_CheckFlag) != 0);
299 }
300
301 int ConditionalRoomHas_UAFlag(StrBuf *Target, WCTemplputParams *TP)
302 {
303         folder *Folder = (folder *)(TP->Context);
304         long UA_CheckFlag;
305                 
306         UA_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
307         if (UA_CheckFlag == 0)
308                 LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
309                                  "requires one of the #\"UA_*\"- defines or an integer flag 0 is invalid!");
310
311         return ((Folder->RAFlags & UA_CheckFlag) != 0);
312 }
313
314
315
316
317
318 void tmplput_ROOM_ACL(StrBuf *Target, WCTemplputParams *TP) 
319 {
320         folder *Folder = (folder *)CTX;
321
322         StrBufAppendPrintf(Target, "%ld", Folder->RAFlags, 0);
323 }
324
325
326
327 void tmplput_ROOM_RAFLAGS(StrBuf *Target, WCTemplputParams *TP) 
328 {
329         folder *Folder = (folder *)(TP->Context);
330         StrBufAppendPrintf(Target, "%d", Folder->RAFlags);
331 }
332
333
334 void tmplput_ThisRoomAide(StrBuf *Target, WCTemplputParams *TP) 
335 {
336         wcsession *WCC = WC;
337
338         LoadRoomAide();
339
340         StrBufAppendTemplate(Target, TP, WCC->CurRoom.RoomAide, 0);
341 }
342 int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
343 {
344         wcsession *WCC = WC;
345         return (WCC != NULL)? 
346                 ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) : 0;
347 }
348
349 int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
350 {
351         wcsession *WCC = WC;
352         return (WCC == NULL)? 0 : 
353                 ( ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ||
354                    (WCC->CurRoom.is_inbox) || 
355                    (WCC->CurRoom.QRFlags2 & QR2_COLLABDEL) );
356 }
357
358
359
360 int ConditionalHaveRoomeditRights(StrBuf *Target, WCTemplputParams *TP)
361 {
362         wcsession *WCC = WC;
363
364         return ( (WCC!= NULL) && 
365                  ((WCC->axlevel >= 6) || 
366                   ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ||
367                   (WCC->CurRoom.is_inbox) ));
368 }
369 void tmplput_ThisRoomPass(StrBuf *Target, WCTemplputParams *TP) 
370 {
371         wcsession *WCC = WC;
372
373         LoadRoomXA();
374
375         StrBufAppendTemplate(Target, TP, WCC->CurRoom.XAPass, 0);
376 }
377
378
379
380
381
382
383 void tmplput_ThisRoom_nNewMessages(StrBuf *Target, WCTemplputParams *TP) 
384 {
385         wcsession *WCC = WC;
386
387         StrBufAppendPrintf(Target, "%d", WCC->CurRoom.nNewMessages);
388 }
389
390 void tmplput_ThisRoom_nTotalMessages(StrBuf *Target, WCTemplputParams *TP) 
391 {
392         wcsession *WCC = WC;
393
394         StrBufAppendPrintf(Target, "%d", WCC->CurRoom.nTotalMessages);
395 }
396
397
398
399
400
401
402 void tmplput_ThisRoomOrder(StrBuf *Target, WCTemplputParams *TP) 
403 {
404         wcsession *WCC = WC;
405
406         LoadRoomXA();
407
408         StrBufAppendPrintf(Target, "%d", WCC->CurRoom.Order);
409 }
410 int ConditionalThisRoomOrder(StrBuf *Target, WCTemplputParams *TP)
411 {
412         wcsession *WCC = WC;
413         long CheckThis;
414
415         if (WCC == NULL)
416                 return 0;
417
418         LoadRoomXA();
419
420         CheckThis = GetTemplateTokenNumber(Target, TP, 2, 0);
421         return CheckThis == WCC->CurRoom.Order;
422 }
423 void tmplput_ROOM_LISTORDER(StrBuf *Target, WCTemplputParams *TP) 
424 {
425         folder *Folder = (folder *)CTX;
426         StrBufAppendPrintf(Target, "%d", Folder->Order);
427 }
428
429
430
431
432
433 int ConditionalThisRoomXHavePic(StrBuf *Target, WCTemplputParams *TP)
434 {
435         wcsession *WCC = WC;
436         
437         if (WCC == NULL)
438                 return 0;
439
440         LoadXRoomPic();
441         return WCC->CurRoom.XHaveRoomPic == 1;
442 }
443
444
445 int ConditionalThisRoomXHaveInfoText(StrBuf *Target, WCTemplputParams *TP)
446 {
447         wcsession *WCC = WC;
448         
449         if (WCC == NULL)
450                 return 0;
451
452         LoadXRoomInfoText();
453         return (StrLength(WCC->CurRoom.XInfoText)>0);
454 }
455 void tmplput_ThisRoomInfoText(StrBuf *Target, WCTemplputParams *TP) 
456 {
457         wcsession *WCC = WC;
458
459         LoadXRoomInfoText();
460
461         StrBufAppendTemplate(Target, TP, WCC->CurRoom.XAPass, 1);
462 }
463
464
465
466
467
468
469
470
471 void tmplput_ROOM_LASTCHANGE(StrBuf *Target, WCTemplputParams *TP) 
472 {
473         folder *Folder = (folder *)CTX;
474         StrBufAppendPrintf(Target, "%d", Folder->lastchange);
475 }
476
477
478
479
480
481
482
483
484 void tmplput_ThisRoomDirectory(StrBuf *Target, WCTemplputParams *TP) 
485 {
486         wcsession *WCC = WC;
487
488         LoadRoomXA();
489
490         StrBufAppendTemplate(Target, TP, WCC->CurRoom.Directory, 0);
491 }
492 void tmplput_ThisRoomXNFiles(StrBuf *Target, WCTemplputParams *TP) 
493 {
494         wcsession *WCC = WC;
495
496         LoadXRoomXCountFiles();
497
498         StrBufAppendPrintf(Target, "%d", WCC->CurRoom.XDownloadCount);
499 }
500
501 void tmplput_ThisRoomX_FileString(StrBuf *Target, WCTemplputParams *TP) 
502 {
503         wcsession *WCC = WC;
504
505         LoadXRoomXCountFiles();
506
507         if (WCC->CurRoom.XDownloadCount == 1)
508                 StrBufAppendBufPlain(Target, _("file"), -1, 0);
509         else
510                 StrBufAppendBufPlain(Target, _("files"), -1, 0);
511 }
512
513
514 void 
515 InitModule_ROOMTOKENS
516 (void)
517 {
518         RegisterNamespace("ROOMBANNER", 0, 1, tmplput_roombanner, NULL, CTX_NONE);
519
520         RegisterNamespace("FLOOR:ID", 0, 0, tmplput_FLOOR_ID, NULL, CTX_FLOORS);
521         RegisterNamespace("ROOM:INFO:FLOORID", 0, 1, tmplput_ROOM_FLOORID, NULL, CTX_ROOMS);
522         RegisterNamespace("ROOM:INFO:FLOOR:ID", 0, 0, tmplput_ROOM_FLOOR_ID, NULL, CTX_ROOMS);
523
524         RegisterNamespace("FLOOR:NAME", 0, 1, tmplput_FLOOR_NAME, NULL, CTX_FLOORS);
525         RegisterNamespace("ROOM:INFO:FLOOR:NAME", 0, 1, tmplput_ROOM_FLOOR_NAME, NULL, CTX_ROOMS);
526         RegisterNamespace("THISROOM:FLOOR:NAME", 0, 1, tmplput_ThisRoomFloorName, NULL, CTX_NONE);
527
528         RegisterNamespace("FLOOR:NROOMS", 0, 0, tmplput_FLOOR_NROOMS, NULL, CTX_FLOORS);
529         RegisterNamespace("ROOM:INFO:FLOOR:NROOMS", 0, 0, tmplput_ROOM_FLOOR_NROOMS, NULL, CTX_ROOMS);
530
531         RegisterConditional(HKEY("COND:FLOOR:ISSUBROOM"), 0, ConditionalFloorIsSUBROOM, CTX_FLOORS);
532         RegisterConditional(HKEY("COND:FLOOR:NROOMS"), 1, ConditionalFloorHaveNRooms, CTX_FLOORS);
533         RegisterConditional(HKEY("COND:ROOM:REST:ISSUBFLOOR"), 0, ConditionalFloorIsRESTSubFloor, CTX_FLOORS);
534         RegisterConditional(HKEY("COND:FLOOR:ISVIRTUAL"), 0, ConditionalFloorIsVirtual, CTX_FLOORS);
535
536         /**** Room... ******/
537         /**** Name ******/
538         RegisterNamespace("ROOMNAME", 0, 1, tmplput_RoomName, NULL, CTX_NONE);
539         RegisterNamespace("CURRENT_ROOM", 0, 1, tmplput_current_room, NULL, CTX_NONE);
540         RegisterNamespace("ROOM:INFO:NAME", 0, 1, tmplput_ROOM_NAME, NULL, CTX_ROOMS);
541         RegisterNamespace("ROOM:INFO:PRINT_NAME", 0, 1, tmplput_ROOM_NAME, NULL, CTX_NONE);
542         RegisterNamespace("ROOM:INFO:BASENAME", 0, 1, tmplput_ROOM_BASENAME, NULL, CTX_ROOMS);
543         RegisterNamespace("ROOM:INFO:LEVELNTIMES", 1, 2, tmplput_ROOM_LEVEL_N_TIMES, NULL, CTX_ROOMS);
544         RegisterConditional(HKEY("COND:ROOM:INFO:IS_INBOX"), 0, ConditionalRoomIsInbox, CTX_ROOMS);
545
546         /****** Properties ******/
547         RegisterNamespace("ROOM:INFO:QRFLAGS", 0, 1, tmplput_ROOM_QRFLAGS, NULL, CTX_ROOMS);
548         RegisterConditional(HKEY("COND:THISROOM:FLAG:QR"), 0, ConditionalThisRoomHas_QRFlag, CTX_NONE);
549         RegisterConditional(HKEY("COND:ROOM:FLAG:QR"), 0, ConditionalRoomHas_QRFlag, CTX_ROOMS);
550
551         RegisterConditional(HKEY("COND:THISROOM:FLAG:QR2"), 0, ConditionalThisRoomHas_QRFlag2, CTX_NONE);
552         RegisterConditional(HKEY("COND:ROOM:FLAG:QR2"), 0, ConditionalRoomHas_QRFlag2, CTX_ROOMS);
553
554         RegisterConditional(HKEY("COND:ROOM:FLAG:UA"), 0, ConditionalRoomHas_UAFlag, CTX_ROOMS);
555         RegisterNamespace("ROOM:INFO:RAFLAGS", 0, 1, tmplput_ROOM_RAFLAGS, NULL, CTX_ROOMS);
556
557
558         RegisterNamespace("ROOM:INFO:LISTORDER", 0, 1, tmplput_ROOM_LISTORDER, NULL, CTX_ROOMS);
559         RegisterNamespace("THISROOM:ORDER", 0, 0, tmplput_ThisRoomOrder, NULL, CTX_NONE);
560         RegisterConditional(HKEY("COND:THISROOM:ORDER"), 0, ConditionalThisRoomOrder, CTX_NONE);
561
562         RegisterNamespace("ROOM:INFO:LASTCHANGE", 0, 1, tmplput_ROOM_LASTCHANGE, NULL, CTX_ROOMS);
563
564         RegisterNamespace("THISROOM:MSGS:NEW", 0, 0, tmplput_ThisRoom_nNewMessages, NULL, CTX_NONE);
565         RegisterNamespace("THISROOM:MSGS:TOTAL", 0, 0, tmplput_ThisRoom_nTotalMessages, NULL, CTX_NONE);
566
567         RegisterNamespace("THISROOM:PASS", 0, 1, tmplput_ThisRoomPass, NULL, CTX_NONE);
568         RegisterNamespace("THISROOM:AIDE", 0, 1, tmplput_ThisRoomAide, NULL, CTX_NONE);
569         RegisterConditional(HKEY("COND:ROOMAIDE"), 2, ConditionalRoomAide, CTX_NONE);
570         RegisterConditional(HKEY("COND:ACCESS:DELETE"), 2, ConditionalRoomAcessDelete, CTX_NONE);
571         RegisterConditional(HKEY("COND:ROOM:EDITACCESS"), 0, ConditionalHaveRoomeditRights, CTX_NONE);
572
573         RegisterConditional(HKEY("COND:THISROOM:HAVE_PIC"), 0, ConditionalThisRoomXHavePic, CTX_NONE);
574
575         RegisterNamespace("THISROOM:INFOTEXT", 1, 2, tmplput_ThisRoomInfoText, NULL, CTX_NONE);
576         RegisterConditional(HKEY("COND:THISROOM:HAVE_INFOTEXT"), 0, ConditionalThisRoomXHaveInfoText, CTX_NONE);
577
578         RegisterNamespace("THISROOM:FILES:N", 0, 1, tmplput_ThisRoomXNFiles, NULL, CTX_NONE);
579         RegisterNamespace("THISROOM:FILES:STR", 0, 1, tmplput_ThisRoomX_FileString, NULL, CTX_NONE);
580         RegisterNamespace("THISROOM:DIRECTORY", 0, 1, tmplput_ThisRoomDirectory, NULL, CTX_NONE);
581
582
583
584
585
586
587         RegisterNamespace("ROOM:INFO:ACL", 0, 1, tmplput_ROOM_ACL, NULL, CTX_ROOMS);
588 }