auto-invite-matrix-bot.meta

Issues/PRs archive for MTRNord/auto-invite-matrix-bot
git clone git://archive.git.mtrnord.blog/MTRNord/auto-invite-matrix-bot.meta.git
Log | Files | Refs

commit 4d8ac41cd361ec61feea5a4793a2a9916b62b35d
Author: Phorge Migration <migration@localhost>
Date:   Tue, 21 Jul 2026 18:05:21 +0200

Archive issues/PRs export for MTRNord/auto-invite-matrix-bot

Diffstat:
Aissues/2.json | 16++++++++++++++++
Aissues/2.md | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apulls/1.diff | 1175+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apulls/1.json | 22++++++++++++++++++++++
Apulls/1.md | 15+++++++++++++++
Apulls/3.diff | 16++++++++++++++++
Apulls/3.json | 24++++++++++++++++++++++++
Apulls/3.md | 20++++++++++++++++++++
Apulls/4.diff | 45+++++++++++++++++++++++++++++++++++++++++++++
Apulls/4.json | 41+++++++++++++++++++++++++++++++++++++++++
Apulls/4.md | 35+++++++++++++++++++++++++++++++++++
11 files changed, 1483 insertions(+), 0 deletions(-)

diff --git a/issues/2.json b/issues/2.json @@ -0,0 +1,16 @@ +{ + "number": 2, + "title": "Sometimes unstable", + "state": "open", + "author": "MTRNord", + "created_at": "2020-03-08T10:13:02Z", + "closed_at": null, + "labels": [ + "bug" + ], + "assignees": [ + "MTRNord" + ], + "body": "Sometimes it crashes because of the missing error handling\r\n\r\n```\r\nError: Response(ResponseError(hyper::Error(IncompleteMessage)))\r\n\r\n 0: failure::backtrace::internal::InternalBacktrace::new\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.6/src/backtrace/internal.rs:46\r\n 1: failure::backtrace::Backtrace::new\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.6/src/backtrace/mod.rs:121\r\n 2: <failure::error::error_impl::ErrorImpl as core::convert::From<F>>::from\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.6/src/error/error_impl.rs:19\r\n 3: <failure::error::Error as core::convert::From<F>>::from\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.6/src/error/mod.rs:36\r\n 4: auto_invite_matrix_bot::do_stuff::{{closure}}\r\n at src/main.rs:405\r\n 5: <std::future::GenFuture<T> as core::future::future::Future>::poll\r\n at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/future.rs:43\r\n 6: <futures_util::stream::futures_unordered::FuturesUnordered<Fut> as futures_core::stream::Stream>::poll_next\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.4/src/stream/futures_unordered/mod.rs:544\r\n 7: <S as futures_core::stream::TryStream>::try_poll_next\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-core-0.3.4/src/stream.rs:193\r\n 8: futures_util::stream::try_stream::TryStreamExt::try_poll_next_unpin\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.4/src/stream/try_stream/mod.rs:791\r\n 9: <futures_util::stream::try_stream::try_next::TryNext<St> as core::future::future::Future>::poll\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.4/src/stream/try_stream/try_next.rs:35\r\n 10: std::future::poll_with_tls_context\r\n at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/future.rs:98\r\n 11: auto_invite_matrix_bot::main::{{closure}}\r\n at src/main.rs:474\r\n 12: <std::future::GenFuture<T> as core::future::future::Future>::poll\r\n at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/future.rs:43\r\n 13: tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/basic_scheduler.rs:138\r\n 14: tokio::runtime::Runtime::block_on::{{closure}}\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/mod.rs:413\r\n 15: tokio::runtime::context::enter\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/context.rs:72\r\n 16: tokio::runtime::handle::Handle::enter\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/handle.rs:34\r\n 17: tokio::runtime::Runtime::block_on\r\n at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/mod.rs:410\r\n 18: auto_invite_matrix_bot::main\r\n at src/main.rs:452\r\n 19: std::rt::lang_start::{{closure}}\r\n at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/rt.rs:67\r\n 20: std::rt::lang_start_internal::{{closure}}\r\n at src/libstd/rt.rs:52\r\n std::panicking::try::do_call\r\n at src/libstd/panicking.rs:305\r\n 21: __rust_maybe_catch_panic\r\n at src/libpanic_unwind/lib.rs:86\r\n 22: std::panicking::try\r\n at src/libstd/panicking.rs:281\r\n std::panic::catch_unwind\r\n at src/libstd/panic.rs:394\r\n std::rt::lang_start_internal\r\n at src/libstd/rt.rs:51\r\n 23: std::rt::lang_start\r\n at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/rt.rs:67\r\n 24: main\r\n 25: __libc_start_main\r\n 26: _start\r\n```", + "comments": [] +} diff --git a/issues/2.md b/issues/2.md @@ -0,0 +1,74 @@ +# #2 Sometimes unstable + +- **State:** open +- **Author:** @MTRNord +- **Created:** 2020-03-08T10:13:02Z +- **Labels:** bug +- **Assignees:** @MTRNord + +--- + +Sometimes it crashes because of the missing error handling + +``` +Error: Response(ResponseError(hyper::Error(IncompleteMessage))) + + 0: failure::backtrace::internal::InternalBacktrace::new + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.6/src/backtrace/internal.rs:46 + 1: failure::backtrace::Backtrace::new + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.6/src/backtrace/mod.rs:121 + 2: <failure::error::error_impl::ErrorImpl as core::convert::From<F>>::from + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.6/src/error/error_impl.rs:19 + 3: <failure::error::Error as core::convert::From<F>>::from + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.6/src/error/mod.rs:36 + 4: auto_invite_matrix_bot::do_stuff::{{closure}} + at src/main.rs:405 + 5: <std::future::GenFuture<T> as core::future::future::Future>::poll + at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/future.rs:43 + 6: <futures_util::stream::futures_unordered::FuturesUnordered<Fut> as futures_core::stream::Stream>::poll_next + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.4/src/stream/futures_unordered/mod.rs:544 + 7: <S as futures_core::stream::TryStream>::try_poll_next + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-core-0.3.4/src/stream.rs:193 + 8: futures_util::stream::try_stream::TryStreamExt::try_poll_next_unpin + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.4/src/stream/try_stream/mod.rs:791 + 9: <futures_util::stream::try_stream::try_next::TryNext<St> as core::future::future::Future>::poll + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.4/src/stream/try_stream/try_next.rs:35 + 10: std::future::poll_with_tls_context + at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/future.rs:98 + 11: auto_invite_matrix_bot::main::{{closure}} + at src/main.rs:474 + 12: <std::future::GenFuture<T> as core::future::future::Future>::poll + at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/future.rs:43 + 13: tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/basic_scheduler.rs:138 + 14: tokio::runtime::Runtime::block_on::{{closure}} + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/mod.rs:413 + 15: tokio::runtime::context::enter + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/context.rs:72 + 16: tokio::runtime::handle::Handle::enter + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/handle.rs:34 + 17: tokio::runtime::Runtime::block_on + at /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.12/src/runtime/mod.rs:410 + 18: auto_invite_matrix_bot::main + at src/main.rs:452 + 19: std::rt::lang_start::{{closure}} + at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/rt.rs:67 + 20: std::rt::lang_start_internal::{{closure}} + at src/libstd/rt.rs:52 + std::panicking::try::do_call + at src/libstd/panicking.rs:305 + 21: __rust_maybe_catch_panic + at src/libpanic_unwind/lib.rs:86 + 22: std::panicking::try + at src/libstd/panicking.rs:281 + std::panic::catch_unwind + at src/libstd/panic.rs:394 + std::rt::lang_start_internal + at src/libstd/rt.rs:51 + 23: std::rt::lang_start + at /rustc/6d3f4e0aab3e36ceb8b83d1e9467514685f6b751/src/libstd/rt.rs:67 + 24: main + 25: __libc_start_main + 26: _start +``` + diff --git a/pulls/1.diff b/pulls/1.diff @@ -0,0 +1,1175 @@ +diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml +index 312cbfd..3f9c429 100644 +--- a/.github/workflows/rust.yml ++++ b/.github/workflows/rust.yml +@@ -11,5 +11,30 @@ jobs: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --verbose +- - name: Run tests +- run: cargo test --verbose ++ ++ clippy: ++ ++ runs-on: ubuntu-latest ++ ++ steps: ++ - uses: actions/checkout@v2 ++ - name: Run Clippy ++ run: cargo clippy --all-targets --all-features -- -D warnings ++ ++ fmt: ++ ++ runs-on: ubuntu-latest ++ ++ steps: ++ - uses: actions/checkout@v2 ++ - name: Check cargofmt ++ run: cargo fmt -- --check ++ ++ tests: ++ ++ runs-on: ubuntu-latest ++ ++ steps: ++ - uses: actions/checkout@v2 ++ - name: Run tests ++ run: cargo test --verbose +diff --git a/.gitignore b/.gitignore +index 11f5e97..71a6262 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -2,3 +2,4 @@ + **/*.rs.bk + config.yaml + output.log ++tmp/ +diff --git a/Cargo.lock b/Cargo.lock +index f1efc7f..bdecc90 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -13,8 +13,8 @@ name = "atty" + version = "0.2.14" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "hermit-abi 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -24,14 +24,16 @@ version = "0.1.0" + dependencies = [ + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 3.0.0-beta.1 (git+https://github.com/clap-rs/clap/)", ++ "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fern 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ruma-client 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", +- "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ++ "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -40,6 +42,26 @@ name = "autocfg" + version = "1.0.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + ++[[package]] ++name = "backtrace" ++version = "0.3.44" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", ++ "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "backtrace-sys" ++version = "0.1.32" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ + [[package]] + name = "bitflags" + version = "1.2.1" +@@ -81,7 +103,7 @@ dependencies = [ + [[package]] + name = "clap" + version = "3.0.0-beta.1" +-source = "git+https://github.com/clap-rs/clap/#bbb14f8bd47ef201b315d367922343577ee60718" ++source = "git+https://github.com/clap-rs/clap/#4aaddf837555945f0c9f83e0efa9115fbcc0ac3c" + dependencies = [ + "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -98,13 +120,13 @@ dependencies = [ + [[package]] + name = "clap_derive" + version = "3.0.0-beta.1" +-source = "git+https://github.com/clap-rs/clap/#bbb14f8bd47ef201b315d367922343577ee60718" ++source = "git+https://github.com/clap-rs/clap/#4aaddf837555945f0c9f83e0efa9115fbcc0ac3c" + dependencies = [ + "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-error 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -113,7 +135,7 @@ version = "0.6.4" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -126,6 +148,26 @@ name = "dtoa" + version = "0.4.5" + source = "registry+https://github.com/rust-lang/crates.io-index" + ++[[package]] ++name = "failure" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "backtrace 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)", ++ "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "failure_derive" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ++ "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", ++ "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ + [[package]] + name = "fern" + version = "0.5.9" +@@ -186,9 +228,9 @@ version = "0.3.4" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -221,7 +263,7 @@ version = "0.1.14" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -239,7 +281,7 @@ dependencies = [ + "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ++ "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -253,10 +295,10 @@ dependencies = [ + + [[package]] + name = "hermit-abi" +-version = "0.1.7" ++version = "0.1.8" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -301,7 +343,7 @@ dependencies = [ + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", +- "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ++ "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -314,7 +356,7 @@ dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ++ "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -341,7 +383,7 @@ name = "iovec" + version = "0.1.4" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -373,7 +415,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "libc" +-version = "0.2.66" ++version = "0.2.67" + source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] +@@ -396,7 +438,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "memchr" +-version = "2.3.2" ++version = "2.3.3" + source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] +@@ -409,7 +451,7 @@ dependencies = [ + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -434,7 +476,7 @@ version = "0.2.3" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.28 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -451,7 +493,7 @@ version = "0.2.33" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -481,7 +523,7 @@ dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -497,7 +539,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -520,9 +562,9 @@ name = "pin-project-internal" + version = "0.4.8" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -551,10 +593,10 @@ version = "0.4.9" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "proc-macro-error-attr 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -562,10 +604,10 @@ name = "proc-macro-error-attr" + version = "0.4.9" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -574,9 +616,9 @@ name = "proc-macro-hack" + version = "0.5.11" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -586,7 +628,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "proc-macro2" +-version = "1.0.8" ++version = "1.0.9" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -597,7 +639,7 @@ name = "quote" + version = "1.0.2" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -606,7 +648,7 @@ version = "0.7.3" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -670,9 +712,9 @@ name = "ruma-api-macros" + version = "0.10.1" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -687,7 +729,7 @@ dependencies = [ + "hyper-tls 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ruma-api 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ruma-client-api 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "ruma-events 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "ruma-events 0.15.1 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)", + "ruma-identifiers 0.14.1 (git+https://github.com/ruma/ruma-identifiers.git)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -702,7 +744,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "js_int 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ruma-api 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "ruma-events 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "ruma-events 0.15.1 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)", + "ruma-identifiers 0.14.1 (git+https://github.com/ruma/ruma-identifiers.git)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -712,10 +754,10 @@ dependencies = [ + [[package]] + name = "ruma-events" + version = "0.15.1" +-source = "registry+https://github.com/rust-lang/crates.io-index" ++source = "git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport#4331dc1f5b831f1db6a88f678379e6c8ba6865f7" + dependencies = [ + "js_int 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "ruma-events-macros 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "ruma-events-macros 0.2.0 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)", + "ruma-identifiers 0.14.1 (git+https://github.com/ruma/ruma-identifiers.git)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -724,11 +766,11 @@ dependencies = [ + [[package]] + name = "ruma-events-macros" + version = "0.2.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" ++source = "git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport#4331dc1f5b831f1db6a88f678379e6c8ba6865f7" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -741,14 +783,19 @@ dependencies = [ + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + ] + ++[[package]] ++name = "rustc-demangle" ++version = "0.1.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ + [[package]] + name = "rustversion" + version = "1.0.2" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -772,7 +819,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -797,9 +844,9 @@ name = "serde_derive" + version = "1.0.104" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -851,10 +898,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "syn" +-version = "1.0.14" ++version = "1.0.16" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -864,9 +911,20 @@ name = "syn-mid" + version = "0.5.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "synstructure" ++version = "0.12.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ++ "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", ++ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -875,7 +933,7 @@ version = "3.1.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -895,35 +953,35 @@ name = "time" + version = "0.1.42" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] + name = "tokio" +-version = "0.2.11" ++version = "0.2.12" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "memchr 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "tokio-macros 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ++ "tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] + name = "tokio-macros" +-version = "0.2.4" ++version = "0.2.5" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ++ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -932,7 +990,7 @@ version = "0.3.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ++ "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -945,7 +1003,7 @@ dependencies = [ + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +- "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ++ "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -1074,6 +1132,8 @@ dependencies = [ + "checksum ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" + "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" + "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" ++"checksum backtrace 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)" = "e4036b9bf40f3cf16aba72a3d65e8a520fc4bafcdc7079aea8f848c58c5b5536" ++"checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" + "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" + "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" +@@ -1085,6 +1145,8 @@ dependencies = [ + "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" + "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" + "checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" ++"checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" ++"checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" + "checksum fern 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e69ab0d5aca163e388c3a49d284fed6c3d0810700e77c5ae2756a50ec1a4daaa" + "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" + "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +@@ -1100,7 +1162,7 @@ dependencies = [ + "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" + "checksum h2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9433d71e471c1736fd5a61b671fc0b148d7a2992f666c958d03cd8feb3b88d1" + "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +-"checksum hermit-abi 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e2c55f143919fbc0bc77e427fe2d74cf23786d7c1875666f2fde3ac3c659bb67" ++"checksum hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" + "checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" + "checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" + "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +@@ -1113,11 +1175,11 @@ dependencies = [ + "checksum js_int 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a28645cf69403534c8b3c961783cdc227c4c4fa5d31468464de1f43be0efcfc" + "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" + "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +-"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" ++"checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" + "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" + "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" + "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +-"checksum memchr 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53445de381a1f436797497c61d851644d0e8e88e6140f22872ad33a704933978" ++"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" + "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" + "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" + "checksum native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" +@@ -1138,7 +1200,7 @@ dependencies = [ + "checksum proc-macro-error-attr 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d175bef481c7902e63e3165627123fff3502f06ac043d3ef42d08c1246da9253" + "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" + "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" +-"checksum proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548" ++"checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" + "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" + "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" + "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" +@@ -1150,9 +1212,10 @@ dependencies = [ + "checksum ruma-api-macros 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e2c60086b570af5d8b88c9e2f10b3c4c950436658a104c3e60117eca2b1c466" + "checksum ruma-client 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e333757b70f7c8e289191e9db1e5db21d56495507dd9aaeadcdbedded55418" + "checksum ruma-client-api 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aa35e24b165401c1066416d804d830313f27d934dcd71f4388396a42f98ba020" +-"checksum ruma-events 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4a196cbeaa7bffe3756448ee9cf142645790e2a0ece78dfaf10a311eaf5e2a5e" +-"checksum ruma-events-macros 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "962d93056619ed61826a9d8872c863560e4892ff6a69b70f593baa5ae8b19dc8" ++"checksum ruma-events 0.15.1 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)" = "<none>" ++"checksum ruma-events-macros 0.2.0 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)" = "<none>" + "checksum ruma-identifiers 0.14.1 (git+https://github.com/ruma/ruma-identifiers.git)" = "<none>" ++"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" + "checksum rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bba175698996010c4f6dce5e7f173b6eb781fce25d2cfc45e27091ce0b79f6" + "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" + "checksum schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" +@@ -1166,13 +1229,14 @@ dependencies = [ + "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + "checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" + "checksum strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +-"checksum syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "af6f3550d8dff9ef7dc34d384ac6f107e5d31c8f57d9f28e0081503f547ac8f5" ++"checksum syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" + "checksum syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" ++"checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" + "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" + "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" + "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +-"checksum tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8fdd17989496f49cdc57978c96f0c9fe5e4a58a8bddc6813c449a4624f6a030b" +-"checksum tokio-macros 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f4b1e7ed7d5d4c2af3d999904b0eebe76544897cdbfb2b9684bed2174ab20f7c" ++"checksum tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "b34bee1facdc352fba10c9c58b654e6ecb6a2250167772bf86071f7c5f2f5061" ++"checksum tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" + "checksum tokio-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7bde02a3a5291395f59b06ec6945a3077602fac2b07eeeaf0dee2122f3619828" + "checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" + "checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" +diff --git a/Cargo.toml b/Cargo.toml +index 4c3f0ba..8d910d5 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -18,7 +18,9 @@ serde_yaml = "0.8" + log = "0.4.8" + fern = "0.5" + chrono = "0.4.10" +- ++rand = "0.7.3" ++failure = "0.1.6" + + [patch.crates-io] + ruma-identifiers = { git = 'https://github.com/ruma/ruma-identifiers.git' } ++ruma-events = { git = 'https://github.com/MTRNord/ruma-events.git', branch = "relates_to_backport" } +diff --git a/config_example.yml b/config_example.yml +index ffe4130..dde4f39 100644 +--- a/config_example.yml ++++ b/config_example.yml +@@ -1,6 +1,7 @@ + --- + message: "This is an automated message. You seem to have invited one of my other Matrix Accounts. A Bot has now invited the correct user. Please be patient until I respond!" + target_user: "@MTRNord:matrix.ffslfl.net" ++debug: true + servers: + - address: "https://mozilla.modular.im" + mxid: "@mtrnord:mozilla.org" +diff --git a/src/config.rs b/src/config.rs +index 58177da..43c192c 100644 +--- a/src/config.rs ++++ b/src/config.rs +@@ -8,6 +8,7 @@ pub struct Config { + pub message: String, + pub target_user: String, + pub servers: Vec<Homeserver>, ++ pub debug: bool, + } + + #[derive(Debug, PartialEq, Serialize, Deserialize)] +diff --git a/src/main.rs b/src/main.rs +index 0453a86..199750a 100644 +--- a/src/main.rs ++++ b/src/main.rs +@@ -1,8 +1,14 @@ + use std::convert::TryFrom; ++use std::fs; ++use std::fs::File; ++use std::io::{BufReader, BufWriter, Read, Write}; + + use clap::Clap; +-use futures_util::future::join_all; ++use futures_util::stream::FuturesUnordered; + use futures_util::stream::TryStreamExt as _; ++use log::{debug, error, info, warn}; ++use rand::distributions::Alphanumeric; ++use rand::{thread_rng, Rng}; + use ruma_client::api::r0::membership::invite_user; + use ruma_client::api::r0::membership::join_room_by_id; + use ruma_client::api::r0::message::create_message_event; +@@ -10,23 +16,130 @@ use ruma_client::api::r0::sync::sync_events::IncomingResponse; + use ruma_client::identifiers::UserId; + use ruma_client::{ + self, ++ api::r0::{ ++ filter::{FilterDefinition, RoomEventFilter, RoomFilter}, ++ message::create_message_event::Response, ++ room::create_room, ++ sync::sync_events::Filter, ++ }, + events::{ +- room::message::{MessageEventContent, NoticeMessageEventContent}, ++ collections::all::RoomEvent::{self, RoomMessage}, ++ room::message::{ ++ InReplyTo, MessageEvent, ++ MessageEventContent::{self, Text}, ++ NoticeMessageEventContent, RelatesTo, TextMessageEventContent, ++ }, + EventType, + }, ++ identifiers::{EventId, RoomId}, + HttpsClient, Session, + }; + use url::Url; + +-use log::{debug, error, info}; +- + use crate::config::{load_config, Config, Homeserver}; + use crate::logger::setup_logger; + + mod config; + mod logger; + +-async fn do_stuff(config: &Config, server: &Homeserver) -> Result<(), ruma_client::Error> { ++async fn send_notice_reply( ++ client: &HttpsClient, ++ text: String, ++ related_event: EventId, ++ room_id: RoomId, ++) -> Result<Response, ruma_client::Error> { ++ let rand_string: String = thread_rng().sample_iter(&Alphanumeric).take(30).collect(); ++ client ++ .request(create_message_event::Request { ++ room_id, ++ event_type: EventType::RoomMessage, ++ txn_id: rand_string, ++ data: MessageEventContent::Notice(NoticeMessageEventContent { ++ body: text, ++ relates_to: Some(RelatesTo { ++ in_reply_to: InReplyTo { ++ event_id: related_event, ++ }, ++ }), ++ }), ++ }) ++ .await ++} ++ ++async fn send_message( ++ client: &HttpsClient, ++ text: String, ++ room_id: RoomId, ++) -> Result<Response, ruma_client::Error> { ++ let rand_string: String = thread_rng().sample_iter(&Alphanumeric).take(30).collect(); ++ client ++ .request(create_message_event::Request { ++ room_id, ++ event_type: EventType::RoomMessage, ++ txn_id: rand_string, ++ data: MessageEventContent::Text(TextMessageEventContent { ++ body: text, ++ format: None, ++ formatted_body: None, ++ relates_to: None, ++ }), ++ }) ++ .await ++} ++ ++async fn get_control_room( ++ client: &HttpsClient, ++ target_user: String, ++) -> Result<RoomId, failure::Error> { ++ fs::create_dir_all("./tmp/")?; ++ let mut room_id_read = String::new(); ++ match File::open(format!( ++ "./tmp/control_room_{}", ++ client.session().unwrap().user_id.hostname() ++ )) { ++ Ok(f) => { ++ let mut br = BufReader::new(f); ++ match br.read_to_string(&mut room_id_read) { ++ Ok(_) => { ++ let room_id = RoomId::try_from(room_id_read.as_str()).unwrap(); ++ Ok(room_id) ++ } ++ Err(e) => Err(failure::Error::try_from(e)?), ++ } ++ } ++ Err(e) => { ++ warn!("Unable to open control_room_tmp: {}", e); ++ let resp = client ++ .request(create_room::Request { ++ invite: vec![UserId::try_from(target_user.as_str())?], ++ name: Some(format!( ++ "AutoInviteBot Control Room {}", ++ client.session().unwrap().user_id.hostname() ++ )), ++ preset: Some(create_room::RoomPreset::TrustedPrivateChat), ++ creation_content: None, ++ room_alias_name: None, ++ topic: None, ++ visibility: None, ++ }) ++ .await?; ++ let room_id: RoomId = resp.room_id; ++ let f = File::create(format!( ++ "./tmp/control_room_{}", ++ client.session().unwrap().user_id.hostname() ++ ))?; ++ let mut f = BufWriter::new(f); ++ f.write_all(room_id.to_string().as_bytes())?; ++ ++ Ok(room_id) ++ } ++ } ++} ++ ++async fn get_client( ++ server: &Homeserver, ++ target_user: String, ++) -> Result<(HttpsClient, RoomId), failure::Error> { + info!("Starting session as {}", server.mxid); + + let session: Session; +@@ -66,41 +179,256 @@ async fn do_stuff(config: &Config, server: &Homeserver) -> Result<(), ruma_clien + error!("Please provide either a password or an access_token!"); + } + +- let mut sync_stream = Box::pin(client.sync(None, None, false)); +- let message = config.message.clone(); ++ let control_room_id = get_control_room(&client, target_user).await?; ++ ++ info!("Started session as {}", server.mxid); ++ ++ Ok((client, control_room_id)) ++} ++ ++async fn parse_invites( ++ client: &HttpsClient, ++ room_id: RoomId, ++ target_user: String, ++ message: String, ++) -> Result<(), ruma_client::Error> { ++ // Auto join rooms ++ debug!("Invited to {:?}", room_id); ++ client ++ .request(join_room_by_id::Request { ++ room_id: room_id.clone(), ++ third_party_signed: None, ++ }) ++ .await?; ++ debug!("Joined {:?}", room_id.clone()); ++ let response = client ++ .request(invite_user::Request { ++ room_id: room_id.clone(), ++ user_id: UserId::try_from(target_user.as_str()).unwrap(), ++ }) ++ .await?; ++ debug!("Invited correct user {:?}", response); ++ ++ let rand_string: String = thread_rng().sample_iter(&Alphanumeric).take(30).collect(); ++ client ++ .request(create_message_event::Request { ++ room_id: room_id.clone(), ++ event_type: EventType::RoomMessage, ++ txn_id: rand_string, ++ data: MessageEventContent::Notice(NoticeMessageEventContent { ++ body: message, ++ relates_to: None, ++ }), ++ }) ++ .await?; ++ ++ debug!("Sent a message about what happened"); ++ Ok(()) ++} ++ ++async fn handle_mention( ++ client: &HttpsClient, ++ config: &Config, ++ control_room_id: RoomId, ++ room_id: RoomId, ++ sender: UserId, ++ event_id: EventId, ++ body: String, ++) -> Result<(), failure::Error> { ++ if config.debug { ++ send_notice_reply( ++ &client, ++ format!( ++ "> <{}> {}\n\n[DEBUG] Mentioned main account about this mention", ++ sender, body ++ ), ++ event_id.clone(), ++ room_id.clone(), ++ ) ++ .await?; ++ } ++ ++ // Send mention to control room ++ send_message( ++ &client, ++ format!( ++ "> <{}> {}\n\n Mention in {} by {}", ++ sender, body, room_id, sender ++ ), ++ control_room_id.clone(), ++ ) ++ .await?; ++ ++ Ok(()) ++} ++ ++async fn parse_joins( ++ client: &HttpsClient, ++ config: &Config, ++ server: &Homeserver, ++ event: RoomEvent, ++ room_id: RoomId, ++ control_room_id: RoomId, ++) -> Result<(), failure::Error> { ++ if let RoomMessage(msg) = event { ++ let content = msg.content; ++ let event_id = msg.event_id; ++ let sender = msg.sender; ++ if let Text(msg_content) = content { ++ let formatted_body: Option<String> = msg_content.formatted_body; ++ let body: String = msg_content.body; ++ ++ if sender.to_string() != client.session().unwrap().user_id.to_string() ++ && formatted_body.clone().is_some() ++ && formatted_body ++ .clone() ++ .unwrap() ++ .to_lowercase() ++ .contains(&server.mxid.clone().to_lowercase()) ++ { ++ handle_mention( ++ client, ++ config, ++ control_room_id.clone(), ++ room_id.clone(), ++ sender.clone(), ++ event_id.clone(), ++ body.clone(), ++ ) ++ .await?; ++ } else if sender.to_string() != client.session().unwrap().user_id.to_string() ++ && formatted_body.clone().is_none() ++ && body.to_lowercase().contains( ++ server ++ .mxid ++ .clone() ++ .to_lowercase() ++ .split(':') ++ .collect::<Vec<_>>()[0], ++ ) ++ { ++ handle_mention( ++ client, ++ config, ++ control_room_id.clone(), ++ room_id.clone(), ++ sender.clone(), ++ event_id.clone(), ++ body.clone(), ++ ) ++ .await?; ++ } ++ // Todo make a smarter command handler ++ /*if body.starts_with("!test") { ++ send_notice_reply( ++ &client, ++ format!("> <{}> {}\n\ntest resp", sender, body), ++ event_id.clone(), ++ room_id.clone(), ++ ) ++ .await?; ++ }*/ ++ } ++ } ++ Ok(()) ++} ++ ++async fn load_next_batch() -> Result<String, failure::Error> { ++ fs::create_dir_all("./tmp/")?; ++ let mut next_batch = String::new(); ++ let f = File::open("./tmp/next_batch")?; ++ let mut br = BufReader::new(f); ++ br.read_to_string(&mut next_batch)?; ++ Ok(next_batch) ++} ++ ++async fn save_next_batch(next_batch: String) -> Result<(), failure::Error> { ++ let f = File::create("./tmp/next_batch")?; ++ let mut f = BufWriter::new(f); ++ f.write_all(next_batch.as_bytes())?; ++ Ok(()) ++} ++ ++fn generate_filter() -> Result<Filter, failure::Error> { ++ let filter = FilterDefinition { ++ event_fields: None, ++ event_format: None, ++ account_data: None, ++ room: Some(RoomFilter { ++ include_leave: None, ++ account_data: None, ++ timeline: Some(RoomEventFilter { ++ not_types: vec![], ++ not_rooms: vec![], ++ limit: None, ++ rooms: None, ++ not_senders: vec![], ++ senders: None, ++ types: Some(vec!["m.room.message".to_owned()]), ++ contains_url: None, ++ }), ++ ephemeral: None, ++ state: None, ++ not_rooms: vec![], ++ rooms: None, ++ }), ++ presence: None, ++ }; ++ Ok(Filter::FilterDefinition(filter)) ++} ++ ++async fn do_stuff(config: &Config, server: &Homeserver) -> Result<(), failure::Error> { + let target_user = config.target_user.clone(); ++ let (client, control_room_id) = get_client(server, target_user.clone()).await?; ++ ++ let since = match load_next_batch().await { ++ Ok(v) => Some(v), ++ Err(e) => { ++ error!("{:?}", e); ++ None ++ } ++ }; ++ ++ let filter = match generate_filter() { ++ Ok(v) => Some(v), ++ Err(e) => { ++ error!("{:?}", e); ++ None ++ } ++ }; ++ ++ let mut sync_stream = Box::pin(client.sync(filter, since, false)); ++ let message = config.message.clone(); + while let Some(response) = sync_stream.try_next().await? { + let res: IncomingResponse = response; ++ let next_batch: String = res.next_batch; ++ save_next_batch(next_batch).await?; ++ + for (room_id, _room) in res.rooms.invite { +- // Auto join rooms +- debug!("Invited to {:?}", room_id.clone()); +- client +- .request(join_room_by_id::Request { +- room_id: room_id.clone(), +- third_party_signed: None, +- }) +- .await?; +- debug!("Joined {:?}", room_id.clone()); +- let response = client +- .request(invite_user::Request { +- room_id: room_id.clone(), +- user_id: UserId::try_from(target_user.clone().as_str()).unwrap(), +- }) +- .await?; +- debug!("Invited correct user {:?}", response); +- client +- .request(create_message_event::Request { +- room_id, +- event_type: EventType::RoomMessage, +- txn_id: "1".to_owned(), +- data: MessageEventContent::Notice(NoticeMessageEventContent { +- body: message.clone(), +- relates_to: None, +- }), +- }) +- .await?; ++ parse_invites( ++ &client, ++ room_id.clone(), ++ target_user.clone(), ++ message.clone(), ++ ) ++ .await?; ++ } ++ for (room_id, room) in res.rooms.join { ++ let events = room.timeline.events; + +- debug!("Sent a message about what happened"); ++ for event in events.into_iter().flat_map(|r| r.into_result()) { ++ if let RoomEvent::RoomMessage(MessageEvent { .. }) = event { ++ parse_joins( ++ &client, ++ config, ++ server, ++ event.clone(), ++ room_id.clone(), ++ control_room_id.clone(), ++ ) ++ .await?; ++ } ++ } + } + } + +@@ -118,7 +446,7 @@ struct Opts { + } + + #[tokio::main] +-async fn main() -> Result<(), ruma_client::Error> { ++async fn main() -> Result<(), failure::Error> { + let opts: Opts = Opts::parse(); + + let log_level = match opts.verbose { +@@ -132,12 +460,16 @@ async fn main() -> Result<(), ruma_client::Error> { + setup_logger(log_level).expect("unable to setup logger"); + + let config = load_config(opts.config).expect("unable to read config"); +- let mut futures = vec![]; ++ ++ let mut futures = FuturesUnordered::new(); + + config.servers.iter().for_each(|x| { + futures.push(do_stuff(&config, x)); + }); + +- join_all(futures).await; ++ while let Some(x) = futures.try_next().await? { ++ error!("{:?}", x); ++ } ++ + Ok(()) + } diff --git a/pulls/1.json b/pulls/1.json @@ -0,0 +1,22 @@ +{ + "number": 1, + "title": "Relay mentions", + "state": "merged", + "diff_file": "1.diff", + "author": "MTRNord", + "created_at": "2020-03-07T20:37:45Z", + "closed_at": "2020-03-07T20:58:14Z", + "merged_at": "2020-03-07T20:58:14Z", + "base_ref": "master", + "head_ref": "relay-mentions", + "labels": [ + "enhancement" + ], + "assignees": [ + "MTRNord" + ], + "requested_reviewers": [], + "body": "", + "comments": [], + "review_comments": [] +} diff --git a/pulls/1.md b/pulls/1.md @@ -0,0 +1,15 @@ +# PR #1 Relay mentions + +- **Status:** merged +- **Author:** @MTRNord +- **Created:** 2020-03-07T20:37:45Z +- **Branch:** relay-mentions → master +- **Merged:** 2020-03-07T20:58:14Z +- **Labels:** enhancement +- **Assignees:** @MTRNord +- **Diff:** [1.diff](./1.diff) + +--- + +_No description._ + diff --git a/pulls/3.diff b/pulls/3.diff @@ -0,0 +1,16 @@ +diff --git a/README.md b/README.md +index a46cf23..4bb1998 100644 +--- a/README.md ++++ b/README.md +@@ -1,5 +1,11 @@ + # auto-invite-matrix-bot + ++Bot allows redirect people, that send messages to one of your "wrong" (old, abandoned, not active) Matrix accounts to your real account. ++ ++It does join on invite, invites your "real" account and sends a customizable message, support listening multiple accounts or Homeservers. ++ ++Also it can relay mentions from your secondary accounts to your primary account. ++ + ## Usage + 1. Install rust on your system + 2. Make a config file according to the config_example.yml diff --git a/pulls/3.json b/pulls/3.json @@ -0,0 +1,24 @@ +{ + "number": 3, + "title": "Add better description to readme", + "state": "merged", + "diff_file": "3.diff", + "author": "MurzNN", + "created_at": "2020-05-06T08:06:55Z", + "closed_at": "2020-05-27T22:39:13Z", + "merged_at": "2020-05-27T22:39:13Z", + "base_ref": "master", + "head_ref": "patch-1", + "labels": [], + "assignees": [], + "requested_reviewers": [], + "body": "I make better description of what this bot do, based on TWIM post.", + "comments": [ + { + "author": "MTRNord", + "created_at": "2020-05-27T22:39:10Z", + "body": "Oh I missed this :D thanks!" + } + ], + "review_comments": [] +} diff --git a/pulls/3.md b/pulls/3.md @@ -0,0 +1,20 @@ +# PR #3 Add better description to readme + +- **Status:** merged +- **Author:** @MurzNN +- **Created:** 2020-05-06T08:06:55Z +- **Branch:** patch-1 → master +- **Merged:** 2020-05-27T22:39:13Z +- **Diff:** [3.diff](./3.diff) + +--- + +I make better description of what this bot do, based on TWIM post. + + +## Comments + +### @MTRNord — 2020-05-27T22:39:10Z + +Oh I missed this :D thanks! + diff --git a/pulls/4.diff b/pulls/4.diff @@ -0,0 +1,45 @@ +diff --git a/.dockerignore b/.dockerignore +new file mode 100644 +index 0000000..e710d68 +--- /dev/null ++++ b/.dockerignore +@@ -0,0 +1,2 @@ ++target ++config_example.yml +\ No newline at end of file +diff --git a/Dockerfile b/Dockerfile +new file mode 100644 +index 0000000..bcfaa2b +--- /dev/null ++++ b/Dockerfile +@@ -0,0 +1,13 @@ ++FROM rust as builder ++ ++WORKDIR /opt/auto-invite-matrix-bot ++COPY . . ++RUN cargo install --path . ++ ++FROM debian:buster-slim ++COPY --from=builder /usr/local/cargo/bin/auto-invite-matrix-bot /usr/local/bin/auto-invite-matrix-bot ++RUN apt-get update && apt-get install -y libssl1.1 ca-certificates && rm -rf /var/lib/apt/lists/* ++ ++WORKDIR / ++ ++CMD ["auto-invite-matrix-bot"] +diff --git a/src/main.rs b/src/main.rs +index 199750a..d42d453 100644 +--- a/src/main.rs ++++ b/src/main.rs +@@ -438,10 +438,10 @@ async fn do_stuff(config: &Config, server: &Homeserver) -> Result<(), failure::E + #[derive(Clap)] + #[clap(version = "0.1.0", author = "MTRNord")] + struct Opts { +- #[clap(short = "c", long = "config", default_value = "config.yaml")] ++ #[clap(short = 'c', long = "config", default_value = "config.yaml")] + config: String, + /// A level of verbosity, and can be used multiple times +- #[clap(short = "v", long = "verbose", parse(from_occurrences))] ++ #[clap(short = 'v', long = "verbose", parse(from_occurrences))] + verbose: i32, + } + diff --git a/pulls/4.json b/pulls/4.json @@ -0,0 +1,41 @@ +{ + "number": 4, + "title": "Make bot compile and add dockerfile", + "state": "merged", + "diff_file": "4.diff", + "author": "freaktechnik", + "created_at": "2020-08-15T19:04:32Z", + "closed_at": "2020-08-15T19:30:40Z", + "merged_at": "2020-08-15T19:30:40Z", + "base_ref": "master", + "head_ref": "master", + "labels": [], + "assignees": [ + "MTRNord" + ], + "requested_reviewers": [], + "body": "In order to use the bot I needed it to be packaged in a docker container, so I created a dockerfile. I've also fixed it not compiling, presumably due to some tiny silly library update. If you don't want the Dockerfile in this repo that's fine. I'll happily open a PR just with the compile fix.\r\n\r\nI think the usage example is also no longer accurate, I needed to do `auto-invite-matrix-bot --config=/path/to/config.yml`.", + "comments": [ + { + "author": "MTRNord", + "created_at": "2020-08-15T19:30:21Z", + "body": "Hi thanks for making the PR. The usage example says the same as you have there. It might be `yml` vs `yaml`. The longer version is used as the default while tbh the shorter version is more common." + }, + { + "author": "freaktechnik", + "created_at": "2020-08-15T19:32:12Z", + "body": "No, the usage sample crucially shows `--config /path/to/config.yml` without the `=` which leads to the args parsing failing rather cryptically." + }, + { + "author": "MTRNord", + "created_at": "2020-08-15T19:51:26Z", + "body": "Hm what example are you referring to? The readme only contains this line about it: `Run it with auto-invite-matrix-bot with an addition --config argument to point to your config file` do you mean the `--help` one? Thats from the clap dependency. Might be a bug on their side or a compatibility issue with the terminal you are using" + }, + { + "author": "freaktechnik", + "created_at": "2020-08-15T20:03:01Z", + "body": "Probably the --help one - I assume that's what they output if the parsing of arguments fails. I found out via tgeir docs that they expect the = for long form. I guess that's a bug in the lib then, indeed." + } + ], + "review_comments": [] +} diff --git a/pulls/4.md b/pulls/4.md @@ -0,0 +1,35 @@ +# PR #4 Make bot compile and add dockerfile + +- **Status:** merged +- **Author:** @freaktechnik +- **Created:** 2020-08-15T19:04:32Z +- **Branch:** master → master +- **Merged:** 2020-08-15T19:30:40Z +- **Assignees:** @MTRNord +- **Diff:** [4.diff](./4.diff) + +--- + +In order to use the bot I needed it to be packaged in a docker container, so I created a dockerfile. I've also fixed it not compiling, presumably due to some tiny silly library update. If you don't want the Dockerfile in this repo that's fine. I'll happily open a PR just with the compile fix. + +I think the usage example is also no longer accurate, I needed to do `auto-invite-matrix-bot --config=/path/to/config.yml`. + + +## Comments + +### @MTRNord — 2020-08-15T19:30:21Z + +Hi thanks for making the PR. The usage example says the same as you have there. It might be `yml` vs `yaml`. The longer version is used as the default while tbh the shorter version is more common. + +### @freaktechnik — 2020-08-15T19:32:12Z + +No, the usage sample crucially shows `--config /path/to/config.yml` without the `=` which leads to the args parsing failing rather cryptically. + +### @MTRNord — 2020-08-15T19:51:26Z + +Hm what example are you referring to? The readme only contains this line about it: `Run it with auto-invite-matrix-bot with an addition --config argument to point to your config file` do you mean the `--help` one? Thats from the clap dependency. Might be a bug on their side or a compatibility issue with the terminal you are using + +### @freaktechnik — 2020-08-15T20:03:01Z + +Probably the --help one - I assume that's what they output if the parsing of arguments fails. I found out via tgeir docs that they expect the = for long form. I guess that's a bug in the lib then, indeed. +