diff options
author | Pierre-Luc Beaudoin <pierre-luc@pierlux.com> | 2009-05-27 03:38:32 +0800 |
---|---|---|
committer | Pierre-Luc Beaudoin <pierre-luc@pierlux.com> | 2009-05-28 00:52:09 +0800 |
commit | c40737394bff5c27daea7e4ee08f240224475904 (patch) | |
tree | 23b00052be64cd0601148b67c41a59e96e44648b /libempathy-gtk/empathy-contact-widget.c | |
parent | c734c5e2451582a52596e44f96e617ee346b6598 (diff) | |
download | gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.gz gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.bz2 gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.lz gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.xz gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.tar.zst gsoc2013-empathy-c40737394bff5c27daea7e4ee08f240224475904.zip |
Display relative time to user
The time of the geolocation update is displayed relatively to
current time (1 min ago, 3 hours ago).
The function just prints ("in the future") for debugging purpuses
for time in the future.
Diffstat (limited to 'libempathy-gtk/empathy-contact-widget.c')
-rw-r--r-- | libempathy-gtk/empathy-contact-widget.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 22f274640..226c5cb90 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -1340,9 +1340,9 @@ contact_widget_location_update (EmpathyContactWidget *information) stamp = g_value_get_int64 (value); time = stamp; - user_date = empathy_time_to_string_local (time, _("%B %e, %Y at %R")); + user_date = empathy_time_to_string_relative (time); - text = g_strconcat ( _("<b>Location</b> on "), user_date, NULL); + text = g_strconcat ( _("<b>Location</b>, "), user_date, NULL); gtk_label_set_markup (GTK_LABEL (information->label_location), text); g_free (text); } @@ -1367,8 +1367,6 @@ contact_widget_location_update (EmpathyContactWidget *information) char *svalue = NULL; skey = (const gchar *) key; - if (tp_strdiff (skey, EMPATHY_LOCATION_TIMESTAMP) == FALSE) - continue; user_label = location_key_to_label (skey); gvalue = (GValue *) pvalue; @@ -1389,6 +1387,13 @@ contact_widget_location_update (EmpathyContactWidget *information) { svalue = g_value_dup_string (gvalue); } + else if (G_VALUE_TYPE (gvalue) == G_TYPE_INT64) + { + time_t time; + + time = g_value_get_int64 (value); + svalue = empathy_time_to_string_utc (time, _("%B %e, %Y at %R UTC")); + } if (svalue != NULL) { |