aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy/empathy-message.c22
-rw-r--r--libempathy/empathy-message.h1
2 files changed, 7 insertions, 16 deletions
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index 520dbe650..53422b61a 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -269,14 +269,6 @@ message_set_property (GObject *object,
}
EmpathyMessage *
-empathy_message_new (const gchar *body)
-{
- return g_object_new (EMPATHY_TYPE_MESSAGE,
- "body", body,
- NULL);
-}
-
-EmpathyMessage *
empathy_message_from_tpl_log_event (TplEvent *logevent)
{
EmpathyMessage *retval = NULL;
@@ -321,7 +313,13 @@ empathy_message_from_tpl_log_event (TplEvent *logevent)
receiver = tpl_event_get_receiver (logevent);
sender = tpl_event_get_sender (logevent);
- retval = empathy_message_new (body);
+ retval = g_object_new (EMPATHY_TYPE_MESSAGE,
+ "type", tpl_text_event_get_message_type (TPL_TEXT_EVENT (logevent)),
+ "body", body,
+ "is-backlog", TRUE,
+ "timestamp", tpl_event_get_timestamp (logevent),
+ NULL);
+
if (receiver != NULL) {
contact = empathy_contact_from_tpl_contact (account, receiver);
empathy_message_set_receiver (retval, contact);
@@ -334,12 +332,6 @@ empathy_message_from_tpl_log_event (TplEvent *logevent)
g_object_unref (contact);
}
- empathy_message_set_timestamp (retval,
- tpl_event_get_timestamp (logevent));
- empathy_message_set_tptype (retval,
- tpl_text_event_get_message_type (TPL_TEXT_EVENT (logevent)));
- empathy_message_set_is_backlog (retval, TRUE);
-
g_free (body);
return retval;
diff --git a/libempathy/empathy-message.h b/libempathy/empathy-message.h
index cb57f0755..fd608b19d 100644
--- a/libempathy/empathy-message.h
+++ b/libempathy/empathy-message.h
@@ -55,7 +55,6 @@ struct _EmpathyMessageClass {
GType empathy_message_get_type (void) G_GNUC_CONST;
-EmpathyMessage * empathy_message_new (const gchar *body);
EmpathyMessage * empathy_message_from_tpl_log_event (TplEvent *logevent);
EmpathyMessage * empathy_message_new_from_tp_message (TpMessage *tp_msg,
gboolean incoming);