예제 #1
0
        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;

            owner.Destroy destroy = new owner.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);
        }
예제 #2
0
        /// <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 agsXMPP.protocol.x.muc.iq.owner.OwnerIq(IqType.get, room);

            m_connection.IqGrabber.SendIq(oIq, cb, cbArgs);
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
        /// <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 agsXMPP.protocol.x.muc.iq.owner.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);
        }