From c74a8d9ae02abb887e8917a65aa854907fe6a15a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 8 Sep 2009 19:48:38 +0000 Subject: [PATCH] * implement (INBOX) thing --- webcit/roomlist.c | 15 +++++++++++++++ webcit/roomops.h | 2 +- webcit/static/t/knrooms_rooms.html | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/webcit/roomlist.c b/webcit/roomlist.c index e085a1563..ca32311fc 100644 --- a/webcit/roomlist.c +++ b/webcit/roomlist.c @@ -205,7 +205,16 @@ HashList *GetRoomListHash(StrBuf *Target, WCTemplputParams *TP) /* Private mailboxes on the main floor get remapped to the personal folder */ if ((room->QRFlags & QR_MAILBOX) && (room->floorid == 0)) + { room->floorid = VIRTUAL_MY_FLOOR; + if ((room->nRoomNameParts == 1) && + (StrLength(room->name) == 4) && + (strcmp(ChrPtr(room->name), "Mail") == 0)) + { + room->is_inbox = 1; + } + + } /* get a pointer to the floor we're on: */ GetHash(WCC->Floors, IKEY(room->floorid), &vFloor); room->Floor = (const floor*) vFloor; @@ -570,6 +579,11 @@ int ConditionalRoomHas_UA_DELETEALLOWED(StrBuf *Target, WCTemplputParams *TP) } +int ConditionalRoomIsInbox(StrBuf *Target, WCTemplputParams *TP) +{ + folder *Folder = (folder *)(TP->Context); + return Folder->is_inbox; +} @@ -621,6 +635,7 @@ InitModule_ROOMLIST RegisterNamespace("ROOM:INFO:FLOOR:NROOMS", 0, 0, tmplput_ROOM_FLOOR_NROOMS, CTX_ROOMS); + RegisterConditional(HKEY("COND:ROOM:INFO:IS_INBOX"), 0, ConditionalRoomIsInbox, CTX_ROOMS); RegisterConditional(HKEY("COND:ROOM:FLAGS:UA_KNOWN"), 0, ConditionalRoomHas_UA_KNOWN, CTX_ROOMS); RegisterConditional(HKEY("COND:ROOM:FLAGS:UA_GOTOALLOWED"), 0, ConditionalRoomHas_UA_GOTOALLOWED, CTX_ROOMS); RegisterConditional(HKEY("COND:ROOM:FLAGS:UA_HASNEWMSGS"), 0, ConditionalRoomHas_UA_HASNEWMSGS, CTX_ROOMS); diff --git a/webcit/roomops.h b/webcit/roomops.h index ac2f607b7..19ceba364 100644 --- a/webcit/roomops.h +++ b/webcit/roomops.h @@ -79,7 +79,7 @@ typedef struct _folder { int hasnewmsgs; /* are there unread messages inside */ - int is_mailbox; /* is it a mailbox? */ + int is_inbox; /* is it a mailbox? */ int selectable; /* can we select it ??? */ int num_rooms; /* If this is a floor, how many rooms does it have */ diff --git a/webcit/static/t/knrooms_rooms.html b/webcit/static/t/knrooms_rooms.html index e69d40939..b5d011422 100644 --- a/webcit/static/t/knrooms_rooms.html +++ b/webcit/static/t/knrooms_rooms.html @@ -7,5 +7,5 @@ ">">
">">
-- 2.30.2