Not logged in. · Lost password · Register
Forum: agsXMPP RSS
How to get the configuration form for MUC / How to handle its result
Avatar
Nandy #1
Member since May 2009 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: MUC Configuration Problem
Hello,

I would like to create a new room and its configuration. The following code works well without configuration:

MucManager muc = new MucManager(this.XmppCon);
muc.GrantOwnershipPrivileges(Room, this.XmppCon.MyJID);
muc.CreateReservedRoom(Room);

But When I tried to do as the following:

private void CreateNewRoom(Jid Room, string Nickname)
{


           MucManager muc = new MucManager(this.XmppCon);
                muc.GrantOwnershipPrivileges(Room, this.XmppCon.MyJID);
                muc.CreateReservedRoom(Room);// This is working well without user-defined configuration.

                OwnerIq oIq = new agsXMPP.protocol.x.muc.iq.owner.OwnerIq(IqType.set, Room);
                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_title = new Field(FieldType.Text_Single);
                f_hiddenRoom.Var = "muc#roomconfig_roomname";
                f_hiddenRoom.Value = "";

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

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

        Field f_private = new Field(FieldType.Boolean);
                f_public.Var = "muc#roomconfig_passwordprotectedroom";
                f_public.Value = "0";

                Field f_password = new Field(FieldType.Text_Private);
                f_public.Var = "muc#roomconfig_roomsecret";
               
               
                data.AddField(f_form);
                data.AddField(f_title);
                data.AddChild(f_persistent);
                data.AddChild(f_public);
                data.AddChild(f_private);
                data.AddChild(f_password);

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

}

I have no idea how I should set(request) the configuration form and how to get(catch) its results.
Is there any value that I should change with that : f_form.Var = "http://jabber.org/protocol/muc#roomconfig";???
I used Openfire Server, and host is "mtalk.net.mm". For group chat service, I use "conference.mtalk.net.mm"


Thanks and Best regards,
AM.Nandy
Regards,

AM.Nandy
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Your order is wrong. You have to create the room first before you can execute actions like GrantOwnership.

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