aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2011-04-21 10:52:39 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2011-04-21 10:52:39 +0800
commit462c1b74848498594239e818270efbcc0cac5170 (patch)
tree06c4eb10110794905d012c82754412996501984e /src
parentfd96433c558ca24e8db7397b69cbd600caa6b793 (diff)
parenteaaf3c72dcb03ad0be08f53e7b621cdc279cf21e (diff)
downloadgsoc2013-empathy-462c1b74848498594239e818270efbcc0cac5170.tar
gsoc2013-empathy-462c1b74848498594239e818270efbcc0cac5170.tar.gz
gsoc2013-empathy-462c1b74848498594239e818270efbcc0cac5170.tar.bz2
gsoc2013-empathy-462c1b74848498594239e818270efbcc0cac5170.tar.lz
gsoc2013-empathy-462c1b74848498594239e818270efbcc0cac5170.tar.xz
gsoc2013-empathy-462c1b74848498594239e818270efbcc0cac5170.tar.zst
gsoc2013-empathy-462c1b74848498594239e818270efbcc0cac5170.zip
Merge branch 'timestamp-rebase' into empathy-skype
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-manager.c10
-rw-r--r--src/empathy-event-manager.c2
-rw-r--r--src/empathy-map-view.c16
3 files changed, 22 insertions, 6 deletions
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c
index 4ff6b7d30..8455001f5 100644
--- a/src/empathy-chat-manager.c
+++ b/src/empathy-chat-manager.c
@@ -216,6 +216,16 @@ handle_channels (TpSimpleHandler *handler,
TpChannel *channel = l->data;
EmpathyTpChat *tp_chat;
+ 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;
+ }
+
tp_chat = empathy_tp_chat_new (account, channel);
if (empathy_tp_chat_is_ready (tp_chat))
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 041d22a18..e2ce0725f 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -1037,7 +1037,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 31fa997c2..321fbce53 100644
--- a/src/empathy-map-view.c
+++ b/src/empathy-map-view.c
@@ -231,7 +231,7 @@ map_view_contacts_update_label (ChamplainMarker *marker)
gchar *date;
gchar *label;
GValue *gtime;
- time_t loctime;
+ gint64 loctime;
GHashTable *location;
EmpathyContact *contact;
@@ -242,18 +242,24 @@ map_view_contacts_update_label (ChamplainMarker *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))
- clutter_actor_set_opacity (CLUTTER_ACTOR (marker), 0.75 * 255);
+ 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
{