2using System.Collections.Generic;
3using System.Threading.Tasks;
26 : base(
"Xmpp/GetRoster",
27 new KeyValuePair<Type,
Expression>(typeof(Dictionary<string, object>), new
Expression(jsonPattern)),
48 int MaxCount =
int.MaxValue;
50 if (Parameters.TryGetValue(
"POffset", out
IElement E) && !(E is
null) &&
51 E.AssociatedObjectValue is
double d)
56 if (Parameters.TryGetValue(
"PMaxCount", out E) && !(E is
null) &&
57 E.AssociatedObjectValue is
double d2)
62 List<Dictionary<string, object>> Roster =
new List<Dictionary<string, object>>();
77 foreach (Networking.XMPP.RosterItem Item in Client.
Roster)
85 Roster.Add(
new Dictionary<string, object>()
87 {
"bareJid", Item.BareJid },
88 {
"pendingSubscription", Item.PendingSubscription == PendingSubscription.Subscribe },
89 {
"status", Item.State },
90 {
"name", Item.Name },
91 {
"Groups", Item.Groups }
104 if (!(Items is
null))
114 Roster.Add(
new Dictionary<string, object>()
116 {
"bareJid", Item.BareJid.Value },
117 {
"pendingSubscription", Item.PendingSubscription },
118 {
"status", Item.Subscription },
119 {
"name", Item.Name },
120 {
"Groups", Item.Groups }
132 {
"RosterItems", Roster.ToArray() }
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.
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 is currently unable to handle the request due to a temporary overloading or maintenance of...
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
RosterItem[] Roster
Items in the roster.
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< IEnumerable< IRosterItem > > GetRoster(CaseInsensitiveString UserName)
Gets the roster of an account.
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.
Gets the roster of the authenticated account.
override async Task POST(HttpRequest Request, HttpResponse Response, Dictionary< string, IElement > Parameters)
Executes the POST method on the resource.
GetRoster()
Gets the roster of the authenticated account.
Service Module hosting the XMPP broker and its components.
Interface for roster items.
Basic interface for all types of elements.