Compare commits

..

No commits in common. "5ce79a3c0560a54a417268e8d7ea1bc10243dcc1" and "09278a80b57ac204387f396d4d8357c92f78a607" have entirely different histories.

5 changed files with 89 additions and 293 deletions

1
.#.drone.yml Symbolic link
View File

@ -0,0 +1 @@
jeff@seraph.10585:1603007115

1
.gitignore vendored
View File

@ -9,4 +9,3 @@ test-db/
bot-db* bot-db*
# We store a disabled async test in this file # We store a disabled async test in this file
bigboy bigboy
.#*

354
Cargo.lock generated
View File

@ -1,39 +1,5 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # 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]] [[package]]
name = "ahash" name = "ahash"
version = "0.3.8" version = "0.3.8"
@ -45,13 +11,19 @@ dependencies = [
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.7.15" version = "0.7.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" checksum = "b476ce7103678b0c6d3d395dbbae31d48ff910bd28be979ba5d48c6351131d0d"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "arc-swap"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
[[package]] [[package]]
name = "arrayref" name = "arrayref"
version = "0.3.6" version = "0.3.6"
@ -148,9 +120,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]] [[package]]
name = "base-x" name = "base-x"
version = "0.2.8" version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1"
[[package]] [[package]]
name = "base64" name = "base64"
@ -158,12 +130,6 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
[[package]]
name = "base64"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]] [[package]]
name = "bincode" name = "bincode"
version = "1.3.1" version = "1.3.1"
@ -182,33 +148,15 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]] [[package]]
name = "blake2b_simd" name = "blake2b_simd"
version = "0.5.11" version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a"
dependencies = [ dependencies = [
"arrayref", "arrayref",
"arrayvec", "arrayvec",
"constant_time_eq", "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]] [[package]]
name = "bumpalo" name = "bumpalo"
version = "3.4.0" version = "3.4.0"
@ -229,9 +177,9 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.62" version = "1.0.61"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40" checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
@ -262,6 +210,7 @@ dependencies = [
"matrix-sdk", "matrix-sdk",
"memmem", "memmem",
"nom", "nom",
"olm-sys",
"phf", "phf",
"rand 0.7.3", "rand 0.7.3",
"serde", "serde",
@ -345,9 +294,9 @@ dependencies = [
[[package]] [[package]]
name = "const_fn" name = "const_fn"
version = "0.4.3" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2"
[[package]] [[package]]
name = "constant_time_eq" name = "constant_time_eq"
@ -357,9 +306,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.9.1" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
dependencies = [ dependencies = [
"core-foundation-sys", "core-foundation-sys",
"libc", "libc",
@ -367,15 +316,9 @@ dependencies = [
[[package]] [[package]]
name = "core-foundation-sys" name = "core-foundation-sys"
version = "0.8.2" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
[[package]]
name = "cpuid-bool"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
[[package]] [[package]]
name = "crc32fast" name = "crc32fast"
@ -423,25 +366,6 @@ dependencies = [
"lazy_static", "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]] [[package]]
name = "dashmap" name = "dashmap"
version = "3.11.10" version = "3.11.10"
@ -453,15 +377,6 @@ dependencies = [
"num_cpus", "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]] [[package]]
name = "dirs" name = "dirs"
version = "3.0.1" version = "3.0.1"
@ -508,11 +423,11 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]] [[package]]
name = "encoding_rs" name = "encoding_rs"
version = "0.8.26" version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" checksum = "a51b8cf747471cb9499b6d59e59b0444f4c90eba8968c4e44874e92b5b64ace2"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 0.1.10",
] ]
[[package]] [[package]]
@ -641,9 +556,8 @@ checksum = "6e1798854a4727ff944a7b12aa999f58ce7aa81db80d2dfaaf2ba06f065ddd2b"
[[package]] [[package]]
name = "futures-locks" name = "futures-locks"
version = "0.6.0" version = "0.6.1-pre"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/asomers/futures-locks#908226deac658e020436e54d66680ff736e5a2b4"
checksum = "50c4e684ddb2d8a4db5ca8a02b35156da129674ba4412b6f528698d58c594954"
dependencies = [ dependencies = [
"futures", "futures",
] ]
@ -714,16 +628,6 @@ dependencies = [
"byteorder", "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]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.1.15" version = "0.1.15"
@ -810,16 +714,6 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" 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]] [[package]]
name = "http" name = "http"
version = "0.2.1" version = "0.2.1"
@ -864,9 +758,9 @@ dependencies = [
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "0.13.9" version = "0.13.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" checksum = "2f3afcfae8af5ad0576a31e768415edb627824129e8e5a29b8bfccb2f234e835"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
@ -878,7 +772,7 @@ dependencies = [
"httparse", "httparse",
"httpdate", "httpdate",
"itoa", "itoa",
"pin-project 1.0.1", "pin-project 0.4.27",
"socket2", "socket2",
"tokio", "tokio",
"tower-service", "tower-service",
@ -1069,7 +963,7 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
[[package]] [[package]]
name = "matrix-sdk" name = "matrix-sdk"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"dashmap", "dashmap",
@ -1078,21 +972,18 @@ dependencies = [
"matrix-sdk-base", "matrix-sdk-base",
"matrix-sdk-common", "matrix-sdk-common",
"matrix-sdk-common-macros", "matrix-sdk-common-macros",
"mime",
"reqwest", "reqwest",
"serde_json", "serde_json",
"thiserror", "thiserror",
"tokio",
"tracing", "tracing",
"tracing-futures", "tracing-futures",
"url", "url",
"zeroize",
] ]
[[package]] [[package]]
name = "matrix-sdk-base" name = "matrix-sdk-base"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"matrix-sdk-common", "matrix-sdk-common",
@ -1109,7 +1000,7 @@ dependencies = [
[[package]] [[package]]
name = "matrix-sdk-common" name = "matrix-sdk-common"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed"
dependencies = [ dependencies = [
"assign", "assign",
"futures-locks", "futures-locks",
@ -1123,7 +1014,7 @@ dependencies = [
[[package]] [[package]]
name = "matrix-sdk-common-macros" name = "matrix-sdk-common-macros"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed"
dependencies = [ dependencies = [
"quote 1.0.7", "quote 1.0.7",
"syn 1.0.48", "syn 1.0.48",
@ -1132,24 +1023,17 @@ dependencies = [
[[package]] [[package]]
name = "matrix-sdk-crypto" name = "matrix-sdk-crypto"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/matrix-org/matrix-rust-sdk#8f99180c99ccd74803565fb36098389198091ded" source = "git+https://github.com/matrix-org/matrix-rust-sdk?rev=master#6872cc717b8b7746ea4c4bec8d143e8653f965ed"
dependencies = [ dependencies = [
"aes-ctr",
"async-trait", "async-trait",
"atomic", "atomic",
"base64 0.13.0",
"byteorder",
"cjson", "cjson",
"dashmap", "dashmap",
"getrandom 0.2.0",
"hmac",
"matrix-sdk-common", "matrix-sdk-common",
"matrix-sdk-common-macros", "matrix-sdk-common-macros",
"olm-rs", "olm-rs",
"pbkdf2",
"serde", "serde",
"serde_json", "serde_json",
"sha2",
"sqlx", "sqlx",
"thiserror", "thiserror",
"tracing", "tracing",
@ -1267,9 +1151,9 @@ dependencies = [
[[package]] [[package]]
name = "native-tls" name = "native-tls"
version = "0.2.5" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a1cda389c26d6b88f3d2dc38aa1b750fe87d298cc5d795ec9e975f402f00372" checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"libc", "libc",
@ -1318,8 +1202,7 @@ dependencies = [
[[package]] [[package]]
name = "olm-rs" name = "olm-rs"
version = "1.0.0" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://gitlab.gnome.org/jhaye/olm-rs/#69df675ccb90982eb28f78dfc191c943a42fa211"
checksum = "daab4abdd728e5e77ec15888fc12688c0b821c81fca621f1bb28dbe489cbc404"
dependencies = [ dependencies = [
"getrandom 0.2.0", "getrandom 0.2.0",
"olm-sys", "olm-sys",
@ -1343,12 +1226,6 @@ version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
[[package]]
name = "opaque-debug"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]] [[package]]
name = "openssl" name = "openssl"
version = "0.10.30" version = "0.10.30"
@ -1408,15 +1285,6 @@ dependencies = [
"winapi 0.3.9", "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]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.1.0" version = "2.1.0"
@ -1525,9 +1393,9 @@ checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
[[package]] [[package]]
name = "ppv-lite86" name = "ppv-lite86"
version = "0.2.10" version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
[[package]] [[package]]
name = "proc-macro-crate" name = "proc-macro-crate"
@ -1767,9 +1635,9 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.4.2" version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -1779,9 +1647,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.6.21" version = "0.6.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c"
[[package]] [[package]]
name = "remove_dir_all" name = "remove_dir_all"
@ -1798,7 +1666,7 @@ version = "0.10.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e" checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e"
dependencies = [ dependencies = [
"base64 0.12.3", "base64",
"bytes", "bytes",
"encoding_rs", "encoding_rs",
"futures-core", "futures-core",
@ -1830,16 +1698,12 @@ dependencies = [
[[package]] [[package]]
name = "ruma" name = "ruma"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"assign",
"js_int",
"ruma-api", "ruma-api",
"ruma-appservice-api",
"ruma-client-api", "ruma-client-api",
"ruma-common", "ruma-common",
"ruma-events", "ruma-events",
"ruma-federation-api",
"ruma-identifiers", "ruma-identifiers",
"ruma-serde", "ruma-serde",
] ]
@ -1847,24 +1711,22 @@ dependencies = [
[[package]] [[package]]
name = "ruma-api" name = "ruma-api"
version = "0.17.0-alpha.1" version = "0.17.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"http", "http",
"percent-encoding", "percent-encoding",
"ruma-api-macros", "ruma-api-macros",
"ruma-common",
"ruma-identifiers", "ruma-identifiers",
"ruma-serde", "ruma-serde",
"serde", "serde",
"serde_json", "serde_json",
"strum", "strum",
"thiserror",
] ]
[[package]] [[package]]
name = "ruma-api-macros" name = "ruma-api-macros"
version = "0.17.0-alpha.1" version = "0.17.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2 1.0.24", "proc-macro2 1.0.24",
@ -1872,28 +1734,14 @@ dependencies = [
"syn 1.0.48", "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]] [[package]]
name = "ruma-client-api" name = "ruma-client-api"
version = "0.10.0-alpha.1" version = "0.10.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"assign", "assign",
"http", "http",
"js_int", "js_int",
"maplit",
"percent-encoding", "percent-encoding",
"ruma-api", "ruma-api",
"ruma-common", "ruma-common",
@ -1908,10 +1756,10 @@ dependencies = [
[[package]] [[package]]
name = "ruma-common" name = "ruma-common"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"js_int", "js_int",
"ruma-common-macros", "ruma-api",
"ruma-identifiers", "ruma-identifiers",
"ruma-serde", "ruma-serde",
"serde", "serde",
@ -1919,21 +1767,10 @@ dependencies = [
"strum", "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]] [[package]]
name = "ruma-events" name = "ruma-events"
version = "0.22.0-alpha.1" version = "0.22.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"js_int", "js_int",
"ruma-common", "ruma-common",
@ -1948,7 +1785,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-events-macros" name = "ruma-events-macros"
version = "0.22.0-alpha.1" version = "0.22.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2 1.0.24", "proc-macro2 1.0.24",
@ -1956,25 +1793,10 @@ dependencies = [
"syn 1.0.48", "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]] [[package]]
name = "ruma-identifiers" name = "ruma-identifiers"
version = "0.17.4" version = "0.17.4"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"ruma-identifiers-macros", "ruma-identifiers-macros",
"ruma-identifiers-validation", "ruma-identifiers-validation",
@ -1985,7 +1807,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-identifiers-macros" name = "ruma-identifiers-macros"
version = "0.17.4" version = "0.17.4"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"proc-macro2 1.0.24", "proc-macro2 1.0.24",
"quote 1.0.7", "quote 1.0.7",
@ -1996,7 +1818,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-identifiers-validation" name = "ruma-identifiers-validation"
version = "0.1.1" version = "0.1.1"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"serde", "serde",
"strum", "strum",
@ -2005,7 +1827,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-serde" name = "ruma-serde"
version = "0.2.3" version = "0.2.3"
source = "git+https://github.com/ruma/ruma?rev=50eb700571480d1440e15a387d10f98be8abab59#50eb700571480d1440e15a387d10f98be8abab59" source = "git+https://github.com/ruma/ruma?rev=409fbcc9d745fb7290327cb7f5defc714229ab30#409fbcc9d745fb7290327cb7f5defc714229ab30"
dependencies = [ dependencies = [
"form_urlencoded", "form_urlencoded",
"itoa", "itoa",
@ -2020,7 +1842,7 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19" checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19"
dependencies = [ dependencies = [
"base64 0.12.3", "base64",
"blake2b_simd", "blake2b_simd",
"constant_time_eq", "constant_time_eq",
"crossbeam-utils", "crossbeam-utils",
@ -2059,9 +1881,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]] [[package]]
name = "security-framework" name = "security-framework"
version = "2.0.0" version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1759c2e3c8580017a484a7ac56d3abc5a6c1feadf88db2f3633f12ae4268c69" checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"core-foundation", "core-foundation",
@ -2072,9 +1894,9 @@ dependencies = [
[[package]] [[package]]
name = "security-framework-sys" name = "security-framework-sys"
version = "2.0.0" version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f99b9d5e26d2a71633cc4f2ebae7cc9f874044e0c351a27e17892d76dce5678b" checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405"
dependencies = [ dependencies = [
"core-foundation-sys", "core-foundation-sys",
"libc", "libc",
@ -2150,25 +1972,13 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
[[package]]
name = "sha2"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8"
dependencies = [
"block-buffer",
"cfg-if 1.0.0",
"cpuid-bool",
"digest",
"opaque-debug",
]
[[package]] [[package]]
name = "signal-hook-registry" name = "signal-hook-registry"
version = "1.2.2" version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce32ea0c6c56d5eacaeb814fbed9960547021d3edd010ded1425f180536b20ab" checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035"
dependencies = [ dependencies = [
"arc-swap",
"libc", "libc",
] ]
@ -2347,16 +2157,6 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" 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]] [[package]]
name = "strum" name = "strum"
version = "0.19.5" version = "0.19.5"
@ -2378,12 +2178,6 @@ dependencies = [
"syn 1.0.48", "syn 1.0.48",
] ]
[[package]]
name = "subtle"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd"
[[package]] [[package]]
name = "syn" name = "syn"
version = "0.15.44" version = "0.15.44"
@ -2443,18 +2237,18 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.22" version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.22" version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab"
dependencies = [ dependencies = [
"proc-macro2 1.0.24", "proc-macro2 1.0.24",
"quote 1.0.7", "quote 1.0.7",
@ -2637,12 +2431,6 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
[[package]]
name = "typenum"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
[[package]] [[package]]
name = "unicase" name = "unicase"
version = "2.6.0" version = "2.6.0"
@ -2696,11 +2484,10 @@ checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7"
[[package]] [[package]]
name = "url" name = "url"
version = "2.2.0" version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb"
dependencies = [ dependencies = [
"form_urlencoded",
"idna", "idna",
"matches", "matches",
"percent-encoding", "percent-encoding",
@ -2713,7 +2500,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11"
dependencies = [ dependencies = [
"rand 0.7.3", "rand 0.7.3",
"serde",
] ]
[[package]] [[package]]

View File

@ -30,7 +30,8 @@ futures = "0.3"
memmem = "0.1" memmem = "0.1"
bincode = "1.3" bincode = "1.3"
phf = { version = "0.7", features = ["macros"] } phf = { version = "0.7", features = ["macros"] }
matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk", branch = "master" } olm-sys = "1.0"
matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "master" }
[dependencies.serde] [dependencies.serde]
version = "1" version = "1"

View File

@ -99,11 +99,20 @@ impl DiceBot {
info!("Logged in as {}", username); info!("Logged in as {}", username);
// Initial sync without event handler prevents responding to //If the local json store has not been created yet, we need to do a single initial sync.
// messages received while bot was offline. TODO: selectively //It stores data under username's localpart.
// respond to old messages? e.g. comands missed while offline. let should_sync = {
self.client.sync_once(SyncSettings::default()).await?; let mut cache = cache_dir()?;
cache.push(username);
!cache.exists()
};
if should_sync {
info!("Performing initial sync");
self.client.sync(SyncSettings::default()).await?;
}
//Attach event handler.
client.add_event_emitter(Box::new(self)).await; client.add_event_emitter(Box::new(self)).await;
info!("Listening for commands"); info!("Listening for commands");
@ -114,9 +123,9 @@ impl DiceBot {
let settings = SyncSettings::default().token(token); let settings = SyncSettings::default().token(token);
// TODO replace with sync_with_callback for cleaner shutdown //this keeps state from the server streaming in to the dice bot via the EventEmitter trait
// process. //TODO somehow figure out how to "sync_until" instead of sync_forever... copy code and modify?
client.sync(settings).await; client.sync_forever(settings, |_| async {}).await;
Ok(()) Ok(())
} }