aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-07 23:14:46 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-08 00:59:34 +0800
commitbc50bd062a3a9bb85e6c3e0228571c670532fdf9 (patch)
treeda24935fbcfe9c877d9144e5b3cd714b13e7bea5
parent487f4d0fc504b9c0cb77a030869893054c907d6d (diff)
downloadgsoc2013-empathy-bc50bd062a3a9bb85e6c3e0228571c670532fdf9.tar
gsoc2013-empathy-bc50bd062a3a9bb85e6c3e0228571c670532fdf9.tar.gz
gsoc2013-empathy-bc50bd062a3a9bb85e6c3e0228571c670532fdf9.tar.bz2
gsoc2013-empathy-bc50bd062a3a9bb85e6c3e0228571c670532fdf9.tar.lz
gsoc2013-empathy-bc50bd062a3a9bb85e6c3e0228571c670532fdf9.tar.xz
gsoc2013-empathy-bc50bd062a3a9bb85e6c3e0228571c670532fdf9.tar.zst
gsoc2013-empathy-bc50bd062a3a9bb85e6c3e0228571c670532fdf9.zip
add empathy_chat_window_get_nb_rooms
-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