summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-03-18 16:56:25 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-25 19:26:20 +0000
commita2e432bdc542f797d22b12dfe570099dfaf2927d (patch)
tree777fe42e9e3c9480bf3457929a23d2635c4afd3c
parentd3d49d5550bc703d5c8399a3d4530ba825e736c9 (diff)
new tp_message_* API
-rw-r--r--libempathy/empathy-message.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index c9ef6b15..b0207b4d 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -674,26 +674,28 @@ empathy_message_new_from_tp_message (TpMessage *tp_msg,
gboolean incoming)
{
EmpathyMessage *message;
- gchar *body;
+ gchar *body, *token, *supersedes;
gint64 timestamp;
gint64 original_timestamp;
- const GHashTable *part = tp_message_peek (tp_msg, 0);
+ GVariant *part = tp_message_dup_part (tp_msg, 0);
g_return_val_if_fail (TP_IS_MESSAGE (tp_msg), NULL);
body = tp_message_to_text (tp_msg);
+ token = tp_message_dup_token (tp_msg);
+ supersedes = tp_message_dup_supersedes (tp_msg);
timestamp = tp_message_get_sent_timestamp (tp_msg);
if (timestamp == 0)
timestamp = tp_message_get_received_timestamp (tp_msg);
- original_timestamp = tp_asv_get_int64 (part,
+ original_timestamp = tp_vardict_get_int64 (part,
"original-message-received", NULL);
message = g_object_new (EMPATHY_TYPE_MESSAGE,
"body", body,
- "token", tp_message_get_token (tp_msg),
- "supersedes", tp_message_get_supersedes (tp_msg),
+ "token", token,
+ "supersedes", supersedes,
"type", tp_message_get_message_type (tp_msg),
"timestamp", timestamp,
"original-timestamp", original_timestamp,
@@ -703,5 +705,8 @@ empathy_message_new_from_tp_message (TpMessage *tp_msg,
NULL);
g_free (body);
+ g_free (token);
+ g_free (supersedes);
+ g_variant_unref (part);
return message;
}