I am working my way through the book (big fan of!) and have come across a scenario in the "Gab" app that I have not been able to figure out. I would like to limit the roster of available users to chat with to a list of users matching a certain criteria, say, email address, user name, etc ...
I modified the reference to jabber:iq:roster to use jabber:iq:search in Gab.
js:
From:
var iq = $iq({type: 'get'}).c('query', {xmlns: 'jabber:iq:roster'});
To:
var iq = $iq({to: "vjud.our_url", type: "set"})
.c("query", {xmlns: "jabber:iq:search"})
.c("x", {xmlns: "jabber:x:data", type: "submit"})
.c("field", {var: "user"})
.c("value", 'smith*');
I then reload the page, but do not receive any search results. I submitted the following via the "Peek" app and the expected search results were returned:
<iq to='vjud.our_url' type='set' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'>
<x xmlns='jabber:x:data' type='submit'>
<field var='user'><value>smith*</value></field>
</x>
</query>
</iq>
I'm wondering if there is a parameter of some sort that I am missing? Does anyone have any ideas or advice?
Thanks