[Telepathy-commits] [telepathy-gabble/master] Use "content-type" message key rather than "type"

Will Thompson will.thompson at collabora.co.uk
Tue Feb 3 06:34:51 PST 2009


This was changed in spec version 0.17.14
---
 src/im-channel.c                |    2 +-
 src/message-util.c              |    2 +-
 src/muc-channel.c               |    2 +-
 tests/twisted/muc/test-muc.py   |    8 ++++----
 tests/twisted/text/test-text.py |    8 ++++----
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/im-channel.c b/src/im-channel.c
index c003777..70fd15f 100644
--- a/src/im-channel.c
+++ b/src/im-channel.c
@@ -528,7 +528,7 @@ _gabble_im_channel_receive (GabbleIMChannel *chan,
       sender);
 
   /* Body */
-  tp_message_set_string (msg, 1, "type", "text/plain");
+  tp_message_set_string (msg, 1, "content-type", "text/plain");
   tp_message_set_string (msg, 1, "content", text);
 
 
diff --git a/src/message-util.c b/src/message-util.c
index 71353ac..deae3cd 100644
--- a/src/message-util.c
+++ b/src/message-util.c
@@ -123,7 +123,7 @@ gabble_message_util_send_message (GObject *obj,
         (n_parts - 1));
 
   part = tp_message_peek (message, 1);
-  content_type = tp_asv_get_string (part, "type");
+  content_type = tp_asv_get_string (part, "content-type");
   text = tp_asv_get_string (part, "content");
 
   if (content_type == NULL || tp_strdiff (content_type, "text/plain"))
diff --git a/src/muc-channel.c b/src/muc-channel.c
index 8f7ca62..d11bd61 100644
--- a/src/muc-channel.c
+++ b/src/muc-channel.c
@@ -2266,7 +2266,7 @@ _gabble_muc_channel_receive (GabbleMucChannel *chan,
       sender);
 
   /* Body */
-  tp_message_set_string (message, 1, "type", "text/plain");
+  tp_message_set_string (message, 1, "content-type", "text/plain");
   tp_message_set_string (message, 1, "content", text);
 
   if (is_echo)
diff --git a/tests/twisted/muc/test-muc.py b/tests/twisted/muc/test-muc.py
index 671edbd..93a2c4d 100644
--- a/tests/twisted/muc/test-muc.py
+++ b/tests/twisted/muc/test-muc.py
@@ -118,7 +118,7 @@ def test(q, bus, conn, stream):
     # messages."
     assert 'message-type' not in header, header
 
-    assert body['type'] == 'text/plain', body
+    assert body['content-type'] == 'text/plain', body
     assert body['content'] == 'hello', body
 
 
@@ -141,7 +141,7 @@ def test(q, bus, conn, stream):
     greeting = [
         dbus.Dictionary({ 'message-type': 1, # Action
                         }, signature='sv'),
-        { 'type': 'text/plain',
+        { 'content-type': 'text/plain',
           'content': u"peers through a gap in the curtains",
         }
     ]
@@ -161,7 +161,7 @@ def test(q, bus, conn, stream):
     header = sent_message[0]
     assert header['message-type'] == 1, header # Action
     body = sent_message[1]
-    assert body['type'] == 'text/plain', body
+    assert body['content-type'] == 'text/plain', body
     assert body['content'] == u'peers through a gap in the curtains', body
 
     assert sent.args[1] == 1, sent.args # Action
@@ -240,7 +240,7 @@ def test(q, bus, conn, stream):
     header = sent_message[0]
     assert 'message-type' not in header, header # Normal
     body = sent_message[1]
-    assert body['type'] == 'text/plain', body
+    assert body['content-type'] == 'text/plain', body
     assert body['content'] == u'goodbye', body
 
     assert sent.args[1] == 0, sent.args # Normal
diff --git a/tests/twisted/text/test-text.py b/tests/twisted/text/test-text.py
index 3c09b01..985a7d4 100644
--- a/tests/twisted/text/test-text.py
+++ b/tests/twisted/text/test-text.py
@@ -82,7 +82,7 @@ def test(q, bus, conn, stream):
     # messages."
     assert 'message-type' not in header, header
 
-    assert body['type'] == 'text/plain', body
+    assert body['content-type'] == 'text/plain', body
     assert body['content'] == 'hello', body
 
     # Remove the message from the pending message queue, and check that
@@ -103,7 +103,7 @@ def test(q, bus, conn, stream):
     greeting = [
         dbus.Dictionary({ 'message-type': 2, # Notice
                         }, signature='sv'),
-        { 'type': 'text/plain',
+        { 'content-type': 'text/plain',
           'content': u"what up",
         }
     ]
@@ -130,7 +130,7 @@ def test(q, bus, conn, stream):
     header = sent_message[0]
     assert header['message-type'] == 2, header # Notice
     body = sent_message[1]
-    assert body['type'] == 'text/plain', body
+    assert body['content-type'] == 'text/plain', body
     assert body['content'] == u'what up', body
 
     assert sent.args[1] == 2, sent.args # Notice
@@ -160,7 +160,7 @@ def test(q, bus, conn, stream):
     # if it would be Normal, message-type SHOULD be omitted
     assert 'message-type' not in header, header
     body = sent_message[1]
-    assert body['type'] == 'text/plain', body
+    assert body['content-type'] == 'text/plain', body
     assert body['content'] == u'goodbye', body
 
     assert sent.args[1] == 0, sent.args # message type normal
-- 
1.5.6.5




More information about the telepathy-commits mailing list