telepathy-haze: Use non-deprecated TpMessage APIs

Simon McVittie smcv at kemper.freedesktop.org
Mon May 7 11:15:17 PDT 2012


Module: telepathy-haze
Branch: master
Commit: bab2be17b5c6af95b7a990038a1978454829b511
URL:    http://cgit.freedesktop.org/telepathy/telepathy-haze/commit/?id=bab2be17b5c6af95b7a990038a1978454829b511

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon May  7 18:02:06 2012 +0100

Use non-deprecated TpMessage APIs

---

 src/im-channel.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/im-channel.c b/src/im-channel.c
index 9dbc43a..68efacb 100644
--- a/src/im-channel.c
+++ b/src/im-channel.c
@@ -757,8 +757,8 @@ _make_message (HazeIMChannel *self,
                PurpleMessageFlags flags,
                time_t mtime)
 {
-  TpMessage *message = tp_message_new ((TpBaseConnection *) self->priv->conn,
-      2, 2);
+  TpBaseConnection *base_conn = (TpBaseConnection *) self->priv->conn;
+  TpMessage *message = tp_cm_message_new (base_conn, 2);
   TpChannelTextMessageType type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL;
   time_t now = time (NULL);
 
@@ -767,8 +767,7 @@ _make_message (HazeIMChannel *self,
   else if (purple_message_meify (text_plain, -1))
     type = TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION;
 
-  tp_message_set_handle (message, 0, "message-sender", TP_HANDLE_TYPE_CONTACT,
-      self->priv->handle);
+  tp_cm_message_set_sender (message, self->priv->handle);
   tp_message_set_uint32 (message, 0, "message-type", type);
 
   /* FIXME: the second half of this test shouldn't be necessary but prpl-jabber
@@ -790,11 +789,11 @@ static TpMessage *
 _make_delivery_report (HazeIMChannel *self,
                        char *text_plain)
 {
-  TpMessage *report = tp_message_new ((TpBaseConnection *) self->priv->conn, 2,
-      2);
+  TpBaseConnection *base_conn = (TpBaseConnection *) self->priv->conn;
+  TpMessage *report = tp_cm_message_new (base_conn, 2);
 
   /* "MUST be the intended recipient of the original message" */
-  tp_message_set_uint32 (report, 0, "message-sender", self->priv->handle);
+  tp_cm_message_set_sender (report, self->priv->handle);
   tp_message_set_uint32 (report, 0, "message-type",
       TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT);
   /* FIXME: we don't know that the failure is temporary */



More information about the telepathy-commits mailing list