summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-05-07 18:31:52 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2012-11-16 10:08:45 +0000
commit5c54074f0490f4b5f6b31ecd8f5df011ca32af83 (patch)
tree968b520dfb2e7e4998cd529e42c8b19cc84d96d2
parent9ef6d455d1ea4f48bfe300a1b3c5a89061edc81d (diff)
Use non-deprecated TpMessage APIs
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49594 Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
-rw-r--r--src/text-helper.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/text-helper.c b/src/text-helper.c
index c21842fd..58dd9b30 100644
--- a/src/text-helper.c
+++ b/src/text-helper.c
@@ -313,16 +313,18 @@ text_helper_report_delivery_error (TpSvcChannel *self,
"handle-type", &handle_type,
NULL);
- delivery_echo = tp_message_new (base_conn, 2, 2);
- tp_message_set_handle (delivery_echo, 0, "message-sender",
- TP_HANDLE_TYPE_CONTACT, base_conn->self_handle);
+ delivery_echo = tp_cm_message_new (base_conn, 2);
+ tp_cm_message_set_sender (delivery_echo, base_conn->self_handle);
tp_message_set_uint32 (delivery_echo, 0, "message-type", type);
tp_message_set_int64 (delivery_echo, 0, "message-sent", (gint64)timestamp);
tp_message_set_string (delivery_echo, 1, "content-type", "text/plain");
tp_message_set_string (delivery_echo, 1, "content", text);
- message = tp_message_new (base_conn, 1, 1);
- tp_message_set_handle (message, 0, "message-sender", handle_type, handle);
+ message = tp_cm_message_new (base_conn, 1);
+
+ if (handle_type == TP_HANDLE_TYPE_CONTACT)
+ tp_cm_message_set_sender (message, handle);
+
tp_message_set_uint32 (message, 0, "message-type",
TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT);
tp_message_set_uint32 (message, 0, "delivery-status",
@@ -330,7 +332,7 @@ text_helper_report_delivery_error (TpSvcChannel *self,
tp_message_set_uint32 (message, 0, "delivery-error",
TP_CHANNEL_TEXT_SEND_ERROR_OFFLINE);
tp_message_set_string (message, 0, "delivery-token", token);
- tp_message_take_message (message, 0, "delivery-echo", delivery_echo);
+ tp_cm_message_take_message (message, 0, "delivery-echo", delivery_echo);
g_object_unref (base_conn);
@@ -344,11 +346,10 @@ text_helper_create_received_message (TpBaseConnection *base_conn,
guint type,
const gchar *text)
{
- TpMessage *message = tp_message_new (base_conn, 2, 2);
+ TpMessage *message = tp_cm_message_new (base_conn, 2);
tp_message_set_uint32 (message, 0, "message-type", type);
- tp_message_set_handle (message, 0, "message-sender",
- TP_HANDLE_TYPE_CONTACT, sender_handle);
+ tp_cm_message_set_sender (message, sender_handle);
tp_message_set_int64 (message, 0, "message-received", timestamp);
tp_message_set_string (message, 1, "content-type", "text/plain");