Пример #1
0
 /// <summary>
 /// Submits the node configuration.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="form">The configuration form.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> SubmitNodeConfigurationAsync(
     this IClientIqSender iqSender, Jid to, string node, XData form, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.SubmitNodeConfiguration(to, node, form), timeout, cancellationToken));
 }
Пример #2
0
 /// <summary>
 /// Remove a contact from the contact list, aka roster
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The jid to remove</param>
 /// <param name="timeout">The timeout</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> RemoveRosterItemAsync(this IClientIqSender iqSender, Jid jid, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(RosterBuilder.RemoveRosterItem(jid), timeout, cancellationToken));
 }
Пример #3
0
 /// <summary>
 /// Request the roster (contact list) asynchronous from the server.
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="version"></param>
 /// <param name="timeout"></param>
 /// <returns></returns>
 public static async Task <Iq> RequestRosterAsync(this IClientIqSender iqSender, string version, int timeout)
 {
     return(await RequestRosterAsync(iqSender, version, timeout, CancellationToken.None));
 }
Пример #4
0
 /// <summary>
 /// Update a Rosteritem
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The jid.</param>
 /// <param name="nickname">The nickname.</param>
 /// <param name="group">The group.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <returns></returns>
 public static async Task <Iq> UpdateRosterItemAsync(this IClientIqSender iqSender, Jid jid, string nickname, string group, int timeout)
 {
     return(await AddRosterItemAsync(iqSender, jid, nickname, new[] { group }, timeout, CancellationToken.None));
 }
Пример #5
0
 /// <summary>
 /// Update a Rosteritem
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The jid.</param>
 /// <param name="nickname">The nickname.</param>
 /// <param name="group">The group.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> UpdateRosterItemAsync(this IClientIqSender iqSender, Jid jid, string nickname, string[] group, int timeout, CancellationToken cancellationToken)
 {
     return(await AddRosterItemAsync(iqSender, jid, nickname, group, timeout, cancellationToken));
 }
Пример #6
0
 /// <summary>
 /// Add a Rosteritem to the Roster
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The BARE jid of the rosteritem that should be removed</param>
 /// <param name="nickname">Nickname for the RosterItem</param>
 /// <param name="group">An Array of groups when you want to add the Rosteritem to multiple groups</param>
 /// <returns></returns>
 public static async Task <Iq> AddRosterItemAsync(this IClientIqSender iqSender, Jid jid, string nickname, string[] groups)
 {
     return(await AddRosterItemAsync(iqSender, jid, nickname, groups, DefaultTimeout));
 }
Пример #7
0
 /// <summary>
 /// Update a Rosteritem
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The jid.</param>
 /// <returns></returns>
 public static async Task <Iq> UpdateRosterItemAsync(this IClientIqSender iqSender, Jid jid)
 {
     return(await AddRosterItemAsync(iqSender, jid, null, new string[] { }));
 }
Пример #8
0
 /// <summary>
 /// Create an instant node
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">Jid of the PubSub service.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 /// <remarks>
 /// Instant nodes are nodes whose node is is automatically generated by a pubsub service.
 /// </remarks>
 public static async Task <Iq> CreateInstantNodeAsync(
     this IClientIqSender iqSender, Jid to, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.CreateInstantNode(to), timeout, cancellationToken));
 }
Пример #9
0
 /// <summary>
 /// Retrieve Subscriptions List
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <returns></returns>
 public static async Task <Iq> RequestSubscriptionsListAsync(this IClientIqSender iqSender, Jid to, string node)
 {
     return(await RequestSubscriptionsListAsync(iqSender, to, node, DefaultTimeout, CancellationToken.None));
 }
Пример #10
0
 /// <summary>
 /// Unsubscribes from a node.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="subId">The sub id.</param>
 /// <param name="jid">The jid.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> UnsubscribeAsync(
     this IClientIqSender iqSender, Jid to, string node, string subId, Jid jid, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.Unsubscribe(to, node, subId, jid), timeout, cancellationToken));
 }
Пример #11
0
 /// <summary>
 /// Request all current subscriptions.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <returns></returns>
 public static async Task <Iq> RequestAllSubscriptionsAsync(this IClientIqSender iqSender, Jid to, int timeout)
 {
     return(await RequestAllSubscriptionsAsync(iqSender, to, timeout, CancellationToken.None));
 }
Пример #12
0
 /// <summary>
 /// Unsubscribes from a node.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="subId">The sub id.</param>
 /// <param name="jid">The jid.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <returns></returns>
 public static async Task <Iq> UnsubscribeAsync(this IClientIqSender iqSender, Jid to, string node, string subId, Jid jid, int timeout)
 {
     return(await UnsubscribeAsync(iqSender, to, node, subId, jid, timeout, CancellationToken.None));
 }
