From a5dde188999904f7b4c64658afbf4a9bf8bf1a35 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Sun, 8 Nov 2020 21:43:18 +0000 Subject: [PATCH] Update to the latest matrix SDK, and fix the Cargo.toml entry. By using rev instead of branch, we were somehow stuck on a very old version of the SDK. The dependency has now been switched to branch instead of rev, and the SDK updates properly to latest master when carg update is called. --- .#.drone.yml | 1 - Cargo.lock | 356 +++++++++++++++++++++++++++++++++++++++++---------- Cargo.toml | 3 +- src/bot.rs | 23 +--- 4 files changed, 293 insertions(+), 90 deletions(-) delete mode 120000 .#.drone.yml diff --git a/.#.drone.yml b/.#.drone.yml deleted file mode 120000 index 29f53d9..0000000 --- a/.#.drone.yml +++ /dev/null @@ -1 +0,0 @@ -jeff@seraph.10585:1603007115 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 0ecf6a3..69c937e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,39 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "aes-ctr" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c3b03608ea1c077228520a167cca2514dc7cd8100a81b30a2b38be985234e5" +dependencies = [ + "aes-soft", + "aesni", + "ctr", + "stream-cipher", +] + +[[package]] +name = "aes-soft" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63dd91889c49327ad7ef3b500fd1109dbd3c509a03db0d4a9ce413b79f575cb6" +dependencies = [ + "block-cipher", + "byteorder", + "opaque-debug", +] + +[[package]] +name = "aesni" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a4d655ae633a96d0acaf0fd7e76aafb8ca5732739bba37aac6f882c8fce656" +dependencies = [ + "block-cipher", + "opaque-debug", + "stream-cipher", +] + [[package]] name = "ahash" version = "0.3.8" @@ -11,19 +45,13 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.14" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b476ce7103678b0c6d3d395dbbae31d48ff910bd28be979ba5d48c6351131d0d" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" dependencies = [ "memchr", ] -[[package]] -name = "arc-swap" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" - [[package]] name = "arrayref" version = "0.3.6" @@ -120,9 +148,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "base-x" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" [[package]] name = "base64" @@ -130,6 +158,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + [[package]] name = "bincode" version = "1.3.1" @@ -148,15 +182,33 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "blake2b_simd" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" dependencies = [ "arrayref", "arrayvec", "constant_time_eq", ] +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-cipher" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f337a3e6da609650eb74e02bc9fac7b735049f7623ab12f2e4c719316fcc7e80" +dependencies = [ + "generic-array", +] + [[package]] name = "bumpalo" version = "3.4.0" @@ -177,9 +229,9 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "cc" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" +checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40" [[package]] name = "cfg-if" @@ -210,7 +262,6 @@ dependencies = [ "matrix-sdk", "memmem", "nom", - "olm-sys", "phf", "rand 0.7.3", "serde", @@ -294,9 +345,9 @@ dependencies = [ [[package]] name = "const_fn" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" +checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" [[package]] name = "constant_time_eq" @@ -306,9 +357,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "core-foundation" -version = "0.7.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" dependencies = [ "core-foundation-sys", "libc", @@ -316,9 +367,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" + +[[package]] +name = "cpuid-bool" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "crc32fast" @@ -366,6 +423,25 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "crypto-mac" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bcd97a54c7ca5ce2f6eb16f6bede5b0ab5f0055fedc17d2f0b4466e21671ca" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc03dee3a2843ac6eb4b5fb39cfcf4cb034d078555d1f4a0afbed418b822f3c2" +dependencies = [ + "stream-cipher", +] + [[package]] name = "dashmap" version = "3.11.10" @@ -377,6 +453,15 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + [[package]] name = "dirs" version = "3.0.1" @@ -423,11 +508,11 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.24" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a51b8cf747471cb9499b6d59e59b0444f4c90eba8968c4e44874e92b5b64ace2" +checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -556,8 +641,9 @@ checksum = "6e1798854a4727ff944a7b12aa999f58ce7aa81db80d2dfaaf2ba06f065ddd2b" [[package]] name = "futures-locks" -version = "0.6.1-pre" -source = "git+https://github.com/asomers/futures-locks#908226deac658e020436e54d66680ff736e5a2b4" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c4e684ddb2d8a4db5ca8a02b35156da129674ba4412b6f528698d58c594954" dependencies = [ "futures", ] @@ -628,6 +714,16 @@ dependencies = [ "byteorder", ] +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.1.15" @@ -714,6 +810,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +[[package]] +name = "hmac" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deae6d9dbb35ec2c502d62b8f7b1c000a0822c3b0794ba36b3149c0a1c840dff" +dependencies = [ + "crypto-mac", + "digest", +] + [[package]] name = "http" version = "0.2.1" @@ -758,9 +864,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.13.8" +version = "0.13.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3afcfae8af5ad0576a31e768415edb627824129e8e5a29b8bfccb2f234e835" +checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" dependencies = [ "bytes", "futures-channel", @@ -772,7 +878,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project 0.4.27", + "pin-project 1.0.1", "socket2", "tokio", "tower-service", @@ -963,7 +1069,7 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "matrix-sdk" version = "0.1.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed" +source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" dependencies = [ "async-trait", "dashmap", @@ -972,18 +1078,21 @@ dependencies = [ "matrix-sdk-base", "matrix-sdk-common", "matrix-sdk-common-macros", + "mime", "reqwest", "serde_json", "thiserror", + "tokio", "tracing", "tracing-futures", "url", + "zeroize", ] [[package]] name = "matrix-sdk-base" version = "0.1.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed" +source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" dependencies = [ "async-trait", "matrix-sdk-common", @@ -1000,7 +1109,7 @@ dependencies = [ [[package]] name = "matrix-sdk-common" version = "0.1.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed" +source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" dependencies = [ "assign", "futures-locks", @@ -1014,7 +1123,7 @@ dependencies = [ [[package]] name = "matrix-sdk-common-macros" version = "0.1.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed" +source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" dependencies = [ "quote 1.0.7", "syn 1.0.48", @@ -1023,17 +1132,24 @@ dependencies = [ [[package]] name = "matrix-sdk-crypto" version = "0.1.0" -source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed" +source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" dependencies = [ + "aes-ctr", "async-trait", "atomic", + "base64 0.13.0", + "byteorder", "cjson", "dashmap", + "getrandom 0.2.0", + "hmac", "matrix-sdk-common", "matrix-sdk-common-macros", "olm-rs", + "pbkdf2", "serde", "serde_json", + "sha2", "sqlx", "thiserror", "tracing", @@ -1151,9 +1267,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" +checksum = "1a1cda389c26d6b88f3d2dc38aa1b750fe87d298cc5d795ec9e975f402f00372" dependencies = [ "lazy_static", "libc", @@ -1202,7 +1318,8 @@ dependencies = [ [[package]] name = "olm-rs" version = "1.0.0" -source = "git+https://gitlab.gnome.org/jhaye/olm-rs/#69df675ccb90982eb28f78dfc191c943a42fa211" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daab4abdd728e5e77ec15888fc12688c0b821c81fca621f1bb28dbe489cbc404" dependencies = [ "getrandom 0.2.0", "olm-sys", @@ -1226,6 +1343,12 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "openssl" version = "0.10.30" @@ -1285,6 +1408,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "pbkdf2" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170d73bf11f39b4ce1809aabc95bf5c33564cdc16fc3200ddda17a5f6e5e48b" +dependencies = [ + "crypto-mac", +] + [[package]] name = "percent-encoding" version = "2.1.0" @@ -1393,9 +1525,9 @@ checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "ppv-lite86" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "proc-macro-crate" @@ -1635,9 +1767,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b" +checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" dependencies = [ "aho-corasick", "memchr", @@ -1647,9 +1779,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.20" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c" +checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" [[package]] name = "remove_dir_all" @@ -1666,7 +1798,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e" dependencies = [ - "base64", + "base64 0.12.3", "bytes", "encoding_rs", "futures-core", @@ -1698,12 +1830,16 @@ dependencies = [ [[package]] name = "ruma" version = "0.0.1" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ + "assign", + "js_int", "ruma-api", + "ruma-appservice-api", "ruma-client-api", "ruma-common", "ruma-events", + "ruma-federation-api", "ruma-identifiers", "ruma-serde", ] @@ -1711,22 +1847,24 @@ dependencies = [ [[package]] name = "ruma-api" version = "0.17.0-alpha.1" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "http", "percent-encoding", "ruma-api-macros", + "ruma-common", "ruma-identifiers", "ruma-serde", "serde", "serde_json", "strum", + "thiserror", ] [[package]] name = "ruma-api-macros" version = "0.17.0-alpha.1" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -1734,14 +1872,28 @@ dependencies = [ "syn 1.0.48", ] +[[package]] +name = "ruma-appservice-api" +version = "0.2.0-alpha.1" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" +dependencies = [ + "ruma-api", + "ruma-common", + "ruma-events", + "ruma-identifiers", + "serde", + "serde_json", +] + [[package]] name = "ruma-client-api" version = "0.10.0-alpha.1" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "assign", "http", "js_int", + "maplit", "percent-encoding", "ruma-api", "ruma-common", @@ -1756,10 +1908,10 @@ dependencies = [ [[package]] name = "ruma-common" version = "0.2.0" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "js_int", - "ruma-api", + "ruma-common-macros", "ruma-identifiers", "ruma-serde", "serde", @@ -1767,10 +1919,21 @@ dependencies = [ "strum", ] +[[package]] +name = "ruma-common-macros" +version = "0.2.0" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" +dependencies = [ + "proc-macro-crate", + "proc-macro2 1.0.24", + "quote 1.0.7", + "syn 1.0.48", +] + [[package]] name = "ruma-events" version = "0.22.0-alpha.1" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "js_int", "ruma-common", @@ -1785,7 +1948,7 @@ dependencies = [ [[package]] name = "ruma-events-macros" version = "0.22.0-alpha.1" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -1793,10 +1956,25 @@ dependencies = [ "syn 1.0.48", ] +[[package]] +name = "ruma-federation-api" +version = "0.0.3" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" +dependencies = [ + "js_int", + "ruma-api", + "ruma-common", + "ruma-events", + "ruma-identifiers", + "ruma-serde", + "serde", + "serde_json", +] + [[package]] name = "ruma-identifiers" version = "0.17.4" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "ruma-identifiers-macros", "ruma-identifiers-validation", @@ -1807,7 +1985,7 @@ dependencies = [ [[package]] name = "ruma-identifiers-macros" version = "0.17.4" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.7", @@ -1818,7 +1996,7 @@ dependencies = [ [[package]] name = "ruma-identifiers-validation" version = "0.1.1" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "serde", "strum", @@ -1827,7 +2005,7 @@ dependencies = [ [[package]] name = "ruma-serde" version = "0.2.3" -source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30" +source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" dependencies = [ "form_urlencoded", "itoa", @@ -1842,7 +2020,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19" dependencies = [ - "base64", + "base64 0.12.3", "blake2b_simd", "constant_time_eq", "crossbeam-utils", @@ -1881,9 +2059,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" -version = "0.4.4" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" +checksum = "c1759c2e3c8580017a484a7ac56d3abc5a6c1feadf88db2f3633f12ae4268c69" dependencies = [ "bitflags", "core-foundation", @@ -1894,9 +2072,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "0.4.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" +checksum = "f99b9d5e26d2a71633cc4f2ebae7cc9f874044e0c351a27e17892d76dce5678b" dependencies = [ "core-foundation-sys", "libc", @@ -1973,12 +2151,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] -name = "signal-hook-registry" -version = "1.2.1" +name = "sha2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" +checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8" +dependencies = [ + "block-buffer", + "cfg-if 1.0.0", + "cpuid-bool", + "digest", + "opaque-debug", +] + +[[package]] +name = "signal-hook-registry" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce32ea0c6c56d5eacaeb814fbed9960547021d3edd010ded1425f180536b20ab" dependencies = [ - "arc-swap", "libc", ] @@ -2157,6 +2347,16 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" +[[package]] +name = "stream-cipher" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c80e15f898d8d8f25db24c253ea615cc14acf418ff307822995814e7d42cfa89" +dependencies = [ + "block-cipher", + "generic-array", +] + [[package]] name = "strum" version = "0.19.5" @@ -2178,6 +2378,12 @@ dependencies = [ "syn 1.0.48", ] +[[package]] +name = "subtle" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd" + [[package]] name = "syn" version = "0.15.44" @@ -2237,18 +2443,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" +checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" +checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.7", @@ -2431,6 +2637,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" + [[package]] name = "unicase" version = "2.6.0" @@ -2484,10 +2696,11 @@ checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7" [[package]] name = "url" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" dependencies = [ + "form_urlencoded", "idna", "matches", "percent-encoding", @@ -2500,6 +2713,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" dependencies = [ "rand 0.7.3", + "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 54a8804..5a99468 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,8 +30,7 @@ futures = "0.3" memmem = "0.1" bincode = "1.3" phf = { version = "0.7", features = ["macros"] } -olm-sys = "1.0" -matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "master" } +matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk", branch = "master" } [dependencies.serde] version = "1" diff --git a/src/bot.rs b/src/bot.rs index 6d23c63..a687551 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -99,20 +99,11 @@ impl DiceBot { info!("Logged in as {}", username); - //If the local json store has not been created yet, we need to do a single initial sync. - //It stores data under username's localpart. - let should_sync = { - let mut cache = cache_dir()?; - cache.push(username); - !cache.exists() - }; + // Initial sync without event handler prevents responding to + // messages received while bot was offline. TODO: selectively + // respond to old messages? e.g. comands missed while offline. + self.client.sync_once(SyncSettings::default()).await?; - if should_sync { - info!("Performing initial sync"); - self.client.sync(SyncSettings::default()).await?; - } - - //Attach event handler. client.add_event_emitter(Box::new(self)).await; info!("Listening for commands"); @@ -123,9 +114,9 @@ impl DiceBot { let settings = SyncSettings::default().token(token); - //this keeps state from the server streaming in to the dice bot via the EventEmitter trait - //TODO somehow figure out how to "sync_until" instead of sync_forever... copy code and modify? - client.sync_forever(settings, |_| async {}).await; + // TODO replace with sync_with_callback for cleaner shutdown + // process. + client.sync(settings).await; Ok(()) }