Back to index

webcit  8.12-dfsg
roomtokens.c
Go to the documentation of this file.
00001 /*
00002  * Lots of different room-related operations.
00003  *
00004  * Copyright (c) 1996-2012 by the citadel.org team
00005  *
00006  * This program is open source software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License, version 3.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #include "webcit.h"
00016 #include "webserver.h"
00017 
00018 
00019 /*
00020  * Embed the room banner
00021  *
00022  * got               The information returned from a GOTO server command
00023  * navbar_style      Determines which navigation buttons to display
00024  */
00025 void tmplput_roombanner(StrBuf *Target, WCTemplputParams *TP)
00026 {
00027        wcsession *WCC = WC;
00028        
00029        /* Refresh current room states.  Doesn't work? gotoroom(NULL); */
00030 
00031        wc_printf("<div id=\"banner\">\n");
00032 
00033        /* The browser needs some information for its own use */
00034        wc_printf("<script type=\"text/javascript\">     \n"
00035                 "    room_is_trash = %d;         \n"
00036                 "</script>\n",
00037                 ((WC->CurRoom.RAFlags & UA_ISTRASH) != 0)
00038        );
00039 
00040        /*
00041         * If the user happens to select the "make this my start page" link,
00042         * we want it to remember the URL as a "/dotskip" one instead of
00043         * a "skip" or "gotonext" or something like that.
00044         */
00045        if (WCC->Hdr->this_page == NULL) {
00046               WCC->Hdr->this_page = NewStrBuf();
00047        }
00048        StrBufPrintf(WCC->Hdr->this_page, "dotskip?room=%s", ChrPtr(WC->CurRoom.name));
00049 
00050        do_template("roombanner");
00051 
00052        do_template("navbar");
00053        wc_printf("</div>\n");
00054 }
00055 
00056 
00057 /*******************************************************************************
00058  ********************** FLOOR Tokens *******************************************
00059  *******************************************************************************/
00060 
00061 
00062 void tmplput_FLOOR_ID(StrBuf *Target, WCTemplputParams *TP) 
00063 {
00064        Floor *myFloor = (Floor *)CTX;
00065 
00066        StrBufAppendPrintf(Target, "%d", myFloor->ID);
00067 }
00068 
00069 
00070 void tmplput_ROOM_FLOORID(StrBuf *Target, WCTemplputParams *TP) 
00071 {
00072        folder *Folder = (folder *)CTX;
00073        StrBufAppendPrintf(Target, "%d", Folder->floorid);
00074 }
00075 
00076 
00077 void tmplput_ROOM_FLOOR_ID(StrBuf *Target, WCTemplputParams *TP) 
00078 {
00079        folder *Folder = (folder *)CTX;
00080        const Floor *pFloor = Folder->Floor;
00081 
00082        if (pFloor == NULL)
00083               return;
00084 
00085        StrBufAppendPrintf(Target, "%d", pFloor->ID);
00086 }
00087 
00088 
00089 void tmplput_ROOM_FLOOR_NAME(StrBuf *Target, WCTemplputParams *TP) 
00090 {
00091        folder *Folder = (folder *)CTX;
00092        const Floor *pFloor = Folder->Floor;
00093 
00094        if (pFloor == NULL)
00095               return;
00096 
00097        StrBufAppendTemplate(Target, TP, pFloor->Name, 0);
00098 }
00099 
00100 
00101 void tmplput_ThisRoomFloorName(StrBuf *Target, WCTemplputParams *TP) 
00102 {
00103        wcsession *WCC = WC;
00104        folder *Folder = &WCC->CurRoom;
00105        const Floor *pFloor;
00106 
00107        if (Folder == NULL)
00108               return;
00109 
00110        pFloor = Folder->Floor;
00111        if (pFloor == NULL)
00112               return;
00113 
00114        StrBufAppendTemplate(Target, TP, pFloor->Name, 0);
00115 }
00116 
00117 
00118 void tmplput_FLOOR_NAME(StrBuf *Target, WCTemplputParams *TP) 
00119 {
00120        Floor *myFloor = (Floor *)CTX;
00121 
00122        StrBufAppendTemplate(Target, TP, myFloor->Name, 0);
00123 }
00124 
00125 
00126 void tmplput_FLOOR_NROOMS(StrBuf *Target, WCTemplputParams *TP) 
00127 {
00128        Floor *myFloor = (Floor *)CTX;
00129 
00130        StrBufAppendPrintf(Target, "%d", myFloor->NRooms);
00131 }
00132 
00133 
00134 void tmplput_ROOM_FLOOR_NROOMS(StrBuf *Target, WCTemplputParams *TP) 
00135 {
00136        folder *Folder = (folder *)CTX;
00137        const Floor *pFloor = Folder->Floor;
00138 
00139        if (pFloor == NULL)
00140               return;
00141        StrBufAppendPrintf(Target, "%d", pFloor->NRooms);
00142 }
00143 
00144 
00145 int ConditionalFloorHaveNRooms(StrBuf *Target, WCTemplputParams *TP)
00146 {
00147        Floor *MyFloor = (Floor *)CTX;
00148        int HaveN;
00149 
00150        HaveN = GetTemplateTokenNumber(Target, TP, 0, 0);
00151 
00152        return HaveN == MyFloor->NRooms;
00153 }
00154 
00155 
00156 int ConditionalFloorIsRESTSubFloor(StrBuf *Target, WCTemplputParams *TP)
00157 {
00158        wcsession  *WCC = WC;
00159        Floor *MyFloor = (Floor *)CTX;
00161        if ((WCC->Hdr->HR.dav_depth == 1) && 
00162            (GetCount(WCC->Directory) == 0))
00163               return 1;
00164        return WCC->CurrentFloor == MyFloor;
00165 }
00166 
00167 
00168 int ConditionalFloorIsSUBROOM(StrBuf *Target, WCTemplputParams *TP)
00169 {
00170        wcsession  *WCC = WC;
00171        Floor *MyFloor = (Floor *)CTX;
00172 
00173        return WCC->CurRoom.floorid == MyFloor->ID;
00174 }
00175 
00176 
00177 int ConditionalFloorIsVirtual(StrBuf *Target, WCTemplputParams *TP)
00178 {
00179        Floor *MyFloor = (Floor *)CTX;
00180 
00181        return MyFloor->ID == VIRTUAL_MY_FLOOR;
00182 }
00183 
00184 
00185 /*******************************************************************************
00186  ********************** ROOM Tokens ********************************************
00187  *******************************************************************************/
00188 /**** Name ******/
00189 
00190 
00191 void tmplput_RoomName(StrBuf *Target, WCTemplputParams *TP)
00192 {
00193        StrBufAppendTemplate(Target, TP, WC->CurRoom.name, 0);
00194 }
00195 
00196 
00197 void tmplput_current_room(StrBuf *Target, WCTemplputParams *TP)
00198 {
00199        wcsession *WCC = WC;
00200 
00201        if (WCC != NULL) {
00202               StrBufAppendTemplate(Target, TP, 
00203                    WCC->CurRoom.name, 
00204                    0
00205               );
00206        }
00207 }
00208 
00209 
00210 void tmplput_ROOM_NAME(StrBuf *Target, WCTemplputParams *TP) 
00211 {
00212        folder *Folder = (folder *)CTX;
00213 
00214        if (Folder == NULL)
00215        {
00216               wcsession *WCC = WC;
00217 
00218               if (WCC == NULL)
00219                      return;
00220               Folder = &WCC->CurRoom;
00221        }
00222        StrBufAppendTemplate(Target, TP, Folder->name, 0);
00223 }
00224 
00225 
00226 void tmplput_ROOM_BASENAME(StrBuf *Target, WCTemplputParams *TP) 
00227 {
00228        folder *room = (folder *)CTX;
00229 
00230        if (room->nRoomNameParts > 1)
00231               StrBufAppendTemplate(Target, TP, 
00232                                   room->RoomNameParts[room->nRoomNameParts - 1], 0);
00233        else 
00234               StrBufAppendTemplate(Target, TP, room->name, 0);
00235 }
00236 
00237 
00238 void tmplput_ROOM_LEVEL_N_TIMES(StrBuf *Target, WCTemplputParams *TP) 
00239 {
00240        folder *room = (folder *)CTX;
00241        int i;
00242         const char *AppendMe;
00243         long AppendMeLen;
00244 
00245 
00246        if (room->nRoomNameParts > 1)
00247        {
00248               GetTemplateTokenString(Target, TP, 0, &AppendMe, &AppendMeLen);
00249               for (i = 0; i < room->nRoomNameParts; i++)
00250                      StrBufAppendBufPlain(Target, AppendMe, AppendMeLen, 0);
00251        }
00252 }
00253 
00254 
00255 int ConditionalRoomIsInbox(StrBuf *Target, WCTemplputParams *TP)
00256 {
00257        folder *Folder = (folder *)CTX;
00258        return Folder->is_inbox;
00259 }
00260 
00261 
00262 /****** Properties ******/
00263 int ConditionalRoom_MayEdit(StrBuf *Target, WCTemplputParams *TP)
00264 {
00265        wcsession *WCC = WC;
00266 
00267        LoadRoomXA ();
00268 
00269        return WCC->CurRoom.XALoaded == 1;
00270 }
00271 
00272 int ConditionalThisRoomHas_QRFlag(StrBuf *Target, WCTemplputParams *TP)
00273 {
00274        long QR_CheckFlag;
00275        wcsession *WCC = WC;
00276        
00277        QR_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
00278        if (QR_CheckFlag == 0)
00279               LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
00280                              "requires one of the #\"QR*\"- defines or an integer flag 0 is invalid!");
00281        
00282        if (WCC == NULL)
00283               return 0;
00284 
00285        if ((TP->Tokens->Params[2]->MaskBy == eOR) ||
00286            (TP->Tokens->Params[2]->MaskBy == eNO))
00287               return (WCC->CurRoom.QRFlags & QR_CheckFlag) != 0;
00288        else
00289               return (WCC->CurRoom.QRFlags & QR_CheckFlag) == QR_CheckFlag;
00290 }
00291 
00292 
00293 int ConditionalRoomHas_QRFlag(StrBuf *Target, WCTemplputParams *TP)
00294 {
00295        long QR_CheckFlag;
00296        folder *Folder = (folder *)(TP->Context);
00297 
00298        QR_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
00299        if (QR_CheckFlag == 0)
00300               LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
00301                              "requires one of the #\"QR*\"- defines or an integer flag 0 is invalid!");
00302 
00303        if ((TP->Tokens->Params[2]->MaskBy == eOR) ||
00304            (TP->Tokens->Params[2]->MaskBy == eNO))
00305               return (Folder->QRFlags & QR_CheckFlag) != 0;
00306        else
00307               return (Folder->QRFlags & QR_CheckFlag) == QR_CheckFlag;
00308 }
00309 
00310 
00311 void tmplput_ROOM_QRFLAGS(StrBuf *Target, WCTemplputParams *TP) 
00312 {
00313        folder *Folder = (folder *)CTX;
00314        StrBufAppendPrintf(Target, "%d", Folder->QRFlags);
00315 }
00316 
00317 
00318 int ConditionalThisRoomHas_QRFlag2(StrBuf *Target, WCTemplputParams *TP)
00319 {
00320        long QR2_CheckFlag;
00321        wcsession *WCC = WC;
00322        
00323        QR2_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
00324        if (QR2_CheckFlag == 0)
00325               LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
00326                              "requires one of the #\"QR2*\"- defines or an integer flag 0 is invalid!");
00327 
00328        
00329        if (WCC == NULL)
00330               return 0;
00331 
00332        if ((TP->Tokens->Params[2]->MaskBy == eOR) ||
00333            (TP->Tokens->Params[2]->MaskBy == eNO))
00334               return (WCC->CurRoom.QRFlags2 & QR2_CheckFlag) != 0;
00335        else
00336               return (WCC->CurRoom.QRFlags2 & QR2_CheckFlag) == QR2_CheckFlag;
00337 }
00338 
00339 
00340 int ConditionalRoomHas_QRFlag2(StrBuf *Target, WCTemplputParams *TP)
00341 {
00342        long QR2_CheckFlag;
00343        folder *Folder = (folder *)(TP->Context);
00344 
00345        QR2_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
00346        if (QR2_CheckFlag == 0)
00347               LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
00348                              "requires one of the #\"QR2*\"- defines or an integer flag 0 is invalid!");
00349        return ((Folder->QRFlags2 & QR2_CheckFlag) != 0);
00350 }
00351 
00352 
00353 int ConditionalRoomHas_UAFlag(StrBuf *Target, WCTemplputParams *TP)
00354 {
00355        folder *Folder = (folder *)(TP->Context);
00356        long UA_CheckFlag;
00357               
00358        UA_CheckFlag = GetTemplateTokenNumber(Target, TP, 2, 0);
00359        if (UA_CheckFlag == 0)
00360               LogTemplateError(Target, "Conditional", ERR_PARM1, TP,
00361                              "requires one of the #\"UA_*\"- defines or an integer flag 0 is invalid!");
00362 
00363        return ((Folder->RAFlags & UA_CheckFlag) != 0);
00364 }
00365 
00366 
00367 void tmplput_ROOM_ACL(StrBuf *Target, WCTemplputParams *TP) 
00368 {
00369        folder *Folder = (folder *)CTX;
00370 
00371        StrBufAppendPrintf(Target, "%ld", Folder->RAFlags, 0);
00372 }
00373 
00374 
00375 void tmplput_ROOM_RAFLAGS(StrBuf *Target, WCTemplputParams *TP) 
00376 {
00377        folder *Folder = (folder *)(TP->Context);
00378        StrBufAppendPrintf(Target, "%d", Folder->RAFlags);
00379 }
00380 
00381 
00382 void tmplput_ThisRoomAide(StrBuf *Target, WCTemplputParams *TP) 
00383 {
00384        wcsession *WCC = WC;
00385 
00386        LoadRoomAide();
00387 
00388        StrBufAppendTemplate(Target, TP, WCC->CurRoom.RoomAide, 0);
00389 }
00390 
00391 
00392 int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
00393 {
00394        wcsession *WCC = WC;
00395        return (WCC != NULL)? 
00396               ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) : 0;
00397 }
00398 
00399 
00400 int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
00401 {
00402        wcsession *WCC = WC;
00403        return (WCC == NULL)? 0 : 
00404               ( ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ||
00405                  (WCC->CurRoom.is_inbox) || 
00406                  (WCC->CurRoom.QRFlags2 & QR2_COLLABDEL) );
00407 }
00408 
00409 
00410 int ConditionalHaveRoomeditRights(StrBuf *Target, WCTemplputParams *TP)
00411 {
00412        wcsession *WCC = WC;
00413 
00414        return (      (WCC != NULL)
00415                      && (WCC->logged_in)
00416                      && (
00417                             (WCC->axlevel >= 6)
00418                             || ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0)
00419                             || (WCC->CurRoom.is_inbox)
00420                      )
00421               );
00422 }
00423 
00424 
00425 void tmplput_ThisRoomPass(StrBuf *Target, WCTemplputParams *TP) 
00426 {
00427        wcsession *WCC = WC;
00428 
00429        LoadRoomXA();
00430        StrBufAppendTemplate(Target, TP, WCC->CurRoom.XAPass, 0);
00431 }
00432 
00433 
00434 void tmplput_ThisRoom_nNewMessages(StrBuf *Target, WCTemplputParams *TP) 
00435 {
00436        wcsession *WCC = WC;
00437 
00438        StrBufAppendPrintf(Target, "%d", WCC->CurRoom.nNewMessages);
00439 }
00440 
00441 
00442 void tmplput_ThisRoom_nTotalMessages(StrBuf *Target, WCTemplputParams *TP) 
00443 {
00444        wcsession *WCC = WC;
00445 
00446        StrBufAppendPrintf(Target, "%d", WCC->CurRoom.nTotalMessages);
00447 }
00448 
00449 
00450 void tmplput_ThisRoomOrder(StrBuf *Target, WCTemplputParams *TP) 
00451 {
00452        wcsession *WCC = WC;
00453 
00454        LoadRoomXA();
00455 
00456        StrBufAppendPrintf(Target, "%d", WCC->CurRoom.Order);
00457 }
00458 
00459 
00460 int ConditionalThisRoomOrder(StrBuf *Target, WCTemplputParams *TP)
00461 {
00462        wcsession *WCC = WC;
00463        long CheckThis;
00464 
00465        if (WCC == NULL)
00466               return 0;
00467 
00468        LoadRoomXA();
00469 
00470        CheckThis = GetTemplateTokenNumber(Target, TP, 2, 0);
00471        return CheckThis == WCC->CurRoom.Order;
00472 }
00473 
00474 
00475 void tmplput_ROOM_LISTORDER(StrBuf *Target, WCTemplputParams *TP) 
00476 {
00477        folder *Folder = (folder *)CTX;
00478        StrBufAppendPrintf(Target, "%d", Folder->Order);
00479 }
00480 
00481 
00482 int ConditionalThisRoomXHavePic(StrBuf *Target, WCTemplputParams *TP)
00483 {
00484        wcsession *WCC = WC;
00485        
00486        if (WCC == NULL)
00487               return 0;
00488 
00489        LoadXRoomPic();
00490        return WCC->CurRoom.XHaveRoomPic == 1;
00491 }
00492 
00493 
00494 int ConditionalThisRoomXHaveInfoText(StrBuf *Target, WCTemplputParams *TP)
00495 {
00496        wcsession *WCC = WC;
00497        
00498        if (WCC == NULL)
00499               return 0;
00500 
00501        LoadXRoomInfoText();
00502        return (StrLength(WCC->CurRoom.XInfoText)>0);
00503 }
00504 
00505 
00506 void tmplput_ThisRoomInfoText(StrBuf *Target, WCTemplputParams *TP) 
00507 {
00508        wcsession *WCC = WC;
00509        long nchars = 0;
00510 
00511        LoadXRoomInfoText();
00512 
00513        nchars = GetTemplateTokenNumber(Target, TP, 0, 0);
00514        if (!nchars) {
00515               /* the whole thing */
00516               StrBufAppendTemplate(Target, TP, WCC->CurRoom.XInfoText, 1);
00517        }
00518        else {
00519               /* only a certain number of characters */
00520               StrBuf *SubBuf;
00521               SubBuf = NewStrBufDup(WCC->CurRoom.XInfoText);
00522               if (StrLength(SubBuf) > nchars) {
00523                      StrBuf_Utf8StrCut(SubBuf, nchars);
00524                      StrBufAppendBufPlain(SubBuf, HKEY("..."), 0);
00525               }
00526               StrBufAppendTemplate(Target, TP, SubBuf, 1);
00527               FreeStrBuf(&SubBuf);
00528        }
00529 }
00530 
00531 
00532 void tmplput_ROOM_LASTCHANGE(StrBuf *Target, WCTemplputParams *TP) 
00533 {
00534        folder *Folder = (folder *)CTX;
00535        StrBufAppendPrintf(Target, "%d", Folder->lastchange);
00536 }
00537 
00538 
00539 void tmplput_ThisRoomDirectory(StrBuf *Target, WCTemplputParams *TP) 
00540 {
00541        wcsession *WCC = WC;
00542 
00543        LoadRoomXA();
00544 
00545        StrBufAppendTemplate(Target, TP, WCC->CurRoom.Directory, 0);
00546 }
00547 
00548 
00549 void tmplput_ThisRoomXNFiles(StrBuf *Target, WCTemplputParams *TP) 
00550 {
00551        wcsession *WCC = WC;
00552 
00553        LoadXRoomXCountFiles();
00554 
00555        StrBufAppendPrintf(Target, "%d", WCC->CurRoom.XDownloadCount);
00556 }
00557 
00558 
00559 void tmplput_ThisRoomX_FileString(StrBuf *Target, WCTemplputParams *TP) 
00560 {
00561        wcsession *WCC = WC;
00562 
00563        LoadXRoomXCountFiles();
00564 
00565        if (WCC->CurRoom.XDownloadCount == 1)
00566               StrBufAppendBufPlain(Target, _("file"), -1, 0);
00567        else
00568               StrBufAppendBufPlain(Target, _("files"), -1, 0);
00569 }
00570 
00571 
00572 int ConditionalIsThisThatRoom(StrBuf *Target, WCTemplputParams *TP)
00573 {
00574        folder *Folder = (folder *)CTX;
00575        wcsession *WCC = WC;
00576 
00577        if (WCC == NULL)
00578               return 0;
00579 
00580        return Folder == WCC->ThisRoom;
00581 }
00582 
00583 
00584 void 
00585 InitModule_ROOMTOKENS
00586 (void)
00587 {
00588        RegisterNamespace("ROOMBANNER", 0, 1, tmplput_roombanner, NULL, CTX_NONE);
00589 
00590        RegisterNamespace("FLOOR:ID", 0, 0, tmplput_FLOOR_ID, NULL, CTX_FLOORS);
00591        RegisterNamespace("ROOM:INFO:FLOORID", 0, 1, tmplput_ROOM_FLOORID, NULL, CTX_ROOMS);
00592        RegisterNamespace("ROOM:INFO:FLOOR:ID", 0, 0, tmplput_ROOM_FLOOR_ID, NULL, CTX_ROOMS);
00593 
00594        RegisterNamespace("FLOOR:NAME", 0, 1, tmplput_FLOOR_NAME, NULL, CTX_FLOORS);
00595        RegisterNamespace("ROOM:INFO:FLOOR:NAME", 0, 1, tmplput_ROOM_FLOOR_NAME, NULL, CTX_ROOMS);
00596        RegisterNamespace("THISROOM:FLOOR:NAME", 0, 1, tmplput_ThisRoomFloorName, NULL, CTX_NONE);
00597 
00598        RegisterNamespace("FLOOR:NROOMS", 0, 0, tmplput_FLOOR_NROOMS, NULL, CTX_FLOORS);
00599        RegisterNamespace("ROOM:INFO:FLOOR:NROOMS", 0, 0, tmplput_ROOM_FLOOR_NROOMS, NULL, CTX_ROOMS);
00600 
00601        RegisterConditional(HKEY("COND:FLOOR:ISSUBROOM"), 0, ConditionalFloorIsSUBROOM, CTX_FLOORS);
00602        RegisterConditional(HKEY("COND:FLOOR:NROOMS"), 1, ConditionalFloorHaveNRooms, CTX_FLOORS);
00603        RegisterConditional(HKEY("COND:ROOM:REST:ISSUBFLOOR"), 0, ConditionalFloorIsRESTSubFloor, CTX_FLOORS);
00604        RegisterConditional(HKEY("COND:FLOOR:ISVIRTUAL"), 0, ConditionalFloorIsVirtual, CTX_FLOORS);
00605 
00606        /**** Room... ******/
00607         /**** Name ******/
00608        RegisterNamespace("ROOMNAME", 0, 1, tmplput_RoomName, NULL, CTX_NONE);
00609        RegisterNamespace("THISROOM", 0, 1, tmplput_current_room, NULL, CTX_NONE);
00610        RegisterNamespace("ROOM:INFO:NAME", 0, 1, tmplput_ROOM_NAME, NULL, CTX_ROOMS);
00611        RegisterNamespace("ROOM:INFO:PRINT_NAME", 0, 1, tmplput_ROOM_NAME, NULL, CTX_NONE);
00612        RegisterNamespace("ROOM:INFO:BASENAME", 0, 1, tmplput_ROOM_BASENAME, NULL, CTX_ROOMS);
00613        RegisterNamespace("ROOM:INFO:LEVELNTIMES", 1, 2, tmplput_ROOM_LEVEL_N_TIMES, NULL, CTX_ROOMS);
00614        RegisterConditional(HKEY("COND:ROOM:INFO:IS_INBOX"), 0, ConditionalRoomIsInbox, CTX_ROOMS);
00615 
00616        /****** Properties ******/
00617        RegisterNamespace("ROOM:INFO:QRFLAGS", 0, 1, tmplput_ROOM_QRFLAGS, NULL, CTX_ROOMS);
00618        RegisterConditional(HKEY("COND:THISROOM:FLAG:QR"), 0, ConditionalThisRoomHas_QRFlag, CTX_NONE);
00619        RegisterConditional(HKEY("COND:THISROOM:EDIT"), 0, ConditionalRoom_MayEdit, CTX_NONE);
00620        RegisterConditional(HKEY("COND:ROOM:FLAG:QR"), 0, ConditionalRoomHas_QRFlag, CTX_ROOMS);
00621 
00622        RegisterConditional(HKEY("COND:THISROOM:FLAG:QR2"), 0, ConditionalThisRoomHas_QRFlag2, CTX_NONE);
00623        RegisterConditional(HKEY("COND:ROOM:FLAG:QR2"), 0, ConditionalRoomHas_QRFlag2, CTX_ROOMS);
00624 
00625        RegisterConditional(HKEY("COND:ROOM:FLAG:UA"), 0, ConditionalRoomHas_UAFlag, CTX_ROOMS);
00626        RegisterNamespace("ROOM:INFO:RAFLAGS", 0, 1, tmplput_ROOM_RAFLAGS, NULL, CTX_ROOMS);
00627 
00628 
00629        RegisterNamespace("ROOM:INFO:LISTORDER", 0, 1, tmplput_ROOM_LISTORDER, NULL, CTX_ROOMS);
00630        RegisterNamespace("THISROOM:ORDER", 0, 0, tmplput_ThisRoomOrder, NULL, CTX_NONE);
00631        RegisterConditional(HKEY("COND:THISROOM:ORDER"), 0, ConditionalThisRoomOrder, CTX_NONE);
00632 
00633        RegisterNamespace("ROOM:INFO:LASTCHANGE", 0, 1, tmplput_ROOM_LASTCHANGE, NULL, CTX_ROOMS);
00634 
00635        RegisterNamespace("THISROOM:MSGS:NEW", 0, 0, tmplput_ThisRoom_nNewMessages, NULL, CTX_NONE);
00636        RegisterNamespace("THISROOM:MSGS:TOTAL", 0, 0, tmplput_ThisRoom_nTotalMessages, NULL, CTX_NONE);
00637 
00638        RegisterNamespace("THISROOM:PASS", 0, 1, tmplput_ThisRoomPass, NULL, CTX_NONE);
00639        RegisterNamespace("THISROOM:AIDE", 0, 1, tmplput_ThisRoomAide, NULL, CTX_NONE);
00640        RegisterConditional(HKEY("COND:ROOMAIDE"), 2, ConditionalRoomAide, CTX_NONE);
00641        RegisterConditional(HKEY("COND:ACCESS:DELETE"), 2, ConditionalRoomAcessDelete, CTX_NONE);
00642        RegisterConditional(HKEY("COND:ROOM:EDITACCESS"), 0, ConditionalHaveRoomeditRights, CTX_NONE);
00643 
00644        RegisterConditional(HKEY("COND:THISROOM:HAVE_PIC"), 0, ConditionalThisRoomXHavePic, CTX_NONE);
00645 
00646        RegisterNamespace("THISROOM:INFOTEXT", 1, 2, tmplput_ThisRoomInfoText, NULL, CTX_NONE);
00647        RegisterConditional(HKEY("COND:THISROOM:HAVE_INFOTEXT"), 0, ConditionalThisRoomXHaveInfoText, CTX_NONE);
00648 
00649        RegisterNamespace("THISROOM:FILES:N", 0, 1, tmplput_ThisRoomXNFiles, NULL, CTX_NONE);
00650        RegisterNamespace("THISROOM:FILES:STR", 0, 1, tmplput_ThisRoomX_FileString, NULL, CTX_NONE);
00651        RegisterNamespace("THISROOM:DIRECTORY", 0, 1, tmplput_ThisRoomDirectory, NULL, CTX_NONE);
00652 
00653        RegisterNamespace("ROOM:INFO:ACL", 0, 1, tmplput_ROOM_ACL, NULL, CTX_ROOMS);
00654        RegisterConditional(HKEY("COND:THIS:THAT:ROOM"), 0, ConditionalIsThisThatRoom, CTX_ROOMS);
00655 }