From bc50bd062a3a9bb85e6c3e0228571c670532fdf9 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 7 Dec 2009 15:14:46 +0000 Subject: add empathy_chat_window_get_nb_rooms --- src/empathy-chat-window.c | 14 ++++++++++++++ src/empathy-chat-window.h | 1 + 2 files changed, 15 insertions(+) diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 6db60b9e1..c2e32bc17 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -2104,3 +2104,17 @@ empathy_chat_window_present_chat (EmpathyChat *chat) gtk_widget_grab_focus (chat->input_text_view); } +guint +empathy_chat_window_get_nb_rooms (EmpathyChatWindow *self) +{ + EmpathyChatWindowPriv *priv = GET_PRIV (self); + GList *l; + guint nb = 0; + + for (l = priv->chats; l != NULL; l = g_list_next (l)) { + if (empathy_chat_is_room (EMPATHY_CHAT (l->data))) + nb++; + } + + return nb; +} diff --git a/src/empathy-chat-window.h b/src/empathy-chat-window.h index 4f1920a9c..9981faddb 100644 --- a/src/empathy-chat-window.h +++ b/src/empathy-chat-window.h @@ -74,6 +74,7 @@ EmpathyChat * empathy_chat_window_find_chat (TpAccount *account const gchar *id); void empathy_chat_window_present_chat (EmpathyChat *chat); +guint empathy_chat_window_get_nb_rooms (EmpathyChatWindow *window); G_END_DECLS -- cgit v1.2.3