void ui_tidy_wins(void) { gboolean tidied = wins_tidy(); if (tidied) { cons_show("Windows tidied."); } else { cons_show("No tidy needed."); } }
void ui_prune_wins(void) { jabber_conn_status_t conn_status = jabber_get_connection_status(); gboolean pruned = FALSE; GSList *recipients = wins_get_prune_recipients(); if (recipients != NULL) { pruned = TRUE; } GSList *curr = recipients; while (curr != NULL) { char *recipient = curr->data; if (conn_status == JABBER_CONNECTED) { if (prefs_get_boolean(PREF_STATES)) { // send <gone/> chat state before closing if (chat_session_get_recipient_supports(recipient)) { chat_session_set_gone(recipient); message_send_gone(recipient); chat_session_end(recipient); } } } ProfWin *window = wins_get_by_recipient(recipient); int num = wins_get_num(window); ui_close_win(num); curr = g_slist_next(curr); } if (recipients != NULL) { g_slist_free(recipients); } wins_tidy(); if (pruned) { cons_show("Windows pruned."); } else { cons_show("No prune needed."); } }
void ui_prune_wins(void) { jabber_conn_status_t conn_status = connection_get_status(); gboolean pruned = FALSE; GSList *wins = wins_get_prune_wins(); if (wins) { pruned = TRUE; } GSList *curr = wins; while (curr) { ProfWin *window = curr->data; if (window->type == WIN_CHAT) { if (conn_status == JABBER_CONNECTED) { ProfChatWin *chatwin = (ProfChatWin*)window; chat_session_remove(chatwin->barejid); } } int num = wins_get_num(window); ui_close_win(num); curr = g_slist_next(curr); } if (wins) { g_slist_free(wins); } wins_tidy(); if (pruned) { cons_show("Windows pruned."); } else { cons_show("No prune needed."); } }