xmpp - How can I tell the difference between the JID of a user and a JID of MUC? -


suppose have 2 jids:

  • jid 1: bob@example.com
  • jid 2 room@chat.example.com

jid 2 refers chat server, chat server isn't going have word chat or conference in it.

is there way, using smack libraries, tell 1 which?

you cannot tell looking @ jid. have keep enough context in given protocol exchange know talking to.

typically on startup, client send disco#items query server:

<iq type='get'     to='shakespeare.lit'     id='items1'>   <query xmlns='http://jabber.org/protocol/disco#items'/> </iq> 

to find of local services, send disco#info query each of services find out more service. once find muc server:

<iq from='chat.shakespeare.lit'     type='result'>   <query xmlns='http://jabber.org/protocol/disco#info'>     <identity         category='conference'         name='shakespearean chat service'         type='text'/>     <feature var='http://jabber.org/protocol/muc'/>   </query> </iq> 

you know of jids include domain name (chat.shakespeare.lit in above example) associated muc rooms.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -