aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2011-05-25 15:13:52 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2011-06-14 00:04:04 +0800
commite0dd22a058f51c159937ebf9a4af7edbd386b02f (patch)
tree97570359f70a0816f6a14c5453e9d65d4c5639c5 /libempathy-gtk/empathy-chat.c
parent2d91c5513fce276eb8a65a463119a80609a4eeb7 (diff)
downloadgsoc2013-empathy-e0dd22a058f51c159937ebf9a4af7edbd386b02f.tar
gsoc2013-empathy-e0dd22a058f51c159937ebf9a4af7edbd386b02f.tar.gz
gsoc2013-empathy-e0dd22a058f51c159937ebf9a4af7edbd386b02f.tar.bz2
gsoc2013-empathy-e0dd22a058f51c159937ebf9a4af7edbd386b02f.tar.lz
gsoc2013-empathy-e0dd22a058f51c159937ebf9a4af7edbd386b02f.tar.xz
gsoc2013-empathy-e0dd22a058f51c159937ebf9a4af7edbd386b02f.tar.zst
gsoc2013-empathy-e0dd22a058f51c159937ebf9a4af7edbd386b02f.zip
Reset the chat state after receiving an edited message
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index dd4bdf0f8..5cee9eb0b 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -1333,6 +1333,9 @@ chat_message_received (EmpathyChat *chat,
gboolean pending)
{
EmpathyChatPriv *priv = GET_PRIV (chat);
+ EmpathyContact *sender;
+
+ sender = empathy_message_get_sender (message);
if (empathy_message_is_edit (message)) {
DEBUG ("Editing message '%s' to '%s'",
@@ -1340,13 +1343,7 @@ chat_message_received (EmpathyChat *chat,
empathy_message_get_body (message));
empathy_chat_view_edit_message (chat->view, message);
-
- /* FIXME: do we need to do things like edit the chat state? */
} else {
- EmpathyContact *sender;
-
- sender = empathy_message_get_sender (message);
-
DEBUG ("Appending new message '%s' from %s (%d)",
empathy_message_get_token (message),
empathy_contact_get_alias (sender),
@@ -1354,12 +1351,6 @@ chat_message_received (EmpathyChat *chat,
empathy_chat_view_append_message (chat->view, message);
- /* We received a message so the contact is no longer
- * composing */
- chat_state_changed_cb (priv->tp_chat, sender,
- TP_CHANNEL_CHAT_STATE_ACTIVE,
- chat);
-
if (empathy_message_is_incoming (message)) {
priv->unread_messages++;
g_object_notify (G_OBJECT (chat), "nb-unread-messages");
@@ -1367,6 +1358,12 @@ chat_message_received (EmpathyChat *chat,
g_signal_emit (chat, signals[NEW_MESSAGE], 0, message, pending);
}
+
+ /* We received a message so the contact is no longer
+ * composing */
+ chat_state_changed_cb (priv->tp_chat, sender,
+ TP_CHANNEL_CHAT_STATE_ACTIVE,
+ chat);
}
static void