Beispiel #1
0
        public void ModifyList(Jid room, agsXMPP.protocol.x.muc.iq.admin.Item[] items, IqCB cb, object cbArg)
        {
            AdminIq aIq = new AdminIq();
            aIq.To = room;
            aIq.Type = IqType.set;

            foreach (agsXMPP.protocol.x.muc.iq.admin.Item itm in items)
            {
                aIq.Query.AddItem(itm);
            }

            if (cb == null)
                m_connection.Send(aIq);
            else
                m_connection.IqGrabber.SendIq(aIq, cb, cbArg);
        }
Beispiel #2
0
        private void ChangeAffiliation(Affiliation affiliation, Jid room, Jid user, string nickname, string reason, IqCB cb, object cbArg)
        {
            var aIq = new AdminIq();
            aIq.To = room;
            aIq.Type = IqType.set;

            agsXMPP.protocol.x.muc.iq.admin.Item itm = new agsXMPP.protocol.x.muc.iq.admin.Item();
            itm.Affiliation = affiliation;

            if (user != null)
                itm.Jid = user;

            if (nickname != null)
                itm.Nickname = nickname;

            if (reason != null)
                itm.Reason = reason;

            aIq.Query.AddItem(itm);

            if (cb == null)
                m_connection.Send(aIq);
            else
                m_connection.IqGrabber.SendIq(aIq, cb, cbArg);
        }
Beispiel #3
0
        private void ChangeRole(Role role, Jid room, string nickname, string reason, IqCB cb, object cbArg)
        {
            AdminIq aIq = new AdminIq();
            aIq.To = room;
            aIq.Type = IqType.set;

            agsXMPP.protocol.x.muc.iq.admin.Item itm = new agsXMPP.protocol.x.muc.iq.admin.Item();
            itm.Role = role;
            itm.Nickname = nickname;

            if (reason != null)
                itm.Reason = reason;

            aIq.Query.AddItem(itm);

            if (cb == null)
                m_connection.Send(aIq);
            else
                m_connection.IqGrabber.SendIq(aIq, cb, cbArg);
        }
Beispiel #4
0
        public void RequestList(Role role, Jid room, IqCB cb, object cbArg)
        {
            AdminIq aIq = new AdminIq();
            aIq.To = room;
            aIq.Type = IqType.get;

            aIq.Query.AddItem(new agsXMPP.protocol.x.muc.iq.admin.Item(role));

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