/// <summary> /// Sends a BanOccupantMessage to ban the given occupant from the given room. /// </summary> /// <param name="roomJid">The bare JID if the room you would like to ban the user for. e.g. '*****@*****.**'</param> /// <param name="jid">The bare JID of the occupant you want to ban. e.g. '*****@*****.**'</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 BanOccupantMessage answers.</returns> public MessageResponseHelper <IQMessage> banOccupant(string roomJid, string jid, string reason, MessageResponseHelper <IQMessage> .OnMessageHandler onMessage, MessageResponseHelper <IQMessage> .OnTimeoutHandler onTimeout) { MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CONNECTION, onMessage, onTimeout); BanOccupantMessage msg = new BanOccupantMessage(CONNECTION.account.getFullJid(), roomJid, jid, reason); helper.start(msg); return(helper); }
/// <summary> /// Sends a BanOccupantMessage to ban the given occupant from the given room. /// </summary> /// <param name="roomJid">The bare JID if the room you would like to ban the user for. e.g. '*****@*****.**'</param> /// <param name="jid">The bare JID of the occupant you want to ban. e.g. '*****@*****.**'</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 BanOccupantMessage answers.</returns> public MessageResponseHelper <IQMessage> banOccupant(string roomJid, string jid, string reason, Func <IQMessage, bool> onMessage, Action onTimeout) { MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CLIENT, onMessage, onTimeout); BanOccupantMessage msg = new BanOccupantMessage(CLIENT.getXMPPAccount().getIdDomainAndResource(), roomJid, jid, reason); helper.start(msg); return(helper); }