├── .dockerignore ├── .github └── workflows │ └── rust.yml ├── .gitignore ├── .idea ├── .gitignore ├── misc.xml ├── modules.xml └── vcs.xml ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── LICENSE ├── README.md ├── auto-invite-matrix-bot.iml ├── config_example.yml └── src ├── config.rs ├── logger.rs └── main.rs /.dockerignore: -------------------------------------------------------------------------------- 1 | target 2 | config_example.yml -------------------------------------------------------------------------------- /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Build 13 | run: cargo build --verbose 14 | 15 | clippy: 16 | 17 | runs-on: ubuntu-latest 18 | 19 | steps: 20 | - uses: actions/checkout@v2 21 | - name: Run Clippy 22 | run: cargo clippy --all-targets --all-features -- -D warnings 23 | 24 | fmt: 25 | 26 | runs-on: ubuntu-latest 27 | 28 | steps: 29 | - uses: actions/checkout@v2 30 | - name: Check cargofmt 31 | run: cargo fmt -- --check 32 | 33 | tests: 34 | 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/checkout@v2 39 | - name: Run tests 40 | run: cargo test --verbose 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | config.yaml 4 | output.log 5 | tmp/ 6 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "ansi_term" 5 | version = "0.12.1" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | dependencies = [ 8 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 9 | ] 10 | 11 | [[package]] 12 | name = "atty" 13 | version = "0.2.14" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | dependencies = [ 16 | "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 17 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 18 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 19 | ] 20 | 21 | [[package]] 22 | name = "auto-invite-matrix-bot" 23 | version = "0.1.0" 24 | dependencies = [ 25 | "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", 26 | "clap 3.0.0-beta.1 (git+https://github.com/clap-rs/clap/)", 27 | "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 28 | "fern 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", 29 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 30 | "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 31 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 32 | "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", 33 | "ruma-client 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 34 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 35 | "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", 36 | "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 37 | "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 38 | ] 39 | 40 | [[package]] 41 | name = "autocfg" 42 | version = "1.0.0" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | 45 | [[package]] 46 | name = "backtrace" 47 | version = "0.3.44" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | dependencies = [ 50 | "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 51 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 52 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 53 | "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 54 | ] 55 | 56 | [[package]] 57 | name = "backtrace-sys" 58 | version = "0.1.32" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | dependencies = [ 61 | "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", 62 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 63 | ] 64 | 65 | [[package]] 66 | name = "bitflags" 67 | version = "1.2.1" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | 70 | [[package]] 71 | name = "bytes" 72 | version = "0.5.4" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | 75 | [[package]] 76 | name = "c2-chacha" 77 | version = "0.2.3" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | dependencies = [ 80 | "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 81 | ] 82 | 83 | [[package]] 84 | name = "cc" 85 | version = "1.0.50" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | 88 | [[package]] 89 | name = "cfg-if" 90 | version = "0.1.10" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | 93 | [[package]] 94 | name = "chrono" 95 | version = "0.4.10" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | dependencies = [ 98 | "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 99 | "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 100 | "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 101 | ] 102 | 103 | [[package]] 104 | name = "clap" 105 | version = "3.0.0-beta.1" 106 | source = "git+https://github.com/clap-rs/clap/#4aaddf837555945f0c9f83e0efa9115fbcc0ac3c" 107 | dependencies = [ 108 | "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", 109 | "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", 110 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 111 | "clap_derive 3.0.0-beta.1 (git+https://github.com/clap-rs/clap/)", 112 | "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 113 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 114 | "strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", 115 | "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 116 | "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 117 | "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", 118 | ] 119 | 120 | [[package]] 121 | name = "clap_derive" 122 | version = "3.0.0-beta.1" 123 | source = "git+https://github.com/clap-rs/clap/#4aaddf837555945f0c9f83e0efa9115fbcc0ac3c" 124 | dependencies = [ 125 | "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 126 | "proc-macro-error 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", 127 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 128 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 129 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 130 | ] 131 | 132 | [[package]] 133 | name = "core-foundation" 134 | version = "0.6.4" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | dependencies = [ 137 | "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", 138 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 139 | ] 140 | 141 | [[package]] 142 | name = "core-foundation-sys" 143 | version = "0.6.2" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | 146 | [[package]] 147 | name = "dtoa" 148 | version = "0.4.5" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | 151 | [[package]] 152 | name = "failure" 153 | version = "0.1.6" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | dependencies = [ 156 | "backtrace 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)", 157 | "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 158 | ] 159 | 160 | [[package]] 161 | name = "failure_derive" 162 | version = "0.1.6" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | dependencies = [ 165 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 166 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 167 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 168 | "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", 169 | ] 170 | 171 | [[package]] 172 | name = "fern" 173 | version = "0.5.9" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | dependencies = [ 176 | "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", 177 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 178 | ] 179 | 180 | [[package]] 181 | name = "fnv" 182 | version = "1.0.6" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | 185 | [[package]] 186 | name = "foreign-types" 187 | version = "0.3.2" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | dependencies = [ 190 | "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 191 | ] 192 | 193 | [[package]] 194 | name = "foreign-types-shared" 195 | version = "0.1.1" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | 198 | [[package]] 199 | name = "fuchsia-zircon" 200 | version = "0.3.3" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | dependencies = [ 203 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 204 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 205 | ] 206 | 207 | [[package]] 208 | name = "fuchsia-zircon-sys" 209 | version = "0.3.3" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | 212 | [[package]] 213 | name = "futures-channel" 214 | version = "0.3.4" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | dependencies = [ 217 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 218 | ] 219 | 220 | [[package]] 221 | name = "futures-core" 222 | version = "0.3.4" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | 225 | [[package]] 226 | name = "futures-macro" 227 | version = "0.3.4" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | dependencies = [ 230 | "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", 231 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 232 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 233 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 234 | ] 235 | 236 | [[package]] 237 | name = "futures-sink" 238 | version = "0.3.4" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | 241 | [[package]] 242 | name = "futures-task" 243 | version = "0.3.4" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | 246 | [[package]] 247 | name = "futures-util" 248 | version = "0.3.4" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | dependencies = [ 251 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 252 | "futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 253 | "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 254 | "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", 255 | "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", 256 | "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 257 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 258 | ] 259 | 260 | [[package]] 261 | name = "getrandom" 262 | version = "0.1.14" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | dependencies = [ 265 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 266 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 267 | "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", 268 | ] 269 | 270 | [[package]] 271 | name = "h2" 272 | version = "0.2.1" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | dependencies = [ 275 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 276 | "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 277 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 278 | "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 279 | "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 280 | "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 281 | "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 282 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 283 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 284 | "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 285 | "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 286 | ] 287 | 288 | [[package]] 289 | name = "heck" 290 | version = "0.3.1" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | dependencies = [ 293 | "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 294 | ] 295 | 296 | [[package]] 297 | name = "hermit-abi" 298 | version = "0.1.8" 299 | source = "registry+https://github.com/rust-lang/crates.io-index" 300 | dependencies = [ 301 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 302 | ] 303 | 304 | [[package]] 305 | name = "http" 306 | version = "0.2.0" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | dependencies = [ 309 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 310 | "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 311 | "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", 312 | ] 313 | 314 | [[package]] 315 | name = "http-body" 316 | version = "0.3.1" 317 | source = "registry+https://github.com/rust-lang/crates.io-index" 318 | dependencies = [ 319 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 320 | "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 321 | ] 322 | 323 | [[package]] 324 | name = "httparse" 325 | version = "1.3.4" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | 328 | [[package]] 329 | name = "hyper" 330 | version = "0.13.2" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | dependencies = [ 333 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 334 | "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 335 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 336 | "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 337 | "h2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 338 | "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 339 | "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 340 | "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 341 | "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", 342 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 343 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 344 | "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 345 | "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 346 | "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 347 | "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 348 | "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 349 | ] 350 | 351 | [[package]] 352 | name = "hyper-tls" 353 | version = "0.4.1" 354 | source = "registry+https://github.com/rust-lang/crates.io-index" 355 | dependencies = [ 356 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 357 | "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", 358 | "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 359 | "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 360 | "tokio-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 361 | ] 362 | 363 | [[package]] 364 | name = "idna" 365 | version = "0.2.0" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | dependencies = [ 368 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 369 | "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 370 | "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", 371 | ] 372 | 373 | [[package]] 374 | name = "indexmap" 375 | version = "1.3.2" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | dependencies = [ 378 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 379 | ] 380 | 381 | [[package]] 382 | name = "iovec" 383 | version = "0.1.4" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | dependencies = [ 386 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 387 | ] 388 | 389 | [[package]] 390 | name = "itoa" 391 | version = "0.4.5" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | 394 | [[package]] 395 | name = "js_int" 396 | version = "0.1.2" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | dependencies = [ 399 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 400 | ] 401 | 402 | [[package]] 403 | name = "kernel32-sys" 404 | version = "0.2.2" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | dependencies = [ 407 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 408 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 409 | ] 410 | 411 | [[package]] 412 | name = "lazy_static" 413 | version = "1.4.0" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | 416 | [[package]] 417 | name = "libc" 418 | version = "0.2.67" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | 421 | [[package]] 422 | name = "linked-hash-map" 423 | version = "0.5.2" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | 426 | [[package]] 427 | name = "log" 428 | version = "0.4.8" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | dependencies = [ 431 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 432 | ] 433 | 434 | [[package]] 435 | name = "matches" 436 | version = "0.1.8" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | 439 | [[package]] 440 | name = "memchr" 441 | version = "2.3.3" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | 444 | [[package]] 445 | name = "mio" 446 | version = "0.6.21" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | dependencies = [ 449 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 450 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 451 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 452 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 453 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 454 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 455 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 456 | "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 457 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 458 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 459 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 460 | ] 461 | 462 | [[package]] 463 | name = "miow" 464 | version = "0.2.1" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | dependencies = [ 467 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 468 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 469 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 470 | "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 471 | ] 472 | 473 | [[package]] 474 | name = "native-tls" 475 | version = "0.2.3" 476 | source = "registry+https://github.com/rust-lang/crates.io-index" 477 | dependencies = [ 478 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 479 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 480 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 481 | "openssl 0.10.28 (registry+https://github.com/rust-lang/crates.io-index)", 482 | "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 483 | "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", 484 | "schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", 485 | "security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 486 | "security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 487 | "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 488 | ] 489 | 490 | [[package]] 491 | name = "net2" 492 | version = "0.2.33" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | dependencies = [ 495 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 496 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 497 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 498 | ] 499 | 500 | [[package]] 501 | name = "num-integer" 502 | version = "0.1.42" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | dependencies = [ 505 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 506 | "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 507 | ] 508 | 509 | [[package]] 510 | name = "num-traits" 511 | version = "0.2.11" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | dependencies = [ 514 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 515 | ] 516 | 517 | [[package]] 518 | name = "openssl" 519 | version = "0.10.28" 520 | source = "registry+https://github.com/rust-lang/crates.io-index" 521 | dependencies = [ 522 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 523 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 524 | "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 525 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 526 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 527 | "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", 528 | ] 529 | 530 | [[package]] 531 | name = "openssl-probe" 532 | version = "0.1.2" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | 535 | [[package]] 536 | name = "openssl-sys" 537 | version = "0.9.54" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | dependencies = [ 540 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 541 | "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", 542 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 543 | "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", 544 | "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 545 | ] 546 | 547 | [[package]] 548 | name = "percent-encoding" 549 | version = "2.1.0" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | 552 | [[package]] 553 | name = "pin-project" 554 | version = "0.4.8" 555 | source = "registry+https://github.com/rust-lang/crates.io-index" 556 | dependencies = [ 557 | "pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 558 | ] 559 | 560 | [[package]] 561 | name = "pin-project-internal" 562 | version = "0.4.8" 563 | source = "registry+https://github.com/rust-lang/crates.io-index" 564 | dependencies = [ 565 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 566 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 567 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 568 | ] 569 | 570 | [[package]] 571 | name = "pin-project-lite" 572 | version = "0.1.4" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | 575 | [[package]] 576 | name = "pin-utils" 577 | version = "0.1.0-alpha.4" 578 | source = "registry+https://github.com/rust-lang/crates.io-index" 579 | 580 | [[package]] 581 | name = "pkg-config" 582 | version = "0.3.17" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | 585 | [[package]] 586 | name = "ppv-lite86" 587 | version = "0.2.6" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | 590 | [[package]] 591 | name = "proc-macro-error" 592 | version = "0.4.9" 593 | source = "registry+https://github.com/rust-lang/crates.io-index" 594 | dependencies = [ 595 | "proc-macro-error-attr 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", 596 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 597 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 598 | "rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 599 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 600 | ] 601 | 602 | [[package]] 603 | name = "proc-macro-error-attr" 604 | version = "0.4.9" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | dependencies = [ 607 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 608 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 609 | "rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 610 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 611 | "syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 612 | ] 613 | 614 | [[package]] 615 | name = "proc-macro-hack" 616 | version = "0.5.11" 617 | source = "registry+https://github.com/rust-lang/crates.io-index" 618 | dependencies = [ 619 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 620 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 621 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 622 | ] 623 | 624 | [[package]] 625 | name = "proc-macro-nested" 626 | version = "0.1.3" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | 629 | [[package]] 630 | name = "proc-macro2" 631 | version = "1.0.9" 632 | source = "registry+https://github.com/rust-lang/crates.io-index" 633 | dependencies = [ 634 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 635 | ] 636 | 637 | [[package]] 638 | name = "quote" 639 | version = "1.0.2" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | dependencies = [ 642 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 643 | ] 644 | 645 | [[package]] 646 | name = "rand" 647 | version = "0.7.3" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | dependencies = [ 650 | "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", 651 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 652 | "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 653 | "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 654 | "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 655 | ] 656 | 657 | [[package]] 658 | name = "rand_chacha" 659 | version = "0.2.1" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | dependencies = [ 662 | "c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 663 | "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 664 | ] 665 | 666 | [[package]] 667 | name = "rand_core" 668 | version = "0.5.1" 669 | source = "registry+https://github.com/rust-lang/crates.io-index" 670 | dependencies = [ 671 | "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", 672 | ] 673 | 674 | [[package]] 675 | name = "rand_hc" 676 | version = "0.2.0" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | dependencies = [ 679 | "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 680 | ] 681 | 682 | [[package]] 683 | name = "redox_syscall" 684 | version = "0.1.56" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | 687 | [[package]] 688 | name = "remove_dir_all" 689 | version = "0.5.2" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | dependencies = [ 692 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 693 | ] 694 | 695 | [[package]] 696 | name = "ruma-api" 697 | version = "0.13.1" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | dependencies = [ 700 | "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 701 | "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 702 | "ruma-api-macros 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", 703 | "ruma-identifiers 0.14.1 (git+https://github.com/ruma/ruma-identifiers.git)", 704 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 705 | "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", 706 | "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", 707 | "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 708 | ] 709 | 710 | [[package]] 711 | name = "ruma-api-macros" 712 | version = "0.10.1" 713 | source = "registry+https://github.com/rust-lang/crates.io-index" 714 | dependencies = [ 715 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 716 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 717 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 718 | ] 719 | 720 | [[package]] 721 | name = "ruma-client" 722 | version = "0.3.0" 723 | source = "registry+https://github.com/rust-lang/crates.io-index" 724 | dependencies = [ 725 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 726 | "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 727 | "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 728 | "hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", 729 | "hyper-tls 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 730 | "ruma-api 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", 731 | "ruma-client-api 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 732 | "ruma-events 0.15.1 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)", 733 | "ruma-identifiers 0.14.1 (git+https://github.com/ruma/ruma-identifiers.git)", 734 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 735 | "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", 736 | "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", 737 | "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 738 | ] 739 | 740 | [[package]] 741 | name = "ruma-client-api" 742 | version = "0.6.0" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | dependencies = [ 745 | "js_int 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 746 | "ruma-api 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", 747 | "ruma-events 0.15.1 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)", 748 | "ruma-identifiers 0.14.1 (git+https://github.com/ruma/ruma-identifiers.git)", 749 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 750 | "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", 751 | "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 752 | ] 753 | 754 | [[package]] 755 | name = "ruma-events" 756 | version = "0.15.1" 757 | source = "git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport#4331dc1f5b831f1db6a88f678379e6c8ba6865f7" 758 | dependencies = [ 759 | "js_int 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 760 | "ruma-events-macros 0.2.0 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)", 761 | "ruma-identifiers 0.14.1 (git+https://github.com/ruma/ruma-identifiers.git)", 762 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 763 | "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", 764 | ] 765 | 766 | [[package]] 767 | name = "ruma-events-macros" 768 | version = "0.2.0" 769 | source = "git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport#4331dc1f5b831f1db6a88f678379e6c8ba6865f7" 770 | dependencies = [ 771 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 772 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 773 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 774 | ] 775 | 776 | [[package]] 777 | name = "ruma-identifiers" 778 | version = "0.14.1" 779 | source = "git+https://github.com/ruma/ruma-identifiers.git#81fb260a4693e87611b0c852515067f6e0d2c25e" 780 | dependencies = [ 781 | "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", 782 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 783 | "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 784 | ] 785 | 786 | [[package]] 787 | name = "rustc-demangle" 788 | version = "0.1.16" 789 | source = "registry+https://github.com/rust-lang/crates.io-index" 790 | 791 | [[package]] 792 | name = "rustversion" 793 | version = "1.0.2" 794 | source = "registry+https://github.com/rust-lang/crates.io-index" 795 | dependencies = [ 796 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 797 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 798 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 799 | ] 800 | 801 | [[package]] 802 | name = "ryu" 803 | version = "1.0.2" 804 | source = "registry+https://github.com/rust-lang/crates.io-index" 805 | 806 | [[package]] 807 | name = "schannel" 808 | version = "0.1.17" 809 | source = "registry+https://github.com/rust-lang/crates.io-index" 810 | dependencies = [ 811 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 812 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 813 | ] 814 | 815 | [[package]] 816 | name = "security-framework" 817 | version = "0.3.4" 818 | source = "registry+https://github.com/rust-lang/crates.io-index" 819 | dependencies = [ 820 | "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 821 | "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", 822 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 823 | "security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 824 | ] 825 | 826 | [[package]] 827 | name = "security-framework-sys" 828 | version = "0.3.3" 829 | source = "registry+https://github.com/rust-lang/crates.io-index" 830 | dependencies = [ 831 | "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", 832 | ] 833 | 834 | [[package]] 835 | name = "serde" 836 | version = "1.0.104" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | dependencies = [ 839 | "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 840 | ] 841 | 842 | [[package]] 843 | name = "serde_derive" 844 | version = "1.0.104" 845 | source = "registry+https://github.com/rust-lang/crates.io-index" 846 | dependencies = [ 847 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 848 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 849 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 850 | ] 851 | 852 | [[package]] 853 | name = "serde_json" 854 | version = "1.0.48" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | dependencies = [ 857 | "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", 858 | "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 859 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 860 | ] 861 | 862 | [[package]] 863 | name = "serde_urlencoded" 864 | version = "0.6.1" 865 | source = "registry+https://github.com/rust-lang/crates.io-index" 866 | dependencies = [ 867 | "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", 868 | "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", 869 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 870 | "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 871 | ] 872 | 873 | [[package]] 874 | name = "serde_yaml" 875 | version = "0.8.11" 876 | source = "registry+https://github.com/rust-lang/crates.io-index" 877 | dependencies = [ 878 | "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", 879 | "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", 880 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 881 | "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 882 | ] 883 | 884 | [[package]] 885 | name = "slab" 886 | version = "0.4.2" 887 | source = "registry+https://github.com/rust-lang/crates.io-index" 888 | 889 | [[package]] 890 | name = "smallvec" 891 | version = "1.2.0" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | 894 | [[package]] 895 | name = "strsim" 896 | version = "0.9.3" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | 899 | [[package]] 900 | name = "syn" 901 | version = "1.0.16" 902 | source = "registry+https://github.com/rust-lang/crates.io-index" 903 | dependencies = [ 904 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 905 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 906 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 907 | ] 908 | 909 | [[package]] 910 | name = "syn-mid" 911 | version = "0.5.0" 912 | source = "registry+https://github.com/rust-lang/crates.io-index" 913 | dependencies = [ 914 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 915 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 916 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 917 | ] 918 | 919 | [[package]] 920 | name = "synstructure" 921 | version = "0.12.3" 922 | source = "registry+https://github.com/rust-lang/crates.io-index" 923 | dependencies = [ 924 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 925 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 926 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 927 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 928 | ] 929 | 930 | [[package]] 931 | name = "tempfile" 932 | version = "3.1.0" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | dependencies = [ 935 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 936 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 937 | "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", 938 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 939 | "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", 940 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 941 | ] 942 | 943 | [[package]] 944 | name = "textwrap" 945 | version = "0.11.0" 946 | source = "registry+https://github.com/rust-lang/crates.io-index" 947 | dependencies = [ 948 | "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 949 | ] 950 | 951 | [[package]] 952 | name = "time" 953 | version = "0.1.42" 954 | source = "registry+https://github.com/rust-lang/crates.io-index" 955 | dependencies = [ 956 | "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", 957 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 958 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 959 | ] 960 | 961 | [[package]] 962 | name = "tokio" 963 | version = "0.2.12" 964 | source = "registry+https://github.com/rust-lang/crates.io-index" 965 | dependencies = [ 966 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 967 | "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 968 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 969 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 970 | "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 971 | "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", 972 | "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 973 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 974 | "tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", 975 | ] 976 | 977 | [[package]] 978 | name = "tokio-macros" 979 | version = "0.2.5" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | dependencies = [ 982 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 983 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 984 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 985 | ] 986 | 987 | [[package]] 988 | name = "tokio-tls" 989 | version = "0.3.0" 990 | source = "registry+https://github.com/rust-lang/crates.io-index" 991 | dependencies = [ 992 | "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 993 | "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 994 | ] 995 | 996 | [[package]] 997 | name = "tokio-util" 998 | version = "0.2.0" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | dependencies = [ 1001 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 1002 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 1003 | "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 1004 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 1005 | "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 1006 | "tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "tower-service" 1011 | version = "0.3.0" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | 1014 | [[package]] 1015 | name = "try-lock" 1016 | version = "0.2.2" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | 1019 | [[package]] 1020 | name = "unicode-bidi" 1021 | version = "0.3.4" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | dependencies = [ 1024 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 1025 | ] 1026 | 1027 | [[package]] 1028 | name = "unicode-normalization" 1029 | version = "0.1.12" 1030 | source = "registry+https://github.com/rust-lang/crates.io-index" 1031 | dependencies = [ 1032 | "smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 1033 | ] 1034 | 1035 | [[package]] 1036 | name = "unicode-segmentation" 1037 | version = "1.6.0" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | 1040 | [[package]] 1041 | name = "unicode-width" 1042 | version = "0.1.7" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | 1045 | [[package]] 1046 | name = "unicode-xid" 1047 | version = "0.2.0" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | 1050 | [[package]] 1051 | name = "url" 1052 | version = "2.1.1" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | dependencies = [ 1055 | "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 1056 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 1057 | "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 1058 | "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 1059 | ] 1060 | 1061 | [[package]] 1062 | name = "vcpkg" 1063 | version = "0.2.8" 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" 1065 | 1066 | [[package]] 1067 | name = "vec_map" 1068 | version = "0.8.1" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | 1071 | [[package]] 1072 | name = "want" 1073 | version = "0.3.0" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | dependencies = [ 1076 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 1077 | "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 1078 | ] 1079 | 1080 | [[package]] 1081 | name = "wasi" 1082 | version = "0.9.0+wasi-snapshot-preview1" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | 1085 | [[package]] 1086 | name = "winapi" 1087 | version = "0.2.8" 1088 | source = "registry+https://github.com/rust-lang/crates.io-index" 1089 | 1090 | [[package]] 1091 | name = "winapi" 1092 | version = "0.3.8" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | dependencies = [ 1095 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 1096 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 1097 | ] 1098 | 1099 | [[package]] 1100 | name = "winapi-build" 1101 | version = "0.1.1" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | 1104 | [[package]] 1105 | name = "winapi-i686-pc-windows-gnu" 1106 | version = "0.4.0" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | 1109 | [[package]] 1110 | name = "winapi-x86_64-pc-windows-gnu" 1111 | version = "0.4.0" 1112 | source = "registry+https://github.com/rust-lang/crates.io-index" 1113 | 1114 | [[package]] 1115 | name = "ws2_32-sys" 1116 | version = "0.2.1" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | dependencies = [ 1119 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 1120 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 1121 | ] 1122 | 1123 | [[package]] 1124 | name = "yaml-rust" 1125 | version = "0.4.3" 1126 | source = "registry+https://github.com/rust-lang/crates.io-index" 1127 | dependencies = [ 1128 | "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", 1129 | ] 1130 | 1131 | [metadata] 1132 | "checksum ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 1133 | "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 1134 | "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 1135 | "checksum backtrace 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)" = "e4036b9bf40f3cf16aba72a3d65e8a520fc4bafcdc7079aea8f848c58c5b5536" 1136 | "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" 1137 | "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 1138 | "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" 1139 | "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" 1140 | "checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" 1141 | "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 1142 | "checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" 1143 | "checksum clap 3.0.0-beta.1 (git+https://github.com/clap-rs/clap/)" = "" 1144 | "checksum clap_derive 3.0.0-beta.1 (git+https://github.com/clap-rs/clap/)" = "" 1145 | "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" 1146 | "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" 1147 | "checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" 1148 | "checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" 1149 | "checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" 1150 | "checksum fern 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e69ab0d5aca163e388c3a49d284fed6c3d0810700e77c5ae2756a50ec1a4daaa" 1151 | "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" 1152 | "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 1153 | "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 1154 | "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 1155 | "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 1156 | "checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" 1157 | "checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" 1158 | "checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" 1159 | "checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" 1160 | "checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" 1161 | "checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" 1162 | "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 1163 | "checksum h2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9433d71e471c1736fd5a61b671fc0b148d7a2992f666c958d03cd8feb3b88d1" 1164 | "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" 1165 | "checksum hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" 1166 | "checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" 1167 | "checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" 1168 | "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 1169 | "checksum hyper 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fa1c527bbc634be72aa7ba31e4e4def9bbb020f5416916279b7c705cd838893e" 1170 | "checksum hyper-tls 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3adcd308402b9553630734e9c36b77a7e48b3821251ca2493e8cd596763aafaa" 1171 | "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 1172 | "checksum indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" 1173 | "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 1174 | "checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" 1175 | "checksum js_int 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a28645cf69403534c8b3c961783cdc227c4c4fa5d31468464de1f43be0efcfc" 1176 | "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 1177 | "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 1178 | "checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" 1179 | "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" 1180 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 1181 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 1182 | "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 1183 | "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" 1184 | "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 1185 | "checksum native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" 1186 | "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" 1187 | "checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" 1188 | "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" 1189 | "checksum openssl 0.10.28 (registry+https://github.com/rust-lang/crates.io-index)" = "973293749822d7dd6370d6da1e523b0d1db19f06c459134c658b2a4261378b52" 1190 | "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 1191 | "checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" 1192 | "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 1193 | "checksum pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" 1194 | "checksum pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" 1195 | "checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" 1196 | "checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" 1197 | "checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" 1198 | "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" 1199 | "checksum proc-macro-error 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "052b3c9af39c7e5e94245f820530487d19eb285faedcb40e0c3275132293f242" 1200 | "checksum proc-macro-error-attr 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d175bef481c7902e63e3165627123fff3502f06ac043d3ef42d08c1246da9253" 1201 | "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" 1202 | "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" 1203 | "checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" 1204 | "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" 1205 | "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1206 | "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" 1207 | "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1208 | "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1209 | "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 1210 | "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" 1211 | "checksum ruma-api 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b56cf718a9b575a9ce4fae92399c5c00b9059b2d3fbc6bfb4ff4f00431e50290" 1212 | "checksum ruma-api-macros 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e2c60086b570af5d8b88c9e2f10b3c4c950436658a104c3e60117eca2b1c466" 1213 | "checksum ruma-client 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e333757b70f7c8e289191e9db1e5db21d56495507dd9aaeadcdbedded55418" 1214 | "checksum ruma-client-api 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aa35e24b165401c1066416d804d830313f27d934dcd71f4388396a42f98ba020" 1215 | "checksum ruma-events 0.15.1 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)" = "" 1216 | "checksum ruma-events-macros 0.2.0 (git+https://github.com/MTRNord/ruma-events.git?branch=relates_to_backport)" = "" 1217 | "checksum ruma-identifiers 0.14.1 (git+https://github.com/ruma/ruma-identifiers.git)" = "" 1218 | "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" 1219 | "checksum rustversion 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bba175698996010c4f6dce5e7f173b6eb781fce25d2cfc45e27091ce0b79f6" 1220 | "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" 1221 | "checksum schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" 1222 | "checksum security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8ef2429d7cefe5fd28bd1d2ed41c944547d4ff84776f5935b456da44593a16df" 1223 | "checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" 1224 | "checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" 1225 | "checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" 1226 | "checksum serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" 1227 | "checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" 1228 | "checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" 1229 | "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 1230 | "checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" 1231 | "checksum strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" 1232 | "checksum syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" 1233 | "checksum syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" 1234 | "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" 1235 | "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 1236 | "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 1237 | "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" 1238 | "checksum tokio 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "b34bee1facdc352fba10c9c58b654e6ecb6a2250167772bf86071f7c5f2f5061" 1239 | "checksum tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" 1240 | "checksum tokio-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7bde02a3a5291395f59b06ec6945a3077602fac2b07eeeaf0dee2122f3619828" 1241 | "checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" 1242 | "checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 1243 | "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" 1244 | "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 1245 | "checksum unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" 1246 | "checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" 1247 | "checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" 1248 | "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 1249 | "checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" 1250 | "checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" 1251 | "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" 1252 | "checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1253 | "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1254 | "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1255 | "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 1256 | "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1257 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1258 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1259 | "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1260 | "checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" 1261 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "auto-invite-matrix-bot" 3 | version = "0.1.0" 4 | authors = ["Marcel "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | ruma-client = "0.3.0" 11 | futures-core = "0.3.4" 12 | futures-util = "0.3.4" 13 | tokio = { version = "0.2.11", features = ["macros"] } 14 | url = "2.1.1" 15 | clap = { git = "https://github.com/clap-rs/clap/" } 16 | serde = { version = "1.0", features = ["derive"] } 17 | serde_yaml = "0.8" 18 | log = "0.4.8" 19 | fern = "0.5" 20 | chrono = "0.4.10" 21 | rand = "0.7.3" 22 | failure = "0.1.6" 23 | 24 | [patch.crates-io] 25 | ruma-identifiers = { git = 'https://github.com/ruma/ruma-identifiers.git' } 26 | ruma-events = { git = 'https://github.com/MTRNord/ruma-events.git', branch = "relates_to_backport" } 27 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rust as builder 2 | 3 | WORKDIR /opt/auto-invite-matrix-bot 4 | COPY . . 5 | RUN cargo install --path . 6 | 7 | FROM debian:buster-slim 8 | COPY --from=builder /usr/local/cargo/bin/auto-invite-matrix-bot /usr/local/bin/auto-invite-matrix-bot 9 | RUN apt-get update && apt-get install -y libssl1.1 ca-certificates && rm -rf /var/lib/apt/lists/* 10 | 11 | WORKDIR / 12 | 13 | CMD ["auto-invite-matrix-bot"] 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # auto-invite-matrix-bot 2 | 3 | Bot allows redirect people, that send messages to one of your "wrong" (old, abandoned, not active) Matrix accounts to your real account. 4 | 5 | It does join on invite, invites your "real" account and sends a customizable message, support listening multiple accounts or Homeservers. 6 | 7 | Also it can relay mentions from your secondary accounts to your primary account. 8 | 9 | ## Usage 10 | 1. Install rust on your system 11 | 2. Make a config file according to the config_example.yml 12 | 3. Install the application using `cargo install --git https://github.com/MTRNord/auto-invite-matrix-bot.git` 13 | 4. Run it with `auto-invite-matrix-bot` with an addition `--config` argument to point to your config file 14 | -------------------------------------------------------------------------------- /auto-invite-matrix-bot.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /config_example.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 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!" 3 | target_user: "@MTRNord:matrix.ffslfl.net" 4 | debug: true 5 | servers: 6 | - address: "https://mozilla.modular.im" 7 | mxid: "@mtrnord:mozilla.org" 8 | access_token: "" # Use either access_token or password 9 | password: "" # Use either access_token or password 10 | -------------------------------------------------------------------------------- /src/config.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::BufReader; 3 | 4 | use serde::{Deserialize, Serialize}; 5 | 6 | #[derive(Debug, PartialEq, Serialize, Deserialize)] 7 | pub struct Config { 8 | pub message: String, 9 | pub target_user: String, 10 | pub servers: Vec, 11 | pub debug: bool, 12 | } 13 | 14 | #[derive(Debug, PartialEq, Serialize, Deserialize)] 15 | pub struct Homeserver { 16 | pub address: String, 17 | pub mxid: String, 18 | pub access_token: Option, 19 | pub password: Option, 20 | } 21 | 22 | pub fn load_config(config_file: String) -> Result { 23 | let f = File::open(config_file).expect("Unable to open config file"); 24 | let br = BufReader::new(f); 25 | 26 | let deserialized_config: Config = serde_yaml::from_reader(br)?; 27 | Ok(deserialized_config) 28 | } 29 | -------------------------------------------------------------------------------- /src/logger.rs: -------------------------------------------------------------------------------- 1 | use log::LevelFilter; 2 | pub fn setup_logger(crate_level: LevelFilter) -> Result<(), fern::InitError> { 3 | fern::Dispatch::new() 4 | .format(|out, message, record| { 5 | out.finish(format_args!( 6 | "{}[{}][{}] {}", 7 | chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"), 8 | record.target(), 9 | record.level(), 10 | message 11 | )) 12 | }) 13 | // output all messages 14 | .level(log::LevelFilter::Warn) 15 | .level_for("auto_invite_matrix_bot", crate_level) 16 | .level_for("ruma_client", crate_level) 17 | .chain(std::io::stdout()) 18 | .chain(fern::log_file("output.log")?) 19 | .apply()?; 20 | Ok(()) 21 | } 22 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::convert::TryFrom; 2 | use std::fs; 3 | use std::fs::File; 4 | use std::io::{BufReader, BufWriter, Read, Write}; 5 | 6 | use clap::Clap; 7 | use futures_util::stream::FuturesUnordered; 8 | use futures_util::stream::TryStreamExt as _; 9 | use log::{debug, error, info, warn}; 10 | use rand::distributions::Alphanumeric; 11 | use rand::{thread_rng, Rng}; 12 | use ruma_client::api::r0::membership::invite_user; 13 | use ruma_client::api::r0::membership::join_room_by_id; 14 | use ruma_client::api::r0::message::create_message_event; 15 | use ruma_client::api::r0::sync::sync_events::IncomingResponse; 16 | use ruma_client::identifiers::UserId; 17 | use ruma_client::{ 18 | self, 19 | api::r0::{ 20 | filter::{FilterDefinition, RoomEventFilter, RoomFilter}, 21 | message::create_message_event::Response, 22 | room::create_room, 23 | sync::sync_events::Filter, 24 | }, 25 | events::{ 26 | collections::all::RoomEvent::{self, RoomMessage}, 27 | room::message::{ 28 | InReplyTo, MessageEvent, 29 | MessageEventContent::{self, Text}, 30 | NoticeMessageEventContent, RelatesTo, TextMessageEventContent, 31 | }, 32 | EventType, 33 | }, 34 | identifiers::{EventId, RoomId}, 35 | HttpsClient, Session, 36 | }; 37 | use url::Url; 38 | 39 | use crate::config::{load_config, Config, Homeserver}; 40 | use crate::logger::setup_logger; 41 | 42 | mod config; 43 | mod logger; 44 | 45 | async fn send_notice_reply( 46 | client: &HttpsClient, 47 | text: String, 48 | related_event: EventId, 49 | room_id: RoomId, 50 | ) -> Result { 51 | let rand_string: String = thread_rng().sample_iter(&Alphanumeric).take(30).collect(); 52 | client 53 | .request(create_message_event::Request { 54 | room_id, 55 | event_type: EventType::RoomMessage, 56 | txn_id: rand_string, 57 | data: MessageEventContent::Notice(NoticeMessageEventContent { 58 | body: text, 59 | relates_to: Some(RelatesTo { 60 | in_reply_to: InReplyTo { 61 | event_id: related_event, 62 | }, 63 | }), 64 | }), 65 | }) 66 | .await 67 | } 68 | 69 | async fn send_message( 70 | client: &HttpsClient, 71 | text: String, 72 | room_id: RoomId, 73 | ) -> Result { 74 | let rand_string: String = thread_rng().sample_iter(&Alphanumeric).take(30).collect(); 75 | client 76 | .request(create_message_event::Request { 77 | room_id, 78 | event_type: EventType::RoomMessage, 79 | txn_id: rand_string, 80 | data: MessageEventContent::Text(TextMessageEventContent { 81 | body: text, 82 | format: None, 83 | formatted_body: None, 84 | relates_to: None, 85 | }), 86 | }) 87 | .await 88 | } 89 | 90 | async fn get_control_room( 91 | client: &HttpsClient, 92 | target_user: String, 93 | ) -> Result { 94 | fs::create_dir_all("./tmp/")?; 95 | let mut room_id_read = String::new(); 96 | match File::open(format!( 97 | "./tmp/control_room_{}", 98 | client.session().unwrap().user_id.hostname() 99 | )) { 100 | Ok(f) => { 101 | let mut br = BufReader::new(f); 102 | match br.read_to_string(&mut room_id_read) { 103 | Ok(_) => { 104 | let room_id = RoomId::try_from(room_id_read.as_str()).unwrap(); 105 | Ok(room_id) 106 | } 107 | Err(e) => Err(failure::Error::try_from(e)?), 108 | } 109 | } 110 | Err(e) => { 111 | warn!("Unable to open control_room_tmp: {}", e); 112 | let resp = client 113 | .request(create_room::Request { 114 | invite: vec![UserId::try_from(target_user.as_str())?], 115 | name: Some(format!( 116 | "AutoInviteBot Control Room {}", 117 | client.session().unwrap().user_id.hostname() 118 | )), 119 | preset: Some(create_room::RoomPreset::TrustedPrivateChat), 120 | creation_content: None, 121 | room_alias_name: None, 122 | topic: None, 123 | visibility: None, 124 | }) 125 | .await?; 126 | let room_id: RoomId = resp.room_id; 127 | let f = File::create(format!( 128 | "./tmp/control_room_{}", 129 | client.session().unwrap().user_id.hostname() 130 | ))?; 131 | let mut f = BufWriter::new(f); 132 | f.write_all(room_id.to_string().as_bytes())?; 133 | 134 | Ok(room_id) 135 | } 136 | } 137 | } 138 | 139 | async fn get_client( 140 | server: &Homeserver, 141 | target_user: String, 142 | ) -> Result<(HttpsClient, RoomId), failure::Error> { 143 | info!("Starting session as {}", server.mxid); 144 | 145 | let session: Session; 146 | let mut client: HttpsClient = HttpsClient::https( 147 | Url::parse(server.address.as_str()).expect("unable to parse url"), 148 | None, 149 | ); 150 | if server.access_token.is_some() { 151 | session = Session { 152 | device_id: "Ruma Bot".to_string(), 153 | access_token: server 154 | .access_token 155 | .as_ref() 156 | .expect("missing access_token") 157 | .to_owned(), 158 | user_id: UserId::try_from(server.mxid.as_str()).unwrap(), 159 | }; 160 | 161 | client = HttpsClient::https( 162 | Url::parse(server.address.as_str()).expect("unable to parse url"), 163 | Some(session), 164 | ); 165 | } else if server.password.is_some() { 166 | client 167 | .log_in( 168 | server.mxid.clone(), 169 | server 170 | .password 171 | .as_ref() 172 | .expect("failed to read password") 173 | .to_owned(), 174 | None, 175 | None, 176 | ) 177 | .await?; 178 | } else { 179 | error!("Please provide either a password or an access_token!"); 180 | } 181 | 182 | let control_room_id = get_control_room(&client, target_user).await?; 183 | 184 | info!("Started session as {}", server.mxid); 185 | 186 | Ok((client, control_room_id)) 187 | } 188 | 189 | async fn parse_invites( 190 | client: &HttpsClient, 191 | room_id: RoomId, 192 | target_user: String, 193 | message: String, 194 | ) -> Result<(), ruma_client::Error> { 195 | // Auto join rooms 196 | debug!("Invited to {:?}", room_id); 197 | client 198 | .request(join_room_by_id::Request { 199 | room_id: room_id.clone(), 200 | third_party_signed: None, 201 | }) 202 | .await?; 203 | debug!("Joined {:?}", room_id.clone()); 204 | let response = client 205 | .request(invite_user::Request { 206 | room_id: room_id.clone(), 207 | user_id: UserId::try_from(target_user.as_str()).unwrap(), 208 | }) 209 | .await?; 210 | debug!("Invited correct user {:?}", response); 211 | 212 | let rand_string: String = thread_rng().sample_iter(&Alphanumeric).take(30).collect(); 213 | client 214 | .request(create_message_event::Request { 215 | room_id: room_id.clone(), 216 | event_type: EventType::RoomMessage, 217 | txn_id: rand_string, 218 | data: MessageEventContent::Notice(NoticeMessageEventContent { 219 | body: message, 220 | relates_to: None, 221 | }), 222 | }) 223 | .await?; 224 | 225 | debug!("Sent a message about what happened"); 226 | Ok(()) 227 | } 228 | 229 | async fn handle_mention( 230 | client: &HttpsClient, 231 | config: &Config, 232 | control_room_id: RoomId, 233 | room_id: RoomId, 234 | sender: UserId, 235 | event_id: EventId, 236 | body: String, 237 | ) -> Result<(), failure::Error> { 238 | if config.debug { 239 | send_notice_reply( 240 | &client, 241 | format!( 242 | "> <{}> {}\n\n[DEBUG] Mentioned main account about this mention", 243 | sender, body 244 | ), 245 | event_id.clone(), 246 | room_id.clone(), 247 | ) 248 | .await?; 249 | } 250 | 251 | // Send mention to control room 252 | send_message( 253 | &client, 254 | format!( 255 | "> <{}> {}\n\n Mention in {} by {}", 256 | sender, body, room_id, sender 257 | ), 258 | control_room_id.clone(), 259 | ) 260 | .await?; 261 | 262 | Ok(()) 263 | } 264 | 265 | async fn parse_joins( 266 | client: &HttpsClient, 267 | config: &Config, 268 | server: &Homeserver, 269 | event: RoomEvent, 270 | room_id: RoomId, 271 | control_room_id: RoomId, 272 | ) -> Result<(), failure::Error> { 273 | if let RoomMessage(msg) = event { 274 | let content = msg.content; 275 | let event_id = msg.event_id; 276 | let sender = msg.sender; 277 | if let Text(msg_content) = content { 278 | let formatted_body: Option = msg_content.formatted_body; 279 | let body: String = msg_content.body; 280 | 281 | if sender.to_string() != client.session().unwrap().user_id.to_string() 282 | && formatted_body.clone().is_some() 283 | && formatted_body 284 | .clone() 285 | .unwrap() 286 | .to_lowercase() 287 | .contains(&server.mxid.clone().to_lowercase()) 288 | { 289 | handle_mention( 290 | client, 291 | config, 292 | control_room_id.clone(), 293 | room_id.clone(), 294 | sender.clone(), 295 | event_id.clone(), 296 | body.clone(), 297 | ) 298 | .await?; 299 | } else if sender.to_string() != client.session().unwrap().user_id.to_string() 300 | && formatted_body.clone().is_none() 301 | && body.to_lowercase().contains( 302 | server 303 | .mxid 304 | .clone() 305 | .to_lowercase() 306 | .split(':') 307 | .collect::>()[0], 308 | ) 309 | { 310 | handle_mention( 311 | client, 312 | config, 313 | control_room_id.clone(), 314 | room_id.clone(), 315 | sender.clone(), 316 | event_id.clone(), 317 | body.clone(), 318 | ) 319 | .await?; 320 | } 321 | // Todo make a smarter command handler 322 | /*if body.starts_with("!test") { 323 | send_notice_reply( 324 | &client, 325 | format!("> <{}> {}\n\ntest resp", sender, body), 326 | event_id.clone(), 327 | room_id.clone(), 328 | ) 329 | .await?; 330 | }*/ 331 | } 332 | } 333 | Ok(()) 334 | } 335 | 336 | async fn load_next_batch() -> Result { 337 | fs::create_dir_all("./tmp/")?; 338 | let mut next_batch = String::new(); 339 | let f = File::open("./tmp/next_batch")?; 340 | let mut br = BufReader::new(f); 341 | br.read_to_string(&mut next_batch)?; 342 | Ok(next_batch) 343 | } 344 | 345 | async fn save_next_batch(next_batch: String) -> Result<(), failure::Error> { 346 | let f = File::create("./tmp/next_batch")?; 347 | let mut f = BufWriter::new(f); 348 | f.write_all(next_batch.as_bytes())?; 349 | Ok(()) 350 | } 351 | 352 | fn generate_filter() -> Result { 353 | let filter = FilterDefinition { 354 | event_fields: None, 355 | event_format: None, 356 | account_data: None, 357 | room: Some(RoomFilter { 358 | include_leave: None, 359 | account_data: None, 360 | timeline: Some(RoomEventFilter { 361 | not_types: vec![], 362 | not_rooms: vec![], 363 | limit: None, 364 | rooms: None, 365 | not_senders: vec![], 366 | senders: None, 367 | types: Some(vec!["m.room.message".to_owned()]), 368 | contains_url: None, 369 | }), 370 | ephemeral: None, 371 | state: None, 372 | not_rooms: vec![], 373 | rooms: None, 374 | }), 375 | presence: None, 376 | }; 377 | Ok(Filter::FilterDefinition(filter)) 378 | } 379 | 380 | async fn do_stuff(config: &Config, server: &Homeserver) -> Result<(), failure::Error> { 381 | let target_user = config.target_user.clone(); 382 | let (client, control_room_id) = get_client(server, target_user.clone()).await?; 383 | 384 | let since = match load_next_batch().await { 385 | Ok(v) => Some(v), 386 | Err(e) => { 387 | error!("{:?}", e); 388 | None 389 | } 390 | }; 391 | 392 | let filter = match generate_filter() { 393 | Ok(v) => Some(v), 394 | Err(e) => { 395 | error!("{:?}", e); 396 | None 397 | } 398 | }; 399 | 400 | let mut sync_stream = Box::pin(client.sync(filter, since, false)); 401 | let message = config.message.clone(); 402 | while let Some(response) = sync_stream.try_next().await? { 403 | let res: IncomingResponse = response; 404 | let next_batch: String = res.next_batch; 405 | save_next_batch(next_batch).await?; 406 | 407 | for (room_id, _room) in res.rooms.invite { 408 | parse_invites( 409 | &client, 410 | room_id.clone(), 411 | target_user.clone(), 412 | message.clone(), 413 | ) 414 | .await?; 415 | } 416 | for (room_id, room) in res.rooms.join { 417 | let events = room.timeline.events; 418 | 419 | for event in events.into_iter().flat_map(|r| r.into_result()) { 420 | if let RoomEvent::RoomMessage(MessageEvent { .. }) = event { 421 | parse_joins( 422 | &client, 423 | config, 424 | server, 425 | event.clone(), 426 | room_id.clone(), 427 | control_room_id.clone(), 428 | ) 429 | .await?; 430 | } 431 | } 432 | } 433 | } 434 | 435 | Ok(()) 436 | } 437 | 438 | #[derive(Clap)] 439 | #[clap(version = "0.1.0", author = "MTRNord")] 440 | struct Opts { 441 | #[clap(short = 'c', long = "config", default_value = "config.yaml")] 442 | config: String, 443 | /// A level of verbosity, and can be used multiple times 444 | #[clap(short = 'v', long = "verbose", parse(from_occurrences))] 445 | verbose: i32, 446 | } 447 | 448 | #[tokio::main] 449 | async fn main() -> Result<(), failure::Error> { 450 | let opts: Opts = Opts::parse(); 451 | 452 | let log_level = match opts.verbose { 453 | 0 => log::LevelFilter::Info, // default 454 | 1 => log::LevelFilter::Error, // -v 455 | 2 => log::LevelFilter::Warn, // -vv 456 | 3 => log::LevelFilter::Debug, // -vvv 457 | _ => log::LevelFilter::Trace, // -vvvv and above 458 | }; 459 | 460 | setup_logger(log_level).expect("unable to setup logger"); 461 | 462 | let config = load_config(opts.config).expect("unable to read config"); 463 | 464 | let mut futures = FuturesUnordered::new(); 465 | 466 | config.servers.iter().for_each(|x| { 467 | futures.push(do_stuff(&config, x)); 468 | }); 469 | 470 | while let Some(x) = futures.try_next().await? { 471 | error!("{:?}", x); 472 | } 473 | 474 | Ok(()) 475 | } 476 | --------------------------------------------------------------------------------