Not logged in. · Lost password · Register
Forum: agsXMPP RSS
gab #1
Member since Jul 2007 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: how to access children of roster control
i need to broadcast msg to all contacts under a group in the roster control.

this is my code:

        Dim childrenSize As Integer

        childrenSize = rn.GetNodeCount(True)

        For i = 1 To childrenSize
            con.MesagageGrabber.Add(New Jid(selectedRosterNode.NextVisibleNode.Text), New BareJidComparer, AddressOf MessageCallback, Nothing)
            Dim viq As VcardIq = New VcardIq(IqType.get, New Jid(selectedRosterNode.NextVisibleNode.Text))
            _connection.IqGrabber.SendIq(viq, AddressOf VcardResult, Nothing)

the problem is that the text field of the child under selectedRosterNode (which is "NextVisibleNode") cannot be used as the Jid for MessageGrabber because it could be simply things like nicknames and not proper jabber id.

how can i make this TreeNode (NextVisibleNode) to a (Roster Node)??

Thanks for any advice
Alex #2
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post

the RosterControl is derived from the Treeview and all Nodes are of type RosterNode and derived from Treenode.
So you can cast them to RosterNode.

Take a look at the RosterNodeType Enum. This enum tells you the type of the node. Depending on the type of the node you can use the Properties RosterItem or Presence to get more information about the node.

The UI controls are under the MIT licence like all the examples. They should help you to build your own controls, or give an idea how to get start building you own controls.

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