Пример #13
0
 /// <summary>
 /// Create an instant node
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">Jid of the PubSub service.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <returns></returns>
 /// <remarks>
 /// Instant nodes are nodes whose node is is automatically generated by a pubsub service.
 /// </remarks>
 public static async Task <Iq> CreateInstantNodeAsync(this IClientIqSender iqSender, Jid to, int timeout)
 {
     return(await CreateInstantNodeAsync(iqSender, to, timeout, CancellationToken.None));
 }
Пример #14
0
 /// <summary>
 /// Unsubscribes from a node.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="jid">The jid.</param>
 /// <returns></returns>
 public static async Task <Iq> UnsubscribeAsync(this IClientIqSender iqSender, Jid to, string node, Jid jid)
 {
     return(await UnsubscribeAsync(iqSender, to, node, null, jid, DefaultTimeout, CancellationToken.None));
 }
Пример #15
0
 /// <summary>
 /// Add a Rosteritem to the Roster
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The BARE jid of the rosteritem that should be removed</param>
 /// <param name="nickname">Nickname for the RosterItem</param>
 /// <param name="group">The group to which the roteritem should be added</param>
 /// <returns></returns>
 public static async Task <Iq> AddRosterItemAsync(this IClientIqSender iqSender, Jid jid, string nickname, string group)
 {
     return(await AddRosterItemAsync(iqSender, jid, nickname, !String.IsNullOrEmpty(group)?new[] { group } : new string[] { }));
 }
Пример #16
0
 /// <summary>
 /// Retrieve Subscriptions List
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> RequestSubscriptionsListAsync(
     this IClientIqSender iqSender, Jid to, string node, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.RequestSubscriptionsList(to, node), timeout, cancellationToken));
 }
Пример #17
0
 /// <summary>
 /// Add a Rosteritem to the Roster
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The BARE jid of the rosteritem that should be removed</param>
 /// <param name="nickname">Nickname for the RosterItem</param>
 /// <param name="group">The group to which the roteritem should be added</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> AddRosterItemAsync(this IClientIqSender iqSender, Jid jid, string nickname, string group, int timeout, CancellationToken cancellationToken)
 {
     return(await AddRosterItemAsync(iqSender, jid, nickname, !String.IsNullOrEmpty(group)?new[] { group } : new string[] { }, timeout, cancellationToken));
 }
Пример #18
0
 /// <summary>
 /// Purges all node item.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">Jid of the pubsub service for this request</param>
 /// <param name="node">The node.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <returns></returns>
 /// <remarks>
 /// If a service persists published items, a node owner may want to purge
 /// the node of all published items (thus removing all items from the
 /// persistent store, with the exception of the last published item,
 /// which MAY be cached). It is OPTIONAL for a service to implement this
 /// feature.
 /// </remarks>
 public static async Task <Iq> PurgeNodeAsync(this IClientIqSender iqSender, Jid to, string node, int timeout)
 {
     return(await PurgeNodeAsync(iqSender, to, node, timeout, CancellationToken.None));
 }
Пример #19
0
        /// <summary>
        /// Add a Rosteritem to the Roster
        /// </summary>
        /// <param name="iqSender"><see cref="IClientIqSender"/></param>
        /// <param name="jid">The BARE jid of the rosteritem that should be removed</param>
        /// <param name="nickname">Nickname for the RosterItem</param>
        /// <param name="group">An Array of groups when you want to add the Rosteritem to multiple groups</param>
        /// <param name="timeout">The timeout in milliseconds.</param>
        /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
        /// <returns></returns>
        public static async Task <Iq> AddRosterItemAsync(this IClientIqSender iqSender, Jid jid, string nickname, string[] groups, int timeout, CancellationToken cancellationToken)
        {
            var riq = RosterBuilder.AddRosterItem(jid, nickname, groups);

            return(await iqSender.SendIqAsync(riq, timeout, cancellationToken));
        }
Пример #20
0
 /// <summary>
 /// Creates a new node.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <returns></returns>
 public static async Task <Iq> CreateNodeAsync(this IClientIqSender iqSender, Jid to, string node)
 {
     return(await CreateNodeAsync(iqSender, to, node, null));
 }
Пример #21
0
 /// <summary>
 /// Update a Rosteritem
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The jid.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> UpdateRosterItemAsync(this IClientIqSender iqSender, Jid jid, int timeout, CancellationToken cancellationToken)
 {
     return(await AddRosterItemAsync(iqSender, jid, null, new string[] { }, timeout, cancellationToken));
 }
