* burn our folder cache when zapping/deleting
[citadel.git] / webcit / roomops.h
1
2 #define VIRTUAL_MY_FLOOR -1
3
4 /*
5  * \brief This struct holds a list of rooms for \\\<G\\\>oto operations.
6  */
7 struct march {
8         struct march *next;       /* pointer to next in linked list */
9         char march_name[128];     /* name of room */
10         int march_floor;          /* floor number of room */
11         int march_order;          /* sequence in which we are to visit this room */
12 };
13
14 /* *
15  * \brief       This struct holds a list of rooms for client display.
16  *              It is a binary tree.
17  */
18 struct roomlisting {
19         struct roomlisting *lnext;      /* pointer to 'left' tree node */
20         struct roomlisting *rnext;      /* pointer to 'right' tree node */
21         char rlname[128];               /* name of room */
22         unsigned rlflags;               /* room flags */
23         int rlfloor;                    /* the floor it resides on */
24         int rlorder;                    /* room listing order */
25 };
26
27
28
29
30
31 typedef struct _floor {
32         int ID;
33         StrBuf *Name;
34         long NRooms;
35         long AlphaN;
36 } Floor;
37
38 /**
39  * \brief  Data structure for roomlist-to-folderlist conversion 
40  */
41 struct __ofolder {
42         int floor;      /* which floor is it on */
43         char room[SIZ]; /* which roomname ??? */
44         char name[SIZ]; /* which is its own name??? */
45         int hasnewmsgs; /* are there unread messages inside */
46         int is_mailbox; /* is it a mailbox?  */
47         int selectable; /* can we select it ??? */
48         int view;       /* whats its default view? inbox/calendar.... */
49         int num_rooms;  /* If this is a floor, how many rooms does it have */
50 };
51
52
53
54 /**
55  * \brief  Data structure for roomlist-to-folderlist conversion 
56  */
57 typedef struct _folder {
58         /* Data citserver tells us about the room */
59         StrBuf *name;   /* the full name of the room we're talking about */
60         long QRFlags;    /* roomflags */
61         int floorid;      /* which floor is it on */
62
63         long listorder; /* todo */
64         long QRFlags2;    /* Bitbucket NO2 */
65
66         long RAFlags;
67
68         int view;       /* whats its default view? inbox/calendar.... */
69         long defview;
70         long lastchange; /* todo... */
71
72         /* later evaluated data from the serverdata */
73         long nRoomNameParts;
74         StrBuf **RoomNameParts;
75
76         const Floor *Floor;   /* point to the floor we're on.. */
77
78         int hasnewmsgs; /* are there unread messages inside */
79         int is_inbox;   /* is it a mailbox?  */
80
81         int RoomAideLoaded;
82         StrBuf *RoomAide;
83
84         int XALoaded;
85         StrBuf *XAPass;
86         StrBuf *Directory;
87         long Order;
88
89         int selectable; /* can we select it ??? */
90         long num_rooms; /* If this is a floor, how many rooms does it have */
91
92
93 /* Only available from the GOTO context... */
94         long nNewMessages;
95         long nTotalMessages;
96         long LastMessageRead;
97         long HighestRead;
98         int ShowInfo;
99         int UsersNewMAilboxMessages; /* should we notify the user about new messages? */
100         int IsTrash;
101
102         int XHaveRoomPic;
103         int XHaveRoomPicLoaded;
104
105         int XHaveInfoTextLoaded;
106         StrBuf *XInfoText;
107
108         int XHaveDownloadCount;
109         int XDownloadCount;
110
111         HashList *IgnetCfgs[maxRoomNetCfg];
112
113 }folder;
114
115 HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
116 void vDeleteFolder(void *vFolder);
117 void FlushFolder(folder *room);
118 void ParseGoto(folder *proom, StrBuf *Line);
119 void FlushRoomlist(void); /* release our caches, so a deleted / zapped room disapears */
120
121 /*
122  * wrapper around usual sort-comparator; private rooms will allways be prefered, -1 if one of them NULL
123  */
124 int CompareRooms(const folder *room1, const folder *room2);
125
126
127 #define REST_TOPLEVEL 0
128 #define REST_IN_NAMESPACE (1<<0)
129 #define REST_IN_FLOOR (1<<1)
130 #define REST_IN_ROOM (1<<2)
131 #define REST_HAVE_SUB_ROOMS (1<<3)
132 #define REST_GOT_LOCAL_PART (1<<4)
133 #define REST_NONEXIST (1<<5)
134