aboutsummaryrefslogtreecommitdiff
path: root/src/message/signalproxy/objects/aliasmanager.rs
diff options
context:
space:
mode:
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..828caaa
--- /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: &mut Self, properties: VariantMap) {
+ self.update(properties);
+ }
+
+ /// Server to Client
+ fn add_alias(self: &mut 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: &mut 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
+ }
+}
/span> 2025-03-01add UserType implementation for required signalproxy objectsMax Audron-13/+131 2025-03-01remove old quassel attributes from derive macrosMax Audron-37/+36 2025-02-27extend docs and reorganize filesMax Audron-1281/+321 2025-02-26implement NetworkId UserTypeMax Audron-108/+196 2025-02-26implement IdentityIdMax Audron-8/+79 2025-02-26refactor variant deserializationMax Audron-123/+59 2025-02-26refactor deserialize and serializevariant traitMax Audron-90/+80 2025-02-26refactor variant serialization codeMax Audron-256/+405 2025-02-26add MsgId and BufferId to objects where neededMax Audron-141/+157 2025-02-25enable transparent repr for msgid and bufferidMax Audron-0/+2 2025-02-25Implement BacklogManagerTobias Deiminger-59/+113 2025-02-25Use BufferId in BufferInfoTobias Deiminger-10/+11 2025-02-25Use BufferId in VariantTobias Deiminger-2/+33 2025-02-25Add BufferId as Rust typeTobias Deiminger-0/+39 2025-02-25Use MsgId in MessageTobias Deiminger-18/+6 2025-02-25Use MsgId in VariantTobias Deiminger-20/+37 2025-02-25Add MsgId as Rust typeTobias Deiminger-0/+56 2025-02-24added session manager comments and log messageMax Audron-1/+3 2025-02-23add identity syncable to SessionManagerMax Audron-1/+8 2025-02-23add syncables for IrcUserMax Audron-2/+53 2025-02-23move network config to it's own file and impl it's syncMax Audron-23/+84 2025-02-23add basic network syncablesMax Audron-39/+420 2025-02-23clean up unused_import and unused_variables a bitMax Audron-2/+8 2025-02-23fix server feature errorsMax Audron-28/+23 2025-02-23fix ircchannel and maplist network representationMax Audron-154/+137 2025-02-22replace deprecated failure crate with thiserrorMax Audron-278/+194 2025-02-22update dependencies and fix errorsMax Audron-508/+332 2025-02-22update flakeMax Audron-94/+117 2024-05-22add todos to readmeMax Audron-16/+35