]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-message.c
Merge branch 'gnome-3-8'
[empathy.git] / libempathy / empathy-message.c
index 6111bcd8c25ace3f783f840325353b111c62a964..d6f30a6789e4cd66e4400b3eb66c2f64aeea5779 100644 (file)
  */
 
 #include "config.h"
-
-#include <string.h>
+#include "empathy-message.h"
 
 #include <glib/gi18n-lib.h>
-
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/account.h>
-#include <telepathy-glib/account-manager.h>
-
-#include <telepathy-logger/entity.h>
-#include <telepathy-logger/event.h>
-#include <telepathy-logger/text-event.h>
-#ifdef HAVE_CALL_LOGS
-# include <telepathy-logger/call-event.h>
-#endif
+#include <tp-account-widgets/tpaw-time.h>
 
 #include "empathy-client-factory.h"
-#include "empathy-message.h"
 #include "empathy-utils.h"
 #include "empathy-enum-types.h"
 
@@ -208,7 +196,7 @@ empathy_message_init (EmpathyMessage *message)
                EMPATHY_TYPE_MESSAGE, EmpathyMessagePriv);
 
        message->priv = priv;
-       priv->timestamp = empathy_time_get_current ();
+       priv->timestamp = tpaw_time_get_current ();
 }
 
 static void
@@ -326,7 +314,7 @@ message_set_property (GObject      *object,
        case PROP_TIMESTAMP:
                priv->timestamp = g_value_get_int64 (value);
                if (priv->timestamp <= 0)
-                       priv->timestamp = empathy_time_get_current ();
+                       priv->timestamp = tpaw_time_get_current ();
                break;
        case PROP_ORIGINAL_TIMESTAMP:
                priv->original_timestamp = g_value_get_int64 (value);
@@ -405,13 +393,12 @@ empathy_message_from_tpl_log_event (TplEvent *logevent)
                type = tpl_text_event_get_message_type (TPL_TEXT_EVENT (logevent));
                token = tpl_text_event_get_message_token (textevent);
        }
-#ifdef HAVE_CALL_LOGS
        else if (TPL_IS_CALL_EVENT (logevent)) {
                TplCallEvent *call = TPL_CALL_EVENT (logevent);
 
                timestamp = tpl_event_get_timestamp (logevent);
 
-               if (tpl_call_event_get_end_reason (call) == TPL_CALL_END_REASON_NO_ANSWER)
+               if (tpl_call_event_get_end_reason (call) == TP_CALL_STATE_CHANGE_REASON_NO_ANSWER)
                        body = g_strdup_printf (_("Missed call from %s"),
                                tpl_entity_get_alias (tpl_event_get_sender (logevent)));
                else if (tpl_entity_get_entity_type (tpl_event_get_sender (logevent)) == TPL_ENTITY_SELF)
@@ -422,7 +409,6 @@ empathy_message_from_tpl_log_event (TplEvent *logevent)
                        body = g_strdup_printf (_("Call from %s"),
                                tpl_entity_get_alias (tpl_event_get_sender (logevent)));
        }
-#endif
        else {
                /* Unknown event type */
                return NULL;