]> git.0d.be Git - empathy.git/commitdiff
add empathy_chat_window_get_nb_rooms
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 7 Dec 2009 15:14:46 +0000 (15:14 +0000)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 7 Dec 2009 16:59:34 +0000 (16:59 +0000)
src/empathy-chat-window.c
src/empathy-chat-window.h

index 6db60b9e17fcf5f1811811dd2dbf7adae5a69fa0..c2e32bc17e226c8a969c0f40cc501e95366ddb94 100644 (file)
@@ -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;
+}
index 4f1920a9c2c6b927300f156de1ae27e2fbae4339..9981faddbcc8c914412d7a131cec9f6fd3143f4f 100644 (file)
@@ -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