# HG changeset patch
# Node ID e41baa54c35c27d01b2c02900dd530e9fb7c7d1a
# Parent  27f816a512af8b6eba09ae2c2c8562c4f50cb8f3
diff --git a/pidgin/pidginconversation.c b/pidgin/pidginconversation.c
--- a/pidgin/pidginconversation.c
+++ b/pidgin/pidginconversation.c
@@ -217,32 +217,6 @@
 	}
 }
 
-static char *
-pidgin_converation_get_timestamp_string(G_GNUC_UNUSED GObject *self,
-                                        PurpleMessage *message,
-                                        G_GNUC_UNUSED gpointer data)
-{
-	GDateTime *timestamp = NULL;
-
-	if(!PURPLE_IS_MESSAGE(message)) {
-		return NULL;
-	}
-
-	timestamp = purple_message_get_timestamp(message);
-	if(timestamp != NULL) {
-		GDateTime *local = NULL;
-		char *ret = NULL;
-
-		local = g_date_time_to_local(timestamp);
-		ret = g_date_time_format(local, "%I:%M %p");
-		g_date_time_unref(local);
-
-		return ret;
-	}
-
-	return NULL;
-}
-
 static void
 pidgin_conversation_member_list_context_cb(GtkGestureSingle *self,
                                            G_GNUC_UNUSED gint n_press,
@@ -434,8 +408,6 @@
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_conversation_input_key_pressed_cb);
 	gtk_widget_class_bind_template_callback(widget_class,
-	                                        pidgin_converation_get_timestamp_string);
-	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_conversation_member_list_context_cb);
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_conversation_message_setup);
diff --git a/pidgin/pidginmessage.c b/pidgin/pidginmessage.c
--- a/pidgin/pidginmessage.c
+++ b/pidgin/pidginmessage.c
@@ -28,11 +28,6 @@
 	GtkBox parent;
 
 	PurpleMessage *message;
-
-	GtkWidget *avatar;
-	GtkWidget *author;
-	GtkWidget *edited;
-	GtkWidget *timestamp;
 };
 
 enum {
@@ -169,6 +164,32 @@
 }
 
 static char *
+pidgin_message_get_timestamp_string(G_GNUC_UNUSED GObject *self,
+                                    PurpleMessage *message,
+                                    G_GNUC_UNUSED gpointer data)
+{
+	GDateTime *timestamp = NULL;
+
+	if(!PURPLE_IS_MESSAGE(message)) {
+		return NULL;
+	}
+
+	timestamp = purple_message_get_timestamp(message);
+	if(timestamp != NULL) {
+		GDateTime *local = NULL;
+		char *ret = NULL;
+
+		local = g_date_time_to_local(timestamp);
+		ret = g_date_time_format(local, "%I:%M %p");
+		g_date_time_unref(local);
+
+		return ret;
+	}
+
+	return NULL;
+}
+
+static char *
 pidgin_message_process_message_contents_cb(G_GNUC_UNUSED GObject *self,
                                            const char *contents,
                                            G_GNUC_UNUSED gpointer data)
@@ -184,6 +205,26 @@
 }
 
 static gboolean
