From 3f1b321290d57754584f5d547f801c9cc6f04c75 Mon Sep 17 00:00:00 2001 From: Pierre-Luc Beaudoin Date: Sun, 25 Jan 2009 23:07:04 +1100 Subject: Expect the timestamp to be a int64 --- libempathy-gtk/empathy-contact-widget.c | 35 +++++++++++++++++---------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 30f1e4c25..401a1db3a 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -1264,23 +1264,24 @@ contact_widget_location_update (EmpathyContactWidget *information) gtk_label_set_markup (GTK_LABEL (information->label_location), _("Location")); else { - const gchar *str_date = g_value_get_string (value); - struct tm * ptm = g_new0 (struct tm, 1); - - gchar * p = strptime (str_date, "%Y%m%dT%T", ptm); - if (p != NULL) - { - gchar *text; - gchar user_date [100]; - if (strftime (user_date, 100, _("%B %e, %Y at %R UTC"), ptm) > 0) - { - text = g_strconcat ( _("Location on "), user_date, NULL); - gtk_label_set_markup (GTK_LABEL (information->label_location), text); - g_free (text); - } - else - gtk_label_set_markup (GTK_LABEL (information->label_location), _("Location")); - } + gchar user_date [100]; + gint64 stamp; + struct tm *ptm; + time_t time; + + stamp = g_value_get_int64 (value); + time = stamp; + ptm = gmtime (&time); + + if (strftime (user_date, 100, _("%B %e, %Y at %R UTC"), ptm) > 0) + { + gchar *text; + text = g_strconcat ( _("Location on "), user_date, NULL); + gtk_label_set_markup (GTK_LABEL (information->label_location), text); + g_free (text); + } + else + gtk_label_set_markup (GTK_LABEL (information->label_location), _("Location")); } if (/* information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP || */ -- cgit v1.2.3