aboutsummaryrefslogtreecommitdiff
path: root/src/message/signalproxy/objects/network.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/message/signalproxy/objects/network.rs')
-rw-r--r--src/message/signalproxy/objects/network.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/message/signalproxy/objects/network.rs b/src/message/signalproxy/objects/network.rs
index 693abfe..138f63f 100644
--- a/src/message/signalproxy/objects/network.rs
+++ b/src/message/signalproxy/objects/network.rs
@@ -9,7 +9,7 @@ use libquassel_derive::{sync, NetworkMap, Setters};
use crate::error::ProtocolError;
use crate::message::signalproxy::translation::NetworkMap;
-use crate::message::{Class, Syncable};
+use crate::message::{Class, NetworkList, Syncable};
use crate::primitive::{Variant, VariantList, VariantMap};
use crate::serialize::{Deserialize, Serialize, UserType};
@@ -617,6 +617,20 @@ pub struct NetworkServer {
pub proxy_pass: String,
}
+// TODO this is not correct usage, it's technically not really network repr were converting from
+// but just the conversion of VariantList -> Self directly
+// we have this problem since now we have generic VariantList impls
+// for all the variants and this type is now also directly a variant
+impl NetworkList for Vec<NetworkServer> {
+ fn to_network_list(&self) -> super::VariantList {
+ self.iter().map(|b| Variant::NetworkServer(b.clone())).collect()
+ }
+
+ fn from_network_list(input: &mut super::VariantList) -> Self {
+ input.iter().map(|b| match_variant!(b, Variant::NetworkServer)).collect()
+ }
+}
+
impl UserType for NetworkServer {
const NAME: &str = "Network::Server";
}
erive/src/network/mod.rs?h=feature/example/statetracker&id=e25f93c75a7f096f5f5f02aaf4238293071a7a2e&follow=1'>rewrite network derive to work more consistentlyMax Audron-78/+90 2021-07-21fix wrong capitalization for HighlightRuleListMax Audron-2/+2 2021-07-21implement the Network trait generically for all inner Variant TypesMax Audron-1/+66 2021-07-21change IRC MessageType to be a bitflag instead of enumMax Audron-54/+94 2021-07-21fix network objectMax Audron-18/+24 2021-07-21minor docs and cleanupMax Audron-4/+8 2021-04-05WIP: impl more signalproxy objectsMax Audron-1000/+1621 2021-03-09WIP: impl signalproxy typesMax Audron-253/+376 2021-01-21add to and from network deriveMax Audron-42/+2767 2021-01-21reorganize tests and add quassel featuresMax Audron-551/+850 2021-01-04add example program: quasselproxyclientMax Audron-0/+280 2021-01-04random stuffMax Audron-2/+9 2021-01-04add more signalproxy objectsMax Audron-40/+120 2021-01-04add message parsing feature flagsMax Audron-43/+96 2021-01-04fix parsing of datetime when value is -1Max Audron-1/+9 2021-01-02update dependenciesMax Audron-267/+27 2021-01-02rework handshakemessage parsingMax Audron-141/+278 2020-10-16updateMax Audron-1553/+294 2020-10-16update paperworkMax Audron-487/+391