+pidgin_message_query_tooltip_contents_cb(GtkWidget *self,
+                                         G_GNUC_UNUSED gint x,
+                                         G_GNUC_UNUSED gint y,
+                                         G_GNUC_UNUSED gboolean keyboard_mode,
+                                         GtkTooltip *tooltip,
+                                         G_GNUC_UNUSED gpointer data)
+{
+	const char *uri = NULL;
+
+	uri = gtk_label_get_current_uri(GTK_LABEL(self));
+	if(purple_strempty(uri)) {
+		return FALSE;
+	}
+
+	gtk_tooltip_set_text(tooltip, uri);
+
+	return TRUE;
+}
+
+static gboolean
 pidgin_message_query_tooltip_edited_cb(G_GNUC_UNUSED GtkWidget *self,
                                        G_GNUC_UNUSED gint x,
                                        G_GNUC_UNUSED gint y,
@@ -191,14 +232,20 @@
                                        GtkTooltip *tooltip,
                                        gpointer data)
 {
-	PurpleMessage *message = gtk_list_item_get_item(data);
+	PidginMessage *pidgin_message = data;
+	PurpleMessage *purple_message = NULL;
 	GDateTime *timestamp = NULL;
 
-	if(!PURPLE_IS_MESSAGE(message)) {
+	if(!PIDGIN_IS_MESSAGE(pidgin_message)) {
 		return FALSE;
 	}
 
-	timestamp = purple_message_get_edited_at(message);
+	purple_message = pidgin_message_get_message(pidgin_message);
+	if(!PURPLE_IS_MESSAGE(purple_message)) {
+		return FALSE;
+	}
+
+	timestamp = purple_message_get_edited_at(purple_message);
 
 	return pidgin_message_set_tooltip_for_timestamp(tooltip, timestamp);
 }
@@ -310,17 +357,15 @@
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_message_get_message_attributes);
 	gtk_widget_class_bind_template_callback(widget_class,
+	                                        pidgin_message_get_timestamp_string);
+	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_message_process_message_contents_cb);
 	gtk_widget_class_bind_template_callback(widget_class,
+	                                        pidgin_message_query_tooltip_contents_cb);
+	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_message_query_tooltip_edited_cb);
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_message_query_tooltip_timestamp_cb);
-
-	gtk_widget_class_bind_template_child(widget_class, PidginMessage, avatar);
-	gtk_widget_class_bind_template_child(widget_class, PidginMessage, author);
-	gtk_widget_class_bind_template_child(widget_class, PidginMessage, edited);
-	gtk_widget_class_bind_template_child(widget_class, PidginMessage,
-	                                     timestamp);
 }
 
 /******************************************************************************
diff --git a/pidgin/resources/Conversations/message.ui b/pidgin/resources/Conversations/message.ui
--- a/pidgin/resources/Conversations/message.ui
+++ b/pidgin/resources/Conversations/message.ui
@@ -55,15 +55,6 @@
               </object>
             </child>
             <child>
-              <object class="GtkLabel" id="timestamp">
-                <binding name="visible">
-                  <lookup name="contains-pointer">motion_controller</lookup>
-                </binding>
-                <property name="has-tooltip">1</property>
-                <signal name="query-tooltip" handler="pidgin_message_query_tooltip_timestamp_cb"/>
-              </object>
-            </child>
-            <child>
               <object class="GtkLabel" id="edited">
                 <binding name="visible">
                   <lookup name="edited" type="PurpleMessage">
@@ -73,6 +64,23 @@
                 <property name="label" translatable="yes">(edited)</property>
                 <property name="has-tooltip">1</property>
                 <signal name="query-tooltip" handler="pidgin_message_query_tooltip_edited_cb"/>
+                <style>
+                  <class name="dim-label"/>
+                </style>
+              </object>
+            </child>
+            <child>
+              <object class="GtkLabel" id="timestamp">
+                <binding name="visible">
+                  <lookup name="contains_pointer">motion_controller</lookup>
+                </binding>
+                <binding name="label">
+                  <closure type="gchararray" function="pidgin_message_get_timestamp_string">
+                    <lookup name="message">PidginMessage</lookup>
+                  </closure>
+                </binding>
+                <property name="has-tooltip">1</property>
+                <signal name="query-tooltip" handler="pidgin_message_query_tooltip_timestamp_cb"/>
               </object>
             </child>
           </object>
@@ -85,10 +93,6 @@
             <property name="yalign">0</property>
             <property name="use-markup">1</property>
             <binding name="label">
-              <!-- this file is used by a GtkItemFactory in
-                  PidginConversation which is why the function name has a
-                  pidgin_conversation prefix.
-                -->
               <closure type="gchararray" function="pidgin_message_process_message_contents_cb">
                 <lookup name="contents" type="PurpleMessage">
                   <lookup name="message">PidginMessage</lookup>
@@ -100,6 +104,8 @@
                 <lookup name="message">PidginMessage</lookup>
               </closure>
             </binding>
+            <property name="has-tooltip">1</property>
+            <signal name="query-tooltip" handler="pidgin_message_query_tooltip_contents_cb"/>
           </object>
         </child>
       </object>
