2using System.Collections.Generic;
3using System.Threading.Tasks;
26 : base(
"Xmpp/SendSubscriptionAccepted",
27 new KeyValuePair<Type,
Expression>(typeof(Dictionary<string, object>), new
Expression(jsonPattern)),
47 string To = (string)Parameters[
"PTo"].AssociatedObjectValue;
49 if (
string.IsNullOrEmpty(To))
54 string Id = (string)Parameters[
"PId"]?.AssociatedObjectValue;
56 if (
string.IsNullOrEmpty(Id))
57 Id = Guid.NewGuid().ToString();
59 Dictionary<string, object> NewItem;
85 NewItem =
new Dictionary<string, object>()
87 {
"bareJid", Item?.
BareJid ?? To },
89 {
"status", Item?.
State ?? SubscriptionState.None },
90 {
"name", Item?.
Name ?? string.Empty },
91 {
"Groups", Item?.
Groups ??
new string[0] }
112 Item?.
Name ??
string.Empty, State,
null,
null);
120 NewItem =
new Dictionary<string, object>()
122 {
"bareJid", Item.BareJid.Value },
123 {
"pendingSubscription", Item.PendingSubscription },
124 {
"status", Item.Subscription },
125 {
"name", Item.Name },
126 {
"Groups", Item.Groups }
134 {
"RosterItem", NewItem }
A Named dictionary is a dictionary, with a local name and a namespace. Use it to return content that ...
Static class managing loading of resources stored as embedded resources or in content files.
static string LoadResourceAsText(string ResourceName)
Loads a text resource from an embedded resource.
Static class managing the runtime environment of the IoT Gateway.
static XmppClient XmppClient
XMPP Client connection of gateway.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
Represents an HTTP request.
Represets a response of an HTTP client request.
async Task Return(object Object)
Returns an object to the client. This method can only be called once per response,...
The server has not found anything matching the Request-URI. No indication is given of whether the con...
The server is currently unable to handle the request due to a temporary overloading or maintenance of...
Event arguments for presence events.
async Task Accept()
Accepts a subscription or unsubscription request.
string Id
ID attribute of presence stanza.
Maintains information about an item in the roster.
SubscriptionState State
roup Current subscription state.
string[] Groups
Any groups the roster item belongs to.
string BareJid
Bare JID of the roster item.
PendingSubscription PendingSubscription
If there's a pending unanswered presence subscription or unsubscription request made to the contact.
string Name
Name of the roster item.
Contains information about one XMPP address.
static readonly XmppAddress Empty
Empty address.
CaseInsensitiveString Domain
Domain name.
async Task< bool > Presence(string Type, string Id, XmppAddress From, string Language, Stanza Stanza, ISender Sender)
Presence stanza.
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
PresenceEventArgs GetSubscriptionRequest(string BareJID)
Gets a presence subscription request
Static class that dynamically manages types and interfaces available in the runtime environment.
static bool TryGetModuleParameter(string Name, out object Value)
Tries to get a module parameter value.
Class managing a script expression.
string UserName
User Name.
async Task< IRosterItem > GetRosterItem(CaseInsensitiveString UserName, CaseInsensitiveString Jid)
Gets a roster item for an account.
async Task< IRosterItem > SetRosterItem(CaseInsensitiveString UserName, CaseInsensitiveString Jid, string Name, SubscriptionStatus? Subscription, bool? PendingSubscription, string[] Groups)
Sets a roster item in a users roster.
static AccountUser AssertUserAuthenticated(HttpRequest Request)
Makes sure the request is made by an authenticated API user.
const string AgentNamespace
https://waher.se/Schema/BrokerAgent.xsd
Abstract base class for XMPP resources.
static bool IsValidBareJID(string JID)
Checks if a string is a valid Bare JID.
Accepts a presence subscription request made to the XMPP account.
SendSubscriptionAccepted()
Accepts a presence subscription request made to the XMPP account.
override async Task POST(HttpRequest Request, HttpResponse Response, Dictionary< string, IElement > Parameters)
Executes the POST method on the resource.
Service Module hosting the XMPP broker and its components.
Interface for roster items.
SubscriptionStatus Subscription
Subscription status.
string Name
Name of roster item.
SubscriptionStatus
Roster item subscription status enumeration.
PendingSubscription
Pending subscription states.