[Telepathy-commits] [telepathy-gabble/master] change buddies queries to use <view> instead of <query>
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Fri Sep 26 10:02:12 PDT 2008
20080523102605-7fe3f-77af5c8dad4f6ddc0ca48c54749fd84eb575f321.gz
---
src/conn-olpc.c | 12 ++++++------
tests/twisted/olpc/olpc-buddy-search.py | 24 ++++++++++++------------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index 909283b..68497a9 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -3189,15 +3189,15 @@ buddy_query_result_cb (GabbleConnection *conn,
GObject *_view,
gpointer user_data)
{
- LmMessageNode *query;
+ LmMessageNode *view_node;
GabbleOlpcBuddyView *view = GABBLE_OLPC_BUDDY_VIEW (_view);
- query = lm_message_node_get_child_with_namespace (reply_msg->node, "query",
+ view_node = lm_message_node_get_child_with_namespace (reply_msg->node, "view",
NS_OLPC_BUDDY);
- if (query == NULL)
+ if (view_node == NULL)
return LM_HANDLER_RESULT_REMOVE_MESSAGE;
- add_buddies_to_view_from_node (conn, view, query);
+ add_buddies_to_view_from_node (conn, view, view_node);
return LM_HANDLER_RESULT_REMOVE_MESSAGE;
}
@@ -3248,7 +3248,7 @@ olpc_gadget_request_random_buddies (GabbleSvcOLPCGadget *iface,
query = lm_message_build_with_sub_type (conn->olpc_gadget_buddy,
LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_GET,
- '(', "query", "",
+ '(', "view", "",
'@', "xmlns", NS_OLPC_BUDDY,
'@', "id", id_str,
'(', "random", "",
@@ -3316,7 +3316,7 @@ olpc_gadget_search_buddies_by_properties (GabbleSvcOLPCGadget *iface,
query = lm_message_build_with_sub_type (conn->olpc_gadget_buddy,
LM_MESSAGE_TYPE_IQ, LM_MESSAGE_SUB_TYPE_GET,
- '(', "query", "",
+ '(', "view", "",
'@', "xmlns", NS_OLPC_BUDDY,
'@', "id", id_str,
'(', "buddy", "",
diff --git a/tests/twisted/olpc/olpc-buddy-search.py b/tests/twisted/olpc/olpc-buddy-search.py
index f20ea5f..8e77f0f 100644
--- a/tests/twisted/olpc/olpc-buddy-search.py
+++ b/tests/twisted/olpc/olpc-buddy-search.py
@@ -113,10 +113,10 @@ def test(q, bus, conn, stream):
EventPattern('stream-iq', to='gadget.localhost', query_ns=NS_OLPC_BUDDY),
EventPattern('dbus-return', method='RequestRandomBuddies'))
- query = iq_event.stanza.firstChildElement()
- assert query.name == 'query'
- assert query['id'] == '0'
- random = xpath.queryForNodes('/iq/query/random', iq_event.stanza)
+ view = iq_event.stanza.firstChildElement()
+ assert view.name == 'view'
+ assert view['id'] == '0'
+ random = xpath.queryForNodes('/iq/view/random', iq_event.stanza)
assert len(random) == 1
assert random[0]['max'] == '3'
@@ -124,8 +124,8 @@ def test(q, bus, conn, stream):
reply = make_result_iq(stream, iq_event.stanza)
reply['from'] = 'gadget.localhost'
reply['to'] = 'alice at localhost'
- query = xpath.queryForNodes('/iq/query', reply)[0]
- buddy = query.addElement((None, "buddy"))
+ view = xpath.queryForNodes('/iq/view', reply)[0]
+ buddy = view.addElement((None, "buddy"))
buddy['jid'] = 'bob at localhost'
properties = buddy.addElement((NS_OLPC_BUDDY_PROPS, "properties"))
property = properties.addElement((None, "property"))
@@ -159,10 +159,10 @@ def test(q, bus, conn, stream):
EventPattern('stream-iq', to='gadget.localhost', query_ns=NS_OLPC_BUDDY),
EventPattern('dbus-return', method='SearchBuddiesByProperties'))
- properties = xpath.queryForNodes('/iq/query/buddy/properties/property', iq_event.stanza)
- query = iq_event.stanza.firstChildElement()
- assert query.name == 'query'
- assert query['id'] == '1'
+ properties = xpath.queryForNodes('/iq/view/buddy/properties/property', iq_event.stanza)
+ view = iq_event.stanza.firstChildElement()
+ assert view.name == 'view'
+ assert view['id'] == '1'
assert len(properties) == 1
property = properties[0]
assert property['type'] == 'str'
@@ -173,8 +173,8 @@ def test(q, bus, conn, stream):
reply = make_result_iq(stream, iq_event.stanza)
reply['from'] = 'gadget.localhost'
reply['to'] = 'alice at localhost'
- query = xpath.queryForNodes('/iq/query', reply)[0]
- buddy = query.addElement((None, "buddy"))
+ view = xpath.queryForNodes('/iq/view', reply)[0]
+ buddy = view.addElement((None, "buddy"))
buddy['jid'] = 'charles at localhost'
properties = buddy.addElement((NS_OLPC_BUDDY_PROPS, "properties"))
property = properties.addElement((None, "property"))
--
1.5.6.5
More information about the Telepathy-commits
mailing list