Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
huanghucheng #1
Member since Sep 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: problem about creating a persistent mucroom
hello,Alex!!!
I want you help,this is my code:
            string name = this.roomName.Text;
            string descri = this.descri.Text;
            Jid jid = new Jid(name + "@conference.127.0.0.1");
            MucManager muc = new MucManager(this.mainForm.XmppCon);
          
            muc.CreateReservedRoom(jid);// This is working well without user-defined configuration.
           
            muc.GrantOwnershipPrivileges(jid, this.mainForm.XmppCon.MyJID);

            muc.JoinRoom(jid, this.mainForm.mySelf.UserName);
           
            muc.RequestConfigurationForm(jid, new IqCB(OnRequestConfiguration));

        public void  OnRequestConfiguration(object sender, IQ iq, object obj)
        {
            agsXMPP.protocol.x.muc.iq.owner.OwnerIq oIq = new agsXMPP.protocol.x.muc.iq.owner.OwnerIq();
            oIq.Type = IqType.set;
            oIq.To = iq.From;

            agsXMPP.protocol.x.data.Data data = new agsXMPP.protocol.x.data.Data(XDataFormType.form);

            Field f_persistent = new Field(FieldType.Boolean);
            f_persistent.Var = "muc#roomconfig_persistentroom";
            f_persistent.Value = "1";


            Field f_public = new Field(FieldType.Boolean);
            f_public.Var = "muc#roomconfig_publicroom";
            f_public.Value = "1";

            data.AddChild(f_persistent);
            data.AddChild(f_public);

            oIq.Query.AddChild(data);
            this.mainForm.XmppCon.IqGrabber.SendIq(oIq, new IqCB(OnGetFieldsResult), null);

        }
     
        public void OnGetFieldsResult(object sender, IQ iq, object data)
        {
           //
        }
   I debug it when it is over the type of the iq is 'result',but the database doesnot have the information the mucroom i create.
I use wildfire and sql2000.
sorry about my bad english!
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please post your Xml log.

Alex
Avatar
huanghucheng #3
Member since Sep 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: this is my xml
SEND: <iq id="agsXMPP_8" type="get" to="room1@conference.127.0.0.1"><query xmlns="http://jabber.org/protocol/muc#owner" /></iq>
SEND: <iq id="agsXMPP_9" to="room1@conference.127.0.0.1" type="set"><query xmlns="http://jabber.org/protocol/muc#admin"><item affiliation="owner" jid="aaa@127.0.0.1/MiniClient" /></query></iq>
SEND: <presence to="room1@conference.127.0.0.1/me"><x xmlns="http://jabber.org/protocol/muc" /></presence>
SEND: <iq id="agsXMPP_10" type="get" to="room1@conference.127.0.0.1"><query xmlns="http://jabber.org/protocol/muc#owner" /></iq>
RECV: <presence xmlns="jabber:client" from="room1@conference.127.0.0.1/me" to="aaa@127.0.0.1/MiniClient"><x xmlns="http://jabber.org/protocol/muc#user"><item role="moderator" affiliation="owner" jid="aaa@127.0.0.1/MiniClient" /><status code="201" /></x></presence>
RECV: <message xmlns="jabber:client" from="room1@conference.127.0.0.1" to="aaa@127.0.0.1/MiniClient" type="groupchat"><body>This room is locked from entry until configuration is confirmed.</body></message>
RECV: <iq xmlns="jabber:client" from="room1@conference.127.0.0.1" to="aaa@127.0.0.1/MiniClient" type="result" id="agsXMPP_10"><query xmlns="http://jabber.org/protocol/muc#owner"><x xmlns="jabber:x:data" type="form"><title>Room configuration</title><instructions>The room "room1" has been created. To accept the default configuration, click the "OK" button. Or, modify the settings by completing the following form:</instructions><field type="hidden" var="FORM_TYPE"><value>http://jabber.org/protocol/muc#roomconfig</value></field><field label="Room Name" var="muc#roomconfig_roomname" type="text-single"><value>room1</value></field><field label="Description" var="muc#roomconfig_roomdesc" type="text-single"><value>room1</value></field><field label="Allow Occupants to Change Subject" var="muc#roomconfig_changesubject" type="boolean"><value>0</value></field><field label="Maximum Room Occupants" var="muc#roomconfig_maxusers" type="list-single"><value>30</value><option label="10"><value>10</value></option><option label="20"><value>20</value></option><option label="30"><value>30</value></option><option label="40"><value>40</value></option><option label="50"><value>50</value></option><option label="None"><value>0</value></option></field><field label="Roles for Which Presence is Broadcast" var="muc#roomconfig_presencebroadcast" type="list-multi"><value>moderator</value><value>participant</value><value>visitor</value><option label="Moderator"><value>moderator</value></option><option label="Participant"><value>participant</value></option><option label="Visitor"><value>visitor</value></option></field><field label="List Room in Directory" var="muc#roomconfig_publicroom" type="boolean"><value>1</value></field><field label="Room is Persistent" var="muc#roomconfig_persistentroom" type="boolean"><value>0</value></field><field label="Room is Moderated" var="muc#roomconfig_moderatedroom" type="boolean"><value>0</value></field><field label="Room is Members-only" var="muc#roomconfig_membersonly" type="boolean"><value>0</value></field><field type="fixed"><value>Note: by default, only admins can send invitations in an members-only room.</value></field><field label="Allow Occupants to Invite Others" var="muc#roomconfig_allowinvites" type="boolean"><value>0</value></field><field label="Password Required to Enter Room" var="muc#roomconfig_passwordprotectedroom" type="boolean"><value>0</value></field><field type="fixed"><value>If a password is required to enter this room, you must specify the password below.</value></field><field label="Password" var="muc#roomconfig_roomsecret" type="text-private"><value /></field><field label="Role that May Discover Real JIDs of Occupants" var="muc#roomconfig_whois" type="list-single"><value>moderators</value><option label="Moderator"><value>moderators</value></option><option label="Anyone"><value>anyone</value></option></field><field label="Log Room Conversations" var="muc#roomconfig_enablelogging" type="boolean"><value>0</value></field><field label="Only login with registered nickname" var="x-muc#roomconfig_reservednick" type="boolean"><value>0</value></field><field label="Allow Occupants to change nicknames" var="x-muc#roomconfig_canchangenick" type="boolean"><value>1</value></field><field label="Allow Users to register with the room" var="x-muc#roomconfig_registration" type="boolean"><value>1</value></field><field type="fixed"><value>You may specify administrators of this room. Please provide one JID per line.</value></field><field label="Room Admins" var="muc#roomconfig_roomadmins" type="jid-multi" /><field type="fixed"><value>You may specify additional owners for this room. Please provide one JID per line.</value></field><field label="Room Owners" var="muc#roomconfig_roomowners" type="jid-multi"><value>aaa@127.0.0.1</value></field></x></query></iq>
SEND: <iq id="agsXMPP_11" type="set" to="room1@conference.127.0.0.1"><query xmlns="http://jabber.org/protocol/muc#owner"><x xmlns="jabber:x:data" type="form"><field type="boolean" var="muc#roomconfig_persistentroom">1</field><field type="boolean" var="muc#roomconfig_publicroom">1</field></x></query></iq>
RECV: <iq xmlns="jabber:client" from="room1@conference.127.0.0.1" to="aaa@127.0.0.1/MiniClient" type="result" id="agsXMPP_11" />

I want to create a room that can persistent in the database,but...,i need your help
This post was edited on 2013-03-17, 14:57 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you form must be of type submit, and you must submit all form fields, not only the muc#roomconfig_persistentroom field.

Alex
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