From 1ec7c2f0e2e5efddcb1c03f8acf67dc0f2a49e7a Mon Sep 17 00:00:00 2001 From: Max Audron Date: Thu, 6 Oct 2022 13:23:20 +0200 Subject: fix IgnoreListManager * mark fields as pub * change enum type to i32 from u8 * fix variant type for string fields --- .../signalproxy/objects/ignorelistmanager.rs | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/message/signalproxy/objects/ignorelistmanager.rs b/src/message/signalproxy/objects/ignorelistmanager.rs index 19d07d5..78570aa 100644 --- a/src/message/signalproxy/objects/ignorelistmanager.rs +++ b/src/message/signalproxy/objects/ignorelistmanager.rs @@ -9,7 +9,7 @@ use libquassel_derive::{sync, NetworkList, NetworkMap}; pub struct IgnoreListManager { #[quassel(name = "IgnoreList")] #[network(variant = "VariantMap", network, map)] - ignore_list: Vec, + pub ignore_list: Vec, } impl IgnoreListManager { @@ -181,27 +181,27 @@ impl Syncable for IgnoreListManager { #[derive(Debug, Clone, PartialEq, NetworkMap)] #[network(repr = "maplist")] pub struct IgnoreListItem { - #[network(rename = "ignoreType", network, type = "u8")] - ignore_type: IgnoreType, - #[network(rename = "ignoreRule")] - ignore_rule: String, + #[network(rename = "ignoreType", network, type = "i32")] + pub ignore_type: IgnoreType, + #[network(rename = "ignoreRule", variant = "StringList")] + pub ignore_rule: String, #[network(rename = "isRegEx")] - is_regex: bool, - #[network(rename = "strictness", network, type = "u8")] - strictness: StrictnessType, - #[network(rename = "scope", network, type = "u8")] - scope: ScopeType, - #[network(rename = "scopeRule")] - scope_rule: String, + pub is_regex: bool, + #[network(rename = "strictness", network, type = "i32")] + pub strictness: StrictnessType, + #[network(rename = "scope", network, type = "i32")] + pub scope: ScopeType, + #[network(rename = "scopeRule", variant = "StringList")] + pub scope_rule: String, #[network(rename = "isActive")] - is_active: bool, + pub is_active: bool, } ///////////////////////////////////// ////////////////////////////////////// -#[repr(u8)] +#[repr(i32)] #[derive(Debug, Clone, Copy, PartialEq)] pub enum IgnoreType { SenderIgnore = 0x00, @@ -209,10 +209,10 @@ pub enum IgnoreType { CtcpIgnore = 0x02, } -impl TryFrom for IgnoreType { +impl TryFrom for IgnoreType { type Error = &'static str; - fn try_from(value: u8) -> Result { + fn try_from(value: i32) -> Result { match value { 0x00 => Ok(IgnoreType::SenderIgnore), 0x01 => Ok(IgnoreType::MessageIgnore), @@ -223,10 +223,10 @@ impl TryFrom for IgnoreType { } impl crate::message::signalproxy::Network for IgnoreType { - type Item = u8; + type Item = i32; fn to_network(&self) -> Self::Item { - *self as u8 + *self as i32 } fn from_network(input: &mut Self::Item) -> Self { @@ -234,7 +234,7 @@ impl crate::message::signalproxy::Network for IgnoreType { } } -#[repr(u8)] +#[repr(i32)] #[derive(Debug, Clone, Copy, PartialEq)] pub enum StrictnessType { UnmatchedStrictness = 0x00, @@ -242,10 +242,10 @@ pub enum StrictnessType { HardStrictness = 0x02, } -impl TryFrom for StrictnessType { +impl TryFrom for StrictnessType { type Error = &'static str; - fn try_from(value: u8) -> Result { + fn try_from(value: i32) -> Result { match value { 0x00 => Ok(StrictnessType::UnmatchedStrictness), 0x01 => Ok(StrictnessType::SoftStrictness), @@ -256,10 +256,10 @@ impl TryFrom for StrictnessType { } impl crate::message::signalproxy::Network for StrictnessType { - type Item = u8; + type Item = i32; fn to_network(&self) -> Self::Item { - *self as u8 + *self as i32 } fn from_network(input: &mut Self::Item) -> Self { @@ -267,7 +267,7 @@ impl crate::message::signalproxy::Network for StrictnessType { } } -#[repr(u8)] +#[repr(i32)] #[derive(Debug, Clone, Copy, PartialEq)] pub enum ScopeType { GlobalScope = 0x00, @@ -275,10 +275,10 @@ pub enum ScopeType { ChannelScope = 0x02, } -impl TryFrom for ScopeType { +impl TryFrom for ScopeType { type Error = &'static str; - fn try_from(value: u8) -> Result { + fn try_from(value: i32) -> Result { match value { 0x00 => Ok(ScopeType::GlobalScope), 0x01 => Ok(ScopeType::NetworkScope), @@ -289,10 +289,10 @@ impl TryFrom for ScopeType { } impl crate::message::signalproxy::Network for ScopeType { - type Item = u8; + type Item = i32; fn to_network(&self) -> Self::Item { - *self as u8 + *self as i32 } fn from_network(input: &mut Self::Item) -> Self { -- cgit v1.2.3 >Max Audron-2/+2 - update dependencies - add server password 2025-12-14add server passwordMax Audron-1/+6 2025-12-14update cargo dependenciesMax Audron-670/+505 2025-12-14update flake inputs to nixpkgs 25.11Max Audron-36/+41 2025-05-06fix rustls missing cryptoproviderMax Audron-1/+6 2025-05-06remove too commonly used used for shifty_eyesMax Audron-1/+1 2025-05-06fix truncate on unicodeMax Audron-10/+20 fuck unicode all my homies stan ascii 2025-05-06update dependenciesMax Audron-691/+1659 2024-08-12add nix build and moduleMax Audron-5/+427 2022-02-19remove jsonnet lock fileMax Audron-36/+0 2022-02-19fix deploy to work with gitlab agentMax Audron-4/+4 2021-10-22write tons of documentation and reorganize some modulesMax Audron-65/+300 2021-10-22remove wolfram alpha url shorteningMax Audron-1/+2 2021-10-20remove failing wolfram alpha test casesMax Audron-105/+55 this is due to the url shorterner dying randomly and also just generally bad idea to call external services during unit tests. 2021-10-20bump version to 1.6.2Max Audron-3/+2 2021-10-20prepare for release on crates.ioMax Audron-39/+65 2021-10-20add async docs to macro crate and bump versionMax Audron-9/+10 2021-10-20change hook errors to be logged as warningsMax Audron-3/+3 they in nearly all cases aren't critical enough to warrant an actual error messages 2021-10-20fix configuration not loading correctly on release buildsMax Audron-8/+23 2021-10-19replace sedregex crate8-rework-sedMax Audron-20/+358 This replaces the sedregex crate with our own implementation for multiple reasons: 1. We required to access the parsed regex, this required a patch to the sedregex crate which did not get merged due to an inactive dev, blocking us from publishing on crates.Io 2. We wanted to highlight the changes done in bold 3. We want to add execution of multiple chained sed commands in the future which would require more modification 2021-10-19add formatting trait for irc codesMax Audron-0/+129 add an impl off the formatting trait on String to format Strings with the typical irc formatting codes for bold, italic etc 2021-10-17fix links in readmeMax Audron-2/+2