* FlushIgnetCfgs() get me out of FlushFolder, so we can reload GNET configs after...
[citadel.git] / webcit / roomops.h
index c569d4e29be02edf08ae9a22901f82d2bcefd677..e0a6320791c387da51974405ba19f8c4d040f011 100644 (file)
@@ -29,10 +29,11 @@ struct roomlisting {
 
 
 typedef struct _floor {
-       long ID;
+       int ID;
        StrBuf *Name;
        long NRooms;
-} floor;
+       long AlphaN;
+} Floor;
 
 /**
  * \brief  Data structure for roomlist-to-folderlist conversion 
@@ -54,30 +55,77 @@ struct __ofolder {
  * \brief  Data structure for roomlist-to-folderlist conversion 
  */
 typedef struct _folder {
-       StrBuf *name;   /* which is its own name??? */
-       int QRFlags;    /* roomflags */
-       int floorid;      /* which floor is it on */
-
-
-       int listorder; /* todo */
-
-       StrBuf *ACL;    /* access Control list... */
+       /* Data citserver tells us about the room */
+       long QRFlags;    /* roomflags */
+       long QRFlags2;    /* Bitbucket NO2 */
+       long RAFlags;
 
        int view;       /* whats its default view? inbox/calendar.... */
-       int defview;
-       int lastchange; /* todo... */
+       long defview;
+       long lastchange; /* todo... */
 
+       /* later evaluated data from the serverdata */
+       StrBuf *name;   /* the full name of the room we're talking about */
+       long nRoomNameParts;
+       StrBuf **RoomNameParts;
 
+       int floorid;      /* which floor is it on */
+       const Floor *Floor;   /* point to the floor we're on.. */
 
+       int hasnewmsgs; /* are there unread messages inside */
+       int is_inbox;   /* is it a mailbox?  */
+
+       int RoomAideLoaded;
+       StrBuf *RoomAide;
+
+/* only available if GETR was run */
+       int XALoaded;
+       StrBuf *XAPass;
+       StrBuf *Directory;
+       long Order;
+
+/* Only available from the GOTO context... */
+       long nNewMessages;
+       long nTotalMessages;
+       long LastMessageRead;
+       long HighestRead;
+       int ShowInfo;
+       int UsersNewMAilboxMessages; /* should we notify the user about new messages? */
+       int IsTrash;
+/* Only available if certain other commands ran */
+       int XHaveRoomPic;
+       int XHaveRoomPicLoaded;
+
+       int XHaveInfoTextLoaded;
+       StrBuf *XInfoText;
+
+       int XHaveDownloadCount;
+       int XDownloadCount;
+       
+       int BumpUsers; /* if SETR set to 1 to make all users who knew this room to forget about it. */
+
+       HashList *IgnetCfgs[maxRoomNetCfg + 1];
+}folder;
 
-       const floor *Floor;   /* pint to the floor we're on.. */
-       StrBuf *room;   /* which roomname ??? */
+HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
+void vDeleteFolder(void *vFolder);
+void FlushFolder(folder *room);
+void FlushIgnetCfgs(folder *room);
+void ParseGoto(folder *proom, StrBuf *Line);
+void FlushRoomlist(void); /* release our caches, so a deleted / zapped room disapears */
+void ReloadCurrentRoom(void); /* Flush cache; reload current state */
 
+/*
+ * wrapper around usual sort-comparator; private rooms will allways be prefered, -1 if one of them NULL
+ */
+int CompareRooms(const folder *room1, const folder *room2);
 
-       int hasnewmsgs; /* are there unread messages inside */
-       int is_mailbox; /* is it a mailbox?  */
-       int selectable; /* can we select it ??? */
-       int num_rooms;  /* If this is a floor, how many rooms does it have */
 
-}folder;
+#define REST_TOPLEVEL 0
+#define REST_IN_NAMESPACE (1<<0)
+#define REST_IN_FLOOR (1<<1)
+#define REST_IN_ROOM (1<<2)
+#define REST_HAVE_SUB_ROOMS (1<<3)
+#define REST_GOT_LOCAL_PART (1<<4)
+#define REST_NONEXIST (1<<5)