Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
AndyGear #1
Member since Jan 2012 · 6 posts
Group memberships: Members, Premium
Show profile · Link to this post
Subject: Request List of users in Chatroom
Hello,

I've tried to follow the example in the MiniClient to request a list of users in a chatroom, but I am not receiving any DiscoItems:

public void ListPlayersInRoom(string roomName, participantsDelegate callback)
    {
        _participantsDelegate = callback;
        DiscoInfoIq discoIq = new DiscoInfoIq(IqType.get);
        discoIq.To = makeMucJid(roomName);
        _xmppCon.IqGrabber.SendIq(discoIq, new IqCB(ListPlayersInRoomCallback));
    }

    private void ListPlayersInRoomCallback(object sender, IQ iq, object data)
    {
        DiscoItems items = iq.Query as DiscoItems;
        if (items == null)
            return;

        DiscoItem[] players = items.GetDiscoItems();
        foreach (DiscoItem player in players)
        {
            _participantsDelegate(iq.From.User, player.Jid.User);
        }
    }

    private Jid makeMucJid(string room)
    {
        return new Jid(room + "@conference." + _domain);
    }

Any suggestions or ideas?
Avatar
Alex #2
Member since Feb 2003 · 4328 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Can you please also post the resulting xml?
Avatar
AndyGear #3
Member since Jan 2012 · 6 posts
Group memberships: Members, Premium
Show profile · Link to this post
As it turns out it was my mistake.  The room was not actually being created on the server which is why nothing was returned.  Bad assumption on my part.  Works perfectly now!
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