display_main_menu();
return;
}
+ /** TODO: Room created, now udate the left hand icon bar for this user */
+ burn_folder_cache(0); /* burn the old folder cache */
+
+
gotoroom(er_name);
do_change_view(er_view); /* Now go there */
}
{
char buf[SIZ];
+
serv_puts("KILL 1");
serv_getln(buf, sizeof buf);
+ burn_folder_cache(0); /* Burn the cahce of known rooms to update the icon bar */
if (buf[0] != '2') {
strcpy(WC->ImportantMessage, &buf[4]);
display_main_menu();
+/**
+ * \brief Burn the cached folder list.
+ * \param age How old the cahce needs to be before we burn it.
+ */
+
+void burn_folder_cache(time_t age)
+{
+ /** If our cached folder list is very old, burn it. */
+ if (WC->cache_fold != NULL) {
+ if ((time(NULL) - WC->cache_timestamp) > age) {
+ free(WC->cache_fold);
+ WC->cache_fold = NULL;
+ }
+ }
+}
+
+
+
+
/**
* \brief Show the room list.
* (only should get called by
char buf3[SIZ];
/** If our cached folder list is very old, burn it. */
- if (WC->cache_fold != NULL) {
- if ((time(NULL) - WC->cache_timestamp) > 300) {
- free(WC->cache_fold);
- WC->cache_fold = NULL;
- }
- }
-
+ burn_folder_cache(300);
+
/** Can we do the iconbar roomlist from cache? */
if ((WC->cache_fold != NULL) && (!strcasecmp(viewpref, "iconbar"))) {
do_iconbar_view(WC->cache_fold, WC->cache_max_folders, WC->cache_num_floors);
void end_ajax_response(void);
void initialize_viewdefs(void);
void initialize_axdefs(void);
+void burn_folder_cache(time_t age);
void list_all_rooms_by_floor(char *viewpref);
void display_room_directory(void);
void download_file(char *);