Exemple #1
0
        /// <summary>
        /// Sends a UpdateBanListMessage which updates the ban list for the given room.
        /// </summary>
        /// <param name="roomJid">The bare JID if the room you would like to update the ban list for. e.g. '*****@*****.**'</param>
        /// <param name="changedUsers"></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 UpdateBanListMessage answers.</returns>
        public MessageResponseHelper <IQMessage> updateBanList(string roomJid, List <BanedUser> changedUsers, MessageResponseHelper <IQMessage> .OnMessageHandler onMessage, MessageResponseHelper <IQMessage> .OnTimeoutHandler onTimeout)
        {
            MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CONNECTION, onMessage, onTimeout);
            UpdateBanListMessage msg = new UpdateBanListMessage(CONNECTION.account.getFullJid(), roomJid, changedUsers);

            helper.start(msg);
            return(helper);
        }
        /// <summary>
        /// Sends a UpdateBanListMessage which updates the ban list for the given room.
        /// </summary>
        /// <param name="roomJid">The bare JID if the room you would like to update the ban list for. e.g. '*****@*****.**'</param>
        /// <param name="changedUsers"></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 UpdateBanListMessage answers.</returns>
        public MessageResponseHelper <IQMessage> updateBanList(string roomJid, List <BanedUser> changedUsers, Func <IQMessage, bool> onMessage, Action onTimeout)
        {
            MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CLIENT, onMessage, onTimeout);
            UpdateBanListMessage msg = new UpdateBanListMessage(CLIENT.getXMPPAccount().getIdDomainAndResource(), roomJid, changedUsers);

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