[empathy: 7/19] Add a tooltip saying when the message was edited



commit 6b13df746bc564a8ee72d1575315c007100262ce
Author: Danielle Madeley <danielle madeley collabora co uk>
Date:   Fri May 20 13:02:22 2011 +1000

    Add a tooltip saying when the message was edited

 libempathy-gtk/empathy-theme-adium.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index a55eff6..14a3998 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -1035,6 +1035,7 @@ theme_adium_edit_message (EmpathyChatView *view,
 	WebKitDOMDocument *doc;
 	WebKitDOMElement *span;
 	gchar *id, *parsed_body;
+	gchar *tooltip, *timestamp;
 	GError *error = NULL;
 
 	if (priv->pages_loading != 0) {
@@ -1072,8 +1073,21 @@ theme_adium_edit_message (EmpathyChatView *view,
 	if (error != NULL) {
 		DEBUG ("Error setting new inner-HTML: %s", error->message);
 		g_error_free (error);
+		goto except;
 	}
 
+	/* set a tooltip */
+	timestamp = empathy_time_to_string_local (
+		empathy_message_get_timestamp (message),
+		"%H:%M:%S");
+	tooltip = g_strdup_printf (_("Message edited at %s"), timestamp);
+
+	webkit_dom_html_element_set_title (WEBKIT_DOM_HTML_ELEMENT (span),
+		tooltip);
+
+	g_free (tooltip);
+	g_free (timestamp);
+
 	goto finally;
 
 except:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]