Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Storys #1
Member since Aug 2009 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: Configuration group error
SEND:
<presence to="1@conference.61.139.93.81/a">
  <x xmlns="http://jabber.org/protocol/muc" />
</presence>
SEND:
<iq id="agsXMPP_10" type="get" to="1@conference.61.139.93.81">
  <query xmlns="http://jabber.org/protocol/muc#owner" />
</iq>
RECV:
<presence xmlns="jabber:client" from="1@conference.61.139.93.81/a" to="yangjingbo@61.139.93.81/34484496341253260959797002" xml:lang="en">
  <x xmlns="http://jabber.org/protocol/muc#user">
    <item role="moderator" affiliation="owner" jid="yangjingbo@61.139.93.81/34484496341253260959797002" />
    <status code="201" />
  </x>
</presence>
RECV:
<iq xmlns="jabber:client" from="1@conference.61.139.93.81" to="yangjingbo@61.139.93.81/34484496341253260959797002" type="result" id="agsXMPP_10">
  <query xmlns="http://jabber.org/protocol/muc#owner">
    <instructions>You need an x:data capable client to configure room</instructions>
    <x xmlns="jabber:x:data" type="form">
      <title>Configuration for 1@conference.61.139.93.81</title>
      <field type="hidden" var="FORM_TYPE">
        <value>http://jabber.org/protocol/muc#roomconfig</value>
      </field>
      <field label="Room title" type="text-single" var="muc#roomconfig_roomname">
        <value />
      </field>
      <field label="Make room persistent" type="boolean" var="muc#roomconfig_persistentroom">
        <value>0</value>
      </field>
      <field label="Make room public searchable" type="boolean" var="muc#roomconfig_publicroom">
        <value>1</value>
      </field>
      <field label="Make participants list public" type="boolean" var="public_list">
        <value>1</value>
      </field>
      <field label="Make room password protected" type="boolean" var="muc#roomconfig_passwordprotectedroom">
        <value>0</value>
      </field>
      <field label="Password" type="text-private" var="muc#roomconfig_roomsecret">
        <value />
      </field>
      <field label="Maximum Number of Occupants" type="list-single" var="muc#roomconfig_maxusers">
        <value>200</value>
        <option label="5">
          <value>5</value>
        </option>
        <option label="10">
          <value>10</value>
        </option>
        <option label="20">
          <value>20</value>
        </option>
        <option label="30">
          <value>30</value>
        </option>
        <option label="50">
          <value>50</value>
        </option>
        <option label="100">
          <value>100</value>
        </option>
        <option label="200">
          <value>200</value>
        </option>
      </field>
      <field label="Present real JIDs to" type="list-single" var="muc#roomconfig_whois">
        <value>moderators</value>
        <option label="moderators only">
          <value>moderators</value>
        </option>
        <option label="anyone">
          <value>anyone</value>
        </option>
      </field>
      <field label="Make room members-only" type="boolean" var="muc#roomconfig_membersonly">
        <value>0</value>
      </field>
      <field label="Make room moderated" type="boolean" var="muc#roomconfig_moderatedroom">
        <value>1</value>
      </field>
      <field label="Default users as participants" type="boolean" var="members_by_default">
        <value>1</value>
      </field>
      <field label="Allow users to change subject" type="boolean" var="muc#roomconfig_changesubject">
        <value>1</value>
      </field>
      <field label="Allow users to send private messages" type="boolean" var="allow_private_messages">
        <value>1</value>
      </field>
      <field label="Allow users to query other users" type="boolean" var="allow_query_users">
        <value>1</value>
      </field>
      <field label="Allow users to send invites" type="boolean" var="muc#roomconfig_allowinvites">
        <value>0</value>
      </field>
      <field label="Allow visitors to send status text in presence updates" type="boolean" var="muc#roomconfig_allowvisitorstatus">
        <value>1</value>
      </field>
      <field label="Allow visitors to change nickname" type="boolean" var="muc#roomconfig_allowvisitornickchange">
        <value>1</value>
      </field>
    </x>
  </query>
</iq>
SEND:
<iq id="agsXMPP_11" type="set" to="1@conference.61.139.93.81" from="yangjingbo@61.139.93.81/34484496341253260959797002">
  <query xmlns="http://jabber.org/protocol/muc#owner">
    <x xmlns="jabber:x:data" type="submit">
      <field var="FORM_TYPE">
        <Value>http://jabber.org/protocol/muc#roomconfig</Value>
      </field>
      <field var="muc#roomconfig_roomname">
        <value>A Dark Cave</value>
      </field>
      <field var="muc#roomconfig_roomdesc">
        <value>The place for all good witches!</value>
      </field>
      <field var="muc#roomconfig_enablelogging">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_changesubject">
        <value>1</value>
      </field>
      <field var="muc#roomconfig_allowinvites">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_maxusers">
        <value>10</value>
      </field>
      <field var="muc#roomconfig_publicroom">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_persistentroom">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_moderatedroom">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_membersonly">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_passwordprotectedroom">
        <value>1</value>
      </field>
      <field var="muc#roomconfig_roomsecret">
        <value>cauldronburn</value>
      </field>
      <field var="muc#roomconfig_whois">
        <value>moderators</value>
      </field>
      <field var="muc#roomconfig_roomadmins">
        <value>storys@61.139.93.81</value>
      </field>
    </x>
  </query>
