diff options
Diffstat (limited to 'src/ui/window_list.c')
-rw-r--r-- | src/ui/window_list.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/ui/window_list.c b/src/ui/window_list.c index a90c7141..2c45ea97 100644 --- a/src/ui/window_list.c +++ b/src/ui/window_list.c @@ -1102,6 +1102,51 @@ wins_create_summary(gboolean unread) return result; } +GSList* +wins_create_summary_attention() +{ + GSList* result = NULL; + + GList* keys = g_hash_table_get_keys(windows); + keys = g_list_sort(keys, _wins_cmp_num); + GList* curr = keys; + + while (curr) { + ProfWin* window = g_hash_table_lookup(windows, curr->data); + gboolean has_attention = FALSE; + if (window->type == WIN_CHAT) { + ProfChatWin* chatwin = (ProfChatWin*)window; + assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); + has_attention = chatwin->has_attention; + } else if (window->type == WIN_MUC) { + ProfMucWin* mucwin = (ProfMucWin*)window; + assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK); + has_attention = mucwin->has_attention; + } + if ( has_attention) { + GString* line = g_string_new(""); + + int ui_index = GPOINTER_TO_INT(curr->data); + char* winstring = win_to_string(window); + if (!winstring) { + g_string_free(line, TRUE); + continue; + } + + g_string_append_printf(line, "%d: %s", ui_index, winstring); + free(winstring); + + result = g_slist_append(result, strdup(line->str)); + g_string_free(line, TRUE); + } + curr = g_list_next(curr); + } + + g_list_free(keys); + + return result; +} + char* win_autocomplete(const char* const search_str, gboolean previous, void* context) { |