aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-theme-boxes.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-03-14 21:05:41 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-03-14 21:05:41 +0800
commit867245d29553bb2480bfb8cb7bd5250d678492e8 (patch)
treedde87b5d754a0feb8ea9b380e6e800132ce9629f /libempathy-gtk/empathy-theme-boxes.c
parent93f70d88d4611f0bd6c79ea19257c6156cadb24d (diff)
downloadgsoc2013-empathy-867245d29553bb2480bfb8cb7bd5250d678492e8.tar
gsoc2013-empathy-867245d29553bb2480bfb8cb7bd5250d678492e8.tar.gz
gsoc2013-empathy-867245d29553bb2480bfb8cb7bd5250d678492e8.tar.bz2
gsoc2013-empathy-867245d29553bb2480bfb8cb7bd5250d678492e8.tar.lz
gsoc2013-empathy-867245d29553bb2480bfb8cb7bd5250d678492e8.tar.xz
gsoc2013-empathy-867245d29553bb2480bfb8cb7bd5250d678492e8.tar.zst
gsoc2013-empathy-867245d29553bb2480bfb8cb7bd5250d678492e8.zip
Remove EmpathyChatViewBlock and empaty_chat_view_set_last_contact
svn path=/trunk/; revision=791
Diffstat (limited to 'libempathy-gtk/empathy-theme-boxes.c')
-rw-r--r--libempathy-gtk/empathy-theme-boxes.c41
1 files changed, 4 insertions, 37 deletions
diff --git a/libempathy-gtk/empathy-theme-boxes.c b/libempathy-gtk/empathy-theme-boxes.c
index 797cb4324..06c35cae8 100644
--- a/libempathy-gtk/empathy-theme-boxes.c
+++ b/libempathy-gtk/empathy-theme-boxes.c
@@ -527,10 +527,10 @@ theme_boxes_maybe_append_header (EmpathyTheme *theme,
{
EmpathyThemeBoxesPriv *priv;
EmpathyContact *contact;
+ EmpathyContact *last_contact;
GdkPixbuf *avatar = NULL;
GtkTextBuffer *buffer;
const gchar *name;
- gboolean header;
GtkTextIter iter;
GtkWidget *label1, *label2;
GtkTextChildAnchor *anchor;
@@ -541,42 +541,20 @@ theme_boxes_maybe_append_header (EmpathyTheme *theme,
GtkTextIter start;
GdkColor color;
gboolean parse_success;
- gboolean from_self;
priv = GET_PRIV (theme);
contact = empathy_message_get_sender (msg);
- from_self = empathy_contact_is_user (contact);
+ name = empathy_contact_get_name (contact);
+ last_contact = empathy_chat_view_get_last_contact (view);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
empathy_debug (DEBUG_DOMAIN, "Maybe add fancy header");
- name = empathy_contact_get_name (contact);
-
- header = FALSE;
-
/* Only insert a header if the previously inserted block is not the same
* as this one. This catches all the different cases:
*/
- if (empathy_chat_view_get_last_block_type (view) != EMPATHY_CHAT_VIEW_BLOCK_SELF &&
- empathy_chat_view_get_last_block_type (view) != EMPATHY_CHAT_VIEW_BLOCK_OTHER) {
- header = TRUE;
- }
- else if (from_self &&
- empathy_chat_view_get_last_block_type (view) == EMPATHY_CHAT_VIEW_BLOCK_OTHER) {
- header = TRUE;
- }
- else if (!from_self &&
- empathy_chat_view_get_last_block_type (view) == EMPATHY_CHAT_VIEW_BLOCK_SELF) {
- header = TRUE;
- }
- else if (!from_self &&
- (!empathy_chat_view_get_last_contact (view) ||
- contact != empathy_chat_view_get_last_contact (view))) {
- header = TRUE;
- }
-
- if (!header) {
+ if (last_contact && empathy_contact_equal (last_contact, contact)) {
return;
}
@@ -708,14 +686,6 @@ theme_boxes_append_message (EmpathyTheme *theme,
empathy_message_get_body (message),
"fancy-body", "fancy-link");
}
-
- if (empathy_contact_is_user (sender)) {
- empathy_chat_view_set_last_block_type (view, EMPATHY_CHAT_VIEW_BLOCK_SELF);
- empathy_chat_view_set_last_contact (view, NULL);
- } else {
- empathy_chat_view_set_last_block_type (view, EMPATHY_CHAT_VIEW_BLOCK_OTHER);
- empathy_chat_view_set_last_contact (view, sender);
- }
}
static void
@@ -740,8 +710,6 @@ theme_boxes_append_event (EmpathyTheme *theme,
"fancy-event",
NULL);
g_free (msg);
-
- empathy_chat_view_set_last_block_type (view, EMPATHY_CHAT_VIEW_BLOCK_EVENT);
}
static void
@@ -804,7 +772,6 @@ theme_boxes_append_timestamp (EmpathyTheme *theme,
"fancy-time",
NULL);
- empathy_chat_view_set_last_block_type (view, EMPATHY_CHAT_VIEW_BLOCK_TIME);
empathy_chat_view_set_last_timestamp (view, timestamp);
}