/// <summary>
        /// Sends a PubSubDeleteNodeMessage to delete a pubsub node.
        /// https://xmpp.org/extensions/xep-0060.html#owner-delete
        /// </summary>
        /// <param name="toBareJid">The target pubsub server (can be null).</param>
        /// <param name="nodeName">The name of the node, you want to delete.</param>
        /// <returns>The result of the PubSubDeleteNodeMessage.</returns>
        public async Task <MessageResponseHelperResult <IQMessage> > deleteNodeAsync(string toBareJid, string nodeName)
        {
            AsyncMessageResponseHelper <IQMessage> helper = new AsyncMessageResponseHelper <IQMessage>(CONNECTION);
            PubSubDeleteNodeMessage msg = new PubSubDeleteNodeMessage(CONNECTION.account.getFullJid(), toBareJid, nodeName);

            return(await helper.startAsync(msg));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sends a PubSubDeleteNodeMessage for deleting a pubsub node.
        /// https://xmpp.org/extensions/xep-0060.html#owner-delete
        /// </summary>
        /// <param name="to">The target pubsub server (can be null).</param>
        /// <param name="nodeName">The name of the node, you want to delete.</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 PubSubDeleteNodeMessage answers.</returns>
        public MessageResponseHelper <IQMessage> deleteNode(string to, string nodeName, Func <IQMessage, bool> onMessage, Action onTimeout)
        {
            MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CLIENT, onMessage, onTimeout);
            PubSubDeleteNodeMessage           msg    = new PubSubDeleteNodeMessage(CLIENT.getXMPPAccount().getIdDomainAndResource(), to, nodeName);

            helper.start(msg);
            return(helper);
        }
Exemplo n.º 3
0
        private void deleteDeviceListNode()
        {
            if (resetDeviceListStatelessHelper != null)
            {
                resetDeviceListStatelessHelper.Dispose();
                resetDeviceListStatelessHelper = null;
            }

            resetDeviceListStatelessHelper = new MessageResponseHelper <IQMessage>(CONNECTION, onDeleteDeviceListNodeMessage, onDeleteDeviceListNodeTimeout);
            PubSubDeleteNodeMessage msg = new PubSubDeleteNodeMessage(CONNECTION.account.getIdDomainAndResource(), null, Consts.XML_XEP_0384_DEVICE_LIST_NODE);

            resetDeviceListStatelessHelper.start(msg);
        }