Not logged in. · Lost password · Register
Forum: MatriX RSS
search chatroom
Avatar
jason- #1
Member since Mar 2014 · 2 posts · Location: america
Group memberships: Members
Show profile · Link to this post
Subject: search chatroom
hi alex
i want to search cahatroom in c# and show in listview

send xml : jason.Send("<iq type='set' to='conference.domain.com'><query xmlns='jabber:iq:search'><set xmlns='http://jabber.org/protocol/rsm'><index>" + a + "</index><max>3</max></set><x type='get' xmlns='jabber:x:data'><field var='name'><value>" + textBox8.Text + "</value></field></x></query></iq>");

<max>3</max> = number to search chatroom and add in listview
textbox8.text = room name

recive xml : <iq xmlns="jabber:client" from="conference.domain.com" to="jason@domain.com/jason205" type="result"><query xmlns="jabber:iq:search"><x xmlns="jabber:x:data"><reported><field type="text-single" label="Name" var="name" /><field type="text-single" label="Subject" var="subject" /><field type="text-single" label="Language code" var="language" /><field type="text-single" label="Number of users" var="num_users" /><field type="text-single" label="Max number of users allowed" var="num_max_users" /><field type="boolean" label="Is a password protected room" var="is_password_protected" /><field type="boolean" label="Is a member only room" var="is_member_only" /><field type="list-single" label="Location type" var="location-type" /><field type="text-single" label="Location code" var="location" /><field type="jid-single" label="JID" var="jid" /></reported><item><field type="text-single" var="name"><value>america</value></field><field type="text-single" var="subject"><value>/me  </value></field><field type="text-single" var="num_users"><value>0</value></field><field type="text-single" var="num_max_users"><value>25</value></field><field type="boolean" var="is_password_protected"><value>false</value></field><field type="boolean" var="is_member_only"><value>false</value></field><field type="text-single" var="language"><value /></field><field type="list-single" var="location-type"><value /></field><field type="text-single" var="location"><value /></field><field type="jid-single" var="jid"><value>america@conference.domain.com</value></field></item><item><field type="text-single" var="name"><value>america2</value></field><field type="text-single" var="subject"><value>reaper mom fuked by gFg</value></field><field type="text-single" var="num_users"><value>18</value></field><field type="text-single" var="num_max_users"><value>25</value></field><field type="boolean" var="is_password_protected"><value>false</value></field><field type="boolean" var="is_member_only"><value>false</value></field><field type="text-single" var="language"><value>en</value></field><field type="list-single" var="location-type"><value>worldwide</value></field><field type="text-single" var="location"><value /></field><field type="jid-single" var="jid"><value>america2@conference.domain.com</value></field></item><item><field type="text-single" var="name"><value>america2</value></field><field type="text-single" var="subject"><value>Join for fun :-)</value></field><field type="text-single" var="num_users"><value>17</value></field><field type="text-single" var="num_max_users"><value>25</value></field><field type="boolean" var="is_password_protected"><value>false</value></field><field type="boolean" var="is_member_only"><value>false</value></field><field type="text-single" var="language"><value>en</value></field><field type="list-single" var="location-type"><value>worldwide</value></field><field type="text-single" var="location"><value /></field><field type="jid-single" var="jid"><value>america2@conference.domain.com</value></field></item></x><set xmlns="http://jabber.org/protocol/rsm"><count>101</count><first index="0">america@conference.domain.com</first><last>america2@conference.domain.com</last></set></query></iq>


var="num_users"><value>17</value> = user numbers in chatroom
var="subject"><value>Join for fun :-)</value> = room subject
var="is_password_protected"><value>false</value> = room is locked or unlocked

i want to show num user,subject,lock or unlocked in LISTVIEW. help me please alex
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please use Matrix to build your XML packets you send. The packet you send is invalid because it does not contain an ID.

To get chatrooms on a server you should use service discovery and the DiscoManager.

Alex
Avatar
jason- #3
Member since Mar 2014 · 2 posts · Location: america
Group memberships: Members
Show profile · Link to this post
hi alex i get xml from gajim xml console :

send : <iq xmlns="jabber:client" to="conference.domain.com" type="get" id="248">
<query xmlns="http://jabber.org/protocol/disco#items" />
</iq>


recive :
<iq from="conference.domain.com" to="jason@domain.com/Gajim" type="result" id="248">
<query xmlns="http://jabber.org/protocol/disco#items">
<item jid="pakistan123@conference.domain.com" name="pakistan123"/>
<item jid="americas@conference.domain.com" name="america"/>
<item jid="america*@conference.domain.com" name="america*"/>
<item jid="texas@conference.domain.com" name="texas"/>
<item jid="japan@conference.domain.com" name="japan"/>
<item jid="london@conference.domain.com" name="london"/>
<item jid="eng@conference.domain.com" name="eng"/>
<item jid="pak@conference.domain.com" name="pak"/>
<item jid="indonesia@conference.domain.com" name="indonesia"/>
<item jid="pakistan@conference.domain.com" name="pakistan"/>
<item jid="turkey@conference.domain.com" name="turkey"/>
<item jid="english@conference.domain.com" name="english"/>
<item jid="english2@conference.domain.com" name="english2"/>
<item jid="north@conference.domain.com" name="north"/>


in the gajim listview add part of name="room name"/>


recive from room :

<iq from="kerala@conference.domain.com" to="jason@domain.com/Gajim" type="result" id="249">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="conference" type="text" name="kerala"/>
<feature var="urn:xmpp:ping"/>
<feature var="http://jabber.org/protocol/muc"/>
<feature var="http://jabber.org/protocol/rsm"/>
<feature var="http://jabber.org/protocol/muc#unique"/>
<feature var="muc_nonanonymous"/>
<feature var="muc_unmoderated"/>
<feature var="muc_open"/>
<feature var="muc_persistent"/>
<feature var="muc_public"/>
<feature var="muc_unsecured"/>
<x xmlns="jabber:x:data" type="result">
<field type="hidden" var="FORM_TYPE">
<value>http://jabber.org/protocol/muc#roominfo</value>
</field>
<field type="text-single" var="muc#roomconfig_lang" label="Preferred language to be used in the room">
<value>en</value>
</field>
<field type="text-single" var="muc#roomconfig_location" label="Room location">
<value/>
</field>
<field type="list-single" var="muc#roomconfig_location-type" label="Room location type">
<option label="Worldwide">
<value>worldwide</value>
</option>
<option label="Continent">
<value>continent</value>
</option>
<option label="Country">
<value>country</value>
</option>
<option label="Region">
<value>region</value>
</option>
<value>worldwide</value>
</field>
<field type="text-single" var="muc#roominfo_occupants" label="Number of occupants">
<value>21</value>
</field>
</x>
</query>
</iq>

i find this . can you help me???
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you did never describe what your exact problem is. I'm sorry, I cannot help you when you don't supply a solid description of your problem.
What you have in your Gajim console can be fine in MatriX with the DiscoManager, look there at DesiverItems and DiscoverInformation.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS