示例#1
0
        private IQ muc_OnRoomConfig(Room room, IQ parent)
        {
            muzzle.XDataForm form = new muzzle.XDataForm(parent);
            if (form.ShowDialog() != DialogResult.OK)
                return null;

            return (IQ)form.GetResponse();
        }
        /// <summary>
        /// Joins a conference room.
        /// </summary>
        /// <param name="roomAndNick">room@conference/nick, where "nick" is the desred nickname in the room.</param>
        /// <returns>
        /// If already joined, the existing room will be returned.
        /// If not, a Room object will be returned in the joining state.
        /// </returns>
        public Room GetRoom(JID roomAndNick)
        {
            if (roomAndNick == null)
                throw new ArgumentNullException("roomAndNick");

            if (roomAndNick.Resource == null)
                roomAndNick.Resource = DefaultNick;

            Room r = (Room)m_rooms[roomAndNick];
            if (r != null)
                return r;

            // If no resource specified, pick up the user's name from their JID
            if (roomAndNick.Resource == null)
                roomAndNick.Resource = m_stream.JID.User;

            r = new Room(this, roomAndNick);
            r.OnJoin += OnJoin;
            r.OnLeave += OnLeave;
            r.OnPresenceError += OnPresenceError;
            r.OnRoomConfig += OnRoomConfig;
            r.OnRoomMessage += OnRoomMessage;
            r.OnPrivateMessage += OnPrivateMessage;
            r.OnAdminMessage += OnAdminMessage;
            r.OnSelfMessage += OnSelfMessage;
            r.OnSubjectChange += OnSubjectChange;
            r.OnParticipantJoin += OnParticipantJoin;
            r.OnParticipantLeave += OnParticipantLeave;
            r.OnParticipantPresenceChange += OnParticipantPresenceChange;

            m_rooms[roomAndNick] = r;
            return r;
        }
示例#3
0
 private void muc_OnPresenceError(Room room, Presence pres)
 {
     m_err = true;
     pnlCon.Text = "Groupchat error: " + pres.Error.OuterXml;
 }