aboutsummaryrefslogtreecommitdiff
path: root/src/message/signalproxy/objects/aliasmanager.rs
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2020-10-16 21:58:05 +0200
committerMax Audron <audron@cocaine.farm>2020-10-16 21:58:05 +0200
commitfd943651195a970aac2b066e3bdbb23253f73ce7 (patch)
tree09af5399dcd96b8f525412798b7e6e8719f3e55e /src/message/signalproxy/objects/aliasmanager.rs
parentupdate paperwork (diff)
update
Diffstat (limited to 'src/message/signalproxy/objects/aliasmanager.rs')
-rw-r--r--src/message/signalproxy/objects/aliasmanager.rs46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/message/signalproxy/objects/aliasmanager.rs b/src/message/signalproxy/objects/aliasmanager.rs
new file mode 100644
index 0000000..7e9cfca
--- /dev/null
+++ b/src/message/signalproxy/objects/aliasmanager.rs
@@ -0,0 +1,46 @@
+use crate::primitive::{Variant, VariantMap};
+
+#[derive(Clone, Debug, std::cmp::PartialEq)]
+pub struct AliasManager {
+ pub aliases: Vec<Alias>,
+}
+
+#[derive(Clone, Debug, std::cmp::PartialEq)]
+pub struct Alias {
+ name: String,
+ expansion: String,
+}
+
+// impl AliasManager {
+// /// Client to Server
+// ///
+// /// Replaces all properties of the object with the content of the
+// /// "properties" parameter. This parameter is in network representation.
+// ///
+// fn request_update(self: Self, properties: VariantMap) {
+// self.update(properties);
+// }
+//
+// /// Server to Client
+// fn add_alias(self: Self, name: String, expansion: String) {
+// self.aliases.push(Alias { name, expansion });
+// }
+//
+// /// Server to Client
+// ///
+// /// Replaces all properties of the object with the content of the
+// /// "properties" parameter. This parameter is in network representation.
+// ///
+// fn update(self: Self, properties: VariantMap) {
+// let mut alias: Vec<Alias> = Vec::new();
+//
+// // for (i, name) in match_variant!(properties[&"Aliases".to_string()], Variant::String) {
+// // alias.push(Alias {
+// // name,
+// // expansion: match_variant!(properties["Aliases"], Variant::String)["expansions"][i],
+// // })
+// // }
+//
+// self.aliases = alias
+// }
+// }