From 6f09a11586982df133b4c03dfc42ef902f0a5642 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Sun, 19 Sep 2021 14:16:29 +0000 Subject: [PATCH] Upgrade to matrix SDK 0.4. --- Cargo.lock | 715 +++++++++++---------------- dicebot/Cargo.toml | 2 +- dicebot/src/bin/dicebot-cmd.rs | 2 +- dicebot/src/bot/command_execution.rs | 8 +- dicebot/src/bot/event_handlers.rs | 112 ++--- dicebot/src/bot/mod.rs | 27 +- dicebot/src/cofd/dice.rs | 2 +- dicebot/src/commands/mod.rs | 4 +- dicebot/src/commands/rooms.rs | 2 +- dicebot/src/context.rs | 2 +- dicebot/src/cthulhu/dice.rs | 2 +- dicebot/src/error.rs | 5 +- dicebot/src/matrix.rs | 19 +- dicebot/src/rpc/service.rs | 3 +- 14 files changed, 381 insertions(+), 524 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6796e62..b7726d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,7 +31,7 @@ checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if", "cipher", - "cpufeatures 0.2.1", + "cpufeatures", "ctr", "opaque-debug", ] @@ -52,9 +52,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ "getrandom 0.2.3", "once_cell", @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.43" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf" +checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" [[package]] name = "arrayref" @@ -119,9 +119,9 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] @@ -130,9 +130,9 @@ version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] @@ -179,12 +179,6 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d67c978b1322c8031145b1f6c236fc371292f52c565bc96018b2971afcbffe1" -[[package]] -name = "base-x" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" - [[package]] name = "base64" version = "0.13.0" @@ -219,9 +213,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "bytemuck" @@ -243,9 +237,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -255,21 +249,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chacha20" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee7ad89dc1128635074c268ee661f90c3f7e83d9fd12910608c36b47d6c3412" +checksum = "01b72a433d0cf2aef113ba70f62634c56fddb0f244e6377185c56a7cadbd8f91" dependencies = [ "cfg-if", "cipher", - "cpufeatures 0.1.5", + "cpufeatures", "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1580317203210c517b6d44794abfbe600698276db18127e37ad3e69bf5e848e5" +checksum = "3b84ed6d1d5f7aa9bdde921a5090e0ca4d934d250ea3b402a5fab3a994e28a2a" dependencies = [ "aead", "chacha20", @@ -293,7 +287,7 @@ dependencies = [ "libc", "num-integer", "num-traits", - "time 0.1.43", + "time", "winapi", ] @@ -308,9 +302,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" +checksum = "b7b858541263efe664aead4a5209a4ae5c5d2811167d4ed4ee0944503f8d2089" dependencies = [ "cc", ] @@ -323,9 +317,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "combine" -version = "4.6.1" +version = "4.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a909e4d93292cd8e9c42e189f61681eff9d67b6541f96b8a1a737f23737bd001" +checksum = "b2b2f5d0ee456f3928812dfc8c6d9a1d592b98678f6d56db9b0cd2b7bc6c8db5" dependencies = [ "bytes", "memchr", @@ -333,15 +327,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c32f031ea41b4291d695026c023b95d59db2d8a2c7640800ed56bc8f510f22" - -[[package]] -name = "const_fn" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7" +checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" [[package]] name = "constant_time_eq" @@ -351,9 +339,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ "core-foundation-sys", "libc", @@ -361,18 +349,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" - -[[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" -dependencies = [ - "libc", -] +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" @@ -385,9 +364,9 @@ dependencies = [ [[package]] name = "crc" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c2722795460108a7872e1cd933a85d6ec38abc4baecad51028f702da28889f" +checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" dependencies = [ "crc-catalog", ] @@ -515,9 +494,9 @@ dependencies = [ [[package]] name = "der" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e21d2d0f22cde6e88694108429775c0219760a07779bf96503b434a03d7412" +checksum = "28e98c534e9c8a0483aa01d6f6913bc063de254311bd267c9cf535e9b70e15b2" dependencies = [ "const-oid", ] @@ -551,12 +530,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - [[package]] name = "dotenv" version = "0.15.0" @@ -597,13 +570,19 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.28" +version = "0.8.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" +checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746" dependencies = [ "cfg-if", ] +[[package]] +name = "event-listener" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" + [[package]] name = "fallible-iterator" version = "0.2.0" @@ -758,9 +737,9 @@ checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" dependencies = [ "autocfg", "proc-macro-hack", - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] @@ -889,9 +868,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a668f699973d0f573d15749b7002a9ac9e1f9c6b220e7b165601334c173d8de" +checksum = "c3a7187e78088aead22ceedeee99779455b23fc231fe13ec443f99bb71694e5b" dependencies = [ "color_quant", "weezl", @@ -912,9 +891,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.4" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f3675cfef6a30c8031cf9e6493ebdc3bb3272a3fea3923c4210d1830e6a472" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ "bytes", "fnv", @@ -1007,16 +986,16 @@ dependencies = [ "log", "mac", "markup5ever", - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] name = "http" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" +checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" dependencies = [ "bytes", "fnv", @@ -1025,9 +1004,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes", "http", @@ -1048,9 +1027,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.12" +version = "0.14.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13f67199e765030fa08fe0bd581af683f0d5bc04ea09c2b1102012c5fb90e7fd" +checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" dependencies = [ "bytes", "futures-channel", @@ -1135,13 +1114,12 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", "js-sys", - "time 0.2.27", "wasm-bindgen", "web-sys", ] @@ -1187,9 +1165,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.53" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4bf49d50e2961077d9c99f4b7997d770a1114f087c3c2e0069b36c13fc2979d" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ "wasm-bindgen", ] @@ -1224,9 +1202,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.101" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb00336871be5ed2c8ed44b60ae9959dc5b9f08539422ed43f09e34ecaeba21" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "libsqlite3-sys" @@ -1321,9 +1299,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "matrix-qrcode" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "292c022b5b3d2f6fe39095497b27f4ec5cbcc6e55d0b20c0c01b8bde07f3f419" +checksum = "4231739aa2ff90c6c55b07d7179c52b496622a86fc2f7e0431336d109ba7838d" dependencies = [ "base64", "byteorder", @@ -1336,13 +1314,14 @@ dependencies = [ [[package]] name = "matrix-sdk" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a9dcccddd5d1e7b13304169021404015fd40a95f56bd895319e9447f7784e6" +checksum = "5834b96fef26d6d61c8ffd21dda3569c7c0fc688f9cc8aebd35f6f8c3068a186" dependencies = [ "backoff", "bytes", "dashmap", + "event-listener", "futures", "futures-timer", "http", @@ -1351,6 +1330,7 @@ dependencies = [ "mime", "reqwest", "ruma", + "serde", "serde_json", "thiserror", "tokio", @@ -1362,9 +1342,9 @@ dependencies = [ [[package]] name = "matrix-sdk-base" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96e360288b4acb062e4cb3e2952d49b2a93e256438ec749bfffdef701bd0abd0" +checksum = "b97c4d675ff70395c1b0cd94fae869cea4efd3f148b74bf4186e969ee622a9c7" dependencies = [ "chacha20poly1305", "dashmap", @@ -1388,9 +1368,9 @@ dependencies = [ [[package]] name = "matrix-sdk-common" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f595bd52c35ce962ecf52875c5b659f3845cb00b35dd205c7ae62e2b7bdad38" +checksum = "31c004ca5d02a17eb827a2c3d8e34c9a84c075b42cfed7022895ba6418372ea5" dependencies = [ "async-trait", "futures", @@ -1405,9 +1385,9 @@ dependencies = [ [[package]] name = "matrix-sdk-crypto" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "207af21203f5d1787426dbb89c13dc791515448086f098c52ecb9bc591a5b621" +checksum = "d36626b188e0ea1d244eef6fe39ab1758c401de6ec84d0389df88f9f6ad761b9" dependencies = [ "aes", "aes-gcm", @@ -1455,9 +1435,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "minimal-lexical" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c835948974f68e0bd58636fc6c5b1fbff7b297e3046f11b3b3c18bbac012c6d" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" @@ -1480,9 +1460,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -1543,9 +1523,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" +checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" dependencies = [ "memchr", "minimal-lexical", @@ -1614,9 +1594,9 @@ dependencies = [ [[package]] name = "olm-rs" -version = "1.0.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8962a1fc909accf520991dcda872888554ecf16320097e02d3bd9981844a24ae" +checksum = "33a5773f317476f5687fc8200fc0120d97b075c30c133a5b15ca558252743720" dependencies = [ "getrandom 0.2.3", "olm-sys", @@ -1627,9 +1607,9 @@ dependencies = [ [[package]] name = "olm-sys" -version = "1.1.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "067ed86d3c0ab5d9009601082cd16a438e2104174f956d38fc81e0ad56f5696b" +checksum = "9074a928e1840d69d43d246b78e0ad580aae240e5add5a09add02e9dc3a4f621" dependencies = [ "cmake", ] @@ -1648,9 +1628,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.36" +version = "0.10.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" +checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" dependencies = [ "bitflags", "cfg-if", @@ -1668,9 +1648,9 @@ checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-sys" -version = "0.9.66" +version = "0.9.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1996d2d305e561b70d1ee0c53f1542833f4e1ac6ce9a6708b6ff2738ca67dc82" +checksum = "c6517987b3f8226b5da3661dad65ff7f300cc59fb5ea8333ca191fc65fde3edf" dependencies = [ "autocfg", "cc", @@ -1712,9 +1692,9 @@ checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" [[package]] name = "pbkdf2" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739" dependencies = [ "crypto-mac", ] @@ -1775,9 +1755,9 @@ dependencies = [ "phf_generator", "phf_shared", "proc-macro-hack", - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] @@ -1804,9 +1784,9 @@ version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] @@ -1823,9 +1803,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs8" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbee84ed13e44dd82689fa18348a49934fa79cc774a344c42fc9b301c71b140a" +checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447" dependencies = [ "der", "spki", @@ -1834,9 +1814,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" [[package]] name = "png" @@ -1856,7 +1836,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ - "cpufeatures 0.2.1", + "cpufeatures", "opaque-debug", "universal-hash", ] @@ -1868,16 +1848,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ "cfg-if", - "cpufeatures 0.2.1", + "cpufeatures", "opaque-debug", "universal-hash", ] [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "precomputed-hash" @@ -1887,9 +1867,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "proc-macro-crate" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" dependencies = [ "thiserror", "toml", @@ -1918,9 +1898,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid 0.2.2", ] @@ -1961,9 +1941,9 @@ checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" dependencies = [ "anyhow", "itertools 0.9.0", - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] @@ -1997,11 +1977,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.32", ] [[package]] @@ -2176,11 +2156,11 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e2d142a0c173f7e096ae1297d677cb4bb056fc80f25f31d6b0d2a82da07beee" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", + "proc-macro2 1.0.32", + "quote 1.0.10", "refinery-core", "regex", - "syn 1.0.76", + "syn 1.0.81", ] [[package]] @@ -2220,9 +2200,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.4" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22" +checksum = "66d2927ca2f685faf0fc620ac4834690d29e7abb153add10f5812eef20b5e280" dependencies = [ "base64", "bytes", @@ -2242,6 +2222,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "serde", + "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", @@ -2265,9 +2246,9 @@ dependencies = [ [[package]] name = "ruma" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a4acf77afac731e1fa133e6952d074af052f02d64909677a66619f52e758261" +checksum = "668031e3108d6a2cfbe6eca271d8698f4593440e71a44afdadcf67ce3cb93c1f" dependencies = [ "assign", "js_int", @@ -2284,9 +2265,9 @@ dependencies = [ [[package]] name = "ruma-api" -version = "0.17.1" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6473753f244f057181f975224aeaf5b4e2003f43f2a6279bf0b95f4e0126335" +checksum = "eda5ec9cf6163bb6be82c8a3994de09fdcd349dcf651aa6cabf649451f361eee" dependencies = [ "bytes", "http", @@ -2301,21 +2282,21 @@ dependencies = [ [[package]] name = "ruma-api-macros" -version = "0.17.1" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85286e2c65897079e7dcc120964cca47d5a3c23b7d1e9f730f533060919fedf7" +checksum = "72984e25b5e66fcce3267e97288e8dab96e966b151d4d205846049f5b2819e97" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] name = "ruma-client-api" -version = "0.11.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b86eba1c6fce6dd5c7a17ed632515aa7d04bbe6fbaa74c1699fb72c9fcc2d3d" +checksum = "ef8acd3e66bf9d63d9472ecd17b9f497062ce1caaf13673b101d6697358b41a7" dependencies = [ "assign", "bytes", @@ -2334,9 +2315,9 @@ dependencies = [ [[package]] name = "ruma-common" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146a88f34b7a084d54eaf790aaf4c25f5d2366ca8f3d1f326985fa5d31d72595" +checksum = "41d5b7605f58dc0d9cf1848cc7f1af2bae4e4bcd1d2b7a87bbb9864c8a785b91" dependencies = [ "indexmap", "js_int", @@ -2350,9 +2331,9 @@ dependencies = [ [[package]] name = "ruma-events" -version = "0.23.3" +version = "0.24.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da5f1472d60803e06744f83040a055948fd5bc1f4344d3e555ea378d0d6c96d" +checksum = "5ba40ba9f4b6bdf6dc82b18ee7dfd7a029c86a12f9785a0efe4df04bd5dfa3c8" dependencies = [ "indoc", "js_int", @@ -2362,25 +2343,26 @@ dependencies = [ "ruma-serde", "serde", "serde_json", + "thiserror", ] [[package]] name = "ruma-events-macros" -version = "0.23.3" +version = "0.24.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85929d84b29c4ce034bd1742e13d7ca25d885831f0185b73f7f9a9094296e1c4" +checksum = "431a3dfadb48a8b7df9d00776274e32fed68df96cc19d9d9346bfed62540f91a" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] name = "ruma-federation-api" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5206d4922c5dbd3b6faf2aaec9b5551fdf710ef73cc2145f13d0a5bb3945dc" +checksum = "fa3d1db1a064ab26484df6ef5d96c384fc053022004f34d96c3b4939e13dc204" dependencies = [ "js_int", "ruma-api", @@ -2394,9 +2376,9 @@ dependencies = [ [[package]] name = "ruma-identifiers" -version = "0.19.4" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be9ce339ce206dd5eb5eb29b7ad1b964652d46345bc46f25d68105effc75f4b" +checksum = "cb417d091e8dd5a633e4e5998231a156049d7fcc221045cfdc0642eb72067732" dependencies = [ "paste", "ruma-identifiers-macros", @@ -2408,26 +2390,26 @@ dependencies = [ [[package]] name = "ruma-identifiers-macros" -version = "0.19.4" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c7bc7e132a84f8d03924cf63d3a37bd87ffee5c29fee69b9125d045c7e4020" +checksum = "c708edad7f605638f26c951cbad7501fbf28ab01009e5ca65ea5a2db74a882b1" dependencies = [ - "quote 1.0.9", + "quote 1.0.10", "ruma-identifiers-validation", - "syn 1.0.76", + "syn 1.0.81", ] [[package]] name = "ruma-identifiers-validation" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8edeb165c4dcb8c93d1b7396b32fd5f52c5d9c7e7898ab87d772f824fe642f7c" +checksum = "42285e7fb5d5f2d5268e45bb683e36d5c6fd9fc1e11a4559ba3c3521f3bbb2cb" [[package]] name = "ruma-serde" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9cf55470945ce15641f331d0230bbab328cdf9aa5c3ec8aa20977b60553f15" +checksum = "8b2b22aae842e7ecda695e42b7b39d4558959d9d9a27acc2a16acf4f4f7f00c3" dependencies = [ "bytes", "form_urlencoded", @@ -2440,21 +2422,21 @@ dependencies = [ [[package]] name = "ruma-serde-macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af6e7156da1a4b0bd4b13dbe8c5a725878595a7962345393b3f171c75bd7cc" +checksum = "243e9bef188b08f94c79bc2f8fd1eb307a9e636b2b8e4571acf8c7be16381d28" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] name = "ruma-signatures" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d83873429181c7747b42fce80d86be84d63fd178e83573472c93143643b7a67" +checksum = "4a4f64027165b59500162d10d435b1253898bf3ad4f5002cb0d56913fe7f76d7" dependencies = [ "base64", "ed25519-dalek", @@ -2470,13 +2452,12 @@ dependencies = [ [[package]] name = "ruma-state-res" -version = "0.2.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50be7be79f1036dfdacda38e94f334e99f845db2e414887eedb757d065a05594" +checksum = "518c1afbddfcc5ffac8818a5cf0902709e6eca11aca8f24f6479df6f0601f1ba" dependencies = [ "itertools 0.10.1", "js_int", - "maplit", "ruma-common", "ruma-events", "ruma-identifiers", @@ -2514,15 +2495,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver", -] - [[package]] name = "ryu" version = "1.0.5" @@ -2583,21 +2555,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "send_wrapper" version = "0.4.0" @@ -2619,16 +2576,16 @@ version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] name = "serde_json" -version = "1.0.67" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f9e390c27c3c0ce8bc5d725f6e4d30a29d26659494aa4b17535f7522c5c950" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" dependencies = [ "indexmap", "itoa", @@ -2648,30 +2605,24 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" - [[package]] name = "sha2" -version = "0.9.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9204c41a1597a8c5af23c82d1c921cb01ec0a4c59e07a9c7306062829a3903f3" +checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" dependencies = [ "block-buffer", "cfg-if", - "cpufeatures 0.2.1", + "cpufeatures", "digest", "opaque-debug", ] [[package]] name = "sharded-slab" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740223c51853f3145fe7c90360d2d4232f2b62e3449489c207eccde818979982" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] @@ -2687,9 +2638,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" [[package]] name = "siphasher" @@ -2699,15 +2650,15 @@ checksum = "533494a8f9b724d33625ab53c6c4800f7cc445895924a8ef649222dcb76e938b" [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "sled" -version = "0.34.6" +version = "0.34.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0132f3e393bcb7390c60bb45769498cf4550bcb7a21d7f95c02b69f6362cdc" +checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935" dependencies = [ "crc32fast", "crossbeam-epoch", @@ -2721,15 +2672,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" [[package]] name = "socket2" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765f090f0e423d2b55843402a07915add955e7d60657db13707a159727326cad" +checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" dependencies = [ "libc", "winapi", @@ -2737,23 +2688,21 @@ dependencies = [ [[package]] name = "spki" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "987637c5ae6b3121aba9d513f869bd2bff11c4cc086c22473befd6649c0bd521" +checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32" dependencies = [ "der", ] [[package]] name = "sqlformat" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684001e7985ec1a9a66963b77ed151ef22a7876b3fdd7e37a57ec774f54b7d96" +checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" dependencies = [ - "lazy_static", - "maplit", - "nom 7.0.0", - "regex", + "itertools 0.10.1", + "nom 7.1.0", "unicode_categories", ] @@ -2821,22 +2770,22 @@ dependencies = [ "heck", "hex", "once_cell", - "proc-macro2 1.0.29", - "quote 1.0.9", + "proc-macro2 1.0.32", + "quote 1.0.10", "serde", "serde_json", "sha2", "sqlx-core", "sqlx-rt", - "syn 1.0.76", + "syn 1.0.81", "url", ] [[package]] name = "sqlx-rt" -version = "0.5.7" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14302b678d9c76b28f2e60115211e25e0aabc938269991745a169753dc00e35c" +checksum = "0d1bd069de53442e7a320f525a6d4deb8bb0621ac7a55f7eccbc2b58b57f43d0" dependencies = [ "native-tls", "once_cell", @@ -2844,78 +2793,21 @@ dependencies = [ "tokio-native-tls", ] -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check", -] - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "serde", - "serde_derive", - "syn 1.0.76", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2 1.0.29", - "quote 1.0.9", - "serde", - "serde_derive", - "serde_json", - "sha1", - "syn 1.0.76", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "string_cache" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ddb1139b5353f96e429e1a5e19fbaf663bddedaa06d1dbd49f82e352601209a" +checksum = "923f0f39b6267d37d23ce71ae7235602134b250ace715dd2c90421998ddac0c6" dependencies = [ "lazy_static", "new_debug_unreachable", + "parking_lot", "phf_shared", "precomputed-hash", "serde", @@ -2929,8 +2821,8 @@ checksum = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97" dependencies = [ "phf_generator", "phf_shared", - "proc-macro2 1.0.29", - "quote 1.0.9", + "proc-macro2 1.0.32", + "quote 1.0.10", ] [[package]] @@ -2971,24 +2863,24 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.76" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f107db402c2c2055242dbf4d2af0e69197202e9faacbef9571bbe47f5a1b84" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", + "proc-macro2 1.0.32", + "quote 1.0.10", "unicode-xid 0.2.2", ] [[package]] name = "synstructure" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", "unicode-xid 0.2.2", ] @@ -3064,22 +2956,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] @@ -3112,49 +3004,11 @@ dependencies = [ "winapi", ] -[[package]] -name = "time" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb", - "time-macros", - "version_check", - "winapi", -] - -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - -[[package]] -name = "time-macros-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" -dependencies = [ - "proc-macro-hack", - "proc-macro2 1.0.29", - "quote 1.0.9", - "standback", - "syn 1.0.76", -] - [[package]] name = "tinyvec" -version = "1.3.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338" +checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7" dependencies = [ "tinyvec_macros", ] @@ -3167,9 +3021,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4efe6fc2395938c8155973d7be49fe8d03a843726e285e100a8a383cc0154ce" +checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" dependencies = [ "autocfg", "bytes", @@ -3187,13 +3041,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.3.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" +checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] @@ -3208,9 +3062,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -3219,9 +3073,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes", "futures-core", @@ -3275,22 +3129,23 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c695de27302f4697191dda1c7178131a8cb805463dda02864acb80fe1322fdcf" dependencies = [ - "proc-macro2 1.0.29", + "proc-macro2 1.0.32", "prost-build", - "quote 1.0.9", - "syn 1.0.76", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] name = "tower" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f" +checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" dependencies = [ "futures-core", "futures-util", "indexmap", "pin-project", + "pin-project-lite", "rand 0.8.4", "slab", "tokio", @@ -3315,9 +3170,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.26" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if", "log", @@ -3328,20 +3183,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", ] [[package]] name = "tracing-core" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ "lazy_static", ] @@ -3379,9 +3234,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.20" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9cbe87a2fa7e35900ce5de20220a582a9483a7063811defce79d7cbd59d4cfe" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" dependencies = [ "ansi_term", "chrono", @@ -3413,9 +3268,9 @@ checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" [[package]] name = "unicode-bidi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" @@ -3434,9 +3289,9 @@ checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" @@ -3547,36 +3402,34 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.76" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce9b1b516211d33767048e5d47fa2a381ed8b76fc48d2ce4aa39877f9f183e0" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ "cfg-if", - "serde", - "serde_json", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.76" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe8dc78e2326ba5f845f4b5bf548401604fa20b1dd1d365fb73b6c1d6364041" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.26" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fded345a6559c2cfee778d562300c581f7d4ff3edb9b0d230d69800d213972" +checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" dependencies = [ "cfg-if", "js-sys", @@ -3586,38 +3439,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.76" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44468aa53335841d9d6b6c023eaab07c0cd4bddbcfdee3e2bb1e8d2cb8069fef" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ - "quote 1.0.9", + "quote 1.0.10", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.76" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0195807922713af1e67dc66132c7328206ed9766af3858164fb583eedc25fbad" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.76" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdb075a845574a1fa5f09fd77e43f7747599301ea3417a9fbffdeedfc1f4a29" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "web-sys" -version = "0.3.53" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224b2f6b67919060055ef1a67807367c2066ed520c3862cc013d26cf893a783c" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" dependencies = [ "js-sys", "wasm-bindgen", @@ -3642,9 +3495,9 @@ dependencies = [ [[package]] name = "whoami" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7741161a40200a867c96dfa5574544efa4178cf4c8f770b62dd1cc0362d7ae1" +checksum = "483a59fee1a93fec90eb08bc2eb4315ef10f4ebc478b3a5fadc969819cb66117" dependencies = [ "wasm-bindgen", "web-sys", @@ -3698,33 +3551,33 @@ dependencies = [ [[package]] name = "xml5ever" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1b52e6e8614d4a58b8e70cf51ec0cc21b256ad8206708bcff8139b5bbd6a59" +checksum = "9234163818fd8e2418fcde330655e757900d4236acd8cc70fef345ef91f6d865" dependencies = [ "log", "mac", "markup5ever", - "time 0.1.43", + "time", ] [[package]] name = "zeroize" -version = "1.4.1" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377db0846015f7ae377174787dd452e1c5f5a9050bc6f954911d01f116daa0cd" +checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.1.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1" +checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73" dependencies = [ - "proc-macro2 1.0.29", - "quote 1.0.9", - "syn 1.0.76", + "proc-macro2 1.0.32", + "quote 1.0.10", + "syn 1.0.81", "synstructure", ] diff --git a/dicebot/Cargo.toml b/dicebot/Cargo.toml index 9940c5c..ef40998 100644 --- a/dicebot/Cargo.toml +++ b/dicebot/Cargo.toml @@ -32,7 +32,7 @@ combine = "4.5" futures = "0.3" html2text = "0.2" phf = { version = "0.8", features = ["macros"] } -matrix-sdk = { version = "0.3" } +matrix-sdk = { version = "0.4.1" } refinery = { version = "0.6", features = ["rusqlite"]} barrel = { version = "0.6", features = ["sqlite3"] } tempfile = "3" diff --git a/dicebot/src/bin/dicebot-cmd.rs b/dicebot/src/bin/dicebot-cmd.rs index ed956f2..e264ce2 100644 --- a/dicebot/src/bin/dicebot-cmd.rs +++ b/dicebot/src/bin/dicebot-cmd.rs @@ -1,4 +1,4 @@ -use matrix_sdk::identifiers::room_id; +use matrix_sdk::ruma::identifiers::room_id; use matrix_sdk::Client; use tenebrous_dicebot::commands; use tenebrous_dicebot::commands::ResponseExtractor; diff --git a/dicebot/src/bot/command_execution.rs b/dicebot/src/bot/command_execution.rs index ad623d8..59f26f2 100644 --- a/dicebot/src/bot/command_execution.rs +++ b/dicebot/src/bot/command_execution.rs @@ -8,12 +8,8 @@ use crate::{ models::Account, }; use futures::stream::{self, StreamExt}; -use matrix_sdk::{ - self, - identifiers::{EventId, RoomId}, - room::Joined, - Client, -}; +use matrix_sdk::ruma::{EventId, RoomId}; +use matrix_sdk::{self, room::Joined, Client}; use std::clone::Clone; use std::convert::TryFrom; diff --git a/dicebot/src/bot/event_handlers.rs b/dicebot/src/bot/event_handlers.rs index 248611d..7e4017c 100644 --- a/dicebot/src/bot/event_handlers.rs +++ b/dicebot/src/bot/event_handlers.rs @@ -2,18 +2,12 @@ use super::DiceBot; use crate::db::sqlite::Database; use crate::db::Rooms; use crate::error::BotError; -use async_trait::async_trait; use log::{debug, error, info, warn}; -use matrix_sdk::{ - self, - events::{ - room::member::MemberEventContent, - room::message::{MessageEventContent, MessageType, TextMessageEventContent}, - StrippedStateEvent, SyncMessageEvent, - }, - room::Room, - EventHandler, -}; +use matrix_sdk::ruma::events::room::member::MemberEventContent; +use matrix_sdk::ruma::events::room::message::{MessageType, TextMessageEventContent}; +use matrix_sdk::ruma::events::{StrippedStateEvent, SyncMessageEvent}; +use matrix_sdk::Client; +use matrix_sdk::{self, room::Room, ruma::events::room::message::MessageEventContent}; use std::ops::Sub; use std::time::{Duration, SystemTime}; use std::{clone::Clone, time::UNIX_EPOCH}; @@ -101,58 +95,56 @@ async fn should_process_event(db: &Database, room_id: &str, event_id: &str) -> b }) } -/// This event emitter listens for messages with dice rolling commands. -/// Originally adapted from the matrix-rust-sdk examples. -#[async_trait] -impl EventHandler for DiceBot { - async fn on_stripped_state_member( - &self, - room: Room, - event: &StrippedStateEvent, - _: Option, - ) { - let room = match room { - Room::Invited(invited_room) => invited_room, - _ => return, - }; +pub(super) async fn on_stripped_state_member( + event: StrippedStateEvent, + client: Client, + room: Room, +) { + let room = match room { + Room::Invited(invited_room) => invited_room, + _ => return, + }; - if room.own_user_id().as_str() != event.state_key { - return; - } - - info!( - "Autojoining room {}", - room.display_name().await.ok().unwrap_or_default() - ); - - if let Err(e) = self.client.join_room_by_id(&room.room_id()).await { - warn!("Could not join room: {}", e.to_string()) - } + if room.own_user_id().as_str() != event.state_key { + return; } - async fn on_room_message(&self, room: Room, event: &SyncMessageEvent) { - let room = match room { - Room::Joined(joined_room) => joined_room, - _ => return, - }; + info!( + "Autojoining room {}", + room.display_name().await.ok().unwrap_or_default() + ); - let room_id = room.room_id().as_str(); - if !should_process_event(&self.db, room_id, event.event_id.as_str()).await { - return; - } - - let (msg_body, sender_username) = - if let Ok((msg_body, sender_username)) = should_process_message(self, &event).await { - (msg_body, sender_username) - } else { - return; - }; - - let results = self - .execute_commands(&room, &sender_username, &msg_body) - .await; - - self.handle_results(&room, &sender_username, event.event_id.clone(), results) - .await; + if let Err(e) = client.join_room_by_id(&room.room_id()).await { + warn!("Could not join room: {}", e.to_string()) } } + +pub(super) async fn on_room_message( + event: SyncMessageEvent, + room: Room, + bot: DiceBot, +) { + let room = match room { + Room::Joined(joined_room) => joined_room, + _ => return, + }; + + let room_id = room.room_id().as_str(); + if !should_process_event(&bot.db, room_id, event.event_id.as_str()).await { + return; + } + + let (msg_body, sender_username) = + if let Ok((msg_body, sender_username)) = should_process_message(&bot, &event).await { + (msg_body, sender_username) + } else { + return; + }; + + let results = bot + .execute_commands(&room, &sender_username, &msg_body) + .await; + + bot.handle_results(&room, &sender_username, event.event_id.clone(), results) + .await; +} diff --git a/dicebot/src/bot/mod.rs b/dicebot/src/bot/mod.rs index 955f9ff..57fb57d 100644 --- a/dicebot/src/bot/mod.rs +++ b/dicebot/src/bot/mod.rs @@ -5,7 +5,11 @@ use crate::db::DbState; use crate::error::BotError; use crate::state::DiceBotState; use log::info; -use matrix_sdk::{self, identifiers::EventId, room::Joined, Client, SyncSettings}; +use matrix_sdk::room::Room; +use matrix_sdk::ruma::events::room::message::MessageEventContent; +use matrix_sdk::ruma::events::SyncMessageEvent; +use matrix_sdk::ruma::EventId; +use matrix_sdk::{self, room::Joined, Client, SyncSettings}; use std::clone::Clone; use std::sync::{Arc, RwLock}; @@ -18,6 +22,7 @@ const MAX_COMMANDS_PER_MESSAGE: usize = 50; /// The DiceBot struct represents an active dice bot. The bot is not /// connected to Matrix until its run() function is called. +#[derive(Clone)] pub struct DiceBot { /// A reference to the configuration read in on application start. config: Arc, @@ -79,14 +84,32 @@ impl DiceBot { Ok(()) } + async fn bind_events(&self) { + //on room message: need closure to pass bot ref in. + self.client + .register_event_handler({ + let bot: DiceBot = self.clone(); + move |event: SyncMessageEvent, room: Room| { + let bot = bot.clone(); + async move { event_handlers::on_room_message(event, room, bot).await } + } + }) + .await; + + //auto-join handler + self.client + .register_event_handler(event_handlers::on_stripped_state_member) + .await; + } + /// Logs the bot in to Matrix and listens for events until program /// terminated, or a panic occurs. Originally adapted from the /// matrix-rust-sdk command bot example. pub async fn run(self) -> Result<(), BotError> { let client = self.client.clone(); self.login(&client).await?; + self.bind_events().await; - client.set_event_handler(Box::new(self)).await; info!("Listening for commands"); // TODO replace with sync_with_callback for cleaner shutdown diff --git a/dicebot/src/cofd/dice.rs b/dicebot/src/cofd/dice.rs index a218375..4300ebc 100644 --- a/dicebot/src/cofd/dice.rs +++ b/dicebot/src/cofd/dice.rs @@ -332,7 +332,7 @@ mod tests { macro_rules! dummy_room { () => { crate::context::RoomContext { - id: &matrix_sdk::identifiers::room_id!("!fakeroomid:example.com"), + id: &matrix_sdk::ruma::identifiers::room_id!("!fakeroomid:example.com"), display_name: "displayname".to_owned(), secure: false, } diff --git a/dicebot/src/commands/mod.rs b/dicebot/src/commands/mod.rs index 6e63baf..ba9ffeb 100644 --- a/dicebot/src/commands/mod.rs +++ b/dicebot/src/commands/mod.rs @@ -166,7 +166,7 @@ mod tests { macro_rules! dummy_room { () => { crate::context::RoomContext { - id: &matrix_sdk::identifiers::room_id!("!fakeroomid:example.com"), + id: &matrix_sdk::ruma::identifiers::room_id!("!fakeroomid:example.com"), display_name: "displayname".to_owned(), secure: false, } @@ -176,7 +176,7 @@ mod tests { macro_rules! secure_room { () => { crate::context::RoomContext { - id: &matrix_sdk::identifiers::room_id!("!fakeroomid:example.com"), + id: &matrix_sdk::ruma::identifiers::room_id!("!fakeroomid:example.com"), display_name: "displayname".to_owned(), secure: true, } diff --git a/dicebot/src/commands/rooms.rs b/dicebot/src/commands/rooms.rs index 0b9205a..1720b72 100644 --- a/dicebot/src/commands/rooms.rs +++ b/dicebot/src/commands/rooms.rs @@ -6,7 +6,7 @@ use crate::matrix; use async_trait::async_trait; use fuse_rust::{Fuse, FuseProperty, Fuseable}; use futures::stream::{self, StreamExt, TryStreamExt}; -use matrix_sdk::{identifiers::UserId, Client}; +use matrix_sdk::{ruma::UserId, Client}; use std::convert::TryFrom; /// Holds matrix room ID and display name as strings, for use with diff --git a/dicebot/src/context.rs b/dicebot/src/context.rs index 20b0f6f..105738e 100644 --- a/dicebot/src/context.rs +++ b/dicebot/src/context.rs @@ -1,8 +1,8 @@ use crate::db::sqlite::Database; use crate::error::BotError; use crate::models::Account; -use matrix_sdk::identifiers::{RoomId, UserId}; use matrix_sdk::room::Joined; +use matrix_sdk::ruma::identifiers::{RoomId, UserId}; use matrix_sdk::Client; use std::convert::TryFrom; diff --git a/dicebot/src/cthulhu/dice.rs b/dicebot/src/cthulhu/dice.rs index aa856ce..827389b 100644 --- a/dicebot/src/cthulhu/dice.rs +++ b/dicebot/src/cthulhu/dice.rs @@ -431,7 +431,7 @@ mod tests { macro_rules! dummy_room { () => { crate::context::RoomContext { - id: &matrix_sdk::identifiers::room_id!("!fakeroomid:example.com"), + id: &matrix_sdk::ruma::identifiers::room_id!("!fakeroomid:example.com"), display_name: "displayname".to_owned(), secure: false, } diff --git a/dicebot/src/error.rs b/dicebot/src/error.rs index e8c4a1a..f4728a5 100644 --- a/dicebot/src/error.rs +++ b/dicebot/src/error.rs @@ -39,9 +39,6 @@ pub enum BotError { #[error("uncategorized matrix SDK error: {0}")] MatrixError(#[from] matrix_sdk::Error), - #[error("uncategorized matrix SDK base error: {0}")] - MatrixBaseError(#[from] matrix_sdk::BaseError), - #[error("future canceled")] FutureCanceledError, @@ -80,7 +77,7 @@ pub enum BotError { TryFromIntError(#[from] std::num::TryFromIntError), #[error("identifier error: {0}")] - IdentifierError(#[from] matrix_sdk::identifiers::Error), + IdentifierError(#[from] matrix_sdk::ruma::identifiers::Error), #[error("password creation error: {0}")] PasswordCreationError(argon2::Error), diff --git a/dicebot/src/matrix.rs b/dicebot/src/matrix.rs index d1fa6c0..bd4a0c6 100644 --- a/dicebot/src/matrix.rs +++ b/dicebot/src/matrix.rs @@ -2,15 +2,12 @@ use std::path::PathBuf; use futures::stream::{self, StreamExt, TryStreamExt}; use log::error; -use matrix_sdk::{events::room::message::NoticeMessageEventContent, room::Joined, ClientConfig}; -use matrix_sdk::{ - events::room::message::{InReplyTo, Relation}, - events::room::message::{MessageEventContent, MessageType}, - events::AnyMessageEventContent, - identifiers::EventId, - Error as MatrixError, -}; -use matrix_sdk::{identifiers::RoomId, identifiers::UserId, Client}; +use matrix_sdk::ruma::events::room::message::{InReplyTo, MessageEventContent, Relation}; +use matrix_sdk::ruma::events::AnyMessageEventContent; +use matrix_sdk::ruma::{EventId, RoomId, UserId}; +use matrix_sdk::Client; +use matrix_sdk::Error as MatrixError; +use matrix_sdk::{room::Joined, ClientConfig}; use url::Url; use crate::{config::Config, error::BotError}; @@ -95,9 +92,7 @@ pub async fn send_message( _ => return, }; - let mut content = MessageEventContent::new(MessageType::Notice( - NoticeMessageEventContent::html(plain.trim(), html), - )); + let mut content = MessageEventContent::notice_html(plain.trim(), html); content.relates_to = reply_to.map(|event_id| Relation::Reply { in_reply_to: InReplyTo::new(event_id), diff --git a/dicebot/src/rpc/service.rs b/dicebot/src/rpc/service.rs index 1d3136b..186d3d2 100644 --- a/dicebot/src/rpc/service.rs +++ b/dicebot/src/rpc/service.rs @@ -4,7 +4,8 @@ use crate::matrix; use crate::{config::Config, db::sqlite::Database}; use futures::stream; use futures::{StreamExt, TryFutureExt, TryStreamExt}; -use matrix_sdk::{identifiers::UserId, room::Joined, Client}; +use matrix_sdk::ruma::UserId; +use matrix_sdk::{room::Joined, Client}; use std::convert::TryFrom; use std::sync::Arc; use tenebrous_rpc::protos::dicebot::{