/// <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 PubSubCreateNodeMessage for creating 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, Func <IQMessage, bool> onMessage, Action onTimeout) { MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CLIENT, onMessage, onTimeout); PubSubCreateNodeMessage msg = new PubSubCreateNodeMessage(CLIENT.getXMPPAccount().getIdDomainAndResource(), to, nodeName, config); helper.start(msg); return(helper); }