Not logged in. · Lost password · Register
Forum: agsXMPP RSS
the same of subject
Avatar
GaofengChen #1
Member since Jul 2013 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: I Can't get list of group chats rooms by using miniclient
hello,Alex!

Just like my subject, I don't know how to get list of group chat rooms.
I successfully created two rooms by spark on openfire, there are room1 and room2 in the  the service conference.im.openfire.com(domain).

I have modified the ChatServers.xml like this:

<ChatServers>  
   <Server>conference.im.openfire.com</Server> 
</ChatServers>

After running miniclient , successfully login. In the GroupChat tab, using the button "Find Rooms" ,

RECV:
  1. <iq xmlns="jabber:client" to="dsm@im.openfire.com/MiniClient" type="result" id="agsXMPP_10">
  2. <query xmlns="http://jabber.org/protocol/disco#items">
  3. <item name="User Search" jid="search.im.openfire.com" />
  4. <item name="Socks 5 Bytestreams Proxy" jid="proxy.im.openfire.com" />
  5. <item name="Publish-Subscribe service" jid="pubsub.im.openfire.com" />
  6. <item name="publicroom" jid="conference.im.openfire.com" /></query></iq>

but,  the results  "User Search","Socks 5 Bytestreams Proxy" ,"Publish-Subscribe service","publicroom" are not my wanted.
I don't know what they are, and I want to know why room1 and room2 could not been finded, and how to get them.

so, Alex, Help me , thanks very much.
This post was edited 2 times, last on 2013-07-04, 15:47 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you posted the result of your iq only. Please post also the request.

To get a list of rooms on your server you have to send a disco items query to the Jid of your group chat server which you said is conference.im.openfire.com.

Alex
Avatar
GaofengChen #3
Member since Jul 2013 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: send and recv
  1. SEND: <iq id="agsXMPP_10" type="get"><query xmlns="http://jabber.org/protocol/disco#items" /></iq>
  2.  
  3. RECV: <iq xmlns="jabber:client" to="dsm@im.openfire.com/MiniClient" type="result" id="agsXMPP_10">
  4. <query xmlns="http://jabber.org/protocol/disco#items">
  5. <item name="User Search" jid="search.im.openfire.com" />
  6. <item name="Socks 5 Bytestreams Proxy" jid="proxy.im.openfire.com" />
  7. <item name="Publish-Subscribe service" jid="pubsub.im.openfire.com" />
  8. <item name="publicroom" jid="conference.im.openfire.com" /></query></iq>

I debugged the code of frmMain.cs, the method FindChatRoom,
 
  1. private void FindChatRooms()
  2.         {
  3.             TreeNode node = treeGC.SelectedNode;
  4.             if (node == null || node.Level != 0)
  5.                 return;
  6.  
  7.             DiscoItemsIq discoIq = new DiscoItemsIq(IqType.get);
  8.             discoIq.To = new Jid(node.Text);
  9.             this.XmppCon.IqGrabber.SendIq(discoIq, new IqCB(OnGetChatRooms), node);
  10.         }

The vaue of node.Text  is "conference.im.openfire.com",  and discoIq is "<iq xmlns="jabber:client" id="agsXMPP_11" type="get"><query xmlns="http://jabber.org/protocol/disco#items" >"

Is there any mistake in the code?
This post was edited 2 times, last on 2013-07-05, 10:36 by Alex.
Avatar
GaofengChen #4
Member since Jul 2013 · 3 posts
Group memberships: Members
Show profile · Link to this post
hi,Alex

I have find the problem.

IqGrabber.cs

public void SendIq(IQ iq, IqCB cb, object cbArg)
{           
            if (cb != null)
            {
                TrackerData td = new TrackerData();
                td.cb = cb;
                td.data = cbArg;

                m_grabbing[iq.Id] = td;
              
              iq.RemoveAttribute("to");

            }
    m_connection.Send(iq);
   }

Line "  iq.RemoveAttribute("to"); " is the key.
Avatar
Alex #5
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #3
In your request below the to attribute is missing.

<iq id="agsXMPP_10" type="get"><query xmlns="http://jabber.org/protocol/disco#items" /></iq>

It must be:

  1. <iq id="agsXMPP_10" to="conference.im.openfire.com" type="get"><query xmlns="http://jabber.org/protocol/disco#items" /></iq>
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #4
Quote by GaofengChen:
I have find the problem.
.....

Line "  iq.RemoveAttribute("to"); " is the key.

no, that's definitely wrong.
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: agsXMPP RSS