aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-window.c14
-rw-r--r--src/empathy-chat-window.h1
2 files changed, 15 insertions, 0 deletions
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