コード例 #1
0
        /// <summary>
        /// Sends a SetBookmarksMessage to set bookmarks on the server.
        /// https://xmpp.org/extensions/xep-0048.html#storage-pubsub-upload
        /// </summary>
        /// <param name="conferences">A list of XEP-0048 <seealso cref="Network.XML.Messages.XEP_0048.ConferenceItem"/> objects that should be set.</param>
        /// <returns>The XEP-0048 SetBookmarksMessage result.</returns>
        public async Task <MessageResponseHelperResult <IQMessage> > setBookmars_xep_0048Async(IList <Network.XML.Messages.XEP_0048.ConferenceItem> conferences)
        {
            AsyncMessageResponseHelper <IQMessage> helper = new AsyncMessageResponseHelper <IQMessage>(CONNECTION);

            Network.XML.Messages.XEP_0048.SetBookmarksMessage msg = new Network.XML.Messages.XEP_0048.SetBookmarksMessage(CONNECTION.account.getFullJid(), conferences);
            return(await helper.startAsync(msg));
        }
コード例 #2
0
        /// <summary>
        /// Sends a SetBookmarksMessage to request all bookmarks from the server.
        /// https://xmpp.org/extensions/xep-0048.html#storage-pubsub-upload
        /// </summary>
        /// <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 SetBookmarksMessage answers.</returns>
        public MessageResponseHelper <IQMessage> setBookmars_xep_0048(IList <Network.XML.Messages.XEP_0048.ConferenceItem> conferences, MessageResponseHelper <IQMessage> .OnMessageHandler onMessage, MessageResponseHelper <IQMessage> .OnTimeoutHandler onTimeout)
        {
            MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CONNECTION, onMessage, onTimeout);

            Network.XML.Messages.XEP_0048.SetBookmarksMessage msg = new Network.XML.Messages.XEP_0048.SetBookmarksMessage(CONNECTION.account.getFullJid(), conferences);
            helper.start(msg);
            return(helper);
        }
コード例 #3
0
        /// <summary>
        /// Sends a SetBookmarksMessage for requesting all bookmarks from the server.
        /// https://xmpp.org/extensions/xep-0048.html#storage-pubsub-upload
        /// </summary>
        /// <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 SetBookmarksMessage answers.</returns>
        public MessageResponseHelper <IQMessage> setBookmars_xep_0048(IList <Network.XML.Messages.XEP_0048.ConferenceItem> conferences, Func <IQMessage, bool> onMessage, Action onTimeout)
        {
            MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CLIENT, onMessage, onTimeout);

            Network.XML.Messages.XEP_0048.SetBookmarksMessage msg = new Network.XML.Messages.XEP_0048.SetBookmarksMessage(CLIENT.getXMPPAccount().getIdDomainAndResource(), conferences);
            helper.start(msg);
            return(helper);
        }