Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
javanesevn #1
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Subject: Create a hidden room in MUC
Dear all,

I would like to create room on which client user can not find it by Service Discovery or other searching method.
Thank you for your support.

Best regards,
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
ich your server supports this you should see a field for that in the room configuration.

The feature us:
  1. <feature var='muc_hidden'/>


Alex
Avatar
javanesevn #3
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Thank your quickly reply.

I am using Openfire 3.5.1. Here is my log out :

RECV:
    <iq xmlns="jabber:client" from="conference.shin" to="test@shin/MiniClient" type="result" id="agsXMPP_6">
           <query xmlns="http://jabber.org/protocol/disco#info">
                  <identity name="Public Chatrooms" category="conference" type="text" />
     <identity name="Public Chatroom Search" category="directory" type="chatroom" />
        <feature var="http://jabber.org/protocol/muc" />
                      <feature var="http://jabber.org/protocol/disco#info" />
                      <feature var="http://jabber.org/protocol/disco#items" />
                      <feature var="jabber:iq:search" />
                      <feature var="http://jabber.org/protocol/rsm" />
            </query>
     </iq>


It seems not support [muc_hidden] feature.

Thanks
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
please post the xml fo your configuration form.
This one is from ejabberd2.

  1. <iq from="..." type="result" to="...." id="ad59a" >
  2.     <query xmlns="http://jabber.org/protocol/muc#owner">
  3.         <instructions>You need an x:data capable client to configure room</instructions>
  4.         <x xmlns="jabber:x:data" type="form" >
  5.             <title>Configuration for alextest@conference.jabber.org</title>
  6.             <field type="hidden" var="FORM_TYPE" >
  7.                 <value>http://jabber.org/protocol/muc#roomconfig</value>
  8.             </field>
  9.             <field type="text-single" label="Room title" var="muc#roomconfig_roomname" >
  10.                 <value/>
  11.             </field>
  12.             <field type="boolean" label="Make room persistent" var="muc#roomconfig_persistentroom" >
  13.                 <value>0</value>
  14.             </field>
  15.             <field type="boolean" label="Make room public searchable" var="muc#roomconfig_publicroom" >
  16.                 <value>1</value>
  17.             </field>
  18.             <field type="boolean" label="Make participants list public" var="public_list" >
  19.                 <value>0</value>
  20.             </field>
  21.             <field type="boolean" label="Make room password protected" var="muc#roomconfig_passwordprotectedroom" >
  22.                 <value>0</value>
  23.             </field>
  24.             <field type="text-private" label="Password" var="muc#roomconfig_roomsecret" >
  25.                 <value/>
  26.             </field>
  27.             <field type="list-single" label="Maximum Number of Occupants" var="muc#roomconfig_maxusers" >
  28.                 <value>200</value>
  29.             <option label="5" >
  30.                 <value>5</value>
  31.             </option>
  32.             <option label="10" >
  33.                 <value>10</value>
  34.             </option>
  35.             <option label="20" >
  36.                 <value>20</value>
  37.             </option>
  38.             <option label="30" >
  39.                 <value>30</value>
  40.             </option>
  41.             <option label="50" >
  42.                 <value>50</value>
  43.             </option>
  44.             <option label="100" >
  45.                 <value>100</value>
  46.             </option>
  47.             <option label="200" >
  48.                 <value>200</value>
  49.             </option>
  50.             </field>
  51.             <field type="list-single" label="Present real JIDs to" var="muc#roomconfig_whois" >
  52.                 <value>moderators</value>
  53.                 <option label="moderators only" >
  54.                     <value>moderators</value>
  55.                 </option>
  56.                 <option label="anyone" >
  57.                     <value>anyone</value>
  58.                 </option>
  59.             </field>
  60.             <field type="boolean" label="Make room members-only" var="muc#roomconfig_membersonly" >
  61.                 <value>0</value>
  62.             </field>
  63.             <field type="boolean" label="Make room moderated" var="muc#roomconfig_moderatedroom" >
  64.                 <value>1</value>
  65.             </field>
  66.             <field type="boolean" label="Default users as participants" var="members_by_default" >
  67.                 <value>1</value>
  68.             </field>
  69.             <field type="boolean" label="Allow users to change subject" var="muc#roomconfig_changesubject" >
  70.                 <value>1</value>
  71.             </field>
  72.             <field type="boolean" label="Allow users to send private messages" var="allow_private_messages" >
  73.                 <value>1</value>
  74.             </field>
  75.             <field type="boolean" label="Allow users to query other users" var="allow_query_users" >
  76.                 <value>1</value>
  77.             </field>
  78.             <field type="boolean" label="Allow users to send invites" var="muc#roomconfig_allowinvites" >
  79.                 <value>0</value>
  80.             </field>
  81.             <field type="boolean" label="Enable logging" var="muc#roomconfig_enablelogging" >
  82.                 <value>0</value>
  83.             </field>
  84.         </x>
  85.     </query>
  86. </iq>

