From 03d20e55433ca5d11633dec62435ea66ebdaf1ae Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 20 May 2007 15:20:32 +0000 Subject: Correctly remember the contact who sent last message. 2007-05-20 Xavier Claessens * libempathy-gtk/gossip-chat-view.c: Correctly remember the contact who sent last message. svn path=/trunk/; revision=86 --- libempathy-gtk/gossip-chat-view.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/gossip-chat-view.c b/libempathy-gtk/gossip-chat-view.c index b9d2d4b51..24770f5de 100644 --- a/libempathy-gtk/gossip-chat-view.c +++ b/libempathy-gtk/gossip-chat-view.c @@ -1472,16 +1472,17 @@ gossip_chat_view_append_message (GossipChatView *view, my_contact = gossip_contact_get_user (sender); + /* Reset the last inserted contact. */ + if (priv->last_contact) { + g_object_unref (priv->last_contact); + } + if (gossip_contact_equal (my_contact, sender)) { priv->last_block_type = BLOCK_TYPE_SELF; + priv->last_contact = NULL; } else { priv->last_block_type = BLOCK_TYPE_OTHER; - } - - /* Reset the last inserted contact, since it was from self. */ - if (priv->last_contact) { - g_object_unref (priv->last_contact); - priv->last_contact = NULL; + priv->last_contact = g_object_ref (sender); } if (scroll_down) { -- cgit v1.2.3