diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-04-20 15:49:52 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-04-20 15:49:52 +0800 |
commit | bdea54f59e52ebeaa0743674aa5998636f26a241 (patch) | |
tree | a1d5920da73c6737225bfa31b594cb4dd00f59c0 /src | |
parent | 9d9cfc021b05fe9afbe8769d6e0c289cf1dc9734 (diff) | |
parent | eb6ab4328849a0c5ee5959560f90f36fd71a815d (diff) | |
download | gsoc2013-empathy-bdea54f59e52ebeaa0743674aa5998636f26a241.tar gsoc2013-empathy-bdea54f59e52ebeaa0743674aa5998636f26a241.tar.gz gsoc2013-empathy-bdea54f59e52ebeaa0743674aa5998636f26a241.tar.bz2 gsoc2013-empathy-bdea54f59e52ebeaa0743674aa5998636f26a241.tar.lz gsoc2013-empathy-bdea54f59e52ebeaa0743674aa5998636f26a241.tar.xz gsoc2013-empathy-bdea54f59e52ebeaa0743674aa5998636f26a241.tar.zst gsoc2013-empathy-bdea54f59e52ebeaa0743674aa5998636f26a241.zip |
Merge branch 'timestamp-648188'
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-chat-manager.c | 7 | ||||
-rw-r--r-- | src/empathy-event-manager.c | 2 | ||||
-rw-r--r-- | src/empathy-map-view.c | 14 |
3 files changed, 18 insertions, 5 deletions
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c index ff715fe37..6c92c25cb 100644 --- a/src/empathy-chat-manager.c +++ b/src/empathy-chat-manager.c @@ -231,6 +231,13 @@ handle_channels (TpSimpleHandler *handler, if (tp_proxy_get_invalidated (channel) != NULL) continue; + if (!TP_IS_TEXT_CHANNEL (channel)) + { + DEBUG ("Channel %s doesn't implement Messages; can't handle it", + tp_proxy_get_object_path (channel)); + continue; + } + handling = TRUE; tp_chat = empathy_tp_chat_new (account, channel); diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index 342d3e11e..6125ec895 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -934,7 +934,7 @@ approve_channels (TpSimpleApprover *approver, channel_type = tp_channel_get_channel_type_id (channel); - if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_TEXT) + if (TP_IS_TEXT_CHANNEL (channel)) { EmpathyTpChat *tp_chat; diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index b7a2e1975..9e6cc6dee 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -221,7 +221,7 @@ map_view_contacts_update_label (ClutterActor *marker) gchar *date; gchar *label; GValue *gtime; - time_t loctime; + gint64 loctime; GHashTable *location; EmpathyContact *contact; @@ -232,18 +232,24 @@ map_view_contacts_update_label (ClutterActor *marker) if (gtime != NULL) { - time_t now; + GDateTime *now, *d; + GTimeSpan delta; loctime = g_value_get_int64 (gtime); date = empathy_time_to_string_relative (loctime); label = g_strconcat ("<b>", name, "</b>\n<small>", date, "</small>", NULL); g_free (date); - now = time (NULL); + now = g_date_time_new_now_utc (); + d = g_date_time_new_from_unix_utc (loctime); + delta = g_date_time_difference (now, d); /* if location is older than a week */ - if (now - loctime > (60 * 60 * 24 * 7)) + if (delta > G_TIME_SPAN_DAY * 7) clutter_actor_set_opacity (marker, 0.75 * 255); + + g_date_time_unref (now); + g_date_time_unref (d); } else { |