[empathy] Remove the composing list
- From: Sjoerd Simons <sjoerds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Remove the composing list
- Date: Wed, 29 Dec 2010 13:03:32 +0000 (UTC)
commit d471250122f68adba8625fbc719614f927fa4103
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date: Sun Dec 26 19:22:04 2010 +0100
Remove the composing list
libempathy-gtk/empathy-chat.c | 7 +++++++
libempathy-gtk/empathy-chat.h | 2 ++
src/empathy-chat-window.c | 17 ++---------------
3 files changed, 11 insertions(+), 15 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 2956154..36b0896 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -3429,3 +3429,10 @@ empathy_chat_messages_read (EmpathyChat *self)
}
priv->unread_messages = 0;
}
+
+/* Return TRUE if on of the contacts in this chat is composing */
+gboolean
+empathy_chat_is_composing (EmpathyChat *chat)
+{
+ return chat->priv->compositors != NULL;
+}
diff --git a/libempathy-gtk/empathy-chat.h b/libempathy-gtk/empathy-chat.h
index 596b83f..01b7a73 100644
--- a/libempathy-gtk/empathy-chat.h
+++ b/libempathy-gtk/empathy-chat.h
@@ -89,6 +89,8 @@ void empathy_chat_set_show_contacts (EmpathyChat *chat,
guint empathy_chat_get_nb_unread_messages (EmpathyChat *chat);
void empathy_chat_messages_read (EmpathyChat *self);
+
+gboolean empathy_chat_is_composing (EmpathyChat *chat);
G_END_DECLS
#endif /* __EMPATHY_CHAT_H__ */
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 1a7c2aa..f764df5 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -75,7 +75,6 @@ typedef struct {
EmpathyChat *current_chat;
GList *chats;
GList *chats_new_msg;
- GList *chats_composing;
gboolean page_added;
gboolean dnd_same_window;
EmpathyChatroomManager *chatroom_manager;
@@ -668,7 +667,7 @@ chat_window_update_chat_tab (EmpathyChat *chat)
else if (g_list_find (priv->chats_new_msg, chat)) {
icon_name = EMPATHY_IMAGE_MESSAGE;
}
- else if (g_list_find (priv->chats_composing, chat)) {
+ else if (empathy_chat_is_composing (chat)) {
icon_name = EMPATHY_IMAGE_TYPING;
}
else if (remote_contact) {
@@ -713,7 +712,7 @@ chat_window_update_chat_tab (EmpathyChat *chat)
_("Topic:"), subject);
}
- if (g_list_find (priv->chats_composing, chat)) {
+ if (empathy_chat_is_composing (chat)) {
append_markup_printf (tooltip, "\n%s", _("Typing a message."));
}
@@ -1242,16 +1241,6 @@ chat_window_composing_cb (EmpathyChat *chat,
gboolean is_composing,
EmpathyChatWindow *window)
{
- EmpathyChatWindowPriv *priv;
-
- priv = GET_PRIV (window);
-
- if (is_composing && !g_list_find (priv->chats_composing, chat)) {
- priv->chats_composing = g_list_prepend (priv->chats_composing, chat);
- } else {
- priv->chats_composing = g_list_remove (priv->chats_composing, chat);
- }
-
chat_window_update_chat_tab (chat);
}
@@ -1630,7 +1619,6 @@ chat_window_page_removed_cb (GtkNotebook *notebook,
priv->chats = g_list_remove (priv->chats, chat);
priv->chats_new_msg = g_list_remove (priv->chats_new_msg, chat);
empathy_chat_messages_read (chat);
- priv->chats_composing = g_list_remove (priv->chats_composing, chat);
if (priv->chats == NULL) {
g_object_unref (window);
@@ -2104,7 +2092,6 @@ empathy_chat_window_init (EmpathyChatWindow *window)
/* Set up private details */
priv->chats = NULL;
priv->chats_new_msg = NULL;
- priv->chats_composing = NULL;
priv->current_chat = NULL;
priv->notification = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]