summaryrefslogtreecommitdiff
path: root/src/idle-text.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-03-17 10:25:48 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-03-17 10:25:48 +0100
commitbf1d7bf5a6e0d5227619ad4639e73553b235177f (patch)
tree257fdd009959304a8f6a252f47411797d9335271 /src/idle-text.c
parent8681199e058f8abb2c0c0a0a2e477d2d7450a3a0 (diff)
Use tp_cm_message_new_text()
It makes the code simpler and set the message-sender-id key (fdo #35362).
Diffstat (limited to 'src/idle-text.c')
-rw-r--r--src/idle-text.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/idle-text.c b/src/idle-text.c
index 160b24b..cc7fd41 100644
--- a/src/idle-text.c
+++ b/src/idle-text.c
@@ -229,19 +229,11 @@ idle_text_received (GObject *chan,
{
TpMessage *msg;
- msg = tp_message_new (base_conn, 2, 2);
+ msg = tp_cm_message_new_text (base_conn, sender,
+ TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, text);
- /* Header */
- if (type != TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL)
- tp_message_set_uint32 (msg, 0, "message-type", type);
-
- tp_message_set_handle (msg, 0, "message-sender", TP_HANDLE_TYPE_CONTACT, sender);
tp_message_set_int64 (msg, 0, "message-received", time (NULL));
- /* Body */
- tp_message_set_string (msg, 1, "content-type", "text/plain");
- tp_message_set_string (msg, 1, "content", text);
-
tp_message_mixin_take_received (chan, msg);
return TRUE;
}