1using System.Collections.Generic;
3using System.Threading.Tasks;
25 public override string Name =>
"Occupants";
32 "Lists occupants in a room named `ROOM`."
51 await ResponseCallback(
"Multi-User Chat disabled.",
string.Empty);
55 Enter.ParseRoom(Arguments[0], out
string RoomId, out
string Domain);
59 await ResponseCallback(
"Not occupant of room.",
string.Empty);
68 await ResponseCallback(
"No occupants in room.",
string.Empty);
72 StringBuilder Response =
new StringBuilder();
74 Response.AppendLine(
"| Occupants in room |||||");
75 Response.AppendLine(
"| Nick-name | Availability | Affiliation | Role | JID |");
76 Response.AppendLine(
"|:----|:----|:----|:----|:----|");
78 foreach (KeyValuePair<CaseInsensitiveString, Networking.XMPP.MUC.UserPresenceEventArgs> P
in Occupants)
80 Response.Append(
"| `");
81 Response.Append(P.Key.Value);
82 Response.Append(
"` | `");
83 Response.Append(P.Value.Availability.ToString());
84 Response.Append(
"` | ");
86 if (P.Value.Affiliation.HasValue)
89 Response.Append(P.Value.Affiliation.Value.ToString());
93 Response.Append(
" | ");
95 if (P.Value.Role.HasValue)
98 Response.Append(P.Value.Role.Value.ToString());
102 Response.Append(
" | `");
103 Response.Append(P.Value.FullJid);
104 Response.AppendLine(
"` |");
107 await ResponseCallback(Response.ToString(),
string.Empty);
Static class managing the runtime environment of the IoT Gateway.
static MultiUserChatClient MucClient
XMPP Multi-User Chat Protocol (MUC) Client.
Represents a case-insensitive string.
An administrative command taking one parameter.
Asks the broker to enter a room.
Lists occupants in a room.
override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
Executes the command.
override string Name
Command name
Occupants()
Lists occupants in a room.
override string ParameterName
Name of parameter.
override string[] HelpParagraphs
Markdown description of syntax.
Service Module hosting the XMPP broker and its components.
delegate Task< string > ResponseCallbackHandler(string Markdown, string MessageId)
Delegate for response callback handler methods.