diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-05-20 13:25:46 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-06-14 00:04:03 +0800 |
commit | 7d48e0689c9c13bfeb7dbc21854a87dfc58a3005 (patch) | |
tree | 9593139dd677a7bc3d660f3e92c77e4abee93794 | |
parent | 04986511e537b4a5d90cc13f63580984e6fa1318 (diff) | |
download | gsoc2013-empathy-7d48e0689c9c13bfeb7dbc21854a87dfc58a3005.tar gsoc2013-empathy-7d48e0689c9c13bfeb7dbc21854a87dfc58a3005.tar.gz gsoc2013-empathy-7d48e0689c9c13bfeb7dbc21854a87dfc58a3005.tar.bz2 gsoc2013-empathy-7d48e0689c9c13bfeb7dbc21854a87dfc58a3005.tar.lz gsoc2013-empathy-7d48e0689c9c13bfeb7dbc21854a87dfc58a3005.tar.xz gsoc2013-empathy-7d48e0689c9c13bfeb7dbc21854a87dfc58a3005.tar.zst gsoc2013-empathy-7d48e0689c9c13bfeb7dbc21854a87dfc58a3005.zip |
Set 'token' and 'supersedes' for events from the logger
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | libempathy/empathy-message.c | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index c7053d89a..fa6e8f7b0 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ LIBCANBERRA_GTK_REQUIRED=0.25 LIBNOTIFY_REQUIRED=0.7.0 TELEPATHY_FARSIGHT_REQUIRED=0.0.14 TELEPATHY_GLIB_REQUIRED=0.15.1 -TELEPATHY_LOGGER=0.2.8 +TELEPATHY_LOGGER=0.2.9.1 # Optional deps CLUTTER_GTK_REQUIRED=0.90.3 diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c index d68309bb3..06913dc0c 100644 --- a/libempathy/empathy-message.c +++ b/libempathy/empathy-message.c @@ -341,7 +341,8 @@ empathy_message_from_tpl_log_event (TplEvent *logevent) TpAccount *account = NULL; TplEntity *receiver = NULL; TplEntity *sender = NULL; - gchar *body= NULL; + gchar *body = NULL; + const gchar *token = NULL, *supersedes = NULL; EmpathyContact *contact; TpChannelTextMessageType type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL; @@ -364,14 +365,18 @@ empathy_message_from_tpl_log_event (TplEvent *logevent) g_object_unref (acc_man); if (TPL_IS_TEXT_EVENT (logevent)) { - body = g_strdup (tpl_text_event_get_message ( - TPL_TEXT_EVENT (logevent))); + TplTextEvent *textevent = TPL_TEXT_EVENT (logevent); + + body = g_strdup (tpl_text_event_get_message (textevent)); type = tpl_text_event_get_message_type (TPL_TEXT_EVENT (logevent)); + token = tpl_text_event_get_message_token (textevent); + supersedes = tpl_text_event_get_supersedes_token (textevent); } #ifdef HAVE_CALL_LOGS else if (TPL_IS_CALL_EVENT (logevent)) { TplCallEvent *call = TPL_CALL_EVENT (logevent); + if (tpl_call_event_get_end_reason (call) == TPL_CALL_END_REASON_NO_ANSWER) body = g_strdup_printf (_("Missed call from %s"), tpl_entity_get_alias (tpl_event_get_sender (logevent))); @@ -393,6 +398,8 @@ empathy_message_from_tpl_log_event (TplEvent *logevent) retval = g_object_new (EMPATHY_TYPE_MESSAGE, "type", type, + "token", token, + "supersedes", supersedes, "body", body, "is-backlog", TRUE, "timestamp", tpl_event_get_timestamp (logevent), |