/// <summary> /// Sends a PubSubCreateNodeMessage to create a pubsub node. /// https://xmpp.org/extensions/xep-0060.html#owner-create-and-configure /// </summary> /// <param name="to">The target pubsub server (can be null).</param> /// <param name="nodeName">The name of the node, you want to create.</param> /// <param name="config">The configuration for the node.</param> /// <param name="onMessage">The method that should get executed once the helper receives a new valid message (can be null).</param> /// <param name="onTimeout">The method that should get executed once the helper timeout gets triggered (can be null).</param> /// <returns>Returns a MessageResponseHelper listening for PubSubCreateNodeMessage answers.</returns> public MessageResponseHelper <IQMessage> createNode(string to, string nodeName, DataForm config, MessageResponseHelper <IQMessage> .OnMessageHandler onMessage, MessageResponseHelper <IQMessage> .OnTimeoutHandler onTimeout) { MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CONNECTION, onMessage, onTimeout); PubSubCreateNodeMessage msg = new PubSubCreateNodeMessage(CONNECTION.account.getFullJid(), to, nodeName, config); helper.start(msg); return(helper); }
/// <summary> /// Sends a PubSubSubscribeMessage to subscribe to the given node. /// https://xmpp.org/extensions/xep-0060.html#subscriber-subscribe /// </summary> /// <param name="to">The target pubsub server (can be null).</param> /// <param name="nodeName">The name of the node, you want to subscribe to.</param> /// <param name="onMessage">The method that should get executed once the helper receives a new valid message (can be null).</param> /// <param name="onTimeout">The method that should get executed once the helper timeout gets triggered (can be null).</param> /// <returns>Returns a MessageResponseHelper listening for PubSubSubscribeMessage answers.</returns> public MessageResponseHelper <IQMessage> requestNodeSubscription(string to, string nodeName, MessageResponseHelper <IQMessage> .OnMessageHandler onMessage, MessageResponseHelper <IQMessage> .OnTimeoutHandler onTimeout) { MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CONNECTION, onMessage, onTimeout); PubSubSubscribeMessage msg = new PubSubSubscribeMessage(CONNECTION.account.getFullJid(), CONNECTION.account.getBareJid(), to, nodeName); helper.start(msg); return(helper); }
/// <summary> /// Sends a RemoveBookmarksMessage to remove the given bookmark from the server. /// https://xmpp.org/extensions/xep-0402.html#removing-a-bookmark /// </summary> /// <param name="conferenceItem">The bookmark that should get removed from the server.</param> /// <param name="onMessage">The method that should get executed once the helper receives a new valid message (can be null).</param> /// <param name="onTimeout">The method that should get executed once the helper timeout gets triggered (can be null).</param> /// <returns>Returns a MessageResponseHelper listening for RemoveBookmarksMessage answers.</returns> public MessageResponseHelper <IQMessage> removeBookmark_xep_0402(ConferenceItem conferenceItem, MessageResponseHelper <IQMessage> .OnMessageHandler onMessage, MessageResponseHelper <IQMessage> .OnTimeoutHandler onTimeout) { MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CONNECTION, onMessage, onTimeout); RemoveBookmarkMessage msg = new RemoveBookmarkMessage(CONNECTION.account.getFullJid(), conferenceItem); helper.start(msg); return(helper); }
private void requestBanList() { if (MUCInfo != null && Chat != null && Client != null) { if (MUCInfo.state != Data_Manager2.Classes.MUCState.ENTERD || !Client.isConnected()) { showErrorMessage("Room not joined!"); return; } reload_btn.IsEnabled = false; reload_prgr.Visibility = Visibility.Visible; error_itbx.Visibility = Visibility.Collapsed; string chatId = MUCInfo.chatId; string nickname = MUCInfo.nickname; string roomJid = Chat.chatJabberId; Task.Run(async() => { if (isAllowedToRequestBanList(chatId, nickname)) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => responseHelper = Client.MUC_COMMAND_HELPER.requestBanList(roomJid, onRequestBanListMessage, onRequestBanListTimeout)); } else { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { showErrorMessage("Unable to request ban list - missing permissions!"); reload_btn.IsEnabled = true; reload_prgr.Visibility = Visibility.Collapsed; }); } }); } }
//--------------------------------------------------------Constructor:----------------------------------------------------------------\\ #region --Constructors-- /// <summary> /// Basic Constructor /// </summary> /// <history> /// 12/03/2018 Created [Fabian Sauter] /// </history> public MucBanListControl() { this.responseHelper = null; this.BANNED_USERS = new ObservableCollection <MUCBanedUserTemplate>(); this.InitializeComponent(); }
//--------------------------------------------------------Constructor:----------------------------------------------------------------\\ #region --Constructors-- /// <summary> /// Basic Constructor /// </summary> /// <history> /// 12/02/2018 Created [Fabian Sauter] /// </history> public MucInfoControl() { this.changeNickHelper = null; this.InitializeComponent(); }