From c63d5e6db9bbf50ebd73a297905bd436774ea974 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sat, 26 Sep 2020 13:05:32 +0200 Subject: split signalproxy.rs --- src/message/signalproxy/rpccall.rs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/message/signalproxy/rpccall.rs (limited to 'src/message/signalproxy/rpccall.rs') diff --git a/src/message/signalproxy/rpccall.rs b/src/message/signalproxy/rpccall.rs new file mode 100644 index 0000000..748b226 --- /dev/null +++ b/src/message/signalproxy/rpccall.rs @@ -0,0 +1,38 @@ +use crate::message::MessageType; +use crate::primitive::{Variant, VariantList}; +use crate::{Deserialize, Serialize}; + +#[derive(Clone, Debug, std::cmp::PartialEq)] +pub struct RpcCall { + slot_name: String, + params: VariantList, +} + +impl Serialize for RpcCall { + fn serialize(&self) -> Result, failure::Error> { + let mut res = VariantList::new(); + + res.push(Variant::i32(MessageType::RpcCall as i32)); + res.push(Variant::StringUTF8(self.slot_name.clone())); + + res.append(&mut self.params.clone()); + + res.serialize() + } +} + +impl Deserialize for RpcCall { + fn parse(b: &[std::primitive::u8]) -> Result<(std::primitive::usize, Self), failure::Error> { + let (size, mut res) = VariantList::parse(&b)?; + + res.remove(0); + + Ok(( + size, + Self { + slot_name: match_variant!(res.remove(0), Variant::StringUTF8), + params: res, + }, + )) + } +} -- cgit v1.2.3 logtreecommitdiff
p;id=e53976d33c7611991c8a33344fd2f73211096c6e&follow=1'>ready tanka deploy for CI
Commit message (Expand)AuthorLines
2025-12-18add wolfram alpha natural language responseMax Audron-2/+34
2025-12-17release 1.8.01.8.0Max Audron-2/+3
2025-12-17add twitter cancel featureMax Audron-7/+44
2025-12-14update debug config filesMax Audron-7/+6
2025-12-14release 1.7.11.7.1Max Audron-2/+2
2025-12-14fix non-sasl connection registrationMax Audron-9/+35
2025-12-14fix readme badge linksMax Audron-3/+3
2025-12-14update readme and remotesMax Audron-1/+14
2025-12-14release 1.7.01.7.0Max Audron-2/+2
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
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
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
2021-10-20fix configuration not loading correctly on release buildsMax Audron-8/+23
2021-10-19replace sedregex crate8-rework-sedMax Audron-20/+358
2021-10-19add formatting trait for irc codesMax Audron-0/+129
2021-10-17fix links in readmeMax Audron-2/+2
Max Audron-32/+69
2021-06-05remove tanka vendoringMax Audron-27651/+0
2021-05-26Release 1.0.1Max Audron-3/+3
2021-05-26fix log breaking once buffer fullMax Audron-2/+33
the log_msg function was poping the newest message and replacing it with the newest message, it should be poping the oldest messages.
2021-05-16add deployment stuffMax Audron-6/+27786
2021-05-15add container buildMax Audron-2/+35