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 /libempathy | |
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
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-message.c | 13 |
1 files changed, 10 insertions, 3 deletions
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), |