[empathy/next: 61/79] new tp_message_* API
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy/next: 61/79] new tp_message_* API
- Date: Thu, 3 Apr 2014 14:31:06 +0000 (UTC)
commit 9f6bea4b966ef186c1eb7d8cb571ea52f355f375
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Tue Mar 18 16:56:25 2014 +0100
new tp_message_* API
libempathy/empathy-message.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index c9ef6b1..b0207b4 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]