Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
MucConstant.cs
1using System.Collections.Generic;
2using Waher.Script;
6
8{
12 public class MucConstant : IConstant
13 {
17 public MucConstant()
18 {
19 }
20
24 public string ConstantName
25 {
26 get { return "MUC"; }
27 }
28
32 public string[] Aliases
33 {
34 get { return null; }
35 }
36
42 {
43 return new ObjectValue(this);
44 }
45
51 public MucRoom this[string RoomName]
52 {
53 get
54 {
55 if (RoomName.IndexOf('@') < 0)
56 {
57 if (!XmppServerModule.Instance.TryGetDomainAndNickName(RoomName, out string Domain, out string NickName))
58 throw new KeyNotFoundException("MUC room not entered: " + RoomName);
59
60 return new MucRoom(RoomName + "@" + Domain, RoomName, Domain, NickName);
61 }
62 else
63 {
64 Enter.ParseRoom(RoomName, out string RoomId, out string Domain);
65
66 if (!XmppServerModule.Instance.TryGetNickName(RoomId, Domain, out string NickName))
67 throw new KeyNotFoundException("MUC room not entered: " + RoomName);
68
69 return new MucRoom(RoomName, RoomId, Domain, NickName);
70 }
71 }
72 }
73 }
74}
Collection of variables.
Definition: Variables.cs:25
Asks the broker to enter a room.
Definition: Enter.cs:13
MUC constant, for script-access to MUC rooms.
Definition: MucConstant.cs:13
MucConstant()
MUC constant, for script-access to MUC rooms.
Definition: MucConstant.cs:17
string ConstantName
Name of the constant
Definition: MucConstant.cs:25
IElement GetValueElement(Variables Variables)
Gets the constant value element.
Definition: MucConstant.cs:41
string[] Aliases
Optional aliases. If there are no aliases for the constant, null is returned.
Definition: MucConstant.cs:33
MUC Room, for script access to remote sources.
Definition: MucRoom.cs:7
Service Module hosting the XMPP broker and its components.
Basic interface for all types of elements.
Definition: IElement.cs:20
Base interface for constants that integrate into the script engine.
Definition: IConstant.cs:10