]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/gossip-chat-view.c
Correctly remember if last message comes from the self contact or another.
[empathy.git] / libempathy-gtk / gossip-chat-view.c
index 5f8c7d49d9efbeae3702564b0c3c6e3ab6c3a321..b9d2d4b51526ba5c179fc6fe31c6da9be2316d97 100644 (file)
@@ -1431,6 +1431,7 @@ gossip_chat_view_append_message (GossipChatView *view,
 {
        GossipChatViewPriv *priv;
        GossipContact      *sender;
+       GossipContact      *my_contact;
        const gchar        *body;
        gboolean            scroll_down;
 
@@ -1469,7 +1470,13 @@ gossip_chat_view_append_message (GossipChatView *view,
                }
        }
 
-       priv->last_block_type = BLOCK_TYPE_SELF;
+       my_contact = gossip_contact_get_user (sender);
+
+       if (gossip_contact_equal (my_contact, sender)) {
+               priv->last_block_type = BLOCK_TYPE_SELF;
+       } else {
+               priv->last_block_type = BLOCK_TYPE_OTHER;
+       }
 
        /* Reset the last inserted contact, since it was from self. */
        if (priv->last_contact) {