예제 #1
0
        /// <summary>
        /// Invite multiple contacts to a chatroom
        /// </summary>
        /// <param name="jids"></param>
        /// <param name="room"></param>
        /// <param name="reason"></param>
        public void Invite(Jid[] jids, Jid room, string reason)
        {
            Message msg = new Message();
            msg.To = room;

            User user = new User();
            foreach (Jid jid in jids)
            {
                if (reason != null)
                    user.AddChild(new Invite(jid, reason));
                else
                    user.AddChild(new Invite(jid));
            }

            msg.AddChild(user);

            m_connection.Send(msg);
        }
예제 #2
0
        /// <summary>
        /// Decline a groupchat invitation
        /// </summary>
        /// <param name="to">the jid which invited us</param>
        /// <param name="room">to room to which we send the decline (this is normally the same room we were invited to)</param>
        /// <param name="reason">reason why we decline the invitation</param>
        public void Decline(Jid to, Jid room, string reason)
        {
            Message msg = new Message();
            msg.To = room;

            User user = new User();
            if (reason != null)
                user.Decline = new Decline(to, reason);
            else
                user.Decline = new Decline(to);

            msg.AddChild(user);

            m_connection.Send(msg);
        }