[empathy] add empathy_chat_window_get_nb_rooms
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy] add empathy_chat_window_get_nb_rooms
- Date: Mon, 7 Dec 2009 16:59:53 +0000 (UTC)
commit bc50bd062a3a9bb85e6c3e0228571c670532fdf9
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Mon Dec 7 15:14:46 2009 +0000
add empathy_chat_window_get_nb_rooms
src/empathy-chat-window.c | 14 ++++++++++++++
src/empathy-chat-window.h | 1 +
2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 6db60b9..c2e32bc 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 4f1920a..9981fad 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]