Back to index

webcit  8.12-dfsg
roomops.h
Go to the documentation of this file.
00001 
00002 #define VIRTUAL_MY_FLOOR -1
00003 
00004 /*
00005  * \brief This struct holds a list of rooms for \\<G\\>oto operations.
00006  */
00007 struct march {
00008        struct march *next;       /* pointer to next in linked list */
00009        char march_name[128];     /* name of room */
00010        int march_floor;          /* floor number of room */
00011        int march_order;          /* sequence in which we are to visit this room */
00012 };
00013 
00014 /* *
00015  * \brief     This struct holds a list of rooms for client display.
00016  *            It is a binary tree.
00017  */
00018 struct roomlisting {
00019        struct roomlisting *lnext;  /* pointer to 'left' tree node */
00020        struct roomlisting *rnext;  /* pointer to 'right' tree node */
00021        char rlname[128];           /* name of room */
00022        unsigned rlflags;           /* room flags */
00023        int rlfloor;                /* the floor it resides on */
00024        int rlorder;                /* room listing order */
00025 };
00026 
00027 
00028 
00029 
00030 
00031 typedef struct _floor {
00032        int ID;
00033        StrBuf *Name;
00034        long NRooms;
00035        long AlphaN;
00036 } Floor;
00037 
00041 struct __ofolder {
00042        int floor;      /* which floor is it on */
00043        char room[SIZ];      /* which roomname ??? */
00044        char name[SIZ];      /* which is its own name??? */
00045        int hasnewmsgs;      /* are there unread messages inside */
00046        int is_mailbox;      /* is it a mailbox?  */
00047        int selectable;      /* can we select it ??? */
00048        int view;       /* whats its default view? inbox/calendar.... */
00049        int num_rooms;       /* If this is a floor, how many rooms does it have */
00050 };
00051 
00052 
00053 
00057 typedef struct _folder {
00058        /* Data citserver tells us about the room */
00059        long QRFlags;    /* roomflags */
00060        long QRFlags2;    /* Bitbucket NO2 */
00061        long RAFlags;
00062 
00063        int view;       /* whats its default view? inbox/calendar.... */
00064        long defview;
00065        long lastchange; /* todo... */
00066 
00067        /* later evaluated data from the serverdata */
00068        StrBuf *name; /* the full name of the room we're talking about */
00069        long nRoomNameParts;
00070        StrBuf **RoomNameParts;
00071 
00072        int floorid;      /* which floor is it on */
00073        const Floor *Floor;   /* point to the floor we're on.. */
00074 
00075        int hasnewmsgs;      /* are there unread messages inside */
00076        int is_inbox; /* is it a mailbox?  */
00077 
00078        int RoomAideLoaded;
00079        StrBuf *RoomAide;
00080 
00081 /* only available if GETR was run */
00082        int XALoaded;
00083        StrBuf *XAPass;
00084        StrBuf *Directory;
00085        long Order;
00086 
00087 /* Only available from the GOTO context... */
00088        long nNewMessages;
00089        long nTotalMessages;
00090        long LastMessageRead;
00091        long HighestRead;
00092        int ShowInfo;
00093        int UsersNewMAilboxMessages; /* should we notify the user about new messages? */
00094        int IsTrash;
00095 /* Only available if certain other commands ran */
00096        int XHaveRoomPic;
00097        int XHaveRoomPicLoaded;
00098 
00099        int XHaveInfoTextLoaded;
00100        StrBuf *XInfoText;
00101 
00102        int XHaveDownloadCount;
00103        int XDownloadCount;
00104        
00105        int BumpUsers; /* if SETR set to 1 to make all users who knew this room to forget about it. */
00106 
00107        HashList *IgnetCfgs[maxRoomNetCfg + 1];
00108 }folder;
00109 
00110 HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
00111 void vDeleteFolder(void *vFolder);
00112 void FlushFolder(folder *room);
00113 void FlushIgnetCfgs(folder *room);
00114 void ParseGoto(folder *proom, StrBuf *Line);
00115 void FlushRoomlist(void); /* release our caches, so a deleted / zapped room disapears */
00116 void ReloadCurrentRoom(void); /* Flush cache; reload current state */
00117 
00118 HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
00119 HashList *GetRoomListHash(StrBuf *Target, WCTemplputParams *TP);
00120 int SortRoomsByListOrder(const void *room1, const void *room2);
00121 void tmplput_roombanner(StrBuf *Target, WCTemplputParams *TP);
00122 
00123 
00124 void LoadRoomAide(void);
00125 void LoadRoomXA (void);
00126 void LoadXRoomPic(void);
00127 void LoadXRoomInfoText(void);
00128 void LoadXRoomXCountFiles(void);
00129 
00130 long gotoroom(const StrBuf *gname);
00131 
00132 void slrp_highest(void);
00133 void remove_march(const StrBuf *aaa);
00134 void dotskip(void);
00135 void smart_goto(const StrBuf *next_room);
00136 void free_march_list(wcsession *wcf);
00137 
00138 /*
00139  * wrapper around usual sort-comparator; private rooms will allways be prefered, -1 if one of them NULL
00140  */
00141 int CompareRooms(const folder *room1, const folder *room2);
00142 
00143 
00144 #define REST_TOPLEVEL 0
00145 #define REST_IN_NAMESPACE (1<<0)
00146 #define REST_IN_FLOOR (1<<1)
00147 #define REST_IN_ROOM (1<<2)
00148 #define REST_HAVE_SUB_ROOMS (1<<3)
00149 #define REST_GOT_LOCAL_PART (1<<4)
00150 #define REST_NONEXIST (1<<5)
00151