14 [CollectionName(
"FriendshipRules")]
17 [Index(
"JID",
"RemoteJID")]
20 private Guid objectId = Guid.Empty;
23 private bool canSubscribeToPresence =
false;
39 set => this.objectId = value;
48 set => this.jid = value;
56 get => this.remoteJid;
57 set => this.remoteJid = value;
66 get => this.canSubscribeToPresence;
67 set => this.canSubscribeToPresence = value;
77 Output.WriteAttributeString(
"jid", this.jid);
78 Output.WriteAttributeString(
"remoteJid", this.remoteJid);
79 Output.WriteAttributeString(
"canSubscribeToPresence",
CommonTypes.
Encode(
this.canSubscribeToPresence));
80 Output.WriteEndElement();
89 StringBuilder sb =
new StringBuilder();
91 using (XmlWriter w = XmlWriter.Create(sb))
Helps with parsing of commong data types.
static string Encode(bool x)
Encodes a Boolean for use in XML and other formats.
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
Controls if a device with a remote JID is allowed to subscribe to the presence of a device with JID.
string ExportXml()
Exports the rule as an XML string.
FriendshipRule()
Controls if a device with a remote JID is allowed to subscribe to the presence of a device with JID.
void Export(XmlWriter Output)
Exports the rule.
CaseInsensitiveString RemoteJID
JID of device that want to subscribe to presence.
bool CanSubscribeToPresence
If presence subscription should be permitted.
CaseInsensitiveString JID
JID of device needing to decide if a presence subscription should be accepted or rejected.
Abstract base class for rules.
const string RuleNamespace
http://waher.se/Schema/Provisioning/Rules.xsd
TypeNameSerialization
How the type name should be serialized.