//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ #region --Set-, Get- Methods-- #endregion //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ #region --Misc Methods (Public)-- /// <summary> /// Sends a DiscoRequestMessage and requests all MUC rooms for the given server. /// </summary> /// <param name="server">The server the rooms should get requested for. e.g. 'conference.jabber.org'</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 DiscoRequestMessage answers.</returns> public MessageResponseHelper <IQMessage> requestRooms(string server, Func <IQMessage, bool> onMessage, Action onTimeout) { MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CLIENT, onMessage, onTimeout); DiscoRequestMessage disco = new DiscoRequestMessage(CLIENT.getXMPPAccount().getIdDomainAndResource(), server, DiscoType.ITEMS); helper.start(disco); return(helper); }
//--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ #region --Misc Methods (Public)-- /// <summary> /// Sends a RequestBookmarksMessage for requesting all bookmarks from the server. /// https://xmpp.org/extensions/xep-0048.html#storage-pubsub-retrieve /// </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 RequestBookmarksMessage answers.</returns> public MessageResponseHelper <IQMessage> requestBookmars_xep_0048(Func <IQMessage, bool> onMessage, Action onTimeout) { MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CLIENT, onMessage, onTimeout); Network.XML.Messages.XEP_0048.RequestBookmarksMessage msg = new Network.XML.Messages.XEP_0048.RequestBookmarksMessage(CLIENT.getXMPPAccount().getIdDomainAndResource()); helper.start(msg); return(helper); }
//--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\ #region --Set-, Get- Methods-- #endregion //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\ #region --Misc Methods (Public)-- /// <summary> /// Sends a OmemoRequestBundleInformationMessage to requests the OMEMO bundle information of the given target and deviceId. /// </summary> /// <param name="to">The bare JID of the target you want to request the OMEMO bundle information from. e.g. 'conference.jabber.org'</param> /// <param name="deviceId">The device id you want to request the OMEMO bundle information for.</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 OmemoRequestBundleInformationMessage answers.</returns> public MessageResponseHelper <IQMessage> requestBundleInformation(string to, uint deviceId, Func <IQMessage, bool> onMessage, Action onTimeout) { MessageResponseHelper <IQMessage> helper = new MessageResponseHelper <IQMessage>(CLIENT, onMessage, onTimeout); OmemoRequestBundleInformationMessage msg = new OmemoRequestBundleInformationMessage(CLIENT.getXMPPAccount().getIdDomainAndResource(), to, deviceId); helper.start(msg); return(helper); }