this is the field which makes the room public or private.
  1. <field type="boolean" label="Make room public searchable" var="muc#roomconfig_publicroom" >
  2.    <value>1</value>
  3. </field>
  4.  
  5. Alex
Avatar
javanesevn #5
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Hi Alex,

Here is my code snippet to create room:

       private void CreateChatRoom() {
            MucManager muc = new MucManager(xmppConnection);         

            string roomId = "hiddenroom@conference.shin";
            m_RoomJid    = new Jid(roomId);
            muc.CreateReservedRoom(m_RoomJid);

            OwnerIq oIq  = new agsXMPP.protocol.x.muc.iq.owner.OwnerIq(IqType.set, m_RoomJid);           
            Data data    =  new Data(XDataFormType.form);

            Field f_form = new Field(FieldType.Hidden);
            f_form.Var   = "http://jabber.org/protocol/muc#roomconfig";
            f_form.Value = "FORM_TYPE";

            Field f_hiddenRoom = new Field(FieldType.Boolean);
            f_hiddenRoom.Var   = "muc#roomconfig_publicroom";
            f_hiddenRoom.Value = "0";

            data.AddField(f_form);
            data.AddField(f_hiddenRoom);
            oIq.Query.AddChild(data);

            xmppConnection.Send(oIq);           
        }

Best regards,
This post was edited on 2008-10-31, 09:43 by javanesevn.
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I need the debug xml, not your  source code
Avatar
javanesevn #7
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Thanks for your support.
Here is my XML debug.

SEND: <iq id="agsXMPP_13" type="get" to="conference.xmpp01"><query xmlns="http://jabber.org/protocol/disco#items" /></iq>
RECV:
             <iq xmlns="jabber:client" from="conference.xmpp01" to="user1@xmpp01/home" type="result" id="agsXMPP_13">
                    <query xmlns="http://jabber.org/protocol/disco#items" />
             </iq>
SEND: <iq id="agsXMPP_14" type="get" to="M_200811041201@conference.xmpp01"><query xmlns="http://jabber.org/protocol/muc#owner" /></iq>
SEND: <presence to="M_200811041201@conference.xmpp01/user1"><x xmlns="http://jabber.org/protocol/muc" /></presence>
RECV:
             <iq xmlns="jabber:client" from="m_200811041201@conference.xmpp01" to="user1@xmpp01/home" type="error" id="agsXMPP_14">
                   <query xmlns="http://jabber.org/protocol/muc#owner" /><error code="401" type="auth"><not-authorized xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error>
             </iq>
SEND:
             <iq id="agsXMPP_15" type="set" to="M_200811041201@conference.xmpp01">
                    <query xmlns="http://jabber.org/protocol/muc#owner">
                            <x xmlns="jabber:x:data" type="submit">
                                  <field type="hidden" var="http://jabber.org/protocol/muc#roomconfig">FORM_TYPE</field>
                                  <field type="boolean" var="muc#roomconfig_publicroom">1</field>
                            </x>
                   </query>
             </iq>
RECV:
            <presence xmlns="jabber:client" from="m_200811041201@conference.xmpp01/user1" to="user1@xmpp01/home">
                      <x xmlns="http://jabber.org/protocol/muc#user">
                            <item role="moderator" affiliation="owner" jid="user1@xmpp01/home" /><status code="201" />
                      </x>
            </presence>
RECV:
            <message xmlns="jabber:client" from="m_200811041201@conference.xmpp01" to="user1@xmpp01/home" type="groupchat">
                        <body>This room is locked from entry until configuration is confirmed.</body>
            </message>
RECV:
            <message xmlns="jabber:client" from="m_200811041201@conference.xmpp01" to="user1@xmpp01/home" type="groupchat">
                        <body>This room is now unlocked.</body>
            </message>
RECV: <iq xmlns="jabber:client" from="m_200811041201@conference.xmpp01" to="user1@xmpp01/home" type="result" id="agsXMPP_15" />


  • And about  authentication:
  >> muc.CreateReservedRoom(m_RoomJid);
  >> muc.JoinRoom(m_RoomJid, myJid);

This room is created without password. But why do I still get error code="401" ..

Best regards,
Avatar
Alex #8
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you are creating a reserved room which means you accept the default configuration.
Thats wrong in your case. You have to create a room and configure it. So use JoinRoom instead of CreateReservedRoom.

Alex
Avatar
javanesevn #9
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Thank you, Alex

I created hidden room from RequestConfigurationForm(...) but I can not set room subject in the same time.
I must sent to server a new subject message later.

Best
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