Compare commits
2 commits
eac3d4bc3f
...
84112a1027
Author | SHA1 | Date | |
---|---|---|---|
|
84112a1027 | ||
|
f828837efe |
377
Cargo.lock
generated
377
Cargo.lock
generated
|
@ -83,6 +83,7 @@ checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
|
|||
dependencies = [
|
||||
"getrandom 0.2.3",
|
||||
"once_cell",
|
||||
"serde",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
|
@ -180,9 +181,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.61"
|
||||
version = "0.3.62"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01"
|
||||
checksum = "091bcdf2da9950f96aa522681ce805e6857f6ca8df73833d35736ab2dc78e152"
|
||||
dependencies = [
|
||||
"addr2line",
|
||||
"cc",
|
||||
|
@ -193,12 +194,6 @@ dependencies = [
|
|||
"rustc-demangle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "base-x"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.13.0"
|
||||
|
@ -228,9 +223,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
version = "3.7.1"
|
||||
version = "3.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538"
|
||||
checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c"
|
||||
|
||||
[[package]]
|
||||
name = "bytemuck"
|
||||
|
@ -318,12 +313,6 @@ version = "1.0.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919"
|
||||
|
||||
[[package]]
|
||||
name = "chunked_transfer"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e"
|
||||
|
||||
[[package]]
|
||||
name = "cipher"
|
||||
version = "0.3.0"
|
||||
|
@ -395,12 +384,6 @@ version = "0.6.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b"
|
||||
|
||||
[[package]]
|
||||
name = "const_fn"
|
||||
version = "0.4.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7"
|
||||
|
||||
[[package]]
|
||||
name = "copypasta"
|
||||
version = "0.7.1"
|
||||
|
@ -740,12 +723,6 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "discard"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
|
||||
|
||||
[[package]]
|
||||
name = "dispatch"
|
||||
version = "0.2.0"
|
||||
|
@ -801,11 +778,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "eframe"
|
||||
version = "0.14.0"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5aeeebd536f1a2737661be42819ed58a7aac69a4bf061610b373467f886574e6"
|
||||
checksum = "3a084390b90aa223d5fb6ee3d2ac3a2ded0df212f684f91fbb5f0f45ab9e0724"
|
||||
dependencies = [
|
||||
"egui",
|
||||
"egui-winit",
|
||||
"egui_glium",
|
||||
"egui_web",
|
||||
"epi",
|
||||
|
@ -813,12 +791,14 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "egui"
|
||||
version = "0.14.2"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b403f29d592b5c2267279bfdf2cd3fe3ba0e7a8738d03203a6f1536e8e9d26bd"
|
||||
checksum = "1c8d416a3343cbfc6f4d17bb1cba46b4d7efecb9ee541967763e0b5e04e5fae7"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"epaint",
|
||||
"ron",
|
||||
"nohash-hasher",
|
||||
"ron 0.7.0",
|
||||
"serde",
|
||||
]
|
||||
|
||||
|
@ -830,40 +810,47 @@ dependencies = [
|
|||
"eframe",
|
||||
"futures",
|
||||
"matrix-sdk",
|
||||
"ron",
|
||||
"ron 0.6.6",
|
||||
"serde",
|
||||
"tokio",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "egui_glium"
|
||||
version = "0.14.0"
|
||||
name = "egui-winit"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "972b1882ae98f7dd2f5dcbf5efeb35448c158a8f6ba80d6cc3b8073eae1fae4f"
|
||||
checksum = "bc403e91d1bd693239f1c734193cdf0eb38c8682bbfb9990c4b6cd2db5ee368e"
|
||||
dependencies = [
|
||||
"copypasta",
|
||||
"directories-next",
|
||||
"egui",
|
||||
"epi",
|
||||
"glium",
|
||||
"ron",
|
||||
"serde",
|
||||
"ureq",
|
||||
"webbrowser",
|
||||
"winit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "egui_glium"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "26478ec89b8c9c41a45687a90f9c8fc18106e3ffd8a08559285d625185a2ac92"
|
||||
dependencies = [
|
||||
"egui",
|
||||
"egui-winit",
|
||||
"epi",
|
||||
"glium",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "egui_web"
|
||||
version = "0.14.1"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a70a7eee03a31589660cbfefa5ac529b9740b008d94075c46fd29f80abfad9de"
|
||||
checksum = "43f2af8984a1c9ecaaaf7f11424c78185c89b5cfe8dab3bd0fac641db81c5763"
|
||||
dependencies = [
|
||||
"egui",
|
||||
"epi",
|
||||
"js-sys",
|
||||
"ron",
|
||||
"serde",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
|
@ -877,44 +864,45 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
|||
|
||||
[[package]]
|
||||
name = "emath"
|
||||
version = "0.14.0"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cca5179aa9d15128cebb79bb56dda73a79cc66b402056ff19a992e54b365e15c"
|
||||
checksum = "24a1aaa922d55da6a2bf32957c3d153e7fb9d52ed8d69777a75092240172eb6e"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "encoding_rs"
|
||||
version = "0.8.28"
|
||||
version = "0.8.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065"
|
||||
checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "epaint"
|
||||
version = "0.14.0"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "136e7d88da926182bcfdb8217137dd347dfe5dc03b8988eaba3ef8becf83394a"
|
||||
checksum = "16bb4d3b8bbbd132c99d2a5efec8567e8b6d09b742f758ae6cf1e4b104fe0231"
|
||||
dependencies = [
|
||||
"ab_glyph",
|
||||
"ahash",
|
||||
"atomic_refcell",
|
||||
"emath",
|
||||
"ordered-float",
|
||||
"nohash-hasher",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "epi"
|
||||
version = "0.14.0"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3c033c9b4d921566a98b8831b63af5ba2a0ad7ffa62d22b897698f36c22a28a"
|
||||
checksum = "3f5e4e08127f9b86e2c450c96a3032764b63546eb170c2fc54684dc70ff3fc82"
|
||||
dependencies = [
|
||||
"directories-next",
|
||||
"egui",
|
||||
"ron",
|
||||
"ron 0.7.0",
|
||||
"serde",
|
||||
]
|
||||
|
||||
|
@ -1289,9 +1277,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.3.6"
|
||||
version = "0.3.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964"
|
||||
checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"fnv",
|
||||
|
@ -1347,9 +1335,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "http-body"
|
||||
version = "0.4.3"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5"
|
||||
checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http",
|
||||
|
@ -1370,9 +1358,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440"
|
|||
|
||||
[[package]]
|
||||
name = "hyper"
|
||||
version = "0.14.13"
|
||||
version = "0.14.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593"
|
||||
checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
|
@ -1465,13 +1453,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "instant"
|
||||
version = "0.1.11"
|
||||
version = "0.1.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd"
|
||||
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"js-sys",
|
||||
"time",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
]
|
||||
|
@ -1550,9 +1537,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.103"
|
||||
version = "0.2.105"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6"
|
||||
checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013"
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
|
@ -1625,7 +1612,7 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
|
|||
[[package]]
|
||||
name = "matrix-qrcode"
|
||||
version = "0.2.0"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=9e1024f#9e1024f4b5907f492a8599937769a139894561f9"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=2e04a37#2e04a3753ddad9aa11943c5c2b14b184d4e8e51c"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"byteorder",
|
||||
|
@ -1639,7 +1626,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "matrix-sdk"
|
||||
version = "0.4.1"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=9e1024f#9e1024f4b5907f492a8599937769a139894561f9"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=2e04a37#2e04a3753ddad9aa11943c5c2b14b184d4e8e51c"
|
||||
dependencies = [
|
||||
"async-stream",
|
||||
"backoff",
|
||||
|
@ -1667,7 +1654,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "matrix-sdk-base"
|
||||
version = "0.4.1"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=9e1024f#9e1024f4b5907f492a8599937769a139894561f9"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=2e04a37#2e04a3753ddad9aa11943c5c2b14b184d4e8e51c"
|
||||
dependencies = [
|
||||
"chacha20poly1305",
|
||||
"dashmap",
|
||||
|
@ -1692,7 +1679,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "matrix-sdk-common"
|
||||
version = "0.4.1"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=9e1024f#9e1024f4b5907f492a8599937769a139894561f9"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=2e04a37#2e04a3753ddad9aa11943c5c2b14b184d4e8e51c"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"futures",
|
||||
|
@ -1708,7 +1695,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "matrix-sdk-crypto"
|
||||
version = "0.4.1"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=9e1024f#9e1024f4b5907f492a8599937769a139894561f9"
|
||||
source = "git+https://github.com/matrix-org/matrix-rust-sdk/?rev=2e04a37#2e04a3753ddad9aa11943c5c2b14b184d4e8e51c"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"aes-gcm",
|
||||
|
@ -1799,9 +1786,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "mio"
|
||||
version = "0.7.13"
|
||||
version = "0.7.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16"
|
||||
checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
|
@ -1900,6 +1887,12 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nohash-hasher"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "7.0.0"
|
||||
|
@ -2024,9 +2017,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "object"
|
||||
version = "0.26.2"
|
||||
version = "0.27.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2"
|
||||
checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
@ -2065,15 +2058,6 @@ version = "0.3.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
||||
|
||||
[[package]]
|
||||
name = "ordered-float"
|
||||
version = "2.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97c9d06878b3a851e8026ef94bf7fef9ba93062cd412601da4d9cf369b1cc62d"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "osmesa-sys"
|
||||
version = "0.1.2"
|
||||
|
@ -2192,9 +2176,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.20"
|
||||
version = "0.3.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb"
|
||||
checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f"
|
||||
|
||||
[[package]]
|
||||
name = "png"
|
||||
|
@ -2233,9 +2217,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
version = "0.2.14"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741"
|
||||
checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-crate"
|
||||
|
@ -2296,6 +2280,15 @@ dependencies = [
|
|||
"image",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quick-xml"
|
||||
version = "0.22.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "0.6.13"
|
||||
|
@ -2450,9 +2443,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.11.5"
|
||||
version = "0.11.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51c732d463dd300362ffb44b7b125f299c23d2990411a4253824630ebc7467fb"
|
||||
checksum = "66d2927ca2f685faf0fc620ac4834690d29e7abb153add10f5812eef20b5e280"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"bytes",
|
||||
|
@ -2501,9 +2494,20 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ron"
|
||||
version = "0.6.5"
|
||||
version = "0.6.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "45005aa836116903a49cf3461474da697cfe66221762c6e95871092009ec86d6"
|
||||
checksum = "86018df177b1beef6c7c8ef949969c4f7cb9a9344181b92486b23c79995bdaa4"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"bitflags",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ron"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b861ecaade43ac97886a512b360d01d66be9f41f3c61088b42cedf92e03d678"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"bitflags",
|
||||
|
@ -2512,9 +2516,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rqrr"
|
||||
version = "0.3.2"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e88a63da014e6f18dbe76e3084feb2f6c5a570ad8d524cc1afff4a6db18404cd"
|
||||
checksum = "6fa79947f53b20adb909a323d828d0fd744fa9d854792df07913b083bcd4d63b"
|
||||
dependencies = [
|
||||
"g2p",
|
||||
"image",
|
||||
|
@ -2524,7 +2528,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma"
|
||||
version = "0.4.0"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"assign",
|
||||
"js_int",
|
||||
|
@ -2542,7 +2546,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-api"
|
||||
version = "0.18.5"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http",
|
||||
|
@ -2558,7 +2562,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-api-macros"
|
||||
version = "0.18.5"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"proc-macro-crate 1.1.0",
|
||||
"proc-macro2 1.0.30",
|
||||
|
@ -2569,7 +2573,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-client-api"
|
||||
version = "0.12.3"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"assign",
|
||||
"bytes",
|
||||
|
@ -2589,7 +2593,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-common"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"js_int",
|
||||
|
@ -2604,7 +2608,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-events"
|
||||
version = "0.24.6"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"indoc",
|
||||
"js_int",
|
||||
|
@ -2620,7 +2624,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-events-macros"
|
||||
version = "0.24.6"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"proc-macro-crate 1.1.0",
|
||||
"proc-macro2 1.0.30",
|
||||
|
@ -2631,7 +2635,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-federation-api"
|
||||
version = "0.3.1"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-api",
|
||||
|
@ -2646,7 +2650,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-identifiers"
|
||||
version = "0.20.0"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"paste",
|
||||
"percent-encoding",
|
||||
|
@ -2660,7 +2664,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-identifiers-macros"
|
||||
version = "0.20.0"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"quote 1.0.10",
|
||||
"ruma-identifiers-validation",
|
||||
|
@ -2670,7 +2674,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-identifiers-validation"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"thiserror",
|
||||
]
|
||||
|
@ -2678,7 +2682,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-serde"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"form_urlencoded",
|
||||
|
@ -2692,7 +2696,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-serde-macros"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"proc-macro-crate 1.1.0",
|
||||
"proc-macro2 1.0.30",
|
||||
|
@ -2703,7 +2707,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-signatures"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"ed25519-dalek",
|
||||
|
@ -2720,7 +2724,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-state-res"
|
||||
version = "0.4.1"
|
||||
source = "git+https://github.com/ruma/ruma?rev=0101e110f#0101e110f8b56e5f0b0bcaac5a31a9cdbf299b8e"
|
||||
source = "git+https://github.com/ruma/ruma?rev=ac6ecc3e5#ac6ecc3e5e28197765f345c4d5a7732b41b057e7"
|
||||
dependencies = [
|
||||
"itertools",
|
||||
"js_int",
|
||||
|
@ -2740,15 +2744,6 @@ version = "0.1.21"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
|
||||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||
dependencies = [
|
||||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.19.1"
|
||||
|
@ -2815,21 +2810,6 @@ dependencies = [
|
|||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||
dependencies = [
|
||||
"semver-parser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver-parser"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||
|
||||
[[package]]
|
||||
name = "send_wrapper"
|
||||
version = "0.4.0"
|
||||
|
@ -2879,12 +2859,6 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha1"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.9.8"
|
||||
|
@ -2919,9 +2893,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "signature"
|
||||
version = "1.3.1"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335"
|
||||
checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788"
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
|
@ -3022,64 +2996,6 @@ dependencies = [
|
|||
"der",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "standback"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff"
|
||||
dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stdweb"
|
||||
version = "0.4.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5"
|
||||
dependencies = [
|
||||
"discard",
|
||||
"rustc_version",
|
||||
"stdweb-derive",
|
||||
"stdweb-internal-macros",
|
||||
"stdweb-internal-runtime",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stdweb-derive"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.30",
|
||||
"quote 1.0.10",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"syn 1.0.80",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stdweb-internal-macros"
|
||||
version = "0.2.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
|
||||
dependencies = [
|
||||
"base-x",
|
||||
"proc-macro2 1.0.30",
|
||||
"quote 1.0.10",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"sha1",
|
||||
"syn 1.0.80",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stdweb-internal-runtime"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0"
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.9.3"
|
||||
|
@ -3163,44 +3079,6 @@ dependencies = [
|
|||
"weezl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.2.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242"
|
||||
dependencies = [
|
||||
"const_fn",
|
||||
"libc",
|
||||
"standback",
|
||||
"stdweb",
|
||||
"time-macros",
|
||||
"version_check",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time-macros"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1"
|
||||
dependencies = [
|
||||
"proc-macro-hack",
|
||||
"time-macros-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time-macros-impl"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f"
|
||||
dependencies = [
|
||||
"proc-macro-hack",
|
||||
"proc-macro2 1.0.30",
|
||||
"quote 1.0.10",
|
||||
"standback",
|
||||
"syn 1.0.80",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tinyvec"
|
||||
version = "1.5.0"
|
||||
|
@ -3402,22 +3280,6 @@ version = "0.7.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
|
||||
|
||||
[[package]]
|
||||
name = "ureq"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3131cd6cb18488da91da1d10ed31e966f453c06b65bf010d35638456976a3fd7"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"chunked_transfer",
|
||||
"log",
|
||||
"once_cell",
|
||||
"rustls",
|
||||
"url",
|
||||
"webpki",
|
||||
"webpki-roots",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "url"
|
||||
version = "2.2.2"
|
||||
|
@ -3761,9 +3623,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "x11-clipboard"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b397ace6e980510de59a4fe3d4c758dffab231d6d747ce9fa1aba6b6035d5f32"
|
||||
checksum = "473068b7b80ac86a18328824f1054e5e007898c47b5bbc281bd7abe32bc3653c"
|
||||
dependencies = [
|
||||
"xcb",
|
||||
]
|
||||
|
@ -3781,12 +3643,13 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "xcb"
|
||||
version = "0.9.0"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "62056f63138b39116f82a540c983cc11f1c90cd70b3d492a70c25eaa50bd22a6"
|
||||
checksum = "771e2b996df720cd1c6dd9ff90f62d91698fd3610cc078388d0564bdd6622a9c"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
"quick-xml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -8,7 +8,7 @@ resolver = "2"
|
|||
|
||||
[dependencies]
|
||||
crossbeam-channel = "0.5"
|
||||
eframe = { version = "0.14", features = ["persistence", "http"] }
|
||||
eframe = { version = "0.15", features = ["persistence"] }
|
||||
futures = "0.3"
|
||||
ron = "0.6"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
@ -17,6 +17,6 @@ url = { version = "2.2", features = ["serde"] }
|
|||
|
||||
[dependencies.matrix-sdk]
|
||||
git = "https://github.com/matrix-org/matrix-rust-sdk/"
|
||||
rev = "9e1024f"
|
||||
rev = "2e04a37"
|
||||
default-features = false
|
||||
features = ["encryption", "qrcode", "sled_cryptostore", "sled_state_store", "require_auth_for_profile_requests", "rustls-tls"]
|
||||
features = ["encryption", "qrcode", "sled_cryptostore", "sled_state_store", "rustls-tls"]
|
||||
|
|
|
@ -7,7 +7,7 @@ use eframe::NativeOptions;
|
|||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn main() {
|
||||
let app = ui::App::default();
|
||||
let mut options = NativeOptions::default();
|
||||
options.transparent = true;
|
||||
let options = NativeOptions::default();
|
||||
//options.transparent = true;
|
||||
eframe::run_native(Box::new(app), options);
|
||||
}
|
||||
|
|
71
src/sync.rs
71
src/sync.rs
|
@ -7,8 +7,11 @@ use std::sync::{
|
|||
|
||||
use crossbeam_channel::Sender;
|
||||
use matrix_sdk::{
|
||||
encryption::verification::{
|
||||
QrVerification, SasVerification, Verification, VerificationRequest,
|
||||
},
|
||||
room::Joined,
|
||||
ruma::{RoomId, UserId},
|
||||
ruma::{events::room::message::RoomMessageEventContent, RoomId, UserId},
|
||||
Client, RoomMember,
|
||||
};
|
||||
use tokio::sync::{mpsc::UnboundedReceiver, Notify};
|
||||
|
@ -22,10 +25,25 @@ pub enum Request {
|
|||
Login(Url, String, String),
|
||||
/// Restore session
|
||||
Restore(matrix_sdk::Session),
|
||||
/// Get the calculated name for a room
|
||||
/// Get the calculated name for a room.
|
||||
RoomName(RoomId),
|
||||
/// Send a message to a room.
|
||||
Message(Joined, String),
|
||||
/// Get a member from a joined room
|
||||
JoinedMember(Joined, UserId),
|
||||
/// Get the verification request with the flow id.
|
||||
VerifyRequest(UserId, String),
|
||||
/// Cancel a verification attempt.
|
||||
VerifyCancel(VerificationRequest),
|
||||
/// Accept a verification request.
|
||||
VerifyAccept(VerificationRequest),
|
||||
/// Find an active verification with the flow id.
|
||||
VerifyStart(UserId, String),
|
||||
/// Start SAS verification flow.
|
||||
VerifyStartSas(VerificationRequest),
|
||||
VerifySasConfirm(SasVerification),
|
||||
/// Start QR code verification flow.
|
||||
VerifyStartQr(VerificationRequest),
|
||||
/// Stop syncing
|
||||
Quit,
|
||||
}
|
||||
|
@ -38,6 +56,12 @@ pub enum Response {
|
|||
RoomName(RoomId, String),
|
||||
/// Retrived a member frmo a joined room.
|
||||
JoinedMember(RoomId, RoomMember),
|
||||
/// Got a verification request.
|
||||
VerifyRequest(VerificationRequest),
|
||||
/// Started SAS verification.
|
||||
VerifySas(SasVerification),
|
||||
/// Started QR verification.
|
||||
VerifyQr(QrVerification),
|
||||
/// An error happened while responding to a request
|
||||
Error(matrix_sdk::Error),
|
||||
}
|
||||
|
@ -99,7 +123,48 @@ async fn handle_request(
|
|||
},
|
||||
Request::JoinedMember(room, user) => {
|
||||
if let Some(member) = room.get_member(&user).await? {
|
||||
response.send(Response::JoinedMember(room.room_id().clone(), member));
|
||||
response.send(Response::JoinedMember(room.room_id().clone(), member))?;
|
||||
}
|
||||
}
|
||||
Request::Message(room, message) => {
|
||||
let event = RoomMessageEventContent::text_plain(message);
|
||||
room.send(event, None).await?;
|
||||
}
|
||||
Request::VerifyRequest(user, flow_id) => {
|
||||
let verification = client.get_verification_request(&user, &flow_id).await;
|
||||
if let Some(verification) = verification {
|
||||
response.send(Response::VerifyRequest(verification))?;
|
||||
}
|
||||
}
|
||||
Request::VerifyCancel(verify) => {
|
||||
verify.cancel().await?;
|
||||
}
|
||||
Request::VerifyAccept(verify) => {
|
||||
verify.accept().await?;
|
||||
}
|
||||
Request::VerifyStart(sender, flow_id) => {
|
||||
if let Some(verify) = client.get_verification(&sender, &flow_id).await {
|
||||
match verify {
|
||||
// TODO: auto-accepting is very naughty
|
||||
Verification::SasV1(sas) => {
|
||||
sas.accept().await?;
|
||||
response.send(Response::VerifySas(sas))?
|
||||
}
|
||||
Verification::QrV1(qr) => response.send(Response::VerifyQr(qr))?,
|
||||
};
|
||||
}
|
||||
}
|
||||
Request::VerifyStartSas(verify) => {
|
||||
if let Some(sas) = verify.start_sas().await? {
|
||||
response.send(Response::VerifySas(sas))?;
|
||||
}
|
||||
}
|
||||
Request::VerifySasConfirm(sas) => {
|
||||
sas.confirm().await?;
|
||||
}
|
||||
Request::VerifyStartQr(verify) => {
|
||||
if let Some(qr) = verify.generate_qr_code().await? {
|
||||
response.send(Response::VerifyQr(qr))?;
|
||||
}
|
||||
}
|
||||
Request::Quit => {
|
||||
|
|
29
src/ui.rs
29
src/ui.rs
|
@ -34,7 +34,11 @@ impl epi::App for App {
|
|||
storage
|
||||
.get_string("rooms")
|
||||
.and_then(|s| ron::from_str(&s).ok())
|
||||
.map(|list| view.room_list = list);
|
||||
.map(|list| view.room_list = dbg!(list));
|
||||
storage
|
||||
.get_string("entry")
|
||||
.and_then(|s| ron::from_str(&s).ok())
|
||||
.map(|entry| view.entry = entry);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,6 +53,9 @@ impl epi::App for App {
|
|||
if let Ok(rooms) = ron::to_string(&main.room_list) {
|
||||
storage.set_string("rooms", rooms)
|
||||
}
|
||||
if let Ok(entry) = ron::to_string(&main.entry) {
|
||||
storage.set_string("entry", entry)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +63,7 @@ impl epi::App for App {
|
|||
fn on_exit(&mut self) {
|
||||
match self.view {
|
||||
View::Main(ref mut main) => {
|
||||
main.request.send(sync::Request::Quit).ok();
|
||||
main.request.quit();
|
||||
main.sync_handle.take().map(|t| t.join());
|
||||
}
|
||||
_ => (),
|
||||
|
@ -100,9 +107,7 @@ impl View {
|
|||
});
|
||||
let view = session::App::new(client, req_tx, res_rx, handle);
|
||||
for room in view.client.rooms() {
|
||||
view.request
|
||||
.send(sync::Request::RoomName(room.room_id().clone()))
|
||||
.ok();
|
||||
view.request.room_name(room.room_id().clone());
|
||||
}
|
||||
|
||||
*self = View::Main(view);
|
||||
|
@ -119,9 +124,23 @@ impl Default for View {
|
|||
}
|
||||
}
|
||||
|
||||
/// Named ID's for widgets that need one.
|
||||
#[derive(Debug, Clone, Copy, Hash)]
|
||||
pub enum Id {
|
||||
/// Side panel with the room list.
|
||||
RoomPanel,
|
||||
/// Top panel with room name an such.
|
||||
RoomSummary,
|
||||
/// Panel with members of a room.
|
||||
MemberList,
|
||||
/// Message entry.
|
||||
MessageEntry,
|
||||
/// Error message.
|
||||
ErrorPanel,
|
||||
/// Panel showing verification requests.
|
||||
VerificationPanel,
|
||||
/// Window for a SAS verification session.
|
||||
SasVerification,
|
||||
/// Window for a QR verification session.
|
||||
QrVerification,
|
||||
}
|
||||
|
|
|
@ -7,9 +7,14 @@ use crossbeam_channel::Receiver;
|
|||
use eframe::egui::{self, Color32, Label, ScrollArea, Sense};
|
||||
use matrix_sdk::{
|
||||
deserialized_responses::SyncResponse,
|
||||
room::Room,
|
||||
encryption::verification::{SasVerification, Verification, VerificationRequest},
|
||||
room::{Joined, Room},
|
||||
ruma::{
|
||||
events::{room::message::MessageType, AnyMessageEvent, AnyRoomEvent},
|
||||
events::{
|
||||
key::verification::VerificationMethod,
|
||||
room::{create::RoomType as CreateRoomType, message::MessageType},
|
||||
AnyMessageEvent, AnyRoomEvent, AnyToDeviceEvent,
|
||||
},
|
||||
RoomId, UserId,
|
||||
},
|
||||
Client, RoomMember,
|
||||
|
@ -25,13 +30,25 @@ use super::Id;
|
|||
#[derive(Debug)]
|
||||
pub struct App {
|
||||
pub client: matrix_sdk::Client,
|
||||
pub request: UnboundedSender<sync::Request>,
|
||||
/// Request sender.
|
||||
pub request: RequestSender,
|
||||
/// Response receiver.
|
||||
pub response: Receiver<sync::Response>,
|
||||
/// Handle to the sync loop thread.
|
||||
pub sync_handle: Option<std::thread::JoinHandle<()>>,
|
||||
/// Error message.
|
||||
pub error: Option<String>,
|
||||
/// State of an active verification request.
|
||||
pub verify_req: Option<VerificationRequest>,
|
||||
/// State of a started verification session.
|
||||
pub verify: Option<Verification>,
|
||||
|
||||
/// Data for the room list
|
||||
pub room_list: RoomList,
|
||||
/// Data for storing a timeline
|
||||
pub timelines: HashMap<RoomId, Timeline>,
|
||||
/// Message entry
|
||||
pub entry: MessageEntry,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
|
||||
|
@ -49,6 +66,17 @@ pub struct Timeline {
|
|||
member_pending: HashSet<UserId>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
|
||||
pub struct MessageEntry {
|
||||
text: HashMap<RoomId, String>,
|
||||
}
|
||||
|
||||
impl MessageEntry {
|
||||
pub fn get(&mut self, room: &RoomId) -> &mut String {
|
||||
self.text.entry(room.clone()).or_default()
|
||||
}
|
||||
}
|
||||
|
||||
impl RoomList {
|
||||
fn room_name<'a>(&'a self, room: &matrix_sdk::BaseRoom) -> Cow<'a, str> {
|
||||
if let Some(name) = self.room_name.get(room.room_id()) {
|
||||
|
@ -85,13 +113,16 @@ impl App {
|
|||
) -> Self {
|
||||
Self {
|
||||
client,
|
||||
request,
|
||||
request: RequestSender(request),
|
||||
response,
|
||||
|
||||
sync_handle: Some(sync_handle),
|
||||
room_list: RoomList::default(),
|
||||
error: None,
|
||||
timelines: HashMap::new(),
|
||||
verify_req: None,
|
||||
verify: None,
|
||||
error: None,
|
||||
entry: MessageEntry::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,11 +132,20 @@ impl App {
|
|||
}
|
||||
|
||||
egui::SidePanel::left(Id::RoomPanel)
|
||||
.max_width(800.0)
|
||||
.max_width(400.0)
|
||||
.default_width(400.0)
|
||||
.show(ctx, |ui| {
|
||||
ui.add(egui::Label::new("Joined").strong());
|
||||
for room in self.client.joined_rooms() {
|
||||
|
||||
let mut joined = self.client.joined_rooms();
|
||||
joined.sort_by_key(|room| self.room_list.room_name(&room).to_uppercase());
|
||||
joined.retain(|room| {
|
||||
room.create_content()
|
||||
.and_then(|c| c.room_type)
|
||||
.map_or(true, |t| t != CreateRoomType::Space)
|
||||
});
|
||||
|
||||
for room in joined {
|
||||
let group = if self.room_list.is_selected(room.room_id()) {
|
||||
egui::Frame::group(&Default::default())
|
||||
} else {
|
||||
|
@ -146,17 +186,108 @@ impl App {
|
|||
ui.heading("Members");
|
||||
let timeline = self.timelines.entry(room.room_id().clone()).or_default();
|
||||
for member in timeline.member.values() {
|
||||
ui.label(member.name());
|
||||
ui.group(|ui| {
|
||||
ui.set_width(ui.available_width());
|
||||
ui.label(member.name());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if self.error.is_some() {
|
||||
egui::TopBottomPanel::top(Id::ErrorPanel).show(ctx, |ui| {
|
||||
if ui.button("x").clicked() {
|
||||
self.error = None;
|
||||
return;
|
||||
}
|
||||
ui.label(self.error.as_ref().unwrap());
|
||||
});
|
||||
}
|
||||
|
||||
if let Some(ref verify_req) = self.verify_req {
|
||||
egui::TopBottomPanel::top(Id::VerificationPanel).show(ctx, |ui| {
|
||||
ui.label(format!(
|
||||
"Verification request for {}",
|
||||
verify_req.other_user_id(),
|
||||
));
|
||||
if !verify_req.is_ready() {
|
||||
if verify_req.is_cancelled() {
|
||||
ui.label("Verification attempt canceled");
|
||||
return;
|
||||
}
|
||||
if verify_req.we_started() {
|
||||
ui.label("Waiting for other user to accept verification.");
|
||||
} else {
|
||||
if ui.button("Accept").clicked() {
|
||||
self.request.verify_accept(verify_req.clone())
|
||||
}
|
||||
}
|
||||
if verify_req.is_ready() {
|
||||
let methods = verify_req.their_supported_methods().unwrap();
|
||||
for method in methods {
|
||||
if method == VerificationMethod::SasV1 {
|
||||
if ui.button("Verify with emoji").clicked() {
|
||||
self.request.verify_start_sas(verify_req.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ui.button("Cancel").clicked() {
|
||||
self.request.verify_cancel(verify_req.clone())
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if let Some(verify) = self.verify.clone() {
|
||||
match verify {
|
||||
Verification::SasV1(sas) => {
|
||||
egui::Window::new("Emoji verification")
|
||||
.id(egui::Id::new(Id::SasVerification))
|
||||
.fixed_size([500.0, 300.0])
|
||||
.show(ctx, |ui| {
|
||||
if let Some(cancel) = sas.cancel_info() {
|
||||
ui.label("Verification cancelled");
|
||||
ui.label(cancel.reason());
|
||||
}
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
if let Some(emojis) = sas.emoji() {
|
||||
for emoji in emojis {
|
||||
ui.vertical_centered(|ui| {
|
||||
ui.set_max_width(50.0);
|
||||
ui.heading(&emoji.symbol);
|
||||
ui.label(&emoji.description);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
ui.horizontal(|ui| {
|
||||
if ui.button("Confirm").clicked() {
|
||||
self.request.verify_sas_confirm(sas);
|
||||
}
|
||||
if ui.button("Close").clicked() {
|
||||
self.verify = None;
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
Verification::QrV1(_qr) => {
|
||||
egui::Window::new("QR code verification")
|
||||
.id(egui::Id::new(Id::QrVerification))
|
||||
.auto_sized()
|
||||
.show(ctx, |ui| {
|
||||
ui.label("Not implemented yet oops");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let joined = match room {
|
||||
Room::Joined(ref room) => room,
|
||||
_ => return,
|
||||
};
|
||||
|
||||
// Main panel with the timeline
|
||||
egui::CentralPanel::default().show(ctx, |ui| {
|
||||
ScrollArea::auto_sized().show(ui, |ui| {
|
||||
ScrollArea::vertical().show(ui, |ui| {
|
||||
let timeline = self.timelines.entry(room.room_id().clone()).or_default();
|
||||
for event in timeline.messages.iter() {
|
||||
let sender = event.sender();
|
||||
|
@ -164,12 +295,7 @@ impl App {
|
|||
Some(member) => member.name(),
|
||||
None => {
|
||||
if !timeline.member_pending.contains(sender) {
|
||||
self.request
|
||||
.send(sync::Request::JoinedMember(
|
||||
joined.clone(),
|
||||
sender.clone(),
|
||||
))
|
||||
.ok();
|
||||
self.request.joined_member(joined.clone(), sender.clone());
|
||||
}
|
||||
sender.localpart()
|
||||
}
|
||||
|
@ -178,14 +304,18 @@ impl App {
|
|||
AnyRoomEvent::Message(AnyMessageEvent::RoomMessage(msg)) => {
|
||||
match &msg.content.msgtype {
|
||||
MessageType::Text(text) => {
|
||||
ui.add(Label::new(name).strong())
|
||||
.on_hover_text(event.sender());
|
||||
ui.label(&text.body);
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.add(Label::new(name).strong())
|
||||
.on_hover_text(event.sender());
|
||||
ui.label(&text.body);
|
||||
});
|
||||
}
|
||||
MessageType::Notice(notice) => {
|
||||
ui.add(Label::new(name).strong())
|
||||
.on_hover_text(event.sender());
|
||||
ui.add(egui::Label::new(¬ice.body).weak());
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.add(Label::new(name).strong())
|
||||
.on_hover_text(event.sender());
|
||||
ui.add(egui::Label::new(¬ice.body).weak());
|
||||
});
|
||||
}
|
||||
MessageType::ServerNotice(notice) => {
|
||||
ui.add(Label::new(name).strong())
|
||||
|
@ -196,35 +326,62 @@ impl App {
|
|||
ui.label(format!("* {} {}", name, emote.body));
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
};
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
egui::TopBottomPanel::bottom(Id::MessageEntry).show(ctx, |ui| {
|
||||
ui.add(
|
||||
egui::TextEdit::multiline(self.entry.get(joined.room_id()))
|
||||
.desired_width(ui.available_width()),
|
||||
);
|
||||
if ui.button("Send").clicked() {
|
||||
self.send_message(joined.clone());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn send_message(&mut self, room: Joined) {
|
||||
let entry = self.entry.get(room.room_id());
|
||||
self.request.message(room, std::mem::take(entry));
|
||||
}
|
||||
|
||||
fn handle_response(&mut self, response: sync::Response) {
|
||||
use sync::Response;
|
||||
match response {
|
||||
sync::Response::RoomName(room, name) => {
|
||||
Response::Sync(sync) => self.handle_sync(sync),
|
||||
Response::RoomName(room, name) => {
|
||||
self.room_list.room_name.insert(room, name);
|
||||
}
|
||||
sync::Response::JoinedMember(room, member) => {
|
||||
Response::JoinedMember(room, member) => {
|
||||
self.timelines
|
||||
.entry(room)
|
||||
.or_default()
|
||||
.member
|
||||
.insert(member.user_id().clone(), member);
|
||||
}
|
||||
sync::Response::Error(e) => {
|
||||
Response::VerifyRequest(verification) => {
|
||||
self.verify_req = Some(verification);
|
||||
}
|
||||
Response::VerifySas(sas) => {
|
||||
self.verify_req = None;
|
||||
self.verify = Some(Verification::SasV1(sas));
|
||||
}
|
||||
Response::VerifyQr(qr) => {
|
||||
self.verify_req = None;
|
||||
self.verify = Some(Verification::QrV1(qr));
|
||||
}
|
||||
Response::Error(e) => {
|
||||
self.error = Some(e.to_string());
|
||||
}
|
||||
sync::Response::Sync(sync) => self.handle_sync(sync),
|
||||
};
|
||||
}
|
||||
|
||||
fn handle_sync(&mut self, sync: SyncResponse) {
|
||||
dbg!(&sync);
|
||||
for (id, room) in sync.rooms.join {
|
||||
let timeline = self.timelines.entry(id.clone()).or_default();
|
||||
for event in room.timeline.events {
|
||||
|
@ -235,5 +392,75 @@ impl App {
|
|||
timeline.messages.push(event.into_full_event(id.clone()));
|
||||
}
|
||||
}
|
||||
for to_device in sync.to_device.events {
|
||||
let to_device = match to_device.deserialize() {
|
||||
Ok(to_device) => to_device,
|
||||
Err(_) => continue,
|
||||
};
|
||||
match to_device {
|
||||
AnyToDeviceEvent::KeyVerificationRequest(req) => {
|
||||
self.request
|
||||
.verify_request(req.sender, req.content.transaction_id);
|
||||
}
|
||||
AnyToDeviceEvent::KeyVerificationStart(start) => {
|
||||
if self.verify_req.is_none() {
|
||||
self.request
|
||||
.verify_start(start.sender, start.content.transaction_id)
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RequestSender(UnboundedSender<sync::Request>);
|
||||
|
||||
impl RequestSender {
|
||||
pub fn room_name(&self, name: RoomId) {
|
||||
self.0.send(sync::Request::RoomName(name)).ok();
|
||||
}
|
||||
|
||||
pub fn joined_member(&self, room: Joined, id: UserId) {
|
||||
self.0.send(sync::Request::JoinedMember(room, id)).ok();
|
||||
}
|
||||
|
||||
pub fn message(&self, room: Joined, message: String) {
|
||||
self.0.send(sync::Request::Message(room, message)).ok();
|
||||
}
|
||||
|
||||
pub fn verify_request(&self, user: UserId, flow_id: String) {
|
||||
self.0
|
||||
.send(sync::Request::VerifyRequest(user, flow_id))
|
||||
.ok();
|
||||
}
|
||||
|
||||
pub fn verify_cancel(&self, verify: VerificationRequest) {
|
||||
self.0.send(sync::Request::VerifyCancel(verify)).ok();
|
||||
}
|
||||
|
||||
pub fn verify_accept(&self, verify: VerificationRequest) {
|
||||
self.0.send(sync::Request::VerifyAccept(verify)).ok();
|
||||
}
|
||||
|
||||
pub fn verify_start(&self, user: UserId, flow_id: String) {
|
||||
self.0.send(sync::Request::VerifyStart(user, flow_id)).ok();
|
||||
}
|
||||
|
||||
pub fn verify_start_sas(&self, verify: VerificationRequest) {
|
||||
self.0.send(sync::Request::VerifyStartSas(verify)).ok();
|
||||
}
|
||||
|
||||
pub fn verify_sas_confirm(&self, sas: SasVerification) {
|
||||
self.0.send(sync::Request::VerifySasConfirm(sas)).ok();
|
||||
}
|
||||
|
||||
pub fn verify_start_qr(&self, verify: VerificationRequest) {
|
||||
self.0.send(sync::Request::VerifyStartQr(verify)).ok();
|
||||
}
|
||||
|
||||
pub fn quit(&self) {
|
||||
self.0.send(sync::Request::Quit).ok();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue