Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
akchase47 #1
Member since Jul 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: Group Chat
Hello all,

I am currently working on an xmpp server and everything is going quite well.

One questions I have though is what is the best way in code to determine that a presence from a client is the first initial group chat presence.

So how do I check this:

<presence xmlns="jabber:client" to="groupchat@chat.example.com/user1"><x xmlns="http://jabber.org/protocol/muc" /></presence>

To see if it contains the <x/> element with a namespace of MUC?

I am thinking that there must be some nice easy way like working with IQs and Query elements within those but haven't been able to find it yet.

Thanks,

Chase
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I would check the to Jid. Group chat presence are always sent to a group chat service.

Alex
Avatar
akchase47 #3
Member since Jul 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
Well, right now I am testing it internally, and I am using either Digsby or Pandion as clients to test with.

The way I set up the clients is pointing directly to an IP address instead of a domain name.

The problem with that is even if the group chat presence is sent to "chat.example.com" that presence still comes in over the stream attached to the main service at "example.com". Should I just check that every presence received on "example.com" is actually to "chat.example.com" and forward it to the group chat service.

Right now I was going to put the main service and the group chat service at the same place, is that bad to do?
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes of course all packets are coming over the same connection. But normally you check the to attribute, namespaces and other stuff to forward to packets to the internal classes, module or plugins for further processing.

Alex
Avatar
akchase47 #5
Member since Jul 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
I got confused about it "going to a group chat service", made it sound like the information should have gone somewhere else to be processed. I was planning to do it exactly how you have said here, thanks for helping me out.

Thanks,

Chase
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
in XMPP the group chat service could run also in a separate process connected over the xmpp component protocol to your server. I this case you would have to forward the packet to this process.
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