[Telepathy-commits] [telepathy-gabble/master] use "id" as attribute instead of the old misnamed "type" attribute in Gadget current-activity change message
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Fri Sep 26 10:02:37 PDT 2008
20080703133356-7fe3f-f000fd3241086f0d9ef57305826c59eb93547572.gz
---
src/conn-olpc.c | 6 ++++++
tests/twisted/olpc/util.py | 3 +--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index b744cf0..ccba52e 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -1471,6 +1471,12 @@ extract_current_activity (GabbleConnection *conn,
return NULL;
id = lm_message_node_get_attribute (node, "type");
+ if (id == NULL)
+ {
+ /* This attribute should be called "id" and not "type". Gadget uses the
+ * right name. */
+ id = lm_message_node_get_attribute (node, "id");
+ }
room = lm_message_node_get_attribute (node, "room");
if (room == NULL || room[0] == '\0')
diff --git a/tests/twisted/olpc/util.py b/tests/twisted/olpc/util.py
index 29659d1..da419ba 100644
--- a/tests/twisted/olpc/util.py
+++ b/tests/twisted/olpc/util.py
@@ -148,8 +148,7 @@ def send_gadget_current_activity_changed_msg(stream, buddy, view_id, id, room):
message = elem('message', from_='gadget.localhost',
to='test at localhost', type='notice')(
elem(NS_OLPC_BUDDY, 'change', jid=buddy, id=view_id)(
- elem(NS_OLPC_CURRENT_ACTIVITY, 'activity', type=id, room=room)()
- ),
+ elem(NS_OLPC_CURRENT_ACTIVITY, 'activity', id=id, room=room)()),
elem(NS_AMP, 'amp')(
elem('rule', condition='deliver-at', value='stored',
action='error')))
--
1.5.6.5
More information about the Telepathy-commits
mailing list