After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 648575 - Show a red line demarcating read and unread messages in WebKit based (HTML) chats
Show a red line demarcating read and unread messages in WebKit based (HTML) c...
Status: RESOLVED DUPLICATE of bug 443884
Product: empathy
Classification: Core
Component: Chat
unspecified
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-25 00:15 UTC by Chandni Verma
Modified: 2011-04-25 08:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
redline in ongoing messages (11.46 KB, patch)
2011-04-25 01:53 UTC, Chandni Verma
reviewed Details | Review

Description Chandni Verma 2011-04-25 00:15:05 UTC
This bug branches from bug #443884#c9
Comment 1 Chandni Verma 2011-04-25 01:53:18 UTC
Created attachment 186573 [details] [review]
redline in ongoing messages

This is a way I could think of creating a demarcation. If it looks good, I can proceed with it.

It does not yet implement lines on appended events and logs presently.
Comment 2 Guillaume Desmottes 2011-04-25 07:28:09 UTC
As said on bug #443884, no need to create a new bug.

*** This bug has been marked as a duplicate of bug 443884 ***
Comment 3 Guillaume Desmottes 2011-04-25 08:26:34 UTC
Review of attachment 186573 [details] [review]:

I'm reviewing here because of the reviewing tool but please use bug #443884 from now.

Your patch introduced trailing spaces; "git diff" should show them in red and "make check" should catch them as well.

Did you check if Adium has a built-in system to display unread messages?

::: libempathy-gtk/empathy-chat.c
@@ +122,3 @@
 	guint              unread_messages;
+
+	time_t             last_viewed_at;

Since last week, we stopped using time_t and always use gint64 for timestamps. See bug #648188

@@ +1252,3 @@
 		empathy_contact_get_handle (sender));
 
+	if (priv->is_seen &&

This logic doesn't seem to work here, the line is never displayed.

I'm wondering if we could do something simpler. What about:
- Add empathy_chat_view_messages_read() and call it in empathy_chat_messages_read()
- In the theme, add the line if that's the first unread message.

Would that work?

::: libempathy-gtk/empathy-chat.h
@@ +97,3 @@
+void               empathy_chat_set_last_viewed_at (EmpathyChat *chat,
+						      time_t view_time);
+time_t             empathy_chat_get_last_viewed_at (EmpathyChat *chat);

Why is this function public? Actually this function doesn't really buy us anything as it's only called in empathy-chat, which could use priv->last_viewed_at directly.

::: libempathy-gtk/empathy-theme-adium.c
@@ +549,3 @@
+		g_string_append (html_string,
+				"<div id=\"demarcator\"> <HR WIDTH=\"85%\" COLOR=\"#FF0000\""
+				" SIZE=\"3\"> </div>");

The line is pretty massive here. I think it would look better having it more thin.

::: src/empathy-chat-window.c
@@ +1540,3 @@
+	if (priv->current_chat != NULL)
+			empathy_chat_set_last_viewed_at (priv->current_chat,
+				empathy_time_get_current ());

This look wrong. Why not do this directly in empathy_chat_messages_read()?