예제 #1
0
        /// <summary>
        /// Sends a KickOccupantMessage to kick the given occupant from the given room.
        /// </summary>
        /// <param name="roomJid">The bare JID if the room you would like to kick the user for. e.g. '*****@*****.**'</param>
        /// <param name="nickname">The occupants nickname that should get kicked.</param>
        /// <param name="reason">An optional reason why the occupant should get kicked.</param>
        /// <param name="onMessage">The method that should get executed once the helper receives a new valid message.</param>
        /// <param name="onTimeout">The method that should get executed once the helper timeout gets triggered.</param>
        /// <returns>Returns a MessageResponseHelper listening for KickOccupantMessage answers.</returns>
        public MessageResponseHelper <IQMessage> kickOccupant(string roomJid, string nickname, string reason, MessageResponseHelper <IQMessage> .OnMessageHandler onMessage, MessageResponseHelper <IQMessage> .OnTimeoutHandler onTimeout)
        {
            MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CONNECTION, onMessage, onTimeout);
            KickOccupantMessage msg = new KickOccupantMessage(CONNECTION.account.getFullJid(), roomJid, nickname, reason);

            helper.start(msg);
            return(helper);
        }
예제 #2
0
        /// <summary>
        /// Sends a KickOccupantMessage to kick the given occupant from the given room.
        /// </summary>
        /// <param name="roomJid">The bare JID if the room you would like to kick the user for. e.g. '*****@*****.**'</param>
        /// <param name="nickname">The occupants nickname that should get kicked.</param>
        /// <param name="reason">An optional reason why the occupant should get kicked.</param>
        /// <param name="onMessage">The method that should get executed once the helper receives a new valid message.</param>
        /// <param name="onTimeout">The method that should get executed once the helper timeout gets triggered.</param>
        /// <returns>Returns a MessageResponseHelper listening for KickOccupantMessage answers.</returns>
        public MessageResponseHelper <IQMessage> kickOccupant(string roomJid, string nickname, string reason, Func <IQMessage, bool> onMessage, Action onTimeout)
        {
            MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CLIENT, onMessage, onTimeout);
            KickOccupantMessage msg = new KickOccupantMessage(CLIENT.getXMPPAccount().getIdDomainAndResource(), roomJid, nickname, reason);

            helper.start(msg);
            return(helper);
        }