public async Task <Iq> SubmitRoomConfigurationAsync(Jid room, Data xdata)
        {
            var iq = new OwnerIq {
                Type = IqType.Set, To = room, OwnerQuery = { XData = xdata }
            };

            return(await XmppClient.SendIqAsync(iq));
        }
        public async Task <Iq> RequestRoomConfigurationAsync(Jid room)
        {
            var iq = new OwnerIq {
                Type = IqType.Get, To = room
            };

            return(await XmppClient.SendIqAsync(iq));
        }
        /// <summary>
        /// Request the configuration form of a chatroom.
        /// You can request the from when creating a new room. or at any time later if you want to change the room configuration.
        /// Only room owners can request this from. Otherwise the service must return a 403 forbidden error
        /// </summary>
        /// <param name="room">
        /// </param>
        /// <param name="cb">
        /// </param>
        /// <param name="cbArgs">
        /// </param>
        public void RequestConfigurationForm(Jid room, IqCB cb, object cbArgs)
        {
            OwnerIq oIq = new OwnerIq(IqType.get, room);

            m_connection.IqGrabber.SendIq(oIq, cb, cbArgs);
        }
        /// <summary>
        /// create an "instant room". This means you accept the default configuration and dont want to configure the room.
        /// </summary>
        /// <param name="room">
        /// </param>
        /// <param name="cb">
        /// </param>
        /// <param name="cbArgs">
        /// </param>
        public void AcceptDefaultConfiguration(Jid room, IqCB cb, object cbArgs)
        {
            OwnerIq oIq = new OwnerIq(IqType.set, room);
            oIq.Query.AddChild(new Data(XDataFormType.submit));

            if (cb == null)
            {
                m_connection.Send(oIq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(oIq, cb, cbArgs);
            }
        }
        /// <summary>
        /// </summary>
        /// <param name="room">
        /// </param>
        /// <param name="altVenue">
        /// </param>
        /// <param name="reason">
        /// </param>
        /// <param name="cb">
        /// </param>
        /// <param name="cbArg">
        /// </param>
        public void DestroyRoom(Jid room, Jid altVenue, string reason, IqCB cb, object cbArg)
        {
            /*
             Example 177. Owner Submits Room Destruction Request

            <iq from='[email protected]/desktop'
                id='begone'
                to='*****@*****.**'
                type='set'>
              <query xmlns='http://jabber.org/protocol/muc#owner'>
                <destroy jid='*****@*****.**'>
                  <reason>Macbeth doth come.</reason>
                </destroy>
              </query>
            </iq>
            */
            OwnerIq iq = new OwnerIq();
            iq.Type = IqType.set;
            iq.To = room;

            Destroy destroy = new Destroy();

            if (reason != null)
            {
                destroy.Reason = reason;
            }

            if (altVenue != null)
            {
                destroy.AlternateVenue = altVenue;
            }

            iq.Query.AddChild(destroy);

            if (cb == null)
            {
                m_connection.Send(iq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(iq, cb, cbArg);
            }
        }
        /// <summary>
        /// <para>
        /// Creates a reserved room. The MUC server replies to this request either with an error if the room already exists 
        /// or another error occured. Or with the configuration for, for the reserved room which you have submit in the
        /// second step.
        /// </para>
        /// </summary>
        /// <param name="room">
        /// Jid of the room to create
        /// </param>
        /// <param name="cb">
        /// callback for the response
        /// </param>
        /// <param name="cbArg">
        /// optional callback arguments
        /// </param>
        public void CreateReservedRoom(Jid room, IqCB cb, object cbArg)
        {
            /*
            <iq from='[email protected]/desktop'
                id='create1'
                to='*****@*****.**'
                type='get'>
                <query xmlns='http://jabber.org/protocol/muc#owner'/>
            </iq>
            */
            OwnerIq iq = new OwnerIq();
            iq.Type = IqType.get;
            iq.To = room;

            if (cb == null)
            {
                m_connection.Send(iq);
            }
            else
            {
                m_connection.IqGrabber.SendIq(iq, cb, cbArg);
            }
        }