</iq>
RECV:
<iq xmlns="jabber:client" from="1@conference.61.139.93.81" to="yangjingbo@61.139.93.81/34484496341253260959797002" type="error" id="agsXMPP_11">
  <query xmlns="http://jabber.org/protocol/muc#owner">
    <x xmlns="jabber:x:data" type="submit">
      <field var="FORM_TYPE">
        <Value>http://jabber.org/protocol/muc#roomconfig</Value>
      </field>
      <field var="muc#roomconfig_roomname">
        <value>A Dark Cave</value>
      </field>
      <field var="muc#roomconfig_roomdesc">
        <value>The place for all good witches!</value>
      </field>
      <field var="muc#roomconfig_enablelogging">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_changesubject">
        <value>1</value>
      </field>
      <field var="muc#roomconfig_allowinvites">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_maxusers">
        <value>10</value>
      </field>
      <field var="muc#roomconfig_publicroom">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_persistentroom">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_moderatedroom">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_membersonly">
        <value>0</value>
      </field>
      <field var="muc#roomconfig_passwordprotectedroom">
        <value>1</value>
      </field>
      <field var="muc#roomconfig_roomsecret">
        <value>cauldronburn</value>
      </field>
      <field var="muc#roomconfig_whois">
        <value>moderators</value>
      </field>
      <field var="muc#roomconfig_roomadmins">
        <value>storys@61.139.93.81</value>
      </field>
    </x>
  </query>
 
<error code="400" type="modify">
    <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  </error>

</iq>
This post was edited on 2009-09-18, 10:16 by Storys.
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
can you try to wait for the room presence first before you request the configuration form. This could be a race condition, other than that I found no issues. If this is not the problem I will take a closer look.
Which server software are you using?

Alex
Avatar
Storys #3
Member since Aug 2009 · 7 posts
Group memberships: Members
Show profile · Link to this post
I am using the "ejabberd" Server

I just want to change the configuration of chat rooms

My Code

  1.            Jid roomJid = new Jid("testRoom@conference.61.139.93.81");
  2.             MucManager muc = new MucManager(XmppCon);
  3.             muc.JoinRoom(roomJid, "myName");
  4.  
  5.  
  6.             muc.RequestConfigurationForm(roomJid, new IqCB(OnRequestConfiguratio));
  7.         }
  8.         private void OnRequestConfiguratio(object sender, IQ iq, object data)
  9.         {
  10.             if (iq.Type == IqType.result)
  11.             {
  12.                 agsXMPP.protocol.x.muc.iq.owner.OwnerIq oIq = new agsXMPP.protocol.x.muc.iq.owner.OwnerIq();
  13.                 oIq.Type = IqType.set;
  14.                 oIq.To = iq.From;
  15.  
  16.                 agsXMPP.protocol.x.data.Data xForm = new Data();
  17.                 xForm.Type = XDataFormType.submit;
  18.                 /*
  19.                      add more code here to fill out all fields in the form.
  20.                  */
  21.                 oIq.Query.AddChild(xForm);
  22.  
  23.                 XmppCon.IqGrabber.SendIq(oIq, new IqCB(OnRoomConfigResult));
  24.             }
  25.         }
  26.  
  27.         private void OnRoomConfigResult(object sender, IQ iq, object data)
  28.         {
  29.      Here is the error message returned
  30.         }
This post was edited 2 times, last on 2013-05-17, 08:29 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  1. <field var="FORM_TYPE">
  2.         <Value>http://jabber.org/protocol/muc#roomconfig</Value>
  3. </field>

here is a problem. Value is captital, but must be all lower case.
Avatar
Storys #5
Member since Aug 2009 · 7 posts
Group memberships: Members
Show profile · Link to this post
Issue is resolved, send the following configuration will return an error.

<field var="muc#roomconfig_roomdesc">
         <value> The place for all good witches! </ value>
       </ field>

<field var="muc#roomconfig_enablelogging">
         <value> 0 </ value>
       </ field>

<field var="muc#roomconfig_roomadmins">
         <value> storys@61.139.93.81 </ value>
       </ field>

But it's unclear what is cause.

Thanks
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
please post the complete xml of the request including the reply.
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