diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2011-02-24 18:17:15 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-02-25 01:09:23 +0800 |
commit | 67920cae23f4b8020559d7548fd1dff8de44e962 (patch) | |
tree | d9784819ef3db4a959030020e0c646902441bb39 /libempathy/empathy-message.c | |
parent | 677a6bf7fca3ce8e26cf02d36c2721fa03510a4d (diff) | |
download | gsoc2013-empathy-67920cae23f4b8020559d7548fd1dff8de44e962.tar gsoc2013-empathy-67920cae23f4b8020559d7548fd1dff8de44e962.tar.gz gsoc2013-empathy-67920cae23f4b8020559d7548fd1dff8de44e962.tar.bz2 gsoc2013-empathy-67920cae23f4b8020559d7548fd1dff8de44e962.tar.lz gsoc2013-empathy-67920cae23f4b8020559d7548fd1dff8de44e962.tar.xz gsoc2013-empathy-67920cae23f4b8020559d7548fd1dff8de44e962.tar.zst gsoc2013-empathy-67920cae23f4b8020559d7548fd1dff8de44e962.zip |
Port empathy to Telepathy logger 0.2.0
Diffstat (limited to 'libempathy/empathy-message.c')
-rw-r--r-- | libempathy/empathy-message.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c index ca3b020ac..e194573db 100644 --- a/libempathy/empathy-message.c +++ b/libempathy/empathy-message.c @@ -31,8 +31,8 @@ #include <telepathy-glib/account-manager.h> #include <telepathy-logger/entity.h> -#include <telepathy-logger/entry.h> -#include <telepathy-logger/entry-text.h> +#include <telepathy-logger/event.h> +#include <telepathy-logger/text-event.h> #include "empathy-message.h" #include "empathy-utils.h" @@ -259,7 +259,7 @@ empathy_message_new (const gchar *body) } EmpathyMessage * -empathy_message_from_tpl_log_entry (TplEntry *logentry) +empathy_message_from_tpl_log_event (TplEvent *logevent) { EmpathyMessage *retval = NULL; TpAccountManager *acc_man = NULL; @@ -269,7 +269,7 @@ empathy_message_from_tpl_log_entry (TplEntry *logentry) gchar *body= NULL; EmpathyContact *contact; - g_return_val_if_fail (TPL_IS_ENTRY (logentry), NULL); + g_return_val_if_fail (TPL_IS_EVENT (logevent), NULL); acc_man = tp_account_manager_dup (); /* FIXME Currently Empathy shows in the log viewer only valid accounts, so it @@ -284,24 +284,24 @@ empathy_message_from_tpl_log_entry (TplEntry *logentry) * needed anymore any TpAccount passing and the following call will be * useless */ account = tp_account_manager_ensure_account (acc_man, - tpl_entry_get_account_path (logentry)); + tpl_event_get_account_path (logevent)); g_object_unref (acc_man); - /* TODO Currently only TplLogEntryText exists as subclass of TplEntry, in - * future more TplEntry will exist and EmpathyMessage should probably - * be enhanced to support other types of log entries (ie TplLogEntryCall). + /* TODO Currently only TplTextEvent exists as subclass of TplEvent, in + * future more TplEvent will exist and EmpathyMessage should probably + * be enhanced to support other types of log entries (ie TplCallEvent). * * For now we just check (simply) that we are dealing with the only supported type, * then there will be a if/then/else or switch handling all the supported * cases. */ - if (!TPL_IS_ENTRY_TEXT (logentry)) + if (!TPL_IS_TEXT_EVENT (logevent)) return NULL; - body = g_strdup (tpl_entry_text_get_message ( - TPL_ENTRY_TEXT (logentry))); - receiver = tpl_entry_get_receiver (logentry); - sender = tpl_entry_get_sender (logentry); + body = g_strdup (tpl_text_event_get_message ( + TPL_TEXT_EVENT (logevent))); + receiver = tpl_event_get_receiver (logevent); + sender = tpl_event_get_sender (logevent); retval = empathy_message_new (body); if (receiver != NULL) { @@ -317,9 +317,7 @@ empathy_message_from_tpl_log_entry (TplEntry *logentry) } empathy_message_set_timestamp (retval, - tpl_entry_get_timestamp (logentry)); - empathy_message_set_id (retval, - tpl_entry_text_get_pending_msg_id (TPL_ENTRY_TEXT (logentry))); + tpl_event_get_timestamp (logevent)); empathy_message_set_is_backlog (retval, TRUE); g_free (body); |