Пример #22
0
 /// <summary>
 /// Purges all node item.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">Jid of the pubsub service for this request</param>
 /// <param name="node">The node.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 /// <remarks>
 /// If a service persists published items, a node owner may want to purge
 /// the node of all published items (thus removing all items from the
 /// persistent store, with the exception of the last published item,
 /// which MAY be cached). It is OPTIONAL for a service to implement this
 /// feature.
 /// </remarks>
 public static async Task <Iq> PurgeNodeAsync(
     this IClientIqSender iqSender, Jid to, string node, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(PubSubBuilder.PurgeNode(to, node), timeout, cancellationToken));
 }
Пример #23
0
 /// <summary>
 /// Update a Rosteritem
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The jid.</param>
 /// <param name="nickname">The nickname.</param>
 /// <param name="group">The group.</param>
 /// <returns></returns>
 public static async Task <Iq> UpdateRosterItemAsync(this IClientIqSender iqSender, Jid jid, string nickname, string[] group)
 {
     return(await AddRosterItemAsync(iqSender, jid, nickname, group));
 }
Пример #24
0
 /// <summary>
 /// Request an item
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">Jid of the pubsub service for this request</param>
 /// <param name="node">The node.</param>
 /// <param name="id">The id</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <returns></returns>
 public static async Task <Iq> RequestItemAsync(
     this IClientIqSender iqSender, Jid to, string node, string id, int timeout)
 {
     return(await RequestItemAsync(iqSender, to, node, id, timeout, CancellationToken.None));
 }
Пример #25
0
 /// <summary>
 /// Remove a contact from the contact list, aka roster
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The jid to remove</param>
 /// <returns></returns>
 public static async Task <Iq> RemoveRosterItemAsync(this IClientIqSender iqSender, Jid jid)
 {
     return(await RemoveRosterItemAsync(iqSender, jid, DefaultTimeout));
 }
Пример #26
0
 /// <summary>
 /// Request the roster (contact list) asynchronous from the server.
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="version"></param>
 /// <param name="timeout"></param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> RequestRosterAsync(this IClientIqSender iqSender, string version, int timeout, CancellationToken cancellationToken)
 {
     return(await iqSender.SendIqAsync(RosterBuilder.RequestRoster(version), timeout, cancellationToken));
 }
Пример #27
0
 /// <summary>
 /// Request the roster (contact list) asynchronous from the server.
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="timeout"></param>
 /// <param name="cancellationToken"></param>
 /// <returns></returns>
 public static async Task <Iq> RequestRosterAsync(this IClientIqSender iqSender, int timeout, CancellationToken cancellationToken)
 {
     return(await RequestRosterAsync(iqSender, null, DefaultTimeout, CancellationToken.None));
 }
Пример #28
0
 /// <summary>
 /// Add a Rosteritem to the Roster
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="jid">The BARE jid of the rosteritem that should be removed</param>
 /// <param name="nickname">Nickname for the RosterItem</param>
 /// <returns></returns>
 public static async Task <Iq> AddRosterItemAsync(this IClientIqSender iqSender, Jid jid, string nickname)
 {
     return(await AddRosterItemAsync(iqSender, jid, nickname, new string[] { }));
 }
Пример #29
0
 /// <summary>
 /// Request the roster (contact list) asynchronous from the server.
 /// </summary>
 /// <param name="iqSender"><see cref="IClientIqSender"/></param>
 /// <param name="version"></param>
 /// <param name="cancellationToken">The cancellation token used to cancel the request.</param>
 /// <returns></returns>
 public static async Task <Iq> RequestRosterAsync(this IClientIqSender iqSender, string version, CancellationToken cancellationToken)
 {
     return(await RequestRosterAsync(iqSender, version, DefaultTimeout, cancellationToken));
 }
Пример #30
0
 /// <summary>
 /// Submits the node configuration.
 /// </summary>
 /// <param name="iqSender">The <see cref="IClientIqSender"/></param>
 /// <param name="to">To.</param>
 /// <param name="node">The node.</param>
 /// <param name="form">The configuration form.</param>
 /// <param name="timeout">The timeout in milliseconds.</param>
 /// <returns></returns>
 public static async Task <Iq> SubmitNodeConfigurationAsync(this IClientIqSender iqSender, Jid to, string node, XData form, int timeout)
 {
     return(await SubmitNodeConfigurationAsync(iqSender, to, node, form, timeout, CancellationToken.None));
 }