diff --git a/.github/workflows/backend.yaml b/.github/workflows/backend.yaml index 3c657c30d4..f6c137fdea 100644 --- a/.github/workflows/backend.yaml +++ b/.github/workflows/backend.yaml @@ -23,7 +23,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: fmt - args: --manifest-path v2/Cargo.toml --all -- --check + args: --all -- --check clippy: name: run clippy @@ -40,12 +40,10 @@ jobs: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - run: rustup component add clippy - uses: Swatinem/rust-cache@v1 - with: - working-directory: ./v2 - uses: actions-rs/cargo@v1 with: command: clippy - args: --manifest-path v2/Cargo.toml -- -D warnings + args: -- -D warnings test: name: run tests @@ -61,9 +59,6 @@ jobs: with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - uses: Swatinem/rust-cache@v1 - with: - working-directory: ./v2 - uses: actions-rs/cargo@v1 with: command: test - args: --manifest-path v2/Cargo.toml diff --git a/.github/workflows/candid.yaml b/.github/workflows/candid.yaml index f068ef9935..67580859d9 100644 --- a/.github/workflows/candid.yaml +++ b/.github/workflows/candid.yaml @@ -23,7 +23,6 @@ jobs: name: didc version: 0.7.8 - name: run validate-candid-syntax.sh - working-directory: ./v2 run: ./validate-candid-syntax.sh shell: bash @@ -44,6 +43,5 @@ jobs: name: didc version: 0.7.8 - name: run validate-candid-matches-rust.sh - working-directory: ./v2 run: ./validate-candid-matches-rust.sh shell: bash diff --git a/.github/workflows/deploy_frontend.yaml b/.github/workflows/deploy_frontend.yaml index 38062aa726..137b73cf00 100644 --- a/.github/workflows/deploy_frontend.yaml +++ b/.github/workflows/deploy_frontend.yaml @@ -22,7 +22,7 @@ jobs: - name: Build the frontend run: | - cd v2/frontend + cd frontend npm ci npm run build:prod_test cd .. diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml index 5ff0aa70d6..fdb7aa2830 100644 --- a/.github/workflows/frontend.yaml +++ b/.github/workflows/frontend.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: v2/frontend + working-directory: frontend steps: - uses: actions/checkout@master - uses: actions/setup-node@v1 diff --git a/Cargo.lock b/Cargo.lock index b762ce383a..c99aca8a76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,29 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.4", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -11,6 +34,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" + [[package]] name = "arrayvec" version = "0.5.2" @@ -26,6 +64,28 @@ dependencies = [ "term", ] +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-trait" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "atty" version = "0.2.14" @@ -39,871 +99,4469 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" +dependencies = [ + "autocfg 1.1.0", +] [[package]] -name = "base32" -version = "0.4.0" +name = "autocfg" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "beef" -version = "0.5.1" +name = "aws-config" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed554bd50246729a1ec158d08aa3235d1b69d94ad120ebe187e28894787e736" +checksum = "0a5421955d4744207053bef13a65cc60af6cd1e9ad0ff447bd5e630d1edddd72" +dependencies = [ + "aws-http", + "aws-sdk-sts", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "hyper", + "tokio", + "tower", + "tracing", +] [[package]] -name = "bit-set" -version = "0.5.2" +name = "aws-endpoint" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +checksum = "c45bafccabcc4953bd71015ae187c3fe85dec2960aef1c2cf5515c867c0fbd54" dependencies = [ - "bit-vec", + "aws-smithy-http", + "aws-types", + "http", + "regex", + "tracing", ] [[package]] -name = "bit-vec" -version = "0.6.3" +name = "aws-http" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "4ad5cd76c37a16219dc6f73474f1cd1603872b6f5e6a765df7ef5a2000c6dcd8" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "aws-types", + "http", + "lazy_static", + "percent-encoding", + "tracing", +] [[package]] -name = "bitflags" -version = "1.3.2" +name = "aws-sdk-dynamodb" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "f4ee129e0a16969fb764c9914feaf1885b68c3ba026821fe52e6e05c5b70464b" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand", + "http", + "tokio-stream", + "tower", +] [[package]] -name = "block-buffer" -version = "0.9.0" +name = "aws-sdk-pinpoint" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "ebd69416519cb84ee58933153c4e8a4bcb5a967e5d1c949d0b10e7bf41a073cc" dependencies = [ - "generic-array", + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "tower", ] [[package]] -name = "byteorder" -version = "1.4.3" +name = "aws-sdk-sts" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "b4e4397ce5e2b21bda02db9b4ed4642f0717b5fe6dd2c276d364a019734108e3" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-query", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "bytes", + "http", + "tower", +] [[package]] -name = "candid" -version = "0.6.21" +name = "aws-sig-auth" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65f05b872d010281c905c4e6ff2079c1341d1e527e05f3bfab88d49ea3269def" +checksum = "446fbc7a132042271fc363a442b0f97e6036e71a6f55c535ca5cf2062b73aece" dependencies = [ - "byteorder", - "candid_derive", - "codespan-reporting", - "hex", - "ic-types", - "lalrpop", - "lalrpop-util", - "leb128", - "logos", - "num-bigint", - "num-traits", - "num_enum", - "paste", - "pretty", - "serde", - "serde_bytes", + "aws-sigv4", + "aws-smithy-http", + "aws-types", + "http", "thiserror", + "tracing", ] [[package]] -name = "candid_derive" -version = "0.4.4" +name = "aws-sigv4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d7232a5dd836d83ae9ffd79061b42d729afab6f11bfaba7dc2a82575b686ae2" +checksum = "9c60fde70ec639a20e30b2ea425619a72242e5fff0b3a8ac7f729d07b847deb3" dependencies = [ - "lazy_static", - "proc-macro2", - "quote", - "syn", + "aws-smithy-http", + "form_urlencoded", + "hex", + "http", + "once_cell", + "percent-encoding", + "regex", + "ring", + "time 0.3.7", + "tracing", ] [[package]] -name = "cfg-if" -version = "0.1.10" +name = "aws-smithy-async" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "9ce0f12c49772b774e2d65b579d09c205948ea8679b2b39d08d1ae9476bb535d" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", + "tokio-stream", +] [[package]] -name = "cfg-if" -version = "1.0.0" +name = "aws-smithy-client" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chats" -version = "0.1.0" +checksum = "42212ca483db4774b1cbadf648be4a06dc45dec0ecfd552506a63c98ea4e2838" dependencies = [ - "enum_dispatch", - "ic-cdk", - "ic-cdk-macros", - "itertools", - "range-set", - "serde", - "serde_bytes", - "shared", - "smallvec", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-types", + "bytes", + "fastrand", + "http", + "http-body", + "hyper", + "hyper-rustls 0.22.1", + "lazy_static", + "pin-project", + "pin-project-lite", + "tokio", + "tower", + "tracing", ] [[package]] -name = "codespan-reporting" -version = "0.9.5" +name = "aws-smithy-http" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0762455306b1ed42bc651ef6a2197aabda5e1d4a43c34d5eab5c1a3634e81d" +checksum = "009e7ddec00dfe28a5eb1d6749342d274aa05c2fddb3b8abf82429fd060544c9" dependencies = [ - "termcolor", - "unicode-width", + "aws-smithy-types", + "bytes", + "bytes-utils", + "futures-core", + "http", + "http-body", + "hyper", + "percent-encoding", + "pin-project", + "tokio", + "tokio-util", + "tracing", ] [[package]] -name = "cpufeatures" -version = "0.2.1" +name = "aws-smithy-http-tower" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "0317649bd8f4b0fc0e1721b3bbe878af6352926a89b5d2cfb4211d5fe8342c75" dependencies = [ - "libc", + "aws-smithy-http", + "bytes", + "http", + "http-body", + "pin-project", + "tower", + "tracing", ] [[package]] -name = "crc32fast" -version = "1.2.1" +name = "aws-smithy-json" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "06c858f5049c12eb77ea1b9624c8463d41bbefa9e8e8c3159ce4565e8e3b27ce" dependencies = [ - "cfg-if 1.0.0", + "aws-smithy-types", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "aws-smithy-query" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "77b94596aef43e18fed1e5370aa9dac9c402b28441fc56577b00b757b3fb001b" +dependencies = [ + "aws-smithy-types", + "urlencoding", +] [[package]] -name = "derivative" -version = "2.2.0" +name = "aws-smithy-types" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "8d9ea9658f2576b4e91c6b00c4963a68614daf74b5160a66daa02c9f897da3ae" dependencies = [ - "proc-macro2", - "quote", - "syn", + "itoa", + "num-integer", + "ryu", + "time 0.3.7", ] [[package]] -name = "diff" -version = "0.1.12" +name = "aws-smithy-xml" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" +checksum = "db1bbd22e96540cf8809a9137bf627e28e5bc6b365ab1ac58d9d81649b31def1" +dependencies = [ + "thiserror", + "xmlparser", +] [[package]] -name = "digest" -version = "0.9.0" +name = "aws-types" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "490a491f7592e110762a305970a3c88b6a5bd662bde27f3b2f2ab7be6b8f1589" dependencies = [ - "generic-array", + "aws-smithy-async", + "aws-smithy-types", + "rustc_version", + "tracing", + "zeroize", ] [[package]] -name = "dirs-next" -version = "2.0.0" +name = "base32" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] +checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "base64" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] -name = "either" -version = "1.6.1" +name = "base64ct" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "e6b4d9b1225d28d360ec6a231d65af1fd99a2a095154c8040689617290569c5c" [[package]] -name = "ena" -version = "0.14.0" +name = "beef" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3" +checksum = "bed554bd50246729a1ec158d08aa3235d1b69d94ad120ebe187e28894787e736" + +[[package]] +name = "binread" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16598dfc8e6578e9b597d9910ba2e73618385dc9f4b1d43dd92c349d6be6418f" dependencies = [ - "log", + "binread_derive", + "lazy_static", + "rustversion", ] [[package]] -name = "enum_dispatch" -version = "0.3.7" +name = "binread_derive" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd53b3fde38a39a06b2e66dc282f3e86191e53bd04cc499929c15742beae3df8" +checksum = "1d9672209df1714ee804b1f4d4f68c8eb2a90b1f7a07acf472f88ce198ef1fed" dependencies = [ - "once_cell", + "either", "proc-macro2", "quote", "syn", ] [[package]] -name = "fixedbitset" -version = "0.2.0" +name = "bit-set" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +dependencies = [ + "bit-vec", +] [[package]] -name = "fnv" -version = "1.0.7" +name = "bit-vec" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] -name = "generic-array" -version = "0.14.4" +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "typenum", - "version_check", + "generic-array", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "block-buffer" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", + "generic-array", ] [[package]] -name = "hashbrown" -version = "0.11.2" +name = "build_const" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "bumpalo" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] -name = "hex" -version = "0.4.3" +name = "bytemuck" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" [[package]] -name = "highway" -version = "0.6.4" +name = "byteorder" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3461b968f695ca312b968503261f5a345de0f02a39dbaa3021f20d53b426395d" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] -name = "ic-cdk" -version = "0.2.4" +name = "bytes" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae261fe701ff53bf985840749a67da01beb89c8bdb7a7d8fedbd772c72556ea8" -dependencies = [ - "candid", - "cfg-if 0.1.10", - "ic-types", - "serde", -] +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] -name = "ic-cdk-macros" -version = "0.2.4" +name = "bytes-utils" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d18985bb2a060d6d3ff052812b1067ed7e989088369a98c24ffd3de08b14030b" +checksum = "4e314712951c43123e5920a446464929adc667a5eade7f8fb3997776c9df6e54" dependencies = [ - "candid", - "ic-cdk", - "proc-macro2", - "quote", - "serde", - "serde_tokenstream", - "syn", + "bytes", + "either", ] [[package]] -name = "ic-types" -version = "0.1.5" +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" + +[[package]] +name = "candid" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94dd8ec75019bc7159efe6ca2de5392e14a8e82c02ec6dae6d1b32af5337acd1" +checksum = "12970d8d0620d2bdb7e81a5b13ed11e41fcdfeba53d61e45b5853afcbf9611fd" dependencies = [ - "base32", - "crc32fast", + "anyhow", + "binread", + "byteorder", + "candid_derive", + "codespan-reporting", "hex", + "ic-types", + "lalrpop", + "lalrpop-util", + "leb128", + "logos", + "num-bigint", + "num-traits", + "num_enum", + "paste", + "pretty", "serde", "serde_bytes", - "sha2", "thiserror", ] [[package]] -name = "indexmap" -version = "1.7.0" +name = "candid_derive" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e02c03c4d547674a3f3f3109538fb49871fbe636216daa019f06a62faca9061" +dependencies = [ + "lazy_static", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "candid_gen" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "canister_api_macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "canister_client" +version = "0.1.0" +dependencies = [ + "candid", + "canister_client_macros", + "dirs", + "futures", + "garcon", + "group_canister", + "group_canister_client", + "group_index_canister", + "group_index_canister_client", + "ic-agent", + "ic-utils", + "notifications_canister", + "online_users_aggregator_canister", + "root_canister", + "root_canister_client", + "serde", + "types", + "user_canister", + "user_canister_client", + "user_index_canister", + "user_index_canister_client", +] + +[[package]] +name = "canister_client_macros" +version = "0.1.0" +dependencies = [ + "garcon", +] + +[[package]] +name = "canister_installer" +version = "0.1.0" +dependencies = [ + "canister_client", + "clap", + "tokio", + "types", +] + +[[package]] +name = "canister_logger" +version = "0.1.0" +dependencies = [ + "candid", + "ic-cdk", + "serde", + "tracing", + "tracing-attributes", + "tracing-subscriber", + "types", +] + +[[package]] +name = "canister_state_macros" +version = "0.1.0" + +[[package]] +name = "canister_upgrader" +version = "0.1.0" +dependencies = [ + "canister_client", + "clap", + "tokio", + "types", +] + +[[package]] +name = "captcha" +version = "0.0.8" +source = "git+https://github.com/nmattia/captcha?rev=4751b6fa4e56229c2af5b9a28195ff039551d8e7#4751b6fa4e56229c2af5b9a28195ff039551d8e7" +dependencies = [ + "base64", + "hound", + "image", + "lodepng", + "rand 0.7.3", + "serde_json", +] + +[[package]] +name = "castaway" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" + +[[package]] +name = "cc" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chat_events" +version = "0.1.0" +dependencies = [ + "candid", + "itertools", + "search", + "serde", + "types", +] + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "time 0.1.43", + "winapi", +] + +[[package]] +name = "clap" +version = "3.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "indexmap", + "lazy_static", + "os_str_bytes", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1132dc3944b31c20dd8b906b3a9f0a5d0243e092d59171414969657ac6aa85" +dependencies = [ + "heck 0.4.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "coarsetime" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "441947d9f3582f20b35fdd2bc5ada3a8c74c9ea380d66268607cb399b510ee08" +dependencies = [ + "libc", + "once_cell", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + +[[package]] +name = "const-oid" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" +dependencies = [ + "build_const", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "lazy_static", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" +dependencies = [ + "cfg-if", + "lazy_static", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03" +dependencies = [ + "generic-array", + "rand_core 0.6.3", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4600d695eb3f6ce1cd44e6e291adceb2cc3ab12f20a33777ecd0bf6eba34e06" +dependencies = [ + "generic-array", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ct-codecs" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df" + +[[package]] +name = "ct-logs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" +dependencies = [ + "sct 0.6.1", +] + +[[package]] +name = "curl" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de97b894edd5b5bcceef8b78d7da9b75b1d2f2f9a910569d0bde3dd31d84939" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2", + "winapi", +] + +[[package]] +name = "curl-sys" +version = "0.4.52+curl-7.81.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b8c2d1023ea5fded5b7b892e4b8e95f70038a421126a056761a84246a28971" +dependencies = [ + "cc", + "libc", + "libnghttp2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "winapi", +] + +[[package]] +name = "data_generator" +version = "0.1.0" +dependencies = [ + "canister_client", + "clap", + "futures", + "group_canister", + "ic-agent", + "lipsum", + "rand 0.7.3", + "tokio", + "types", + "user_canister", + "utils", +] + +[[package]] +name = "deflate" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" +dependencies = [ + "adler32", + "byteorder", +] + +[[package]] +name = "der" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4" +dependencies = [ + "const-oid", + "crypto-bigint", + "der_derive", +] + +[[package]] +name = "der_derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aed3b3c608dc56cf36c45fe979d04eda51242e6703d8d0bb03426ef7c41db6a" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "diff" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cb780dce4f9a8f5c087362b3a4595936b2019e7c8b30f2c3e9a7e94e6ae9837" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +name = "dynamodb_index_store" +version = "0.1.0" +dependencies = [ + "async-trait", + "aws-sdk-dynamodb", + "aws-types", + "index_store", + "types", +] + +[[package]] +name = "ecdsa" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43ee23aa5b4f68c7a092b5c3beb25f50c406adc75e2363634f242f28ab255372" +dependencies = [ + "der", + "elliptic-curve", + "hmac 0.11.0", + "signature", +] + +[[package]] +name = "ece" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5463ffecc0677adcd786c4481f73b215714d4757edf2eb37a573c03d00459" +dependencies = [ + "base64", + "byteorder", + "hex", + "hkdf", + "lazy_static", + "once_cell", + "openssl", + "serde", + "sha2 0.10.1", + "thiserror", +] + +[[package]] +name = "ed25519-compact" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e1f30f0312ac83726c1197abeacd91c9557f8a623e904a009ae6bc529ae8d8" +dependencies = [ + "ct-codecs", + "getrandom 0.2.4", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "elliptic-curve" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beca177dcb8eb540133e7680baff45e7cc4d93bf22002676cec549f82343721b" +dependencies = [ + "crypto-bigint", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.3", + "subtle", + "zeroize", +] + +[[package]] +name = "ena" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3" +dependencies = [ + "log", +] + +[[package]] +name = "encoding_rs" +version = "0.8.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "event-listener" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" + +[[package]] +name = "fallible_collections" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52db5973b6a19247baf19b30f41c23a1bfffc2e9ce0a5db2f60e3cd5dc8895f7" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + +[[package]] +name = "ff" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f40b2dcd8bc322217a5f6559ae5f9e9d1de202a2ecee2e9eafcbece7562a4f" +dependencies = [ + "rand_core 0.6.3", + "subtle", +] + +[[package]] +name = "fixedbitset" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" + +[[package]] +name = "flate2" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" +dependencies = [ + "cfg-if", + "crc32fast", + "libc", + "miniz_oxide 0.4.4", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-executor" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "garcon" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e83fb8961dcd3c26123863998521ae4d07e5e5aa8fb50b503380448f2e0ea069" +dependencies = [ + "futures-util", +] + +[[package]] +name = "generic-array" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gif" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a7187e78088aead22ceedeee99779455b23fc231fe13ec443f99bb71694e5b" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "group" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c363a5301b8f153d80747126a04b3c82073b9fe3130571a9d170cacdeaf7912" +dependencies = [ + "ff", + "rand_core 0.6.3", + "subtle", +] + +[[package]] +name = "group_canister" +version = "0.1.0" +dependencies = [ + "candid", + "candid_gen", + "serde", + "serde_bytes", + "types", +] + +[[package]] +name = "group_canister_c2c_client" +version = "0.1.0" +dependencies = [ + "candid", + "canister_client_macros", + "group_canister", + "ic-cdk", + "tracing", + "types", +] + +[[package]] +name = "group_canister_client" +version = "0.1.0" +dependencies = [ + "candid", + "canister_client_macros", + "group_canister", + "ic-agent", + "types", +] + +[[package]] +name = "group_canister_impl" +version = "0.1.0" +dependencies = [ + "candid", + "canister_api_macros", + "canister_logger", + "canister_state_macros", + "chat_events", + "futures", + "group_canister", + "group_index_canister", + "group_index_canister_c2c_client", + "http_request", + "ic-cdk", + "ic-cdk-macros", + "itertools", + "lazy_static", + "notifications_canister", + "notifications_canister_c2c_client", + "open_storage_bucket_client", + "regex", + "search", + "serde", + "serializer", + "tracing", + "types", + "user_canister", + "user_canister_c2c_client", + "user_index_canister", + "user_index_canister_c2c_client", + "utils", +] + +[[package]] +name = "group_index_canister" +version = "0.1.0" +dependencies = [ + "candid", + "candid_gen", + "serde", + "types", +] + +[[package]] +name = "group_index_canister_c2c_client" +version = "0.1.0" +dependencies = [ + "canister_client_macros", + "group_index_canister", + "ic-cdk", + "tracing", + "types", +] + +[[package]] +name = "group_index_canister_client" +version = "0.1.0" +dependencies = [ + "candid", + "canister_client_macros", + "group_index_canister", + "ic-agent", + "types", +] + +[[package]] +name = "group_index_canister_impl" +version = "0.1.0" +dependencies = [ + "candid", + "canister_api_macros", + "canister_logger", + "canister_state_macros", + "futures", + "group_canister", + "group_canister_c2c_client", + "group_index_canister", + "http_request", + "ic-cdk", + "ic-cdk-macros", + "rand 0.7.3", + "search", + "serde", + "serializer", + "tracing", + "types", + "utils", +] + +[[package]] +name = "h2" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f1f717ddc7b2ba36df7e871fd88db79326551d3d6f1fc406fbfd28b582ff8e" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "158bc31e00a68e380286904cc598715f861f2b0ccf7aa6fe20c6d0c49ca5d0f6" +dependencies = [ + "hmac 0.12.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddca131f3e7f2ce2df364b57949a9d47915cfbd35e46cfee355ccebbf794d6a2" +dependencies = [ + "digest 0.10.2", +] + +[[package]] +name = "hmac-sha1-compact" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d103cfecf6edf3f7d1dc7c5ab64e99488c0f8d11786e43b40873e66e8489d014" + +[[package]] +name = "hmac-sha256" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6334e3f219f0b55a298ef4030bb39c52faa3f91921d5deb6b4c23af5eae54214" +dependencies = [ + "digest 0.9.0", +] + +[[package]] +name = "hmac-sha512" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "187fd559ab2ecdfba750a8740953f70bcea7d96a4fabaf3e532f76401eae50f5" +dependencies = [ + "digest 0.9.0", +] + +[[package]] +name = "hound" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" + +[[package]] +name = "http" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "http_request" +version = "0.1.0" +dependencies = [ + "candid", + "canister_logger", + "num-traits", + "serde", + "serde_bytes", + "serde_json", + "types", + "utils", +] + +[[package]] +name = "httparse" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043f0e083e9901b6cc658a77d1eb86f4fc650bbb977a4337dd63192826aa85dd" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +dependencies = [ + "ct-logs", + "futures-util", + "hyper", + "log", + "rustls 0.19.1", + "rustls-native-certs 0.5.0", + "tokio", + "tokio-rustls 0.22.0", + "webpki 0.21.4", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +dependencies = [ + "http", + "hyper", + "log", + "rustls 0.20.2", + "rustls-native-certs 0.6.1", + "tokio", + "tokio-rustls 0.23.2", + "webpki-roots", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "ic-agent" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4bae4fe3e2ef68b9321bc12b99d482100796edf48e47ff82ff8257dcd9c7c41" +dependencies = [ + "async-trait", + "base32", + "base64", + "byteorder", + "garcon", + "hex", + "http", + "hyper-rustls 0.23.0", + "ic-types", + "leb128", + "mime", + "openssl", + "pem 1.0.2", + "rand 0.8.4", + "reqwest", + "ring", + "rustls 0.20.2", + "serde", + "serde_bytes", + "serde_cbor", + "simple_asn1", + "thiserror", + "url", +] + +[[package]] +name = "ic-cdk" +version = "0.4.0" +source = "git+https://github.com/hpeebles/cdk-rs?rev=fe27fb859ee8080e65a36d16a2d97e446db08654#fe27fb859ee8080e65a36d16a2d97e446db08654" +dependencies = [ + "candid", + "cfg-if", + "serde", +] + +[[package]] +name = "ic-cdk-macros" +version = "0.4.0" +source = "git+https://github.com/hpeebles/cdk-rs?rev=fe27fb859ee8080e65a36d16a2d97e446db08654#fe27fb859ee8080e65a36d16a2d97e446db08654" +dependencies = [ + "candid", + "ic-cdk", + "proc-macro2", + "quote", + "serde", + "serde_tokenstream", + "syn", +] + +[[package]] +name = "ic-ledger-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6ed965b39ea4cf482053bfebc8bbe40329b664e0de64109530d6c33d6c708e" +dependencies = [ + "candid", + "crc32fast", + "hex", + "ic-cdk", + "serde", + "sha2 0.9.9", +] + +[[package]] +name = "ic-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e78ec6f58886cdc252d6f912dc794211bd6bbc39ddc9dcda434b2dc16c335b3" +dependencies = [ + "base32", + "crc32fast", + "hex", + "serde", + "serde_bytes", + "sha2 0.9.9", + "thiserror", +] + +[[package]] +name = "ic-utils" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dfd2a0c8be5f1708b07279c7965cc0edfdff7d44342945603835f7b9aae5dd4" +dependencies = [ + "async-trait", + "candid", + "garcon", + "ic-agent", + "serde", + "serde_bytes", + "strum", + "strum_macros", + "thiserror", +] + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "image" +version = "0.23.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "gif", + "jpeg-decoder", + "num-iter", + "num-rational", + "num-traits", + "png", + "scoped_threadpool", + "tiff", +] + +[[package]] +name = "index_store" +version = "0.1.0" +dependencies = [ + "async-trait", + "futures", + "types", +] + +[[package]] +name = "indexmap" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +dependencies = [ + "autocfg 1.1.0", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" + +[[package]] +name = "isahc" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d140e84730d325378912ede32d7cd53ef1542725503b3353e5ec8113c7c6f588" +dependencies = [ + "async-channel", + "castaway", + "crossbeam-utils", + "curl", + "curl-sys", + "encoding_rs", + "event-listener", + "futures-lite", + "http", + "log", + "mime", + "once_cell", + "polling", + "slab", + "sluice", + "tracing", + "tracing-futures", + "url", + "waker-fn", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + +[[package]] +name = "jpeg-decoder" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" +dependencies = [ + "rayon", +] + +[[package]] +name = "js-sys" +version = "0.3.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jwt-simple" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b56547b8cb883de90ff60e684b18ac4c79244574fa73617217e5d3c6cdfb9c" +dependencies = [ + "anyhow", + "coarsetime", + "ct-codecs", + "ed25519-compact", + "hmac-sha1-compact", + "hmac-sha256", + "hmac-sha512", + "k256", + "p256", + "rand 0.8.4", + "rsa", + "serde", + "serde_json", + "thiserror", + "zeroize", +] + +[[package]] +name = "k256" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "903ae2481bcdfdb7b68e0a9baa4b7c9aff600b9ae2e8e5bb5833b8c91ab851ea" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2 0.9.9", +] + +[[package]] +name = "lalrpop" +version = "0.19.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852b75a095da6b69da8c5557731c3afd06525d4f655a4fc1c799e2ec8bc4dce4" +dependencies = [ + "ascii-canvas", + "atty", + "bit-set", + "diff", + "ena", + "itertools", + "lalrpop-util", + "petgraph", + "pico-args", + "regex", + "regex-syntax", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "lalrpop-util" +version = "0.19.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6d265705249fe209280676d8f68887859fa42e1d34f342fc05bd47726a5e188" +dependencies = [ + "regex", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "ledger_utils" +version = "0.1.0" +dependencies = [ + "candid", + "ic-ledger-types", + "types", + "utils", +] + +[[package]] +name = "libc" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" + +[[package]] +name = "libm" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" + +[[package]] +name = "libnghttp2-sys" +version = "0.1.7+1.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "libz-sys" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "lipsum" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ee7271c76a89032dcc7e595c0a739a9c5514eab483deb0e82981fe2098c56a" +dependencies = [ + "rand 0.8.4", + "rand_chacha 0.3.1", +] + +[[package]] +name = "lock_api" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "lodepng" +version = "3.4.7" +source = "git+https://github.com/kornelski/lodepng-rust?rev=8ceb5b1ffc9c1ab1f8c7ace9bde5f01a5be0aaa2#8ceb5b1ffc9c1ab1f8c7ace9bde5f01a5be0aaa2" +dependencies = [ + "fallible_collections", + "flate2", + "libc", + "rgb", +] + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "logos" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427e2abca5be13136da9afdbf874e6b34ad9001dd70f2b103b083a85daa7b345" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56a7d287fd2ac3f75b11f19a1c8a874a7d55744bd91f7a1b3e7cf87d4343c36d" +dependencies = [ + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax", + "syn", + "utf8-ranges", +] + +[[package]] +name = "lzma-rs" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aba8ecb0450dfabce4ad72085eed0a75dffe8f21f7ada05638564ea9db2d7fb1" +dependencies = [ + "byteorder", + "crc", +] + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "miniz_oxide" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" +dependencies = [ + "adler32", +] + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg 1.1.0", +] + +[[package]] +name = "mio" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +dependencies = [ + "libc", + "log", + "miow", + "ntapi", + "winapi", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + +[[package]] +name = "native-tls" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "notification_pusher_aws" +version = "0.1.0" +dependencies = [ + "async-trait", + "aws-config", + "candid", + "dotenv", + "dynamodb_index_store", + "index_store", + "notification_pusher_core", + "serde", + "tokio", + "tracing", + "tracing-subscriber", + "types", +] + +[[package]] +name = "notification_pusher_cli" +version = "0.1.0" +dependencies = [ + "async-trait", + "candid", + "dotenv", + "futures", + "index_store", + "notification_pusher_core", + "tokio", + "tracing", + "tracing-subscriber", + "types", +] + +[[package]] +name = "notification_pusher_core" +version = "0.1.0" +dependencies = [ + "async-trait", + "base64", + "candid", + "futures", + "garcon", + "ic-agent", + "index_store", + "notifications_canister", + "openssl", + "serde", + "tokio", + "tracing", + "types", + "web-push", +] + +[[package]] +name = "notifications_canister" +version = "0.1.0" +dependencies = [ + "candid", + "candid_gen", + "serde", + "types", +] + +[[package]] +name = "notifications_canister_c2c_client" +version = "0.1.0" +dependencies = [ + "canister_client_macros", + "ic-cdk", + "notifications_canister", + "tracing", + "types", +] + +[[package]] +name = "notifications_canister_client" +version = "0.1.0" +dependencies = [ + "candid", + "canister_client_macros", + "ic-agent", + "notifications_canister", + "types", +] + +[[package]] +name = "notifications_canister_impl" +version = "0.1.0" +dependencies = [ + "candid", + "canister_api_macros", + "canister_logger", + "canister_state_macros", + "http_request", + "ic-cdk", + "ic-cdk-macros", + "notifications_canister", + "serde", + "serializer", + "tracing", + "types", + "user_index_canister", + "user_index_canister_c2c_client", + "utils", +] + +[[package]] +name = "ntapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint-dig" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4547ee5541c18742396ae2c895d0717d0f886d8823b8399cdaf7b07d63ad0480" +dependencies = [ + "autocfg 0.1.8", + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.4", + "smallvec 1.8.0", + "zeroize", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg 1.1.0", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg 1.1.0", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num_threads" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ba99ba6393e2c3734791401b66902d981cb03bf190af674ca69949b6d5fb15" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" + +[[package]] +name = "online_users_aggregator_canister" +version = "0.1.0" +dependencies = [ + "candid", + "candid_gen", + "serde", + "types", +] + +[[package]] +name = "online_users_aggregator_canister_client" +version = "0.1.0" +dependencies = [ + "candid", + "canister_client_macros", + "ic-agent", + "online_users_aggregator_canister", + "types", +] + +[[package]] +name = "online_users_aggregator_canister_impl" +version = "0.1.0" +dependencies = [ + "candid", + "canister_api_macros", + "canister_logger", + "canister_state_macros", + "http_request", + "ic-cdk", + "ic-cdk-macros", + "online_users_aggregator_canister", + "serde", + "serializer", + "tracing", + "types", + "user_index_canister", + "user_index_canister_c2c_client", + "utils", +] + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "open_storage_bucket_canister" +version = "0.1.0" +dependencies = [ + "candid", + "candid_gen", + "serde", + "types", +] + +[[package]] +name = "open_storage_bucket_canister_c2c_client" +version = "0.1.0" +dependencies = [ + "canister_client_macros", + "ic-cdk", + "open_storage_bucket_canister", + "tracing", + "types", +] + +[[package]] +name = "open_storage_bucket_client" +version = "0.1.0" +dependencies = [ + "futures", + "ic-cdk", + "open_storage_bucket_canister", + "open_storage_bucket_canister_c2c_client", + "types", +] + +[[package]] +name = "open_storage_index_canister" +version = "0.1.0" +dependencies = [ + "candid", + "candid_gen", + "serde", + "types", +] + +[[package]] +name = "open_storage_index_canister_c2c_client" +version = "0.1.0" +dependencies = [ + "canister_client_macros", + "ic-cdk", + "open_storage_index_canister", + "tracing", + "types", +] + +[[package]] +name = "openssl" +version = "0.10.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-sys", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-src" +version = "111.17.0+1.1.1m" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d6a336abd10814198f66e2a91ccd7336611f30334119ca8ce300536666fcf4" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" +dependencies = [ + "autocfg 1.1.0", + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +dependencies = [ + "memchr", +] + +[[package]] +name = "p256" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d053368e1bae4c8a672953397bd1bd7183dde1c72b0b7612a15719173148d186" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sha2 0.9.9", +] + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec 1.8.0", + "winapi", +] + +[[package]] +name = "paste" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" + +[[package]] +name = "pem" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" +dependencies = [ + "base64", + "once_cell", + "regex", +] + +[[package]] +name = "pem" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9a3b09a20e374558580a4914d3b7d89bd61b954a5a5e1dcbea98753addb1947" +dependencies = [ + "base64", +] + +[[package]] +name = "pem-rfc7468" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84e93a3b1cc0510b03020f33f21e62acdde3dcaef432edc95bea377fbd4c2cd4" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "petgraph" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pico-args" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" + +[[package]] +name = "pin-project" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs1" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "116bee8279d783c0cf370efa1a94632f2108e5ef0bb32df31f051647810a4e2c" +dependencies = [ + "der", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "pkcs8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447" +dependencies = [ + "der", + "pem-rfc7468", + "pkcs1", + "spki", + "zeroize", +] + +[[package]] +name = "pkg-config" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" + +[[package]] +name = "png" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" +dependencies = [ + "bitflags", + "crc32fast", + "deflate", + "miniz_oxide 0.3.7", +] + +[[package]] +name = "polling" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +dependencies = [ + "cfg-if", + "libc", + "log", + "wepoll-ffi", + "winapi", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "pretty" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9940b913ee56ddd94aec2d3cd179dd47068236f42a1a6415ccf9d880ce2a61" +dependencies = [ + "arrayvec", + "typed-arena", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quickcheck" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6" +dependencies = [ + "rand 0.8.4", +] + +[[package]] +name = "quote" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.4", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "range-set" +version = "0.0.7" +source = "git+https://github.com/hpeebles/range-set?rev=d64d0b95c5a397273b490bd37d81ddbff9c3e4a3#d64d0b95c5a397273b490bd37d81ddbff9c3e4a3" +dependencies = [ + "num-traits", + "serde", + "smallvec 0.6.14", +] + +[[package]] +name = "rayon" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +dependencies = [ + "autocfg 1.1.0", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "lazy_static", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.4", + "redox_syscall", +] + +[[package]] +name = "regex" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "reqwest" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls 0.23.0", + "hyper-tls", + "ipnet", + "js-sys", + "lazy_static", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls 0.20.2", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tokio-rustls 0.23.2", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "rgb" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a374af9a0e5fdcdd98c1c7b64f05004f9ea2555b6c75f211daa81268a3c50f1" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rmp" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f55e5fa1446c4d5dd1f5daeed2a4fe193071771a2636274d0d7a3b082aa7ad6" +dependencies = [ + "byteorder", + "num-traits", +] + +[[package]] +name = "rmp-serde" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3eedffbfcc6a428f230c04baf8f59bd73c1781361e4286111fe900849aaddaf" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "root_canister" +version = "0.1.0" +dependencies = [ + "candid", + "candid_gen", + "serde", + "types", +] + +[[package]] +name = "root_canister_client" +version = "0.1.0" +dependencies = [ + "candid", + "canister_client_macros", + "ic-agent", + "root_canister", + "types", +] + +[[package]] +name = "root_canister_impl" +version = "0.1.0" +dependencies = [ + "candid", + "canister_api_macros", + "canister_logger", + "canister_state_macros", + "http_request", + "ic-cdk", + "ic-cdk-macros", + "root_canister", + "serde", + "serializer", + "tracing", + "types", + "user_index_canister", + "utils", +] + +[[package]] +name = "rsa" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c2603e2823634ab331437001b411b9ed11660fbc4066f3908c84a9439260d" +dependencies = [ + "byteorder", + "digest 0.9.0", + "lazy_static", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8", + "rand 0.8.4", + "subtle", + "zeroize", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64", + "log", + "ring", + "sct 0.6.1", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" +dependencies = [ + "log", + "ring", + "sct 0.7.0", + "webpki 0.22.0", +] + +[[package]] +name = "rustls-native-certs" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +dependencies = [ + "openssl-probe", + "rustls 0.19.1", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca9ebdfa27d3fc180e42879037b5338ab1c040c06affd00d8338598e7800943" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64", +] + +[[package]] +name = "rustversion" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" + +[[package]] +name = "ryu" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" + +[[package]] +name = "schannel" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +dependencies = [ + "lazy_static", + "winapi", +] + +[[package]] +name = "scoped_threadpool" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "search" +version = "0.1.0" +dependencies = [ + "types", +] + +[[package]] +name = "sec1_decode" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6326ddc956378a0739200b2c30892dccaf198992dfd7323274690b9e188af23" +dependencies = [ + "der", + "pem 0.8.3", + "thiserror", +] + +[[package]] +name = "security-framework" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" + +[[package]] +name = "serde" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_tokenstream" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6deb15c3a535e81438110111d90168d91721652f502abb147f31cde129f683d" +dependencies = [ + "proc-macro2", + "serde", + "syn", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serializer" +version = "0.1.0" +dependencies = [ + "rmp-serde", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.2", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2807892cfa58e081aa1f1111391c7a0649d4fa127a4ffbe34bcbfb35a1171a4" +dependencies = [ + "digest 0.9.0", + "rand_core 0.6.3", +] + +[[package]] +name = "simple_asn1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a762b1c38b9b990c694b9c2f8abe3372ce6a9ceaae6bca39cfc46e054f45745" +dependencies = [ + "num-bigint", + "num-traits", + "thiserror", + "time 0.3.7", +] + +[[package]] +name = "siphasher" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a86232ab60fa71287d7f2ddae4a7073f6b7aac33631c3015abb556f08c6d0a3e" + +[[package]] +name = "slab" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" + +[[package]] +name = "sluice" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5" +dependencies = [ + "async-channel", + "futures-core", + "futures-io", +] + +[[package]] +name = "smallvec" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" +dependencies = [ + "maybe-uninit", + "serde", +] + +[[package]] +name = "smallvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" + +[[package]] +name = "sms_sender_aws" +version = "0.1.0" +dependencies = [ + "async-trait", + "aws-config", + "aws-sdk-pinpoint", + "aws-types", + "candid", + "dotenv", + "dynamodb_index_store", + "index_store", + "sms_sender_core", + "tokio", + "tracing", + "tracing-subscriber", + "types", +] + +[[package]] +name = "sms_sender_cli" +version = "0.1.0" +dependencies = [ + "aws-config", + "candid", + "dotenv", + "index_store", + "sms_sender_aws", + "sms_sender_core", + "tokio", + "tracing", + "tracing-subscriber", + "types", +] + +[[package]] +name = "sms_sender_core" +version = "0.1.0" +dependencies = [ + "async-trait", + "candid", + "futures", + "garcon", + "ic-agent", + "index_store", + "openssl", + "serde", + "tokio", + "tracing", + "types", + "user_index_canister", +] + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32" +dependencies = [ + "der", +] + +[[package]] +name = "string_cache" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33994d0838dc2d152d17a62adf608a869b5e846b65b389af7f3dbc1de45c5b26" +dependencies = [ + "lazy_static", + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" + +[[package]] +name = "strum_macros" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" dependencies = [ - "autocfg", - "hashbrown", + "heck 0.3.3", + "proc-macro2", + "quote", + "rustversion", + "syn", ] [[package]] -name = "itertools" -version = "0.10.1" +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ - "either", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] -name = "lalrpop" -version = "0.19.6" +name = "synstructure" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15174f1c529af5bf1283c3bc0058266b483a67156f79589fab2a25e23cf8988" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "ascii-canvas", - "atty", - "bit-set", - "diff", - "ena", - "itertools", - "lalrpop-util", - "petgraph", - "pico-args", - "regex", - "regex-syntax", - "string_cache", - "term", - "tiny-keccak", + "proc-macro2", + "quote", + "syn", "unicode-xid", ] [[package]] -name = "lalrpop-util" -version = "0.19.6" +name = "tempfile" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e58cce361efcc90ba8a0a5f982c741ff86b603495bb15a998412e957dcd278" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "regex", + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "term" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] [[package]] -name = "leb128" -version = "0.2.4" +name = "termcolor" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +dependencies = [ + "winapi-util", +] [[package]] -name = "libc" -version = "0.2.101" +name = "textwrap" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb00336871be5ed2c8ed44b60ae9959dc5b9f08539422ed43f09e34ecaeba21" +checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" [[package]] -name = "log" -version = "0.4.14" +name = "thiserror" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ - "cfg-if 1.0.0", + "thiserror-impl", ] [[package]] -name = "logos" -version = "0.12.0" +name = "thiserror-impl" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427e2abca5be13136da9afdbf874e6b34ad9001dd70f2b103b083a85daa7b345" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ - "logos-derive", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "logos-derive" -version = "0.12.0" +name = "thread_local" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a7d287fd2ac3f75b11f19a1c8a874a7d55744bd91f7a1b3e7cf87d4343c36d" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tiff" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" +dependencies = [ + "jpeg-decoder", + "miniz_oxide 0.4.4", + "weezl", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "004cbc98f30fa233c61a38bc77e96a9106e65c88f2d3bef182ae952027e5753d" +dependencies = [ + "itoa", + "libc", + "num_threads", + "quickcheck", + "time-macros", +] + +[[package]] +name = "time-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25eb0ca3468fc0acc11828786797f6ef9aa1555e4a211a60d64cc8e4d1be47d6" + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" +dependencies = [ + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ - "beef", - "fnv", "proc-macro2", "quote", - "regex-syntax", "syn", - "utf8-ranges", ] [[package]] -name = "maybe-uninit" -version = "2.0.0" +name = "tokio-native-tls" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] [[package]] -name = "memchr" -version = "2.4.1" +name = "tokio-rustls" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +dependencies = [ + "rustls 0.19.1", + "tokio", + "webpki 0.21.4", +] [[package]] -name = "multi-map" -version = "1.3.0" +name = "tokio-rustls" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bba551d6d795f74a01767577ea8339560bf0a65354e0417b7e915ed608443d46" +checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b" +dependencies = [ + "rustls 0.20.2", + "tokio", + "webpki 0.22.0", +] [[package]] -name = "new_debug_unreachable" -version = "1.0.4" +name = "tokio-stream" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] [[package]] -name = "num-bigint" -version = "0.3.2" +name = "tokio-util" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d0a3d5e207573f948a9e5376662aa743a2ea13f7c50a554d7af443a73fbfeba" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", ] [[package]] -name = "num-integer" -version = "0.1.44" +name = "toml" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ - "autocfg", - "num-traits", + "serde", ] [[package]] -name = "num-traits" -version = "0.2.14" +name = "tower" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "5651b5f6860a99bd1adb59dbfe1db8beb433e73709d9032b413a77e2fb7c066a" dependencies = [ - "autocfg", + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "num_enum" -version = "0.5.4" +name = "tower-layer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" + +[[package]] +name = "tower-service" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" + +[[package]] +name = "tracing" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9" dependencies = [ - "derivative", - "num_enum_derive", + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", ] [[package]] -name = "num_enum_derive" -version = "0.5.4" +name = "tracing-attributes" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" +checksum = "8276d9a4a3a558d7b7ad5303ad50b53d58264641b82914b7ada36bd762e7a716" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", "syn", ] [[package]] -name = "once_cell" -version = "1.8.0" +name = "tracing-core" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23" +dependencies = [ + "lazy_static", + "valuable", +] [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "tracing-futures" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] [[package]] -name = "p2p" +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec 1.8.0", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "typed-arena" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "types" version = "0.1.0" dependencies = [ - "ic-cdk", - "ic-cdk-macros", + "candid", + "ic-ledger-types", + "lzma-rs", "serde", - "shared", + "serde_bytes", ] [[package]] -name = "paste" -version = "1.0.5" +name = "unicode-bidi" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] -name = "petgraph" -version = "0.5.1" +name = "unicode-normalization" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ - "fixedbitset", - "indexmap", + "tinyvec", ] [[package]] -name = "phf_shared" -version = "0.8.0" +name = "unicode-segmentation" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" -dependencies = [ - "siphasher", -] +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] -name = "pico-args" -version = "0.4.2" +name = "unicode-width" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] -name = "precomputed-hash" -version = "0.1.1" +name = "unicode-xid" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] -name = "pretty" -version = "0.10.0" +name = "untrusted" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad9940b913ee56ddd94aec2d3cd179dd47068236f42a1a6415ccf9d880ce2a61" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ - "arrayvec", - "typed-arena", + "form_urlencoded", + "idna", + "matches", + "percent-encoding", ] [[package]] -name = "proc-macro-crate" -version = "1.0.0" +name = "urlencoding" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92" +checksum = "5a1f0175e03a0973cf4afd476bef05c26e228520400eb1fd473ad417b1c00ffb" + +[[package]] +name = "user_canister" +version = "0.1.0" dependencies = [ - "thiserror", - "toml", + "candid", + "candid_gen", + "ic-ledger-types", + "serde", + "serde_bytes", + "types", ] [[package]] -name = "proc-macro2" -version = "1.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +name = "user_canister_c2c_client" +version = "0.1.0" dependencies = [ - "unicode-xid", + "canister_client_macros", + "ic-cdk", + "tracing", + "types", + "user_canister", ] [[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +name = "user_canister_client" +version = "0.1.0" dependencies = [ - "proc-macro2", + "candid", + "canister_client_macros", + "ic-agent", + "types", + "user_canister", ] [[package]] -name = "range-set" -version = "0.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51c363412e87a2d92e8730f95cbdae590a46959bbcb17d0b5c1ad2c7af98d11" +name = "user_canister_impl" +version = "0.1.0" dependencies = [ - "num-traits", - "smallvec", + "candid", + "canister_api_macros", + "canister_logger", + "canister_state_macros", + "chat_events", + "futures", + "group_canister", + "group_canister_c2c_client", + "group_index_canister", + "group_index_canister_c2c_client", + "http_request", + "ic-cdk", + "ic-cdk-macros", + "ic-ledger-types", + "itertools", + "ledger_utils", + "notifications_canister", + "notifications_canister_c2c_client", + "open_storage_bucket_client", + "search", + "serde", + "serializer", + "tracing", + "types", + "user_canister", + "user_canister_c2c_client", + "user_index_canister", + "user_index_canister_c2c_client", + "utils", ] [[package]] -name = "redox_syscall" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +name = "user_index_canister" +version = "0.1.0" dependencies = [ - "bitflags", + "candid", + "candid_gen", + "ic-ledger-types", + "serde", + "serde_bytes", + "types", ] [[package]] -name = "redox_users" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +name = "user_index_canister_c2c_client" +version = "0.1.0" dependencies = [ - "getrandom", - "redox_syscall", + "canister_client_macros", + "ic-cdk", + "tracing", + "types", + "user_index_canister", ] [[package]] -name = "regex" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +name = "user_index_canister_client" +version = "0.1.0" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "candid", + "canister_client_macros", + "ic-agent", + "types", + "user_index_canister", ] [[package]] -name = "regex-syntax" -version = "0.6.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +name = "user_index_canister_impl" +version = "0.1.0" +dependencies = [ + "candid", + "canister_api_macros", + "canister_logger", + "canister_state_macros", + "captcha", + "futures", + "group_canister", + "group_canister_c2c_client", + "http_request", + "ic-cdk", + "ic-cdk-macros", + "ic-ledger-types", + "itertools", + "ledger_utils", + "open_storage_index_canister", + "open_storage_index_canister_c2c_client", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "serde", + "serializer", + "tracing", + "types", + "user_canister", + "user_canister_c2c_client", + "user_index_canister", + "utils", +] [[package]] -name = "rustversion" -version = "1.0.5" +name = "utf8-ranges" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" [[package]] -name = "serde" -version = "1.0.130" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +name = "utils" +version = "0.1.0" dependencies = [ - "serde_derive", + "candid", + "canister_client_macros", + "getrandom 0.2.4", + "ic-cdk", + "rand 0.7.3", + "range-set", + "serde", + "serde_bytes", + "smallvec 0.6.14", + "tracing", + "types", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "valuable" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" -dependencies = [ - "serde", -] +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] -name = "serde_derive" -version = "1.0.130" +name = "vcpkg" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] -name = "serde_tokenstream" -version = "0.1.2" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3ce95257fba42a656f558db28d56a9fac5aa6e4f29c5ef607f32f524fab0ab" -dependencies = [ - "proc-macro2", - "serde", - "syn", -] +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "sha2" -version = "0.9.6" +name = "waker-fn" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9204c41a1597a8c5af23c82d1c921cb01ec0a4c59e07a9c7306062829a3903f3" -dependencies = [ - "block-buffer", - "cfg-if 1.0.0", - "cpufeatures", - "digest", - "opaque-debug", -] +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] -name = "shared" -version = "0.1.0" +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "highway", - "ic-cdk", - "ic-types", "log", - "serde", + "try-lock", ] [[package]] -name = "siphasher" -version = "0.3.6" +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729a25c17d72b06c68cb47955d44fda88ad2d3e7d77e025663fdd69b93dd71a1" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] -name = "smallvec" -version = "0.6.14" +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] -name = "string_cache" -version = "0.8.1" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ddb1139b5353f96e429e1a5e19fbaf663bddedaa06d1dbd49f82e352601209a" -dependencies = [ - "lazy_static", - "new_debug_unreachable", - "phf_shared", - "precomputed-hash", -] +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "syn" -version = "1.0.75" +name = "wasm-bindgen" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7" +checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", + "cfg-if", + "wasm-bindgen-macro", ] [[package]] -name = "term" -version = "0.7.0" +name = "wasm-bindgen-backend" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", ] [[package]] -name = "termcolor" -version = "1.1.2" +name = "wasm-bindgen-futures" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" dependencies = [ - "winapi-util", + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] -name = "thiserror" -version = "1.0.28" +name = "wasm-bindgen-macro" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "283d5230e63df9608ac7d9691adc1dfb6e701225436eb64d0b9a7f0a5a04f6ec" +checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" dependencies = [ - "thiserror-impl", + "quote", + "wasm-bindgen-macro-support", ] [[package]] -name = "thiserror-impl" -version = "1.0.28" +name = "wasm-bindgen-macro-support" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa3884228611f5cd3608e2d409bf7dce832e4eb3135e3f11addbd7e41bd68e71" +checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2", "quote", "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", ] [[package]] -name = "tiny-keccak" -version = "2.0.2" +name = "wasm-bindgen-shared" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] +checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" [[package]] -name = "toml" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +name = "web-push" +version = "0.9.1" +source = "git+https://github.com/hpeebles/rust-web-push?rev=c0424e229fab6094754338e6efb97efb9fcf56e5#c0424e229fab6094754338e6efb97efb9fcf56e5" dependencies = [ + "base64", + "chrono", + "ece", + "futures-lite", + "http", + "isahc", + "jwt-simple", + "log", + "pem 0.8.3", + "pkcs8", + "sec1_decode", "serde", + "serde_derive", + "serde_json", ] [[package]] -name = "typed-arena" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" - -[[package]] -name = "typenum" -version = "1.14.0" +name = "web-sys" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" +checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] -name = "unicode-width" -version = "0.1.8" +name = "webpki" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "webpki" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "user_mgmt" -version = "0.1.0" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ - "ic-cdk", - "ic-cdk-macros", - "multi-map", - "serde", - "shared", + "ring", + "untrusted", ] [[package]] -name = "utf8-ranges" -version = "1.0.4" +name = "webpki-roots" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" +checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449" +dependencies = [ + "webpki 0.22.0", +] [[package]] -name = "version_check" -version = "0.9.3" +name = "weezl" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "d8b77fdfd5a253be4ab714e4ffa3c49caf146b4de743e97510c0656cf90f1e8e" [[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +name = "wepoll-ffi" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] [[package]] name = "winapi" @@ -935,3 +4593,39 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi", +] + +[[package]] +name = "xmlparser" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "114ba2b24d2167ef6d67d7d04c8cc86522b87f490025f39f0303b7db5bf5e3d8" + +[[package]] +name = "zeroize" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] diff --git a/Cargo.toml b/Cargo.toml index 4a67078c39..4dd7f78532 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,70 @@ [workspace] members = [ - "src/services/chats", - "src/services/p2p", - "src/services/shared", - "src/services/user_mgmt" + "backend/canister_installer", + "backend/canister_upgrader", + "backend/canisters/group/api", + "backend/canisters/group/c2c_client", + "backend/canisters/group/client", + "backend/canisters/group/impl", + "backend/canisters/group_index/api", + "backend/canisters/group_index/c2c_client", + "backend/canisters/group_index/client", + "backend/canisters/group_index/impl", + "backend/canisters/notifications/api", + "backend/canisters/notifications/c2c_client", + "backend/canisters/notifications/client", + "backend/canisters/notifications/impl", + "backend/canisters/online_users_aggregator/api", + "backend/canisters/online_users_aggregator/client", + "backend/canisters/online_users_aggregator/impl", + "backend/canisters/open_storage_bucket/api", + "backend/canisters/open_storage_bucket/c2c_client", + "backend/canisters/open_storage_index/api", + "backend/canisters/open_storage_index/c2c_client", + "backend/canisters/root/api", + "backend/canisters/root/client", + "backend/canisters/root/impl", + "backend/canisters/user/api", + "backend/canisters/user/c2c_client", + "backend/canisters/user/client", + "backend/canisters/user/impl", + "backend/canisters/user_index/api", + "backend/canisters/user_index/c2c_client", + "backend/canisters/user_index/client", + "backend/canisters/user_index/impl", + "backend/data_generator", + "backend/libraries/canister_api_macros", + "backend/libraries/canister_client", + "backend/libraries/canister_client_macros", + "backend/libraries/canister_logger", + "backend/libraries/canister_state_macros", + "backend/libraries/chat_events", + "backend/libraries/dynamodb_index_store", + "backend/libraries/http_request", + "backend/libraries/index_store", + "backend/libraries/ledger_utils", + "backend/libraries/open_storage_bucket_client", + "backend/libraries/search", + "backend/libraries/serializer", + "backend/libraries/types", + "backend/libraries/utils", + "backend/notification_pusher/aws", + "backend/notification_pusher/cli", + "backend/notification_pusher/core", + "backend/sms_sender/aws", + "backend/sms_sender/cli", + "backend/sms_sender/core" ] [profile.release] lto = true opt-level = "z" codegen-units = 1 + +[patch.crates-io] +ic-cdk = { git = "https://github.com/hpeebles/cdk-rs", rev = "fe27fb859ee8080e65a36d16a2d97e446db08654" } +ic-cdk-macros = { git = "https://github.com/hpeebles/cdk-rs", rev = "fe27fb859ee8080e65a36d16a2d97e446db08654" } +web-push = { git = "https://github.com/hpeebles/rust-web-push", rev = "c0424e229fab6094754338e6efb97efb9fcf56e5" } +# We need a custom lodepng-rust that builds on wasm32-unknown-unknown +# https://github.com/dfinity/internet-identity/issues/471 +lodepng = { git = 'https://github.com/kornelski/lodepng-rust', rev = '8ceb5b1ffc9c1ab1f8c7ace9bde5f01a5be0aaa2' } \ No newline at end of file diff --git a/README.md b/README.md index 5de020aad3..27d96dbe11 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,7 @@ -# open-chat +## Testing locally -Welcome to your new open-chat project and to the internet computer development community. By default, creating a new project adds this README and some template files to your project directory. You can edit these template files to customize your project and to include your own code to speed up the development cycle. +Start dfx using `dfx start` -To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens. +To create and install the service canisters run `./deploy-local.sh ` (eg. `./deploy-local.sh default`) -To learn more before you start working with open-chat, see the following documentation available online: - -- [Quick Start](https://sdk.dfinity.org/docs/quickstart/quickstart.html) -- [SDK Developer Tools](https://sdk.dfinity.org/docs/developers-guide/sdk-guide.html) -- [Motoko Programming Language Guide](https://sdk.dfinity.org/docs/language-guide/motoko.html) -- [Motoko Language Quick Reference](https://sdk.dfinity.org/docs/language-guide/language-manual.html) - -If you want to start working on your project right away, you might want to try the following commands: - -```bash -cd open-chat/ -dfx help -dfx config --help -``` +To upgrade a canister run `./upgrade-canister-local.sh [VERSION]` (eg. `./upgrade-canister-local.sh default user 1.0.0`) \ No newline at end of file diff --git a/v2/backend/canister_installer/Cargo.toml b/backend/canister_installer/Cargo.toml similarity index 100% rename from v2/backend/canister_installer/Cargo.toml rename to backend/canister_installer/Cargo.toml diff --git a/v2/backend/canister_installer/local-bin/group_canister_impl-opt.wasm.xz b/backend/canister_installer/local-bin/group_canister_impl-opt.wasm.xz similarity index 100% rename from v2/backend/canister_installer/local-bin/group_canister_impl-opt.wasm.xz rename to backend/canister_installer/local-bin/group_canister_impl-opt.wasm.xz diff --git a/v2/backend/canister_installer/local-bin/group_index_canister_impl-opt.wasm b/backend/canister_installer/local-bin/group_index_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_installer/local-bin/group_index_canister_impl-opt.wasm rename to backend/canister_installer/local-bin/group_index_canister_impl-opt.wasm diff --git a/v2/backend/canister_installer/local-bin/notifications_canister_impl-opt.wasm b/backend/canister_installer/local-bin/notifications_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_installer/local-bin/notifications_canister_impl-opt.wasm rename to backend/canister_installer/local-bin/notifications_canister_impl-opt.wasm diff --git a/v2/backend/canister_installer/local-bin/online_users_aggregator_canister_impl-opt.wasm b/backend/canister_installer/local-bin/online_users_aggregator_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_installer/local-bin/online_users_aggregator_canister_impl-opt.wasm rename to backend/canister_installer/local-bin/online_users_aggregator_canister_impl-opt.wasm diff --git a/v2/backend/canister_installer/local-bin/root_canister_impl-opt.wasm b/backend/canister_installer/local-bin/root_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_installer/local-bin/root_canister_impl-opt.wasm rename to backend/canister_installer/local-bin/root_canister_impl-opt.wasm diff --git a/v2/backend/canister_installer/local-bin/user_canister_impl-opt.wasm.xz b/backend/canister_installer/local-bin/user_canister_impl-opt.wasm.xz similarity index 100% rename from v2/backend/canister_installer/local-bin/user_canister_impl-opt.wasm.xz rename to backend/canister_installer/local-bin/user_canister_impl-opt.wasm.xz diff --git a/v2/backend/canister_installer/local-bin/user_index_canister_impl-opt.wasm b/backend/canister_installer/local-bin/user_index_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_installer/local-bin/user_index_canister_impl-opt.wasm rename to backend/canister_installer/local-bin/user_index_canister_impl-opt.wasm diff --git a/v2/backend/canister_installer/local-bin/user_index_canister_impl-opt.wasm.xz b/backend/canister_installer/local-bin/user_index_canister_impl-opt.wasm.xz similarity index 100% rename from v2/backend/canister_installer/local-bin/user_index_canister_impl-opt.wasm.xz rename to backend/canister_installer/local-bin/user_index_canister_impl-opt.wasm.xz diff --git a/v2/backend/canister_installer/src/main.rs b/backend/canister_installer/src/main.rs similarity index 100% rename from v2/backend/canister_installer/src/main.rs rename to backend/canister_installer/src/main.rs diff --git a/v2/backend/canister_upgrader/Cargo.toml b/backend/canister_upgrader/Cargo.toml similarity index 100% rename from v2/backend/canister_upgrader/Cargo.toml rename to backend/canister_upgrader/Cargo.toml diff --git a/v2/backend/canister_upgrader/local-bin/group_canister_impl-opt.wasm.xz b/backend/canister_upgrader/local-bin/group_canister_impl-opt.wasm.xz similarity index 100% rename from v2/backend/canister_upgrader/local-bin/group_canister_impl-opt.wasm.xz rename to backend/canister_upgrader/local-bin/group_canister_impl-opt.wasm.xz diff --git a/v2/backend/canister_upgrader/local-bin/group_index_canister_impl-opt.wasm b/backend/canister_upgrader/local-bin/group_index_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_upgrader/local-bin/group_index_canister_impl-opt.wasm rename to backend/canister_upgrader/local-bin/group_index_canister_impl-opt.wasm diff --git a/v2/backend/canister_upgrader/local-bin/notifications_canister_impl-opt.wasm b/backend/canister_upgrader/local-bin/notifications_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_upgrader/local-bin/notifications_canister_impl-opt.wasm rename to backend/canister_upgrader/local-bin/notifications_canister_impl-opt.wasm diff --git a/v2/backend/canister_upgrader/local-bin/online_users_aggregator_canister_impl-opt.wasm b/backend/canister_upgrader/local-bin/online_users_aggregator_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_upgrader/local-bin/online_users_aggregator_canister_impl-opt.wasm rename to backend/canister_upgrader/local-bin/online_users_aggregator_canister_impl-opt.wasm diff --git a/v2/backend/canister_upgrader/local-bin/root_canister_impl-opt.wasm b/backend/canister_upgrader/local-bin/root_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_upgrader/local-bin/root_canister_impl-opt.wasm rename to backend/canister_upgrader/local-bin/root_canister_impl-opt.wasm diff --git a/v2/backend/canister_upgrader/local-bin/user_canister_impl-opt.wasm.xz b/backend/canister_upgrader/local-bin/user_canister_impl-opt.wasm.xz similarity index 100% rename from v2/backend/canister_upgrader/local-bin/user_canister_impl-opt.wasm.xz rename to backend/canister_upgrader/local-bin/user_canister_impl-opt.wasm.xz diff --git a/v2/backend/canister_upgrader/local-bin/user_index_canister_impl-opt.wasm b/backend/canister_upgrader/local-bin/user_index_canister_impl-opt.wasm similarity index 100% rename from v2/backend/canister_upgrader/local-bin/user_index_canister_impl-opt.wasm rename to backend/canister_upgrader/local-bin/user_index_canister_impl-opt.wasm diff --git a/v2/backend/canister_upgrader/local-bin/user_index_canister_impl-opt.wasm.xz b/backend/canister_upgrader/local-bin/user_index_canister_impl-opt.wasm.xz similarity index 100% rename from v2/backend/canister_upgrader/local-bin/user_index_canister_impl-opt.wasm.xz rename to backend/canister_upgrader/local-bin/user_index_canister_impl-opt.wasm.xz diff --git a/v2/backend/canister_upgrader/src/main.rs b/backend/canister_upgrader/src/main.rs similarity index 100% rename from v2/backend/canister_upgrader/src/main.rs rename to backend/canister_upgrader/src/main.rs diff --git a/v2/backend/canisters/group/api/Cargo.toml b/backend/canisters/group/api/Cargo.toml similarity index 100% rename from v2/backend/canisters/group/api/Cargo.toml rename to backend/canisters/group/api/Cargo.toml diff --git a/v2/backend/canisters/group/api/can.did b/backend/canisters/group/api/can.did similarity index 100% rename from v2/backend/canisters/group/api/can.did rename to backend/canisters/group/api/can.did diff --git a/v2/backend/canisters/group/api/src/lib.rs b/backend/canisters/group/api/src/lib.rs similarity index 100% rename from v2/backend/canisters/group/api/src/lib.rs rename to backend/canisters/group/api/src/lib.rs diff --git a/v2/backend/canisters/group/api/src/lifecycle/init.rs b/backend/canisters/group/api/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/group/api/src/lifecycle/init.rs rename to backend/canisters/group/api/src/lifecycle/init.rs diff --git a/v2/backend/canisters/group/api/src/lifecycle/mod.rs b/backend/canisters/group/api/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/group/api/src/lifecycle/mod.rs rename to backend/canisters/group/api/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/group/api/src/lifecycle/post_upgrade.rs b/backend/canisters/group/api/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/group/api/src/lifecycle/post_upgrade.rs rename to backend/canisters/group/api/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/group/api/src/main.rs b/backend/canisters/group/api/src/main.rs similarity index 100% rename from v2/backend/canisters/group/api/src/main.rs rename to backend/canisters/group/api/src/main.rs diff --git a/v2/backend/canisters/group/api/src/queries/c2c_search_messages.rs b/backend/canisters/group/api/src/queries/c2c_search_messages.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/c2c_search_messages.rs rename to backend/canisters/group/api/src/queries/c2c_search_messages.rs diff --git a/v2/backend/canisters/group/api/src/queries/c2c_summary.rs b/backend/canisters/group/api/src/queries/c2c_summary.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/c2c_summary.rs rename to backend/canisters/group/api/src/queries/c2c_summary.rs diff --git a/v2/backend/canisters/group/api/src/queries/c2c_summary_updates.rs b/backend/canisters/group/api/src/queries/c2c_summary_updates.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/c2c_summary_updates.rs rename to backend/canisters/group/api/src/queries/c2c_summary_updates.rs diff --git a/v2/backend/canisters/group/api/src/queries/events.rs b/backend/canisters/group/api/src/queries/events.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/events.rs rename to backend/canisters/group/api/src/queries/events.rs diff --git a/v2/backend/canisters/group/api/src/queries/events_by_index.rs b/backend/canisters/group/api/src/queries/events_by_index.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/events_by_index.rs rename to backend/canisters/group/api/src/queries/events_by_index.rs diff --git a/v2/backend/canisters/group/api/src/queries/events_range.rs b/backend/canisters/group/api/src/queries/events_range.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/events_range.rs rename to backend/canisters/group/api/src/queries/events_range.rs diff --git a/v2/backend/canisters/group/api/src/queries/events_window.rs b/backend/canisters/group/api/src/queries/events_window.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/events_window.rs rename to backend/canisters/group/api/src/queries/events_window.rs diff --git a/v2/backend/canisters/group/api/src/queries/mod.rs b/backend/canisters/group/api/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/mod.rs rename to backend/canisters/group/api/src/queries/mod.rs diff --git a/v2/backend/canisters/group/api/src/queries/public_summary.rs b/backend/canisters/group/api/src/queries/public_summary.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/public_summary.rs rename to backend/canisters/group/api/src/queries/public_summary.rs diff --git a/v2/backend/canisters/group/api/src/queries/search_messages.rs b/backend/canisters/group/api/src/queries/search_messages.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/search_messages.rs rename to backend/canisters/group/api/src/queries/search_messages.rs diff --git a/v2/backend/canisters/group/api/src/queries/selected_initial.rs b/backend/canisters/group/api/src/queries/selected_initial.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/selected_initial.rs rename to backend/canisters/group/api/src/queries/selected_initial.rs diff --git a/v2/backend/canisters/group/api/src/queries/selected_updates.rs b/backend/canisters/group/api/src/queries/selected_updates.rs similarity index 100% rename from v2/backend/canisters/group/api/src/queries/selected_updates.rs rename to backend/canisters/group/api/src/queries/selected_updates.rs diff --git a/v2/backend/canisters/group/api/src/updates/add_participants.rs b/backend/canisters/group/api/src/updates/add_participants.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/add_participants.rs rename to backend/canisters/group/api/src/updates/add_participants.rs diff --git a/v2/backend/canisters/group/api/src/updates/block_user.rs b/backend/canisters/group/api/src/updates/block_user.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/block_user.rs rename to backend/canisters/group/api/src/updates/block_user.rs diff --git a/v2/backend/canisters/group/api/src/updates/c2c_assume_super_admin.rs b/backend/canisters/group/api/src/updates/c2c_assume_super_admin.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/c2c_assume_super_admin.rs rename to backend/canisters/group/api/src/updates/c2c_assume_super_admin.rs diff --git a/v2/backend/canisters/group/api/src/updates/c2c_dismiss_super_admin.rs b/backend/canisters/group/api/src/updates/c2c_dismiss_super_admin.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/c2c_dismiss_super_admin.rs rename to backend/canisters/group/api/src/updates/c2c_dismiss_super_admin.rs diff --git a/v2/backend/canisters/group/api/src/updates/c2c_join_group.rs b/backend/canisters/group/api/src/updates/c2c_join_group.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/c2c_join_group.rs rename to backend/canisters/group/api/src/updates/c2c_join_group.rs diff --git a/v2/backend/canisters/group/api/src/updates/c2c_join_group_v2.rs b/backend/canisters/group/api/src/updates/c2c_join_group_v2.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/c2c_join_group_v2.rs rename to backend/canisters/group/api/src/updates/c2c_join_group_v2.rs diff --git a/v2/backend/canisters/group/api/src/updates/c2c_leave_group.rs b/backend/canisters/group/api/src/updates/c2c_leave_group.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/c2c_leave_group.rs rename to backend/canisters/group/api/src/updates/c2c_leave_group.rs diff --git a/v2/backend/canisters/group/api/src/updates/c2c_relinquish_super_admin.rs b/backend/canisters/group/api/src/updates/c2c_relinquish_super_admin.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/c2c_relinquish_super_admin.rs rename to backend/canisters/group/api/src/updates/c2c_relinquish_super_admin.rs diff --git a/v2/backend/canisters/group/api/src/updates/c2c_toggle_mute_notifications.rs b/backend/canisters/group/api/src/updates/c2c_toggle_mute_notifications.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/c2c_toggle_mute_notifications.rs rename to backend/canisters/group/api/src/updates/c2c_toggle_mute_notifications.rs diff --git a/v2/backend/canisters/group/api/src/updates/change_role.rs b/backend/canisters/group/api/src/updates/change_role.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/change_role.rs rename to backend/canisters/group/api/src/updates/change_role.rs diff --git a/v2/backend/canisters/group/api/src/updates/delete_group.rs b/backend/canisters/group/api/src/updates/delete_group.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/delete_group.rs rename to backend/canisters/group/api/src/updates/delete_group.rs diff --git a/v2/backend/canisters/group/api/src/updates/delete_messages.rs b/backend/canisters/group/api/src/updates/delete_messages.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/delete_messages.rs rename to backend/canisters/group/api/src/updates/delete_messages.rs diff --git a/v2/backend/canisters/group/api/src/updates/edit_message.rs b/backend/canisters/group/api/src/updates/edit_message.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/edit_message.rs rename to backend/canisters/group/api/src/updates/edit_message.rs diff --git a/v2/backend/canisters/group/api/src/updates/mod.rs b/backend/canisters/group/api/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/mod.rs rename to backend/canisters/group/api/src/updates/mod.rs diff --git a/v2/backend/canisters/group/api/src/updates/remove_participant.rs b/backend/canisters/group/api/src/updates/remove_participant.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/remove_participant.rs rename to backend/canisters/group/api/src/updates/remove_participant.rs diff --git a/v2/backend/canisters/group/api/src/updates/send_message.rs b/backend/canisters/group/api/src/updates/send_message.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/send_message.rs rename to backend/canisters/group/api/src/updates/send_message.rs diff --git a/v2/backend/canisters/group/api/src/updates/set_pinned_message.rs b/backend/canisters/group/api/src/updates/set_pinned_message.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/set_pinned_message.rs rename to backend/canisters/group/api/src/updates/set_pinned_message.rs diff --git a/v2/backend/canisters/group/api/src/updates/toggle_reaction.rs b/backend/canisters/group/api/src/updates/toggle_reaction.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/toggle_reaction.rs rename to backend/canisters/group/api/src/updates/toggle_reaction.rs diff --git a/v2/backend/canisters/group/api/src/updates/unblock_user.rs b/backend/canisters/group/api/src/updates/unblock_user.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/unblock_user.rs rename to backend/canisters/group/api/src/updates/unblock_user.rs diff --git a/v2/backend/canisters/group/api/src/updates/update_group.rs b/backend/canisters/group/api/src/updates/update_group.rs similarity index 100% rename from v2/backend/canisters/group/api/src/updates/update_group.rs rename to backend/canisters/group/api/src/updates/update_group.rs diff --git a/v2/backend/canisters/group/c2c_client/Cargo.toml b/backend/canisters/group/c2c_client/Cargo.toml similarity index 100% rename from v2/backend/canisters/group/c2c_client/Cargo.toml rename to backend/canisters/group/c2c_client/Cargo.toml diff --git a/v2/backend/canisters/group/c2c_client/src/lib.rs b/backend/canisters/group/c2c_client/src/lib.rs similarity index 100% rename from v2/backend/canisters/group/c2c_client/src/lib.rs rename to backend/canisters/group/c2c_client/src/lib.rs diff --git a/v2/backend/canisters/group/client/Cargo.toml b/backend/canisters/group/client/Cargo.toml similarity index 100% rename from v2/backend/canisters/group/client/Cargo.toml rename to backend/canisters/group/client/Cargo.toml diff --git a/v2/backend/canisters/group/client/src/lib.rs b/backend/canisters/group/client/src/lib.rs similarity index 100% rename from v2/backend/canisters/group/client/src/lib.rs rename to backend/canisters/group/client/src/lib.rs diff --git a/v2/backend/canisters/group/impl/Cargo.toml b/backend/canisters/group/impl/Cargo.toml similarity index 100% rename from v2/backend/canisters/group/impl/Cargo.toml rename to backend/canisters/group/impl/Cargo.toml diff --git a/v2/backend/canisters/group/impl/src/guards.rs b/backend/canisters/group/impl/src/guards.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/guards.rs rename to backend/canisters/group/impl/src/guards.rs diff --git a/v2/backend/canisters/group/impl/src/lib.rs b/backend/canisters/group/impl/src/lib.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/lib.rs rename to backend/canisters/group/impl/src/lib.rs diff --git a/v2/backend/canisters/group/impl/src/lifecycle/init.rs b/backend/canisters/group/impl/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/lifecycle/init.rs rename to backend/canisters/group/impl/src/lifecycle/init.rs diff --git a/v2/backend/canisters/group/impl/src/lifecycle/inspect_message.rs b/backend/canisters/group/impl/src/lifecycle/inspect_message.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/lifecycle/inspect_message.rs rename to backend/canisters/group/impl/src/lifecycle/inspect_message.rs diff --git a/v2/backend/canisters/group/impl/src/lifecycle/mod.rs b/backend/canisters/group/impl/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/lifecycle/mod.rs rename to backend/canisters/group/impl/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/group/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/group/impl/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/lifecycle/post_upgrade.rs rename to backend/canisters/group/impl/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/group/impl/src/lifecycle/pre_upgrade.rs b/backend/canisters/group/impl/src/lifecycle/pre_upgrade.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/lifecycle/pre_upgrade.rs rename to backend/canisters/group/impl/src/lifecycle/pre_upgrade.rs diff --git a/v2/backend/canisters/group/impl/src/model/activity_notification_state.rs b/backend/canisters/group/impl/src/model/activity_notification_state.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/model/activity_notification_state.rs rename to backend/canisters/group/impl/src/model/activity_notification_state.rs diff --git a/v2/backend/canisters/group/impl/src/model/mod.rs b/backend/canisters/group/impl/src/model/mod.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/model/mod.rs rename to backend/canisters/group/impl/src/model/mod.rs diff --git a/v2/backend/canisters/group/impl/src/model/participants.rs b/backend/canisters/group/impl/src/model/participants.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/model/participants.rs rename to backend/canisters/group/impl/src/model/participants.rs diff --git a/v2/backend/canisters/group/impl/src/queries/c2c_search_messages.rs b/backend/canisters/group/impl/src/queries/c2c_search_messages.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/c2c_search_messages.rs rename to backend/canisters/group/impl/src/queries/c2c_search_messages.rs diff --git a/v2/backend/canisters/group/impl/src/queries/c2c_summary.rs b/backend/canisters/group/impl/src/queries/c2c_summary.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/c2c_summary.rs rename to backend/canisters/group/impl/src/queries/c2c_summary.rs diff --git a/v2/backend/canisters/group/impl/src/queries/c2c_summary_updates.rs b/backend/canisters/group/impl/src/queries/c2c_summary_updates.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/c2c_summary_updates.rs rename to backend/canisters/group/impl/src/queries/c2c_summary_updates.rs diff --git a/v2/backend/canisters/group/impl/src/queries/events.rs b/backend/canisters/group/impl/src/queries/events.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/events.rs rename to backend/canisters/group/impl/src/queries/events.rs diff --git a/v2/backend/canisters/group/impl/src/queries/events_by_index.rs b/backend/canisters/group/impl/src/queries/events_by_index.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/events_by_index.rs rename to backend/canisters/group/impl/src/queries/events_by_index.rs diff --git a/v2/backend/canisters/group/impl/src/queries/events_range.rs b/backend/canisters/group/impl/src/queries/events_range.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/events_range.rs rename to backend/canisters/group/impl/src/queries/events_range.rs diff --git a/v2/backend/canisters/group/impl/src/queries/events_window.rs b/backend/canisters/group/impl/src/queries/events_window.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/events_window.rs rename to backend/canisters/group/impl/src/queries/events_window.rs diff --git a/v2/backend/canisters/group/impl/src/queries/http_request.rs b/backend/canisters/group/impl/src/queries/http_request.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/http_request.rs rename to backend/canisters/group/impl/src/queries/http_request.rs diff --git a/v2/backend/canisters/group/impl/src/queries/mod.rs b/backend/canisters/group/impl/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/mod.rs rename to backend/canisters/group/impl/src/queries/mod.rs diff --git a/v2/backend/canisters/group/impl/src/queries/public_summary.rs b/backend/canisters/group/impl/src/queries/public_summary.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/public_summary.rs rename to backend/canisters/group/impl/src/queries/public_summary.rs diff --git a/v2/backend/canisters/group/impl/src/queries/search_messages.rs b/backend/canisters/group/impl/src/queries/search_messages.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/search_messages.rs rename to backend/canisters/group/impl/src/queries/search_messages.rs diff --git a/v2/backend/canisters/group/impl/src/queries/selected_initial.rs b/backend/canisters/group/impl/src/queries/selected_initial.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/selected_initial.rs rename to backend/canisters/group/impl/src/queries/selected_initial.rs diff --git a/v2/backend/canisters/group/impl/src/queries/selected_updates.rs b/backend/canisters/group/impl/src/queries/selected_updates.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/queries/selected_updates.rs rename to backend/canisters/group/impl/src/queries/selected_updates.rs diff --git a/v2/backend/canisters/group/impl/src/regular_jobs.rs b/backend/canisters/group/impl/src/regular_jobs.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/regular_jobs.rs rename to backend/canisters/group/impl/src/regular_jobs.rs diff --git a/v2/backend/canisters/group/impl/src/updates/add_participants.rs b/backend/canisters/group/impl/src/updates/add_participants.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/add_participants.rs rename to backend/canisters/group/impl/src/updates/add_participants.rs diff --git a/v2/backend/canisters/group/impl/src/updates/block_user.rs b/backend/canisters/group/impl/src/updates/block_user.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/block_user.rs rename to backend/canisters/group/impl/src/updates/block_user.rs diff --git a/v2/backend/canisters/group/impl/src/updates/c2c_assume_super_admin.rs b/backend/canisters/group/impl/src/updates/c2c_assume_super_admin.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/c2c_assume_super_admin.rs rename to backend/canisters/group/impl/src/updates/c2c_assume_super_admin.rs diff --git a/v2/backend/canisters/group/impl/src/updates/c2c_dismiss_super_admin.rs b/backend/canisters/group/impl/src/updates/c2c_dismiss_super_admin.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/c2c_dismiss_super_admin.rs rename to backend/canisters/group/impl/src/updates/c2c_dismiss_super_admin.rs diff --git a/v2/backend/canisters/group/impl/src/updates/c2c_join_group.rs b/backend/canisters/group/impl/src/updates/c2c_join_group.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/c2c_join_group.rs rename to backend/canisters/group/impl/src/updates/c2c_join_group.rs diff --git a/v2/backend/canisters/group/impl/src/updates/c2c_leave_group.rs b/backend/canisters/group/impl/src/updates/c2c_leave_group.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/c2c_leave_group.rs rename to backend/canisters/group/impl/src/updates/c2c_leave_group.rs diff --git a/v2/backend/canisters/group/impl/src/updates/c2c_relinquish_super_admin.rs b/backend/canisters/group/impl/src/updates/c2c_relinquish_super_admin.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/c2c_relinquish_super_admin.rs rename to backend/canisters/group/impl/src/updates/c2c_relinquish_super_admin.rs diff --git a/v2/backend/canisters/group/impl/src/updates/c2c_toggle_mute_notifications.rs b/backend/canisters/group/impl/src/updates/c2c_toggle_mute_notifications.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/c2c_toggle_mute_notifications.rs rename to backend/canisters/group/impl/src/updates/c2c_toggle_mute_notifications.rs diff --git a/v2/backend/canisters/group/impl/src/updates/change_role.rs b/backend/canisters/group/impl/src/updates/change_role.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/change_role.rs rename to backend/canisters/group/impl/src/updates/change_role.rs diff --git a/v2/backend/canisters/group/impl/src/updates/delete_group.rs b/backend/canisters/group/impl/src/updates/delete_group.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/delete_group.rs rename to backend/canisters/group/impl/src/updates/delete_group.rs diff --git a/v2/backend/canisters/group/impl/src/updates/delete_messages.rs b/backend/canisters/group/impl/src/updates/delete_messages.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/delete_messages.rs rename to backend/canisters/group/impl/src/updates/delete_messages.rs diff --git a/v2/backend/canisters/group/impl/src/updates/edit_message.rs b/backend/canisters/group/impl/src/updates/edit_message.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/edit_message.rs rename to backend/canisters/group/impl/src/updates/edit_message.rs diff --git a/v2/backend/canisters/group/impl/src/updates/mod.rs b/backend/canisters/group/impl/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/mod.rs rename to backend/canisters/group/impl/src/updates/mod.rs diff --git a/v2/backend/canisters/group/impl/src/updates/remove_participant.rs b/backend/canisters/group/impl/src/updates/remove_participant.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/remove_participant.rs rename to backend/canisters/group/impl/src/updates/remove_participant.rs diff --git a/v2/backend/canisters/group/impl/src/updates/send_message.rs b/backend/canisters/group/impl/src/updates/send_message.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/send_message.rs rename to backend/canisters/group/impl/src/updates/send_message.rs diff --git a/v2/backend/canisters/group/impl/src/updates/set_pinned_message.rs b/backend/canisters/group/impl/src/updates/set_pinned_message.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/set_pinned_message.rs rename to backend/canisters/group/impl/src/updates/set_pinned_message.rs diff --git a/v2/backend/canisters/group/impl/src/updates/toggle_reaction.rs b/backend/canisters/group/impl/src/updates/toggle_reaction.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/toggle_reaction.rs rename to backend/canisters/group/impl/src/updates/toggle_reaction.rs diff --git a/v2/backend/canisters/group/impl/src/updates/unblock_user.rs b/backend/canisters/group/impl/src/updates/unblock_user.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/unblock_user.rs rename to backend/canisters/group/impl/src/updates/unblock_user.rs diff --git a/v2/backend/canisters/group/impl/src/updates/update_group.rs b/backend/canisters/group/impl/src/updates/update_group.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/update_group.rs rename to backend/canisters/group/impl/src/updates/update_group.rs diff --git a/v2/backend/canisters/group/impl/src/updates/wallet_receive.rs b/backend/canisters/group/impl/src/updates/wallet_receive.rs similarity index 100% rename from v2/backend/canisters/group/impl/src/updates/wallet_receive.rs rename to backend/canisters/group/impl/src/updates/wallet_receive.rs diff --git a/v2/backend/canisters/group_index/api/Cargo.toml b/backend/canisters/group_index/api/Cargo.toml similarity index 100% rename from v2/backend/canisters/group_index/api/Cargo.toml rename to backend/canisters/group_index/api/Cargo.toml diff --git a/v2/backend/canisters/group_index/api/can.did b/backend/canisters/group_index/api/can.did similarity index 100% rename from v2/backend/canisters/group_index/api/can.did rename to backend/canisters/group_index/api/can.did diff --git a/v2/backend/canisters/group_index/api/src/lib.rs b/backend/canisters/group_index/api/src/lib.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/lib.rs rename to backend/canisters/group_index/api/src/lib.rs diff --git a/v2/backend/canisters/group_index/api/src/lifecycle/init.rs b/backend/canisters/group_index/api/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/lifecycle/init.rs rename to backend/canisters/group_index/api/src/lifecycle/init.rs diff --git a/v2/backend/canisters/group_index/api/src/lifecycle/mod.rs b/backend/canisters/group_index/api/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/lifecycle/mod.rs rename to backend/canisters/group_index/api/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/group_index/api/src/lifecycle/post_upgrade.rs b/backend/canisters/group_index/api/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/lifecycle/post_upgrade.rs rename to backend/canisters/group_index/api/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/group_index/api/src/main.rs b/backend/canisters/group_index/api/src/main.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/main.rs rename to backend/canisters/group_index/api/src/main.rs diff --git a/v2/backend/canisters/group_index/api/src/queries/c2c_filter_groups.rs b/backend/canisters/group_index/api/src/queries/c2c_filter_groups.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/queries/c2c_filter_groups.rs rename to backend/canisters/group_index/api/src/queries/c2c_filter_groups.rs diff --git a/v2/backend/canisters/group_index/api/src/queries/c2c_recommended_groups.rs b/backend/canisters/group_index/api/src/queries/c2c_recommended_groups.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/queries/c2c_recommended_groups.rs rename to backend/canisters/group_index/api/src/queries/c2c_recommended_groups.rs diff --git a/v2/backend/canisters/group_index/api/src/queries/mod.rs b/backend/canisters/group_index/api/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/queries/mod.rs rename to backend/canisters/group_index/api/src/queries/mod.rs diff --git a/v2/backend/canisters/group_index/api/src/queries/search.rs b/backend/canisters/group_index/api/src/queries/search.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/queries/search.rs rename to backend/canisters/group_index/api/src/queries/search.rs diff --git a/v2/backend/canisters/group_index/api/src/updates/c2c_create_group.rs b/backend/canisters/group_index/api/src/updates/c2c_create_group.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/updates/c2c_create_group.rs rename to backend/canisters/group_index/api/src/updates/c2c_create_group.rs diff --git a/v2/backend/canisters/group_index/api/src/updates/c2c_delete_group.rs b/backend/canisters/group_index/api/src/updates/c2c_delete_group.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/updates/c2c_delete_group.rs rename to backend/canisters/group_index/api/src/updates/c2c_delete_group.rs diff --git a/v2/backend/canisters/group_index/api/src/updates/c2c_mark_active.rs b/backend/canisters/group_index/api/src/updates/c2c_mark_active.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/updates/c2c_mark_active.rs rename to backend/canisters/group_index/api/src/updates/c2c_mark_active.rs diff --git a/v2/backend/canisters/group_index/api/src/updates/c2c_notify_low_balance.rs b/backend/canisters/group_index/api/src/updates/c2c_notify_low_balance.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/updates/c2c_notify_low_balance.rs rename to backend/canisters/group_index/api/src/updates/c2c_notify_low_balance.rs diff --git a/v2/backend/canisters/group_index/api/src/updates/c2c_update_group.rs b/backend/canisters/group_index/api/src/updates/c2c_update_group.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/updates/c2c_update_group.rs rename to backend/canisters/group_index/api/src/updates/c2c_update_group.rs diff --git a/v2/backend/canisters/group_index/api/src/updates/mod.rs b/backend/canisters/group_index/api/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/updates/mod.rs rename to backend/canisters/group_index/api/src/updates/mod.rs diff --git a/v2/backend/canisters/group_index/api/src/updates/upgrade_group_canister_wasm.rs b/backend/canisters/group_index/api/src/updates/upgrade_group_canister_wasm.rs similarity index 100% rename from v2/backend/canisters/group_index/api/src/updates/upgrade_group_canister_wasm.rs rename to backend/canisters/group_index/api/src/updates/upgrade_group_canister_wasm.rs diff --git a/v2/backend/canisters/group_index/c2c_client/Cargo.toml b/backend/canisters/group_index/c2c_client/Cargo.toml similarity index 100% rename from v2/backend/canisters/group_index/c2c_client/Cargo.toml rename to backend/canisters/group_index/c2c_client/Cargo.toml diff --git a/v2/backend/canisters/group_index/c2c_client/src/lib.rs b/backend/canisters/group_index/c2c_client/src/lib.rs similarity index 100% rename from v2/backend/canisters/group_index/c2c_client/src/lib.rs rename to backend/canisters/group_index/c2c_client/src/lib.rs diff --git a/v2/backend/canisters/group_index/client/Cargo.toml b/backend/canisters/group_index/client/Cargo.toml similarity index 100% rename from v2/backend/canisters/group_index/client/Cargo.toml rename to backend/canisters/group_index/client/Cargo.toml diff --git a/v2/backend/canisters/group_index/client/src/lib.rs b/backend/canisters/group_index/client/src/lib.rs similarity index 100% rename from v2/backend/canisters/group_index/client/src/lib.rs rename to backend/canisters/group_index/client/src/lib.rs diff --git a/v2/backend/canisters/group_index/impl/Cargo.toml b/backend/canisters/group_index/impl/Cargo.toml similarity index 100% rename from v2/backend/canisters/group_index/impl/Cargo.toml rename to backend/canisters/group_index/impl/Cargo.toml diff --git a/v2/backend/canisters/group_index/impl/src/lib.rs b/backend/canisters/group_index/impl/src/lib.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/lib.rs rename to backend/canisters/group_index/impl/src/lib.rs diff --git a/v2/backend/canisters/group_index/impl/src/lifecycle/heartbeat.rs b/backend/canisters/group_index/impl/src/lifecycle/heartbeat.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/lifecycle/heartbeat.rs rename to backend/canisters/group_index/impl/src/lifecycle/heartbeat.rs diff --git a/v2/backend/canisters/group_index/impl/src/lifecycle/init.rs b/backend/canisters/group_index/impl/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/lifecycle/init.rs rename to backend/canisters/group_index/impl/src/lifecycle/init.rs diff --git a/v2/backend/canisters/group_index/impl/src/lifecycle/inspect_message.rs b/backend/canisters/group_index/impl/src/lifecycle/inspect_message.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/lifecycle/inspect_message.rs rename to backend/canisters/group_index/impl/src/lifecycle/inspect_message.rs diff --git a/v2/backend/canisters/group_index/impl/src/lifecycle/mod.rs b/backend/canisters/group_index/impl/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/lifecycle/mod.rs rename to backend/canisters/group_index/impl/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/group_index/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/group_index/impl/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/lifecycle/post_upgrade.rs rename to backend/canisters/group_index/impl/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/group_index/impl/src/lifecycle/pre_upgrade.rs b/backend/canisters/group_index/impl/src/lifecycle/pre_upgrade.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/lifecycle/pre_upgrade.rs rename to backend/canisters/group_index/impl/src/lifecycle/pre_upgrade.rs diff --git a/v2/backend/canisters/group_index/impl/src/model/cached_hot_groups.rs b/backend/canisters/group_index/impl/src/model/cached_hot_groups.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/model/cached_hot_groups.rs rename to backend/canisters/group_index/impl/src/model/cached_hot_groups.rs diff --git a/v2/backend/canisters/group_index/impl/src/model/deleted_groups.rs b/backend/canisters/group_index/impl/src/model/deleted_groups.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/model/deleted_groups.rs rename to backend/canisters/group_index/impl/src/model/deleted_groups.rs diff --git a/v2/backend/canisters/group_index/impl/src/model/mod.rs b/backend/canisters/group_index/impl/src/model/mod.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/model/mod.rs rename to backend/canisters/group_index/impl/src/model/mod.rs diff --git a/v2/backend/canisters/group_index/impl/src/model/private_groups.rs b/backend/canisters/group_index/impl/src/model/private_groups.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/model/private_groups.rs rename to backend/canisters/group_index/impl/src/model/private_groups.rs diff --git a/v2/backend/canisters/group_index/impl/src/model/public_groups.rs b/backend/canisters/group_index/impl/src/model/public_groups.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/model/public_groups.rs rename to backend/canisters/group_index/impl/src/model/public_groups.rs diff --git a/v2/backend/canisters/group_index/impl/src/queries/c2c_filter_groups.rs b/backend/canisters/group_index/impl/src/queries/c2c_filter_groups.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/queries/c2c_filter_groups.rs rename to backend/canisters/group_index/impl/src/queries/c2c_filter_groups.rs diff --git a/v2/backend/canisters/group_index/impl/src/queries/c2c_recommended_groups.rs b/backend/canisters/group_index/impl/src/queries/c2c_recommended_groups.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/queries/c2c_recommended_groups.rs rename to backend/canisters/group_index/impl/src/queries/c2c_recommended_groups.rs diff --git a/v2/backend/canisters/group_index/impl/src/queries/http_request.rs b/backend/canisters/group_index/impl/src/queries/http_request.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/queries/http_request.rs rename to backend/canisters/group_index/impl/src/queries/http_request.rs diff --git a/v2/backend/canisters/group_index/impl/src/queries/mod.rs b/backend/canisters/group_index/impl/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/queries/mod.rs rename to backend/canisters/group_index/impl/src/queries/mod.rs diff --git a/v2/backend/canisters/group_index/impl/src/queries/search.rs b/backend/canisters/group_index/impl/src/queries/search.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/queries/search.rs rename to backend/canisters/group_index/impl/src/queries/search.rs diff --git a/v2/backend/canisters/group_index/impl/src/updates/c2c_create_group.rs b/backend/canisters/group_index/impl/src/updates/c2c_create_group.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/updates/c2c_create_group.rs rename to backend/canisters/group_index/impl/src/updates/c2c_create_group.rs diff --git a/v2/backend/canisters/group_index/impl/src/updates/c2c_delete_group.rs b/backend/canisters/group_index/impl/src/updates/c2c_delete_group.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/updates/c2c_delete_group.rs rename to backend/canisters/group_index/impl/src/updates/c2c_delete_group.rs diff --git a/v2/backend/canisters/group_index/impl/src/updates/c2c_mark_active.rs b/backend/canisters/group_index/impl/src/updates/c2c_mark_active.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/updates/c2c_mark_active.rs rename to backend/canisters/group_index/impl/src/updates/c2c_mark_active.rs diff --git a/v2/backend/canisters/group_index/impl/src/updates/c2c_notify_low_balance.rs b/backend/canisters/group_index/impl/src/updates/c2c_notify_low_balance.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/updates/c2c_notify_low_balance.rs rename to backend/canisters/group_index/impl/src/updates/c2c_notify_low_balance.rs diff --git a/v2/backend/canisters/group_index/impl/src/updates/c2c_update_group.rs b/backend/canisters/group_index/impl/src/updates/c2c_update_group.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/updates/c2c_update_group.rs rename to backend/canisters/group_index/impl/src/updates/c2c_update_group.rs diff --git a/v2/backend/canisters/group_index/impl/src/updates/mod.rs b/backend/canisters/group_index/impl/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/updates/mod.rs rename to backend/canisters/group_index/impl/src/updates/mod.rs diff --git a/v2/backend/canisters/group_index/impl/src/updates/upgrade_group_canister_wasm.rs b/backend/canisters/group_index/impl/src/updates/upgrade_group_canister_wasm.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/updates/upgrade_group_canister_wasm.rs rename to backend/canisters/group_index/impl/src/updates/upgrade_group_canister_wasm.rs diff --git a/v2/backend/canisters/group_index/impl/src/updates/wallet_receive.rs b/backend/canisters/group_index/impl/src/updates/wallet_receive.rs similarity index 100% rename from v2/backend/canisters/group_index/impl/src/updates/wallet_receive.rs rename to backend/canisters/group_index/impl/src/updates/wallet_receive.rs diff --git a/v2/backend/canisters/notifications/api/Cargo.toml b/backend/canisters/notifications/api/Cargo.toml similarity index 100% rename from v2/backend/canisters/notifications/api/Cargo.toml rename to backend/canisters/notifications/api/Cargo.toml diff --git a/v2/backend/canisters/notifications/api/can.did b/backend/canisters/notifications/api/can.did similarity index 100% rename from v2/backend/canisters/notifications/api/can.did rename to backend/canisters/notifications/api/can.did diff --git a/v2/backend/canisters/notifications/api/src/lib.rs b/backend/canisters/notifications/api/src/lib.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/lib.rs rename to backend/canisters/notifications/api/src/lib.rs diff --git a/v2/backend/canisters/notifications/api/src/lifecycle/init.rs b/backend/canisters/notifications/api/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/lifecycle/init.rs rename to backend/canisters/notifications/api/src/lifecycle/init.rs diff --git a/v2/backend/canisters/notifications/api/src/lifecycle/mod.rs b/backend/canisters/notifications/api/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/lifecycle/mod.rs rename to backend/canisters/notifications/api/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/notifications/api/src/lifecycle/post_upgrade.rs b/backend/canisters/notifications/api/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/lifecycle/post_upgrade.rs rename to backend/canisters/notifications/api/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/notifications/api/src/main.rs b/backend/canisters/notifications/api/src/main.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/main.rs rename to backend/canisters/notifications/api/src/main.rs diff --git a/v2/backend/canisters/notifications/api/src/notification_candid_gen.rs b/backend/canisters/notifications/api/src/notification_candid_gen.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/notification_candid_gen.rs rename to backend/canisters/notifications/api/src/notification_candid_gen.rs diff --git a/v2/backend/canisters/notifications/api/src/queries/mod.rs b/backend/canisters/notifications/api/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/queries/mod.rs rename to backend/canisters/notifications/api/src/queries/mod.rs diff --git a/v2/backend/canisters/notifications/api/src/queries/notifications.rs b/backend/canisters/notifications/api/src/queries/notifications.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/queries/notifications.rs rename to backend/canisters/notifications/api/src/queries/notifications.rs diff --git a/v2/backend/canisters/notifications/api/src/queries/subscription_exists.rs b/backend/canisters/notifications/api/src/queries/subscription_exists.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/queries/subscription_exists.rs rename to backend/canisters/notifications/api/src/queries/subscription_exists.rs diff --git a/v2/backend/canisters/notifications/api/src/updates/c2c_push_notification.rs b/backend/canisters/notifications/api/src/updates/c2c_push_notification.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/updates/c2c_push_notification.rs rename to backend/canisters/notifications/api/src/updates/c2c_push_notification.rs diff --git a/v2/backend/canisters/notifications/api/src/updates/mod.rs b/backend/canisters/notifications/api/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/updates/mod.rs rename to backend/canisters/notifications/api/src/updates/mod.rs diff --git a/v2/backend/canisters/notifications/api/src/updates/push_subscription.rs b/backend/canisters/notifications/api/src/updates/push_subscription.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/updates/push_subscription.rs rename to backend/canisters/notifications/api/src/updates/push_subscription.rs diff --git a/v2/backend/canisters/notifications/api/src/updates/remove_notifications.rs b/backend/canisters/notifications/api/src/updates/remove_notifications.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/updates/remove_notifications.rs rename to backend/canisters/notifications/api/src/updates/remove_notifications.rs diff --git a/v2/backend/canisters/notifications/api/src/updates/remove_subscription.rs b/backend/canisters/notifications/api/src/updates/remove_subscription.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/updates/remove_subscription.rs rename to backend/canisters/notifications/api/src/updates/remove_subscription.rs diff --git a/v2/backend/canisters/notifications/api/src/updates/remove_subscriptions.rs b/backend/canisters/notifications/api/src/updates/remove_subscriptions.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/updates/remove_subscriptions.rs rename to backend/canisters/notifications/api/src/updates/remove_subscriptions.rs diff --git a/v2/backend/canisters/notifications/api/src/updates/remove_subscriptions_for_user.rs b/backend/canisters/notifications/api/src/updates/remove_subscriptions_for_user.rs similarity index 100% rename from v2/backend/canisters/notifications/api/src/updates/remove_subscriptions_for_user.rs rename to backend/canisters/notifications/api/src/updates/remove_subscriptions_for_user.rs diff --git a/v2/backend/canisters/notifications/c2c_client/Cargo.toml b/backend/canisters/notifications/c2c_client/Cargo.toml similarity index 100% rename from v2/backend/canisters/notifications/c2c_client/Cargo.toml rename to backend/canisters/notifications/c2c_client/Cargo.toml diff --git a/v2/backend/canisters/notifications/c2c_client/src/lib.rs b/backend/canisters/notifications/c2c_client/src/lib.rs similarity index 100% rename from v2/backend/canisters/notifications/c2c_client/src/lib.rs rename to backend/canisters/notifications/c2c_client/src/lib.rs diff --git a/v2/backend/canisters/notifications/client/Cargo.toml b/backend/canisters/notifications/client/Cargo.toml similarity index 100% rename from v2/backend/canisters/notifications/client/Cargo.toml rename to backend/canisters/notifications/client/Cargo.toml diff --git a/v2/backend/canisters/notifications/client/src/lib.rs b/backend/canisters/notifications/client/src/lib.rs similarity index 100% rename from v2/backend/canisters/notifications/client/src/lib.rs rename to backend/canisters/notifications/client/src/lib.rs diff --git a/v2/backend/canisters/notifications/impl/Cargo.toml b/backend/canisters/notifications/impl/Cargo.toml similarity index 100% rename from v2/backend/canisters/notifications/impl/Cargo.toml rename to backend/canisters/notifications/impl/Cargo.toml diff --git a/v2/backend/canisters/notifications/impl/src/guards.rs b/backend/canisters/notifications/impl/src/guards.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/guards.rs rename to backend/canisters/notifications/impl/src/guards.rs diff --git a/v2/backend/canisters/notifications/impl/src/lib.rs b/backend/canisters/notifications/impl/src/lib.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/lib.rs rename to backend/canisters/notifications/impl/src/lib.rs diff --git a/v2/backend/canisters/notifications/impl/src/lifecycle/init.rs b/backend/canisters/notifications/impl/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/lifecycle/init.rs rename to backend/canisters/notifications/impl/src/lifecycle/init.rs diff --git a/v2/backend/canisters/notifications/impl/src/lifecycle/mod.rs b/backend/canisters/notifications/impl/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/lifecycle/mod.rs rename to backend/canisters/notifications/impl/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/notifications/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/notifications/impl/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/lifecycle/post_upgrade.rs rename to backend/canisters/notifications/impl/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/notifications/impl/src/lifecycle/pre_upgrade.rs b/backend/canisters/notifications/impl/src/lifecycle/pre_upgrade.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/lifecycle/pre_upgrade.rs rename to backend/canisters/notifications/impl/src/lifecycle/pre_upgrade.rs diff --git a/v2/backend/canisters/notifications/impl/src/model/mod.rs b/backend/canisters/notifications/impl/src/model/mod.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/model/mod.rs rename to backend/canisters/notifications/impl/src/model/mod.rs diff --git a/v2/backend/canisters/notifications/impl/src/model/subscriptions.rs b/backend/canisters/notifications/impl/src/model/subscriptions.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/model/subscriptions.rs rename to backend/canisters/notifications/impl/src/model/subscriptions.rs diff --git a/v2/backend/canisters/notifications/impl/src/queries/http_request.rs b/backend/canisters/notifications/impl/src/queries/http_request.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/queries/http_request.rs rename to backend/canisters/notifications/impl/src/queries/http_request.rs diff --git a/v2/backend/canisters/notifications/impl/src/queries/mod.rs b/backend/canisters/notifications/impl/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/queries/mod.rs rename to backend/canisters/notifications/impl/src/queries/mod.rs diff --git a/v2/backend/canisters/notifications/impl/src/queries/notifications.rs b/backend/canisters/notifications/impl/src/queries/notifications.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/queries/notifications.rs rename to backend/canisters/notifications/impl/src/queries/notifications.rs diff --git a/v2/backend/canisters/notifications/impl/src/queries/subscription_exists.rs b/backend/canisters/notifications/impl/src/queries/subscription_exists.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/queries/subscription_exists.rs rename to backend/canisters/notifications/impl/src/queries/subscription_exists.rs diff --git a/v2/backend/canisters/notifications/impl/src/updates/c2c_push_notification.rs b/backend/canisters/notifications/impl/src/updates/c2c_push_notification.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/updates/c2c_push_notification.rs rename to backend/canisters/notifications/impl/src/updates/c2c_push_notification.rs diff --git a/v2/backend/canisters/notifications/impl/src/updates/mod.rs b/backend/canisters/notifications/impl/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/updates/mod.rs rename to backend/canisters/notifications/impl/src/updates/mod.rs diff --git a/v2/backend/canisters/notifications/impl/src/updates/push_subscription.rs b/backend/canisters/notifications/impl/src/updates/push_subscription.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/updates/push_subscription.rs rename to backend/canisters/notifications/impl/src/updates/push_subscription.rs diff --git a/v2/backend/canisters/notifications/impl/src/updates/remove_notifications.rs b/backend/canisters/notifications/impl/src/updates/remove_notifications.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/updates/remove_notifications.rs rename to backend/canisters/notifications/impl/src/updates/remove_notifications.rs diff --git a/v2/backend/canisters/notifications/impl/src/updates/remove_subscription.rs b/backend/canisters/notifications/impl/src/updates/remove_subscription.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/updates/remove_subscription.rs rename to backend/canisters/notifications/impl/src/updates/remove_subscription.rs diff --git a/v2/backend/canisters/notifications/impl/src/updates/remove_subscriptions.rs b/backend/canisters/notifications/impl/src/updates/remove_subscriptions.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/updates/remove_subscriptions.rs rename to backend/canisters/notifications/impl/src/updates/remove_subscriptions.rs diff --git a/v2/backend/canisters/notifications/impl/src/updates/remove_subscriptions_for_user.rs b/backend/canisters/notifications/impl/src/updates/remove_subscriptions_for_user.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/updates/remove_subscriptions_for_user.rs rename to backend/canisters/notifications/impl/src/updates/remove_subscriptions_for_user.rs diff --git a/v2/backend/canisters/notifications/impl/src/updates/wallet_receive.rs b/backend/canisters/notifications/impl/src/updates/wallet_receive.rs similarity index 100% rename from v2/backend/canisters/notifications/impl/src/updates/wallet_receive.rs rename to backend/canisters/notifications/impl/src/updates/wallet_receive.rs diff --git a/v2/backend/canisters/online_users_aggregator/api/Cargo.toml b/backend/canisters/online_users_aggregator/api/Cargo.toml similarity index 100% rename from v2/backend/canisters/online_users_aggregator/api/Cargo.toml rename to backend/canisters/online_users_aggregator/api/Cargo.toml diff --git a/v2/backend/canisters/online_users_aggregator/api/can.did b/backend/canisters/online_users_aggregator/api/can.did similarity index 100% rename from v2/backend/canisters/online_users_aggregator/api/can.did rename to backend/canisters/online_users_aggregator/api/can.did diff --git a/v2/backend/canisters/online_users_aggregator/api/src/lib.rs b/backend/canisters/online_users_aggregator/api/src/lib.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/api/src/lib.rs rename to backend/canisters/online_users_aggregator/api/src/lib.rs diff --git a/v2/backend/canisters/online_users_aggregator/api/src/lifecycle/init.rs b/backend/canisters/online_users_aggregator/api/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/api/src/lifecycle/init.rs rename to backend/canisters/online_users_aggregator/api/src/lifecycle/init.rs diff --git a/v2/backend/canisters/online_users_aggregator/api/src/lifecycle/mod.rs b/backend/canisters/online_users_aggregator/api/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/api/src/lifecycle/mod.rs rename to backend/canisters/online_users_aggregator/api/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/online_users_aggregator/api/src/lifecycle/post_upgrade.rs b/backend/canisters/online_users_aggregator/api/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/api/src/lifecycle/post_upgrade.rs rename to backend/canisters/online_users_aggregator/api/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/online_users_aggregator/api/src/main.rs b/backend/canisters/online_users_aggregator/api/src/main.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/api/src/main.rs rename to backend/canisters/online_users_aggregator/api/src/main.rs diff --git a/v2/backend/canisters/online_users_aggregator/api/src/updates/mark_as_online.rs b/backend/canisters/online_users_aggregator/api/src/updates/mark_as_online.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/api/src/updates/mark_as_online.rs rename to backend/canisters/online_users_aggregator/api/src/updates/mark_as_online.rs diff --git a/v2/backend/canisters/online_users_aggregator/api/src/updates/mod.rs b/backend/canisters/online_users_aggregator/api/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/api/src/updates/mod.rs rename to backend/canisters/online_users_aggregator/api/src/updates/mod.rs diff --git a/v2/backend/canisters/online_users_aggregator/client/Cargo.toml b/backend/canisters/online_users_aggregator/client/Cargo.toml similarity index 100% rename from v2/backend/canisters/online_users_aggregator/client/Cargo.toml rename to backend/canisters/online_users_aggregator/client/Cargo.toml diff --git a/v2/backend/canisters/online_users_aggregator/client/src/lib.rs b/backend/canisters/online_users_aggregator/client/src/lib.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/client/src/lib.rs rename to backend/canisters/online_users_aggregator/client/src/lib.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/Cargo.toml b/backend/canisters/online_users_aggregator/impl/Cargo.toml similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/Cargo.toml rename to backend/canisters/online_users_aggregator/impl/Cargo.toml diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/lib.rs b/backend/canisters/online_users_aggregator/impl/src/lib.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/lib.rs rename to backend/canisters/online_users_aggregator/impl/src/lib.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/heartbeat.rs b/backend/canisters/online_users_aggregator/impl/src/lifecycle/heartbeat.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/heartbeat.rs rename to backend/canisters/online_users_aggregator/impl/src/lifecycle/heartbeat.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/init.rs b/backend/canisters/online_users_aggregator/impl/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/init.rs rename to backend/canisters/online_users_aggregator/impl/src/lifecycle/init.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/mod.rs b/backend/canisters/online_users_aggregator/impl/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/mod.rs rename to backend/canisters/online_users_aggregator/impl/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/online_users_aggregator/impl/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/post_upgrade.rs rename to backend/canisters/online_users_aggregator/impl/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/pre_upgrade.rs b/backend/canisters/online_users_aggregator/impl/src/lifecycle/pre_upgrade.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/lifecycle/pre_upgrade.rs rename to backend/canisters/online_users_aggregator/impl/src/lifecycle/pre_upgrade.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/model/mod.rs b/backend/canisters/online_users_aggregator/impl/src/model/mod.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/model/mod.rs rename to backend/canisters/online_users_aggregator/impl/src/model/mod.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/model/online_users.rs b/backend/canisters/online_users_aggregator/impl/src/model/online_users.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/model/online_users.rs rename to backend/canisters/online_users_aggregator/impl/src/model/online_users.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/queries/http_request.rs b/backend/canisters/online_users_aggregator/impl/src/queries/http_request.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/queries/http_request.rs rename to backend/canisters/online_users_aggregator/impl/src/queries/http_request.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/queries/mod.rs b/backend/canisters/online_users_aggregator/impl/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/queries/mod.rs rename to backend/canisters/online_users_aggregator/impl/src/queries/mod.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/updates/mark_as_online.rs b/backend/canisters/online_users_aggregator/impl/src/updates/mark_as_online.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/updates/mark_as_online.rs rename to backend/canisters/online_users_aggregator/impl/src/updates/mark_as_online.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/updates/mod.rs b/backend/canisters/online_users_aggregator/impl/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/updates/mod.rs rename to backend/canisters/online_users_aggregator/impl/src/updates/mod.rs diff --git a/v2/backend/canisters/online_users_aggregator/impl/src/updates/wallet_receive.rs b/backend/canisters/online_users_aggregator/impl/src/updates/wallet_receive.rs similarity index 100% rename from v2/backend/canisters/online_users_aggregator/impl/src/updates/wallet_receive.rs rename to backend/canisters/online_users_aggregator/impl/src/updates/wallet_receive.rs diff --git a/v2/backend/canisters/open_storage_bucket/api/Cargo.toml b/backend/canisters/open_storage_bucket/api/Cargo.toml similarity index 100% rename from v2/backend/canisters/open_storage_bucket/api/Cargo.toml rename to backend/canisters/open_storage_bucket/api/Cargo.toml diff --git a/v2/backend/canisters/open_storage_bucket/api/src/lib.rs b/backend/canisters/open_storage_bucket/api/src/lib.rs similarity index 100% rename from v2/backend/canisters/open_storage_bucket/api/src/lib.rs rename to backend/canisters/open_storage_bucket/api/src/lib.rs diff --git a/v2/backend/canisters/open_storage_bucket/api/src/updates/delete_files.rs b/backend/canisters/open_storage_bucket/api/src/updates/delete_files.rs similarity index 100% rename from v2/backend/canisters/open_storage_bucket/api/src/updates/delete_files.rs rename to backend/canisters/open_storage_bucket/api/src/updates/delete_files.rs diff --git a/v2/backend/canisters/open_storage_bucket/api/src/updates/mod.rs b/backend/canisters/open_storage_bucket/api/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/open_storage_bucket/api/src/updates/mod.rs rename to backend/canisters/open_storage_bucket/api/src/updates/mod.rs diff --git a/v2/backend/canisters/open_storage_bucket/c2c_client/Cargo.toml b/backend/canisters/open_storage_bucket/c2c_client/Cargo.toml similarity index 100% rename from v2/backend/canisters/open_storage_bucket/c2c_client/Cargo.toml rename to backend/canisters/open_storage_bucket/c2c_client/Cargo.toml diff --git a/v2/backend/canisters/open_storage_bucket/c2c_client/src/lib.rs b/backend/canisters/open_storage_bucket/c2c_client/src/lib.rs similarity index 100% rename from v2/backend/canisters/open_storage_bucket/c2c_client/src/lib.rs rename to backend/canisters/open_storage_bucket/c2c_client/src/lib.rs diff --git a/v2/backend/canisters/open_storage_index/api/Cargo.toml b/backend/canisters/open_storage_index/api/Cargo.toml similarity index 100% rename from v2/backend/canisters/open_storage_index/api/Cargo.toml rename to backend/canisters/open_storage_index/api/Cargo.toml diff --git a/v2/backend/canisters/open_storage_index/api/src/lib.rs b/backend/canisters/open_storage_index/api/src/lib.rs similarity index 100% rename from v2/backend/canisters/open_storage_index/api/src/lib.rs rename to backend/canisters/open_storage_index/api/src/lib.rs diff --git a/v2/backend/canisters/open_storage_index/api/src/updates/add_or_update_users.rs b/backend/canisters/open_storage_index/api/src/updates/add_or_update_users.rs similarity index 100% rename from v2/backend/canisters/open_storage_index/api/src/updates/add_or_update_users.rs rename to backend/canisters/open_storage_index/api/src/updates/add_or_update_users.rs diff --git a/v2/backend/canisters/open_storage_index/api/src/updates/mod.rs b/backend/canisters/open_storage_index/api/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/open_storage_index/api/src/updates/mod.rs rename to backend/canisters/open_storage_index/api/src/updates/mod.rs diff --git a/v2/backend/canisters/open_storage_index/c2c_client/Cargo.toml b/backend/canisters/open_storage_index/c2c_client/Cargo.toml similarity index 100% rename from v2/backend/canisters/open_storage_index/c2c_client/Cargo.toml rename to backend/canisters/open_storage_index/c2c_client/Cargo.toml diff --git a/v2/backend/canisters/open_storage_index/c2c_client/src/lib.rs b/backend/canisters/open_storage_index/c2c_client/src/lib.rs similarity index 100% rename from v2/backend/canisters/open_storage_index/c2c_client/src/lib.rs rename to backend/canisters/open_storage_index/c2c_client/src/lib.rs diff --git a/v2/backend/canisters/root/api/Cargo.toml b/backend/canisters/root/api/Cargo.toml similarity index 100% rename from v2/backend/canisters/root/api/Cargo.toml rename to backend/canisters/root/api/Cargo.toml diff --git a/v2/backend/canisters/root/api/can.did b/backend/canisters/root/api/can.did similarity index 100% rename from v2/backend/canisters/root/api/can.did rename to backend/canisters/root/api/can.did diff --git a/v2/backend/canisters/root/api/src/lib.rs b/backend/canisters/root/api/src/lib.rs similarity index 100% rename from v2/backend/canisters/root/api/src/lib.rs rename to backend/canisters/root/api/src/lib.rs diff --git a/v2/backend/canisters/root/api/src/lifecycle/init.rs b/backend/canisters/root/api/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/root/api/src/lifecycle/init.rs rename to backend/canisters/root/api/src/lifecycle/init.rs diff --git a/v2/backend/canisters/root/api/src/lifecycle/mod.rs b/backend/canisters/root/api/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/root/api/src/lifecycle/mod.rs rename to backend/canisters/root/api/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/root/api/src/lifecycle/post_upgrade.rs b/backend/canisters/root/api/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/root/api/src/lifecycle/post_upgrade.rs rename to backend/canisters/root/api/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/root/api/src/main.rs b/backend/canisters/root/api/src/main.rs similarity index 100% rename from v2/backend/canisters/root/api/src/main.rs rename to backend/canisters/root/api/src/main.rs diff --git a/v2/backend/canisters/root/api/src/updates/mod.rs b/backend/canisters/root/api/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/root/api/src/updates/mod.rs rename to backend/canisters/root/api/src/updates/mod.rs diff --git a/v2/backend/canisters/root/api/src/updates/upgrade_user_index_canister.rs b/backend/canisters/root/api/src/updates/upgrade_user_index_canister.rs similarity index 100% rename from v2/backend/canisters/root/api/src/updates/upgrade_user_index_canister.rs rename to backend/canisters/root/api/src/updates/upgrade_user_index_canister.rs diff --git a/v2/backend/canisters/root/client/Cargo.toml b/backend/canisters/root/client/Cargo.toml similarity index 100% rename from v2/backend/canisters/root/client/Cargo.toml rename to backend/canisters/root/client/Cargo.toml diff --git a/v2/backend/canisters/root/client/src/lib.rs b/backend/canisters/root/client/src/lib.rs similarity index 100% rename from v2/backend/canisters/root/client/src/lib.rs rename to backend/canisters/root/client/src/lib.rs diff --git a/v2/backend/canisters/root/impl/Cargo.toml b/backend/canisters/root/impl/Cargo.toml similarity index 100% rename from v2/backend/canisters/root/impl/Cargo.toml rename to backend/canisters/root/impl/Cargo.toml diff --git a/v2/backend/canisters/root/impl/src/guards.rs b/backend/canisters/root/impl/src/guards.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/guards.rs rename to backend/canisters/root/impl/src/guards.rs diff --git a/v2/backend/canisters/root/impl/src/lib.rs b/backend/canisters/root/impl/src/lib.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/lib.rs rename to backend/canisters/root/impl/src/lib.rs diff --git a/v2/backend/canisters/root/impl/src/lifecycle/init.rs b/backend/canisters/root/impl/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/lifecycle/init.rs rename to backend/canisters/root/impl/src/lifecycle/init.rs diff --git a/v2/backend/canisters/root/impl/src/lifecycle/mod.rs b/backend/canisters/root/impl/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/lifecycle/mod.rs rename to backend/canisters/root/impl/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/root/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/root/impl/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/lifecycle/post_upgrade.rs rename to backend/canisters/root/impl/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/root/impl/src/lifecycle/pre_upgrade.rs b/backend/canisters/root/impl/src/lifecycle/pre_upgrade.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/lifecycle/pre_upgrade.rs rename to backend/canisters/root/impl/src/lifecycle/pre_upgrade.rs diff --git a/v2/backend/canisters/root/impl/src/queries/http_request.rs b/backend/canisters/root/impl/src/queries/http_request.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/queries/http_request.rs rename to backend/canisters/root/impl/src/queries/http_request.rs diff --git a/v2/backend/canisters/root/impl/src/queries/mod.rs b/backend/canisters/root/impl/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/queries/mod.rs rename to backend/canisters/root/impl/src/queries/mod.rs diff --git a/v2/backend/canisters/root/impl/src/updates/mod.rs b/backend/canisters/root/impl/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/updates/mod.rs rename to backend/canisters/root/impl/src/updates/mod.rs diff --git a/v2/backend/canisters/root/impl/src/updates/upgrade_user_index_canister.rs b/backend/canisters/root/impl/src/updates/upgrade_user_index_canister.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/updates/upgrade_user_index_canister.rs rename to backend/canisters/root/impl/src/updates/upgrade_user_index_canister.rs diff --git a/v2/backend/canisters/root/impl/src/updates/wallet_receive.rs b/backend/canisters/root/impl/src/updates/wallet_receive.rs similarity index 100% rename from v2/backend/canisters/root/impl/src/updates/wallet_receive.rs rename to backend/canisters/root/impl/src/updates/wallet_receive.rs diff --git a/v2/backend/canisters/user/api/Cargo.toml b/backend/canisters/user/api/Cargo.toml similarity index 100% rename from v2/backend/canisters/user/api/Cargo.toml rename to backend/canisters/user/api/Cargo.toml diff --git a/v2/backend/canisters/user/api/can.did b/backend/canisters/user/api/can.did similarity index 100% rename from v2/backend/canisters/user/api/can.did rename to backend/canisters/user/api/can.did diff --git a/v2/backend/canisters/user/api/src/lib.rs b/backend/canisters/user/api/src/lib.rs similarity index 100% rename from v2/backend/canisters/user/api/src/lib.rs rename to backend/canisters/user/api/src/lib.rs diff --git a/v2/backend/canisters/user/api/src/lifecycle/init.rs b/backend/canisters/user/api/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/user/api/src/lifecycle/init.rs rename to backend/canisters/user/api/src/lifecycle/init.rs diff --git a/v2/backend/canisters/user/api/src/lifecycle/mod.rs b/backend/canisters/user/api/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/user/api/src/lifecycle/mod.rs rename to backend/canisters/user/api/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/user/api/src/lifecycle/post_upgrade.rs b/backend/canisters/user/api/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/user/api/src/lifecycle/post_upgrade.rs rename to backend/canisters/user/api/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/user/api/src/main.rs b/backend/canisters/user/api/src/main.rs similarity index 100% rename from v2/backend/canisters/user/api/src/main.rs rename to backend/canisters/user/api/src/main.rs diff --git a/v2/backend/canisters/user/api/src/queries/bio.rs b/backend/canisters/user/api/src/queries/bio.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/bio.rs rename to backend/canisters/user/api/src/queries/bio.rs diff --git a/v2/backend/canisters/user/api/src/queries/events.rs b/backend/canisters/user/api/src/queries/events.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/events.rs rename to backend/canisters/user/api/src/queries/events.rs diff --git a/v2/backend/canisters/user/api/src/queries/events_by_index.rs b/backend/canisters/user/api/src/queries/events_by_index.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/events_by_index.rs rename to backend/canisters/user/api/src/queries/events_by_index.rs diff --git a/v2/backend/canisters/user/api/src/queries/events_range.rs b/backend/canisters/user/api/src/queries/events_range.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/events_range.rs rename to backend/canisters/user/api/src/queries/events_range.rs diff --git a/v2/backend/canisters/user/api/src/queries/events_window.rs b/backend/canisters/user/api/src/queries/events_window.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/events_window.rs rename to backend/canisters/user/api/src/queries/events_window.rs diff --git a/v2/backend/canisters/user/api/src/queries/initial_state.rs b/backend/canisters/user/api/src/queries/initial_state.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/initial_state.rs rename to backend/canisters/user/api/src/queries/initial_state.rs diff --git a/v2/backend/canisters/user/api/src/queries/mod.rs b/backend/canisters/user/api/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/mod.rs rename to backend/canisters/user/api/src/queries/mod.rs diff --git a/v2/backend/canisters/user/api/src/queries/recommended_groups.rs b/backend/canisters/user/api/src/queries/recommended_groups.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/recommended_groups.rs rename to backend/canisters/user/api/src/queries/recommended_groups.rs diff --git a/v2/backend/canisters/user/api/src/queries/search_all_messages.rs b/backend/canisters/user/api/src/queries/search_all_messages.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/search_all_messages.rs rename to backend/canisters/user/api/src/queries/search_all_messages.rs diff --git a/v2/backend/canisters/user/api/src/queries/search_messages.rs b/backend/canisters/user/api/src/queries/search_messages.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/search_messages.rs rename to backend/canisters/user/api/src/queries/search_messages.rs diff --git a/v2/backend/canisters/user/api/src/queries/transactions.rs b/backend/canisters/user/api/src/queries/transactions.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/transactions.rs rename to backend/canisters/user/api/src/queries/transactions.rs diff --git a/v2/backend/canisters/user/api/src/queries/updates.rs b/backend/canisters/user/api/src/queries/updates.rs similarity index 100% rename from v2/backend/canisters/user/api/src/queries/updates.rs rename to backend/canisters/user/api/src/queries/updates.rs diff --git a/v2/backend/canisters/user/api/src/updates/add_recommended_group_exclusions.rs b/backend/canisters/user/api/src/updates/add_recommended_group_exclusions.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/add_recommended_group_exclusions.rs rename to backend/canisters/user/api/src/updates/add_recommended_group_exclusions.rs diff --git a/v2/backend/canisters/user/api/src/updates/assume_group_super_admin.rs b/backend/canisters/user/api/src/updates/assume_group_super_admin.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/assume_group_super_admin.rs rename to backend/canisters/user/api/src/updates/assume_group_super_admin.rs diff --git a/v2/backend/canisters/user/api/src/updates/block_user.rs b/backend/canisters/user/api/src/updates/block_user.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/block_user.rs rename to backend/canisters/user/api/src/updates/block_user.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_charge_user_account.rs b/backend/canisters/user/api/src/updates/c2c_charge_user_account.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_charge_user_account.rs rename to backend/canisters/user/api/src/updates/c2c_charge_user_account.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_delete_messages.rs b/backend/canisters/user/api/src/updates/c2c_delete_messages.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_delete_messages.rs rename to backend/canisters/user/api/src/updates/c2c_delete_messages.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_edit_message.rs b/backend/canisters/user/api/src/updates/c2c_edit_message.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_edit_message.rs rename to backend/canisters/user/api/src/updates/c2c_edit_message.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_grant_super_admin.rs b/backend/canisters/user/api/src/updates/c2c_grant_super_admin.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_grant_super_admin.rs rename to backend/canisters/user/api/src/updates/c2c_grant_super_admin.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_mark_read.rs b/backend/canisters/user/api/src/updates/c2c_mark_read.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_mark_read.rs rename to backend/canisters/user/api/src/updates/c2c_mark_read.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_remove_from_group.rs b/backend/canisters/user/api/src/updates/c2c_remove_from_group.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_remove_from_group.rs rename to backend/canisters/user/api/src/updates/c2c_remove_from_group.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_retry_sending_failed_messages.rs b/backend/canisters/user/api/src/updates/c2c_retry_sending_failed_messages.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_retry_sending_failed_messages.rs rename to backend/canisters/user/api/src/updates/c2c_retry_sending_failed_messages.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_revoke_super_admin.rs b/backend/canisters/user/api/src/updates/c2c_revoke_super_admin.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_revoke_super_admin.rs rename to backend/canisters/user/api/src/updates/c2c_revoke_super_admin.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_send_message.rs b/backend/canisters/user/api/src/updates/c2c_send_message.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_send_message.rs rename to backend/canisters/user/api/src/updates/c2c_send_message.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_toggle_reaction.rs b/backend/canisters/user/api/src/updates/c2c_toggle_reaction.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_toggle_reaction.rs rename to backend/canisters/user/api/src/updates/c2c_toggle_reaction.rs diff --git a/v2/backend/canisters/user/api/src/updates/c2c_try_add_to_group.rs b/backend/canisters/user/api/src/updates/c2c_try_add_to_group.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/c2c_try_add_to_group.rs rename to backend/canisters/user/api/src/updates/c2c_try_add_to_group.rs diff --git a/v2/backend/canisters/user/api/src/updates/create_group.rs b/backend/canisters/user/api/src/updates/create_group.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/create_group.rs rename to backend/canisters/user/api/src/updates/create_group.rs diff --git a/v2/backend/canisters/user/api/src/updates/delete_messages.rs b/backend/canisters/user/api/src/updates/delete_messages.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/delete_messages.rs rename to backend/canisters/user/api/src/updates/delete_messages.rs diff --git a/v2/backend/canisters/user/api/src/updates/dismiss_alerts.rs b/backend/canisters/user/api/src/updates/dismiss_alerts.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/dismiss_alerts.rs rename to backend/canisters/user/api/src/updates/dismiss_alerts.rs diff --git a/v2/backend/canisters/user/api/src/updates/edit_message.rs b/backend/canisters/user/api/src/updates/edit_message.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/edit_message.rs rename to backend/canisters/user/api/src/updates/edit_message.rs diff --git a/v2/backend/canisters/user/api/src/updates/join_group.rs b/backend/canisters/user/api/src/updates/join_group.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/join_group.rs rename to backend/canisters/user/api/src/updates/join_group.rs diff --git a/v2/backend/canisters/user/api/src/updates/join_group_v2.rs b/backend/canisters/user/api/src/updates/join_group_v2.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/join_group_v2.rs rename to backend/canisters/user/api/src/updates/join_group_v2.rs diff --git a/v2/backend/canisters/user/api/src/updates/leave_group.rs b/backend/canisters/user/api/src/updates/leave_group.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/leave_group.rs rename to backend/canisters/user/api/src/updates/leave_group.rs diff --git a/v2/backend/canisters/user/api/src/updates/mark_read.rs b/backend/canisters/user/api/src/updates/mark_read.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/mark_read.rs rename to backend/canisters/user/api/src/updates/mark_read.rs diff --git a/v2/backend/canisters/user/api/src/updates/mod.rs b/backend/canisters/user/api/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/mod.rs rename to backend/canisters/user/api/src/updates/mod.rs diff --git a/v2/backend/canisters/user/api/src/updates/mute_notifications.rs b/backend/canisters/user/api/src/updates/mute_notifications.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/mute_notifications.rs rename to backend/canisters/user/api/src/updates/mute_notifications.rs diff --git a/v2/backend/canisters/user/api/src/updates/relinquish_group_super_admin.rs b/backend/canisters/user/api/src/updates/relinquish_group_super_admin.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/relinquish_group_super_admin.rs rename to backend/canisters/user/api/src/updates/relinquish_group_super_admin.rs diff --git a/v2/backend/canisters/user/api/src/updates/send_message.rs b/backend/canisters/user/api/src/updates/send_message.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/send_message.rs rename to backend/canisters/user/api/src/updates/send_message.rs diff --git a/v2/backend/canisters/user/api/src/updates/set_avatar.rs b/backend/canisters/user/api/src/updates/set_avatar.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/set_avatar.rs rename to backend/canisters/user/api/src/updates/set_avatar.rs diff --git a/v2/backend/canisters/user/api/src/updates/set_bio.rs b/backend/canisters/user/api/src/updates/set_bio.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/set_bio.rs rename to backend/canisters/user/api/src/updates/set_bio.rs diff --git a/v2/backend/canisters/user/api/src/updates/set_preferences.rs b/backend/canisters/user/api/src/updates/set_preferences.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/set_preferences.rs rename to backend/canisters/user/api/src/updates/set_preferences.rs diff --git a/v2/backend/canisters/user/api/src/updates/toggle_reaction.rs b/backend/canisters/user/api/src/updates/toggle_reaction.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/toggle_reaction.rs rename to backend/canisters/user/api/src/updates/toggle_reaction.rs diff --git a/v2/backend/canisters/user/api/src/updates/unblock_user.rs b/backend/canisters/user/api/src/updates/unblock_user.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/unblock_user.rs rename to backend/canisters/user/api/src/updates/unblock_user.rs diff --git a/v2/backend/canisters/user/api/src/updates/unmute_notifications.rs b/backend/canisters/user/api/src/updates/unmute_notifications.rs similarity index 100% rename from v2/backend/canisters/user/api/src/updates/unmute_notifications.rs rename to backend/canisters/user/api/src/updates/unmute_notifications.rs diff --git a/v2/backend/canisters/user/c2c_client/Cargo.toml b/backend/canisters/user/c2c_client/Cargo.toml similarity index 100% rename from v2/backend/canisters/user/c2c_client/Cargo.toml rename to backend/canisters/user/c2c_client/Cargo.toml diff --git a/v2/backend/canisters/user/c2c_client/src/lib.rs b/backend/canisters/user/c2c_client/src/lib.rs similarity index 100% rename from v2/backend/canisters/user/c2c_client/src/lib.rs rename to backend/canisters/user/c2c_client/src/lib.rs diff --git a/v2/backend/canisters/user/client/Cargo.toml b/backend/canisters/user/client/Cargo.toml similarity index 100% rename from v2/backend/canisters/user/client/Cargo.toml rename to backend/canisters/user/client/Cargo.toml diff --git a/v2/backend/canisters/user/client/src/lib.rs b/backend/canisters/user/client/src/lib.rs similarity index 100% rename from v2/backend/canisters/user/client/src/lib.rs rename to backend/canisters/user/client/src/lib.rs diff --git a/v2/backend/canisters/user/impl/Cargo.toml b/backend/canisters/user/impl/Cargo.toml similarity index 100% rename from v2/backend/canisters/user/impl/Cargo.toml rename to backend/canisters/user/impl/Cargo.toml diff --git a/v2/backend/canisters/user/impl/src/guards.rs b/backend/canisters/user/impl/src/guards.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/guards.rs rename to backend/canisters/user/impl/src/guards.rs diff --git a/v2/backend/canisters/user/impl/src/lib.rs b/backend/canisters/user/impl/src/lib.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/lib.rs rename to backend/canisters/user/impl/src/lib.rs diff --git a/v2/backend/canisters/user/impl/src/lifecycle/init.rs b/backend/canisters/user/impl/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/lifecycle/init.rs rename to backend/canisters/user/impl/src/lifecycle/init.rs diff --git a/v2/backend/canisters/user/impl/src/lifecycle/inspect_message.rs b/backend/canisters/user/impl/src/lifecycle/inspect_message.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/lifecycle/inspect_message.rs rename to backend/canisters/user/impl/src/lifecycle/inspect_message.rs diff --git a/v2/backend/canisters/user/impl/src/lifecycle/mod.rs b/backend/canisters/user/impl/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/lifecycle/mod.rs rename to backend/canisters/user/impl/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/user/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/user/impl/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/lifecycle/post_upgrade.rs rename to backend/canisters/user/impl/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/user/impl/src/lifecycle/pre_upgrade.rs b/backend/canisters/user/impl/src/lifecycle/pre_upgrade.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/lifecycle/pre_upgrade.rs rename to backend/canisters/user/impl/src/lifecycle/pre_upgrade.rs diff --git a/v2/backend/canisters/user/impl/src/model/alerts.rs b/backend/canisters/user/impl/src/model/alerts.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/alerts.rs rename to backend/canisters/user/impl/src/model/alerts.rs diff --git a/v2/backend/canisters/user/impl/src/model/direct_chat.rs b/backend/canisters/user/impl/src/model/direct_chat.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/direct_chat.rs rename to backend/canisters/user/impl/src/model/direct_chat.rs diff --git a/v2/backend/canisters/user/impl/src/model/direct_chats.rs b/backend/canisters/user/impl/src/model/direct_chats.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/direct_chats.rs rename to backend/canisters/user/impl/src/model/direct_chats.rs diff --git a/v2/backend/canisters/user/impl/src/model/failed_messages_pending_retry.rs b/backend/canisters/user/impl/src/model/failed_messages_pending_retry.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/failed_messages_pending_retry.rs rename to backend/canisters/user/impl/src/model/failed_messages_pending_retry.rs diff --git a/v2/backend/canisters/user/impl/src/model/group_chat.rs b/backend/canisters/user/impl/src/model/group_chat.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/group_chat.rs rename to backend/canisters/user/impl/src/model/group_chat.rs diff --git a/v2/backend/canisters/user/impl/src/model/group_chats.rs b/backend/canisters/user/impl/src/model/group_chats.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/group_chats.rs rename to backend/canisters/user/impl/src/model/group_chats.rs diff --git a/v2/backend/canisters/user/impl/src/model/mod.rs b/backend/canisters/user/impl/src/model/mod.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/mod.rs rename to backend/canisters/user/impl/src/model/mod.rs diff --git a/v2/backend/canisters/user/impl/src/model/recommended_group_exclusions.rs b/backend/canisters/user/impl/src/model/recommended_group_exclusions.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/recommended_group_exclusions.rs rename to backend/canisters/user/impl/src/model/recommended_group_exclusions.rs diff --git a/v2/backend/canisters/user/impl/src/model/transactions.rs b/backend/canisters/user/impl/src/model/transactions.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/transactions.rs rename to backend/canisters/user/impl/src/model/transactions.rs diff --git a/v2/backend/canisters/user/impl/src/model/unread_message_index_map.rs b/backend/canisters/user/impl/src/model/unread_message_index_map.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/unread_message_index_map.rs rename to backend/canisters/user/impl/src/model/unread_message_index_map.rs diff --git a/v2/backend/canisters/user/impl/src/model/user_cycles_balance.rs b/backend/canisters/user/impl/src/model/user_cycles_balance.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/user_cycles_balance.rs rename to backend/canisters/user/impl/src/model/user_cycles_balance.rs diff --git a/v2/backend/canisters/user/impl/src/model/user_preferences.rs b/backend/canisters/user/impl/src/model/user_preferences.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/model/user_preferences.rs rename to backend/canisters/user/impl/src/model/user_preferences.rs diff --git a/v2/backend/canisters/user/impl/src/queries/bio.rs b/backend/canisters/user/impl/src/queries/bio.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/bio.rs rename to backend/canisters/user/impl/src/queries/bio.rs diff --git a/v2/backend/canisters/user/impl/src/queries/events.rs b/backend/canisters/user/impl/src/queries/events.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/events.rs rename to backend/canisters/user/impl/src/queries/events.rs diff --git a/v2/backend/canisters/user/impl/src/queries/events_by_index.rs b/backend/canisters/user/impl/src/queries/events_by_index.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/events_by_index.rs rename to backend/canisters/user/impl/src/queries/events_by_index.rs diff --git a/v2/backend/canisters/user/impl/src/queries/events_range.rs b/backend/canisters/user/impl/src/queries/events_range.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/events_range.rs rename to backend/canisters/user/impl/src/queries/events_range.rs diff --git a/v2/backend/canisters/user/impl/src/queries/events_window.rs b/backend/canisters/user/impl/src/queries/events_window.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/events_window.rs rename to backend/canisters/user/impl/src/queries/events_window.rs diff --git a/v2/backend/canisters/user/impl/src/queries/http_request.rs b/backend/canisters/user/impl/src/queries/http_request.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/http_request.rs rename to backend/canisters/user/impl/src/queries/http_request.rs diff --git a/v2/backend/canisters/user/impl/src/queries/mod.rs b/backend/canisters/user/impl/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/mod.rs rename to backend/canisters/user/impl/src/queries/mod.rs diff --git a/v2/backend/canisters/user/impl/src/queries/recommended_groups.rs b/backend/canisters/user/impl/src/queries/recommended_groups.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/recommended_groups.rs rename to backend/canisters/user/impl/src/queries/recommended_groups.rs diff --git a/v2/backend/canisters/user/impl/src/queries/search_all_messages.rs b/backend/canisters/user/impl/src/queries/search_all_messages.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/search_all_messages.rs rename to backend/canisters/user/impl/src/queries/search_all_messages.rs diff --git a/v2/backend/canisters/user/impl/src/queries/search_messages.rs b/backend/canisters/user/impl/src/queries/search_messages.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/search_messages.rs rename to backend/canisters/user/impl/src/queries/search_messages.rs diff --git a/v2/backend/canisters/user/impl/src/queries/transactions.rs b/backend/canisters/user/impl/src/queries/transactions.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/transactions.rs rename to backend/canisters/user/impl/src/queries/transactions.rs diff --git a/v2/backend/canisters/user/impl/src/queries/updates.rs b/backend/canisters/user/impl/src/queries/updates.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/queries/updates.rs rename to backend/canisters/user/impl/src/queries/updates.rs diff --git a/v2/backend/canisters/user/impl/src/regular_jobs.rs b/backend/canisters/user/impl/src/regular_jobs.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/regular_jobs.rs rename to backend/canisters/user/impl/src/regular_jobs.rs diff --git a/v2/backend/canisters/user/impl/src/updates/add_recommended_group_exclusions.rs b/backend/canisters/user/impl/src/updates/add_recommended_group_exclusions.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/add_recommended_group_exclusions.rs rename to backend/canisters/user/impl/src/updates/add_recommended_group_exclusions.rs diff --git a/v2/backend/canisters/user/impl/src/updates/assume_group_super_admin.rs b/backend/canisters/user/impl/src/updates/assume_group_super_admin.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/assume_group_super_admin.rs rename to backend/canisters/user/impl/src/updates/assume_group_super_admin.rs diff --git a/v2/backend/canisters/user/impl/src/updates/block_user.rs b/backend/canisters/user/impl/src/updates/block_user.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/block_user.rs rename to backend/canisters/user/impl/src/updates/block_user.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_charge_user_account.rs b/backend/canisters/user/impl/src/updates/c2c_charge_user_account.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_charge_user_account.rs rename to backend/canisters/user/impl/src/updates/c2c_charge_user_account.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_delete_messages.rs b/backend/canisters/user/impl/src/updates/c2c_delete_messages.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_delete_messages.rs rename to backend/canisters/user/impl/src/updates/c2c_delete_messages.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_edit_message.rs b/backend/canisters/user/impl/src/updates/c2c_edit_message.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_edit_message.rs rename to backend/canisters/user/impl/src/updates/c2c_edit_message.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_grant_super_admin.rs b/backend/canisters/user/impl/src/updates/c2c_grant_super_admin.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_grant_super_admin.rs rename to backend/canisters/user/impl/src/updates/c2c_grant_super_admin.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_mark_read.rs b/backend/canisters/user/impl/src/updates/c2c_mark_read.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_mark_read.rs rename to backend/canisters/user/impl/src/updates/c2c_mark_read.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_remove_from_group.rs b/backend/canisters/user/impl/src/updates/c2c_remove_from_group.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_remove_from_group.rs rename to backend/canisters/user/impl/src/updates/c2c_remove_from_group.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_retry_sending_failed_messages.rs b/backend/canisters/user/impl/src/updates/c2c_retry_sending_failed_messages.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_retry_sending_failed_messages.rs rename to backend/canisters/user/impl/src/updates/c2c_retry_sending_failed_messages.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_revoke_super_admin.rs b/backend/canisters/user/impl/src/updates/c2c_revoke_super_admin.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_revoke_super_admin.rs rename to backend/canisters/user/impl/src/updates/c2c_revoke_super_admin.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_send_message.rs b/backend/canisters/user/impl/src/updates/c2c_send_message.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_send_message.rs rename to backend/canisters/user/impl/src/updates/c2c_send_message.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_toggle_reaction.rs b/backend/canisters/user/impl/src/updates/c2c_toggle_reaction.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_toggle_reaction.rs rename to backend/canisters/user/impl/src/updates/c2c_toggle_reaction.rs diff --git a/v2/backend/canisters/user/impl/src/updates/c2c_try_add_to_group.rs b/backend/canisters/user/impl/src/updates/c2c_try_add_to_group.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/c2c_try_add_to_group.rs rename to backend/canisters/user/impl/src/updates/c2c_try_add_to_group.rs diff --git a/v2/backend/canisters/user/impl/src/updates/create_group.rs b/backend/canisters/user/impl/src/updates/create_group.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/create_group.rs rename to backend/canisters/user/impl/src/updates/create_group.rs diff --git a/v2/backend/canisters/user/impl/src/updates/crypto/cycles.rs b/backend/canisters/user/impl/src/updates/crypto/cycles.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/crypto/cycles.rs rename to backend/canisters/user/impl/src/updates/crypto/cycles.rs diff --git a/v2/backend/canisters/user/impl/src/updates/crypto/icp.rs b/backend/canisters/user/impl/src/updates/crypto/icp.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/crypto/icp.rs rename to backend/canisters/user/impl/src/updates/crypto/icp.rs diff --git a/v2/backend/canisters/user/impl/src/updates/crypto/mod.rs b/backend/canisters/user/impl/src/updates/crypto/mod.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/crypto/mod.rs rename to backend/canisters/user/impl/src/updates/crypto/mod.rs diff --git a/v2/backend/canisters/user/impl/src/updates/delete_messages.rs b/backend/canisters/user/impl/src/updates/delete_messages.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/delete_messages.rs rename to backend/canisters/user/impl/src/updates/delete_messages.rs diff --git a/v2/backend/canisters/user/impl/src/updates/dismiss_alerts.rs b/backend/canisters/user/impl/src/updates/dismiss_alerts.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/dismiss_alerts.rs rename to backend/canisters/user/impl/src/updates/dismiss_alerts.rs diff --git a/v2/backend/canisters/user/impl/src/updates/edit_message.rs b/backend/canisters/user/impl/src/updates/edit_message.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/edit_message.rs rename to backend/canisters/user/impl/src/updates/edit_message.rs diff --git a/v2/backend/canisters/user/impl/src/updates/join_group.rs b/backend/canisters/user/impl/src/updates/join_group.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/join_group.rs rename to backend/canisters/user/impl/src/updates/join_group.rs diff --git a/v2/backend/canisters/user/impl/src/updates/leave_group.rs b/backend/canisters/user/impl/src/updates/leave_group.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/leave_group.rs rename to backend/canisters/user/impl/src/updates/leave_group.rs diff --git a/v2/backend/canisters/user/impl/src/updates/mark_read.rs b/backend/canisters/user/impl/src/updates/mark_read.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/mark_read.rs rename to backend/canisters/user/impl/src/updates/mark_read.rs diff --git a/v2/backend/canisters/user/impl/src/updates/mod.rs b/backend/canisters/user/impl/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/mod.rs rename to backend/canisters/user/impl/src/updates/mod.rs diff --git a/v2/backend/canisters/user/impl/src/updates/mute_notifications.rs b/backend/canisters/user/impl/src/updates/mute_notifications.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/mute_notifications.rs rename to backend/canisters/user/impl/src/updates/mute_notifications.rs diff --git a/v2/backend/canisters/user/impl/src/updates/relinquish_group_super_admin.rs b/backend/canisters/user/impl/src/updates/relinquish_group_super_admin.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/relinquish_group_super_admin.rs rename to backend/canisters/user/impl/src/updates/relinquish_group_super_admin.rs diff --git a/v2/backend/canisters/user/impl/src/updates/send_message.rs b/backend/canisters/user/impl/src/updates/send_message.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/send_message.rs rename to backend/canisters/user/impl/src/updates/send_message.rs diff --git a/v2/backend/canisters/user/impl/src/updates/set_avatar.rs b/backend/canisters/user/impl/src/updates/set_avatar.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/set_avatar.rs rename to backend/canisters/user/impl/src/updates/set_avatar.rs diff --git a/v2/backend/canisters/user/impl/src/updates/set_bio.rs b/backend/canisters/user/impl/src/updates/set_bio.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/set_bio.rs rename to backend/canisters/user/impl/src/updates/set_bio.rs diff --git a/v2/backend/canisters/user/impl/src/updates/set_preferences.rs b/backend/canisters/user/impl/src/updates/set_preferences.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/set_preferences.rs rename to backend/canisters/user/impl/src/updates/set_preferences.rs diff --git a/v2/backend/canisters/user/impl/src/updates/toggle_reaction.rs b/backend/canisters/user/impl/src/updates/toggle_reaction.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/toggle_reaction.rs rename to backend/canisters/user/impl/src/updates/toggle_reaction.rs diff --git a/v2/backend/canisters/user/impl/src/updates/unblock_user.rs b/backend/canisters/user/impl/src/updates/unblock_user.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/unblock_user.rs rename to backend/canisters/user/impl/src/updates/unblock_user.rs diff --git a/v2/backend/canisters/user/impl/src/updates/wallet_receive.rs b/backend/canisters/user/impl/src/updates/wallet_receive.rs similarity index 100% rename from v2/backend/canisters/user/impl/src/updates/wallet_receive.rs rename to backend/canisters/user/impl/src/updates/wallet_receive.rs diff --git a/v2/backend/canisters/user_index/api/Cargo.toml b/backend/canisters/user_index/api/Cargo.toml similarity index 100% rename from v2/backend/canisters/user_index/api/Cargo.toml rename to backend/canisters/user_index/api/Cargo.toml diff --git a/v2/backend/canisters/user_index/api/can.did b/backend/canisters/user_index/api/can.did similarity index 100% rename from v2/backend/canisters/user_index/api/can.did rename to backend/canisters/user_index/api/can.did diff --git a/v2/backend/canisters/user_index/api/src/lib.rs b/backend/canisters/user_index/api/src/lib.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/lib.rs rename to backend/canisters/user_index/api/src/lib.rs diff --git a/v2/backend/canisters/user_index/api/src/lifecycle/init.rs b/backend/canisters/user_index/api/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/lifecycle/init.rs rename to backend/canisters/user_index/api/src/lifecycle/init.rs diff --git a/v2/backend/canisters/user_index/api/src/lifecycle/mod.rs b/backend/canisters/user_index/api/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/lifecycle/mod.rs rename to backend/canisters/user_index/api/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/user_index/api/src/lifecycle/post_upgrade.rs b/backend/canisters/user_index/api/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/lifecycle/post_upgrade.rs rename to backend/canisters/user_index/api/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/user_index/api/src/main.rs b/backend/canisters/user_index/api/src/main.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/main.rs rename to backend/canisters/user_index/api/src/main.rs diff --git a/v2/backend/canisters/user_index/api/src/queries/c2c_is_super_admin.rs b/backend/canisters/user_index/api/src/queries/c2c_is_super_admin.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/queries/c2c_is_super_admin.rs rename to backend/canisters/user_index/api/src/queries/c2c_is_super_admin.rs diff --git a/v2/backend/canisters/user_index/api/src/queries/c2c_lookup_user_id.rs b/backend/canisters/user_index/api/src/queries/c2c_lookup_user_id.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/queries/c2c_lookup_user_id.rs rename to backend/canisters/user_index/api/src/queries/c2c_lookup_user_id.rs diff --git a/v2/backend/canisters/user_index/api/src/queries/current_user.rs b/backend/canisters/user_index/api/src/queries/current_user.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/queries/current_user.rs rename to backend/canisters/user_index/api/src/queries/current_user.rs diff --git a/v2/backend/canisters/user_index/api/src/queries/mod.rs b/backend/canisters/user_index/api/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/queries/mod.rs rename to backend/canisters/user_index/api/src/queries/mod.rs diff --git a/v2/backend/canisters/user_index/api/src/queries/search.rs b/backend/canisters/user_index/api/src/queries/search.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/queries/search.rs rename to backend/canisters/user_index/api/src/queries/search.rs diff --git a/v2/backend/canisters/user_index/api/src/queries/sms_messages.rs b/backend/canisters/user_index/api/src/queries/sms_messages.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/queries/sms_messages.rs rename to backend/canisters/user_index/api/src/queries/sms_messages.rs diff --git a/v2/backend/canisters/user_index/api/src/queries/super_admins.rs b/backend/canisters/user_index/api/src/queries/super_admins.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/queries/super_admins.rs rename to backend/canisters/user_index/api/src/queries/super_admins.rs diff --git a/v2/backend/canisters/user_index/api/src/queries/user.rs b/backend/canisters/user_index/api/src/queries/user.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/queries/user.rs rename to backend/canisters/user_index/api/src/queries/user.rs diff --git a/v2/backend/canisters/user_index/api/src/queries/users.rs b/backend/canisters/user_index/api/src/queries/users.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/queries/users.rs rename to backend/canisters/user_index/api/src/queries/users.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/add_super_admin.rs b/backend/canisters/user_index/api/src/updates/add_super_admin.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/add_super_admin.rs rename to backend/canisters/user_index/api/src/updates/add_super_admin.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/c2c_mark_send_message_failed.rs b/backend/canisters/user_index/api/src/updates/c2c_mark_send_message_failed.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/c2c_mark_send_message_failed.rs rename to backend/canisters/user_index/api/src/updates/c2c_mark_send_message_failed.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/c2c_mark_users_online.rs b/backend/canisters/user_index/api/src/updates/c2c_mark_users_online.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/c2c_mark_users_online.rs rename to backend/canisters/user_index/api/src/updates/c2c_mark_users_online.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/c2c_notify_low_balance.rs b/backend/canisters/user_index/api/src/updates/c2c_notify_low_balance.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/c2c_notify_low_balance.rs rename to backend/canisters/user_index/api/src/updates/c2c_notify_low_balance.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/c2c_set_avatar.rs b/backend/canisters/user_index/api/src/updates/c2c_set_avatar.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/c2c_set_avatar.rs rename to backend/canisters/user_index/api/src/updates/c2c_set_avatar.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/confirm_phone_number.rs b/backend/canisters/user_index/api/src/updates/confirm_phone_number.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/confirm_phone_number.rs rename to backend/canisters/user_index/api/src/updates/confirm_phone_number.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/create_challenge.rs b/backend/canisters/user_index/api/src/updates/create_challenge.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/create_challenge.rs rename to backend/canisters/user_index/api/src/updates/create_challenge.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/mod.rs b/backend/canisters/user_index/api/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/mod.rs rename to backend/canisters/user_index/api/src/updates/mod.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/register_user.rs b/backend/canisters/user_index/api/src/updates/register_user.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/register_user.rs rename to backend/canisters/user_index/api/src/updates/register_user.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/remove_sms_messages.rs b/backend/canisters/user_index/api/src/updates/remove_sms_messages.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/remove_sms_messages.rs rename to backend/canisters/user_index/api/src/updates/remove_sms_messages.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/remove_super_admin.rs b/backend/canisters/user_index/api/src/updates/remove_super_admin.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/remove_super_admin.rs rename to backend/canisters/user_index/api/src/updates/remove_super_admin.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/resend_code.rs b/backend/canisters/user_index/api/src/updates/resend_code.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/resend_code.rs rename to backend/canisters/user_index/api/src/updates/resend_code.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/set_username.rs b/backend/canisters/user_index/api/src/updates/set_username.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/set_username.rs rename to backend/canisters/user_index/api/src/updates/set_username.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/submit_phone_number.rs b/backend/canisters/user_index/api/src/updates/submit_phone_number.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/submit_phone_number.rs rename to backend/canisters/user_index/api/src/updates/submit_phone_number.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/upgrade_storage.rs b/backend/canisters/user_index/api/src/updates/upgrade_storage.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/upgrade_storage.rs rename to backend/canisters/user_index/api/src/updates/upgrade_storage.rs diff --git a/v2/backend/canisters/user_index/api/src/updates/upgrade_user_canister_wasm.rs b/backend/canisters/user_index/api/src/updates/upgrade_user_canister_wasm.rs similarity index 100% rename from v2/backend/canisters/user_index/api/src/updates/upgrade_user_canister_wasm.rs rename to backend/canisters/user_index/api/src/updates/upgrade_user_canister_wasm.rs diff --git a/v2/backend/canisters/user_index/c2c_client/Cargo.toml b/backend/canisters/user_index/c2c_client/Cargo.toml similarity index 100% rename from v2/backend/canisters/user_index/c2c_client/Cargo.toml rename to backend/canisters/user_index/c2c_client/Cargo.toml diff --git a/v2/backend/canisters/user_index/c2c_client/src/lib.rs b/backend/canisters/user_index/c2c_client/src/lib.rs similarity index 100% rename from v2/backend/canisters/user_index/c2c_client/src/lib.rs rename to backend/canisters/user_index/c2c_client/src/lib.rs diff --git a/v2/backend/canisters/user_index/client/Cargo.toml b/backend/canisters/user_index/client/Cargo.toml similarity index 100% rename from v2/backend/canisters/user_index/client/Cargo.toml rename to backend/canisters/user_index/client/Cargo.toml diff --git a/v2/backend/canisters/user_index/client/src/lib.rs b/backend/canisters/user_index/client/src/lib.rs similarity index 100% rename from v2/backend/canisters/user_index/client/src/lib.rs rename to backend/canisters/user_index/client/src/lib.rs diff --git a/v2/backend/canisters/user_index/impl/Cargo.toml b/backend/canisters/user_index/impl/Cargo.toml similarity index 100% rename from v2/backend/canisters/user_index/impl/Cargo.toml rename to backend/canisters/user_index/impl/Cargo.toml diff --git a/v2/backend/canisters/user_index/impl/src/guards.rs b/backend/canisters/user_index/impl/src/guards.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/guards.rs rename to backend/canisters/user_index/impl/src/guards.rs diff --git a/v2/backend/canisters/user_index/impl/src/lib.rs b/backend/canisters/user_index/impl/src/lib.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/lib.rs rename to backend/canisters/user_index/impl/src/lib.rs diff --git a/v2/backend/canisters/user_index/impl/src/lifecycle/heartbeat.rs b/backend/canisters/user_index/impl/src/lifecycle/heartbeat.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/lifecycle/heartbeat.rs rename to backend/canisters/user_index/impl/src/lifecycle/heartbeat.rs diff --git a/v2/backend/canisters/user_index/impl/src/lifecycle/init.rs b/backend/canisters/user_index/impl/src/lifecycle/init.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/lifecycle/init.rs rename to backend/canisters/user_index/impl/src/lifecycle/init.rs diff --git a/v2/backend/canisters/user_index/impl/src/lifecycle/inspect_message.rs b/backend/canisters/user_index/impl/src/lifecycle/inspect_message.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/lifecycle/inspect_message.rs rename to backend/canisters/user_index/impl/src/lifecycle/inspect_message.rs diff --git a/v2/backend/canisters/user_index/impl/src/lifecycle/mod.rs b/backend/canisters/user_index/impl/src/lifecycle/mod.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/lifecycle/mod.rs rename to backend/canisters/user_index/impl/src/lifecycle/mod.rs diff --git a/v2/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs b/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs rename to backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs diff --git a/v2/backend/canisters/user_index/impl/src/lifecycle/pre_upgrade.rs b/backend/canisters/user_index/impl/src/lifecycle/pre_upgrade.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/lifecycle/pre_upgrade.rs rename to backend/canisters/user_index/impl/src/lifecycle/pre_upgrade.rs diff --git a/v2/backend/canisters/user_index/impl/src/model/account_billing.rs b/backend/canisters/user_index/impl/src/model/account_billing.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/model/account_billing.rs rename to backend/canisters/user_index/impl/src/model/account_billing.rs diff --git a/v2/backend/canisters/user_index/impl/src/model/challenges.rs b/backend/canisters/user_index/impl/src/model/challenges.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/model/challenges.rs rename to backend/canisters/user_index/impl/src/model/challenges.rs diff --git a/v2/backend/canisters/user_index/impl/src/model/failed_messages_pending_retry.rs b/backend/canisters/user_index/impl/src/model/failed_messages_pending_retry.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/model/failed_messages_pending_retry.rs rename to backend/canisters/user_index/impl/src/model/failed_messages_pending_retry.rs diff --git a/v2/backend/canisters/user_index/impl/src/model/mod.rs b/backend/canisters/user_index/impl/src/model/mod.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/model/mod.rs rename to backend/canisters/user_index/impl/src/model/mod.rs diff --git a/v2/backend/canisters/user_index/impl/src/model/open_storage_user_sync_queue.rs b/backend/canisters/user_index/impl/src/model/open_storage_user_sync_queue.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/model/open_storage_user_sync_queue.rs rename to backend/canisters/user_index/impl/src/model/open_storage_user_sync_queue.rs diff --git a/v2/backend/canisters/user_index/impl/src/model/user.rs b/backend/canisters/user_index/impl/src/model/user.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/model/user.rs rename to backend/canisters/user_index/impl/src/model/user.rs diff --git a/v2/backend/canisters/user_index/impl/src/model/user_map.rs b/backend/canisters/user_index/impl/src/model/user_map.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/model/user_map.rs rename to backend/canisters/user_index/impl/src/model/user_map.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/c2c_is_super_admin.rs b/backend/canisters/user_index/impl/src/queries/c2c_is_super_admin.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/c2c_is_super_admin.rs rename to backend/canisters/user_index/impl/src/queries/c2c_is_super_admin.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/c2c_lookup_user_id.rs b/backend/canisters/user_index/impl/src/queries/c2c_lookup_user_id.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/c2c_lookup_user_id.rs rename to backend/canisters/user_index/impl/src/queries/c2c_lookup_user_id.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/current_user.rs b/backend/canisters/user_index/impl/src/queries/current_user.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/current_user.rs rename to backend/canisters/user_index/impl/src/queries/current_user.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/http_request.rs b/backend/canisters/user_index/impl/src/queries/http_request.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/http_request.rs rename to backend/canisters/user_index/impl/src/queries/http_request.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/mod.rs b/backend/canisters/user_index/impl/src/queries/mod.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/mod.rs rename to backend/canisters/user_index/impl/src/queries/mod.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/search.rs b/backend/canisters/user_index/impl/src/queries/search.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/search.rs rename to backend/canisters/user_index/impl/src/queries/search.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/sms_messages.rs b/backend/canisters/user_index/impl/src/queries/sms_messages.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/sms_messages.rs rename to backend/canisters/user_index/impl/src/queries/sms_messages.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/super_admins.rs b/backend/canisters/user_index/impl/src/queries/super_admins.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/super_admins.rs rename to backend/canisters/user_index/impl/src/queries/super_admins.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/user.rs b/backend/canisters/user_index/impl/src/queries/user.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/user.rs rename to backend/canisters/user_index/impl/src/queries/user.rs diff --git a/v2/backend/canisters/user_index/impl/src/queries/users.rs b/backend/canisters/user_index/impl/src/queries/users.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/queries/users.rs rename to backend/canisters/user_index/impl/src/queries/users.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/add_super_admin.rs b/backend/canisters/user_index/impl/src/updates/add_super_admin.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/add_super_admin.rs rename to backend/canisters/user_index/impl/src/updates/add_super_admin.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/c2c_mark_send_message_failed.rs b/backend/canisters/user_index/impl/src/updates/c2c_mark_send_message_failed.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/c2c_mark_send_message_failed.rs rename to backend/canisters/user_index/impl/src/updates/c2c_mark_send_message_failed.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/c2c_mark_users_online.rs b/backend/canisters/user_index/impl/src/updates/c2c_mark_users_online.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/c2c_mark_users_online.rs rename to backend/canisters/user_index/impl/src/updates/c2c_mark_users_online.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/c2c_notify_low_balance.rs b/backend/canisters/user_index/impl/src/updates/c2c_notify_low_balance.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/c2c_notify_low_balance.rs rename to backend/canisters/user_index/impl/src/updates/c2c_notify_low_balance.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/c2c_set_avatar.rs b/backend/canisters/user_index/impl/src/updates/c2c_set_avatar.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/c2c_set_avatar.rs rename to backend/canisters/user_index/impl/src/updates/c2c_set_avatar.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/confirm_phone_number.rs b/backend/canisters/user_index/impl/src/updates/confirm_phone_number.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/confirm_phone_number.rs rename to backend/canisters/user_index/impl/src/updates/confirm_phone_number.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/create_challenge.rs b/backend/canisters/user_index/impl/src/updates/create_challenge.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/create_challenge.rs rename to backend/canisters/user_index/impl/src/updates/create_challenge.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/mod.rs b/backend/canisters/user_index/impl/src/updates/mod.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/mod.rs rename to backend/canisters/user_index/impl/src/updates/mod.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/register_user.rs b/backend/canisters/user_index/impl/src/updates/register_user.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/register_user.rs rename to backend/canisters/user_index/impl/src/updates/register_user.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/remove_sms_messages.rs b/backend/canisters/user_index/impl/src/updates/remove_sms_messages.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/remove_sms_messages.rs rename to backend/canisters/user_index/impl/src/updates/remove_sms_messages.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/remove_super_admin.rs b/backend/canisters/user_index/impl/src/updates/remove_super_admin.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/remove_super_admin.rs rename to backend/canisters/user_index/impl/src/updates/remove_super_admin.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/resend_code.rs b/backend/canisters/user_index/impl/src/updates/resend_code.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/resend_code.rs rename to backend/canisters/user_index/impl/src/updates/resend_code.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/set_username.rs b/backend/canisters/user_index/impl/src/updates/set_username.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/set_username.rs rename to backend/canisters/user_index/impl/src/updates/set_username.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/submit_phone_number.rs b/backend/canisters/user_index/impl/src/updates/submit_phone_number.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/submit_phone_number.rs rename to backend/canisters/user_index/impl/src/updates/submit_phone_number.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/upgrade_storage.rs b/backend/canisters/user_index/impl/src/updates/upgrade_storage.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/upgrade_storage.rs rename to backend/canisters/user_index/impl/src/updates/upgrade_storage.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/upgrade_user_canister_wasm.rs b/backend/canisters/user_index/impl/src/updates/upgrade_user_canister_wasm.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/upgrade_user_canister_wasm.rs rename to backend/canisters/user_index/impl/src/updates/upgrade_user_canister_wasm.rs diff --git a/v2/backend/canisters/user_index/impl/src/updates/wallet_receive.rs b/backend/canisters/user_index/impl/src/updates/wallet_receive.rs similarity index 100% rename from v2/backend/canisters/user_index/impl/src/updates/wallet_receive.rs rename to backend/canisters/user_index/impl/src/updates/wallet_receive.rs diff --git a/v2/backend/data_generator/Cargo.toml b/backend/data_generator/Cargo.toml similarity index 100% rename from v2/backend/data_generator/Cargo.toml rename to backend/data_generator/Cargo.toml diff --git a/v2/backend/data_generator/src/main.rs b/backend/data_generator/src/main.rs similarity index 100% rename from v2/backend/data_generator/src/main.rs rename to backend/data_generator/src/main.rs diff --git a/v2/backend/integration_tests/.gitignore b/backend/integration_tests/.gitignore similarity index 100% rename from v2/backend/integration_tests/.gitignore rename to backend/integration_tests/.gitignore diff --git a/v2/backend/integration_tests/Cargo.lock b/backend/integration_tests/Cargo.lock similarity index 100% rename from v2/backend/integration_tests/Cargo.lock rename to backend/integration_tests/Cargo.lock diff --git a/v2/backend/integration_tests/Cargo.toml b/backend/integration_tests/Cargo.toml similarity index 100% rename from v2/backend/integration_tests/Cargo.toml rename to backend/integration_tests/Cargo.toml diff --git a/v2/backend/integration_tests/cycles_wallet.wasm b/backend/integration_tests/cycles_wallet.wasm similarity index 100% rename from v2/backend/integration_tests/cycles_wallet.wasm rename to backend/integration_tests/cycles_wallet.wasm diff --git a/v2/backend/integration_tests/run.sh b/backend/integration_tests/run.sh similarity index 100% rename from v2/backend/integration_tests/run.sh rename to backend/integration_tests/run.sh diff --git a/v2/backend/integration_tests/src/change_role_tests.rs b/backend/integration_tests/src/change_role_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/change_role_tests.rs rename to backend/integration_tests/src/change_role_tests.rs diff --git a/v2/backend/integration_tests/src/create_group_tests.rs b/backend/integration_tests/src/create_group_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/create_group_tests.rs rename to backend/integration_tests/src/create_group_tests.rs diff --git a/v2/backend/integration_tests/src/get_updates_tests.rs b/backend/integration_tests/src/get_updates_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/get_updates_tests.rs rename to backend/integration_tests/src/get_updates_tests.rs diff --git a/v2/backend/integration_tests/src/main.rs b/backend/integration_tests/src/main.rs similarity index 100% rename from v2/backend/integration_tests/src/main.rs rename to backend/integration_tests/src/main.rs diff --git a/v2/backend/integration_tests/src/make_super_admin_tests.rs b/backend/integration_tests/src/make_super_admin_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/make_super_admin_tests.rs rename to backend/integration_tests/src/make_super_admin_tests.rs diff --git a/v2/backend/integration_tests/src/mentions_tests.rs b/backend/integration_tests/src/mentions_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/mentions_tests.rs rename to backend/integration_tests/src/mentions_tests.rs diff --git a/v2/backend/integration_tests/src/online_users_aggregator_tests.rs b/backend/integration_tests/src/online_users_aggregator_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/online_users_aggregator_tests.rs rename to backend/integration_tests/src/online_users_aggregator_tests.rs diff --git a/v2/backend/integration_tests/src/send_cycles_tests.rs b/backend/integration_tests/src/send_cycles_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/send_cycles_tests.rs rename to backend/integration_tests/src/send_cycles_tests.rs diff --git a/v2/backend/integration_tests/src/send_message_tests.rs b/backend/integration_tests/src/send_message_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/send_message_tests.rs rename to backend/integration_tests/src/send_message_tests.rs diff --git a/v2/backend/integration_tests/src/set_pinned_message_tests.rs b/backend/integration_tests/src/set_pinned_message_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/set_pinned_message_tests.rs rename to backend/integration_tests/src/set_pinned_message_tests.rs diff --git a/v2/backend/integration_tests/src/verify_user_tests.rs b/backend/integration_tests/src/verify_user_tests.rs similarity index 100% rename from v2/backend/integration_tests/src/verify_user_tests.rs rename to backend/integration_tests/src/verify_user_tests.rs diff --git a/v2/backend/libraries/candid_gen/Cargo.toml b/backend/libraries/candid_gen/Cargo.toml similarity index 100% rename from v2/backend/libraries/candid_gen/Cargo.toml rename to backend/libraries/candid_gen/Cargo.toml diff --git a/v2/backend/libraries/candid_gen/src/lib.rs b/backend/libraries/candid_gen/src/lib.rs similarity index 100% rename from v2/backend/libraries/candid_gen/src/lib.rs rename to backend/libraries/candid_gen/src/lib.rs diff --git a/v2/backend/libraries/canister_api_macros/Cargo.toml b/backend/libraries/canister_api_macros/Cargo.toml similarity index 100% rename from v2/backend/libraries/canister_api_macros/Cargo.toml rename to backend/libraries/canister_api_macros/Cargo.toml diff --git a/v2/backend/libraries/canister_api_macros/src/lib.rs b/backend/libraries/canister_api_macros/src/lib.rs similarity index 100% rename from v2/backend/libraries/canister_api_macros/src/lib.rs rename to backend/libraries/canister_api_macros/src/lib.rs diff --git a/v2/backend/libraries/canister_client/Cargo.toml b/backend/libraries/canister_client/Cargo.toml similarity index 100% rename from v2/backend/libraries/canister_client/Cargo.toml rename to backend/libraries/canister_client/Cargo.toml diff --git a/v2/backend/libraries/canister_client/keys/controller.pem b/backend/libraries/canister_client/keys/controller.pem similarity index 100% rename from v2/backend/libraries/canister_client/keys/controller.pem rename to backend/libraries/canister_client/keys/controller.pem diff --git a/v2/backend/libraries/canister_client/keys/user1.pem b/backend/libraries/canister_client/keys/user1.pem similarity index 100% rename from v2/backend/libraries/canister_client/keys/user1.pem rename to backend/libraries/canister_client/keys/user1.pem diff --git a/v2/backend/libraries/canister_client/keys/user2.pem b/backend/libraries/canister_client/keys/user2.pem similarity index 100% rename from v2/backend/libraries/canister_client/keys/user2.pem rename to backend/libraries/canister_client/keys/user2.pem diff --git a/v2/backend/libraries/canister_client/keys/user3.pem b/backend/libraries/canister_client/keys/user3.pem similarity index 100% rename from v2/backend/libraries/canister_client/keys/user3.pem rename to backend/libraries/canister_client/keys/user3.pem diff --git a/v2/backend/libraries/canister_client/src/lib.rs b/backend/libraries/canister_client/src/lib.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/lib.rs rename to backend/libraries/canister_client/src/lib.rs diff --git a/v2/backend/libraries/canister_client/src/operations/create_group.rs b/backend/libraries/canister_client/src/operations/create_group.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/create_group.rs rename to backend/libraries/canister_client/src/operations/create_group.rs diff --git a/v2/backend/libraries/canister_client/src/operations/cycles_wallet.rs b/backend/libraries/canister_client/src/operations/cycles_wallet.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/cycles_wallet.rs rename to backend/libraries/canister_client/src/operations/cycles_wallet.rs diff --git a/v2/backend/libraries/canister_client/src/operations/get_user.rs b/backend/libraries/canister_client/src/operations/get_user.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/get_user.rs rename to backend/libraries/canister_client/src/operations/get_user.rs diff --git a/v2/backend/libraries/canister_client/src/operations/install_service_canisters.rs b/backend/libraries/canister_client/src/operations/install_service_canisters.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/install_service_canisters.rs rename to backend/libraries/canister_client/src/operations/install_service_canisters.rs diff --git a/v2/backend/libraries/canister_client/src/operations/mod.rs b/backend/libraries/canister_client/src/operations/mod.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/mod.rs rename to backend/libraries/canister_client/src/operations/mod.rs diff --git a/v2/backend/libraries/canister_client/src/operations/register_user.rs b/backend/libraries/canister_client/src/operations/register_user.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/register_user.rs rename to backend/libraries/canister_client/src/operations/register_user.rs diff --git a/v2/backend/libraries/canister_client/src/operations/send_direct_message.rs b/backend/libraries/canister_client/src/operations/send_direct_message.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/send_direct_message.rs rename to backend/libraries/canister_client/src/operations/send_direct_message.rs diff --git a/v2/backend/libraries/canister_client/src/operations/send_group_message.rs b/backend/libraries/canister_client/src/operations/send_group_message.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/send_group_message.rs rename to backend/libraries/canister_client/src/operations/send_group_message.rs diff --git a/v2/backend/libraries/canister_client/src/operations/set_username.rs b/backend/libraries/canister_client/src/operations/set_username.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/set_username.rs rename to backend/libraries/canister_client/src/operations/set_username.rs diff --git a/v2/backend/libraries/canister_client/src/operations/upgrade_service_canisters.rs b/backend/libraries/canister_client/src/operations/upgrade_service_canisters.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/operations/upgrade_service_canisters.rs rename to backend/libraries/canister_client/src/operations/upgrade_service_canisters.rs diff --git a/v2/backend/libraries/canister_client/src/utils.rs b/backend/libraries/canister_client/src/utils.rs similarity index 100% rename from v2/backend/libraries/canister_client/src/utils.rs rename to backend/libraries/canister_client/src/utils.rs diff --git a/v2/backend/libraries/canister_client_macros/Cargo.toml b/backend/libraries/canister_client_macros/Cargo.toml similarity index 100% rename from v2/backend/libraries/canister_client_macros/Cargo.toml rename to backend/libraries/canister_client_macros/Cargo.toml diff --git a/v2/backend/libraries/canister_client_macros/src/lib.rs b/backend/libraries/canister_client_macros/src/lib.rs similarity index 100% rename from v2/backend/libraries/canister_client_macros/src/lib.rs rename to backend/libraries/canister_client_macros/src/lib.rs diff --git a/v2/backend/libraries/canister_logger/Cargo.toml b/backend/libraries/canister_logger/Cargo.toml similarity index 100% rename from v2/backend/libraries/canister_logger/Cargo.toml rename to backend/libraries/canister_logger/Cargo.toml diff --git a/v2/backend/libraries/canister_logger/src/lib.rs b/backend/libraries/canister_logger/src/lib.rs similarity index 100% rename from v2/backend/libraries/canister_logger/src/lib.rs rename to backend/libraries/canister_logger/src/lib.rs diff --git a/v2/backend/libraries/canister_logger/src/panic_hook.rs b/backend/libraries/canister_logger/src/panic_hook.rs similarity index 100% rename from v2/backend/libraries/canister_logger/src/panic_hook.rs rename to backend/libraries/canister_logger/src/panic_hook.rs diff --git a/v2/backend/libraries/canister_state_macros/Cargo.toml b/backend/libraries/canister_state_macros/Cargo.toml similarity index 100% rename from v2/backend/libraries/canister_state_macros/Cargo.toml rename to backend/libraries/canister_state_macros/Cargo.toml diff --git a/v2/backend/libraries/canister_state_macros/src/lib.rs b/backend/libraries/canister_state_macros/src/lib.rs similarity index 100% rename from v2/backend/libraries/canister_state_macros/src/lib.rs rename to backend/libraries/canister_state_macros/src/lib.rs diff --git a/v2/backend/libraries/chat_events/Cargo.toml b/backend/libraries/chat_events/Cargo.toml similarity index 100% rename from v2/backend/libraries/chat_events/Cargo.toml rename to backend/libraries/chat_events/Cargo.toml diff --git a/v2/backend/libraries/chat_events/src/chat_events.rs b/backend/libraries/chat_events/src/chat_events.rs similarity index 100% rename from v2/backend/libraries/chat_events/src/chat_events.rs rename to backend/libraries/chat_events/src/chat_events.rs diff --git a/v2/backend/libraries/chat_events/src/direct_chat_events.rs b/backend/libraries/chat_events/src/direct_chat_events.rs similarity index 100% rename from v2/backend/libraries/chat_events/src/direct_chat_events.rs rename to backend/libraries/chat_events/src/direct_chat_events.rs diff --git a/v2/backend/libraries/chat_events/src/group_chat_events.rs b/backend/libraries/chat_events/src/group_chat_events.rs similarity index 100% rename from v2/backend/libraries/chat_events/src/group_chat_events.rs rename to backend/libraries/chat_events/src/group_chat_events.rs diff --git a/v2/backend/libraries/chat_events/src/lib.rs b/backend/libraries/chat_events/src/lib.rs similarity index 100% rename from v2/backend/libraries/chat_events/src/lib.rs rename to backend/libraries/chat_events/src/lib.rs diff --git a/v2/backend/libraries/chat_events/src/macros.rs b/backend/libraries/chat_events/src/macros.rs similarity index 100% rename from v2/backend/libraries/chat_events/src/macros.rs rename to backend/libraries/chat_events/src/macros.rs diff --git a/v2/backend/libraries/dynamodb_index_store/Cargo.toml b/backend/libraries/dynamodb_index_store/Cargo.toml similarity index 100% rename from v2/backend/libraries/dynamodb_index_store/Cargo.toml rename to backend/libraries/dynamodb_index_store/Cargo.toml diff --git a/v2/backend/libraries/dynamodb_index_store/src/lib.rs b/backend/libraries/dynamodb_index_store/src/lib.rs similarity index 100% rename from v2/backend/libraries/dynamodb_index_store/src/lib.rs rename to backend/libraries/dynamodb_index_store/src/lib.rs diff --git a/v2/backend/libraries/http_request/Cargo.toml b/backend/libraries/http_request/Cargo.toml similarity index 100% rename from v2/backend/libraries/http_request/Cargo.toml rename to backend/libraries/http_request/Cargo.toml diff --git a/v2/backend/libraries/http_request/src/avatar_handler.rs b/backend/libraries/http_request/src/avatar_handler.rs similarity index 100% rename from v2/backend/libraries/http_request/src/avatar_handler.rs rename to backend/libraries/http_request/src/avatar_handler.rs diff --git a/v2/backend/libraries/http_request/src/lib.rs b/backend/libraries/http_request/src/lib.rs similarity index 100% rename from v2/backend/libraries/http_request/src/lib.rs rename to backend/libraries/http_request/src/lib.rs diff --git a/v2/backend/libraries/http_request/src/logs_handler.rs b/backend/libraries/http_request/src/logs_handler.rs similarity index 100% rename from v2/backend/libraries/http_request/src/logs_handler.rs rename to backend/libraries/http_request/src/logs_handler.rs diff --git a/v2/backend/libraries/http_request/src/metrics_handler.rs b/backend/libraries/http_request/src/metrics_handler.rs similarity index 100% rename from v2/backend/libraries/http_request/src/metrics_handler.rs rename to backend/libraries/http_request/src/metrics_handler.rs diff --git a/v2/backend/libraries/http_request/src/router.rs b/backend/libraries/http_request/src/router.rs similarity index 100% rename from v2/backend/libraries/http_request/src/router.rs rename to backend/libraries/http_request/src/router.rs diff --git a/v2/backend/libraries/index_store/Cargo.toml b/backend/libraries/index_store/Cargo.toml similarity index 100% rename from v2/backend/libraries/index_store/Cargo.toml rename to backend/libraries/index_store/Cargo.toml diff --git a/v2/backend/libraries/index_store/src/dummy_store.rs b/backend/libraries/index_store/src/dummy_store.rs similarity index 100% rename from v2/backend/libraries/index_store/src/dummy_store.rs rename to backend/libraries/index_store/src/dummy_store.rs diff --git a/v2/backend/libraries/index_store/src/lib.rs b/backend/libraries/index_store/src/lib.rs similarity index 100% rename from v2/backend/libraries/index_store/src/lib.rs rename to backend/libraries/index_store/src/lib.rs diff --git a/v2/backend/libraries/ledger_utils/Cargo.toml b/backend/libraries/ledger_utils/Cargo.toml similarity index 100% rename from v2/backend/libraries/ledger_utils/Cargo.toml rename to backend/libraries/ledger_utils/Cargo.toml diff --git a/v2/backend/libraries/ledger_utils/src/lib.rs b/backend/libraries/ledger_utils/src/lib.rs similarity index 100% rename from v2/backend/libraries/ledger_utils/src/lib.rs rename to backend/libraries/ledger_utils/src/lib.rs diff --git a/v2/backend/libraries/open_storage_bucket_client/Cargo.toml b/backend/libraries/open_storage_bucket_client/Cargo.toml similarity index 100% rename from v2/backend/libraries/open_storage_bucket_client/Cargo.toml rename to backend/libraries/open_storage_bucket_client/Cargo.toml diff --git a/v2/backend/libraries/open_storage_bucket_client/src/lib.rs b/backend/libraries/open_storage_bucket_client/src/lib.rs similarity index 100% rename from v2/backend/libraries/open_storage_bucket_client/src/lib.rs rename to backend/libraries/open_storage_bucket_client/src/lib.rs diff --git a/v2/backend/libraries/search/Cargo.toml b/backend/libraries/search/Cargo.toml similarity index 100% rename from v2/backend/libraries/search/Cargo.toml rename to backend/libraries/search/Cargo.toml diff --git a/v2/backend/libraries/search/src/document.rs b/backend/libraries/search/src/document.rs similarity index 100% rename from v2/backend/libraries/search/src/document.rs rename to backend/libraries/search/src/document.rs diff --git a/v2/backend/libraries/search/src/lib.rs b/backend/libraries/search/src/lib.rs similarity index 100% rename from v2/backend/libraries/search/src/lib.rs rename to backend/libraries/search/src/lib.rs diff --git a/v2/backend/libraries/search/src/message_content.rs b/backend/libraries/search/src/message_content.rs similarity index 100% rename from v2/backend/libraries/search/src/message_content.rs rename to backend/libraries/search/src/message_content.rs diff --git a/v2/backend/libraries/search/src/query.rs b/backend/libraries/search/src/query.rs similarity index 100% rename from v2/backend/libraries/search/src/query.rs rename to backend/libraries/search/src/query.rs diff --git a/v2/backend/libraries/serializer/Cargo.toml b/backend/libraries/serializer/Cargo.toml similarity index 100% rename from v2/backend/libraries/serializer/Cargo.toml rename to backend/libraries/serializer/Cargo.toml diff --git a/v2/backend/libraries/serializer/src/lib.rs b/backend/libraries/serializer/src/lib.rs similarity index 100% rename from v2/backend/libraries/serializer/src/lib.rs rename to backend/libraries/serializer/src/lib.rs diff --git a/v2/backend/libraries/types/Cargo.toml b/backend/libraries/types/Cargo.toml similarity index 100% rename from v2/backend/libraries/types/Cargo.toml rename to backend/libraries/types/Cargo.toml diff --git a/v2/backend/libraries/types/can.did b/backend/libraries/types/can.did similarity index 100% rename from v2/backend/libraries/types/can.did rename to backend/libraries/types/can.did diff --git a/v2/backend/libraries/types/src/alert.rs b/backend/libraries/types/src/alert.rs similarity index 100% rename from v2/backend/libraries/types/src/alert.rs rename to backend/libraries/types/src/alert.rs diff --git a/v2/backend/libraries/types/src/avatar.rs b/backend/libraries/types/src/avatar.rs similarity index 100% rename from v2/backend/libraries/types/src/avatar.rs rename to backend/libraries/types/src/avatar.rs diff --git a/v2/backend/libraries/types/src/canister_upgrade_status.rs b/backend/libraries/types/src/canister_upgrade_status.rs similarity index 100% rename from v2/backend/libraries/types/src/canister_upgrade_status.rs rename to backend/libraries/types/src/canister_upgrade_status.rs diff --git a/v2/backend/libraries/types/src/canister_wasm.rs b/backend/libraries/types/src/canister_wasm.rs similarity index 100% rename from v2/backend/libraries/types/src/canister_wasm.rs rename to backend/libraries/types/src/canister_wasm.rs diff --git a/v2/backend/libraries/types/src/challenge.rs b/backend/libraries/types/src/challenge.rs similarity index 100% rename from v2/backend/libraries/types/src/challenge.rs rename to backend/libraries/types/src/challenge.rs diff --git a/v2/backend/libraries/types/src/chat_id.rs b/backend/libraries/types/src/chat_id.rs similarity index 100% rename from v2/backend/libraries/types/src/chat_id.rs rename to backend/libraries/types/src/chat_id.rs diff --git a/v2/backend/libraries/types/src/chat_summary.rs b/backend/libraries/types/src/chat_summary.rs similarity index 100% rename from v2/backend/libraries/types/src/chat_summary.rs rename to backend/libraries/types/src/chat_summary.rs diff --git a/v2/backend/libraries/types/src/confirmation_code_sms.rs b/backend/libraries/types/src/confirmation_code_sms.rs similarity index 100% rename from v2/backend/libraries/types/src/confirmation_code_sms.rs rename to backend/libraries/types/src/confirmation_code_sms.rs diff --git a/v2/backend/libraries/types/src/cryptocurrency.rs b/backend/libraries/types/src/cryptocurrency.rs similarity index 100% rename from v2/backend/libraries/types/src/cryptocurrency.rs rename to backend/libraries/types/src/cryptocurrency.rs diff --git a/v2/backend/libraries/types/src/cycles.rs b/backend/libraries/types/src/cycles.rs similarity index 100% rename from v2/backend/libraries/types/src/cycles.rs rename to backend/libraries/types/src/cycles.rs diff --git a/v2/backend/libraries/types/src/deleted_group_info.rs b/backend/libraries/types/src/deleted_group_info.rs similarity index 100% rename from v2/backend/libraries/types/src/deleted_group_info.rs rename to backend/libraries/types/src/deleted_group_info.rs diff --git a/v2/backend/libraries/types/src/error.rs b/backend/libraries/types/src/error.rs similarity index 100% rename from v2/backend/libraries/types/src/error.rs rename to backend/libraries/types/src/error.rs diff --git a/v2/backend/libraries/types/src/event_index.rs b/backend/libraries/types/src/event_index.rs similarity index 100% rename from v2/backend/libraries/types/src/event_index.rs rename to backend/libraries/types/src/event_index.rs diff --git a/v2/backend/libraries/types/src/event_wrapper.rs b/backend/libraries/types/src/event_wrapper.rs similarity index 100% rename from v2/backend/libraries/types/src/event_wrapper.rs rename to backend/libraries/types/src/event_wrapper.rs diff --git a/v2/backend/libraries/types/src/events.rs b/backend/libraries/types/src/events.rs similarity index 100% rename from v2/backend/libraries/types/src/events.rs rename to backend/libraries/types/src/events.rs diff --git a/v2/backend/libraries/types/src/field_too_long.rs b/backend/libraries/types/src/field_too_long.rs similarity index 100% rename from v2/backend/libraries/types/src/field_too_long.rs rename to backend/libraries/types/src/field_too_long.rs diff --git a/v2/backend/libraries/types/src/group_activity.rs b/backend/libraries/types/src/group_activity.rs similarity index 100% rename from v2/backend/libraries/types/src/group_activity.rs rename to backend/libraries/types/src/group_activity.rs diff --git a/v2/backend/libraries/types/src/group_match.rs b/backend/libraries/types/src/group_match.rs similarity index 100% rename from v2/backend/libraries/types/src/group_match.rs rename to backend/libraries/types/src/group_match.rs diff --git a/v2/backend/libraries/types/src/http.rs b/backend/libraries/types/src/http.rs similarity index 100% rename from v2/backend/libraries/types/src/http.rs rename to backend/libraries/types/src/http.rs diff --git a/v2/backend/libraries/types/src/indexed_event.rs b/backend/libraries/types/src/indexed_event.rs similarity index 100% rename from v2/backend/libraries/types/src/indexed_event.rs rename to backend/libraries/types/src/indexed_event.rs diff --git a/v2/backend/libraries/types/src/lib.rs b/backend/libraries/types/src/lib.rs similarity index 100% rename from v2/backend/libraries/types/src/lib.rs rename to backend/libraries/types/src/lib.rs diff --git a/v2/backend/libraries/types/src/mention.rs b/backend/libraries/types/src/mention.rs similarity index 100% rename from v2/backend/libraries/types/src/mention.rs rename to backend/libraries/types/src/mention.rs diff --git a/v2/backend/libraries/types/src/message.rs b/backend/libraries/types/src/message.rs similarity index 100% rename from v2/backend/libraries/types/src/message.rs rename to backend/libraries/types/src/message.rs diff --git a/v2/backend/libraries/types/src/message_content.rs b/backend/libraries/types/src/message_content.rs similarity index 100% rename from v2/backend/libraries/types/src/message_content.rs rename to backend/libraries/types/src/message_content.rs diff --git a/v2/backend/libraries/types/src/message_id.rs b/backend/libraries/types/src/message_id.rs similarity index 100% rename from v2/backend/libraries/types/src/message_id.rs rename to backend/libraries/types/src/message_id.rs diff --git a/v2/backend/libraries/types/src/message_index.rs b/backend/libraries/types/src/message_index.rs similarity index 100% rename from v2/backend/libraries/types/src/message_index.rs rename to backend/libraries/types/src/message_index.rs diff --git a/v2/backend/libraries/types/src/message_match.rs b/backend/libraries/types/src/message_match.rs similarity index 100% rename from v2/backend/libraries/types/src/message_match.rs rename to backend/libraries/types/src/message_match.rs diff --git a/v2/backend/libraries/types/src/notifications.rs b/backend/libraries/types/src/notifications.rs similarity index 100% rename from v2/backend/libraries/types/src/notifications.rs rename to backend/libraries/types/src/notifications.rs diff --git a/v2/backend/libraries/types/src/option.rs b/backend/libraries/types/src/option.rs similarity index 100% rename from v2/backend/libraries/types/src/option.rs rename to backend/libraries/types/src/option.rs diff --git a/v2/backend/libraries/types/src/participant.rs b/backend/libraries/types/src/participant.rs similarity index 100% rename from v2/backend/libraries/types/src/participant.rs rename to backend/libraries/types/src/participant.rs diff --git a/v2/backend/libraries/types/src/phone_number.rs b/backend/libraries/types/src/phone_number.rs similarity index 100% rename from v2/backend/libraries/types/src/phone_number.rs rename to backend/libraries/types/src/phone_number.rs diff --git a/v2/backend/libraries/types/src/reactions.rs b/backend/libraries/types/src/reactions.rs similarity index 100% rename from v2/backend/libraries/types/src/reactions.rs rename to backend/libraries/types/src/reactions.rs diff --git a/v2/backend/libraries/types/src/registration_fee.rs b/backend/libraries/types/src/registration_fee.rs similarity index 100% rename from v2/backend/libraries/types/src/registration_fee.rs rename to backend/libraries/types/src/registration_fee.rs diff --git a/v2/backend/libraries/types/src/role.rs b/backend/libraries/types/src/role.rs similarity index 100% rename from v2/backend/libraries/types/src/role.rs rename to backend/libraries/types/src/role.rs diff --git a/v2/backend/libraries/types/src/subscription.rs b/backend/libraries/types/src/subscription.rs similarity index 100% rename from v2/backend/libraries/types/src/subscription.rs rename to backend/libraries/types/src/subscription.rs diff --git a/v2/backend/libraries/types/src/timestamped.rs b/backend/libraries/types/src/timestamped.rs similarity index 100% rename from v2/backend/libraries/types/src/timestamped.rs rename to backend/libraries/types/src/timestamped.rs diff --git a/v2/backend/libraries/types/src/transaction.rs b/backend/libraries/types/src/transaction.rs similarity index 100% rename from v2/backend/libraries/types/src/transaction.rs rename to backend/libraries/types/src/transaction.rs diff --git a/v2/backend/libraries/types/src/user.rs b/backend/libraries/types/src/user.rs similarity index 100% rename from v2/backend/libraries/types/src/user.rs rename to backend/libraries/types/src/user.rs diff --git a/v2/backend/libraries/types/src/user_preferences.rs b/backend/libraries/types/src/user_preferences.rs similarity index 100% rename from v2/backend/libraries/types/src/user_preferences.rs rename to backend/libraries/types/src/user_preferences.rs diff --git a/v2/backend/libraries/types/src/user_summary.rs b/backend/libraries/types/src/user_summary.rs similarity index 100% rename from v2/backend/libraries/types/src/user_summary.rs rename to backend/libraries/types/src/user_summary.rs diff --git a/v2/backend/libraries/types/src/version.rs b/backend/libraries/types/src/version.rs similarity index 100% rename from v2/backend/libraries/types/src/version.rs rename to backend/libraries/types/src/version.rs diff --git a/v2/backend/libraries/utils/Cargo.toml b/backend/libraries/utils/Cargo.toml similarity index 100% rename from v2/backend/libraries/utils/Cargo.toml rename to backend/libraries/utils/Cargo.toml diff --git a/v2/backend/libraries/utils/src/canister/canisters_requiring_upgrade.rs b/backend/libraries/utils/src/canister/canisters_requiring_upgrade.rs similarity index 100% rename from v2/backend/libraries/utils/src/canister/canisters_requiring_upgrade.rs rename to backend/libraries/utils/src/canister/canisters_requiring_upgrade.rs diff --git a/v2/backend/libraries/utils/src/canister/create.rs b/backend/libraries/utils/src/canister/create.rs similarity index 100% rename from v2/backend/libraries/utils/src/canister/create.rs rename to backend/libraries/utils/src/canister/create.rs diff --git a/v2/backend/libraries/utils/src/canister/delete.rs b/backend/libraries/utils/src/canister/delete.rs similarity index 100% rename from v2/backend/libraries/utils/src/canister/delete.rs rename to backend/libraries/utils/src/canister/delete.rs diff --git a/v2/backend/libraries/utils/src/canister/error.rs b/backend/libraries/utils/src/canister/error.rs similarity index 100% rename from v2/backend/libraries/utils/src/canister/error.rs rename to backend/libraries/utils/src/canister/error.rs diff --git a/v2/backend/libraries/utils/src/canister/mod.rs b/backend/libraries/utils/src/canister/mod.rs similarity index 100% rename from v2/backend/libraries/utils/src/canister/mod.rs rename to backend/libraries/utils/src/canister/mod.rs diff --git a/v2/backend/libraries/utils/src/canister/pool.rs b/backend/libraries/utils/src/canister/pool.rs similarity index 100% rename from v2/backend/libraries/utils/src/canister/pool.rs rename to backend/libraries/utils/src/canister/pool.rs diff --git a/v2/backend/libraries/utils/src/canister/stop.rs b/backend/libraries/utils/src/canister/stop.rs similarity index 100% rename from v2/backend/libraries/utils/src/canister/stop.rs rename to backend/libraries/utils/src/canister/stop.rs diff --git a/v2/backend/libraries/utils/src/canister/upgrade.rs b/backend/libraries/utils/src/canister/upgrade.rs similarity index 100% rename from v2/backend/libraries/utils/src/canister/upgrade.rs rename to backend/libraries/utils/src/canister/upgrade.rs diff --git a/v2/backend/libraries/utils/src/case_insensitive_hash_map.rs b/backend/libraries/utils/src/case_insensitive_hash_map.rs similarity index 100% rename from v2/backend/libraries/utils/src/case_insensitive_hash_map.rs rename to backend/libraries/utils/src/case_insensitive_hash_map.rs diff --git a/v2/backend/libraries/utils/src/consts.rs b/backend/libraries/utils/src/consts.rs similarity index 100% rename from v2/backend/libraries/utils/src/consts.rs rename to backend/libraries/utils/src/consts.rs diff --git a/v2/backend/libraries/utils/src/cycles/accept_cycles.rs b/backend/libraries/utils/src/cycles/accept_cycles.rs similarity index 100% rename from v2/backend/libraries/utils/src/cycles/accept_cycles.rs rename to backend/libraries/utils/src/cycles/accept_cycles.rs diff --git a/v2/backend/libraries/utils/src/cycles/can_spend_cycles.rs b/backend/libraries/utils/src/cycles/can_spend_cycles.rs similarity index 100% rename from v2/backend/libraries/utils/src/cycles/can_spend_cycles.rs rename to backend/libraries/utils/src/cycles/can_spend_cycles.rs diff --git a/v2/backend/libraries/utils/src/cycles/check_cycles_balance.rs b/backend/libraries/utils/src/cycles/check_cycles_balance.rs similarity index 100% rename from v2/backend/libraries/utils/src/cycles/check_cycles_balance.rs rename to backend/libraries/utils/src/cycles/check_cycles_balance.rs diff --git a/v2/backend/libraries/utils/src/cycles/mod.rs b/backend/libraries/utils/src/cycles/mod.rs similarity index 100% rename from v2/backend/libraries/utils/src/cycles/mod.rs rename to backend/libraries/utils/src/cycles/mod.rs diff --git a/v2/backend/libraries/utils/src/cycles/top_up_canister.rs b/backend/libraries/utils/src/cycles/top_up_canister.rs similarity index 100% rename from v2/backend/libraries/utils/src/cycles/top_up_canister.rs rename to backend/libraries/utils/src/cycles/top_up_canister.rs diff --git a/v2/backend/libraries/utils/src/env.rs b/backend/libraries/utils/src/env.rs similarity index 100% rename from v2/backend/libraries/utils/src/env.rs rename to backend/libraries/utils/src/env.rs diff --git a/v2/backend/libraries/utils/src/env/canister.rs b/backend/libraries/utils/src/env/canister.rs similarity index 100% rename from v2/backend/libraries/utils/src/env/canister.rs rename to backend/libraries/utils/src/env/canister.rs diff --git a/v2/backend/libraries/utils/src/env/test.rs b/backend/libraries/utils/src/env/test.rs similarity index 100% rename from v2/backend/libraries/utils/src/env/test.rs rename to backend/libraries/utils/src/env/test.rs diff --git a/v2/backend/libraries/utils/src/event_stream.rs b/backend/libraries/utils/src/event_stream.rs similarity index 100% rename from v2/backend/libraries/utils/src/event_stream.rs rename to backend/libraries/utils/src/event_stream.rs diff --git a/v2/backend/libraries/utils/src/iterator_extensions.rs b/backend/libraries/utils/src/iterator_extensions.rs similarity index 100% rename from v2/backend/libraries/utils/src/iterator_extensions.rs rename to backend/libraries/utils/src/iterator_extensions.rs diff --git a/v2/backend/libraries/utils/src/lib.rs b/backend/libraries/utils/src/lib.rs similarity index 100% rename from v2/backend/libraries/utils/src/lib.rs rename to backend/libraries/utils/src/lib.rs diff --git a/v2/backend/libraries/utils/src/memory.rs b/backend/libraries/utils/src/memory.rs similarity index 100% rename from v2/backend/libraries/utils/src/memory.rs rename to backend/libraries/utils/src/memory.rs diff --git a/v2/backend/libraries/utils/src/rand.rs b/backend/libraries/utils/src/rand.rs similarity index 100% rename from v2/backend/libraries/utils/src/rand.rs rename to backend/libraries/utils/src/rand.rs diff --git a/v2/backend/libraries/utils/src/range_set.rs b/backend/libraries/utils/src/range_set.rs similarity index 100% rename from v2/backend/libraries/utils/src/range_set.rs rename to backend/libraries/utils/src/range_set.rs diff --git a/v2/backend/libraries/utils/src/regular_jobs.rs b/backend/libraries/utils/src/regular_jobs.rs similarity index 100% rename from v2/backend/libraries/utils/src/regular_jobs.rs rename to backend/libraries/utils/src/regular_jobs.rs diff --git a/v2/backend/libraries/utils/src/time.rs b/backend/libraries/utils/src/time.rs similarity index 100% rename from v2/backend/libraries/utils/src/time.rs rename to backend/libraries/utils/src/time.rs diff --git a/v2/backend/notes.md b/backend/notes.md similarity index 100% rename from v2/backend/notes.md rename to backend/notes.md diff --git a/v2/backend/notification_pusher/aws/Cargo.toml b/backend/notification_pusher/aws/Cargo.toml similarity index 100% rename from v2/backend/notification_pusher/aws/Cargo.toml rename to backend/notification_pusher/aws/Cargo.toml diff --git a/v2/backend/notification_pusher/aws/README.md b/backend/notification_pusher/aws/README.md similarity index 100% rename from v2/backend/notification_pusher/aws/README.md rename to backend/notification_pusher/aws/README.md diff --git a/v2/backend/notification_pusher/aws/src/main.rs b/backend/notification_pusher/aws/src/main.rs similarity index 100% rename from v2/backend/notification_pusher/aws/src/main.rs rename to backend/notification_pusher/aws/src/main.rs diff --git a/v2/backend/notification_pusher/cli/Cargo.toml b/backend/notification_pusher/cli/Cargo.toml similarity index 100% rename from v2/backend/notification_pusher/cli/Cargo.toml rename to backend/notification_pusher/cli/Cargo.toml diff --git a/v2/backend/notification_pusher/cli/src/main.rs b/backend/notification_pusher/cli/src/main.rs similarity index 100% rename from v2/backend/notification_pusher/cli/src/main.rs rename to backend/notification_pusher/cli/src/main.rs diff --git a/v2/backend/notification_pusher/core/Cargo.toml b/backend/notification_pusher/core/Cargo.toml similarity index 100% rename from v2/backend/notification_pusher/core/Cargo.toml rename to backend/notification_pusher/core/Cargo.toml diff --git a/v2/backend/notification_pusher/core/src/actions/mod.rs b/backend/notification_pusher/core/src/actions/mod.rs similarity index 100% rename from v2/backend/notification_pusher/core/src/actions/mod.rs rename to backend/notification_pusher/core/src/actions/mod.rs diff --git a/v2/backend/notification_pusher/core/src/actions/prune_notifications.rs b/backend/notification_pusher/core/src/actions/prune_notifications.rs similarity index 100% rename from v2/backend/notification_pusher/core/src/actions/prune_notifications.rs rename to backend/notification_pusher/core/src/actions/prune_notifications.rs diff --git a/v2/backend/notification_pusher/core/src/actions/push_notifications.rs b/backend/notification_pusher/core/src/actions/push_notifications.rs similarity index 100% rename from v2/backend/notification_pusher/core/src/actions/push_notifications.rs rename to backend/notification_pusher/core/src/actions/push_notifications.rs diff --git a/v2/backend/notification_pusher/core/src/ic_agent.rs b/backend/notification_pusher/core/src/ic_agent.rs similarity index 100% rename from v2/backend/notification_pusher/core/src/ic_agent.rs rename to backend/notification_pusher/core/src/ic_agent.rs diff --git a/v2/backend/notification_pusher/core/src/lib.rs b/backend/notification_pusher/core/src/lib.rs similarity index 100% rename from v2/backend/notification_pusher/core/src/lib.rs rename to backend/notification_pusher/core/src/lib.rs diff --git a/v2/backend/notification_pusher/core/src/runner.rs b/backend/notification_pusher/core/src/runner.rs similarity index 100% rename from v2/backend/notification_pusher/core/src/runner.rs rename to backend/notification_pusher/core/src/runner.rs diff --git a/v2/backend/rustfmt.toml b/backend/rustfmt.toml similarity index 100% rename from v2/backend/rustfmt.toml rename to backend/rustfmt.toml diff --git a/v2/backend/sms_sender/aws/Cargo.toml b/backend/sms_sender/aws/Cargo.toml similarity index 100% rename from v2/backend/sms_sender/aws/Cargo.toml rename to backend/sms_sender/aws/Cargo.toml diff --git a/v2/backend/sms_sender/aws/README.md b/backend/sms_sender/aws/README.md similarity index 100% rename from v2/backend/sms_sender/aws/README.md rename to backend/sms_sender/aws/README.md diff --git a/v2/backend/sms_sender/aws/src/lib.rs b/backend/sms_sender/aws/src/lib.rs similarity index 100% rename from v2/backend/sms_sender/aws/src/lib.rs rename to backend/sms_sender/aws/src/lib.rs diff --git a/v2/backend/sms_sender/aws/src/main.rs b/backend/sms_sender/aws/src/main.rs similarity index 100% rename from v2/backend/sms_sender/aws/src/main.rs rename to backend/sms_sender/aws/src/main.rs diff --git a/v2/backend/sms_sender/aws/src/pinpoint.rs b/backend/sms_sender/aws/src/pinpoint.rs similarity index 100% rename from v2/backend/sms_sender/aws/src/pinpoint.rs rename to backend/sms_sender/aws/src/pinpoint.rs diff --git a/v2/backend/sms_sender/cli/Cargo.toml b/backend/sms_sender/cli/Cargo.toml similarity index 100% rename from v2/backend/sms_sender/cli/Cargo.toml rename to backend/sms_sender/cli/Cargo.toml diff --git a/v2/backend/sms_sender/cli/src/main.rs b/backend/sms_sender/cli/src/main.rs similarity index 100% rename from v2/backend/sms_sender/cli/src/main.rs rename to backend/sms_sender/cli/src/main.rs diff --git a/v2/backend/sms_sender/core/Cargo.toml b/backend/sms_sender/core/Cargo.toml similarity index 100% rename from v2/backend/sms_sender/core/Cargo.toml rename to backend/sms_sender/core/Cargo.toml diff --git a/v2/backend/sms_sender/core/src/ic_agent.rs b/backend/sms_sender/core/src/ic_agent.rs similarity index 100% rename from v2/backend/sms_sender/core/src/ic_agent.rs rename to backend/sms_sender/core/src/ic_agent.rs diff --git a/v2/backend/sms_sender/core/src/lib.rs b/backend/sms_sender/core/src/lib.rs similarity index 100% rename from v2/backend/sms_sender/core/src/lib.rs rename to backend/sms_sender/core/src/lib.rs diff --git a/v2/backend/sms_sender/core/src/runner.rs b/backend/sms_sender/core/src/runner.rs similarity index 100% rename from v2/backend/sms_sender/core/src/runner.rs rename to backend/sms_sender/core/src/runner.rs diff --git a/v2/backend/sms_sender/core/src/sms_reader.rs b/backend/sms_sender/core/src/sms_reader.rs similarity index 100% rename from v2/backend/sms_sender/core/src/sms_reader.rs rename to backend/sms_sender/core/src/sms_reader.rs diff --git a/v2/backend/sms_sender/core/src/sms_sender.rs b/backend/sms_sender/core/src/sms_sender.rs similarity index 100% rename from v2/backend/sms_sender/core/src/sms_sender.rs rename to backend/sms_sender/core/src/sms_sender.rs diff --git a/canister_ids.json b/canister_ids.json index 5d60be7ce7..7eddc15ce6 100644 --- a/canister_ids.json +++ b/canister_ids.json @@ -1,14 +1,27 @@ { - "chats": { - "ic": "773uq-3qaaa-aaaaf-aaabq-cai" + "root": { + "ic": "l3vml-piaaa-aaaaf-acwyq-cai", + "ic_test": "lswhx-zaaaa-aaaaf-acwza-cai" }, - "p2p": { - "ic": "7k4f5-2yaaa-aaaaf-aaaca-cai" + "user_index": { + "ic": "4bkt6-4aaaa-aaaaf-aaaiq-cai", + "ic_test": "7njde-waaaa-aaaaf-ab2ca-cai" }, - "user_mgmt": { - "ic": "7n5dj-xaaaa-aaaaf-aaacq-cai" + "group_index": { + "ic": "4ijyc-kiaaa-aaaaf-aaaja-cai", + "ic_test": "7kifq-3yaaa-aaaaf-ab2cq-cai" + }, + "notifications": { + "ic_v1": "6vuwk-zaaaa-aaaaf-aaagq-cai", + "ic": "4glvk-ryaaa-aaaaf-aaaia-cai", + "ic_test": "7ekiy-aiaaa-aaaaf-ab2dq-cai" + }, + "online_users_aggregator": { + "ic": "3vlw6-fiaaa-aaaaf-aaa3a-cai", + "ic_test": "7dlom-nqaaa-aaaaf-ab2da-cai" }, "website": { - "ic": "7e6iv-biaaa-aaaaf-aaada-cai" + "ic": "6hsbt-vqaaa-aaaaf-aaafq-cai", + "ic_test": "pfs7b-iqaaa-aaaaf-abs7q-cai" } } \ No newline at end of file diff --git a/commands.txt b/commands.txt deleted file mode 100644 index f0246dacde..0000000000 --- a/commands.txt +++ /dev/null @@ -1,59 +0,0 @@ --- Cleanup -dfx identity remove alice -dfx identity remove calum -dfx identity remove hamish -dfx identity remove matt - --- Preamble -dfx identity new alice -dfx identity new calum -dfx identity new hamish -dfx identity new matt - -dfx --identity=alice canister call user_mgmt register_user '("Alice")' -dfx --identity=calum canister call user_mgmt register_user '("Calum")' -dfx --identity=hamish canister call user_mgmt register_user '("Hamish")' -dfx --identity=matt canister call user_mgmt register_user '("Matt")' - --- Direct Chat -dfx --identity=hamish canister call user_mgmt get_user_id '("Matt")' -dfx --identity=hamish canister call chats create_direct_chat '(principal "lpfg6-5goq7-vn6yz-wegiu-r6goc-sxoor-wj3b2-dpyup-k6i5m-qhv5m-xae", "Hi Matt, how is it going")' -dfx --identity=hamish canister call chats send_message '(45_292_552_032_833_753, "hello!!??")' -dfx --identity=matt canister call chats get_chats '(record { updated_since = null; message_count_for_top_chat = null })' -dfx --identity=matt canister call chats get_messages '(45_292_552_032_833_753, 1)' -dfx --identity=matt canister call chats mark_read '(45_292_552_032_833_753, 2)' -dfx --identity=matt canister call chats send_message '(45_292_552_032_833_753, "whats up?")' - --- Group Chat -dfx --identity=matt canister call user_mgmt get_user_id '("Hamish")' -dfx --identity=matt canister call chats create_group_chat '(vec { principal "uhpjy-crxbe-6chrq-vadba-aqrmz-f4d2e-h7nxj-7hrso-ebvqe-gnygw-tae" }, "Xmas 2020")' -dfx --identity=matt canister call chats send_message '(12_699_180_841_646_933_661, "Are you coming to mine for xmas?")' - -dfx deploy user_index --argument '(record { service_principals = vec {}; sms_service_principals = vec {}; test_mode = true; user_wasm_module = blob "" })' -dfx canister install user_index --mode=reinstall --argument '(record { service_principals = vec {}; sms_service_principals = vec {}; test_mode = true; user_wasm_module = blob "" })' -dfx --identity=matt canister call --query user_index current_user '(record { })' -dfx --identity=matt canister call user_index submit_phone_number '(record { phone_number = record { country_code = 44; number = "07778 588510" } })' -dfx --identity=matt canister call user_index confirm_phone_number '(record { confirmation_code = "123456" })' -dfx --identity=matt canister call user_index set_username '(record { username = "Matt" })' - -dfx deploy user --argument '(record { notification_canister_ids = vec {}; owner = principal "czfqq-wsqcp-34akk-p5ax7-rvqwv-6cgwc-kr2rr-4fr3f-mka7k-5haqh-hqe" })' - --- Get Users -dfx --identity=matt canister call user_mgmt get_users '(vec { record { id = principal "uhpjy-crxbe-6chrq-vadba-aqrmz-f4d2e-h7nxj-7hrso-ebvqe-gnygw-tae"; cached_version = opt 1 } })' - --- Search for users -dfx canister call user_mgmt search_users '(record { search_term = "ali"; max_results = 10 })' - -// Deploy II -II_ENV=development dfx deploy --no-wallet --argument '(null)' - -// Metrics -dfx canister --network=ic --no-wallet call user_mgmt stats '()' -dfx canister --network=ic --no-wallet call chats stats '()' - -// Notifications -dfx deploy notifications --argument '(record { push_service_principals = vec { principal "tu45y-p4p3d-b4gg4-gmyy3-rgweo-whsrq-fephi-vshrn-cipca-xdkri-pae" } })' -dfx canister install notifications --mode=reinstall --argument '(record { push_service_principals = vec { principal "tu45y-p4p3d-b4gg4-gmyy3-rgweo-whsrq-fephi-vshrn-cipca-xdkri-pae" } })' -dfx canister call notifications notifications '(record { from_notification_index = 0 })' - -dfx canister install notifications --mode=upgrade --argument '(record { push_service_principals = vec { principal "tu45y-p4p3d-b4gg4-gmyy3-rgweo-whsrq-fephi-vshrn-cipca-xdkri-pae" } })' \ No newline at end of file diff --git a/v2/compress-wasm.sh b/compress-wasm.sh similarity index 100% rename from v2/compress-wasm.sh rename to compress-wasm.sh diff --git a/v2/deploy-full-env-local.sh b/deploy-full-env-local.sh similarity index 100% rename from v2/deploy-full-env-local.sh rename to deploy-full-env-local.sh diff --git a/v2/deploy-local.sh b/deploy-local.sh similarity index 100% rename from v2/deploy-local.sh rename to deploy-local.sh diff --git a/v2/deploy-prod-test.sh b/deploy-prod-test.sh similarity index 100% rename from v2/deploy-prod-test.sh rename to deploy-prod-test.sh diff --git a/v2/deploy-prod.sh b/deploy-prod.sh similarity index 100% rename from v2/deploy-prod.sh rename to deploy-prod.sh diff --git a/dfx.json b/dfx.json index 442047911f..c30fcd0cf8 100644 --- a/dfx.json +++ b/dfx.json @@ -1,36 +1,52 @@ { "canisters": { - "chats": { + "root": { "type": "custom", - "candid": "src/services/chats/chats.did", - "wasm": "target/wasm32-unknown-unknown/release/chats-opt.wasm", - "build": "./generate-wasm.sh chats" + "candid": "backend/canisters/root/api/can.did", + "wasm": "target/wasm32-unknown-unknown/release/root_canister_impl-opt.wasm", + "build": "./generate-wasm.sh root_canister_impl" }, - "p2p": { + "notifications": { "type": "custom", - "candid": "src/services/p2p/p2p.did", - "wasm": "target/wasm32-unknown-unknown/release/p2p-opt.wasm", - "build": "./generate-wasm.sh p2p" + "candid": "backend/canisters/notifications/api/can.did", + "wasm": "target/wasm32-unknown-unknown/release/notifications_canister_impl-opt.wasm", + "build": "./generate-wasm.sh notifications_canister_impl" }, - "user_mgmt": { + "user_index": { "type": "custom", - "candid": "src/services/user_mgmt/user_mgmt.did", - "wasm": "target/wasm32-unknown-unknown/release/user_mgmt-opt.wasm", - "build": "./generate-wasm.sh user_mgmt" + "candid": "backend/canisters/user_index/api/can.did", + "wasm": "target/wasm32-unknown-unknown/release/user_index_canister_impl-opt.wasm", + "build": "./generate-wasm.sh user_index_canister_impl" + }, + "group_index": { + "type": "custom", + "candid": "backend/canisters/user_index/api/can.did", + "wasm": "target/wasm32-unknown-unknown/release/group_index_canister_impl-opt.wasm", + "build": "./generate-wasm.sh group_index_canister_impl" + }, + "online_users_aggregator": { + "type": "custom", + "candid": "backend/canisters/online_users_agg/api/can.did", + "wasm": "target/wasm32-unknown-unknown/release/online_users_aggregator_canister_impl-opt.wasm", + "build": "./generate-wasm.sh online_users_aggregator_canister_impl" + }, + "user": { + "type": "custom", + "candid": "backend/canisters/user/api/can.did", + "wasm": "target/wasm32-unknown-unknown/release/user_canister_impl-opt.wasm", + "build": "./generate-wasm.sh user_canister_impl" + }, + "group": { + "type": "custom", + "candid": "backend/canisters/group/api/can.did", + "wasm": "target/wasm32-unknown-unknown/release/group_canister_impl-opt.wasm", + "build": "./generate-wasm.sh group_canister_impl" }, "website": { - "dependencies": [ - "chats", - "p2p", - "user_mgmt" - ], "frontend": { - "sourceDir": "src/website", - "entrypoint": "src/website/index.tsx" + "entrypoint": "frontend/public/index.html" }, - "source": [ - "dist/website/" - ], + "source": ["frontend/public"], "type": "assets" } }, @@ -40,27 +56,21 @@ } }, "networks": { - "alpha": { - "providers": [ - "https://mercury.dfinity.network" - ], - "type": "persistent" + "local": { + "bind": "127.0.0.1:8000", + "type": "ephemeral" }, "ic": { "providers": [ - "https://ic0.app" + "https://ic0.app/" ], "type": "persistent" }, - "messaging": { + "ic_test": { "providers": [ - "http://dcs-messaging-1.dfinity.systems:8080" + "https://ic0.app/" ], "type": "persistent" - }, - "local": { - "bind": "127.0.0.1:8000", - "type": "ephemeral" } }, "version": 1 diff --git a/v2/frontend/.babelrc b/frontend/.babelrc similarity index 100% rename from v2/frontend/.babelrc rename to frontend/.babelrc diff --git a/v2/frontend/.eslintignore b/frontend/.eslintignore similarity index 100% rename from v2/frontend/.eslintignore rename to frontend/.eslintignore diff --git a/v2/frontend/.eslintrc.js b/frontend/.eslintrc.js similarity index 100% rename from v2/frontend/.eslintrc.js rename to frontend/.eslintrc.js diff --git a/v2/frontend/.gitignore b/frontend/.gitignore similarity index 100% rename from v2/frontend/.gitignore rename to frontend/.gitignore diff --git a/v2/frontend/.prettierignore b/frontend/.prettierignore similarity index 100% rename from v2/frontend/.prettierignore rename to frontend/.prettierignore diff --git a/v2/frontend/.prettierrc b/frontend/.prettierrc similarity index 100% rename from v2/frontend/.prettierrc rename to frontend/.prettierrc diff --git a/v2/frontend/build_dev.sh b/frontend/build_dev.sh similarity index 100% rename from v2/frontend/build_dev.sh rename to frontend/build_dev.sh diff --git a/v2/frontend/build_prod.sh b/frontend/build_prod.sh similarity index 100% rename from v2/frontend/build_prod.sh rename to frontend/build_prod.sh diff --git a/v2/frontend/build_prod_test.sh b/frontend/build_prod_test.sh similarity index 100% rename from v2/frontend/build_prod_test.sh rename to frontend/build_prod_test.sh diff --git a/v2/frontend/codegen.sh b/frontend/codegen.sh similarity index 100% rename from v2/frontend/codegen.sh rename to frontend/codegen.sh diff --git a/v2/frontend/npm-shrinkwrap.json b/frontend/npm-shrinkwrap.json similarity index 100% rename from v2/frontend/npm-shrinkwrap.json rename to frontend/npm-shrinkwrap.json diff --git a/v2/frontend/package.json b/frontend/package.json similarity index 100% rename from v2/frontend/package.json rename to frontend/package.json diff --git a/src/website/assets/apple-touch-icon.png b/frontend/public/_/raw/apple-touch-icon.png similarity index 100% rename from src/website/assets/apple-touch-icon.png rename to frontend/public/_/raw/apple-touch-icon.png diff --git a/src/website/assets/icon.png b/frontend/public/_/raw/icon.png similarity index 100% rename from src/website/assets/icon.png rename to frontend/public/_/raw/icon.png diff --git a/src/website/assets/oc-logo2.svg b/frontend/public/_/raw/oc-logo2.svg similarity index 100% rename from src/website/assets/oc-logo2.svg rename to frontend/public/_/raw/oc-logo2.svg diff --git a/v2/frontend/public/_/raw/apple-touch-icon.png b/frontend/public/apple-touch-icon.png similarity index 100% rename from v2/frontend/public/_/raw/apple-touch-icon.png rename to frontend/public/apple-touch-icon.png diff --git a/v2/frontend/public/assets/campfire.avif b/frontend/public/assets/campfire.avif similarity index 100% rename from v2/frontend/public/assets/campfire.avif rename to frontend/public/assets/campfire.avif diff --git a/v2/frontend/public/assets/campfire.jpg b/frontend/public/assets/campfire.jpg similarity index 100% rename from v2/frontend/public/assets/campfire.jpg rename to frontend/public/assets/campfire.jpg diff --git a/v2/frontend/public/assets/coral.jpg b/frontend/public/assets/coral.jpg similarity index 100% rename from v2/frontend/public/assets/coral.jpg rename to frontend/public/assets/coral.jpg diff --git a/v2/frontend/public/assets/empty.jpg b/frontend/public/assets/empty.jpg similarity index 100% rename from v2/frontend/public/assets/empty.jpg rename to frontend/public/assets/empty.jpg diff --git a/v2/frontend/public/assets/error.jpg b/frontend/public/assets/error.jpg similarity index 100% rename from v2/frontend/public/assets/error.jpg rename to frontend/public/assets/error.jpg diff --git a/v2/frontend/public/assets/expired.jpg b/frontend/public/assets/expired.jpg similarity index 100% rename from v2/frontend/public/assets/expired.jpg rename to frontend/public/assets/expired.jpg diff --git a/v2/frontend/public/assets/flags.png b/frontend/public/assets/flags.png similarity index 100% rename from v2/frontend/public/assets/flags.png rename to frontend/public/assets/flags.png diff --git a/v2/frontend/public/assets/flags@2x.png b/frontend/public/assets/flags@2x.png similarity index 100% rename from v2/frontend/public/assets/flags@2x.png rename to frontend/public/assets/flags@2x.png diff --git a/v2/frontend/public/assets/group.svg b/frontend/public/assets/group.svg similarity index 100% rename from v2/frontend/public/assets/group.svg rename to frontend/public/assets/group.svg diff --git a/v2/frontend/public/assets/ic-badge-built-on-crypto_label-stripe-for-dark.svg b/frontend/public/assets/ic-badge-built-on-crypto_label-stripe-for-dark.svg similarity index 100% rename from v2/frontend/public/assets/ic-badge-built-on-crypto_label-stripe-for-dark.svg rename to frontend/public/assets/ic-badge-built-on-crypto_label-stripe-for-dark.svg diff --git a/v2/frontend/public/assets/ic-badge-built-on-crypto_label-stripe-for-light.svg b/frontend/public/assets/ic-badge-built-on-crypto_label-stripe-for-light.svg similarity index 100% rename from v2/frontend/public/assets/ic-badge-built-on-crypto_label-stripe-for-light.svg rename to frontend/public/assets/ic-badge-built-on-crypto_label-stripe-for-light.svg diff --git a/v2/frontend/public/assets/logo.jpg b/frontend/public/assets/logo.jpg similarity index 100% rename from v2/frontend/public/assets/logo.jpg rename to frontend/public/assets/logo.jpg diff --git a/v2/frontend/public/assets/spinner.svg b/frontend/public/assets/spinner.svg similarity index 100% rename from v2/frontend/public/assets/spinner.svg rename to frontend/public/assets/spinner.svg diff --git a/v2/frontend/public/assets/sunset.jpg b/frontend/public/assets/sunset.jpg similarity index 100% rename from v2/frontend/public/assets/sunset.jpg rename to frontend/public/assets/sunset.jpg diff --git a/v2/frontend/public/assets/underwater.jpg b/frontend/public/assets/underwater.jpg similarity index 100% rename from v2/frontend/public/assets/underwater.jpg rename to frontend/public/assets/underwater.jpg diff --git a/src/website/icons/unknownUserAvatar.svg b/frontend/public/assets/unknownUserAvatar.svg similarity index 100% rename from src/website/icons/unknownUserAvatar.svg rename to frontend/public/assets/unknownUserAvatar.svg diff --git a/v2/frontend/public/assets/upgrade.jpg b/frontend/public/assets/upgrade.jpg similarity index 100% rename from v2/frontend/public/assets/upgrade.jpg rename to frontend/public/assets/upgrade.jpg diff --git a/v2/frontend/public/assets/woods.jpg b/frontend/public/assets/woods.jpg similarity index 100% rename from v2/frontend/public/assets/woods.jpg rename to frontend/public/assets/woods.jpg diff --git a/v2/frontend/public/global.css b/frontend/public/global.css similarity index 100% rename from v2/frontend/public/global.css rename to frontend/public/global.css diff --git a/v2/frontend/public/_/raw/icon.png b/frontend/public/icon.png similarity index 100% rename from v2/frontend/public/_/raw/icon.png rename to frontend/public/icon.png diff --git a/v2/frontend/public/index.html b/frontend/public/index.html similarity index 100% rename from v2/frontend/public/index.html rename to frontend/public/index.html diff --git a/v2/frontend/public/logo-icon.svg b/frontend/public/logo-icon.svg similarity index 100% rename from v2/frontend/public/logo-icon.svg rename to frontend/public/logo-icon.svg diff --git a/v2/frontend/public/oc-logo.svg b/frontend/public/oc-logo.svg similarity index 100% rename from v2/frontend/public/oc-logo.svg rename to frontend/public/oc-logo.svg diff --git a/v2/frontend/public/_/raw/oc-logo2.svg b/frontend/public/oc-logo2.svg similarity index 100% rename from v2/frontend/public/_/raw/oc-logo2.svg rename to frontend/public/oc-logo2.svg diff --git a/v2/frontend/public/openchat.webmanifest b/frontend/public/openchat.webmanifest similarity index 100% rename from v2/frontend/public/openchat.webmanifest rename to frontend/public/openchat.webmanifest diff --git a/v2/frontend/public/reset.css b/frontend/public/reset.css similarity index 100% rename from v2/frontend/public/reset.css rename to frontend/public/reset.css diff --git a/v2/frontend/readme.md b/frontend/readme.md similarity index 100% rename from v2/frontend/readme.md rename to frontend/readme.md diff --git a/v2/frontend/rollup.config.js b/frontend/rollup.config.js similarity index 100% rename from v2/frontend/rollup.config.js rename to frontend/rollup.config.js diff --git a/v2/frontend/src/App.svelte b/frontend/src/App.svelte similarity index 100% rename from v2/frontend/src/App.svelte rename to frontend/src/App.svelte diff --git a/v2/frontend/src/components/AboutModal.svelte b/frontend/src/components/AboutModal.svelte similarity index 100% rename from v2/frontend/src/components/AboutModal.svelte rename to frontend/src/components/AboutModal.svelte diff --git a/v2/frontend/src/components/Avatar.svelte b/frontend/src/components/Avatar.svelte similarity index 100% rename from v2/frontend/src/components/Avatar.svelte rename to frontend/src/components/Avatar.svelte diff --git a/v2/frontend/src/components/Button.svelte b/frontend/src/components/Button.svelte similarity index 100% rename from v2/frontend/src/components/Button.svelte rename to frontend/src/components/Button.svelte diff --git a/v2/frontend/src/components/ButtonGroup.svelte b/frontend/src/components/ButtonGroup.svelte similarity index 100% rename from v2/frontend/src/components/ButtonGroup.svelte rename to frontend/src/components/ButtonGroup.svelte diff --git a/v2/frontend/src/components/Checkbox.svelte b/frontend/src/components/Checkbox.svelte similarity index 100% rename from v2/frontend/src/components/Checkbox.svelte rename to frontend/src/components/Checkbox.svelte diff --git a/v2/frontend/src/components/CollapsibleCard.svelte b/frontend/src/components/CollapsibleCard.svelte similarity index 100% rename from v2/frontend/src/components/CollapsibleCard.svelte rename to frontend/src/components/CollapsibleCard.svelte diff --git a/v2/frontend/src/components/EditableAvatar.svelte b/frontend/src/components/EditableAvatar.svelte similarity index 100% rename from v2/frontend/src/components/EditableAvatar.svelte rename to frontend/src/components/EditableAvatar.svelte diff --git a/v2/frontend/src/components/ErrorMessage.svelte b/frontend/src/components/ErrorMessage.svelte similarity index 100% rename from v2/frontend/src/components/ErrorMessage.svelte rename to frontend/src/components/ErrorMessage.svelte diff --git a/v2/frontend/src/components/Fab.svelte b/frontend/src/components/Fab.svelte similarity index 100% rename from v2/frontend/src/components/Fab.svelte rename to frontend/src/components/Fab.svelte diff --git a/v2/frontend/src/components/FaqModal.svelte b/frontend/src/components/FaqModal.svelte similarity index 100% rename from v2/frontend/src/components/FaqModal.svelte rename to frontend/src/components/FaqModal.svelte diff --git a/v2/frontend/src/components/FindUser.svelte b/frontend/src/components/FindUser.svelte similarity index 100% rename from v2/frontend/src/components/FindUser.svelte rename to frontend/src/components/FindUser.svelte diff --git a/v2/frontend/src/components/HoverIcon.svelte b/frontend/src/components/HoverIcon.svelte similarity index 100% rename from v2/frontend/src/components/HoverIcon.svelte rename to frontend/src/components/HoverIcon.svelte diff --git a/v2/frontend/src/components/Hoverable.svelte b/frontend/src/components/Hoverable.svelte similarity index 100% rename from v2/frontend/src/components/Hoverable.svelte rename to frontend/src/components/Hoverable.svelte diff --git a/v2/frontend/src/components/Input.svelte b/frontend/src/components/Input.svelte similarity index 100% rename from v2/frontend/src/components/Input.svelte rename to frontend/src/components/Input.svelte diff --git a/v2/frontend/src/components/Lazy.svelte b/frontend/src/components/Lazy.svelte similarity index 100% rename from v2/frontend/src/components/Lazy.svelte rename to frontend/src/components/Lazy.svelte diff --git a/v2/frontend/src/components/Link.svelte b/frontend/src/components/Link.svelte similarity index 100% rename from v2/frontend/src/components/Link.svelte rename to frontend/src/components/Link.svelte diff --git a/v2/frontend/src/components/Loading.svelte b/frontend/src/components/Loading.svelte similarity index 100% rename from v2/frontend/src/components/Loading.svelte rename to frontend/src/components/Loading.svelte diff --git a/v2/frontend/src/components/Login.svelte b/frontend/src/components/Login.svelte similarity index 100% rename from v2/frontend/src/components/Login.svelte rename to frontend/src/components/Login.svelte diff --git a/v2/frontend/src/components/Logo.svelte b/frontend/src/components/Logo.svelte similarity index 100% rename from v2/frontend/src/components/Logo.svelte rename to frontend/src/components/Logo.svelte diff --git a/v2/frontend/src/components/Menu.svelte b/frontend/src/components/Menu.svelte similarity index 100% rename from v2/frontend/src/components/Menu.svelte rename to frontend/src/components/Menu.svelte diff --git a/v2/frontend/src/components/MenuIcon.svelte b/frontend/src/components/MenuIcon.svelte similarity index 100% rename from v2/frontend/src/components/MenuIcon.svelte rename to frontend/src/components/MenuIcon.svelte diff --git a/v2/frontend/src/components/MenuItem.svelte b/frontend/src/components/MenuItem.svelte similarity index 100% rename from v2/frontend/src/components/MenuItem.svelte rename to frontend/src/components/MenuItem.svelte diff --git a/v2/frontend/src/components/ModalContent.svelte b/frontend/src/components/ModalContent.svelte similarity index 100% rename from v2/frontend/src/components/ModalContent.svelte rename to frontend/src/components/ModalContent.svelte diff --git a/v2/frontend/src/components/ModalPage.svelte b/frontend/src/components/ModalPage.svelte similarity index 100% rename from v2/frontend/src/components/ModalPage.svelte rename to frontend/src/components/ModalPage.svelte diff --git a/v2/frontend/src/components/NotFound.svelte b/frontend/src/components/NotFound.svelte similarity index 100% rename from v2/frontend/src/components/NotFound.svelte rename to frontend/src/components/NotFound.svelte diff --git a/v2/frontend/src/components/Overlay.svelte b/frontend/src/components/Overlay.svelte similarity index 100% rename from v2/frontend/src/components/Overlay.svelte rename to frontend/src/components/Overlay.svelte diff --git a/v2/frontend/src/components/Panel.svelte b/frontend/src/components/Panel.svelte similarity index 100% rename from v2/frontend/src/components/Panel.svelte rename to frontend/src/components/Panel.svelte diff --git a/v2/frontend/src/components/Progress.svelte b/frontend/src/components/Progress.svelte similarity index 100% rename from v2/frontend/src/components/Progress.svelte rename to frontend/src/components/Progress.svelte diff --git a/v2/frontend/src/components/Radio.svelte b/frontend/src/components/Radio.svelte similarity index 100% rename from v2/frontend/src/components/Radio.svelte rename to frontend/src/components/Radio.svelte diff --git a/v2/frontend/src/components/Reload.svelte b/frontend/src/components/Reload.svelte similarity index 100% rename from v2/frontend/src/components/Reload.svelte rename to frontend/src/components/Reload.svelte diff --git a/v2/frontend/src/components/RoadmapModal.svelte b/frontend/src/components/RoadmapModal.svelte similarity index 100% rename from v2/frontend/src/components/RoadmapModal.svelte rename to frontend/src/components/RoadmapModal.svelte diff --git a/v2/frontend/src/components/Search.svelte b/frontend/src/components/Search.svelte similarity index 100% rename from v2/frontend/src/components/Search.svelte rename to frontend/src/components/Search.svelte diff --git a/v2/frontend/src/components/SectionHeader.svelte b/frontend/src/components/SectionHeader.svelte similarity index 100% rename from v2/frontend/src/components/SectionHeader.svelte rename to frontend/src/components/SectionHeader.svelte diff --git a/v2/frontend/src/components/Select.svelte b/frontend/src/components/Select.svelte similarity index 100% rename from v2/frontend/src/components/Select.svelte rename to frontend/src/components/Select.svelte diff --git a/v2/frontend/src/components/StorageUsage.svelte b/frontend/src/components/StorageUsage.svelte similarity index 100% rename from v2/frontend/src/components/StorageUsage.svelte rename to frontend/src/components/StorageUsage.svelte diff --git a/v2/frontend/src/components/TextArea.svelte b/frontend/src/components/TextArea.svelte similarity index 100% rename from v2/frontend/src/components/TextArea.svelte rename to frontend/src/components/TextArea.svelte diff --git a/v2/frontend/src/components/Toast.svelte b/frontend/src/components/Toast.svelte similarity index 100% rename from v2/frontend/src/components/Toast.svelte rename to frontend/src/components/Toast.svelte diff --git a/v2/frontend/src/components/Typing.svelte b/frontend/src/components/Typing.svelte similarity index 100% rename from v2/frontend/src/components/Typing.svelte rename to frontend/src/components/Typing.svelte diff --git a/v2/frontend/src/components/UserPill.svelte b/frontend/src/components/UserPill.svelte similarity index 100% rename from v2/frontend/src/components/UserPill.svelte rename to frontend/src/components/UserPill.svelte diff --git a/v2/frontend/src/components/VirtualList.svelte b/frontend/src/components/VirtualList.svelte similarity index 100% rename from v2/frontend/src/components/VirtualList.svelte rename to frontend/src/components/VirtualList.svelte diff --git a/v2/frontend/src/components/home/AudioAttacher.svelte b/frontend/src/components/home/AudioAttacher.svelte similarity index 100% rename from v2/frontend/src/components/home/AudioAttacher.svelte rename to frontend/src/components/home/AudioAttacher.svelte diff --git a/v2/frontend/src/components/home/AudioContent.svelte b/frontend/src/components/home/AudioContent.svelte similarity index 100% rename from v2/frontend/src/components/home/AudioContent.svelte rename to frontend/src/components/home/AudioContent.svelte diff --git a/v2/frontend/src/components/home/ChatEvent.svelte b/frontend/src/components/home/ChatEvent.svelte similarity index 100% rename from v2/frontend/src/components/home/ChatEvent.svelte rename to frontend/src/components/home/ChatEvent.svelte diff --git a/v2/frontend/src/components/home/ChatList.svelte b/frontend/src/components/home/ChatList.svelte similarity index 100% rename from v2/frontend/src/components/home/ChatList.svelte rename to frontend/src/components/home/ChatList.svelte diff --git a/v2/frontend/src/components/home/ChatMessage.svelte b/frontend/src/components/home/ChatMessage.svelte similarity index 100% rename from v2/frontend/src/components/home/ChatMessage.svelte rename to frontend/src/components/home/ChatMessage.svelte diff --git a/v2/frontend/src/components/home/ChatMessageContent.svelte b/frontend/src/components/home/ChatMessageContent.svelte similarity index 100% rename from v2/frontend/src/components/home/ChatMessageContent.svelte rename to frontend/src/components/home/ChatMessageContent.svelte diff --git a/v2/frontend/src/components/home/ChatSummary.svelte b/frontend/src/components/home/ChatSummary.svelte similarity index 100% rename from v2/frontend/src/components/home/ChatSummary.svelte rename to frontend/src/components/home/ChatSummary.svelte diff --git a/v2/frontend/src/components/home/CurrentChat.svelte b/frontend/src/components/home/CurrentChat.svelte similarity index 100% rename from v2/frontend/src/components/home/CurrentChat.svelte rename to frontend/src/components/home/CurrentChat.svelte diff --git a/v2/frontend/src/components/home/CurrentChatHeader.svelte b/frontend/src/components/home/CurrentChatHeader.svelte similarity index 100% rename from v2/frontend/src/components/home/CurrentChatHeader.svelte rename to frontend/src/components/home/CurrentChatHeader.svelte diff --git a/v2/frontend/src/components/home/CurrentChatMessages.svelte b/frontend/src/components/home/CurrentChatMessages.svelte similarity index 100% rename from v2/frontend/src/components/home/CurrentChatMessages.svelte rename to frontend/src/components/home/CurrentChatMessages.svelte diff --git a/v2/frontend/src/components/home/CurrentUser.svelte b/frontend/src/components/home/CurrentUser.svelte similarity index 100% rename from v2/frontend/src/components/home/CurrentUser.svelte rename to frontend/src/components/home/CurrentUser.svelte diff --git a/v2/frontend/src/components/home/DeletedContent.svelte b/frontend/src/components/home/DeletedContent.svelte similarity index 100% rename from v2/frontend/src/components/home/DeletedContent.svelte rename to frontend/src/components/home/DeletedContent.svelte diff --git a/v2/frontend/src/components/home/DirectChatCreatedEvent.svelte b/frontend/src/components/home/DirectChatCreatedEvent.svelte similarity index 100% rename from v2/frontend/src/components/home/DirectChatCreatedEvent.svelte rename to frontend/src/components/home/DirectChatCreatedEvent.svelte diff --git a/v2/frontend/src/components/home/DoubleTick.svelte b/frontend/src/components/home/DoubleTick.svelte similarity index 100% rename from v2/frontend/src/components/home/DoubleTick.svelte rename to frontend/src/components/home/DoubleTick.svelte diff --git a/v2/frontend/src/components/home/DraftMediaMessage.svelte b/frontend/src/components/home/DraftMediaMessage.svelte similarity index 100% rename from v2/frontend/src/components/home/DraftMediaMessage.svelte rename to frontend/src/components/home/DraftMediaMessage.svelte diff --git a/v2/frontend/src/components/home/EmojiAutocompleter.svelte b/frontend/src/components/home/EmojiAutocompleter.svelte similarity index 100% rename from v2/frontend/src/components/home/EmojiAutocompleter.svelte rename to frontend/src/components/home/EmojiAutocompleter.svelte diff --git a/v2/frontend/src/components/home/EmojiPicker.svelte b/frontend/src/components/home/EmojiPicker.svelte similarity index 100% rename from v2/frontend/src/components/home/EmojiPicker.svelte rename to frontend/src/components/home/EmojiPicker.svelte diff --git a/v2/frontend/src/components/home/FileAttacher.svelte b/frontend/src/components/home/FileAttacher.svelte similarity index 100% rename from v2/frontend/src/components/home/FileAttacher.svelte rename to frontend/src/components/home/FileAttacher.svelte diff --git a/v2/frontend/src/components/home/FileContent.svelte b/frontend/src/components/home/FileContent.svelte similarity index 100% rename from v2/frontend/src/components/home/FileContent.svelte rename to frontend/src/components/home/FileContent.svelte diff --git a/v2/frontend/src/components/home/Footer.svelte b/frontend/src/components/home/Footer.svelte similarity index 100% rename from v2/frontend/src/components/home/Footer.svelte rename to frontend/src/components/home/Footer.svelte diff --git a/v2/frontend/src/components/home/GroupChangedEvent.svelte b/frontend/src/components/home/GroupChangedEvent.svelte similarity index 100% rename from v2/frontend/src/components/home/GroupChangedEvent.svelte rename to frontend/src/components/home/GroupChangedEvent.svelte diff --git a/v2/frontend/src/components/home/GroupChatCreatedEvent.svelte b/frontend/src/components/home/GroupChatCreatedEvent.svelte similarity index 100% rename from v2/frontend/src/components/home/GroupChatCreatedEvent.svelte rename to frontend/src/components/home/GroupChatCreatedEvent.svelte diff --git a/v2/frontend/src/components/home/Home.svelte b/frontend/src/components/home/Home.svelte similarity index 100% rename from v2/frontend/src/components/home/Home.svelte rename to frontend/src/components/home/Home.svelte diff --git a/v2/frontend/src/components/home/HomeRoute.svelte b/frontend/src/components/home/HomeRoute.svelte similarity index 100% rename from v2/frontend/src/components/home/HomeRoute.svelte rename to frontend/src/components/home/HomeRoute.svelte diff --git a/v2/frontend/src/components/home/ImageContent.svelte b/frontend/src/components/home/ImageContent.svelte similarity index 100% rename from v2/frontend/src/components/home/ImageContent.svelte rename to frontend/src/components/home/ImageContent.svelte diff --git a/v2/frontend/src/components/home/LeftPanel.svelte b/frontend/src/components/home/LeftPanel.svelte similarity index 100% rename from v2/frontend/src/components/home/LeftPanel.svelte rename to frontend/src/components/home/LeftPanel.svelte diff --git a/v2/frontend/src/components/home/Markdown.svelte b/frontend/src/components/home/Markdown.svelte similarity index 100% rename from v2/frontend/src/components/home/Markdown.svelte rename to frontend/src/components/home/Markdown.svelte diff --git a/v2/frontend/src/components/home/MentionPicker.svelte b/frontend/src/components/home/MentionPicker.svelte similarity index 100% rename from v2/frontend/src/components/home/MentionPicker.svelte rename to frontend/src/components/home/MentionPicker.svelte diff --git a/v2/frontend/src/components/home/MessageEntry.svelte b/frontend/src/components/home/MessageEntry.svelte similarity index 100% rename from v2/frontend/src/components/home/MessageEntry.svelte rename to frontend/src/components/home/MessageEntry.svelte diff --git a/v2/frontend/src/components/home/MessageReaction.svelte b/frontend/src/components/home/MessageReaction.svelte similarity index 100% rename from v2/frontend/src/components/home/MessageReaction.svelte rename to frontend/src/components/home/MessageReaction.svelte diff --git a/v2/frontend/src/components/home/MiddlePanel.svelte b/frontend/src/components/home/MiddlePanel.svelte similarity index 100% rename from v2/frontend/src/components/home/MiddlePanel.svelte rename to frontend/src/components/home/MiddlePanel.svelte diff --git a/v2/frontend/src/components/home/NoChatSelected.svelte b/frontend/src/components/home/NoChatSelected.svelte similarity index 100% rename from v2/frontend/src/components/home/NoChatSelected.svelte rename to frontend/src/components/home/NoChatSelected.svelte diff --git a/v2/frontend/src/components/home/NonMessageEvent.svelte b/frontend/src/components/home/NonMessageEvent.svelte similarity index 100% rename from v2/frontend/src/components/home/NonMessageEvent.svelte rename to frontend/src/components/home/NonMessageEvent.svelte diff --git a/v2/frontend/src/components/home/NotificationsBar.svelte b/frontend/src/components/home/NotificationsBar.svelte similarity index 100% rename from v2/frontend/src/components/home/NotificationsBar.svelte rename to frontend/src/components/home/NotificationsBar.svelte diff --git a/v2/frontend/src/components/home/Paperclip.svelte b/frontend/src/components/home/Paperclip.svelte similarity index 100% rename from v2/frontend/src/components/home/Paperclip.svelte rename to frontend/src/components/home/Paperclip.svelte diff --git a/v2/frontend/src/components/home/ParticipantLeftEvent.svelte b/frontend/src/components/home/ParticipantLeftEvent.svelte similarity index 100% rename from v2/frontend/src/components/home/ParticipantLeftEvent.svelte rename to frontend/src/components/home/ParticipantLeftEvent.svelte diff --git a/v2/frontend/src/components/home/ParticipantsChangedEvent.svelte b/frontend/src/components/home/ParticipantsChangedEvent.svelte similarity index 100% rename from v2/frontend/src/components/home/ParticipantsChangedEvent.svelte rename to frontend/src/components/home/ParticipantsChangedEvent.svelte diff --git a/v2/frontend/src/components/home/PlaceholderContent.svelte b/frontend/src/components/home/PlaceholderContent.svelte similarity index 100% rename from v2/frontend/src/components/home/PlaceholderContent.svelte rename to frontend/src/components/home/PlaceholderContent.svelte diff --git a/v2/frontend/src/components/home/RecommendedGroups.svelte b/frontend/src/components/home/RecommendedGroups.svelte similarity index 100% rename from v2/frontend/src/components/home/RecommendedGroups.svelte rename to frontend/src/components/home/RecommendedGroups.svelte diff --git a/v2/frontend/src/components/home/RemovingGroup.svelte b/frontend/src/components/home/RemovingGroup.svelte similarity index 100% rename from v2/frontend/src/components/home/RemovingGroup.svelte rename to frontend/src/components/home/RemovingGroup.svelte diff --git a/v2/frontend/src/components/home/RepliesTo.svelte b/frontend/src/components/home/RepliesTo.svelte similarity index 100% rename from v2/frontend/src/components/home/RepliesTo.svelte rename to frontend/src/components/home/RepliesTo.svelte diff --git a/v2/frontend/src/components/home/ReplyingTo.svelte b/frontend/src/components/home/ReplyingTo.svelte similarity index 100% rename from v2/frontend/src/components/home/ReplyingTo.svelte rename to frontend/src/components/home/ReplyingTo.svelte diff --git a/v2/frontend/src/components/home/RightPanel.svelte b/frontend/src/components/home/RightPanel.svelte similarity index 100% rename from v2/frontend/src/components/home/RightPanel.svelte rename to frontend/src/components/home/RightPanel.svelte diff --git a/v2/frontend/src/components/home/RoleChangedEvent.svelte b/frontend/src/components/home/RoleChangedEvent.svelte similarity index 100% rename from v2/frontend/src/components/home/RoleChangedEvent.svelte rename to frontend/src/components/home/RoleChangedEvent.svelte diff --git a/v2/frontend/src/components/home/SearchResult.svelte b/frontend/src/components/home/SearchResult.svelte similarity index 100% rename from v2/frontend/src/components/home/SearchResult.svelte rename to frontend/src/components/home/SearchResult.svelte diff --git a/v2/frontend/src/components/home/SelectUsers.svelte b/frontend/src/components/home/SelectUsers.svelte similarity index 100% rename from v2/frontend/src/components/home/SelectUsers.svelte rename to frontend/src/components/home/SelectUsers.svelte diff --git a/v2/frontend/src/components/home/Smiley.svelte b/frontend/src/components/home/Smiley.svelte similarity index 100% rename from v2/frontend/src/components/home/Smiley.svelte rename to frontend/src/components/home/Smiley.svelte diff --git a/v2/frontend/src/components/home/Tick.svelte b/frontend/src/components/home/Tick.svelte similarity index 100% rename from v2/frontend/src/components/home/Tick.svelte rename to frontend/src/components/home/Tick.svelte diff --git a/v2/frontend/src/components/home/TimeAndTicks.svelte b/frontend/src/components/home/TimeAndTicks.svelte similarity index 100% rename from v2/frontend/src/components/home/TimeAndTicks.svelte rename to frontend/src/components/home/TimeAndTicks.svelte diff --git a/v2/frontend/src/components/home/UnresolvedReply.svelte b/frontend/src/components/home/UnresolvedReply.svelte similarity index 100% rename from v2/frontend/src/components/home/UnresolvedReply.svelte rename to frontend/src/components/home/UnresolvedReply.svelte diff --git a/v2/frontend/src/components/home/VideoContent.svelte b/frontend/src/components/home/VideoContent.svelte similarity index 100% rename from v2/frontend/src/components/home/VideoContent.svelte rename to frontend/src/components/home/VideoContent.svelte diff --git a/v2/frontend/src/components/home/addgroup/AddGroup.controller.svelte b/frontend/src/components/home/addgroup/AddGroup.controller.svelte similarity index 100% rename from v2/frontend/src/components/home/addgroup/AddGroup.controller.svelte rename to frontend/src/components/home/addgroup/AddGroup.controller.svelte diff --git a/v2/frontend/src/components/home/addgroup/ChooseParticipants.svelte b/frontend/src/components/home/addgroup/ChooseParticipants.svelte similarity index 100% rename from v2/frontend/src/components/home/addgroup/ChooseParticipants.svelte rename to frontend/src/components/home/addgroup/ChooseParticipants.svelte diff --git a/v2/frontend/src/components/home/addgroup/NewGroup.svelte b/frontend/src/components/home/addgroup/NewGroup.svelte similarity index 100% rename from v2/frontend/src/components/home/addgroup/NewGroup.svelte rename to frontend/src/components/home/addgroup/NewGroup.svelte diff --git a/v2/frontend/src/components/home/groupdetails/AddParticipants.svelte b/frontend/src/components/home/groupdetails/AddParticipants.svelte similarity index 100% rename from v2/frontend/src/components/home/groupdetails/AddParticipants.svelte rename to frontend/src/components/home/groupdetails/AddParticipants.svelte diff --git a/v2/frontend/src/components/home/groupdetails/GroupDetails.svelte b/frontend/src/components/home/groupdetails/GroupDetails.svelte similarity index 100% rename from v2/frontend/src/components/home/groupdetails/GroupDetails.svelte rename to frontend/src/components/home/groupdetails/GroupDetails.svelte diff --git a/v2/frontend/src/components/home/groupdetails/GroupDetailsHeader.svelte b/frontend/src/components/home/groupdetails/GroupDetailsHeader.svelte similarity index 100% rename from v2/frontend/src/components/home/groupdetails/GroupDetailsHeader.svelte rename to frontend/src/components/home/groupdetails/GroupDetailsHeader.svelte diff --git a/v2/frontend/src/components/home/groupdetails/Participant.svelte b/frontend/src/components/home/groupdetails/Participant.svelte similarity index 100% rename from v2/frontend/src/components/home/groupdetails/Participant.svelte rename to frontend/src/components/home/groupdetails/Participant.svelte diff --git a/v2/frontend/src/components/home/groupdetails/Participants.svelte b/frontend/src/components/home/groupdetails/Participants.svelte similarity index 100% rename from v2/frontend/src/components/home/groupdetails/Participants.svelte rename to frontend/src/components/home/groupdetails/Participants.svelte diff --git a/v2/frontend/src/components/home/groupdetails/ParticipantsHeader.svelte b/frontend/src/components/home/groupdetails/ParticipantsHeader.svelte similarity index 100% rename from v2/frontend/src/components/home/groupdetails/ParticipantsHeader.svelte rename to frontend/src/components/home/groupdetails/ParticipantsHeader.svelte diff --git a/v2/frontend/src/components/home/profile/Toggle.svelte b/frontend/src/components/home/profile/Toggle.svelte similarity index 100% rename from v2/frontend/src/components/home/profile/Toggle.svelte rename to frontend/src/components/home/profile/Toggle.svelte diff --git a/v2/frontend/src/components/home/profile/UserProfile.svelte b/frontend/src/components/home/profile/UserProfile.svelte similarity index 100% rename from v2/frontend/src/components/home/profile/UserProfile.svelte rename to frontend/src/components/home/profile/UserProfile.svelte diff --git a/v2/frontend/src/components/home/profile/ViewUserProfile.svelte b/frontend/src/components/home/profile/ViewUserProfile.svelte similarity index 100% rename from v2/frontend/src/components/home/profile/ViewUserProfile.svelte rename to frontend/src/components/home/profile/ViewUserProfile.svelte diff --git a/v2/frontend/src/components/home/upgrade/Congratulations.svelte b/frontend/src/components/home/upgrade/Congratulations.svelte similarity index 100% rename from v2/frontend/src/components/home/upgrade/Congratulations.svelte rename to frontend/src/components/home/upgrade/Congratulations.svelte diff --git a/v2/frontend/src/components/home/upgrade/Explain.svelte b/frontend/src/components/home/upgrade/Explain.svelte similarity index 100% rename from v2/frontend/src/components/home/upgrade/Explain.svelte rename to frontend/src/components/home/upgrade/Explain.svelte diff --git a/v2/frontend/src/components/home/upgrade/Footer.svelte b/frontend/src/components/home/upgrade/Footer.svelte similarity index 100% rename from v2/frontend/src/components/home/upgrade/Footer.svelte rename to frontend/src/components/home/upgrade/Footer.svelte diff --git a/v2/frontend/src/components/home/upgrade/ICPUpgrade.svelte b/frontend/src/components/home/upgrade/ICPUpgrade.svelte similarity index 100% rename from v2/frontend/src/components/home/upgrade/ICPUpgrade.svelte rename to frontend/src/components/home/upgrade/ICPUpgrade.svelte diff --git a/v2/frontend/src/components/home/upgrade/SMSUpgrade.svelte b/frontend/src/components/home/upgrade/SMSUpgrade.svelte similarity index 100% rename from v2/frontend/src/components/home/upgrade/SMSUpgrade.svelte rename to frontend/src/components/home/upgrade/SMSUpgrade.svelte diff --git a/v2/frontend/src/components/home/upgrade/Upgrade.svelte b/frontend/src/components/home/upgrade/Upgrade.svelte similarity index 100% rename from v2/frontend/src/components/home/upgrade/Upgrade.svelte rename to frontend/src/components/home/upgrade/Upgrade.svelte diff --git a/v2/frontend/src/components/register/Challenge.svelte b/frontend/src/components/register/Challenge.svelte similarity index 100% rename from v2/frontend/src/components/register/Challenge.svelte rename to frontend/src/components/register/Challenge.svelte diff --git a/v2/frontend/src/components/register/Complete.svelte b/frontend/src/components/register/Complete.svelte similarity index 100% rename from v2/frontend/src/components/register/Complete.svelte rename to frontend/src/components/register/Complete.svelte diff --git a/v2/frontend/src/components/register/EnterUsername.svelte b/frontend/src/components/register/EnterUsername.svelte similarity index 100% rename from v2/frontend/src/components/register/EnterUsername.svelte rename to frontend/src/components/register/EnterUsername.svelte diff --git a/v2/frontend/src/components/register/Register.svelte b/frontend/src/components/register/Register.svelte similarity index 100% rename from v2/frontend/src/components/register/Register.svelte rename to frontend/src/components/register/Register.svelte diff --git a/v2/frontend/src/components/sessionExpired/SessionExpired.svelte b/frontend/src/components/sessionExpired/SessionExpired.svelte similarity index 100% rename from v2/frontend/src/components/sessionExpired/SessionExpired.svelte rename to frontend/src/components/sessionExpired/SessionExpired.svelte diff --git a/v2/frontend/src/components/unexpectedError/UnexpectedError.svelte b/frontend/src/components/unexpectedError/UnexpectedError.svelte similarity index 100% rename from v2/frontend/src/components/unexpectedError/UnexpectedError.svelte rename to frontend/src/components/unexpectedError/UnexpectedError.svelte diff --git a/v2/frontend/src/components/upgrading/Upgrading.svelte b/frontend/src/components/upgrading/Upgrading.svelte similarity index 100% rename from v2/frontend/src/components/upgrading/Upgrading.svelte rename to frontend/src/components/upgrading/Upgrading.svelte diff --git a/v2/frontend/src/domain/canister.ts b/frontend/src/domain/canister.ts similarity index 100% rename from v2/frontend/src/domain/canister.ts rename to frontend/src/domain/canister.ts diff --git a/v2/frontend/src/domain/chat/chat.ts b/frontend/src/domain/chat/chat.ts similarity index 100% rename from v2/frontend/src/domain/chat/chat.ts rename to frontend/src/domain/chat/chat.ts diff --git a/v2/frontend/src/domain/chat/chat.utils.spec.ts b/frontend/src/domain/chat/chat.utils.spec.ts similarity index 100% rename from v2/frontend/src/domain/chat/chat.utils.spec.ts rename to frontend/src/domain/chat/chat.utils.spec.ts diff --git a/v2/frontend/src/domain/chat/chat.utils.ts b/frontend/src/domain/chat/chat.utils.ts similarity index 100% rename from v2/frontend/src/domain/chat/chat.utils.ts rename to frontend/src/domain/chat/chat.utils.ts diff --git a/v2/frontend/src/domain/crypto/crypto.ts b/frontend/src/domain/crypto/crypto.ts similarity index 100% rename from v2/frontend/src/domain/crypto/crypto.ts rename to frontend/src/domain/crypto/crypto.ts diff --git a/v2/frontend/src/domain/data/data.ts b/frontend/src/domain/data/data.ts similarity index 100% rename from v2/frontend/src/domain/data/data.ts rename to frontend/src/domain/data/data.ts diff --git a/v2/frontend/src/domain/faq.ts b/frontend/src/domain/faq.ts similarity index 100% rename from v2/frontend/src/domain/faq.ts rename to frontend/src/domain/faq.ts diff --git a/v2/frontend/src/domain/notifications/index.ts b/frontend/src/domain/notifications/index.ts similarity index 100% rename from v2/frontend/src/domain/notifications/index.ts rename to frontend/src/domain/notifications/index.ts diff --git a/v2/frontend/src/domain/optionUpdate.ts b/frontend/src/domain/optionUpdate.ts similarity index 100% rename from v2/frontend/src/domain/optionUpdate.ts rename to frontend/src/domain/optionUpdate.ts diff --git a/v2/frontend/src/domain/search/search.ts b/frontend/src/domain/search/search.ts similarity index 100% rename from v2/frontend/src/domain/search/search.ts rename to frontend/src/domain/search/search.ts diff --git a/v2/frontend/src/domain/user/user.ts b/frontend/src/domain/user/user.ts similarity index 100% rename from v2/frontend/src/domain/user/user.ts rename to frontend/src/domain/user/user.ts diff --git a/v2/frontend/src/domain/user/user.utils.spec.ts b/frontend/src/domain/user/user.utils.spec.ts similarity index 100% rename from v2/frontend/src/domain/user/user.utils.spec.ts rename to frontend/src/domain/user/user.utils.spec.ts diff --git a/v2/frontend/src/domain/user/user.utils.ts b/frontend/src/domain/user/user.utils.ts similarity index 100% rename from v2/frontend/src/domain/user/user.utils.ts rename to frontend/src/domain/user/user.utils.ts diff --git a/v2/frontend/src/domain/version.ts b/frontend/src/domain/version.ts similarity index 100% rename from v2/frontend/src/domain/version.ts rename to frontend/src/domain/version.ts diff --git a/v2/frontend/src/domain/webrtc/RtcConnectionsManager.ts b/frontend/src/domain/webrtc/RtcConnectionsManager.ts similarity index 100% rename from v2/frontend/src/domain/webrtc/RtcConnectionsManager.ts rename to frontend/src/domain/webrtc/RtcConnectionsManager.ts diff --git a/v2/frontend/src/domain/webrtc/webrtc.ts b/frontend/src/domain/webrtc/webrtc.ts similarity index 100% rename from v2/frontend/src/domain/webrtc/webrtc.ts rename to frontend/src/domain/webrtc/webrtc.ts diff --git a/v2/frontend/src/dummyModule.js b/frontend/src/dummyModule.js similarity index 100% rename from v2/frontend/src/dummyModule.js rename to frontend/src/dummyModule.js diff --git a/v2/frontend/src/dummyNotifications.js b/frontend/src/dummyNotifications.js similarity index 100% rename from v2/frontend/src/dummyNotifications.js rename to frontend/src/dummyNotifications.js diff --git a/v2/frontend/src/fsm/chat.controller.ts b/frontend/src/fsm/chat.controller.ts similarity index 100% rename from v2/frontend/src/fsm/chat.controller.ts rename to frontend/src/fsm/chat.controller.ts diff --git a/v2/frontend/src/fsm/editGroup.ts b/frontend/src/fsm/editGroup.ts similarity index 100% rename from v2/frontend/src/fsm/editGroup.ts rename to frontend/src/fsm/editGroup.ts diff --git a/v2/frontend/src/fsm/home.controller.ts b/frontend/src/fsm/home.controller.ts similarity index 100% rename from v2/frontend/src/fsm/home.controller.ts rename to frontend/src/fsm/home.controller.ts diff --git a/v2/frontend/src/fsm/identity.controller.ts b/frontend/src/fsm/identity.controller.ts similarity index 100% rename from v2/frontend/src/fsm/identity.controller.ts rename to frontend/src/fsm/identity.controller.ts diff --git a/v2/frontend/src/fsm/newGroup.ts b/frontend/src/fsm/newGroup.ts similarity index 100% rename from v2/frontend/src/fsm/newGroup.ts rename to frontend/src/fsm/newGroup.ts diff --git a/v2/frontend/src/fsm/poller.ts b/frontend/src/fsm/poller.ts similarity index 100% rename from v2/frontend/src/fsm/poller.ts rename to frontend/src/fsm/poller.ts diff --git a/v2/frontend/src/fsm/register.controller.ts b/frontend/src/fsm/register.controller.ts similarity index 100% rename from v2/frontend/src/fsm/register.controller.ts rename to frontend/src/fsm/register.controller.ts diff --git a/v2/frontend/src/i18n/ar.json b/frontend/src/i18n/ar.json similarity index 100% rename from v2/frontend/src/i18n/ar.json rename to frontend/src/i18n/ar.json diff --git a/v2/frontend/src/i18n/cn.json b/frontend/src/i18n/cn.json similarity index 100% rename from v2/frontend/src/i18n/cn.json rename to frontend/src/i18n/cn.json diff --git a/v2/frontend/src/i18n/de.json b/frontend/src/i18n/de.json similarity index 100% rename from v2/frontend/src/i18n/de.json rename to frontend/src/i18n/de.json diff --git a/v2/frontend/src/i18n/en.json b/frontend/src/i18n/en.json similarity index 100% rename from v2/frontend/src/i18n/en.json rename to frontend/src/i18n/en.json diff --git a/v2/frontend/src/i18n/es.json b/frontend/src/i18n/es.json similarity index 100% rename from v2/frontend/src/i18n/es.json rename to frontend/src/i18n/es.json diff --git a/v2/frontend/src/i18n/fr.json b/frontend/src/i18n/fr.json similarity index 100% rename from v2/frontend/src/i18n/fr.json rename to frontend/src/i18n/fr.json diff --git a/v2/frontend/src/i18n/i18n.ts b/frontend/src/i18n/i18n.ts similarity index 100% rename from v2/frontend/src/i18n/i18n.ts rename to frontend/src/i18n/i18n.ts diff --git a/v2/frontend/src/i18n/it.json b/frontend/src/i18n/it.json similarity index 100% rename from v2/frontend/src/i18n/it.json rename to frontend/src/i18n/it.json diff --git a/v2/frontend/src/i18n/jp.json b/frontend/src/i18n/jp.json similarity index 100% rename from v2/frontend/src/i18n/jp.json rename to frontend/src/i18n/jp.json diff --git a/v2/frontend/src/i18n/ru.json b/frontend/src/i18n/ru.json similarity index 100% rename from v2/frontend/src/i18n/ru.json rename to frontend/src/i18n/ru.json diff --git a/v2/frontend/src/i18n/vi.json b/frontend/src/i18n/vi.json similarity index 100% rename from v2/frontend/src/i18n/vi.json rename to frontend/src/i18n/vi.json diff --git a/v2/frontend/src/main.ts b/frontend/src/main.ts similarity index 100% rename from v2/frontend/src/main.ts rename to frontend/src/main.ts diff --git a/v2/frontend/src/routes.ts b/frontend/src/routes.ts similarity index 100% rename from v2/frontend/src/routes.ts rename to frontend/src/routes.ts diff --git a/v2/frontend/src/services/auth.ts b/frontend/src/services/auth.ts similarity index 100% rename from v2/frontend/src/services/auth.ts rename to frontend/src/services/auth.ts diff --git a/v2/frontend/src/services/candidService.ts b/frontend/src/services/candidService.ts similarity index 100% rename from v2/frontend/src/services/candidService.ts rename to frontend/src/services/candidService.ts diff --git a/v2/frontend/src/services/common/chatMappers.ts b/frontend/src/services/common/chatMappers.ts similarity index 100% rename from v2/frontend/src/services/common/chatMappers.ts rename to frontend/src/services/common/chatMappers.ts diff --git a/v2/frontend/src/services/data/data.client.interface.ts b/frontend/src/services/data/data.client.interface.ts similarity index 100% rename from v2/frontend/src/services/data/data.client.interface.ts rename to frontend/src/services/data/data.client.interface.ts diff --git a/v2/frontend/src/services/data/data.client.ts b/frontend/src/services/data/data.client.ts similarity index 100% rename from v2/frontend/src/services/data/data.client.ts rename to frontend/src/services/data/data.client.ts diff --git a/v2/frontend/src/services/group/candid/idl.d.ts b/frontend/src/services/group/candid/idl.d.ts similarity index 100% rename from v2/frontend/src/services/group/candid/idl.d.ts rename to frontend/src/services/group/candid/idl.d.ts diff --git a/v2/frontend/src/services/group/candid/idl.js b/frontend/src/services/group/candid/idl.js similarity index 100% rename from v2/frontend/src/services/group/candid/idl.js rename to frontend/src/services/group/candid/idl.js diff --git a/v2/frontend/src/services/group/candid/types.ts b/frontend/src/services/group/candid/types.ts similarity index 100% rename from v2/frontend/src/services/group/candid/types.ts rename to frontend/src/services/group/candid/types.ts diff --git a/v2/frontend/src/services/group/group.caching.client.ts b/frontend/src/services/group/group.caching.client.ts similarity index 100% rename from v2/frontend/src/services/group/group.caching.client.ts rename to frontend/src/services/group/group.caching.client.ts diff --git a/v2/frontend/src/services/group/group.client.interface.ts b/frontend/src/services/group/group.client.interface.ts similarity index 100% rename from v2/frontend/src/services/group/group.client.interface.ts rename to frontend/src/services/group/group.client.interface.ts diff --git a/v2/frontend/src/services/group/group.client.ts b/frontend/src/services/group/group.client.ts similarity index 100% rename from v2/frontend/src/services/group/group.client.ts rename to frontend/src/services/group/group.client.ts diff --git a/v2/frontend/src/services/group/mappers.ts b/frontend/src/services/group/mappers.ts similarity index 100% rename from v2/frontend/src/services/group/mappers.ts rename to frontend/src/services/group/mappers.ts diff --git a/v2/frontend/src/services/groupIndex/candid/idl.d.ts b/frontend/src/services/groupIndex/candid/idl.d.ts similarity index 100% rename from v2/frontend/src/services/groupIndex/candid/idl.d.ts rename to frontend/src/services/groupIndex/candid/idl.d.ts diff --git a/v2/frontend/src/services/groupIndex/candid/idl.js b/frontend/src/services/groupIndex/candid/idl.js similarity index 100% rename from v2/frontend/src/services/groupIndex/candid/idl.js rename to frontend/src/services/groupIndex/candid/idl.js diff --git a/v2/frontend/src/services/groupIndex/candid/types.ts b/frontend/src/services/groupIndex/candid/types.ts similarity index 100% rename from v2/frontend/src/services/groupIndex/candid/types.ts rename to frontend/src/services/groupIndex/candid/types.ts diff --git a/v2/frontend/src/services/groupIndex/groupIndex.client.interface.ts b/frontend/src/services/groupIndex/groupIndex.client.interface.ts similarity index 100% rename from v2/frontend/src/services/groupIndex/groupIndex.client.interface.ts rename to frontend/src/services/groupIndex/groupIndex.client.interface.ts diff --git a/v2/frontend/src/services/groupIndex/groupIndex.client.ts b/frontend/src/services/groupIndex/groupIndex.client.ts similarity index 100% rename from v2/frontend/src/services/groupIndex/groupIndex.client.ts rename to frontend/src/services/groupIndex/groupIndex.client.ts diff --git a/v2/frontend/src/services/groupIndex/mappers.ts b/frontend/src/services/groupIndex/mappers.ts similarity index 100% rename from v2/frontend/src/services/groupIndex/mappers.ts rename to frontend/src/services/groupIndex/mappers.ts diff --git a/v2/frontend/src/services/httpError.ts b/frontend/src/services/httpError.ts similarity index 100% rename from v2/frontend/src/services/httpError.ts rename to frontend/src/services/httpError.ts diff --git a/v2/frontend/src/services/ledger/candid/can.did b/frontend/src/services/ledger/candid/can.did similarity index 100% rename from v2/frontend/src/services/ledger/candid/can.did rename to frontend/src/services/ledger/candid/can.did diff --git a/v2/frontend/src/services/ledger/candid/idl.d.ts b/frontend/src/services/ledger/candid/idl.d.ts similarity index 100% rename from v2/frontend/src/services/ledger/candid/idl.d.ts rename to frontend/src/services/ledger/candid/idl.d.ts diff --git a/v2/frontend/src/services/ledger/candid/idl.js b/frontend/src/services/ledger/candid/idl.js similarity index 100% rename from v2/frontend/src/services/ledger/candid/idl.js rename to frontend/src/services/ledger/candid/idl.js diff --git a/v2/frontend/src/services/ledger/candid/types.ts b/frontend/src/services/ledger/candid/types.ts similarity index 100% rename from v2/frontend/src/services/ledger/candid/types.ts rename to frontend/src/services/ledger/candid/types.ts diff --git a/v2/frontend/src/services/ledger/ledger.client.interface.ts b/frontend/src/services/ledger/ledger.client.interface.ts similarity index 100% rename from v2/frontend/src/services/ledger/ledger.client.interface.ts rename to frontend/src/services/ledger/ledger.client.interface.ts diff --git a/v2/frontend/src/services/ledger/ledger.client.ts b/frontend/src/services/ledger/ledger.client.ts similarity index 100% rename from v2/frontend/src/services/ledger/ledger.client.ts rename to frontend/src/services/ledger/ledger.client.ts diff --git a/v2/frontend/src/services/notifications/candid/idl.d.ts b/frontend/src/services/notifications/candid/idl.d.ts similarity index 100% rename from v2/frontend/src/services/notifications/candid/idl.d.ts rename to frontend/src/services/notifications/candid/idl.d.ts diff --git a/v2/frontend/src/services/notifications/candid/idl.js b/frontend/src/services/notifications/candid/idl.js similarity index 100% rename from v2/frontend/src/services/notifications/candid/idl.js rename to frontend/src/services/notifications/candid/idl.js diff --git a/v2/frontend/src/services/notifications/candid/notification.d.ts b/frontend/src/services/notifications/candid/notification.d.ts similarity index 100% rename from v2/frontend/src/services/notifications/candid/notification.d.ts rename to frontend/src/services/notifications/candid/notification.d.ts diff --git a/v2/frontend/src/services/notifications/candid/notification.js b/frontend/src/services/notifications/candid/notification.js similarity index 100% rename from v2/frontend/src/services/notifications/candid/notification.js rename to frontend/src/services/notifications/candid/notification.js diff --git a/v2/frontend/src/services/notifications/candid/types.ts b/frontend/src/services/notifications/candid/types.ts similarity index 100% rename from v2/frontend/src/services/notifications/candid/types.ts rename to frontend/src/services/notifications/candid/types.ts diff --git a/v2/frontend/src/services/notifications/mappers.ts b/frontend/src/services/notifications/mappers.ts similarity index 100% rename from v2/frontend/src/services/notifications/mappers.ts rename to frontend/src/services/notifications/mappers.ts diff --git a/v2/frontend/src/services/notifications/notifications.client.interface.ts b/frontend/src/services/notifications/notifications.client.interface.ts similarity index 100% rename from v2/frontend/src/services/notifications/notifications.client.interface.ts rename to frontend/src/services/notifications/notifications.client.interface.ts diff --git a/v2/frontend/src/services/notifications/notifications.client.ts b/frontend/src/services/notifications/notifications.client.ts similarity index 100% rename from v2/frontend/src/services/notifications/notifications.client.ts rename to frontend/src/services/notifications/notifications.client.ts diff --git a/v2/frontend/src/services/online/candid/idl.d.ts b/frontend/src/services/online/candid/idl.d.ts similarity index 100% rename from v2/frontend/src/services/online/candid/idl.d.ts rename to frontend/src/services/online/candid/idl.d.ts diff --git a/v2/frontend/src/services/online/candid/idl.js b/frontend/src/services/online/candid/idl.js similarity index 100% rename from v2/frontend/src/services/online/candid/idl.js rename to frontend/src/services/online/candid/idl.js diff --git a/v2/frontend/src/services/online/candid/types.ts b/frontend/src/services/online/candid/types.ts similarity index 100% rename from v2/frontend/src/services/online/candid/types.ts rename to frontend/src/services/online/candid/types.ts diff --git a/v2/frontend/src/services/online/online.client.interface.ts b/frontend/src/services/online/online.client.interface.ts similarity index 100% rename from v2/frontend/src/services/online/online.client.interface.ts rename to frontend/src/services/online/online.client.interface.ts diff --git a/v2/frontend/src/services/online/online.client.ts b/frontend/src/services/online/online.client.ts similarity index 100% rename from v2/frontend/src/services/online/online.client.ts rename to frontend/src/services/online/online.client.ts diff --git a/v2/frontend/src/services/serviceContainer.ts b/frontend/src/services/serviceContainer.ts similarity index 100% rename from v2/frontend/src/services/serviceContainer.ts rename to frontend/src/services/serviceContainer.ts diff --git a/v2/frontend/src/services/user/candid/idl.d.ts b/frontend/src/services/user/candid/idl.d.ts similarity index 100% rename from v2/frontend/src/services/user/candid/idl.d.ts rename to frontend/src/services/user/candid/idl.d.ts diff --git a/v2/frontend/src/services/user/candid/idl.js b/frontend/src/services/user/candid/idl.js similarity index 100% rename from v2/frontend/src/services/user/candid/idl.js rename to frontend/src/services/user/candid/idl.js diff --git a/v2/frontend/src/services/user/candid/types.ts b/frontend/src/services/user/candid/types.ts similarity index 100% rename from v2/frontend/src/services/user/candid/types.ts rename to frontend/src/services/user/candid/types.ts diff --git a/v2/frontend/src/services/user/mappers.ts b/frontend/src/services/user/mappers.ts similarity index 100% rename from v2/frontend/src/services/user/mappers.ts rename to frontend/src/services/user/mappers.ts diff --git a/v2/frontend/src/services/user/user.caching.client.ts b/frontend/src/services/user/user.caching.client.ts similarity index 100% rename from v2/frontend/src/services/user/user.caching.client.ts rename to frontend/src/services/user/user.caching.client.ts diff --git a/v2/frontend/src/services/user/user.client.interface.ts b/frontend/src/services/user/user.client.interface.ts similarity index 100% rename from v2/frontend/src/services/user/user.client.interface.ts rename to frontend/src/services/user/user.client.interface.ts diff --git a/v2/frontend/src/services/user/user.client.ts b/frontend/src/services/user/user.client.ts similarity index 100% rename from v2/frontend/src/services/user/user.client.ts rename to frontend/src/services/user/user.client.ts diff --git a/v2/frontend/src/services/userIndex/candid/idl.d.ts b/frontend/src/services/userIndex/candid/idl.d.ts similarity index 100% rename from v2/frontend/src/services/userIndex/candid/idl.d.ts rename to frontend/src/services/userIndex/candid/idl.d.ts diff --git a/v2/frontend/src/services/userIndex/candid/idl.js b/frontend/src/services/userIndex/candid/idl.js similarity index 100% rename from v2/frontend/src/services/userIndex/candid/idl.js rename to frontend/src/services/userIndex/candid/idl.js diff --git a/v2/frontend/src/services/userIndex/candid/types.ts b/frontend/src/services/userIndex/candid/types.ts similarity index 100% rename from v2/frontend/src/services/userIndex/candid/types.ts rename to frontend/src/services/userIndex/candid/types.ts diff --git a/v2/frontend/src/services/userIndex/mappers.ts b/frontend/src/services/userIndex/mappers.ts similarity index 100% rename from v2/frontend/src/services/userIndex/mappers.ts rename to frontend/src/services/userIndex/mappers.ts diff --git a/v2/frontend/src/services/userIndex/userIndex.caching.client.ts b/frontend/src/services/userIndex/userIndex.caching.client.ts similarity index 100% rename from v2/frontend/src/services/userIndex/userIndex.caching.client.ts rename to frontend/src/services/userIndex/userIndex.caching.client.ts diff --git a/v2/frontend/src/services/userIndex/userIndex.client.interface.ts b/frontend/src/services/userIndex/userIndex.client.interface.ts similarity index 100% rename from v2/frontend/src/services/userIndex/userIndex.client.interface.ts rename to frontend/src/services/userIndex/userIndex.client.interface.ts diff --git a/v2/frontend/src/services/userIndex/userIndex.client.ts b/frontend/src/services/userIndex/userIndex.client.ts similarity index 100% rename from v2/frontend/src/services/userIndex/userIndex.client.ts rename to frontend/src/services/userIndex/userIndex.client.ts diff --git a/v2/frontend/src/stores/background.ts b/frontend/src/stores/background.ts similarity index 100% rename from v2/frontend/src/stores/background.ts rename to frontend/src/stores/background.ts diff --git a/v2/frontend/src/stores/blockedUsers.ts b/frontend/src/stores/blockedUsers.ts similarity index 100% rename from v2/frontend/src/stores/blockedUsers.ts rename to frontend/src/stores/blockedUsers.ts diff --git a/v2/frontend/src/stores/chat.ts b/frontend/src/stores/chat.ts similarity index 100% rename from v2/frontend/src/stores/chat.ts rename to frontend/src/stores/chat.ts diff --git a/v2/frontend/src/stores/draftMessages.ts b/frontend/src/stores/draftMessages.ts similarity index 100% rename from v2/frontend/src/stores/draftMessages.ts rename to frontend/src/stores/draftMessages.ts diff --git a/v2/frontend/src/stores/emoji.ts b/frontend/src/stores/emoji.ts similarity index 100% rename from v2/frontend/src/stores/emoji.ts rename to frontend/src/stores/emoji.ts diff --git a/v2/frontend/src/stores/iconSize.ts b/frontend/src/stores/iconSize.ts similarity index 100% rename from v2/frontend/src/stores/iconSize.ts rename to frontend/src/stores/iconSize.ts diff --git a/v2/frontend/src/stores/markRead.spec.ts b/frontend/src/stores/markRead.spec.ts similarity index 100% rename from v2/frontend/src/stores/markRead.spec.ts rename to frontend/src/stores/markRead.spec.ts diff --git a/v2/frontend/src/stores/markRead.ts b/frontend/src/stores/markRead.ts similarity index 100% rename from v2/frontend/src/stores/markRead.ts rename to frontend/src/stores/markRead.ts diff --git a/v2/frontend/src/stores/menu.ts b/frontend/src/stores/menu.ts similarity index 100% rename from v2/frontend/src/stores/menu.ts rename to frontend/src/stores/menu.ts diff --git a/v2/frontend/src/stores/nav.ts b/frontend/src/stores/nav.ts similarity index 100% rename from v2/frontend/src/stores/nav.ts rename to frontend/src/stores/nav.ts diff --git a/v2/frontend/src/stores/notifications.ts b/frontend/src/stores/notifications.ts similarity index 100% rename from v2/frontend/src/stores/notifications.ts rename to frontend/src/stores/notifications.ts diff --git a/v2/frontend/src/stores/rtl.ts b/frontend/src/stores/rtl.ts similarity index 100% rename from v2/frontend/src/stores/rtl.ts rename to frontend/src/stores/rtl.ts diff --git a/v2/frontend/src/stores/screenDimensions.ts b/frontend/src/stores/screenDimensions.ts similarity index 100% rename from v2/frontend/src/stores/screenDimensions.ts rename to frontend/src/stores/screenDimensions.ts diff --git a/v2/frontend/src/stores/setStore.ts b/frontend/src/stores/setStore.ts similarity index 100% rename from v2/frontend/src/stores/setStore.ts rename to frontend/src/stores/setStore.ts diff --git a/v2/frontend/src/stores/settings.ts b/frontend/src/stores/settings.ts similarity index 100% rename from v2/frontend/src/stores/settings.ts rename to frontend/src/stores/settings.ts diff --git a/v2/frontend/src/stores/storage.ts b/frontend/src/stores/storage.ts similarity index 100% rename from v2/frontend/src/stores/storage.ts rename to frontend/src/stores/storage.ts diff --git a/v2/frontend/src/stores/tilt.ts b/frontend/src/stores/tilt.ts similarity index 100% rename from v2/frontend/src/stores/tilt.ts rename to frontend/src/stores/tilt.ts diff --git a/v2/frontend/src/stores/time.ts b/frontend/src/stores/time.ts similarity index 100% rename from v2/frontend/src/stores/time.ts rename to frontend/src/stores/time.ts diff --git a/v2/frontend/src/stores/toast.ts b/frontend/src/stores/toast.ts similarity index 100% rename from v2/frontend/src/stores/toast.ts rename to frontend/src/stores/toast.ts diff --git a/v2/frontend/src/stores/typing.ts b/frontend/src/stores/typing.ts similarity index 100% rename from v2/frontend/src/stores/typing.ts rename to frontend/src/stores/typing.ts diff --git a/v2/frontend/src/stores/unconfirmed.ts b/frontend/src/stores/unconfirmed.ts similarity index 100% rename from v2/frontend/src/stores/unconfirmed.ts rename to frontend/src/stores/unconfirmed.ts diff --git a/v2/frontend/src/stores/user.spec.ts b/frontend/src/stores/user.spec.ts similarity index 100% rename from v2/frontend/src/stores/user.spec.ts rename to frontend/src/stores/user.spec.ts diff --git a/v2/frontend/src/stores/user.ts b/frontend/src/stores/user.ts similarity index 100% rename from v2/frontend/src/stores/user.ts rename to frontend/src/stores/user.ts diff --git a/v2/frontend/src/styles/mixins.scss b/frontend/src/styles/mixins.scss similarity index 100% rename from v2/frontend/src/styles/mixins.scss rename to frontend/src/styles/mixins.scss diff --git a/v2/frontend/src/sw/index.ts b/frontend/src/sw/index.ts similarity index 100% rename from v2/frontend/src/sw/index.ts rename to frontend/src/sw/index.ts diff --git a/v2/frontend/src/theme/dark.ts b/frontend/src/theme/dark.ts similarity index 100% rename from v2/frontend/src/theme/dark.ts rename to frontend/src/theme/dark.ts diff --git a/v2/frontend/src/theme/light.ts b/frontend/src/theme/light.ts similarity index 100% rename from v2/frontend/src/theme/light.ts rename to frontend/src/theme/light.ts diff --git a/v2/frontend/src/theme/original.ts b/frontend/src/theme/original.ts similarity index 100% rename from v2/frontend/src/theme/original.ts rename to frontend/src/theme/original.ts diff --git a/v2/frontend/src/theme/themes.ts b/frontend/src/theme/themes.ts similarity index 100% rename from v2/frontend/src/theme/themes.ts rename to frontend/src/theme/themes.ts diff --git a/v2/frontend/src/types.d.ts b/frontend/src/types.d.ts similarity index 100% rename from v2/frontend/src/types.d.ts rename to frontend/src/types.d.ts diff --git a/v2/frontend/src/utils/base64.ts b/frontend/src/utils/base64.ts similarity index 100% rename from v2/frontend/src/utils/base64.ts rename to frontend/src/utils/base64.ts diff --git a/v2/frontend/src/utils/blob.ts b/frontend/src/utils/blob.ts similarity index 100% rename from v2/frontend/src/utils/blob.ts rename to frontend/src/utils/blob.ts diff --git a/v2/frontend/src/utils/caching.ts b/frontend/src/utils/caching.ts similarity index 100% rename from v2/frontend/src/utils/caching.ts rename to frontend/src/utils/caching.ts diff --git a/v2/frontend/src/utils/date.ts b/frontend/src/utils/date.ts similarity index 100% rename from v2/frontend/src/utils/date.ts rename to frontend/src/utils/date.ts diff --git a/v2/frontend/src/utils/emojis.ts b/frontend/src/utils/emojis.ts similarity index 100% rename from v2/frontend/src/utils/emojis.ts rename to frontend/src/utils/emojis.ts diff --git a/v2/frontend/src/utils/error.ts b/frontend/src/utils/error.ts similarity index 100% rename from v2/frontend/src/utils/error.ts rename to frontend/src/utils/error.ts diff --git a/v2/frontend/src/utils/fileSize.ts b/frontend/src/utils/fileSize.ts similarity index 100% rename from v2/frontend/src/utils/fileSize.ts rename to frontend/src/utils/fileSize.ts diff --git a/v2/frontend/src/utils/layout.ts b/frontend/src/utils/layout.ts similarity index 100% rename from v2/frontend/src/utils/layout.ts rename to frontend/src/utils/layout.ts diff --git a/v2/frontend/src/utils/list.spec.ts b/frontend/src/utils/list.spec.ts similarity index 100% rename from v2/frontend/src/utils/list.spec.ts rename to frontend/src/utils/list.spec.ts diff --git a/v2/frontend/src/utils/list.ts b/frontend/src/utils/list.ts similarity index 100% rename from v2/frontend/src/utils/list.ts rename to frontend/src/utils/list.ts diff --git a/v2/frontend/src/utils/logging.ts b/frontend/src/utils/logging.ts similarity index 100% rename from v2/frontend/src/utils/logging.ts rename to frontend/src/utils/logging.ts diff --git a/v2/frontend/src/utils/mapping.ts b/frontend/src/utils/mapping.ts similarity index 100% rename from v2/frontend/src/utils/mapping.ts rename to frontend/src/utils/mapping.ts diff --git a/v2/frontend/src/utils/media.ts b/frontend/src/utils/media.ts similarity index 100% rename from v2/frontend/src/utils/media.ts rename to frontend/src/utils/media.ts diff --git a/v2/frontend/src/utils/mockutils.ts b/frontend/src/utils/mockutils.ts similarity index 100% rename from v2/frontend/src/utils/mockutils.ts rename to frontend/src/utils/mockutils.ts diff --git a/v2/frontend/src/utils/notifications.ts b/frontend/src/utils/notifications.ts similarity index 100% rename from v2/frontend/src/utils/notifications.ts rename to frontend/src/utils/notifications.ts diff --git a/v2/frontend/src/utils/remoteData.ts b/frontend/src/utils/remoteData.ts similarity index 100% rename from v2/frontend/src/utils/remoteData.ts rename to frontend/src/utils/remoteData.ts diff --git a/v2/frontend/src/utils/string.ts b/frontend/src/utils/string.ts similarity index 100% rename from v2/frontend/src/utils/string.ts rename to frontend/src/utils/string.ts diff --git a/v2/frontend/src/utils/transition.ts b/frontend/src/utils/transition.ts similarity index 100% rename from v2/frontend/src/utils/transition.ts rename to frontend/src/utils/transition.ts diff --git a/v2/frontend/src/utils/user.ts b/frontend/src/utils/user.ts similarity index 100% rename from v2/frontend/src/utils/user.ts rename to frontend/src/utils/user.ts diff --git a/v2/frontend/svelte.config.js b/frontend/svelte.config.js similarity index 100% rename from v2/frontend/svelte.config.js rename to frontend/svelte.config.js diff --git a/v2/frontend/tsconfig.json b/frontend/tsconfig.json similarity index 100% rename from v2/frontend/tsconfig.json rename to frontend/tsconfig.json diff --git a/future-architecture.md b/future-architecture.md deleted file mode 100644 index 2a5450ddba..0000000000 --- a/future-architecture.md +++ /dev/null @@ -1,48 +0,0 @@ -## Canisters - -### UserManagement - -- register_user -- lookup_users (query) - -### User - -- send_direct_message -- create_group_chat -- add_group_chat_participants -- remove_group_chat_participants -- mark_messages_as_read -- delete_webrtc_connection_details -- tag_message -- delete_message -- handle_direct_message -- handle_messages_marked_as_read -- handle_group_chat_updated -- handle_webrtc_connection_details -- get_messages (query) -- search_messages (query) -- get_updates (query) - -'get_updates' will internally get updated chats, WebRTC connection details and user details. -This will involve having to make inter-canister query calls. - -### GroupChat - -- send_message -- add_participants -- remove_participants -- mark_messages_as_read -- mark_inactive -- get_updates (query) - -Whilst a group chat is 'active', it will be polled by any participants who are -online. Once a group chat has had no activity for a certain period it will be -marked as 'inactive'. If an update is received by an 'inactive' group chat, it -will set its state to 'active' and push a message to each participant's -canister alerting them of the state change. - -### Data (OpenStorage?) - -- create_file -- put_chunk -- get_chunk (query) diff --git a/generate-wasm.sh b/generate-wasm.sh index 11900ac978..1bbbab34c2 100755 --- a/generate-wasm.sh +++ b/generate-wasm.sh @@ -1,3 +1,5 @@ +#!/bin/sh + echo Building package $1 cargo build --target wasm32-unknown-unknown --release --package $1 diff --git a/p2p.md b/p2p.md deleted file mode 100644 index ee2e550f82..0000000000 --- a/p2p.md +++ /dev/null @@ -1,26 +0,0 @@ -### To create a connection from User1 to User2 - -### User1 -- check that User2 is online -- create new RtcPeerConnection -- create a datachannel on the RtcPeerConnection -- create an offer -- wait for the ICE candidates to be resolved -- send offer containing the ICE candidates to the IC specifying that it is for User2 - -### User2 -- grab offer from User1 (polling every second via a query call) -- remove offer from IC (update call) (solely to clear up memory) -- create new RtcPeerConnection -- add the offer from User1 to the RtcPeerConnection -- once the offer has been added we store a ref to the datachannel included in the offer -- create an answer to User1's offer -- wait for the ICE candidates to be resolved -- send answer containing the ICE candidates to the IC specifying that it is for User1 - -### User1 -- grab answer from User2 (polling every second via a query call) -- remove answer from IC (update call) (solely to clear up memory) -- add the answer from User2 to the RtcPeerConnection - -At this point User1 and User2 can send messages p2p \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index d10538db07..0000000000 --- a/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "open_chat_assets", - "version": "0.1.0", - "description": "", - "keywords": [], - "scripts": { - "build": "webpack" - }, - "dependencies": { - "@dfinity/agent": "^0.9.0", - "@dfinity/auth-client": "^0.9.0", - "@dfinity/authentication": "^0.9.0", - "@dfinity/candid": "^0.9.1", - "@dfinity/identity": "^0.9.0", - "@dfinity/principal": "^0.9.1", - "@emotion/react": "^11.1.5", - "@emotion/styled": "^11.1.5", - "@material-ui/core": "5.0.0-alpha.26", - "@material-ui/icons": "5.0.0-alpha.26", - "@reduxjs/toolkit": "1.5.0", - "@types/async": "^3.2.5", - "@types/emoji-mart": "^3.0.4", - "@types/he": "^1.1.1", - "@types/identicon.js": "^2.3.0", - "@types/md5": "^2.2.1", - "@types/react": "17.0.0", - "@types/react-dom": "17.0.0", - "@types/react-redux": "^7.1.15", - "@types/reactstrap": "^8.7.2", - "@types/resize-observer-browser": "^0.1.5", - "@types/uuid": "^8.3.0", - "assert": "2.0.0", - "async": "^3.2.0", - "buffer": "6.0.3", - "clipboard-polyfill": "^3.0.3", - "copy-webpack-plugin": "^9.0.1", - "css-loader": "5.0.1", - "emoji-mart": "^3.0.0", - "events": "3.3.0", - "he": "^1.2.0", - "html-loader": "1.3.2", - "html-webpack-plugin": "5.3.1", - "identicon.js": "^2.3.3", - "immer": "^8.0.0", - "md5": "^2.3.0", - "process": "0.11.10", - "react": "16.9.0", - "react-dom": "16.9.0", - "react-modal-promise": "0.7.6", - "react-redux": "^7.2.2", - "redux-devtools-extension": "^2.13.8", - "redux-thunk": "^2.3.0", - "stream-browserify": "3.0.0", - "style-loader": "^2.0.0", - "svg-react-loader": "^0.4.6", - "terser-webpack-plugin": "5.1.1", - "ts-loader": "8.0.12", - "typescript": "4.3.5", - "util": "0.12.3", - "uuid": "^8.3.2", - "webpack": "5.24.4", - "webpack-cli": "4.5.0", - "workbox-core": "^6.1.1", - "workbox-expiration": "^6.1.1" - } -} diff --git a/v2/rust-toolchain.toml b/rust-toolchain.toml similarity index 100% rename from v2/rust-toolchain.toml rename to rust-toolchain.toml diff --git a/src/services/chats/Cargo.toml b/src/services/chats/Cargo.toml deleted file mode 100644 index bc694a909d..0000000000 --- a/src/services/chats/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "chats" -version = "0.1.0" -authors = ["Hamish Peebles ", "Matt Grogan "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -path = "src/lib.rs" -crate-type = ["cdylib"] - -[dependencies] -ic-cdk = "0.2.4" -ic-cdk-macros = "0.2.4" -itertools = "0.10.0" -enum_dispatch = "0.3.4" -range-set = "0.0.5" -serde = "1.0.111" -serde_bytes = "0.11.5" -shared = { path = "../shared", version = "0.1.0" } -smallvec = "0.6.14" diff --git a/src/services/chats/chats.did b/src/services/chats/chats.did deleted file mode 100644 index 918333ae69..0000000000 --- a/src/services/chats/chats.did +++ /dev/null @@ -1,332 +0,0 @@ -type UserId = principal; -type ChatId = nat; -type Timestamp = nat64; - -type CreateGroupChatRequest = - record { - chat_id: ChatId; - subject: text; - participants: vec UserId; - chat_history_visible_to_new_joiners: bool; - }; - -type CreateGroupChatResponse = - variant { - Success: GroupChatSummary; - ChatAlreadyExists; - SubjectTooShort: nat8; - SubjectTooLong: nat8; - TooManyParticipants: nat8; - }; - -type TextContent = - record { - text: text; - }; - -type MediaContent = - record { - caption: opt text; - mime_type: text; - width: nat32; - height: nat32; - blob_id: text; - blob_size: nat32; - chunk_size: nat32; - thumbnail_data: text; - blob_deleted: bool; - }; - -type FileContent = - record { - caption: opt text; - name: text; - mime_type: text; - blob_id: text; - blob_size: nat32; - chunk_size: nat32; - blob_deleted: bool; - }; - -type CyclesContent = - record { - amount: nat; - caption: opt text; - }; - -type MessageContent = - variant { - Text: TextContent; - Media: MediaContent; - File: FileContent; - Cycles: CyclesContent; - }; - -type SendDirectMessageRequest = - record { - recipient: UserId; - sender_name: opt text; - client_message_id: text; - content: MessageContent; - replies_to: opt ReplyContext; - }; - -type SendDirectMessageResult = - record { - chat_summary: DirectChatSummary; - message_id: nat32; - timestamp: Timestamp; - }; - -type SendDirectMessageResponse = - variant { - Success: SendDirectMessageResult; - UserNotFound; - RecipientNotFound; - BalanceExceeded; - MessageTooLong: nat32; - InvalidRequest; - SenderBlocked; - RecipientBlocked; - }; - -type SendMessageRequest = - record { - chat_id: ChatId; - sender_name: opt text; - client_message_id: text; - content: MessageContent; - replies_to: opt ReplyContext; - }; - -type SendMessageResult = - record { - chat_summary: ChatSummary; - message_id: nat32; - timestamp: Timestamp; - }; - -type SendMessageResponse = - variant { - Success: SendMessageResult; - ChatNotFound; - MessageTooLong: nat32; - InvalidRequest; - SenderBlocked; - RecipientBlocked; - }; - -type MarkReadResult = - record { - unread_message_id_ranges: vec vec nat32; - }; - -type MarkReadResponse = - variant { - Success: MarkReadResult; - ChatNotFound; - }; - -type AddParticipantsResponse = - variant { - Success: nat32; - PartialSuccess: record { - count_added: nat32; - blocked: vec UserId; - }; - Unauthorized; - ChatNotFound; - NotGroupChat; - }; - -type RemoveParticipantResponse = - variant { - Success; - Unauthorized; - ParticipantNotFound; - CannotRemoveSelfFromChat; - ChatNotFound; - NotGroupChat; - }; - -type LeaveGroupResponse = - variant { - Success; - ParticipantNotFound; - LastAdminCannotLeave; - ChatNotFound; - NotGroupChat; - }; - -type DeleteGroupResponse = - variant { - Success; - Unauthorized; - OnlyLastAdminCanDelete; - ChatNotFound; - NotGroupChat; - }; - -type JoinGroupResponse = - variant { - Success; - AlreadyInGroup; - UserLimitReached; - ChatNotFound; - NotGroupChat; - }; - -type GetChatsRequest = - record { - updated_since: opt Timestamp; - message_count_for_top_chat: opt nat16; - }; - -type GetUpdatesRequest = - record { - updated_since: opt Timestamp; - message_count_for_top_chat: opt nat16; - }; - -type ReplyContext = - record { - chat_id: ChatId; - user_id: UserId; - message_id: nat32; - content: MessageContent; - }; - -type Message = - record { - id: nat32; - client_message_id: text; - timestamp: Timestamp; - sender: UserId; - content: MessageContent; - replies_to: opt ReplyContext; - }; - -type ChatSummary = - variant { - Direct: DirectChatSummary; - Group: GroupChatSummary; - }; - -type DirectChatSummary = - record { - id: ChatId; - them: UserId; - display_date: Timestamp; - last_updated: Timestamp; - unread_by_me_message_id_ranges: vec vec nat32; - unread_by_them_message_id_ranges: vec vec nat32; - latest_messages: vec Message; - muted: bool; - }; - -type GroupChatSummary = - record { - id: ChatId; - subject: text; - display_date: Timestamp; - last_updated: Timestamp; - min_visible_message_id: nat32; - participants: vec UserId; - unread_by_me_message_id_ranges: vec vec nat32; - unread_by_any_message_id_ranges: vec vec nat32; - latest_messages: vec Message; - muted: bool; - }; - -type GetChatsResponse = - variant { - Success: vec ChatSummary; - }; - -type GetUpdatesResponse = - variant { - Success: GetUpdatesResult; - }; - -type GetUpdatesResult = - record { - chats: vec ChatSummary; - blocked_users: vec UserId; - }; - -type GetMessagesResult = - record { - messages: vec Message; - latest_message_id: nat32; - }; - -type GetMessagesResponse = - variant { - Success: GetMessagesResult; - ChatNotFound; - }; - -type GetMessagesByIdResponse = - variant { - Success: GetMessagesResult; - ChatNotFound; - }; - -type SearchAllMessagesResponse = - variant { - Success: SearchAllMessagesResult; - }; - -type SearchAllMessagesResult = - record { - matches: vec SearchMessagesMatch; - }; - -type SearchMessagesMatch = - record { - chat_id: ChatId; - message: Message; - }; - -type Stats = - record { - memory_used: nat64; - timestamp: nat64; - user_id: principal; - cycles_balance: int64; - chunk_count: nat32; - chunk_bytes: nat64; - direct_chat_count: nat32; - group_chat_count: nat32; - text_message_count: nat64; - image_message_count: nat64; - video_message_count: nat64; - file_message_count: nat64; - cycles_message_count: nat64; - cycles_transferred: nat; - pruneable_message_count: nat32; - }; - -service : { - create_group_chat: (CreateGroupChatRequest) -> (CreateGroupChatResponse); - send_direct_message: (SendDirectMessageRequest) -> (SendDirectMessageResponse); - send_message: (SendMessageRequest) -> (SendMessageResponse); - mark_read: (ChatId, nat32, nat32) -> (MarkReadResponse); - add_participants: (ChatId, vec UserId) -> (AddParticipantsResponse); - remove_participant: (ChatId, UserId) -> (RemoveParticipantResponse); - leave_group: (ChatId) -> (LeaveGroupResponse); - delete_group: (ChatId) -> (DeleteGroupResponse); - join_group: (ChatId) -> (JoinGroupResponse); - put_chunk: (text, nat32, vec nat8) -> (bool); - block_user: (UserId, bool) -> (); - toggle_notifications: (ChatId, bool) -> (); - - get_chats: (GetChatsRequest) -> (GetChatsResponse) query; - get_updates: (GetUpdatesRequest) -> (GetUpdatesResponse) query; - - get_messages: (ChatId, nat32, nat32) -> (GetMessagesResponse) query; - get_messages_by_id: (ChatId, vec nat32) -> (GetMessagesByIdResponse) query; - get_chunk: (text, nat32) -> (opt vec nat8) query; - search_all_messages: (text, nat8) -> (SearchAllMessagesResponse) query; - stats: () -> (Stats) query; -} \ No newline at end of file diff --git a/src/services/chats/src/api.rs b/src/services/chats/src/api.rs deleted file mode 100644 index fd2b084e20..0000000000 --- a/src/services/chats/src/api.rs +++ /dev/null @@ -1,109 +0,0 @@ -use crate::queries::*; -use crate::updates::*; -use ic_cdk_macros::*; -use serde_bytes::ByteBuf; -use shared::accept_cycles; -use shared::chat_id::ChatId; -use shared::user_id::UserId; - -#[update] -fn create_group_chat(request: create_group_chat::Request) -> create_group_chat::Response { - create_group_chat::update(request) -} - -#[update] -async fn send_direct_message( - request: send_direct_message::Request, -) -> send_direct_message::Response { - send_direct_message::update(request).await -} - -#[update] -fn send_message(request: send_message::Request) -> send_message::Response { - send_message::update(request) -} - -#[update] -fn mark_read(chat_id: ChatId, from_id: u32, to_id: u32) -> mark_read::Response { - mark_read::update(chat_id, from_id, to_id) -} - -#[update] -fn add_participants(chat_id: ChatId, users: Vec) -> add_participants::Response { - add_participants::update(chat_id, users) -} - -#[update] -fn remove_participant(chat_id: ChatId, user: UserId) -> remove_participant::Response { - remove_participant::update(chat_id, user) -} - -#[update] -fn leave_group(chat_id: ChatId) -> leave_group::Response { - leave_group::update(chat_id) -} - -#[update] -fn delete_group(chat_id: ChatId) -> delete_group::Response { - delete_group::update(chat_id) -} - -#[update] -fn join_group(chat_id: ChatId) -> join_group::Response { - join_group::update(chat_id) -} - -#[update] -fn put_chunk(blob_id: String, chunk_index: u32, data: ByteBuf) -> bool { - put_chunk::update(blob_id, chunk_index, data) -} - -#[update] -fn block_user(user: UserId, unblock: bool) { - block_user::update(user, unblock); -} - -#[update] -fn toggle_notifications(chat_id: ChatId, mute: bool) { - toggle_notifications::update(chat_id, mute); -} - -#[update] -fn wallet_receive() { - accept_cycles(); -} - -#[query] -fn get_chats(request: get_chats::Request) -> get_chats::Response { - get_chats::query(request) -} - -#[query] -fn get_updates(request: get_updates::Request) -> get_updates::Response { - get_updates::query(request) -} - -#[query] -fn get_messages(chat_id: ChatId, from_id: u32, page_size: u32) -> get_messages::Response { - get_messages::query(chat_id, from_id, page_size) -} - -#[query] -fn get_messages_by_id(chat_id: ChatId, ids: Vec) -> get_messages_by_id::Response { - get_messages_by_id::query(chat_id, ids) -} - -#[query] -fn get_chunk(blob_id: String, chunk_index: u32) -> Option { - get_chunk::query(blob_id, chunk_index) -} - -#[query] -fn search_all_messages(search_term: String, max_results: u8) -> search_all_messages::Response { - search_all_messages::query(&search_term, max_results) -} - -#[query] -fn stats() -> stats::Stats { - stats::query() -} diff --git a/src/services/chats/src/domain/blob_storage.rs b/src/services/chats/src/domain/blob_storage.rs deleted file mode 100644 index bc54523d55..0000000000 --- a/src/services/chats/src/domain/blob_storage.rs +++ /dev/null @@ -1,49 +0,0 @@ -use ic_cdk::export::candid::CandidType; -use serde::Deserialize; -use serde_bytes::ByteBuf; -use std::collections::HashMap; - -const MAX_CHUNK_SIZE: u32 = 1024 * 1024; // 1MB - -#[derive(Default, CandidType, Deserialize)] -pub struct BlobStorage { - chunks: HashMap<(String, u32), ByteBuf>, - total_bytes: u64, -} - -impl BlobStorage { - pub fn put_chunk(&mut self, blob_id: String, chunk_index: u32, data: ByteBuf) -> bool { - if data.len() > MAX_CHUNK_SIZE as usize { - return false; - } - let byte_count = data.len() as u64; - self.chunks.insert((blob_id, chunk_index), data); - self.total_bytes += byte_count; - true - } - - pub fn get_chunk(&self, blob_id: String, chunk_index: u32) -> Option<&ByteBuf> { - self.chunks.get(&(blob_id, chunk_index)) - } - - pub fn delete_blob(&mut self, blob_id: &str, blob_size: u32, chunk_size: u32) { - let num_indexes = ((blob_size - 1) / chunk_size) + 1; - for i in 0..num_indexes { - self.delete_chunk(blob_id, i); - } - } - - pub fn get_chunk_count(&self) -> u32 { - self.chunks.len() as u32 - } - - pub fn get_total_bytes(&self) -> u64 { - self.total_bytes - } - - fn delete_chunk(&mut self, blob_id: &str, chunk_index: u32) { - if let Some(chunk) = self.chunks.remove(&(blob_id.to_string(), chunk_index)) { - self.total_bytes -= chunk.len() as u64; - } - } -} diff --git a/src/services/chats/src/domain/blocked_users.rs b/src/services/chats/src/domain/blocked_users.rs deleted file mode 100644 index 183a039c1a..0000000000 --- a/src/services/chats/src/domain/blocked_users.rs +++ /dev/null @@ -1,70 +0,0 @@ -use ic_cdk::export::candid::CandidType; -use serde::Deserialize; -use shared::user_id::UserId; -use std::collections::hash_map::Entry::{Occupied, Vacant}; -use std::collections::{HashMap, HashSet}; - -#[derive(Default, CandidType, Deserialize)] -pub struct BlockedUsers { - map: HashMap>, -} - -impl BlockedUsers { - pub fn get(&self, user_id: &UserId) -> Vec { - match self.map.get(user_id) { - Some(hs) => hs.iter().cloned().collect(), - None => Vec::new(), - } - } - - pub fn block(&mut self, user: UserId, user_to_block: UserId) -> bool { - match self.map.entry(user) { - Occupied(e) => e.into_mut().insert(user_to_block), - Vacant(e) => { - let mut hs = HashSet::new(); - hs.insert(user_to_block); - e.insert(hs); - true - } - } - } - - pub fn unblock(&mut self, user: &UserId, user_to_unblock: &UserId) -> bool { - if let Some(hs) = self.map.get_mut(user) { - let result = hs.remove(user_to_unblock); - if hs.is_empty() { - self.map.remove(user); - } - result - } else { - false - } - } - - pub fn blocked_status(&self, sender: &UserId, recipient: &UserId) -> BlockedStatus { - let recipient_blocked = match self.map.get(sender) { - Some(hs) => hs.contains(recipient), - None => false, - }; - - let sender_blocked = match self.map.get(recipient) { - Some(hs) => hs.contains(sender), - None => false, - }; - - match (recipient_blocked, sender_blocked) { - (false, false) => BlockedStatus::Unblocked, - (false, true) => BlockedStatus::Sender, - (true, false) => BlockedStatus::Recipient, - (true, true) => BlockedStatus::Both, - } - } -} - -#[derive(PartialEq)] -pub enum BlockedStatus { - Unblocked, - Sender, - Recipient, - Both, -} diff --git a/src/services/chats/src/domain/chat.rs b/src/services/chats/src/domain/chat.rs deleted file mode 100644 index 613caf519a..0000000000 --- a/src/services/chats/src/domain/chat.rs +++ /dev/null @@ -1,326 +0,0 @@ -use self::MessageContentValidationResponse::*; -use crate::domain::blob_storage::BlobStorage; -use crate::domain::direct_chat::{DirectChat, DirectChatStableState, DirectChatSummary}; -use crate::domain::group_chat::{GroupChat, GroupChatStableState, GroupChatSummary}; -use enum_dispatch::enum_dispatch; -use ic_cdk::export::candid::CandidType; -use serde::{Deserialize, Serialize}; -use shared::chat_id::ChatId; -use shared::timestamp::Timestamp; -use shared::user_id::UserId; - -#[enum_dispatch(Chat)] -pub enum ChatEnum { - Direct(DirectChat), - Group(GroupChat), -} - -#[enum_dispatch] -pub trait Chat { - fn get_id(&self) -> ChatId; - fn involves_user(&self, user: &UserId) -> bool; - fn push_message( - &mut self, - sender: &UserId, - client_message_id: String, - content: MessageContent, - replies_to: Option, - now: Timestamp, - ) -> Message; - fn get_messages(&self, user: &UserId, from_id: u32, page_size: u32) -> Vec; - fn get_messages_by_id(&self, user: &UserId, ids: Vec) -> Vec; - fn get_message_mut(&mut self, id: u32) -> Option<&mut Message>; - fn get_latest_message_id(&self) -> u32; - fn search_messages(&self, search_term: &str, user: &UserId) -> Vec; - fn mark_read( - &mut self, - user: &UserId, - from_id: u32, - to_id: u32, - now: Timestamp, - ) -> MarkReadResult; - fn mute_notifications(&mut self, user_id: UserId, mute: bool); - fn get_unread_message_id_ranges(&self, user: &UserId) -> Vec<[u32; 2]>; - fn get_display_date(&self, user_id: &UserId) -> Timestamp; - fn get_updated_date(&self) -> Timestamp; - fn to_summary(&self, user: &UserId, message_count: u32) -> ChatSummary; -} - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub struct TextContent { - text: String, -} - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub struct MediaContent { - caption: Option, - mime_type: String, - width: u32, - height: u32, - blob_id: String, - blob_size: u32, - chunk_size: u32, - thumbnail_data: String, - blob_deleted: bool, -} - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub struct FileContent { - caption: Option, - name: String, - mime_type: String, - blob_id: String, - blob_size: u32, - chunk_size: u32, - blob_deleted: bool, -} - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub struct CycleContent { - amount: u128, - caption: Option, -} - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub enum MessageContent { - Text(TextContent), - Media(MediaContent), - File(FileContent), - Cycles(CycleContent), -} - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub enum MessageContentType { - Text, - Image, - Video, - File, - Cycles, -} - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub struct Message { - id: u32, - client_message_id: String, - timestamp: Timestamp, - sender: UserId, - content: MessageContent, - replies_to: Option, -} - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub struct ReplyContext { - chat_id: ChatId, - user_id: UserId, - message_id: u32, - content: MessageContent, -} - -#[derive(CandidType)] -pub enum ChatSummary { - Direct(DirectChatSummary), - Group(GroupChatSummary), -} - -#[derive(CandidType)] -pub struct MarkReadResult { - unread_message_id_ranges: Vec<[u32; 2]>, -} - -#[derive(CandidType, Deserialize)] -pub enum ChatStableState { - Direct(DirectChatStableState), - Group(GroupChatStableState), -} - -impl ChatSummary { - pub fn direct(self) -> Option { - if let ChatSummary::Direct(d) = self { - Some(d) - } else { - None - } - } -} - -impl Message { - pub fn new( - id: u32, - client_message_id: String, - now: Timestamp, - sender: UserId, - content: MessageContent, - replies_to: Option, - ) -> Message { - Message { - id, - client_message_id, - timestamp: now, - sender, - content, - replies_to, - } - } - - pub fn get_id(&self) -> u32 { - self.id - } - - pub fn get_timestamp(&self) -> Timestamp { - self.timestamp - } - - pub fn matches_search(&self, search_term: &str) -> bool { - fn text_matches(text: &Option, search_term: &str) -> bool { - text.is_some() && text.as_ref().unwrap().to_lowercase().contains(search_term) - } - - let search_term = &search_term.to_lowercase(); - match &self.content { - MessageContent::Text(t) => t.text.to_lowercase().contains(search_term), - MessageContent::Media(m) => text_matches(&m.caption, search_term), - MessageContent::File(f) => { - text_matches(&f.caption, search_term) || f.name.to_lowercase().contains(search_term) - } - MessageContent::Cycles(c) => text_matches(&c.caption, search_term), - } - } - - pub fn delete_blob_content(&mut self, blob_storage: &mut BlobStorage) { - match &mut self.content { - MessageContent::File(file) => { - blob_storage.delete_blob(&file.blob_id, file.blob_size, file.chunk_size); - file.blob_deleted = true; - } - MessageContent::Media(media) => { - blob_storage.delete_blob(&media.blob_id, media.blob_size, media.chunk_size); - media.blob_deleted = true; - } - _ => (), - } - } -} - -impl MessageContent { - pub fn is_blob(&self) -> bool { - matches!(self, MessageContent::File(_) | MessageContent::Media(_)) - } - - pub fn validate(&self) -> MessageContentValidationResponse { - const MAX_MESSAGE_LEN: u32 = 5000; - const MAX_CAPTION_LEN: u32 = 500; - const MAX_MIME_TYPE_LEN: u16 = 255; - const MAX_BLOB_ID_LEN: u16 = 100; - const MAX_THUMBNAIL_LEN: u16 = 5000; - - match self { - MessageContent::Text(text) => { - if text.text.len() > MAX_MESSAGE_LEN as usize { - return MessageTooLong(MAX_MESSAGE_LEN); - } - } - MessageContent::Media(media) => { - if media.mime_type.len() > MAX_MIME_TYPE_LEN as usize - || media.blob_id.len() > MAX_BLOB_ID_LEN as usize - || media.thumbnail_data.len() > MAX_THUMBNAIL_LEN as usize - { - return Invalid; - } - if let Some(caption) = &media.caption { - if caption.len() > MAX_CAPTION_LEN as usize { - return MessageTooLong(MAX_CAPTION_LEN); - } - } - } - MessageContent::File(file) => { - if file.mime_type.len() > MAX_MIME_TYPE_LEN as usize - || file.blob_id.len() > MAX_BLOB_ID_LEN as usize - { - return Invalid; - } - if let Some(caption) = &file.caption { - if caption.len() > MAX_CAPTION_LEN as usize { - return MessageTooLong(MAX_CAPTION_LEN); - } - } - } - MessageContent::Cycles(cycles) => { - if let Some(caption) = &cycles.caption { - if caption.len() > MAX_CAPTION_LEN as usize { - return MessageTooLong(MAX_CAPTION_LEN); - } - } - } - }; - - Valid - } - - pub fn get_type(&self) -> MessageContentType { - match self { - MessageContent::Text(_) => MessageContentType::Text, - MessageContent::Media(m) => { - if m.mime_type.to_lowercase().starts_with("video/") { - MessageContentType::Video - } else { - MessageContentType::Image - } - } - MessageContent::File(_) => MessageContentType::File, - MessageContent::Cycles(_) => MessageContentType::Cycles, - } - } -} - -pub enum MessageContentValidationResponse { - Valid, - MessageTooLong(u32), - Invalid, -} - -impl MarkReadResult { - pub fn new(unread_message_id_ranges: Vec<[u32; 2]>) -> MarkReadResult { - MarkReadResult { - unread_message_id_ranges, - } - } -} - -impl ChatStableState { - pub fn get_id(&self) -> ChatId { - match self { - ChatStableState::Direct(c) => c.get_id(), - ChatStableState::Group(c) => c.get_id(), - } - } -} - -impl From for ChatEnum { - fn from(chat: ChatStableState) -> Self { - match chat { - ChatStableState::Direct(c) => ChatEnum::Direct(c.into()), - ChatStableState::Group(c) => ChatEnum::Group(c.into()), - } - } -} - -impl From for ChatStableState { - fn from(chat: ChatEnum) -> Self { - match chat { - ChatEnum::Direct(c) => ChatStableState::Direct(c.into()), - ChatEnum::Group(c) => ChatStableState::Group(c.into()), - } - } -} - -impl CycleContent { - pub fn get_amount(&self) -> u128 { - self.amount - } -} - -impl ReplyContext { - pub fn get_content(&self) -> &MessageContent { - &self.content - } -} diff --git a/src/services/chats/src/domain/chat_list.rs b/src/services/chats/src/domain/chat_list.rs deleted file mode 100644 index 7fac3a729b..0000000000 --- a/src/services/chats/src/domain/chat_list.rs +++ /dev/null @@ -1,309 +0,0 @@ -use super::chat::{Chat, ChatEnum, ChatSummary, MessageContent}; -use super::direct_chat::DirectChat; -use super::group_chat::GroupChat; -use crate::domain::blob_storage::BlobStorage; -use crate::domain::chat::Message; -use crate::domain::chat::{ChatStableState, MessageContentType, ReplyContext}; -use crate::domain::group_chat::GroupChatSummary; -use crate::domain::user_to_chats_map::UserToChatsMap; -use core::cmp::min; -use core::ops::RangeTo; -use ic_cdk::export::candid::CandidType; -use serde::Deserialize; -use shared::chat_id::ChatId; -use shared::storage::StableState; -use shared::timestamp::Timestamp; -use shared::user_id::UserId; -use std::collections::VecDeque; -use std::collections::{ - hash_map::Entry::{Occupied, Vacant}, - HashMap, -}; - -#[derive(Default)] -pub struct ChatList { - chats: HashMap, - user_to_chats_map: UserToChatsMap, - messages_to_prune: VecDeque<(ChatId, u32)>, - stats: Stats, -} - -#[derive(CandidType, Deserialize)] -pub struct ChatListState { - chats: Vec, - messages_to_prune: Vec<(ChatId, u32)>, - stats: Stats, -} - -#[derive(Clone, Default, CandidType, Deserialize)] -pub struct Stats { - pub direct_chat_count: u32, - pub group_chat_count: u32, - pub text_message_count: u64, - pub image_message_count: u64, - pub video_message_count: u64, - pub file_message_count: u64, - pub cycles_message_count: u64, - pub cycles_transferred: u128, - pub pruneable_message_count: u32, -} - -impl ChatList { - pub fn create_direct_chat( - &mut self, - chat_id: ChatId, - sender: UserId, - recipient: UserId, - now: Timestamp, - ) { - let chat = DirectChat::new(chat_id, sender, recipient, now); - let chat_enum = ChatEnum::Direct(chat); - self.chats.insert(chat_id, chat_enum); - self.user_to_chats_map.link_chat_to_user(chat_id, sender); - self.user_to_chats_map.link_chat_to_user(chat_id, recipient); - self.stats.direct_chat_count += 1; - } - - pub fn create_group_chat( - &mut self, - creator: UserId, - chat_id: ChatId, - subject: String, - participants: Vec, - chat_history_visible_to_new_joiners: bool, - now: Timestamp, - ) -> Option { - match self.chats.entry(chat_id) { - Occupied(_) => None, - Vacant(e) => { - self.user_to_chats_map.link_chat_to_user(chat_id, creator); - for p in participants.iter() { - self.user_to_chats_map.link_chat_to_user(chat_id, *p); - } - - let chat = GroupChat::new( - chat_id, - subject, - creator, - participants, - chat_history_visible_to_new_joiners, - now, - ); - let chat_summary = GroupChatSummary::new(&chat, &creator, 0); - - e.insert(ChatEnum::Group(chat)); - self.stats.group_chat_count += 1; - Some(chat_summary) - } - } - } - - pub fn get(&self, chat_id: ChatId, me: &UserId) -> Option<&ChatEnum> { - let chat = self.chats.get(&chat_id)?; - if !chat.involves_user(me) { - return None; - } - Some(chat) - } - - pub fn get_mut(&mut self, chat_id: ChatId, me: &UserId) -> Option<&mut ChatEnum> { - let chat = self.chats.get_mut(&chat_id)?; - if !chat.involves_user(me) { - return None; - } - Some(chat) - } - - pub fn get_unchecked_mut(&mut self, chat_id: ChatId) -> Option<&mut ChatEnum> { - self.chats.get_mut(&chat_id) - } - - pub fn get_all(&self, me: &UserId) -> Vec<&ChatEnum> { - if let Some(chats) = self.user_to_chats_map.get_chats(me) { - chats.iter().filter_map(|c| self.chats.get(c)).collect() - } else { - Vec::new() - } - } - - pub fn get_summaries( - &self, - user: &UserId, - updated_since: Option, - message_count_for_top_chat: Option, - ) -> Vec { - let top_message_count = match message_count_for_top_chat { - Some(c) => c as u32, - None => 1, - }; - - let mut list: Vec<_> = self - .get_all(user) - .into_iter() - .filter(|chat| { - updated_since.is_none() || chat.get_updated_date() > updated_since.unwrap() - }) - .collect(); - - list.sort_unstable_by(|c1, c2| { - let t1 = c1.get_display_date(user); - let t2 = c2.get_display_date(user); - t2.cmp(&t1) - }); - - list.iter() - .enumerate() - .map(|(i, chat)| chat.to_summary(user, if i == 0 { top_message_count } else { 1 })) - .collect() - } - - pub fn delete_chat(&mut self, chat_id: ChatId) { - if let Some(chat) = self.chats.remove(&chat_id) { - match chat { - ChatEnum::Direct(c) => { - let [user1, user2] = c.get_participants(); - self.user_to_chats_map - .unlink_chat_from_user(&chat_id, user1); - self.user_to_chats_map - .unlink_chat_from_user(&chat_id, user2); - self.stats.direct_chat_count -= 1; - } - ChatEnum::Group(c) => { - for p in c.iter_participants() { - self.user_to_chats_map.unlink_chat_from_user(&chat_id, p); - } - self.stats.group_chat_count -= 1 - } - } - } - } - - pub fn push_message( - &mut self, - chat_id: ChatId, - me: &UserId, - client_message_id: String, - content: MessageContent, - replies_to: Option, - now: Timestamp, - ) -> Option { - self.add_message_to_stats(&content); - - match self.get_mut(chat_id, me) { - Some(chat) => { - let is_blob = content.is_blob(); - let message = chat.push_message(me, client_message_id, content, replies_to, now); - let message_id = message.get_id(); - - if is_blob { - self.messages_to_prune.push_back((chat_id, message_id)); - self.stats.pruneable_message_count += 1; - } - - Some(message) - } - None => None, - } - } - - pub fn prune_messages(&mut self, blob_storage: &mut BlobStorage) { - const MEMORY_LIMIT_BYTES: u64 = 1024 * 1024 * 1024; // 1GB - if blob_storage.get_total_bytes() <= MEMORY_LIMIT_BYTES { - return; - } - - const PRUNE_MESSAGES_COUNT: u32 = 20; - let count_to_prune = min(PRUNE_MESSAGES_COUNT, self.messages_to_prune.len() as u32); - - if count_to_prune > 0 { - let messages: Vec<_> = self - .messages_to_prune - .drain(RangeTo { - end: count_to_prune as usize, - }) - .collect(); - - for (chat_id, message_id) in messages { - if let Some(chat) = self.chats.get_mut(&chat_id) { - if let Some(message) = chat.get_message_mut(message_id) { - message.delete_blob_content(blob_storage); - } - } - } - - self.stats.pruneable_message_count -= count_to_prune; - } - } - - pub fn link_chat_to_user(&mut self, chat_id: ChatId, user_id: UserId) { - self.user_to_chats_map.link_chat_to_user(chat_id, user_id); - } - - pub fn unlink_chat_from_user(&mut self, chat_id: &ChatId, user_id: &UserId) { - self.user_to_chats_map - .unlink_chat_from_user(chat_id, user_id); - } - - pub fn get_stats(&self) -> Stats { - self.stats.clone() - } - - fn add_message_to_stats(&mut self, content: &MessageContent) { - match content.get_type() { - MessageContentType::Text => self.stats.text_message_count += 1, - MessageContentType::Image => self.stats.image_message_count += 1, - MessageContentType::Video => self.stats.video_message_count += 1, - MessageContentType::File => self.stats.file_message_count += 1, - MessageContentType::Cycles => { - self.stats.cycles_message_count += 1; - if let MessageContent::Cycles(c) = content { - self.stats.cycles_transferred += c.get_amount(); - } - } - } - } -} - -impl StableState for ChatList { - type State = ChatListState; - - fn drain(self) -> ChatListState { - let chats: Vec = self.chats.into_iter().map(|(_, c)| c.into()).collect(); - let messages_to_prune: Vec<(ChatId, u32)> = self.messages_to_prune.into_iter().collect(); - ChatListState { - chats, - messages_to_prune, - stats: self.stats, - } - } - - fn fill(state: ChatListState) -> ChatList { - let mut chats_map: HashMap = HashMap::new(); - let mut user_to_chats_map: UserToChatsMap = UserToChatsMap::default(); - for c in state.chats.into_iter() { - let chat_id = c.get_id(); - match &c { - ChatStableState::Direct(c) => { - let [user1, user2] = c.get_participants(); - user_to_chats_map.link_chat_to_user(chat_id, *user1); - user_to_chats_map.link_chat_to_user(chat_id, *user2); - } - ChatStableState::Group(c) => { - for p in c.iter_participants() { - user_to_chats_map.link_chat_to_user(chat_id, *p); - } - } - } - chats_map.insert(chat_id, c.into()); - } - let messages_to_prune_deque: VecDeque<(ChatId, u32)> = - state.messages_to_prune.into_iter().collect(); - - ChatList { - chats: chats_map, - user_to_chats_map, - messages_to_prune: messages_to_prune_deque, - stats: state.stats, - } - } -} diff --git a/src/services/chats/src/domain/direct_chat.rs b/src/services/chats/src/domain/direct_chat.rs deleted file mode 100644 index 60f0984723..0000000000 --- a/src/services/chats/src/domain/direct_chat.rs +++ /dev/null @@ -1,266 +0,0 @@ -use super::chat::*; -use super::messages::*; -use crate::utils; -use ic_cdk::export::candid::CandidType; -use range_set::RangeSet; -use serde::Deserialize; -use shared::chat_id::ChatId; -use shared::timestamp::Timestamp; -use shared::user_id::UserId; -use std::ops::RangeInclusive; - -pub struct DirectChat { - id: ChatId, - user1: UserId, - user2: UserId, - user1_unread_message_ids: RangeSet<[RangeInclusive; 2]>, - user2_unread_message_ids: RangeSet<[RangeInclusive; 2]>, - messages: Vec, - last_updated: Timestamp, - user1_muted: bool, - user2_muted: bool, -} - -#[derive(CandidType)] -pub struct DirectChatSummary { - id: ChatId, - them: UserId, - display_date: Timestamp, - last_updated: Timestamp, - unread_by_me_message_id_ranges: Vec<[u32; 2]>, - unread_by_them_message_id_ranges: Vec<[u32; 2]>, - latest_messages: Vec, - muted: bool, -} - -#[derive(CandidType, Deserialize)] -pub struct DirectChatStableState { - id: ChatId, - user1: UserId, - user2: UserId, - user1_unread_message_id_ranges: Vec<[u32; 2]>, - user2_unread_message_id_ranges: Vec<[u32; 2]>, - messages: Vec, - last_updated: Timestamp, - user1_muted: bool, - user2_muted: bool, -} - -impl DirectChat { - pub fn new(id: ChatId, sender: UserId, recipient: UserId, now: Timestamp) -> DirectChat { - DirectChat { - id, - user1: sender, - user2: recipient, - user1_unread_message_ids: RangeSet::new(), - user2_unread_message_ids: RangeSet::new(), - messages: vec![], - last_updated: now, - user1_muted: false, - user2_muted: false, - } - } - - pub fn get_participants(&self) -> [&UserId; 2] { - [&self.user1, &self.user2] - } - - pub fn get_other(&self, me: &UserId) -> &UserId { - if *me == self.user1 { - &self.user2 - } else { - &self.user1 - } - } - - pub fn notifications_muted(&self, user_id: UserId) -> bool { - if user_id == self.user1 { - self.user1_muted - } else if user_id == self.user2 { - self.user2_muted - } else { - true - } - } -} - -impl Chat for DirectChat { - fn get_id(&self) -> ChatId { - self.id - } - - fn involves_user(&self, user: &UserId) -> bool { - self.user1 == *user || self.user2 == *user - } - - fn push_message( - &mut self, - sender: &UserId, - client_message_id: String, - content: MessageContent, - replies_to: Option, - now: Timestamp, - ) -> Message { - let id = match self.messages.last() { - Some(message) => message.get_id() + 1, - None => 1, - }; - - let message = Message::new(id, client_message_id, now, *sender, content, replies_to); - - self.messages.push(message.clone()); - - if sender == &self.user1 { - self.user2_unread_message_ids.insert(id); - } else { - self.user1_unread_message_ids.insert(id); - } - - self.last_updated = now; - - message - } - - fn get_messages(&self, _user: &UserId, from_id: u32, page_size: u32) -> Vec { - get_messages(&self.messages, from_id, page_size, 1) - } - - fn get_messages_by_id(&self, _user: &UserId, ids: Vec) -> Vec { - get_messages_by_id(&self.messages, ids, 1) - } - - fn get_message_mut(&mut self, id: u32) -> Option<&mut Message> { - self.messages.get_mut((id - 1) as usize) - } - - fn get_latest_message_id(&self) -> u32 { - get_latest_message_id(&self.messages) - } - - fn search_messages(&self, search_term: &str, _user: &UserId) -> Vec { - search_messages(self.messages.as_slice(), search_term) - } - - fn mark_read( - &mut self, - me: &UserId, - from_id: u32, - to_id: u32, - now: Timestamp, - ) -> MarkReadResult { - let unread_message_ids: RangeSet<[RangeInclusive; 2]>; - if *me == self.user1 { - self.user1_unread_message_ids.remove_range(from_id..=to_id); - unread_message_ids = self.user1_unread_message_ids.clone(); - } else { - self.user2_unread_message_ids.remove_range(from_id..=to_id); - unread_message_ids = self.user2_unread_message_ids.clone(); - }; - - self.last_updated = now; - - MarkReadResult::new(utils::range_set_to_vec(unread_message_ids)) - } - - fn mute_notifications(&mut self, user_id: UserId, mute: bool) { - if user_id == self.user1 { - self.user1_muted = mute; - } else if user_id == self.user2 { - self.user2_muted = mute; - } - } - - fn get_unread_message_id_ranges(&self, user_id: &UserId) -> Vec<[u32; 2]> { - let is_user1 = *user_id == self.user1; - let unread_message_ids = if is_user1 { - &self.user1_unread_message_ids - } else { - &self.user2_unread_message_ids - }; - - utils::range_set_to_vec(unread_message_ids.clone()) - } - - fn get_display_date(&self, _user_id: &UserId) -> Timestamp { - let latest_message = self.messages.last().unwrap(); - latest_message.get_timestamp() - } - - fn get_updated_date(&self) -> Timestamp { - self.last_updated - } - - fn to_summary(&self, me: &UserId, message_count: u32) -> ChatSummary { - ChatSummary::Direct(DirectChatSummary::new(self, me, message_count)) - } -} - -impl DirectChatSummary { - pub fn new(chat: &DirectChat, me: &UserId, message_count: u32) -> DirectChatSummary { - let is_user1 = *me == chat.user1; - let them = if is_user1 { chat.user2 } else { chat.user1 }; - let unread_by_me_message_id_ranges = chat.get_unread_message_id_ranges(me); - let unread_by_them_message_id_ranges = chat.get_unread_message_id_ranges(&them); - - let latest_messages = chat - .messages - .iter() - .rev() - .take(message_count as usize) - .cloned() - .collect(); - - DirectChatSummary { - id: chat.id, - them, - display_date: chat.get_display_date(me), - last_updated: chat.last_updated, - unread_by_me_message_id_ranges, - unread_by_them_message_id_ranges, - latest_messages, - muted: chat.notifications_muted(*me), - } - } -} - -impl DirectChatStableState { - pub fn get_id(&self) -> ChatId { - self.id - } - - pub fn get_participants(&self) -> [&UserId; 2] { - [&self.user1, &self.user2] - } -} - -impl From for DirectChatStableState { - fn from(chat: DirectChat) -> Self { - DirectChatStableState { - id: chat.id, - user1: chat.user1, - user2: chat.user2, - user1_unread_message_id_ranges: utils::range_set_to_vec(chat.user1_unread_message_ids), - user2_unread_message_id_ranges: utils::range_set_to_vec(chat.user2_unread_message_ids), - messages: chat.messages, - last_updated: chat.last_updated, - user1_muted: chat.user1_muted, - user2_muted: chat.user2_muted, - } - } -} - -impl From for DirectChat { - fn from(chat: DirectChatStableState) -> Self { - DirectChat { - id: chat.id, - user1: chat.user1, - user2: chat.user2, - user1_unread_message_ids: utils::vec_to_range_set(chat.user1_unread_message_id_ranges), - user2_unread_message_ids: utils::vec_to_range_set(chat.user2_unread_message_id_ranges), - messages: chat.messages, - last_updated: chat.last_updated, - user1_muted: chat.user1_muted, - user2_muted: chat.user2_muted, - } - } -} diff --git a/src/services/chats/src/domain/group_chat.rs b/src/services/chats/src/domain/group_chat.rs deleted file mode 100644 index b86942ce7d..0000000000 --- a/src/services/chats/src/domain/group_chat.rs +++ /dev/null @@ -1,458 +0,0 @@ -use super::chat::*; -use super::messages::*; -use crate::utils; -use ic_cdk::export::candid::CandidType; -use range_set::RangeSet; -use serde::Deserialize; -use shared::chat_id::ChatId; -use shared::timestamp::Timestamp; -use shared::user_id::UserId; -use std::cmp::max; -use std::ops::RangeInclusive; - -pub struct GroupChat { - id: ChatId, - subject: String, - description: Option, - participants: Vec, - messages: Vec, - chat_history_visible_to_new_joiners: bool, - last_updated: Timestamp, -} - -pub struct Participant { - user_id: UserId, - admin: bool, - date_added: Timestamp, - min_visible_message_id: u32, - unread_message_ids: RangeSet<[RangeInclusive; 2]>, - notifications_muted: bool, -} - -#[derive(CandidType)] -pub struct GroupChatSummary { - id: ChatId, - subject: String, - display_date: Timestamp, - last_updated: Timestamp, - chat_history_visible_to_new_joiners: bool, - min_visible_message_id: u32, - participants: Vec, - unread_by_me_message_id_ranges: Vec<[u32; 2]>, - unread_by_any_message_id_ranges: Vec<[u32; 2]>, - latest_messages: Vec, - muted: bool, -} - -#[derive(CandidType, Deserialize)] -pub struct GroupChatStableState { - id: ChatId, - subject: String, - description: Option, - participants: Vec, - messages: Vec, - chat_history_visible_to_new_joiners: Option, - last_updated: Timestamp, -} - -#[derive(CandidType, Deserialize)] -pub struct ParticipantStableState { - user_id: UserId, - admin: bool, - date_added: Timestamp, - min_visible_message_id: u32, - unread_message_ids: Vec<[u32; 2]>, - notifications_muted: bool, -} - -impl GroupChat { - pub fn new( - id: ChatId, - subject: String, - creator: UserId, - participants: Vec, - chat_history_visible_to_new_joiners: bool, - now: Timestamp, - ) -> GroupChat { - let mut all_participants = Vec::with_capacity(participants.len() + 1); - all_participants.push(Participant::new(creator, true, 1, now)); - for p in participants { - all_participants.push(Participant::new(p, true, 1, now)) - } - - GroupChat { - id, - subject, - description: None, - participants: all_participants, - messages: Vec::new(), - chat_history_visible_to_new_joiners, - last_updated: now, - } - } - - pub fn add_participant(&mut self, user_to_add: UserId, now: Timestamp) -> bool { - if self.find_participant(&user_to_add).is_some() { - false - } else { - self.participants.push(Participant::new( - user_to_add, - true, - self.get_latest_message_id() + 1, - now, - )); - self.last_updated = now; - true - } - } - - pub fn remove_participant(&mut self, user_to_remove: &UserId, now: Timestamp) -> bool { - let original_count = self.participants.len(); - self.participants.retain(|p| p.user_id != *user_to_remove); - let new_count = self.participants.len(); - self.last_updated = now; - new_count < original_count - } - - pub fn get_min_visible_message_id(&self, user: &UserId) -> u32 { - if self.chat_history_visible_to_new_joiners { - 1 - } else { - self.find_participant(user).unwrap().min_visible_message_id - } - } - - pub fn is_admin(&self, user: &UserId) -> bool { - match self.find_participant(user) { - Some(p) => p.admin, - None => false, - } - } - - pub fn get_admin_count(&self) -> usize { - self.participants.iter().map(|p| p.admin).len() - } - - pub fn leave(&mut self, user_to_remove: &UserId, now: Timestamp) -> Option { - let original_count = self.participants.len(); - - if (self.is_admin(user_to_remove) && self.get_admin_count() == 1) || original_count == 1 { - // Cannot leave the group if you are the last admin or the last participant (this should not happen) - return None; - } - - self.participants.retain(|p| p.user_id != *user_to_remove); - self.last_updated = now; - let new_count = self.participants.len(); - - Some(new_count < original_count) - } - - pub fn is_user_in_group(&self, user_id: &UserId) -> bool { - self.find_participant(user_id).is_some() - } - - pub fn iter_participants(&self) -> impl Iterator { - self.participants.iter().map(|p| &p.user_id) - } - - pub fn subject(&self) -> &String { - &self.subject - } - - pub fn notification_recipients(&self, sender: UserId) -> Vec { - self.participants - .iter() - .filter(|p| !p.notifications_muted && p.user_id != sender) - .map(|p| p.user_id()) - .collect() - } - - pub fn notifications_muted(&self, user_id: UserId) -> bool { - if let Some(participant) = self.find_participant(&user_id) { - participant.notifications_muted - } else { - false - } - } - - fn find_participant(&self, user_id: &UserId) -> Option<&Participant> { - self.participants.iter().find(|p| p.user_id == *user_id) - } - - // fn get_unread_by_any_message_id_ranges(&self, me: &UserId, participant_filter: F) -> Vec<[u32; 2]> - // where F: Fn(&UserId) -> bool { - // let participants: Vec<_> = self.participants - // .iter() - // .filter(|p| participant_filter(&p.user_id)) - // .collect(); - - // let mut range_set = RangeSet::new(); - // for participant in participants { - // for range in participant.unread_message_ids.clone().into_smallvec() { - // range_set.insert_range(range); - // } - // } - - // let min_visible_message_id = self.get_min_visible_message_id(me); - - // range_set.remove_range(0..=(min_visible_message_id - 1)); - - // utils::range_set_to_vec(range_set) - // } -} - -impl Chat for GroupChat { - fn get_id(&self) -> ChatId { - self.id - } - - fn involves_user(&self, user: &UserId) -> bool { - self.participants.iter().any(|p| p.user_id == *user) - } - - fn push_message( - &mut self, - sender: &UserId, - client_message_id: String, - content: MessageContent, - replies_to: Option, - now: Timestamp, - ) -> Message { - let id = match self.messages.last() { - Some(message) => message.get_id() + 1, - None => 1, - }; - - let message = Message::new(id, client_message_id, now, *sender, content, replies_to); - - self.messages.push(message.clone()); - - for p in self - .participants - .iter_mut() - .filter(|p| p.user_id != *sender) - { - p.unread_message_ids.insert(id); - } - - self.last_updated = now; - - message - } - - fn get_messages(&self, user: &UserId, from_id: u32, page_size: u32) -> Vec { - get_messages( - &self.messages, - from_id, - page_size, - self.get_min_visible_message_id(user), - ) - } - - fn get_messages_by_id(&self, user: &UserId, ids: Vec) -> Vec { - get_messages_by_id(&self.messages, ids, self.get_min_visible_message_id(user)) - } - - fn get_message_mut(&mut self, id: u32) -> Option<&mut Message> { - self.messages.get_mut((id - 1) as usize) - } - - fn get_latest_message_id(&self) -> u32 { - get_latest_message_id(&self.messages) - } - - fn search_messages(&self, search_term: &str, user_id: &UserId) -> Vec { - let min_visible_message_id = self - .participants - .iter() - .find(|p| p.user_id == *user_id) - .unwrap() - .min_visible_message_id; - - let range_start = (min_visible_message_id - 1) as usize; - - search_messages(&self.messages[range_start..], search_term) - } - - fn mark_read( - &mut self, - me: &UserId, - from_id: u32, - to_id: u32, - now: Timestamp, - ) -> MarkReadResult { - let participant = self - .participants - .iter_mut() - .find(|p| p.user_id == *me) - .unwrap(); - - participant.unread_message_ids.remove_range(from_id..=to_id); - - self.last_updated = now; - - MarkReadResult::new(utils::range_set_to_vec( - participant.unread_message_ids.clone(), - )) - } - - fn mute_notifications(&mut self, user_id: UserId, mute: bool) { - if let Some(participant) = self.participants.iter_mut().find(|p| p.user_id == user_id) { - participant.notifications_muted = mute; - } - } - - fn get_unread_message_id_ranges(&self, user_id: &UserId) -> Vec<[u32; 2]> { - let participant = self - .participants - .iter() - .find(|p| p.user_id == *user_id) - .unwrap(); - - utils::range_set_to_vec(participant.unread_message_ids.clone()) - } - - fn get_display_date(&self, user_id: &UserId) -> Timestamp { - let user = self - .participants - .iter() - .find(|p| p.user_id == *user_id) - .unwrap(); - let mut updated_date = user.date_added; - - if let Some(message) = self.messages.last() { - updated_date = max(updated_date, message.get_timestamp()); - } - - updated_date - } - - fn get_updated_date(&self) -> Timestamp { - self.last_updated - } - - fn to_summary(&self, me: &UserId, message_count: u32) -> ChatSummary { - ChatSummary::Group(GroupChatSummary::new(self, me, message_count)) - } -} - -impl Participant { - fn new( - user_id: UserId, - admin: bool, - min_visible_message_id: u32, - now: Timestamp, - ) -> Participant { - Participant { - user_id, - admin, - min_visible_message_id, - date_added: now, - unread_message_ids: RangeSet::new(), - notifications_muted: false, - } - } - - pub fn user_id(&self) -> UserId { - self.user_id - } -} - -impl GroupChatSummary { - pub fn new(chat: &GroupChat, me: &UserId, message_count: u32) -> GroupChatSummary { - let unread_by_me_message_id_ranges = chat.get_unread_message_id_ranges(me); - let unread_by_any_message_id_ranges = Vec::new(); //chat.get_unread_by_any_message_id_ranges(me, |p: &UserId| p != me); - - let min_visible_message_id = chat.get_min_visible_message_id(me); - - let latest_messages = chat - .messages - .iter() - .rev() - .take(message_count as usize) - .take_while(|m| m.get_id() >= min_visible_message_id) - .cloned() - .collect(); - - GroupChatSummary { - id: chat.id, - subject: chat.subject.clone(), - display_date: chat.get_display_date(me), - last_updated: chat.last_updated, - chat_history_visible_to_new_joiners: chat.chat_history_visible_to_new_joiners, - min_visible_message_id: chat.get_min_visible_message_id(me), - participants: chat.participants.iter().map(|p| p.user_id).collect(), - unread_by_me_message_id_ranges, - unread_by_any_message_id_ranges, - latest_messages, - muted: chat.notifications_muted(*me), - } - } -} - -impl GroupChatStableState { - pub fn get_id(&self) -> ChatId { - self.id - } - - pub fn iter_participants(&self) -> impl Iterator { - self.participants.iter().map(|p| &p.user_id) - } -} - -impl From for GroupChatStableState { - fn from(chat: GroupChat) -> Self { - GroupChatStableState { - id: chat.id, - subject: chat.subject, - description: chat.description, - participants: chat.participants.into_iter().map(|p| p.into()).collect(), - messages: chat.messages, - chat_history_visible_to_new_joiners: Some(chat.chat_history_visible_to_new_joiners), - last_updated: chat.last_updated, - } - } -} - -impl From for GroupChat { - fn from(chat: GroupChatStableState) -> Self { - GroupChat { - id: chat.id, - subject: chat.subject, - description: chat.description, - participants: chat.participants.into_iter().map(|p| p.into()).collect(), - messages: chat.messages, - chat_history_visible_to_new_joiners: chat - .chat_history_visible_to_new_joiners - .unwrap_or(false), - last_updated: chat.last_updated, - } - } -} - -impl From for ParticipantStableState { - fn from(participant: Participant) -> Self { - ParticipantStableState { - user_id: participant.user_id, - admin: participant.admin, - date_added: participant.date_added, - min_visible_message_id: participant.min_visible_message_id, - unread_message_ids: utils::range_set_to_vec(participant.unread_message_ids), - notifications_muted: participant.notifications_muted, - } - } -} - -impl From for Participant { - fn from(participant: ParticipantStableState) -> Self { - Participant { - user_id: participant.user_id, - admin: participant.admin, - date_added: participant.date_added, - min_visible_message_id: participant.min_visible_message_id, - unread_message_ids: utils::vec_to_range_set(participant.unread_message_ids), - notifications_muted: participant.notifications_muted, - } - } -} diff --git a/src/services/chats/src/domain/messages.rs b/src/services/chats/src/domain/messages.rs deleted file mode 100644 index 6bc561fed6..0000000000 --- a/src/services/chats/src/domain/messages.rs +++ /dev/null @@ -1,68 +0,0 @@ -use crate::domain::chat::Message; -use itertools::Itertools; -use std::cmp::{max, min}; - -pub fn get_messages( - messages: &[Message], - from_id: u32, - page_size: u32, - min_visible_message_id_for_user: u32, -) -> Vec { - if messages.is_empty() { - return Vec::new(); - } - - // The to_id is exclusive - let to_id = from_id + page_size; - - let earliest_id = messages.first().unwrap().get_id(); - let latest_id = messages.last().unwrap().get_id(); - - let from_id = max(from_id, earliest_id); - let from_id = max(from_id, min_visible_message_id_for_user); - - if from_id > latest_id || from_id >= to_id { - return Vec::new(); - } - - let from_index = (from_id - earliest_id) as usize; - let to_index = min((to_id - earliest_id) as usize, messages.len()); - - messages[from_index..to_index].to_vec() -} - -pub fn get_messages_by_id( - messages: &[Message], - ids: Vec, - min_visible_message_id_for_user: u32, -) -> Vec { - if messages.is_empty() { - return Vec::new(); - } - - let earliest_id = messages.first().unwrap().get_id(); - let latest_id = messages.last().unwrap().get_id(); - - ids.into_iter() - .sorted() - .skip_while(|id| *id < min_visible_message_id_for_user) - .take_while(|id| *id <= latest_id) - .map(|id| messages[(id - earliest_id) as usize].clone()) - .collect() -} - -pub fn get_latest_message_id(messages: &[Message]) -> u32 { - if messages.is_empty() { - 0 - } else { - messages.last().unwrap().get_id() - } -} - -pub fn search_messages(messages: &[Message], search_term: &str) -> Vec { - messages - .iter() - .filter(|&m| m.matches_search(search_term)) - .cloned() - .collect() -} diff --git a/src/services/chats/src/domain/mod.rs b/src/services/chats/src/domain/mod.rs deleted file mode 100644 index 0f25eadaac..0000000000 --- a/src/services/chats/src/domain/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub mod blob_storage; -pub mod blocked_users; -pub mod chat; -pub mod chat_list; -pub mod direct_chat; -pub mod group_chat; -pub mod messages; -pub mod user_to_chats_map; diff --git a/src/services/chats/src/domain/user_to_chats_map.rs b/src/services/chats/src/domain/user_to_chats_map.rs deleted file mode 100644 index 1c330998f5..0000000000 --- a/src/services/chats/src/domain/user_to_chats_map.rs +++ /dev/null @@ -1,86 +0,0 @@ -use shared::chat_id::ChatId; -use shared::user_id::UserId; -use std::collections::hash_map::Entry::{Occupied, Vacant}; -use std::collections::{HashMap, HashSet}; - -#[derive(Default)] -pub struct UserToChatsMap { - map: HashMap>, -} - -impl UserToChatsMap { - pub fn get_chats(&self, user_id: &UserId) -> Option<&HashSet> { - self.map.get(user_id) - } - - pub fn link_chat_to_user(&mut self, chat_id: ChatId, user_id: UserId) -> bool { - match self.map.entry(user_id) { - Occupied(e) => e.into_mut().insert(chat_id), - Vacant(e) => { - let mut hs = HashSet::new(); - hs.insert(chat_id); - e.insert(hs); - true - } - } - } - - pub fn unlink_chat_from_user(&mut self, chat_id: &ChatId, user_id: &UserId) -> bool { - if let Some(hs) = self.map.get_mut(user_id) { - hs.remove(chat_id) - } else { - false - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - use itertools::Itertools; - use std::str::FromStr; - - #[test] - fn link_then_get_all_should_return_chats() { - let mut map = UserToChatsMap::default(); - let user_id = - UserId::from_str("bngem-gzprz-dtr6o-xnali-fgmfi-fjgpb-rya7j-x2idk-3eh6u-4v7tx-hqe") - .unwrap(); - - for c in (0..10).map(|i| ChatId(i)) { - map.link_chat_to_user(c, user_id.clone()); - } - - let chats = map.get_chats(&user_id).unwrap(); - - let sorted: Vec<_> = chats.iter().map(|c| c.0).sorted().collect(); - assert_eq!(10, sorted.len()); - for i in 0..10 { - assert_eq!(i, sorted[i] as usize); - } - } - - #[test] - fn unlink_then_get_all_should_not_return_unlinked_chats() { - let mut map = UserToChatsMap::default(); - let user_id = - UserId::from_str("bngem-gzprz-dtr6o-xnali-fgmfi-fjgpb-rya7j-x2idk-3eh6u-4v7tx-hqe") - .unwrap(); - - for c in (0..10).map(|i| ChatId(i)) { - map.link_chat_to_user(c, user_id.clone()); - } - - for c in (5..10).map(|i| ChatId(i)) { - map.unlink_chat_from_user(&c, &user_id); - } - - let chats = map.get_chats(&user_id).unwrap(); - - let sorted: Vec<_> = chats.iter().map(|c| c.0).sorted().collect(); - assert_eq!(5, sorted.len()); - for i in 0..5 { - assert_eq!(i, sorted[i] as usize); - } - } -} diff --git a/src/services/chats/src/lib.rs b/src/services/chats/src/lib.rs deleted file mode 100644 index 74cea9bc8d..0000000000 --- a/src/services/chats/src/lib.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod api; -mod domain; -mod queries; -mod services; -mod updates; -mod upgrade; -mod utils; diff --git a/src/services/chats/src/queries/get_chats.rs b/src/services/chats/src/queries/get_chats.rs deleted file mode 100644 index ad8b002df0..0000000000 --- a/src/services/chats/src/queries/get_chats.rs +++ /dev/null @@ -1,29 +0,0 @@ -use self::Response::*; -use crate::domain::chat::ChatSummary; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use serde::Deserialize; -use shared::timestamp::Timestamp; - -pub fn query(request: Request) -> Response { - let chat_list: &ChatList = storage::get(); - let me = shared::user_id::get_current(); - - Success(chat_list.get_summaries( - &me, - request.updated_since, - request.message_count_for_top_chat, - )) -} - -#[derive(Deserialize)] -pub struct Request { - updated_since: Option, - message_count_for_top_chat: Option, -} - -#[derive(CandidType)] -pub enum Response { - Success(Vec), -} diff --git a/src/services/chats/src/queries/get_chunk.rs b/src/services/chats/src/queries/get_chunk.rs deleted file mode 100644 index 7269630bc9..0000000000 --- a/src/services/chats/src/queries/get_chunk.rs +++ /dev/null @@ -1,9 +0,0 @@ -use crate::domain::blob_storage::BlobStorage; -use ic_cdk::storage; -use serde_bytes::ByteBuf; - -pub fn query(blob_id: String, chunk_index: u32) -> Option { - let blob_storage: &BlobStorage = storage::get(); - - blob_storage.get_chunk(blob_id, chunk_index).cloned() -} diff --git a/src/services/chats/src/queries/get_messages.rs b/src/services/chats/src/queries/get_messages.rs deleted file mode 100644 index ccec75c207..0000000000 --- a/src/services/chats/src/queries/get_messages.rs +++ /dev/null @@ -1,40 +0,0 @@ -use self::Response::*; -use crate::domain::chat::{Chat, Message}; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::chat_id::ChatId; - -pub fn query(chat_id: ChatId, from_id: u32, page_size: u32) -> Response { - let chat_list: &ChatList = storage::get(); - let me = shared::user_id::get_current(); - match chat_list.get(chat_id, &me) { - None => ChatNotFound, - Some(chat) => { - let messages = chat.get_messages(&me, from_id, page_size); - let latest_message_id = chat.get_latest_message_id(); - Success(Result::new(messages, latest_message_id)) - } - } -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), - ChatNotFound, -} - -#[derive(CandidType)] -pub struct Result { - messages: Vec, - latest_message_id: u32, -} - -impl Result { - pub fn new(messages: Vec, latest_message_id: u32) -> Result { - Result { - messages, - latest_message_id, - } - } -} diff --git a/src/services/chats/src/queries/get_messages_by_id.rs b/src/services/chats/src/queries/get_messages_by_id.rs deleted file mode 100644 index b7f724c410..0000000000 --- a/src/services/chats/src/queries/get_messages_by_id.rs +++ /dev/null @@ -1,26 +0,0 @@ -use self::Response::*; -use crate::domain::chat::Chat; -use crate::domain::chat_list::ChatList; -use crate::queries::get_messages::Result; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::chat_id::ChatId; - -pub fn query(chat_id: ChatId, ids: Vec) -> Response { - let chat_list: &ChatList = storage::get(); - let me = shared::user_id::get_current(); - match chat_list.get(chat_id, &me) { - None => ChatNotFound, - Some(chat) => { - let messages = chat.get_messages_by_id(&me, ids); - let latest_message_id = chat.get_latest_message_id(); - Success(Result::new(messages, latest_message_id)) - } - } -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), - ChatNotFound, -} diff --git a/src/services/chats/src/queries/get_updates.rs b/src/services/chats/src/queries/get_updates.rs deleted file mode 100644 index 64e7f4b1dd..0000000000 --- a/src/services/chats/src/queries/get_updates.rs +++ /dev/null @@ -1,51 +0,0 @@ -use self::Response::*; -use crate::domain::blocked_users::BlockedUsers; -use crate::domain::chat::ChatSummary; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use serde::Deserialize; -use shared::timestamp::Timestamp; -use shared::user_id::UserId; - -pub fn query(request: Request) -> Response { - let chat_list: &ChatList = storage::get(); - let me = shared::user_id::get_current(); - - let chats = chat_list.get_summaries( - &me, - request.updated_since, - request.message_count_for_top_chat, - ); - - let blocked_users: &BlockedUsers = storage::get(); - let my_blocked_users = blocked_users.get(&me); - - Success(Result::new(chats, my_blocked_users)) -} - -#[derive(Deserialize)] -pub struct Request { - updated_since: Option, - message_count_for_top_chat: Option, -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), -} - -#[derive(CandidType)] -pub struct Result { - chats: Vec, - blocked_users: Vec, -} - -impl Result { - pub fn new(chats: Vec, blocked_users: Vec) -> Result { - Result { - chats, - blocked_users, - } - } -} diff --git a/src/services/chats/src/queries/mod.rs b/src/services/chats/src/queries/mod.rs deleted file mode 100644 index 061ada5a2b..0000000000 --- a/src/services/chats/src/queries/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub mod get_chats; -pub mod get_chunk; -pub mod get_messages; -pub mod get_messages_by_id; -pub mod get_updates; -pub mod search_all_messages; -pub mod stats; diff --git a/src/services/chats/src/queries/search_all_messages.rs b/src/services/chats/src/queries/search_all_messages.rs deleted file mode 100644 index 6a85b15312..0000000000 --- a/src/services/chats/src/queries/search_all_messages.rs +++ /dev/null @@ -1,46 +0,0 @@ -use self::Response::*; -use crate::domain::chat::{Chat, Message}; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::chat_id::ChatId; - -pub fn query(search_term: &str, max_results: u8) -> Response { - let chat_list: &ChatList = storage::get(); - let me = shared::user_id::get_current(); - let chats = chat_list.get_all(&me); - - let mut matches: Vec = Vec::new(); - for chat in chats { - for message in chat.search_messages(search_term, &me) { - matches.push(Match { - chat_id: chat.get_id(), - message, - }); - } - } - - matches.sort_unstable_by(|x, y| y.message.get_timestamp().cmp(&x.message.get_timestamp())); - - let result = Result { - matches: matches.into_iter().take(max_results as usize).collect(), - }; - - Success(result) -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), -} - -#[derive(CandidType)] -pub struct Result { - matches: Vec, -} - -#[derive(CandidType)] -pub struct Match { - chat_id: ChatId, - message: Message, -} diff --git a/src/services/chats/src/queries/stats.rs b/src/services/chats/src/queries/stats.rs deleted file mode 100644 index de03c805ff..0000000000 --- a/src/services/chats/src/queries/stats.rs +++ /dev/null @@ -1,50 +0,0 @@ -use crate::domain::blob_storage::BlobStorage; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::memory::get_memory_usage; -use shared::timestamp; -use shared::user_id::UserId; - -pub fn query() -> Stats { - let chat_list: &ChatList = storage::get(); - let blob_storage: &BlobStorage = storage::get(); - let chat_stats = chat_list.get_stats(); - - Stats { - memory_used: get_memory_usage(), - timestamp: timestamp::now(), - user_id: shared::user_id::get_current(), - cycles_balance: ic_cdk::api::canister_balance(), - chunk_count: blob_storage.get_chunk_count(), - chunk_bytes: blob_storage.get_total_bytes(), - direct_chat_count: chat_stats.direct_chat_count, - group_chat_count: chat_stats.group_chat_count, - text_message_count: chat_stats.text_message_count, - image_message_count: chat_stats.image_message_count, - video_message_count: chat_stats.video_message_count, - file_message_count: chat_stats.file_message_count, - cycles_message_count: chat_stats.cycles_message_count, - cycles_transferred: chat_stats.cycles_transferred, - pruneable_message_count: chat_stats.pruneable_message_count, - } -} - -#[derive(CandidType)] -pub struct Stats { - memory_used: u64, - timestamp: u64, - user_id: UserId, - cycles_balance: i64, - chunk_count: u32, - chunk_bytes: u64, - direct_chat_count: u32, - group_chat_count: u32, - text_message_count: u64, - image_message_count: u64, - video_message_count: u64, - file_message_count: u64, - cycles_message_count: u64, - cycles_transferred: u128, - pruneable_message_count: u32, -} diff --git a/src/services/chats/src/services/mod.rs b/src/services/chats/src/services/mod.rs deleted file mode 100644 index df337612c9..0000000000 --- a/src/services/chats/src/services/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod notifications; -pub mod user_mgmt; diff --git a/src/services/chats/src/services/notifications/mod.rs b/src/services/chats/src/services/notifications/mod.rs deleted file mode 100644 index dac0b7a888..0000000000 --- a/src/services/chats/src/services/notifications/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod push_direct_message_notification; -pub mod push_group_message_notification; -pub mod shared; diff --git a/src/services/chats/src/services/notifications/push_direct_message_notification.rs b/src/services/chats/src/services/notifications/push_direct_message_notification.rs deleted file mode 100644 index d307069f32..0000000000 --- a/src/services/chats/src/services/notifications/push_direct_message_notification.rs +++ /dev/null @@ -1,42 +0,0 @@ -use crate::domain::chat::Message; -use crate::services::notifications::shared::NOTIFICATIONS_CANISTER_ID; -use ic_cdk::api::call::CallResult; -use ic_cdk::export::candid::CandidType; -use ic_cdk::export::Principal; -use serde::{Deserialize, Serialize}; -use shared::c2c::call_with_logging; -use shared::user_id::UserId; - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub struct Notification { - pub chat_id: String, - pub sender: UserId, - pub sender_name: String, - pub message: Message, -} - -#[derive(CandidType, Deserialize)] -pub struct Args { - pub recipient: UserId, - pub notification: Notification, -} - -#[derive(CandidType, Deserialize)] -pub enum Response { - Success, -} - -pub fn fire_and_forget(recipient: UserId, notification: Notification) { - async fn do_push(recipient: UserId, notification: Notification) { - let canister_id = Principal::from_text(NOTIFICATIONS_CANISTER_ID).unwrap(); - let args = Args { - recipient, - notification, - }; - let _: CallResult<(Response,)> = - call_with_logging(canister_id, "push_v1direct_message_notification", (args,)).await; - } - - let push_notification_future = do_push(recipient, notification); - ic_cdk::block_on(push_notification_future); -} diff --git a/src/services/chats/src/services/notifications/push_group_message_notification.rs b/src/services/chats/src/services/notifications/push_group_message_notification.rs deleted file mode 100644 index 0948c9cd3d..0000000000 --- a/src/services/chats/src/services/notifications/push_group_message_notification.rs +++ /dev/null @@ -1,43 +0,0 @@ -use crate::domain::chat::Message; -use crate::services::notifications::shared::NOTIFICATIONS_CANISTER_ID; -use ic_cdk::api::call::CallResult; -use ic_cdk::export::candid::CandidType; -use ic_cdk::export::Principal; -use serde::{Deserialize, Serialize}; -use shared::c2c::call_with_logging; -use shared::user_id::UserId; - -#[derive(CandidType, Serialize, Deserialize, Clone)] -pub struct Notification { - pub chat_id: String, - pub group_name: String, - pub sender: UserId, - pub sender_name: String, - pub message: Message, -} - -#[derive(CandidType, Deserialize)] -pub struct Args { - pub recipients: Vec, - pub notification: Notification, -} - -#[derive(CandidType, Deserialize)] -pub enum Response { - Success, -} - -pub fn fire_and_forget(recipients: Vec, notification: Notification) { - async fn do_push(recipients: Vec, notification: Notification) { - let canister_id = Principal::from_text(NOTIFICATIONS_CANISTER_ID).unwrap(); - let args = Args { - recipients, - notification, - }; - let _: CallResult<(Response,)> = - call_with_logging(canister_id, "push_v1group_message_notification", (args,)).await; - } - - let push_notification_future = do_push(recipients, notification); - ic_cdk::block_on(push_notification_future); -} diff --git a/src/services/chats/src/services/notifications/shared.rs b/src/services/chats/src/services/notifications/shared.rs deleted file mode 100644 index c86383ae71..0000000000 --- a/src/services/chats/src/services/notifications/shared.rs +++ /dev/null @@ -1 +0,0 @@ -pub const NOTIFICATIONS_CANISTER_ID: &str = "6vuwk-zaaaa-aaaaf-aaagq-cai"; diff --git a/src/services/chats/src/services/user_mgmt/mod.rs b/src/services/chats/src/services/user_mgmt/mod.rs deleted file mode 100644 index 2a04feb953..0000000000 --- a/src/services/chats/src/services/user_mgmt/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod transfer_cycles; diff --git a/src/services/chats/src/services/user_mgmt/transfer_cycles.rs b/src/services/chats/src/services/user_mgmt/transfer_cycles.rs deleted file mode 100644 index 37e0e0c8b8..0000000000 --- a/src/services/chats/src/services/user_mgmt/transfer_cycles.rs +++ /dev/null @@ -1,34 +0,0 @@ -use ic_cdk::export::candid::CandidType; -use ic_cdk::export::Principal; -use serde::Deserialize; -use shared::user_id::UserId; - -#[derive(CandidType, Deserialize, Debug)] -pub struct Request { - pub sender: UserId, - pub recipient: UserId, - pub amount: u128, -} - -#[derive(CandidType, Deserialize, Debug)] -pub enum Response { - Success(Result), - UserNotFound, - RecipientNotFound, - BalanceExceeded, -} - -#[derive(CandidType, Deserialize, Debug)] -pub struct Result { - new_balance: u128, -} - -pub async fn update(request: Request) -> Response { - let user_mgmt_id = Principal::from_text("7n5dj-xaaaa-aaaaf-aaacq-cai").unwrap(); - - let (response,): (Response,) = ic_cdk::call(user_mgmt_id, "transfer_cycles", (request,)) - .await - .unwrap(); - - response -} diff --git a/src/services/chats/src/updates/add_participants.rs b/src/services/chats/src/updates/add_participants.rs deleted file mode 100644 index b2f19e92b9..0000000000 --- a/src/services/chats/src/updates/add_participants.rs +++ /dev/null @@ -1,69 +0,0 @@ -use self::Response::*; -use crate::domain::blocked_users::{BlockedStatus, BlockedUsers}; -use crate::domain::chat::ChatEnum; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::chat_id::ChatId; -use shared::timestamp; -use shared::user_id::UserId; - -pub fn update(chat_id: ChatId, users: Vec) -> Response { - let chat_list: &mut ChatList = storage::get_mut(); - let me = shared::user_id::get_current(); - - let chat = chat_list.get_mut(chat_id, &me); - - match chat { - Some(ChatEnum::Group(group_chat)) => { - let now = timestamp::now(); - if !group_chat.is_admin(&me) { - Unauthorized - } else { - // Check whether the user blocks any users to be added or vice-versa - let blocked_users: &mut BlockedUsers = storage::get_mut(); - - let mut added = Vec::new(); - let mut blocked = Vec::new(); - for u in users { - if blocked_users.blocked_status(&me, &u) != BlockedStatus::Unblocked { - blocked.push(u); - } else if group_chat.add_participant(u, now) { - added.push(u); - } - } - - let count_added = added.len() as u32; - for u in added { - chat_list.link_chat_to_user(chat_id, u); - } - - if blocked.is_empty() { - Success(count_added) - } else { - PartialSuccess(PartialSuccess { - count_added, - blocked, - }) - } - } - } - Some(_) => NotGroupChat, - None => ChatNotFound, - } -} - -#[derive(CandidType)] -pub struct PartialSuccess { - count_added: u32, - blocked: Vec, -} - -#[derive(CandidType)] -pub enum Response { - Success(u32), - PartialSuccess(PartialSuccess), - Unauthorized, - ChatNotFound, - NotGroupChat, -} diff --git a/src/services/chats/src/updates/block_user.rs b/src/services/chats/src/updates/block_user.rs deleted file mode 100644 index 51585151fa..0000000000 --- a/src/services/chats/src/updates/block_user.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::domain::blocked_users::BlockedUsers; -use ic_cdk::storage; -use shared::user_id::UserId; - -pub fn update(user: UserId, unblock: bool) { - let me = shared::user_id::get_current(); - let blocked_users: &mut BlockedUsers = storage::get_mut(); - if unblock { - blocked_users.unblock(&me, &user); - } else { - blocked_users.block(me, user); - } -} diff --git a/src/services/chats/src/updates/create_group_chat.rs b/src/services/chats/src/updates/create_group_chat.rs deleted file mode 100644 index bee8797691..0000000000 --- a/src/services/chats/src/updates/create_group_chat.rs +++ /dev/null @@ -1,55 +0,0 @@ -use self::Response::*; -use crate::domain::chat_list::ChatList; -use crate::domain::group_chat::GroupChatSummary; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use serde::Deserialize; -use shared::chat_id::ChatId; -use shared::timestamp; -use shared::user_id::UserId; - -const MIN_GROUP_SUBJECT_LENGTH: u8 = 2; -const MAX_GROUP_SUBJECT_LENGTH: u8 = 25; - -pub fn update(request: Request) -> Response { - // Validation - if request.subject.len() < MIN_GROUP_SUBJECT_LENGTH as usize { - return SubjectTooShort(MIN_GROUP_SUBJECT_LENGTH); - } else if request.subject.len() > MAX_GROUP_SUBJECT_LENGTH as usize { - return SubjectTooLong(MAX_GROUP_SUBJECT_LENGTH); - } - - let chat_list: &mut ChatList = storage::get_mut(); - let me = shared::user_id::get_current(); - let now = timestamp::now(); - - let chat_summary = chat_list.create_group_chat( - me, - request.chat_id, - request.subject, - request.participants, - request.chat_history_visible_to_new_joiners, - now, - ); - - match chat_summary { - Some(cs) => Success(cs), - None => ChatAlreadyExists, - } -} - -#[derive(Deserialize)] -pub struct Request { - chat_id: ChatId, - subject: String, - participants: Vec, - chat_history_visible_to_new_joiners: bool, -} - -#[derive(CandidType)] -pub enum Response { - Success(GroupChatSummary), - ChatAlreadyExists, - SubjectTooShort(u8), - SubjectTooLong(u8), -} diff --git a/src/services/chats/src/updates/delete_group.rs b/src/services/chats/src/updates/delete_group.rs deleted file mode 100644 index 683916b382..0000000000 --- a/src/services/chats/src/updates/delete_group.rs +++ /dev/null @@ -1,35 +0,0 @@ -use self::Response::*; -use crate::domain::chat::ChatEnum; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::chat_id::ChatId; - -pub fn update(chat_id: ChatId) -> Response { - let chat_list: &mut ChatList = storage::get_mut(); - let me = shared::user_id::get_current(); - let chat = chat_list.get_mut(chat_id, &me); - match chat { - Some(ChatEnum::Group(group_chat)) => { - if !group_chat.is_admin(&me) { - return Unauthorized; - } - if group_chat.get_admin_count() == 1 { - return OnlyLastAdminCanDelete; - } - chat_list.delete_chat(chat_id); - Success - } - Some(_) => NotGroupChat, - None => ChatNotFound, - } -} - -#[derive(CandidType)] -pub enum Response { - Success, - Unauthorized, - OnlyLastAdminCanDelete, - ChatNotFound, - NotGroupChat, -} diff --git a/src/services/chats/src/updates/join_group.rs b/src/services/chats/src/updates/join_group.rs deleted file mode 100644 index 861cdfb972..0000000000 --- a/src/services/chats/src/updates/join_group.rs +++ /dev/null @@ -1,41 +0,0 @@ -use self::Response::*; -use crate::domain::chat::ChatEnum; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::chat_id::ChatId; -use shared::timestamp; - -pub fn update(chat_id: ChatId) -> Response { - let chat_list: &mut ChatList = storage::get_mut(); - let me = shared::user_id::get_current(); - let chat = chat_list.get_unchecked_mut(chat_id); - - match chat { - Some(ChatEnum::Group(group_chat)) => { - let now = timestamp::now(); - if group_chat.is_user_in_group(&me) { - AlreadyInGroup - } else { - let added = group_chat.add_participant(me, now); - if added { - chat_list.link_chat_to_user(chat_id, me); - Success - } else { - GroupSizeLimitReached - } - } - } - Some(_) => NotGroupChat, - None => ChatNotFound, - } -} - -#[derive(CandidType)] -pub enum Response { - Success, - AlreadyInGroup, - GroupSizeLimitReached, - ChatNotFound, - NotGroupChat, -} diff --git a/src/services/chats/src/updates/leave_group.rs b/src/services/chats/src/updates/leave_group.rs deleted file mode 100644 index c196626886..0000000000 --- a/src/services/chats/src/updates/leave_group.rs +++ /dev/null @@ -1,41 +0,0 @@ -use self::Response::*; -use crate::domain::chat::ChatEnum; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::chat_id::ChatId; -use shared::timestamp; - -pub fn update(chat_id: ChatId) -> Response { - let chat_list: &mut ChatList = storage::get_mut(); - let me = shared::user_id::get_current(); - let chat = chat_list.get_mut(chat_id, &me); - - match chat { - Some(ChatEnum::Group(group_chat)) => { - let now = timestamp::now(); - if group_chat.is_admin(&me) && group_chat.get_admin_count() == 1 { - return LastAdminCannotLeave; - } - match group_chat.leave(&me, now) { - Some(true) => { - chat_list.unlink_chat_from_user(&chat_id, &me); - Success - } - Some(false) => ParticipantNotFound, - None => LastAdminCannotLeave, - } - } - Some(_) => NotGroupChat, - None => ChatNotFound, - } -} - -#[derive(CandidType)] -pub enum Response { - Success, - ParticipantNotFound, - LastAdminCannotLeave, - ChatNotFound, - NotGroupChat, -} diff --git a/src/services/chats/src/updates/mark_read.rs b/src/services/chats/src/updates/mark_read.rs deleted file mode 100644 index 5516767ad2..0000000000 --- a/src/services/chats/src/updates/mark_read.rs +++ /dev/null @@ -1,24 +0,0 @@ -use self::Response::*; -use crate::domain::chat::{Chat, MarkReadResult}; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::chat_id::ChatId; -use shared::timestamp; - -pub fn update(chat_id: ChatId, from_id: u32, to_id: u32) -> Response { - let chat_list: &mut ChatList = storage::get_mut(); - let me = shared::user_id::get_current(); - let now = timestamp::now(); - - match chat_list.get_mut(chat_id, &me) { - None => ChatNotFound, - Some(chat) => Success(chat.mark_read(&me, from_id, to_id, now)), - } -} - -#[derive(CandidType)] -pub enum Response { - Success(MarkReadResult), - ChatNotFound, -} diff --git a/src/services/chats/src/updates/mod.rs b/src/services/chats/src/updates/mod.rs deleted file mode 100644 index 08628a789c..0000000000 --- a/src/services/chats/src/updates/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub mod add_participants; -pub mod block_user; -pub mod create_group_chat; -pub mod delete_group; -pub mod join_group; -pub mod leave_group; -pub mod mark_read; -pub mod put_chunk; -pub mod remove_participant; -pub mod send_direct_message; -pub mod send_message; -pub mod toggle_notifications; diff --git a/src/services/chats/src/updates/put_chunk.rs b/src/services/chats/src/updates/put_chunk.rs deleted file mode 100644 index c586d34c3b..0000000000 --- a/src/services/chats/src/updates/put_chunk.rs +++ /dev/null @@ -1,11 +0,0 @@ -use crate::domain::blob_storage::BlobStorage; -use crate::domain::chat_list::ChatList; -use ic_cdk::storage; -use serde_bytes::ByteBuf; - -pub fn update(blob_id: String, chunk_index: u32, data: ByteBuf) -> bool { - let chat_list: &mut ChatList = storage::get_mut(); - let blob_storage: &mut BlobStorage = storage::get_mut(); - chat_list.prune_messages(blob_storage); - blob_storage.put_chunk(blob_id, chunk_index, data) -} diff --git a/src/services/chats/src/updates/remove_participant.rs b/src/services/chats/src/updates/remove_participant.rs deleted file mode 100644 index de876c742f..0000000000 --- a/src/services/chats/src/updates/remove_participant.rs +++ /dev/null @@ -1,46 +0,0 @@ -use self::Response::*; -use crate::domain::chat::ChatEnum; -use crate::domain::chat_list::ChatList; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::chat_id::ChatId; -use shared::timestamp; -use shared::user_id::UserId; - -pub fn update(chat_id: ChatId, user: UserId) -> Response { - let chat_list: &mut ChatList = storage::get_mut(); - let me = shared::user_id::get_current(); - let now = timestamp::now(); - - let chat = chat_list.get_mut(chat_id, &me); - - match chat { - Some(ChatEnum::Group(group_chat)) => { - if me == user { - return CannotRemoveSelfFromChat; - } - if !group_chat.is_admin(&user) { - return Unauthorized; - } - match group_chat.remove_participant(&user, now) { - true => { - chat_list.unlink_chat_from_user(&chat_id, &user); - Success - } - false => ParticipantNotFound, - } - } - Some(_) => NotGroupChat, - None => ChatNotFound, - } -} - -#[derive(CandidType)] -pub enum Response { - Success, - Unauthorized, - ParticipantNotFound, - CannotRemoveSelfFromChat, - ChatNotFound, - NotGroupChat, -} diff --git a/src/services/chats/src/updates/send_direct_message.rs b/src/services/chats/src/updates/send_direct_message.rs deleted file mode 100644 index 67cbe31913..0000000000 --- a/src/services/chats/src/updates/send_direct_message.rs +++ /dev/null @@ -1,145 +0,0 @@ -use self::Response::*; -use crate::domain::blocked_users::{BlockedStatus, BlockedUsers}; -use crate::domain::chat::{ - Chat, ChatEnum, MessageContent, MessageContentValidationResponse, ReplyContext, -}; -use crate::domain::chat_list::ChatList; -use crate::domain::direct_chat::DirectChatSummary; -use crate::services::notifications::push_direct_message_notification; -use crate::services::notifications::push_direct_message_notification::Notification; -use crate::services::user_mgmt::*; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use serde::Deserialize; -use shared::chat_id::ChatId; -use shared::timestamp::{self, Timestamp}; -use shared::user_id::UserId; - -pub async fn update(request: Request) -> Response { - // Validation - if let Some(response) = validate(&request) { - return response; - } - - // Check whether either user blocks the other - let me = shared::user_id::get_current(); - let blocked_users: &mut BlockedUsers = storage::get_mut(); - let blocked_status = blocked_users.blocked_status(&me, &request.recipient); - match blocked_status { - BlockedStatus::Sender => return SenderBlocked, - BlockedStatus::Recipient => return RecipientBlocked, - BlockedStatus::Both => return RecipientBlocked, - BlockedStatus::Unblocked => (), - }; - - let now = timestamp::now(); - let chat_id = ChatId::for_direct_chat(&me, &request.recipient); - - if let MessageContent::Cycles(cycle_content) = &request.content { - let request = transfer_cycles::Request { - sender: me, - recipient: request.recipient, - amount: cycle_content.get_amount(), - }; - - let response = transfer_cycles::update(request).await; - - match response { - transfer_cycles::Response::Success(_) => (), - transfer_cycles::Response::UserNotFound => return UserNotFound, - transfer_cycles::Response::RecipientNotFound => return RecipientNotFound, - transfer_cycles::Response::BalanceExceeded => return BalanceExceeded, - } - } - - let chat_list: &mut ChatList = storage::get_mut(); - - // Create a new direct chat if it does not exist - { - let chat = chat_list.get(chat_id, &me); - if chat.is_none() { - chat_list.create_direct_chat(chat_id, me, request.recipient, now); - } - } - - let message = chat_list - .push_message( - chat_id, - &me, - request.client_message_id, - request.content, - request.replies_to, - now, - ) - .unwrap(); - - let chat = chat_list.get(chat_id, &me).unwrap(); - let chat_summary = chat.to_summary(&me, 0).direct().unwrap(); - let message_id = message.get_id(); - - if let Some(sender_name) = request.sender_name { - if let ChatEnum::Direct(direct) = chat { - if !direct.notifications_muted(request.recipient) { - let notification = Notification { - chat_id: format!("{:x}", chat_id.0), - sender: me, - sender_name, - message, - }; - push_direct_message_notification::fire_and_forget(request.recipient, notification); - } - } - } - - Success(Result { - chat_summary, - message_id, - timestamp: now, - }) -} - -fn validate(request: &Request) -> Option { - if request.client_message_id.len() > 100 { - return Some(Response::InvalidRequest); - } - match request.content.validate() { - MessageContentValidationResponse::MessageTooLong(max) => return Some(MessageTooLong(max)), - MessageContentValidationResponse::Invalid => return Some(InvalidRequest), - MessageContentValidationResponse::Valid => (), - } - if let Some(reply) = &request.replies_to { - match reply.get_content().validate() { - MessageContentValidationResponse::Valid => (), - _ => return Some(InvalidRequest), - } - } - None -} - -#[derive(Deserialize)] -pub struct Request { - recipient: UserId, - sender_name: Option, - client_message_id: String, - content: MessageContent, - replies_to: Option, -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), - UserNotFound, - RecipientNotFound, - BalanceExceeded, - MessageTooLong(u32), - InvalidRequest, - SenderBlocked, - RecipientBlocked, -} - -#[derive(CandidType)] -pub struct Result { - chat_summary: DirectChatSummary, - message_id: u32, - timestamp: Timestamp, -} diff --git a/src/services/chats/src/updates/send_message.rs b/src/services/chats/src/updates/send_message.rs deleted file mode 100644 index e472004464..0000000000 --- a/src/services/chats/src/updates/send_message.rs +++ /dev/null @@ -1,165 +0,0 @@ -use self::Response::*; -use crate::domain::blocked_users::{BlockedStatus, BlockedUsers}; -use crate::domain::chat::{ - Chat, ChatEnum, ChatSummary, MessageContent, MessageContentValidationResponse, ReplyContext, -}; -use crate::domain::chat_list::ChatList; -use crate::services::notifications::push_direct_message_notification; -use crate::services::notifications::push_group_message_notification; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use serde::Deserialize; -use shared::chat_id::ChatId; -use shared::{timestamp, timestamp::Timestamp}; - -pub fn update(request: Request) -> Response { - // Validation - if let Some(response) = validate(&request) { - return response; - } - - let me = shared::user_id::get_current(); - let chat_list: &mut ChatList = storage::get_mut(); - - { - // Try to find the requested chat - let chat = chat_list.get(request.chat_id, &me); - - if chat.is_none() { - return ChatNotFound; - } - - // Check whether either user blocks the other - if let ChatEnum::Direct(dc) = chat.unwrap() { - let blocked_users: &mut BlockedUsers = storage::get_mut(); - let blocked_status = blocked_users.blocked_status(&me, dc.get_other(&me)); - match blocked_status { - BlockedStatus::Sender => return SenderBlocked, - BlockedStatus::Recipient => return RecipientBlocked, - BlockedStatus::Both => return RecipientBlocked, - BlockedStatus::Unblocked => (), - }; - } - } - - { - let now = timestamp::now(); - - let message = chat_list - .push_message( - request.chat_id, - &me, - request.client_message_id, - request.content, - request.replies_to, - now, - ) - .unwrap(); - - if let Some(chat) = chat_list.get(request.chat_id, &me) { - let chat_summary = chat.to_summary(&me, 0); - let message_id = message.get_id(); - - // TODO: truncate the message text/caption to 200 chars. - // A notification can only be 3800 chars. Only the first 150 or so chars are rendered in any case. - - if let Some(sender_name) = request.sender_name { - match chat { - ChatEnum::Direct(direct) => { - let recipient = *direct.get_other(&me); - - if !direct.notifications_muted(recipient) { - let notification = push_direct_message_notification::Notification { - chat_id: format!("{:x}", request.chat_id.0), - sender: me, - sender_name, - message, - }; - - push_direct_message_notification::fire_and_forget( - recipient, - notification, - ); - } - } - ChatEnum::Group(group) => { - let recipients = group.notification_recipients(me); - - if !recipients.is_empty() { - let notification = push_group_message_notification::Notification { - chat_id: format!("{:x}", request.chat_id.0), - group_name: group.subject().clone(), - sender: me, - sender_name, - message, - }; - - push_group_message_notification::fire_and_forget( - recipients, - notification, - ); - } - } - }; - } - - Success(Result::new(chat_summary, message_id, now)) - } else { - ChatNotFound - } - } -} - -fn validate(request: &Request) -> Option { - if request.client_message_id.len() > 100 { - return Some(Response::InvalidRequest); - } - match request.content.validate() { - MessageContentValidationResponse::MessageTooLong(max) => return Some(MessageTooLong(max)), - MessageContentValidationResponse::Invalid => return Some(InvalidRequest), - MessageContentValidationResponse::Valid => (), - } - if let Some(reply) = &request.replies_to { - match reply.get_content().validate() { - MessageContentValidationResponse::Valid => (), - _ => return Some(InvalidRequest), - } - } - None -} - -#[derive(Deserialize)] -pub struct Request { - chat_id: ChatId, - sender_name: Option, - client_message_id: String, - content: MessageContent, - replies_to: Option, -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), - ChatNotFound, - MessageTooLong(u32), - InvalidRequest, - SenderBlocked, - RecipientBlocked, -} - -#[derive(CandidType)] -pub struct Result { - chat_summary: ChatSummary, - message_id: u32, - timestamp: Timestamp, -} - -impl Result { - pub fn new(chat_summary: ChatSummary, message_id: u32, timestamp: Timestamp) -> Result { - Result { - chat_summary, - message_id, - timestamp, - } - } -} diff --git a/src/services/chats/src/updates/toggle_notifications.rs b/src/services/chats/src/updates/toggle_notifications.rs deleted file mode 100644 index c5968059dd..0000000000 --- a/src/services/chats/src/updates/toggle_notifications.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::domain::chat::Chat; -use crate::domain::chat_list::ChatList; -use ic_cdk::storage; -use shared::chat_id::ChatId; - -pub fn update(chat_id: ChatId, mute: bool) { - let chat_list: &mut ChatList = storage::get_mut(); - let me = shared::user_id::get_current(); - - if let Some(chat) = chat_list.get_mut(chat_id, &me) { - chat.mute_notifications(me, mute); - } -} diff --git a/src/services/chats/src/upgrade.rs b/src/services/chats/src/upgrade.rs deleted file mode 100644 index 9d5d9e33ea..0000000000 --- a/src/services/chats/src/upgrade.rs +++ /dev/null @@ -1,61 +0,0 @@ -use crate::domain::blob_storage::BlobStorage; -use crate::domain::blocked_users::BlockedUsers; -use crate::domain::chat_list::{ChatList, ChatListState}; -use ic_cdk::export::candid::CandidType; -use ic_cdk_macros::*; -use serde::Deserialize; -use shared::storage; -use shared::storage::StableState; - -#[pre_upgrade] -fn pre_upgrade() { - let to_save = StableStateOuter { - chats: storage::take_from_storage(), - blobs: storage::take_from_storage(), - blocked_users: storage::take_from_storage(), - }; - storage::stable_save(to_save); -} - -#[post_upgrade] -fn post_upgrade() { - let saved: StableStateOuter = storage::stable_restore(); - - storage::put_in_storage(saved.chats); - storage::put_in_storage(saved.blobs); - storage::put_in_storage(saved.blocked_users); -} - -#[derive(Default)] -struct StableStateOuter { - chats: ChatList, - blobs: BlobStorage, - blocked_users: BlockedUsers, -} - -#[derive(CandidType, Deserialize)] -struct StableStateInner { - chats: ChatListState, - blobs: BlobStorage, - blocked_users: BlockedUsers, -} - -impl StableState for StableStateOuter { - type State = StableStateInner; - - fn drain(self) -> Self::State { - StableStateInner { - chats: self.chats.drain(), - blobs: self.blobs, - blocked_users: self.blocked_users, - } - } - - fn fill(source: Self::State) -> Self { - StableStateOuter { - chats: ChatList::fill(source.chats), - blobs: source.blobs, - blocked_users: source.blocked_users, - } - } -} diff --git a/src/services/chats/src/utils.rs b/src/services/chats/src/utils.rs deleted file mode 100644 index f1980b60e5..0000000000 --- a/src/services/chats/src/utils.rs +++ /dev/null @@ -1,21 +0,0 @@ -use range_set::RangeSet; -use smallvec::SmallVec; -use std::ops::RangeInclusive; - -pub fn range_set_to_vec(range_set: RangeSet<[RangeInclusive; 2]>) -> Vec<[u32; 2]> { - range_set - .into_smallvec() - .into_vec() - .into_iter() - .map(|r| [*r.start(), *r.end()]) - .collect() -} - -pub fn vec_to_range_set(vec: Vec<[u32; 2]>) -> RangeSet<[RangeInclusive; 2]> { - let ranges: Vec<_> = vec - .into_iter() - .map(|r| RangeInclusive::new(r[0], r[1])) - .collect(); - let small_vec = SmallVec::from_vec(ranges); - RangeSet::from_ranges(small_vec).unwrap() -} diff --git a/src/services/p2p/Cargo.toml b/src/services/p2p/Cargo.toml deleted file mode 100644 index c5e884a23a..0000000000 --- a/src/services/p2p/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "p2p" -version = "0.1.0" -authors = ["Hamish Peebles ", "Matt Grogan "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -path = "src/lib.rs" -crate-type = ["cdylib"] - -[dependencies] -ic-cdk = "0.2.4" -ic-cdk-macros = "0.2.4" -serde = "1.0.111" -shared = { path = "../shared", version = "0.1.0" } diff --git a/src/services/p2p/p2p.did b/src/services/p2p/p2p.did deleted file mode 100644 index 9063b504fe..0000000000 --- a/src/services/p2p/p2p.did +++ /dev/null @@ -1,104 +0,0 @@ -type UserId = principal; -type Timestamp = nat64; - -type AddOffersRequest = - record { - offers: vec AddOfferRequest; - }; - -type AddOfferRequest = - record { - id: text; - user_id: UserId; - connection_string: text; - ice_candidates: vec text; - }; - -type AddOffersResponse = - variant { - Success: AddOffersResult; - }; - -type AddOffersResult = - record { - counter_offers: vec Offer; - }; - -type AddAnswersRequest = - record { - answers: vec AddAnswerRequest; - }; - -type AddAnswerRequest = - record { - id: text; - offer_id: text; - user_id: UserId; - connection_string: text; - ice_candidates: vec text; - }; - -type RemoveConnectionDetailsRequest = - record { - connections: vec RemoveSingleConnectionRequest; - }; - -type RemoveSingleConnectionRequest = - record { - user_id: UserId; - id: text; - }; - -type ConnectionDetails = - variant { - Offer: Offer; - Answer: Answer; - }; - -type Offer = - record { - id: text; - user_id: UserId; - connection_string: text; - ice_candidates: vec text; - age_seconds: nat32; - }; - -type Answer = - record { - id: text; - offer_id: text; - user_id: UserId; - connection_string: text; - ice_candidates: vec text; - age_seconds: nat32; - }; - -type GetConnectionDetailsResponse = - variant { - Success: GetConnectionDetailsResult; - }; - -type GetConnectionDetailsResult = - record { - connections: vec ConnectionDetails; - timestamp: Timestamp; - }; - -type Stats = - record { - memory_used: nat64; - timestamp: nat64; - user_id: UserId; - cycles_balance: int64; - user_count: nat64; - }; - -service : { - add_offers: (AddOffersRequest) -> (AddOffersResponse); - add_answers: (AddAnswersRequest) -> (); - remove_connection_details: (RemoveConnectionDetailsRequest) -> (nat32); - - get_connection_details: (opt Timestamp) -> (GetConnectionDetailsResponse) query; - stats: () -> (Stats) query; -} \ No newline at end of file diff --git a/src/services/p2p/src/api.rs b/src/services/p2p/src/api.rs deleted file mode 100644 index e6164b3908..0000000000 --- a/src/services/p2p/src/api.rs +++ /dev/null @@ -1,37 +0,0 @@ -use crate::queries::*; -use crate::updates::*; -use ic_cdk_macros::*; -use shared::accept_cycles; -use shared::timestamp::Timestamp; - -#[update] -pub fn add_offers(request: add_offers::Request) -> add_offers::Response { - add_offers::update(request) -} - -#[update] -pub fn add_answers(request: add_answers::Request) { - add_answers::update(request) -} - -#[update] -pub fn remove_connection_details(request: remove_connection_details::Request) -> u32 { - remove_connection_details::update(request) -} - -#[update] -fn wallet_receive() { - accept_cycles(); -} - -#[query] -pub fn get_connection_details( - updated_since: Option, -) -> get_connection_details::Response { - get_connection_details::query(updated_since) -} - -#[query] -fn stats() -> get_stats::Stats { - get_stats::query() -} diff --git a/src/services/p2p/src/domain/connection_details.rs b/src/services/p2p/src/domain/connection_details.rs deleted file mode 100644 index d3fc8c95b0..0000000000 --- a/src/services/p2p/src/domain/connection_details.rs +++ /dev/null @@ -1,274 +0,0 @@ -use ic_cdk::export::candid::CandidType; -use serde::Deserialize; -use shared::timestamp::Timestamp; -use shared::user_id::UserId; -use std::collections::{ - hash_map::Entry::{Occupied, Vacant}, - HashMap, -}; - -#[derive(CandidType, Deserialize)] -pub struct AllConnectionDetails { - connection_details_per_user: HashMap>, -} - -#[derive(CandidType, Clone, Deserialize)] -pub enum ConnectionDetails { - Offer(Offer), - Answer(Answer), -} - -#[derive(CandidType, Clone, Deserialize)] -pub struct Offer { - id: String, - from: UserId, - to: UserId, - connection_string: String, - ice_candidates: Vec, - timestamp: Timestamp, -} - -#[derive(CandidType, Clone, Deserialize)] -pub struct Answer { - id: String, - offer_id: String, - from: UserId, - to: UserId, - connection_string: String, - ice_candidates: Vec, - timestamp: Timestamp, -} - -#[derive(CandidType)] -pub enum ConnectionDetailsSummary { - Offer(OfferSummary), - Answer(AnswerSummary), -} - -#[derive(CandidType)] -pub struct OfferSummary { - id: String, - user_id: UserId, - connection_string: String, - ice_candidates: Vec, - age_seconds: u32, -} - -#[derive(CandidType)] -pub struct AnswerSummary { - id: String, - offer_id: String, - user_id: UserId, - connection_string: String, - ice_candidates: Vec, - age_seconds: u32, -} - -pub struct Stats { - pub user_count: u64, -} - -impl AllConnectionDetails { - pub fn add_offer( - &mut self, - id: String, - me: UserId, - them: UserId, - connection_string: String, - ice_candidates: Vec, - now: Timestamp, - ) -> Option { - // If the reverse offer already exists, return that - if let Occupied(e) = self.connection_details_per_user.entry(me) { - if let Some(o) = e.get().iter().find_map(|c| match c { - ConnectionDetails::Offer(offer) => { - if offer.from == them { - Some(offer) - } else { - None - } - } - _ => None, - }) { - return Some(OfferSummary { - id: o.id.clone(), - user_id: them, - connection_string: o.connection_string.clone(), - ice_candidates: o.ice_candidates.to_vec(), - age_seconds: ((now - o.timestamp) / 1000) as u32, - }); - } - } - - let offer = - ConnectionDetails::new_offer(id, me, them, connection_string, ice_candidates, now); - - self.add_connection_details(&me, them, offer); - - None - } - - pub fn add_answer( - &mut self, - id: String, - offer_id: String, - me: UserId, - them: UserId, - connection_string: String, - ice_candidates: Vec, - now: Timestamp, - ) { - let answer = ConnectionDetails::new_answer( - id, - offer_id, - me, - them, - connection_string, - ice_candidates, - now, - ); - - self.add_connection_details(&me, them, answer); - } - - pub fn get_connection_details( - &self, - to: &UserId, - updated_since: Option, - now: Timestamp, - ) -> Vec { - match self.connection_details_per_user.get(to) { - Some(v) => v - .iter() - .filter(|c| updated_since.is_none() || c.get_timestamp() > updated_since.unwrap()) - .map(|c| ConnectionDetailsSummary::new(c, now)) - .collect(), - None => Vec::new(), - } - } - - pub fn remove_connection_details(&mut self, from: &UserId, to: &UserId, id: &str) -> bool { - if let Some(v) = self.connection_details_per_user.get_mut(to) { - let original_count = v.len(); - v.retain(|c| c.get_from_user() != from || c.get_id() != id); - v.len() < original_count - } else { - false - } - } - - fn add_connection_details( - &mut self, - me: &UserId, - them: UserId, - connection_details: ConnectionDetails, - ) { - match self.connection_details_per_user.entry(them) { - Vacant(e) => { - e.insert(vec![connection_details]); - } - Occupied(e) => { - let connections = e.into_mut(); - connections.retain(|c| c.get_from_user() != me); - connections.push(connection_details); - } - }; - } - - pub fn get_stats(&self) -> Stats { - Stats { - user_count: self.connection_details_per_user.len() as u64, - } - } -} - -impl ConnectionDetails { - pub fn new_offer( - id: String, - from: UserId, - to: UserId, - connection_string: String, - ice_candidates: Vec, - timestamp: Timestamp, - ) -> ConnectionDetails { - ConnectionDetails::Offer(Offer { - id, - from, - to, - connection_string, - ice_candidates, - timestamp, - }) - } - - pub fn new_answer( - id: String, - offer_id: String, - from: UserId, - to: UserId, - connection_string: String, - ice_candidates: Vec, - timestamp: Timestamp, - ) -> ConnectionDetails { - ConnectionDetails::Answer(Answer { - id, - offer_id, - from, - to, - connection_string, - ice_candidates, - timestamp, - }) - } - - pub fn get_id(&self) -> &str { - match self { - ConnectionDetails::Offer(o) => &o.id, - ConnectionDetails::Answer(a) => &a.id, - } - } - - pub fn get_from_user(&self) -> &UserId { - match self { - ConnectionDetails::Offer(o) => &o.from, - ConnectionDetails::Answer(a) => &a.from, - } - } - - pub fn get_timestamp(&self) -> Timestamp { - match self { - ConnectionDetails::Offer(o) => o.timestamp, - ConnectionDetails::Answer(a) => a.timestamp, - } - } -} - -impl ConnectionDetailsSummary { - pub fn new(connection_details: &ConnectionDetails, now: Timestamp) -> ConnectionDetailsSummary { - match connection_details { - ConnectionDetails::Offer(o) => ConnectionDetailsSummary::Offer(OfferSummary { - id: o.id.clone(), - user_id: o.from, - connection_string: o.connection_string.clone(), - ice_candidates: o.ice_candidates.to_vec(), - age_seconds: ((now - o.timestamp) / 1000) as u32, - }), - ConnectionDetails::Answer(a) => ConnectionDetailsSummary::Answer(AnswerSummary { - id: a.id.clone(), - offer_id: a.offer_id.clone(), - user_id: a.from, - connection_string: a.connection_string.clone(), - ice_candidates: a.ice_candidates.to_vec(), - age_seconds: ((now - a.timestamp) / 1000) as u32, - }), - } - } -} - -impl Default for AllConnectionDetails { - fn default() -> Self { - AllConnectionDetails { - connection_details_per_user: HashMap::new(), - } - } -} diff --git a/src/services/p2p/src/domain/mod.rs b/src/services/p2p/src/domain/mod.rs deleted file mode 100644 index 51ad284b76..0000000000 --- a/src/services/p2p/src/domain/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod connection_details; diff --git a/src/services/p2p/src/lib.rs b/src/services/p2p/src/lib.rs deleted file mode 100644 index 75d44e5b14..0000000000 --- a/src/services/p2p/src/lib.rs +++ /dev/null @@ -1,4 +0,0 @@ -mod api; -mod domain; -mod queries; -mod updates; diff --git a/src/services/p2p/src/queries/get_connection_details.rs b/src/services/p2p/src/queries/get_connection_details.rs deleted file mode 100644 index 4f3f69fdef..0000000000 --- a/src/services/p2p/src/queries/get_connection_details.rs +++ /dev/null @@ -1,31 +0,0 @@ -use self::Response::*; -use crate::domain::connection_details::{AllConnectionDetails, ConnectionDetailsSummary}; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::timestamp::Timestamp; - -pub fn query(updated_since: Option) -> Response { - let me = shared::user_id::get_current(); - let now = shared::timestamp::now(); - let connection_details: &AllConnectionDetails = storage::get(); - - let connections = connection_details.get_connection_details(&me, updated_since, now); - - let result = Result { - connections, - timestamp: now, - }; - - Success(result) -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), -} - -#[derive(CandidType)] -pub struct Result { - connections: Vec, - timestamp: Timestamp, -} diff --git a/src/services/p2p/src/queries/get_stats.rs b/src/services/p2p/src/queries/get_stats.rs deleted file mode 100644 index df484f8258..0000000000 --- a/src/services/p2p/src/queries/get_stats.rs +++ /dev/null @@ -1,27 +0,0 @@ -use crate::domain::connection_details::AllConnectionDetails; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::memory::get_memory_usage; -use shared::timestamp; -use shared::user_id::UserId; - -pub fn query() -> Stats { - let connection_details: &AllConnectionDetails = storage::get(); - let connection_stats = connection_details.get_stats(); - Stats { - memory_used: get_memory_usage(), - timestamp: timestamp::now(), - user_id: shared::user_id::get_current(), - cycles_balance: ic_cdk::api::canister_balance(), - user_count: connection_stats.user_count, - } -} - -#[derive(CandidType)] -pub struct Stats { - memory_used: u64, - timestamp: u64, - user_id: UserId, - cycles_balance: i64, - user_count: u64, -} diff --git a/src/services/p2p/src/queries/mod.rs b/src/services/p2p/src/queries/mod.rs deleted file mode 100644 index 4f1662b9db..0000000000 --- a/src/services/p2p/src/queries/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod get_connection_details; -pub mod get_stats; diff --git a/src/services/p2p/src/updates/add_answers.rs b/src/services/p2p/src/updates/add_answers.rs deleted file mode 100644 index eccfd8b1cf..0000000000 --- a/src/services/p2p/src/updates/add_answers.rs +++ /dev/null @@ -1,36 +0,0 @@ -use crate::domain::connection_details::AllConnectionDetails; -use ic_cdk::storage; -use serde::Deserialize; -use shared::user_id::UserId; - -pub fn update(request: Request) { - let me = shared::user_id::get_current(); - let now = shared::timestamp::now(); - let connection_details: &mut AllConnectionDetails = storage::get_mut(); - - for answer in request.answers { - connection_details.add_answer( - answer.id, - answer.offer_id, - me, - answer.user_id, - answer.connection_string, - answer.ice_candidates, - now, - ); - } -} - -#[derive(Deserialize)] -pub struct Request { - answers: Vec, -} - -#[derive(Deserialize)] -pub struct AddAnswerRequest { - id: String, - offer_id: String, - user_id: UserId, - connection_string: String, - ice_candidates: Vec, -} diff --git a/src/services/p2p/src/updates/add_offers.rs b/src/services/p2p/src/updates/add_offers.rs deleted file mode 100644 index 73595d61c5..0000000000 --- a/src/services/p2p/src/updates/add_offers.rs +++ /dev/null @@ -1,53 +0,0 @@ -use crate::domain::connection_details::{AllConnectionDetails, OfferSummary}; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use serde::Deserialize; -use shared::user_id::UserId; - -pub fn update(request: Request) -> Response { - let me = shared::user_id::get_current(); - let now = shared::timestamp::now(); - let connection_details: &mut AllConnectionDetails = storage::get_mut(); - - let counter_offers: Vec<_> = request - .offers - .into_iter() - .filter_map(|o| { - connection_details.add_offer( - o.id, - me, - o.user_id, - o.connection_string, - o.ice_candidates, - now, - ) - }) - .collect(); - - let result = Result { counter_offers }; - - Response::Success(result) -} - -#[derive(Deserialize)] -pub struct Request { - offers: Vec, -} - -#[derive(Deserialize)] -pub struct AddOfferRequest { - id: String, - user_id: UserId, - connection_string: String, - ice_candidates: Vec, -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), -} - -#[derive(CandidType)] -pub struct Result { - counter_offers: Vec, -} diff --git a/src/services/p2p/src/updates/mod.rs b/src/services/p2p/src/updates/mod.rs deleted file mode 100644 index 208373c02b..0000000000 --- a/src/services/p2p/src/updates/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod add_answers; -pub mod add_offers; -pub mod remove_connection_details; diff --git a/src/services/p2p/src/updates/remove_connection_details.rs b/src/services/p2p/src/updates/remove_connection_details.rs deleted file mode 100644 index a07890dfd4..0000000000 --- a/src/services/p2p/src/updates/remove_connection_details.rs +++ /dev/null @@ -1,28 +0,0 @@ -use crate::domain::connection_details::AllConnectionDetails; -use ic_cdk::storage; -use serde::Deserialize; -use shared::user_id::UserId; - -pub fn update(request: Request) -> u32 { - let me = shared::user_id::get_current(); - let connection_details: &mut AllConnectionDetails = storage::get_mut(); - - let mut count_removed = 0; - for connection in request.connections { - if connection_details.remove_connection_details(&connection.user_id, &me, &connection.id) { - count_removed += 1; - } - } - count_removed -} - -#[derive(Deserialize)] -pub struct Request { - connections: Vec, -} - -#[derive(Deserialize)] -pub struct RemoveSingleConnectionRequest { - user_id: UserId, - id: String, -} diff --git a/src/services/shared/Cargo.toml b/src/services/shared/Cargo.toml deleted file mode 100644 index fcdd23d127..0000000000 --- a/src/services/shared/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "shared" -version = "0.1.0" -authors = ["Hamish Peebles ", "Matt Grogan "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -ic-cdk = "0.2.4" -ic-types = "0.1.2" -highway = "0.6.3" -log = "0.4.14" -serde = "1.0.111" diff --git a/src/services/shared/src/accept_cycles.rs b/src/services/shared/src/accept_cycles.rs deleted file mode 100644 index 3f4e8d2107..0000000000 --- a/src/services/shared/src/accept_cycles.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub fn accept_cycles() -> u128 { - let cycles_available = ic_cdk::api::call::msg_cycles_available(); - let cycles_accepted = ic_cdk::api::call::msg_cycles_accept(cycles_available); - cycles_accepted as u128 -} diff --git a/src/services/shared/src/c2c.rs b/src/services/shared/src/c2c.rs deleted file mode 100644 index 4a1001660b..0000000000 --- a/src/services/shared/src/c2c.rs +++ /dev/null @@ -1,22 +0,0 @@ -use ic_cdk::api::call::CallResult; -use ic_cdk::export::candid::de::ArgumentDecoder; -use ic_cdk::export::candid::ser::ArgumentEncoder; -use ic_cdk::export::candid::Principal; -use log::error; - -pub async fn call_with_logging ArgumentDecoder<'a>>( - canister_id: Principal, - method_name: &str, - args: T, -) -> CallResult { - let result: CallResult = ic_cdk::call(canister_id, method_name, args).await; - - if let Err(error) = &result { - error!( - "Error calling '{}': {:?}: {}", - method_name, error.0, error.1 - ); - } - - result -} diff --git a/src/services/shared/src/chat_id.rs b/src/services/shared/src/chat_id.rs deleted file mode 100644 index 3b19421372..0000000000 --- a/src/services/shared/src/chat_id.rs +++ /dev/null @@ -1,29 +0,0 @@ -use crate::user_id::UserId; -use highway::{HighwayHash, HighwayHasher}; -use ic_cdk::export::candid::CandidType; -use serde::{Deserialize, Serialize}; -use std::ops::Shl; - -#[derive(CandidType, Serialize, Deserialize, PartialEq, Eq, Hash, Copy, Clone)] -pub struct ChatId(pub u128); - -impl ChatId { - pub fn for_direct_chat(user1: &UserId, user2: &UserId) -> ChatId { - let mut hasher = HighwayHasher::default(); - - if user1 < user2 { - hasher.append(user1.as_slice()); - hasher.append(user2.as_slice()); - } else { - hasher.append(user2.as_slice()); - hasher.append(user1.as_slice()); - } - - let hash_parts = hasher.finalize128(); - let hash1: u128 = hash_parts[0].into(); - let hash2: u128 = hash_parts[1].into(); - let hash: u128 = hash1.shl(64) + hash2; - - ChatId(hash) - } -} diff --git a/src/services/shared/src/lib.rs b/src/services/shared/src/lib.rs deleted file mode 100644 index 047389d8b0..0000000000 --- a/src/services/shared/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -use ic_cdk::export::candid::Principal; - -pub type CanisterId = Principal; - -mod accept_cycles; - -pub use accept_cycles::accept_cycles; -pub mod c2c; -pub mod chat_id; -pub mod memory; -pub mod storage; -pub mod timestamp; -pub mod user_id; diff --git a/src/services/shared/src/memory.rs b/src/services/shared/src/memory.rs deleted file mode 100644 index 735a728b5d..0000000000 --- a/src/services/shared/src/memory.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub fn get_memory_usage() -> u64 { - #[cfg(target_arch = "wasm32")] - { - (core::arch::wasm32::memory_size(0) * 65536) as u64 - } - - #[cfg(not(target_arch = "wasm32"))] - { - // This branch won't actually ever be taken - 1024 * 1024 * 100 // 100Mb - } -} diff --git a/src/services/shared/src/storage.rs b/src/services/shared/src/storage.rs deleted file mode 100644 index d572cdb82e..0000000000 --- a/src/services/shared/src/storage.rs +++ /dev/null @@ -1,52 +0,0 @@ -use ic_cdk::api::stable; -use ic_cdk::export::candid; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use serde::de::DeserializeOwned; -use std::mem; - -pub fn take_from_storage() -> T { - let from_storage: &mut T = storage::get_mut(); - - mem::take(from_storage) -} - -pub fn put_in_storage(value: T) { - let from_storage: &mut T = storage::get_mut(); - - *from_storage = value; -} - -pub fn stable_save(value: T) { - let to_save = value.drain(); - - storage::stable_save((to_save,)).unwrap(); -} - -pub fn stable_restore() -> T { - let (saved,): (T::State,) = stable_restore_hack().unwrap(); - - T::fill(saved) -} - -// This is exactly the same as the 'stable_restore' method in the cdk except we skip the 'de.done()' check -pub fn stable_restore_hack() -> Result -where - T: for<'de> candid::de::ArgumentDecoder<'de>, -{ - let bytes = stable::stable_bytes(); - - let mut de = - candid::de::IDLDeserialize::new(bytes.as_slice()).map_err(|e| format!("{:?}", e))?; - let res = candid::de::ArgumentDecoder::decode(&mut de).map_err(|e| format!("{:?}", e))?; - // The idea here is to ignore an error that comes from Candid, because we have trailing - // bytes. - // let _ = de.done(); - Ok(res) -} - -pub trait StableState: 'static + Default { - type State: CandidType + DeserializeOwned; - fn drain(self) -> Self::State; - fn fill(source: Self::State) -> Self; -} diff --git a/src/services/shared/src/timestamp.rs b/src/services/shared/src/timestamp.rs deleted file mode 100644 index 317900d298..0000000000 --- a/src/services/shared/src/timestamp.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub type Timestamp = u64; - -const NANOS_PER_MILLISECOND: u64 = 1_000_000; - -pub fn now() -> Timestamp { - (ic_cdk::api::time() as u64 / NANOS_PER_MILLISECOND) as Timestamp -} diff --git a/src/services/shared/src/user_id.rs b/src/services/shared/src/user_id.rs deleted file mode 100644 index 7aa4a2d274..0000000000 --- a/src/services/shared/src/user_id.rs +++ /dev/null @@ -1,7 +0,0 @@ -use ic_cdk::export::candid::Principal; - -pub type UserId = Principal; - -pub fn get_current() -> UserId { - ic_cdk::caller() -} diff --git a/src/services/user_mgmt/Cargo.toml b/src/services/user_mgmt/Cargo.toml deleted file mode 100644 index 1cdbd55ca3..0000000000 --- a/src/services/user_mgmt/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "user_mgmt" -version = "0.1.0" -authors = ["Hamish Peebles ", "Matt Grogan "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -path = "src/lib.rs" -crate-type = ["cdylib"] - -[dependencies] -ic-cdk = "0.2.4" -ic-cdk-macros = "0.2.4" -multi-map = "1.3.0" -serde = "1.0.111" -shared = { path = "../shared", version = "0.1.0" } diff --git a/src/services/user_mgmt/src/api.rs b/src/services/user_mgmt/src/api.rs deleted file mode 100644 index 2f277dde5a..0000000000 --- a/src/services/user_mgmt/src/api.rs +++ /dev/null @@ -1,62 +0,0 @@ -use crate::domain::user_store::{ - RegisterUserResponse, TransferCyclesResponse, UpdateUsernameResponse, -}; -use crate::queries::*; -use crate::updates::*; -use ic_cdk_macros::*; -use shared::accept_cycles; - -#[update] -pub fn register_user(username: String) -> RegisterUserResponse { - register_user::update(username) -} - -#[update] -pub fn update_username(username: String) -> UpdateUsernameResponse { - set_username::update(username) -} - -#[update] -pub fn set_profile_image(image_id: String) -> set_profile_image::Response { - set_profile_image::update(image_id) -} - -#[update] -pub fn mark_as_online() { - mark_as_online::update(); -} - -#[update] -fn wallet_receive() { - accept_cycles(); -} - -#[update] -pub fn transfer_cycles(request: transfer_cycles::Request) -> TransferCyclesResponse { - transfer_cycles::update(request) -} - -#[query] -pub fn get_current_user() -> get_current_user::Response { - get_current_user::query() -} - -#[query] -pub fn get_user_id(username: String) -> get_user_id::Response { - get_user_id::query(&username) -} - -#[query] -pub fn get_users(request: get_users::Request) -> get_users::Response { - get_users::query(request) -} - -#[query] -pub fn search_users(request: search_users::Request) -> search_users::Response { - search_users::query(request) -} - -#[query] -fn stats() -> get_stats::Stats { - get_stats::query() -} diff --git a/src/services/user_mgmt/src/domain/mod.rs b/src/services/user_mgmt/src/domain/mod.rs deleted file mode 100644 index bd9b6d2237..0000000000 --- a/src/services/user_mgmt/src/domain/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod user_store; diff --git a/src/services/user_mgmt/src/domain/user_store.rs b/src/services/user_mgmt/src/domain/user_store.rs deleted file mode 100644 index f610f8e6c5..0000000000 --- a/src/services/user_mgmt/src/domain/user_store.rs +++ /dev/null @@ -1,367 +0,0 @@ -use core::cmp::Ordering; -use ic_cdk::export::candid::CandidType; -use multi_map::MultiMap; -use serde::Deserialize; -use shared::chat_id::ChatId; -use shared::storage::StableState; -use shared::timestamp::Timestamp; -use shared::user_id::UserId; - -const MAX_USERS: u64 = 100_000; -const MAX_USERNAME_LENGTH: u16 = 25; -const MIN_USERNAME_LENGTH: u16 = 2; - -#[derive(Default)] -pub struct UserStore { - data: MultiMap, -} - -pub struct Stats { - pub user_count: u64, -} - -#[derive(CandidType, Deserialize, Debug)] -pub struct User { - id: UserId, - username: String, - joined: Timestamp, - last_online: Timestamp, - last_updated: Timestamp, - account_balance: u128, - image_id: Option, - version: u32, -} - -#[derive(CandidType)] -pub struct MyProfile { - id: UserId, - username: String, - account_balance: u128, - image_id: Option, - version: u32, -} - -#[derive(CandidType)] -pub struct UserSummary { - id: UserId, - username: String, - seconds_since_last_online: u32, - image_id: Option, - chat_id: ChatId, - version: u32, -} - -#[derive(CandidType)] -pub enum RegisterUserResponse { - Success(MyProfile), - UserExists, - UsernameTaken, - UsernameTooShort(u16), - UsernameTooLong(u16), - UserLimitReached(u64), -} - -#[derive(CandidType)] -pub enum UpdateUsernameResponse { - Success, - SuccessNoChange, - UsernameTaken, - UserNotFound, - UsernameTooShort(u16), - UsernameTooLong(u16), -} - -#[derive(CandidType)] -pub enum TransferCyclesResponse { - Success(TransferCyclesResult), - UserNotFound, - RecipientNotFound, - BalanceExceeded, -} - -#[derive(CandidType)] -pub struct TransferCyclesResult { - new_balance: u128, -} - -impl UserStore { - pub fn register_user( - &mut self, - user_id: UserId, - username: String, - now: Timestamp, - ) -> RegisterUserResponse { - // Validation - if username.len() > MAX_USERNAME_LENGTH as usize { - return RegisterUserResponse::UsernameTooLong(MAX_USERNAME_LENGTH); - } - if username.len() < MIN_USERNAME_LENGTH as usize { - return RegisterUserResponse::UsernameTooShort(MIN_USERNAME_LENGTH); - } - - if self.data.iter().count() >= (MAX_USERS as usize) { - return RegisterUserResponse::UserLimitReached(MAX_USERS); - } - - if self.data.contains_key(&user_id) { - return RegisterUserResponse::UserExists; - } - if self.data.contains_key_alt(&username) { - return RegisterUserResponse::UsernameTaken; - } - - let user = User { - id: user_id, - username: username.clone(), - joined: now, - last_online: now, - last_updated: now, - account_balance: 10_000_000_000_000, - image_id: None, - version: 1, - }; - - let my_profile = MyProfile::new(&user); - - self.data.insert(user_id, username, user); - - RegisterUserResponse::Success(my_profile) - } - - pub fn update_username( - &mut self, - user_id: UserId, - username: String, - now: Timestamp, - ) -> UpdateUsernameResponse { - // Validation - if username.len() > MAX_USERNAME_LENGTH as usize { - return UpdateUsernameResponse::UsernameTooLong(MAX_USERNAME_LENGTH); - } - if username.len() < MIN_USERNAME_LENGTH as usize { - return UpdateUsernameResponse::UsernameTooShort(MIN_USERNAME_LENGTH); - } - - if let Some(match_by_username) = self.data.get_alt(&username) { - return if match_by_username.id == user_id { - UpdateUsernameResponse::SuccessNoChange - } else { - UpdateUsernameResponse::UsernameTaken - }; - } - - if let Some(mut user) = self.data.remove(&user_id) { - user.username = username.clone(); - user.last_online = now; - user.last_updated = now; - user.version += 1; - - self.data.insert(user_id, username, user); - - UpdateUsernameResponse::Success - } else { - UpdateUsernameResponse::UserNotFound - } - } - - pub fn set_profile_image( - &mut self, - user_id: &UserId, - image_id: String, - now: Timestamp, - ) -> bool { - match self.data.get_mut(user_id) { - Some(user) => { - user.image_id = Some(image_id); - user.last_online = now; - user.last_updated = now; - user.version += 1; - true - } - None => false, - } - } - - pub fn mark_as_online(&mut self, user_id: &UserId, now: Timestamp) { - if let Some(user) = self.data.get_mut(user_id) { - user.last_online = now; - } - } - - pub fn get_user_id(&self, username: &String) -> Option { - self.data.get_alt(username).map(|u| u.id) - } - - pub fn get_my_profile(&self, user_id: &UserId) -> Option { - self.data.get(user_id).map(|u| MyProfile::new(u)) - } - - pub fn get_users( - &self, - users: Vec, - me: &UserId, - updated_since: Option, - now: Timestamp, - ) -> Vec { - fn filter(user: &User, updated_since: Timestamp) -> bool { - user.last_online > updated_since || user.last_updated > updated_since - } - - users - .iter() - .filter_map(|id| self.data.get(id)) - .filter(|u| { - if let Some(updated_since) = updated_since { - filter(u, updated_since) - } else { - true - } - }) - .map(|u| UserSummary::new(u, me, Some(now))) - .collect() - } - - pub fn search_users( - &self, - search_term: String, - max_results: u8, - me: &UserId, - now: Timestamp, - ) -> Vec { - // Filter - let search_term_lower = search_term.to_lowercase(); - let mut matches: Vec<&String> = self - .data - .iter() - .filter(|(user_id, (username, _))| { - UserStore::username_matches(&search_term_lower, username) && *user_id != me - }) - .map(|(_, (username, _))| username) - .collect(); - - // Sort - matches.sort_unstable_by(|u1, u2| UserStore::order_usernames(&search_term, *u1, *u2)); - - // Page - matches - .iter() - .take(max_results as usize) - .filter_map(|username| self.data.get_alt(username)) - .map(|u| UserSummary::new(u, me, Some(now))) - .collect() - } - - pub fn transfer_cycles( - &mut self, - my_id: &UserId, - recipient_id: &UserId, - amount: u128, - ) -> TransferCyclesResponse { - let new_balance: u128; - { - let me = self.data.get_mut(my_id); - if me.is_none() { - return TransferCyclesResponse::UserNotFound; - } - let me = me.unwrap(); - - if me.account_balance < amount { - return TransferCyclesResponse::BalanceExceeded; - } - - me.account_balance -= amount; - new_balance = me.account_balance; - } - - { - let recipient = self.data.get_mut(recipient_id); - if recipient.is_none() { - return TransferCyclesResponse::RecipientNotFound; - } - let recipient = recipient.unwrap(); - - recipient.account_balance += amount; - } - - TransferCyclesResponse::Success(TransferCyclesResult { new_balance }) - } - - pub fn get_stats(&self) -> Stats { - Stats { - user_count: self.data.iter().count() as u64, - } - } - - fn username_matches(search_term_lower: &str, username: &str) -> bool { - username.to_lowercase().starts_with(search_term_lower) - } - - fn order_usernames(search_term: &str, u1: &str, u2: &str) -> Ordering { - let u1_starts = u1.starts_with(&search_term); - let u2_starts = u2.starts_with(&search_term); - - if u1_starts != u2_starts { - if u1_starts { - Ordering::Less - } else { - Ordering::Greater - } - } else { - match u1.len().cmp(&u2.len()) { - Ordering::Less => Ordering::Less, - Ordering::Equal => u1.cmp(u2), - Ordering::Greater => Ordering::Greater, - } - } - } -} - -impl StableState for UserStore { - type State = Vec; - - fn drain(self) -> Vec { - self.data.into_iter().map(|(_, (_, u))| u).collect() - } - - fn fill(users: Vec) -> UserStore { - let mut data = MultiMap::with_capacity(users.len()); - - for user in users { - data.insert(user.id, user.username.clone(), user); - } - - UserStore { data } - } -} - -impl MyProfile { - fn new(user: &User) -> MyProfile { - MyProfile { - id: user.id, - username: user.username.clone(), - account_balance: user.account_balance, - image_id: user.image_id.clone(), - version: user.version, - } - } -} - -impl UserSummary { - // You can pass in now = None if you know that the user is online now - fn new(user: &User, me: &UserId, now: Option) -> UserSummary { - let mut seconds_since_last_online: u32 = 0; - if let Some(t) = now { - let millis_since_last_online = t - user.last_online; - seconds_since_last_online = (millis_since_last_online / 1000) as u32; - } - - UserSummary { - id: user.id, - username: user.username.clone(), - seconds_since_last_online, - image_id: user.image_id.clone(), - chat_id: ChatId::for_direct_chat(me, &user.id), - version: user.version, - } - } -} diff --git a/src/services/user_mgmt/src/lib.rs b/src/services/user_mgmt/src/lib.rs deleted file mode 100644 index 8f65e706cc..0000000000 --- a/src/services/user_mgmt/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod api; -mod domain; -mod queries; -mod updates; -mod upgrade; diff --git a/src/services/user_mgmt/src/queries/get_current_user.rs b/src/services/user_mgmt/src/queries/get_current_user.rs deleted file mode 100644 index 0b05b50303..0000000000 --- a/src/services/user_mgmt/src/queries/get_current_user.rs +++ /dev/null @@ -1,20 +0,0 @@ -use self::Response::*; -use crate::domain::user_store::{MyProfile, UserStore}; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; - -pub fn query() -> Response { - let me = shared::user_id::get_current(); - let user_store: &UserStore = storage::get(); - - match user_store.get_my_profile(&me) { - None => UserNotFound, - Some(my_profile) => Success(my_profile), - } -} - -#[derive(CandidType)] -pub enum Response { - Success(MyProfile), - UserNotFound, -} diff --git a/src/services/user_mgmt/src/queries/get_stats.rs b/src/services/user_mgmt/src/queries/get_stats.rs deleted file mode 100644 index aaf72fe3f6..0000000000 --- a/src/services/user_mgmt/src/queries/get_stats.rs +++ /dev/null @@ -1,27 +0,0 @@ -use crate::domain::user_store::UserStore; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::memory::get_memory_usage; -use shared::timestamp; -use shared::user_id::UserId; - -pub fn query() -> Stats { - let user_store: &UserStore = storage::get(); - let user_stats = user_store.get_stats(); - Stats { - memory_used: get_memory_usage(), - timestamp: timestamp::now(), - user_id: shared::user_id::get_current(), - cycles_balance: ic_cdk::api::canister_balance(), - user_count: user_stats.user_count, - } -} - -#[derive(CandidType)] -pub struct Stats { - memory_used: u64, - timestamp: u64, - user_id: UserId, - cycles_balance: i64, - user_count: u64, -} diff --git a/src/services/user_mgmt/src/queries/get_user_id.rs b/src/services/user_mgmt/src/queries/get_user_id.rs deleted file mode 100644 index f47fcc184e..0000000000 --- a/src/services/user_mgmt/src/queries/get_user_id.rs +++ /dev/null @@ -1,20 +0,0 @@ -use self::Response::*; -use crate::domain::user_store::UserStore; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::user_id::UserId; - -pub fn query(username: &String) -> Response { - let user_store: &UserStore = storage::get(); - - match user_store.get_user_id(username) { - None => UserNotFound, - Some(user_id) => Success(user_id), - } -} - -#[derive(CandidType)] -pub enum Response { - Success(UserId), - UserNotFound, -} diff --git a/src/services/user_mgmt/src/queries/get_users.rs b/src/services/user_mgmt/src/queries/get_users.rs deleted file mode 100644 index 3e8be1cfd2..0000000000 --- a/src/services/user_mgmt/src/queries/get_users.rs +++ /dev/null @@ -1,39 +0,0 @@ -use self::Response::*; -use crate::domain::user_store::{UserStore, UserSummary}; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use serde::Deserialize; -use shared::user_id::UserId; -use shared::{timestamp, timestamp::Timestamp}; - -pub fn query(request: Request) -> Response { - let me = shared::user_id::get_current(); - let user_store: &UserStore = storage::get(); - let now = timestamp::now(); - - let users = user_store.get_users(request.users, &me, request.updated_since, now); - - let result = Result { - users, - timestamp: now, - }; - - Success(result) -} - -#[derive(Deserialize)] -pub struct Request { - users: Vec, - updated_since: Option, -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), -} - -#[derive(CandidType)] -pub struct Result { - users: Vec, - timestamp: Timestamp, -} diff --git a/src/services/user_mgmt/src/queries/mod.rs b/src/services/user_mgmt/src/queries/mod.rs deleted file mode 100644 index 431e83d214..0000000000 --- a/src/services/user_mgmt/src/queries/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod get_current_user; -pub mod get_stats; -pub mod get_user_id; -pub mod get_users; -pub mod search_users; diff --git a/src/services/user_mgmt/src/queries/search_users.rs b/src/services/user_mgmt/src/queries/search_users.rs deleted file mode 100644 index f579484171..0000000000 --- a/src/services/user_mgmt/src/queries/search_users.rs +++ /dev/null @@ -1,37 +0,0 @@ -use self::Response::*; -use crate::domain::user_store::{UserStore, UserSummary}; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use serde::Deserialize; -use shared::timestamp; - -const MAX_SEARCH_TERM_LENGTH: usize = 25; - -pub fn query(request: Request) -> Response { - let mut search_term = request.search_term; - search_term.truncate(MAX_SEARCH_TERM_LENGTH); - - let me = shared::user_id::get_current(); - let user_store: &UserStore = storage::get(); - let now = timestamp::now(); - - let users = user_store.search_users(search_term, request.max_results, &me, now); - - Success(Result { users }) -} - -#[derive(Deserialize)] -pub struct Request { - search_term: String, - max_results: u8, -} - -#[derive(CandidType)] -pub enum Response { - Success(Result), -} - -#[derive(CandidType)] -pub struct Result { - users: Vec, -} diff --git a/src/services/user_mgmt/src/updates/mark_as_online.rs b/src/services/user_mgmt/src/updates/mark_as_online.rs deleted file mode 100644 index 10cf890cc2..0000000000 --- a/src/services/user_mgmt/src/updates/mark_as_online.rs +++ /dev/null @@ -1,12 +0,0 @@ -use crate::domain::user_store::UserStore; -use ic_cdk::storage; -use shared::timestamp; - -pub fn update() { - let me = shared::user_id::get_current(); - let now = timestamp::now(); - - let user_store: &mut UserStore = storage::get_mut(); - - user_store.mark_as_online(&me, now); -} diff --git a/src/services/user_mgmt/src/updates/mod.rs b/src/services/user_mgmt/src/updates/mod.rs deleted file mode 100644 index e55f0bf799..0000000000 --- a/src/services/user_mgmt/src/updates/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod mark_as_online; -pub mod register_user; -pub mod set_profile_image; -pub mod set_username; -pub mod transfer_cycles; diff --git a/src/services/user_mgmt/src/updates/register_user.rs b/src/services/user_mgmt/src/updates/register_user.rs deleted file mode 100644 index 3e4e92b12b..0000000000 --- a/src/services/user_mgmt/src/updates/register_user.rs +++ /dev/null @@ -1,12 +0,0 @@ -use crate::domain::user_store::{RegisterUserResponse, UserStore}; -use ic_cdk::storage; -use shared::timestamp; - -pub fn update(username: String) -> RegisterUserResponse { - let me = shared::user_id::get_current(); - let now = timestamp::now(); - - let user_store: &mut UserStore = storage::get_mut(); - - user_store.register_user(me, username, now) -} diff --git a/src/services/user_mgmt/src/updates/set_profile_image.rs b/src/services/user_mgmt/src/updates/set_profile_image.rs deleted file mode 100644 index 3a87b73ce1..0000000000 --- a/src/services/user_mgmt/src/updates/set_profile_image.rs +++ /dev/null @@ -1,23 +0,0 @@ -use self::Response::*; -use crate::domain::user_store::UserStore; -use ic_cdk::export::candid::CandidType; -use ic_cdk::storage; -use shared::timestamp; - -pub fn update(image_id: String) -> Response { - let me = shared::user_id::get_current(); - let now = timestamp::now(); - - let user_store: &mut UserStore = storage::get_mut(); - - match user_store.set_profile_image(&me, image_id, now) { - false => UserNotFound, - true => Success, - } -} - -#[derive(CandidType)] -pub enum Response { - Success, - UserNotFound, -} diff --git a/src/services/user_mgmt/src/updates/set_username.rs b/src/services/user_mgmt/src/updates/set_username.rs deleted file mode 100644 index 11a0d5ef4b..0000000000 --- a/src/services/user_mgmt/src/updates/set_username.rs +++ /dev/null @@ -1,12 +0,0 @@ -use crate::domain::user_store::{UpdateUsernameResponse, UserStore}; -use ic_cdk::storage; -use shared::timestamp; - -pub fn update(username: String) -> UpdateUsernameResponse { - let me = shared::user_id::get_current(); - let now = timestamp::now(); - - let user_store: &mut UserStore = storage::get_mut(); - - user_store.update_username(me, username, now) -} diff --git a/src/services/user_mgmt/src/updates/transfer_cycles.rs b/src/services/user_mgmt/src/updates/transfer_cycles.rs deleted file mode 100644 index 7f2f8a35a5..0000000000 --- a/src/services/user_mgmt/src/updates/transfer_cycles.rs +++ /dev/null @@ -1,18 +0,0 @@ -use crate::domain::user_store::TransferCyclesResponse; -use crate::domain::user_store::UserStore; -use ic_cdk::storage; -use serde::Deserialize; -use shared::user_id::UserId; - -pub fn update(request: Request) -> TransferCyclesResponse { - let user_store: &mut UserStore = storage::get_mut(); - - user_store.transfer_cycles(&request.sender, &request.recipient, request.amount) -} - -#[derive(Deserialize)] -pub struct Request { - sender: UserId, - recipient: UserId, - amount: u128, -} diff --git a/src/services/user_mgmt/src/upgrade.rs b/src/services/user_mgmt/src/upgrade.rs deleted file mode 100644 index 4e377ea8be..0000000000 --- a/src/services/user_mgmt/src/upgrade.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::domain::user_store::UserStore; -use ic_cdk_macros::*; -use shared::storage; - -#[pre_upgrade] -fn pre_upgrade() { - storage::stable_save::(storage::take_from_storage()); -} - -#[post_upgrade] -fn post_upgrade() { - storage::put_in_storage(storage::stable_restore::()); -} diff --git a/src/services/user_mgmt/user_mgmt.did b/src/services/user_mgmt/user_mgmt.did deleted file mode 100644 index 3969cca568..0000000000 --- a/src/services/user_mgmt/user_mgmt.did +++ /dev/null @@ -1,127 +0,0 @@ -type ChatId = nat; -type UserId = principal; -type Timestamp = nat64; - -type UserSummary = - record { - id: UserId; - username: text; - seconds_since_last_online: nat32; - image_id: opt text; - chat_id: ChatId; - version: nat32; - }; - -type MyProfile = - record { - id: UserId; - username: text; - account_balance: nat; - image_id: opt text; - version: nat32; - }; - -type RegisterUserResponse = - variant { - Success: MyProfile; - UserExists; - UsernameTaken; - UserLimitReached: nat64; - UsernameTooShort: nat16; - UsernameTooLong: nat16; - }; - -type UpdateUsernameResponse = - variant { - Success; - SuccessNoChange; - UsernameTaken; - UserNotFound; - UsernameTooShort: nat16; - UsernameTooLong: nat16; - }; - -type SetProfileImageResponse = - variant { - Success; - UserNotFound; - }; - -type TransferCyclesRequest = - record { - sender: UserId; - recipient: UserId; - amount: nat; - }; - -type TransferCyclesResponse = - variant { - Success: record { - new_balance: nat; - }; - UserNotFound; - RecipientNotFound; - BalanceExceeded; - }; - -type GetCurrentUserResponse = - variant { - Success: MyProfile; - UserNotFound; - }; - -type GetUserIdResponse = - variant { - Success: UserId; - UserNotFound; - }; - -type GetUsersRequest = - record { - users: vec UserId; - updated_since: opt Timestamp; - }; - -type GetUsersResponse = - variant { - Success: record { - users: vec UserSummary; - timestamp: Timestamp; - } - }; - -type SearchUsersRequest = - record { - search_term: text; - max_results: nat8 - }; - -type SearchUsersResponse = - variant { - Success: record { - users: vec UserSummary; - } - }; - -type Stats = - record { - memory_used: nat64; - timestamp: nat64; - user_id: UserId; - cycles_balance: int64; - user_count: nat64; - }; - -service : { - register_user: (text) -> (RegisterUserResponse); - update_username: (text) -> (UpdateUsernameResponse); - set_profile_image: (text) -> (SetProfileImageResponse); - mark_as_online: () -> (); - transfer_cycles: (TransferCyclesRequest) -> (TransferCyclesResponse); - - get_current_user: () -> (GetCurrentUserResponse) query; - get_user_id: (text) -> (GetUserIdResponse) query; - get_users: (GetUsersRequest) -> (GetUsersResponse) query; - search_users: (SearchUsersRequest) -> (SearchUsersResponse) query; - stats: () -> (Stats) query; -} \ No newline at end of file diff --git a/src/website/actions/app/changeSidePanel.ts b/src/website/actions/app/changeSidePanel.ts deleted file mode 100644 index e64c3c4f61..0000000000 --- a/src/website/actions/app/changeSidePanel.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { LeftPanelType, RightPanelType } from "../../domain/model/panels"; - -export const LEFT_PANEL_CHANGED = "LEFT_PANEL_CHANGED"; -export const MIDDLE_PANEL_CHANGED = "MIDDLE_PANEL_CHANGED"; -export const RIGHT_PANEL_CHANGED = "RIGHT_PANEL_CHANGED"; - -export function changeLeftPanel(sidePanel: LeftPanelType) { - return { - type: LEFT_PANEL_CHANGED, - payload: sidePanel - }; -} - -export function changeRightPanel(sidePanel: RightPanelType) { - return { - type: RIGHT_PANEL_CHANGED, - payload: sidePanel - }; -} - -export type LeftPanelChangedEvent = { - type: typeof LEFT_PANEL_CHANGED, - payload: LeftPanelType -} - -export type RightPanelChangedEvent = { - type: typeof RIGHT_PANEL_CHANGED, - payload: RightPanelType -} - diff --git a/src/website/actions/app/gotoHome.ts b/src/website/actions/app/gotoHome.ts deleted file mode 100644 index 4f7093241e..0000000000 --- a/src/website/actions/app/gotoHome.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const GOTO_HOME = "GOTO_HOME"; - -export default function() { - return { type: GOTO_HOME }; -} - -export type GotoHomeEvent = { - type: typeof GOTO_HOME -} diff --git a/src/website/actions/app/modalSpinner.ts b/src/website/actions/app/modalSpinner.ts deleted file mode 100644 index f4294e74e6..0000000000 --- a/src/website/actions/app/modalSpinner.ts +++ /dev/null @@ -1,22 +0,0 @@ -export const START_SPINNING = "START_SPINNING"; -export const STOP_SPINNING = "STOP_SPINNING"; - -export function startSpinning() : StartSpinningEvent { - return { - type: START_SPINNING - }; -} - -export function stopSpinning() : StopSpinningEvent { - return { - type: STOP_SPINNING - }; -} - -export type StartSpinningEvent = { - type: typeof START_SPINNING, -} - -export type StopSpinningEvent = { - type: typeof STOP_SPINNING, -} \ No newline at end of file diff --git a/src/website/actions/app/selectTheme.ts b/src/website/actions/app/selectTheme.ts deleted file mode 100644 index 12f010ae10..0000000000 --- a/src/website/actions/app/selectTheme.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { SelectedTheme } from "../../domain/model/theme"; - -export const THEME_SELECTED = "THEME_SELECTED"; - -export default function selectTheme(theme: SelectedTheme) { - return { - type: THEME_SELECTED, - payload: theme - }; -} - -export type ThemeSelectedEvent = { - type: typeof THEME_SELECTED, - payload: SelectedTheme -} diff --git a/src/website/actions/app/switchViewMode.ts b/src/website/actions/app/switchViewMode.ts deleted file mode 100644 index 198288e601..0000000000 --- a/src/website/actions/app/switchViewMode.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Dispatch } from "react"; -import { ViewMode } from "src/website/domain/model/viewMode"; -import { RootState } from "../../reducers"; - -export const SWITCH_VIEW_MODE_REQUESTED = "SWITCH_VIEW_MODE_REQUESTED"; - -export default function(viewMode: ViewMode) { - return (dispatch: Dispatch, getState: () => RootState) => { - const selectedChatIndex = getState().chatsState.selectedChatIndex; - const event: SwitchViewModeRequestedEvent = { - type: SWITCH_VIEW_MODE_REQUESTED, - payload: { - viewMode, - isChatSelected: selectedChatIndex != null - } - }; - dispatch(event); - }; -} - -export type SwitchViewModeRequestedEvent = { - type: typeof SWITCH_VIEW_MODE_REQUESTED, - payload: SwitchViewPaylod -} - -export type SwitchViewPaylod = { - viewMode: ViewMode, - isChatSelected: boolean -} \ No newline at end of file diff --git a/src/website/actions/chats/addParticipants.ts b/src/website/actions/chats/addParticipants.ts deleted file mode 100644 index 4b1bd20662..0000000000 --- a/src/website/actions/chats/addParticipants.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Dispatch } from "react"; -import chatsService from "../../services/chats/service"; -import { UserId } from "../../domain/model/users"; -import { ChatId, GroupChat } from "../../domain/model/chats"; -import { UNCONFIRMED_GROUP_CHAT } from "../../constants"; -import Stopwatch from "../../utils/Stopwatch"; -import { startSpinning, stopSpinning } from "../app/modalSpinner"; -import { alertDialog } from "../../components/modals/Alert"; -import * as setFunctions from "../../utils/setFunctions"; - -export const ADD_PARTICIPANTS_SUCCEEDED = "ADD_PARTICIPANTS_SUCCEEDED"; - -export default function(chat: GroupChat, userIds: UserId[]) { - return async (dispatch: Dispatch) => { - - if (chat.kind === UNCONFIRMED_GROUP_CHAT) - return; - - dispatch(startSpinning()); - - const timer = Stopwatch.startNew(); - - const response = await chatsService.addParticipants(chat.chatId, userIds); - - if (response.kind === "success" || response.kind === "partialSuccess") { - let usersAdded = userIds; - - if (response.kind === "partialSuccess") { - setFunctions.exceptWith(usersAdded, response.blocked); - let text = "You can't add users if you are blocking them or they are blocking you"; - let title = "User not added"; - if (userIds.length > 1) { - if (response.countAdded == 0) { - title = "No users added"; - } else { - title = `Only ${response.countAdded} users added`; - } - } - alertDialog({ title, text }); - } - - if (response.countAdded > 0) { - dispatch({ - type: ADD_PARTICIPANTS_SUCCEEDED, - payload: { - chatId: chat.chatId, - users: usersAdded, - durationMs: timer.getElapsedMs() - } - } as AddParticipantsSucceededEvent); - } - } - - dispatch(stopSpinning()); - }; -} - -export type AddParticipantsSucceededEvent = { - type: typeof ADD_PARTICIPANTS_SUCCEEDED, - payload: { - chatId: ChatId, - users: UserId[], - durationMs: number - } -} diff --git a/src/website/actions/chats/blockUser.ts b/src/website/actions/chats/blockUser.ts deleted file mode 100644 index 3457cf431e..0000000000 --- a/src/website/actions/chats/blockUser.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Dispatch } from "react"; -import { UserId } from "../../domain/model/users"; -import chatsService from "../../services/chats/service"; -import { startSpinning, stopSpinning } from "../app/modalSpinner"; - -export const USER_BLOCKED = "USER_BLOCKED"; -export const USER_UNBLOCKED = "USER_UNBLOCKED"; - -export function blockUser(userId: UserId, unblock: boolean) { - return async (dispatch: Dispatch) : Promise => { - dispatch(startSpinning()); - await chatsService.blockUser(userId, unblock); - let event: UserBlockedEvent | UserUnblockedEvent = { - type: unblock ? USER_UNBLOCKED : USER_BLOCKED, - payload: { - userId - } - }; - dispatch(event); - dispatch(stopSpinning()); - } -} - -export type UserBlockedEvent = { - type: typeof USER_BLOCKED, - payload: { - userId: UserId - } -} - -export type UserUnblockedEvent = { - type: typeof USER_UNBLOCKED, - payload: { - userId: UserId - } -} \ No newline at end of file diff --git a/src/website/actions/chats/createGroupChat.ts b/src/website/actions/chats/createGroupChat.ts deleted file mode 100644 index bb4d9c0c37..0000000000 --- a/src/website/actions/chats/createGroupChat.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { Dispatch } from "react"; - -import chatsService from "../../services/chats/service"; -import * as chatFunctions from "../../domain/model/chats"; -import { ChatId, ConfirmedGroupChat, UnconfirmedGroupChat } from "../../domain/model/chats"; -import { UserId } from "../../domain/model/users"; -import { RootState } from "../../reducers"; - -import sendMessage from "./sendMessage"; -import { TextContent } from "../../domain/model/messages"; -import Stopwatch from "../../utils/Stopwatch"; -import { CreateGroupChatResponse } from "../../services/chats/createGroupChat"; - -export const CREATE_GROUP_CHAT_REQUESTED = "CREATE_GROUP_CHAT_REQUESTED"; -export const CREATE_GROUP_CHAT_SUCCEEDED = "CREATE_GROUP_CHAT_SUCCEEDED"; -export const CREATE_GROUP_CHAT_FAILED = "CREATE_GROUP_CHAT_FAILED"; - -export default function(subject: string, users: UserId[], chatHistoryVisibleToNewJoiners: boolean) { - return async (dispatch: Dispatch, getState: () => RootState) => { - const timer = Stopwatch.startNew(); - const chatId = chatFunctions.generateChatId(); - - const requestEvent: CreateGroupChatRequestedEvent = { - type: CREATE_GROUP_CHAT_REQUESTED, - payload: { - chatId, - subject, - users - } - }; - - dispatch(requestEvent); - - const response = await chatsService.createGroupChat(chatId, subject, users, chatHistoryVisibleToNewJoiners); - - if (response.kind !== "success") { - dispatch({ - type: CREATE_GROUP_CHAT_FAILED, - payload: { - chatId, - subject, - users, - response - } - } as CreateGroupChatFailedEvent); - - return; - } - - // Messages may have been added on the UI before the chat was confirmed on the back end. These messages will - // have been added to the 'chat.unconfirmedMessages' array. So we need to read the values out of this array, - // then apply the state change to confirm the chat, then send those messages using the new chatId. - const oldChat = chatFunctions.getChat(getState().chatsState.chats, chatId)[0] as UnconfirmedGroupChat; - - dispatch({ - type: CREATE_GROUP_CHAT_SUCCEEDED, - payload: { - chatId, - chat: response.result, - durationMs: timer.getElapsedMs() - } - } as CreateGroupChatSucceededEvent); - - const messagesToSend = oldChat.messages; - - if (messagesToSend.length) { - const chat = chatFunctions.getChat(getState().chatsState.chats, chatId)[0] as ConfirmedGroupChat; - messagesToSend.forEach(m => dispatch(sendMessage(chat, m.content as TextContent, m.repliesTo))); - } - } -} - -export type CreateGroupChatRequestedEvent = { - type: typeof CREATE_GROUP_CHAT_REQUESTED, - payload: { - chatId: ChatId, - subject: string, - users: UserId[] - } -} - -export type CreateGroupChatSucceededEvent = { - type: typeof CREATE_GROUP_CHAT_SUCCEEDED, - payload: { - chatId: ChatId, - chat: ConfirmedGroupChat, - durationMs: number - } -} - -export type CreateGroupChatFailedEvent = { - type: typeof CREATE_GROUP_CHAT_FAILED, - payload: { - chatId: ChatId, - subject: string, - users: UserId[], - response: CreateGroupChatResponse - } -} diff --git a/src/website/actions/chats/deselectMessage.ts b/src/website/actions/chats/deselectMessage.ts deleted file mode 100644 index 475a7c81a2..0000000000 --- a/src/website/actions/chats/deselectMessage.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ChatId } from "../../domain/model/chats"; - -export const DESELECT_MESSAGE = "DESELECT_MESSAGE"; - -export default function(chatId: ChatId) : DeselectMessageEvent { - return { - type: DESELECT_MESSAGE, - payload: { - chatId - } - }; -} - -export type DeselectMessageEvent = { - type: typeof DESELECT_MESSAGE, - payload: { - chatId: ChatId, - } -} \ No newline at end of file diff --git a/src/website/actions/chats/getAllChats.ts b/src/website/actions/chats/getAllChats.ts deleted file mode 100644 index 8eb89eafc3..0000000000 --- a/src/website/actions/chats/getAllChats.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { Dispatch } from "react"; -import { RootState } from "../../reducers"; -import chatsService from "../../services/chats/service"; -import { ConfirmedChat } from "../../domain/model/chats"; -import * as chatFunctions from "../../domain/model/chats"; -import { ABOUT_US, PAGE_SIZE } from "../../constants"; -import { Option, Timestamp } from "../../domain/model/common"; -import { HttpError } from "../../errors/httpError"; -import { ViewMode } from "../../domain/model/viewMode"; -import { extractChatIdFromLocation } from "../../domain/historyFunctions"; -import { UserId } from "../../domain/model/users"; -import { alertDialog } from "../../components/modals/Alert"; - -export const GET_ALL_CHATS_REQUESTED = "GET_ALL_CHATS_REQUESTED"; -export const GET_ALL_CHATS_SUCCEEDED = "GET_ALL_CHATS_SUCCEEDED"; -export const GET_ALL_CHATS_FAILED = "GET_ALL_CHATS_FAILED"; - -export default function() { - return async (dispatch: Dispatch, getState: () => RootState) => { - - const requestEvent: GetAllChatsRequestedEvent = { - type: GET_ALL_CHATS_REQUESTED - }; - - dispatch(requestEvent); - - const response = await chatsService.getUpdates({ - updatedSince: null, - messageCountForTopChat: PAGE_SIZE - }); - - let outcomeEvent; - if (response.kind === "success") { - const viewMode = getState().appState.viewMode; - const chats = response.chats; - let chatIndex = (chats.length > 0 && viewMode === ViewMode.Desktop) ? 0 : null; - const selectedChatId = extractChatIdFromLocation(); - if (selectedChatId != null) { - const [ _, index ] = chatFunctions.tryGetChat(chats, selectedChatId); - if (index >= 0) { - chatIndex = index; - } - } - - outcomeEvent = { - type: GET_ALL_CHATS_SUCCEEDED, - payload: { - chats: response.chats, - blockedUsers: response.blockedUsers, - latestUpdateTimestamp: response.latestUpdateTimestamp, - selectedChatIndex: chatIndex - - } - } as GetAllChatsSucceededEvent; - - if (chats.length == 0) { - alertDialog(ABOUT_US); - } - } else { - outcomeEvent = { - type: GET_ALL_CHATS_FAILED, - httpError: response.kind === "httpError" ? response : undefined - } as GetAllChatsFailedEvent; - } - - dispatch(outcomeEvent); - } -} - -export type GetAllChatsRequestedEvent = { - type: typeof GET_ALL_CHATS_REQUESTED -} - -export type GetAllChatsSucceededEvent = { - type: typeof GET_ALL_CHATS_SUCCEEDED, - payload: { - chats: ConfirmedChat[], - blockedUsers: UserId[], - latestUpdateTimestamp: Option, - selectedChatIndex: Option - } -} - -export type GetAllChatsFailedEvent = { - type: typeof GET_ALL_CHATS_FAILED, - httpError?: HttpError -} diff --git a/src/website/actions/chats/getMessages.ts b/src/website/actions/chats/getMessages.ts deleted file mode 100644 index fa8511e248..0000000000 --- a/src/website/actions/chats/getMessages.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Dispatch } from "react"; - -import chatsService from "../../services/chats/service"; -import { ChatId } from "../../domain/model/chats"; -import { GetMessagesResult } from "../../services/chats/getMessages"; - -export const GET_MESSAGES_REQUESTED = "GET_MESSAGES_REQUESTED"; -export const GET_MESSAGES_SUCCEEDED = "GET_MESSAGES_SUCCEEDED"; -export const GET_MESSAGES_FAILED = "GET_MESSAGES_FAILED"; - -export default function(chatId: ChatId, fromId: number, count: number) { - return async (dispatch: Dispatch) => { - const request: GetMessagesRequest = { - chatId, - fromId, - count - }; - - const requestEvent: GetMessagesRequestedEvent = { - type: GET_MESSAGES_REQUESTED, - payload: request - }; - - dispatch(requestEvent); - - const response = await chatsService.getMessages(chatId, fromId, count); - - let outcomeEvent; - if (response.kind === "success") { - outcomeEvent = { - type: GET_MESSAGES_SUCCEEDED, - payload: { - request: request, - result: response.result - } - } as GetMessagesSucceededEvent; - } else { - outcomeEvent = { - type: GET_MESSAGES_FAILED, - payload: request - } as GetMessagesFailedEvent; - } - - dispatch(outcomeEvent); - } -} - -export type GetMessagesRequestedEvent = { - type: typeof GET_MESSAGES_REQUESTED, - payload: GetMessagesRequest -} - -export type GetMessagesSucceededEvent = { - type: typeof GET_MESSAGES_SUCCEEDED, - payload: { - request: GetMessagesRequest, - result: GetMessagesResult - } -} - -export type GetMessagesFailedEvent = { - type: typeof GET_MESSAGES_FAILED, - payload: GetMessagesRequest -} - -export type GetMessagesRequest = { - chatId: ChatId, - fromId: number, - count: number -} diff --git a/src/website/actions/chats/getMessagesById.ts b/src/website/actions/chats/getMessagesById.ts deleted file mode 100644 index 294b4432f9..0000000000 --- a/src/website/actions/chats/getMessagesById.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Dispatch } from "react"; -import chatsService from "../../services/chats/service"; -import { ChatId } from "../../domain/model/chats"; -import { GetMessagesResult } from "../../services/chats/getMessages"; - -export const GET_MESSAGES_BY_ID_REQUESTED = "GET_MESSAGES_BY_ID_REQUESTED"; -export const GET_MESSAGES_BY_ID_SUCCEEDED = "GET_MESSAGES_BY_ID_SUCCEEDED"; -export const GET_MESSAGES_BY_ID_FAILED = "GET_MESSAGES_BY_ID_FAILED"; - -export default function(chatId: ChatId, messageIds: number[]) { - return async (dispatch: Dispatch) => { - const request: GetMessagesByIdRequest = { - chatId, - messageIds - }; - - const requestEvent: GetMessagesByIdRequestedEvent = { - type: GET_MESSAGES_BY_ID_REQUESTED, - payload: request - }; - - dispatch(requestEvent); - - const response = await chatsService.getMessagesById(chatId, messageIds); - - let outcomeEvent: GetMessagesByIdReponseEvent; - - if (response.kind === "success") { - outcomeEvent = { - type: GET_MESSAGES_BY_ID_SUCCEEDED, - payload: { - request: request, - result: response.result - } - }; - } else { - outcomeEvent = { - type: GET_MESSAGES_BY_ID_FAILED, - payload: request - }; - } - - dispatch(outcomeEvent); - } -} - -export type GetMessagesByIdRequestedEvent = { - type: typeof GET_MESSAGES_BY_ID_REQUESTED, - payload: GetMessagesByIdRequest -} - -export type GetMessagesByIdReponseEvent = GetMessagesByIdSucceededEvent | GetMessagesByIdFailedEvent; - -export type GetMessagesByIdSucceededEvent = { - type: typeof GET_MESSAGES_BY_ID_SUCCEEDED, - payload: { - request: GetMessagesByIdRequest, - result: GetMessagesResult - } -} - -export type GetMessagesByIdFailedEvent = { - type: typeof GET_MESSAGES_BY_ID_FAILED, - payload: GetMessagesByIdRequest -} - -export type GetMessagesByIdRequest = { - chatId: ChatId, - messageIds: number[] -} diff --git a/src/website/actions/chats/getUpdatedChats.ts b/src/website/actions/chats/getUpdatedChats.ts deleted file mode 100644 index 5ff6dc1bff..0000000000 --- a/src/website/actions/chats/getUpdatedChats.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { Dispatch } from "react"; - -import chatsService from "../../services/chats/service"; -import { ConfirmedChat } from "../../domain/model/chats"; -import { Option, Timestamp } from "../../domain/model/common"; -import { HttpError } from "../../errors/httpError"; -import { UserId } from "../../domain/model/users"; - -export const GET_UPDATED_CHATS_REQUESTED = "GET_UPDATED_CHATS_REQUESTED"; -export const GET_UPDATED_CHATS_SUCCEEDED = "GET_UPDATED_CHATS_SUCCEEDED"; -export const GET_UPDATED_CHATS_FAILED = "GET_UPDATED_CHATS_FAILED"; - -export default function(updatedSince: Option) { - return async (dispatch: Dispatch) : Promise => { - // This function is called every second and we do not currently listen for GET_UPDATED_CHATS_REQUESTED event so - // in order to remove noise and aid debugging these events are not being dispatched for now. - // - // const requestEvent: GetUpdatedChatsRequestedEvent = { - // type: GET_UPDATED_CHATS_REQUESTED - // }; - // - // dispatch(requestEvent); - - const response = await chatsService.getUpdates({ - updatedSince: updatedSince, - messageCountForTopChat: null - }); - - let outcomeEvent : GetUpdatedChatsSucceededEvent | GetUpdatedChatsFailedEvent; - if (response.kind === "success") { - outcomeEvent = { - type: GET_UPDATED_CHATS_SUCCEEDED, - payload: { - chats: response.chats, - blockedUsers: response.blockedUsers, - latestUpdateTimestamp: response.latestUpdateTimestamp - } - } as GetUpdatedChatsSucceededEvent; - } else { - outcomeEvent = { - type: GET_UPDATED_CHATS_FAILED, - httpError: response.kind === "httpError" ? response : undefined - } as GetUpdatedChatsFailedEvent; - } - - // This function is called every second and the only events that make any state changes are the - // GET_UPDATED_CHATS_SUCCEEDED which have non-empty chats. So we can ignore the events with empty chats. - if (outcomeEvent.type !== GET_UPDATED_CHATS_SUCCEEDED || outcomeEvent.payload.chats.length) { - dispatch(outcomeEvent); - } - - return outcomeEvent; - } -} - -export type GetUpdatedChatsRequestedEvent = { - type: typeof GET_UPDATED_CHATS_REQUESTED -} - -export type GetUpdatedChatsSucceededEvent = { - type: typeof GET_UPDATED_CHATS_SUCCEEDED, - payload: { - chats: ConfirmedChat[], - blockedUsers: UserId[], - latestUpdateTimestamp: Option - } -} - -export type GetUpdatedChatsFailedEvent = { - type: typeof GET_UPDATED_CHATS_FAILED, - httpError?: HttpError -} diff --git a/src/website/actions/chats/gotoChat.ts b/src/website/actions/chats/gotoChat.ts deleted file mode 100644 index 3e0a1d2fb8..0000000000 --- a/src/website/actions/chats/gotoChat.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { Dispatch } from "react"; -import { Option } from "../../domain/model/common"; -import { LocalMessage } from "../../domain/model/messages"; -import { RootState } from "../../reducers"; -import { ChatsState } from "../../reducers/chatsReducer"; -import chatsService from "../../services/chats/service"; -import * as chatFunctions from "../../domain/model/chats"; -import CurrentUserTypingHandler from "../../domain/CurrentUserTypingHandler"; -import MarkAsReadHandler from "../../domain/MarkAsReadHandler"; -import { ChatId, ConfirmedChat } from "../../domain/model/chats"; -import * as notifications from "../../notifications"; - -export const GOTO_CHAT = "GOTO_CHAT"; - -export function gotoChatById(chatId: ChatId, messageId?: number, fromHistory?: boolean) { - return async (dispatch: Dispatch, getState: () => RootState) => { - let chatsState = getState().chatsState; - let chatIndex = chatFunctions.findChatIndex(chatsState.chats, chatId); - if (chatIndex == -1) { - chatIndex = 0; - } - return gotoChat(dispatch, chatsState, chatIndex, messageId, fromHistory); - } -} - -export function gotoChatByIndex(chatIndex: number, messageId?: number) { - return async (dispatch: Dispatch, getState: () => RootState) => { - return gotoChat(dispatch, getState().chatsState, chatIndex, messageId, false); - } -} - -async function gotoChat(dispatch: Dispatch, chatsState: ChatsState, chatIndex: number, messageId?: number, fromHistory?: boolean) : Promise> { - if (chatIndex === chatsState.selectedChatIndex && !messageId) { - return null; - } - - if (chatsState.selectedChatIndex != null && chatIndex !== chatsState.selectedChatIndex) { - const prevChat = chatsState.chats[chatsState.selectedChatIndex]; - if (chatFunctions.isConfirmedChat(prevChat)) { - CurrentUserTypingHandler.markTypingStopped(prevChat.chatId); - MarkAsReadHandler.updateServer(); - } - } - - let missingMessages: LocalMessage[] = []; - - const chat = chatsState.chats[chatIndex] as ConfirmedChat; - if (chat) { - // Load missing messages if necessary - if (messageId) { - const messages = await loadMissingMessages(chat, messageId); - if (messages != null) { - missingMessages = messages; - // The message was missing - check that we now have it - if (messages.find(m => m.id === messageId) == undefined) { - messageId = undefined; - } - } - } - - notifications.close(chat.chatId); - } - - const event: GotoChatEvent = { - type: GOTO_CHAT, - payload: { - chatIndex, - messageId: messageId ?? null, - missingMessages, - fromHistory: fromHistory ?? false - } - }; - - dispatch(event); - - return event; -} - -async function loadMissingMessages(chat: ConfirmedChat, messageId: number) : Promise> { - const excessMessages = 20; - const from = Math.max(1, messageId - excessMessages); - const to = chat.minLocalMessageId ?? (messageId + excessMessages); - - let pageSize = to - from; - if (pageSize <= 0) { - return null; - } - - // Load missing messages - const result = await chatsService.getMessages(chat.chatId, from, pageSize); - - if (result.kind !== "success") { - console.log(result); - return []; - } - - return result.result.messages; -} - -export type GotoChatEvent = { - type: typeof GOTO_CHAT, - payload: { - chatIndex: number, - messageId: Option, - missingMessages: LocalMessage[], - fromHistory: boolean - } -} diff --git a/src/website/actions/chats/gotoUser.ts b/src/website/actions/chats/gotoUser.ts deleted file mode 100644 index f456e3bee8..0000000000 --- a/src/website/actions/chats/gotoUser.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Dispatch } from "react"; -import { RootState } from "../../reducers"; -import { UnconfirmedDirectChat } from "../../domain/model/chats"; -import { UserId, UserSummary } from "../../domain/model/users"; -import { gotoChatByIndex } from "./gotoChat"; -import * as chatFunctions from "../../domain/model/chats"; - -export const DIRECT_CHAT_CREATED = "DIRECT_CHAT_CREATED"; - -export default function(user: UserSummary) { - return (dispatch: Dispatch, getState: () => RootState) => { - gotoUser(dispatch, getState, user); - }; -} - -// Only use this method if the user's details are already stored in the state -export function gotoKnownUser(userId: UserId) { - return (dispatch: Dispatch, getState: () => RootState) => { - const userDictionary = getState().usersState.userDictionary; - const user = userDictionary[userId]; - if (!user) { - throw new Error("User details not found in state - " + userId); - } - gotoUser(dispatch, getState, user); - }; -} - -function gotoUser(dispatch: Dispatch, getState: () => RootState, user: UserSummary) { - const chats = getState().chatsState.chats; - const directChatIndex = chatFunctions.findDirectChatIndex(chats, user.userId); - // If I already have a direct chat with this user then select it otherwise setup a new direct chat - if (directChatIndex >= 0) { - dispatch(gotoChatByIndex(directChatIndex)); - } else { - const newChat = chatFunctions.newUnconfirmedDirectChat(user.userId, user.chatId); - const directChatCreatedEvent: DirectChatCreatedEvent = { - type: DIRECT_CHAT_CREATED, - payload: { - chat: newChat, - user - } - }; - dispatch(directChatCreatedEvent); - } -} - -export type DirectChatCreatedEvent = { - type: typeof DIRECT_CHAT_CREATED, - payload: { - chat: UnconfirmedDirectChat, - user: UserSummary - } -} diff --git a/src/website/actions/chats/joinGroup.ts b/src/website/actions/chats/joinGroup.ts deleted file mode 100644 index 2e0bdfc5fc..0000000000 --- a/src/website/actions/chats/joinGroup.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { Dispatch } from "react"; -import chatsService from "../../services/chats/service"; -import { ChatId } from "../../domain/model/chats"; -import * as chatFunctions from "../../domain/model/chats"; -import { JoinGroupResult } from "../../services/chats/joinGroup"; -import ChatsUpdater from "../../domain/ChatsUpdater"; -import { RootState } from "../../reducers"; - -export const JOIN_GROUP_REQUESTED = "JOIN_GROUP_REQUESTED"; -export const JOIN_GROUP_SUCCEEDED = "JOIN_GROUP_SUCCEEDED"; -export const JOIN_GROUP_FAILED = "JOIN_GROUP_FAILED"; -export const JOIN_GROUP_FAILED_ALREADY_IN_GROUP = "JOIN_GROUP_FAILED_ALREADY_IN_GROUP"; - -export default function(chatId: ChatId) { - return async (dispatch: Dispatch, getState: () => RootState) => { - const state = getState(); - if (chatFunctions.tryGetChat(state.chatsState.chats, chatId)[0]) { - alert("You are already in this chat"); - return; - } - - const requestEvent: JoinGroupRequestedEvent = { - type: JOIN_GROUP_REQUESTED, - payload: { - chatId - } - }; - - dispatch(requestEvent); - - const result = await chatsService.joinGroup(chatId); - - if (result === JoinGroupResult.Success) { - dispatch({ - type: JOIN_GROUP_SUCCEEDED, - payload: { - chatId - } - } as JoinGroupSucceededEvent); - - await ChatsUpdater.triggerUpdate(); - } else if (result === JoinGroupResult.AlreadyInGroup) { - dispatch({ - type: JOIN_GROUP_FAILED_ALREADY_IN_GROUP, - payload: { - chatId, - result - } - } as JoinGroupFailedAlreadyInGroupEvent); - } else { - dispatch({ - type: JOIN_GROUP_FAILED, - payload: { - chatId, - result - } - } as JoinGroupFailedEvent); - } - }; -} - -export type JoinGroupRequestedEvent = { - type: typeof JOIN_GROUP_REQUESTED, - payload: { - chatId: ChatId - } -} - -export type JoinGroupSucceededEvent = { - type: typeof JOIN_GROUP_SUCCEEDED, - payload: { - chatId: ChatId - } -} - -export type JoinGroupFailedEvent = { - type: typeof JOIN_GROUP_FAILED, - payload: { - chatId: ChatId, - result: JoinGroupResult - } -} - -export type JoinGroupFailedAlreadyInGroupEvent = { - type: typeof JOIN_GROUP_FAILED_ALREADY_IN_GROUP, - payload: { - chatId: ChatId - } -} diff --git a/src/website/actions/chats/leaveGroup.ts b/src/website/actions/chats/leaveGroup.ts deleted file mode 100644 index 8222520b5a..0000000000 --- a/src/website/actions/chats/leaveGroup.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Dispatch } from "react"; -import chatsService from "../../services/chats/service"; -import { ChatId } from "../../domain/model/chats"; -import { LeaveGroupResult } from "../../services/chats/leaveGroup"; -import { startSpinning, stopSpinning } from "../app/modalSpinner"; - -export const LEAVE_GROUP_REQUESTED = "LEAVE_GROUP_REQUESTED"; -export const LEAVE_GROUP_SUCCEEDED = "LEAVE_GROUP_SUCCEEDED"; -export const LEAVE_GROUP_FAILED = "LEAVE_GROUP_FAILED"; - -export default function(chatId: ChatId) { - return async (dispatch: Dispatch) => { - - dispatch(startSpinning()); - - const requestEvent: LeaveGroupRequestedEvent = { - type: LEAVE_GROUP_REQUESTED, - payload: { - chatId - } - }; - - dispatch(requestEvent); - - const result = await chatsService.leaveGroup(chatId); - - if (result === LeaveGroupResult.Success) { - dispatch({ - type: LEAVE_GROUP_SUCCEEDED, - payload: { - chatId - } - } as LeaveGroupSucceededEvent); - } else { - dispatch({ - type: LEAVE_GROUP_FAILED, - payload: { - chatId, - result - } - } as LeaveGroupFailedEvent); - } - - dispatch(stopSpinning()); - }; -} - -export type LeaveGroupRequestedEvent = { - type: typeof LEAVE_GROUP_REQUESTED, - payload: { - chatId: ChatId - } -} - -export type LeaveGroupSucceededEvent = { - type: typeof LEAVE_GROUP_SUCCEEDED, - payload: { - chatId: ChatId - } -} - -export type LeaveGroupFailedEvent = { - type: typeof LEAVE_GROUP_FAILED, - payload: { - chatId: ChatId, - result: LeaveGroupResult - } -} diff --git a/src/website/actions/chats/markMessagesAsRead.ts b/src/website/actions/chats/markMessagesAsRead.ts deleted file mode 100644 index b1329552f0..0000000000 --- a/src/website/actions/chats/markMessagesAsRead.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { ChatId } from "../../domain/model/chats"; -import { UserId } from "../../domain/model/users"; - -export const MARK_MESSAGES_AS_READ = "MARK_MESSAGES_AS_READ"; -export const MARK_ALL_MESSAGES_AS_READ = "MARK_ALL_MESSAGES_AS_READ"; -export const MARK_MESSAGES_AS_READ_BY_CLIENT_ID = "MARK_MESSAGES_AS_READ_BY_CLIENT_ID"; -export const MARK_MESSAGES_AS_READ_REMOTELY = "MARK_MESSAGES_AS_READ_REMOTELY"; -export const MARK_MESSAGES_AS_READ_BY_CLIENT_ID_REMOTELY = "MARK_MESSAGES_AS_READ_BY_CLIENT_ID_REMOTELY"; - -export function markAllMessagesAsReadLocally(chatId: ChatId) : MarkAllMessagesAsReadEvent { - return { - type: MARK_ALL_MESSAGES_AS_READ, - payload: { - chatId - } - }; -} - -export function markMessagesAsReadLocally(chatId: ChatId, messageIds: number[]) : MarkMessagesAsReadEvent { - return { - type: MARK_MESSAGES_AS_READ, - payload: { - chatId, - messageIds - } - }; -} - -export function markMessagesAsReadByClientIdLocally(chatId: ChatId, clientMessageIds: string[]) : MarkMessagesAsReadByClientIdEvent { - return { - type: MARK_MESSAGES_AS_READ_BY_CLIENT_ID, - payload: { - chatId, - clientMessageIds - } - }; -} - - -export function markMessagesAsReadRemotely(userId: UserId, messageIds: number[]) : MarkMessagesAsReadRemotelyEvent { - return { - type: MARK_MESSAGES_AS_READ_REMOTELY, - payload: { - userId, - messageIds - } - }; -} - -export function markMessagesAsReadByClientIdRemotely(userId: UserId, clientMessageIds: string[]) : MarkMessagesAsReadByClientIdRemotelyEvent { - return { - type: MARK_MESSAGES_AS_READ_BY_CLIENT_ID_REMOTELY, - payload: { - userId, - clientMessageIds - } - }; -} - -export type MarkMessagesAsReadEvent = { - type: typeof MARK_MESSAGES_AS_READ, - payload: { - chatId: ChatId, - messageIds: number[] - } -} - -export type MarkAllMessagesAsReadEvent = { - type: typeof MARK_ALL_MESSAGES_AS_READ, - payload: { - chatId: ChatId, - } -} - -export type MarkMessagesAsReadByClientIdEvent = { - type: typeof MARK_MESSAGES_AS_READ_BY_CLIENT_ID, - payload: { - chatId: ChatId, - clientMessageIds: string[] - } -} - -export type MarkMessagesAsReadRemotelyEvent = { - type: typeof MARK_MESSAGES_AS_READ_REMOTELY, - payload: { - userId: UserId, - messageIds: number[] - } -} - -export type MarkMessagesAsReadByClientIdRemotelyEvent = { - type: typeof MARK_MESSAGES_AS_READ_BY_CLIENT_ID_REMOTELY, - payload: { - userId: UserId, - clientMessageIds: string[] - } -} diff --git a/src/website/actions/chats/markMessagesAsReadServerSync.ts b/src/website/actions/chats/markMessagesAsReadServerSync.ts deleted file mode 100644 index f42a306d74..0000000000 --- a/src/website/actions/chats/markMessagesAsReadServerSync.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { Dispatch } from "react"; - -import chatsService from "../../services/chats/service"; -import { ChatId } from "../../domain/model/chats"; - -export const MARK_MESSAGES_AS_READ_SERVER_SYNC_REQUESTED = "MARK_MESSAGES_AS_READ_SERVER_SYNC_REQUESTED"; -export const MARK_MESSAGES_AS_READ_SERVER_SYNC_SUCCEEDED = "MARK_MESSAGES_AS_READ_SERVER_SYNC_SUCCEEDED"; -export const MARK_MESSAGES_AS_READ_SERVER_SYNC_FAILED = "MARK_MESSAGES_AS_READ_SERVER_SYNC_FAILED"; - -export default function(chatId: ChatId, fromId: number, toId: number) { - return async (dispatch: Dispatch) => { - const request: MarkMessagesAsReadServerSyncRequest = { - chatId, - fromId, - toId - }; - - const requestEvent: MarkMessagesAsReadServerSyncRequestedEvent = { - type: MARK_MESSAGES_AS_READ_SERVER_SYNC_REQUESTED, - payload: request - }; - - dispatch(requestEvent); - - const response = await chatsService.markRead(chatId, fromId, toId); - - let outcomeEvent; - if (response.kind === "success") { - outcomeEvent = { - type: MARK_MESSAGES_AS_READ_SERVER_SYNC_SUCCEEDED, - payload: { - request: request, - unreadMessageIds: response.result.unreadMessageIds - } - } as MarkMessagesAsReadServerSyncSucceededEvent; - } else { - outcomeEvent = { - type: MARK_MESSAGES_AS_READ_SERVER_SYNC_FAILED, - payload: request - } as MarkMessagesAsReadServerSyncFailedEvent; - } - - dispatch(outcomeEvent); - } -} - -export type MarkMessagesAsReadServerSyncRequestedEvent = { - type: typeof MARK_MESSAGES_AS_READ_SERVER_SYNC_REQUESTED, - payload: MarkMessagesAsReadServerSyncRequest -} - -export type MarkMessagesAsReadServerSyncSucceededEvent = { - type: typeof MARK_MESSAGES_AS_READ_SERVER_SYNC_SUCCEEDED, - payload: { - request: MarkMessagesAsReadServerSyncRequest, - unreadMessageIds: number[] - } -} - -export type MarkMessagesAsReadServerSyncFailedEvent = { - type: typeof MARK_MESSAGES_AS_READ_SERVER_SYNC_FAILED, - payload: MarkMessagesAsReadServerSyncRequest -} - -export type MarkMessagesAsReadServerSyncRequest = { - chatId: ChatId, - fromId: number, - toId: number -} diff --git a/src/website/actions/chats/receiveP2PMessage.ts b/src/website/actions/chats/receiveP2PMessage.ts deleted file mode 100644 index d9b7b38f64..0000000000 --- a/src/website/actions/chats/receiveP2PMessage.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Dispatch } from "react"; -import { RootState } from "../../reducers"; -import { ChatId } from "../../domain/model/chats"; -import { P2PMessage } from "../../domain/model/messages"; - -export const RECEIVE_P2P_MESSAGE = "RECEIVE_P2P_MESSAGE"; - -export default function(chatId: ChatId, message: P2PMessage) { - return (dispatch: Dispatch, getState: () => RootState) => { - - // If the sender is blocked then ignore this message - const blockedUsers = getState().chatsState.blockedUsers; - if (blockedUsers.includes(message.sender)) { - return null; - } - - const event: ReceiveP2PMessageEvent = { - type: RECEIVE_P2P_MESSAGE, - payload: { - chatId, - message - } - }; - dispatch(event); - return event; - }; -} - -export type ReceiveP2PMessageEvent = { - type: typeof RECEIVE_P2P_MESSAGE, - payload: { - chatId: ChatId, - message: P2PMessage - } -} diff --git a/src/website/actions/chats/removeParticipant.ts b/src/website/actions/chats/removeParticipant.ts deleted file mode 100644 index 9f49dae72f..0000000000 --- a/src/website/actions/chats/removeParticipant.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { Dispatch } from "react"; -import chatsService from "../../services/chats/service"; -import { UserId } from "../../domain/model/users"; -import { ChatId } from "../../domain/model/chats"; -import { RemoveParticipantResponse } from "../../services/chats/removeParticipant"; -import Stopwatch from "../../utils/Stopwatch"; - -export const REMOVE_PARTICIPANT_REQUESTED = "REMOVE_PARTICIPANT_REQUESTED"; -export const REMOVE_PARTICIPANT_SUCCEEDED = "REMOVE_PARTICIPANT_SUCCEEDED"; -export const REMOVE_PARTICIPANT_FAILED = "REMOVE_PARTICIPANT_FAILED"; - -export default function(chatId: ChatId, userId: UserId) { - return async (dispatch: Dispatch) => { - const timer = Stopwatch.startNew(); - - const requestEvent: RemoveParticipantRequestedEvent = { - type: REMOVE_PARTICIPANT_REQUESTED, - payload: { - chatId, - userId - } - }; - - dispatch(requestEvent); - - const response = await chatsService.removeParticipant(chatId, userId); - - if (response === RemoveParticipantResponse.Success) { - dispatch({ - type: REMOVE_PARTICIPANT_SUCCEEDED, - payload: { - chatId, - userId, - durationMs: timer.getElapsedMs() - } - } as RemoveParticipantSucceededEvent); - } else { - dispatch({ - type: REMOVE_PARTICIPANT_FAILED, - payload: { - chatId, - userId, - durationMs: timer.getElapsedMs() - } - } as RemoveParticipantFailedEvent); - } - }; -} - -export type RemoveParticipantRequestedEvent = { - type: typeof REMOVE_PARTICIPANT_REQUESTED, - payload: { - chatId: ChatId, - userId: UserId - } -} - -export type RemoveParticipantSucceededEvent = { - type: typeof REMOVE_PARTICIPANT_SUCCEEDED, - payload: { - chatId: ChatId, - userId: UserId, - durationMs: number - } -} - -export type RemoveParticipantFailedEvent = { - type: typeof REMOVE_PARTICIPANT_FAILED, - payload: { - chatId: ChatId, - userId: UserId, - durationMs: number - } -} diff --git a/src/website/actions/chats/replyToMessage.ts b/src/website/actions/chats/replyToMessage.ts deleted file mode 100644 index 6f1c8196c2..0000000000 --- a/src/website/actions/chats/replyToMessage.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Dispatch } from "react"; -import { UserSummary } from "../../domain/model/users"; -import { ChatId } from "../../domain/model/chats"; -import { ReplyContext } from "../../domain/model/messages"; -import gotoUser from "./gotoUser"; - -export const REPLY_TO_MESSAGE_SELECTED = "REPLY_TO_MESSAGE_SELECTED"; -export const REPLY_TO_MESSAGE_CANCELLED = "REPLY_TO_MESSAGE_CANCELLED"; - -export function selectReplyPrivatelyToMessage(replyContext: ReplyContext, user: UserSummary) { - return async (dispatch: Dispatch ) : Promise => { - await dispatch(gotoUser(user)); - const event: ReplyToMessageSelectedEvent = { - type: REPLY_TO_MESSAGE_SELECTED, - payload: { replyContext, privateChatId: user.chatId } - }; - dispatch(event) - return event; - } -} - -export function selectReplyToMessage(replyContext: ReplyContext) : ReplyToMessageSelectedEvent { - return { - type: REPLY_TO_MESSAGE_SELECTED, - payload: { replyContext } - }; -} - -export function cancelReplyToMessage(chatId: ChatId) : ReplyToMessageCancelledEvent { - return { - type: REPLY_TO_MESSAGE_CANCELLED, - payload: { chatId } - }; -} - -export type ReplyToMessageSelectedEvent = { - type: typeof REPLY_TO_MESSAGE_SELECTED, - payload: { - replyContext: ReplyContext, - privateChatId?: ChatId - } -} - -export type ReplyToMessageCancelledEvent = { - type: typeof REPLY_TO_MESSAGE_CANCELLED, - payload: { - chatId: ChatId - } -} diff --git a/src/website/actions/chats/sendMessage.ts b/src/website/actions/chats/sendMessage.ts deleted file mode 100644 index c8dd1c4dd7..0000000000 --- a/src/website/actions/chats/sendMessage.ts +++ /dev/null @@ -1,227 +0,0 @@ -import { Dispatch } from "react"; -import { v1 as uuidv1 } from "uuid"; -import chatsService from "../../services/chats/service"; -import { Chat, ChatId, ConfirmedChat } from "../../domain/model/chats"; -import { Option } from "../../domain/model/common"; -import { LocalMessage, MessageContent, ReplyContext, DraftMessageContent } from "../../domain/model/messages"; -import { RootState } from "../../reducers"; -import { HttpError } from "../../errors/httpError"; -import dataService, { DataSource } from "../../services/data/CachingDataService"; -import { - CHUNK_SIZE_BYTES, - CONFIRMED_DIRECT_CHAT, - UNCONFIRMED_DIRECT_CHAT, - UNCONFIRMED_GROUP_CHAT -} from "../../constants"; -import Stopwatch from "../../utils/Stopwatch"; -import { alertDialog } from "../../components/modals/Alert"; -import * as chatFunctions from "../../domain/model/chats"; - -export const SEND_MESSAGE_REQUESTED = "SEND_MESSAGE_REQUESTED"; -export const SEND_MESSAGE_SUCCEEDED = "SEND_MESSAGE_SUCCEEDED"; -export const SEND_MESSAGE_FAILED = "SEND_MESSAGE_FAILED"; -export const SEND_MESSAGE_CONTENT_UPLOAD_FAILED = "SEND_MESSAGE_CONTENT_UPLOAD_FAILED"; - -export default function (chat: Chat, sendMessageContent: DraftMessageContent, repliesTo: Option) { - return async (dispatch: Dispatch, getState: () => RootState) => { - - // Don't send a direct message if you block the recipient - if (chatFunctions.isDirectChat(chat)) { - const blockedUsers = getState().chatsState.blockedUsers; - if (blockedUsers.includes(chat.them)) { - alertDialog({ - title: "Message not sent", - text: "You have blocked this user - you must unblock them before sending a message" - }); - return; - } - } - - const timer = Stopwatch.startNew(); - const clientMessageId = uuidv1().toString(); - - // If the "send message content" is media the message itself will contain - // meta info about the media and the data will be uploaded separately in parallel - const content = convertContent(sendMessageContent); - - // Start uploading the media data - let uploadContentTask: Option> = null; - if ("id" in content && "data" in sendMessageContent) { - uploadContentTask = dataService.putData( - sendMessageContent.kind === "media" ? DataSource.MediaMessage : DataSource.FileMessage, - content.id, - sendMessageContent.data); - } - - // Dispatch the message requested event - this will put the message in the chat - const request: SendMessageRequest = { - chat, - clientMessageId, - content, - repliesTo - }; - const requestEvent: SendMessageRequestedEvent = { - type: SEND_MESSAGE_REQUESTED, - payload: request - }; - dispatch(requestEvent); - - // We can't send messages to a new group until the group has been confirmed at which point we will receive the chatId. - // So we only signal the 'requestEvent', the reducer will then add the message to the 'unconfirmedMessages' array for - // the chat and those messages will be sent once the chat is confirmed. - if (chat.kind === UNCONFIRMED_GROUP_CHAT) { - return; - } - - // Wait for the media data to finish uploading - if (uploadContentTask && !await uploadContentTask) { - dispatch({ type: SEND_MESSAGE_CONTENT_UPLOAD_FAILED }); - return; - } - - const me = getState().usersState.me!; - - // Send the message to the IC - const response = chat.kind === UNCONFIRMED_DIRECT_CHAT || (chat.kind === CONFIRMED_DIRECT_CHAT && sendMessageContent.kind === "cycles") - ? await chatsService.sendDirectMessage(chat.them, me.username, clientMessageId, content, repliesTo) - : await chatsService.sendMessage(chat.chatId, me.username, clientMessageId, content, repliesTo); - - if (response.kind !== "success") { - // Dispatch a failed event - dispatch({ - type: SEND_MESSAGE_FAILED, - payload: { - chatId: chat.chatId, - clientMessageId - }, - httpError: response.kind === "httpError" ? response : undefined - } as SendMessageFailedEvent); - - if (response.kind !== "httpError") { - let text; - switch (response.kind) { - case "userNotFound": - text = "User not found"; - break; - case "recipientNotFound": - text = "Recipient not found"; - break; - case "chatNotFound": - text = "Chat not found"; - break; - case "balanceExceeded": - text = "Balance exceeded"; - break; - case "senderBlocked": - text = "You are blocked from sending messages to this user"; - break; - case "recipientBlocked": - text = "You have blocked this user - you must unblock them before sending a message"; - break; - } - - alertDialog({ - title: "Message not sent", - text - }); - } - return; - } - - // Dispatch a succeeded event - { - const myUserId = me.userId; - const message: LocalMessage = { - kind: "local", - id: response.result.messageId, - clientMessageId, - date: response.result.date, - sender: myUserId, - content, - repliesTo - }; - const chat: ConfirmedChat = response.result.chat; - chat.messages.push(message); - - dispatch({ - type: SEND_MESSAGE_SUCCEEDED, - payload: { - request, - chat, - durationMs: timer.getElapsedMs() - } - } as SendMessageSucceededEvent); - } - } -} - -function convertContent(sendMessageContent: DraftMessageContent): MessageContent { - switch (sendMessageContent.kind) { - case "media": - return { - kind: sendMessageContent.kind, - caption: sendMessageContent.caption, - mimeType: sendMessageContent.mimeType, - width: sendMessageContent.width, - height: sendMessageContent.height, - id: uuidv1().toString(), - size: sendMessageContent.data.length, - chunkSize: CHUNK_SIZE_BYTES, - blobUrl: sendMessageContent.blobUrl, - thumbnailData: sendMessageContent.thumbnailData, - blobDeleted: false - }; - case "file": - return { - kind: sendMessageContent.kind, - caption: sendMessageContent.caption, - name: sendMessageContent.name, - mimeType: sendMessageContent.mimeType, - id: uuidv1().toString(), - size: sendMessageContent.data.length, - chunkSize: CHUNK_SIZE_BYTES, - blobDeleted: false - }; - case "text": - case "cycles": - return sendMessageContent; - default: - throw Error("Unrecognised content type"); - } -} - -export type SendMessageRequestedEvent = { - type: typeof SEND_MESSAGE_REQUESTED, - payload: SendMessageRequest -} - -export type SendMessageSucceededEvent = { - type: typeof SEND_MESSAGE_SUCCEEDED, - payload: { - request: SendMessageRequest, - chat: ConfirmedChat, - durationMs: number - } -} - -export type SendMessageFailedEvent = { - type: typeof SEND_MESSAGE_FAILED, - payload: SendMessageFailed, - httpError?: HttpError -} - -export type SendMessageFailedToUploadContentEvent = { - type: typeof SEND_MESSAGE_FAILED -} - -export type SendMessageRequest = { - chat: Chat, - clientMessageId: string, - content: MessageContent, - repliesTo: Option -} - -export type SendMessageFailed = { - chatId: ChatId, - clientMessageId: string -} diff --git a/src/website/actions/chats/toggleNotifications.ts b/src/website/actions/chats/toggleNotifications.ts deleted file mode 100644 index e10d7256ae..0000000000 --- a/src/website/actions/chats/toggleNotifications.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Dispatch } from "react"; -import { ChatId } from "../../domain/model/chats"; -import chatsService from "../../services/chats/service"; - -export const NOTIFICATIONS_MUTED = "NOTIFICATIONS_MUTED"; -export const NOTIFICATIONS_UNMUTED = "NOTIFICATIONS_UNMUTED"; - -export function toggleNotifications(chatId: ChatId, mute: boolean) { - return async (dispatch: Dispatch) : Promise => { - let event: NotificationsMutedEvent | NotificationsUnmutedEvent = { - type: mute ? NOTIFICATIONS_MUTED : NOTIFICATIONS_UNMUTED, - payload: { - chatId - } - }; - dispatch(event); - - await chatsService.toggle_notifications(chatId, mute); - } -} - -export type NotificationsMutedEvent = { - type: typeof NOTIFICATIONS_MUTED, - payload: { - chatId: ChatId, - } -} - -export type NotificationsUnmutedEvent = { - type: typeof NOTIFICATIONS_UNMUTED, - payload: { - chatId: ChatId, - } -} diff --git a/src/website/actions/chats/userTyping.ts b/src/website/actions/chats/userTyping.ts deleted file mode 100644 index 0910785dfa..0000000000 --- a/src/website/actions/chats/userTyping.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { ChatId } from "../../domain/model/chats"; -import { UserId } from "../../domain/model/users"; - -export const CURRENT_USER_TYPING = "CURRENT_USER_TYPING"; -export const CURRENT_USER_STOPPED_TYPING = "CURRENT_USER_STOPPED_TYPING"; -export const REMOTE_USER_TYPING = "REMOTE_USER_TYPING"; -export const REMOTE_USER_STOPPED_TYPING = "REMOTE_USER_STOPPED_TYPING"; - -export function currentUserTyping(chatId: ChatId) : CurrentUserTypingEvent { - return { - type: CURRENT_USER_TYPING, - payload: chatId - }; -} - -export function currentUserStoppedTyping(chatId: ChatId) : CurrentUserStoppedTypingEvent { - return { - type: CURRENT_USER_STOPPED_TYPING, - payload: chatId - }; -} - -export function remoteUserTyping(chatId: ChatId, userId: UserId) : RemoteUserTypingEvent { - return { - type: REMOTE_USER_TYPING, - payload: { - chatId, - userId - } - }; -} - -export function remoteUserStoppedTyping(chatId: ChatId, userId: UserId) : RemoteUserStoppedTypingEvent { - return { - type: REMOTE_USER_STOPPED_TYPING, - payload: { - chatId, - userId - } - }; -} - -export type CurrentUserTypingEvent = { - type: typeof CURRENT_USER_TYPING, - payload: ChatId -} - -export type CurrentUserStoppedTypingEvent = { - type: typeof CURRENT_USER_STOPPED_TYPING, - payload: ChatId -} - -export type RemoteUserTypingEvent = { - type: typeof REMOTE_USER_TYPING, - payload: { - chatId: ChatId, - userId: UserId - } -} - -export type RemoteUserStoppedTypingEvent = { - type: typeof REMOTE_USER_STOPPED_TYPING, - payload: { - chatId: ChatId, - userId: UserId - } -} diff --git a/src/website/actions/signin/login.ts b/src/website/actions/signin/login.ts deleted file mode 100644 index 7815c3a480..0000000000 --- a/src/website/actions/signin/login.ts +++ /dev/null @@ -1,23 +0,0 @@ -import getAuthClient, { getTimeUntilSessionExpiryMs } from "../../utils/authClient"; -import { Dispatch } from "react"; -import getCurrentUser from "../users/getCurrentUser"; -import CanisterClientFactory from "../../services/CanisterClientFactory"; -import SessionExpirationHandler from "../../domain/SessionExpirationHandler"; - -const SESSION_TIMEOUT_NANOS = BigInt(30 * 24 * 60 * 60 * 1000 * 1000 * 1000) // 30 days - -export default function login() { - return async (dispatch: Dispatch) => { - let authClient = getAuthClient(); - await authClient.login({ - identityProvider: process.env.IDP_URL, - maxTimeToLive: SESSION_TIMEOUT_NANOS, - onSuccess: async () => { - const identity = authClient.getIdentity(); - await CanisterClientFactory.init(identity); - dispatch(getCurrentUser()); - SessionExpirationHandler.startSession(); - } - }); - } -} diff --git a/src/website/actions/signin/logout.ts b/src/website/actions/signin/logout.ts deleted file mode 100644 index 81e48a2fcd..0000000000 --- a/src/website/actions/signin/logout.ts +++ /dev/null @@ -1,24 +0,0 @@ -import getAuthClient from "../../utils/authClient"; -import { Dispatch } from "react"; -import * as notifications from "../../notifications"; - -export const USER_LOGGED_OUT = "USER_LOGGED_OUT"; - -export default function logout() { - return async (dispatch: Dispatch) => { - await getAuthClient().logout(); - - const userLoggedOutEvent: UserLoggedOutEvent = { - type: USER_LOGGED_OUT - }; - - dispatch(userLoggedOutEvent); - - let success = await notifications.unregister(); - console.log(`unregister service worker: ${success}`); - }; -} - -export type UserLoggedOutEvent = { - type: typeof USER_LOGGED_OUT -} diff --git a/src/website/actions/signin/notifySessionExpired.ts b/src/website/actions/signin/notifySessionExpired.ts deleted file mode 100644 index 1ebcaedb15..0000000000 --- a/src/website/actions/signin/notifySessionExpired.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Dispatch } from "react"; -import getAuthClient from "../../utils/authClient"; - -export const SESSION_EXPIRED = "SESSION_EXPIRED"; -export const SESSION_EXPIRY_ACKNOWLEDGED = "SESSION_EXPIRY_ACKNOWLEDGED"; - -export default function notifySessionExpired() { - return async (dispatch: Dispatch) => { - await getAuthClient().logout(); - - const sessionExpiredEvent: SessionExpiredEvent = { - type: SESSION_EXPIRED - }; - - dispatch(sessionExpiredEvent); - }; -} - -export function sessionExpiryAcknowledged() : SessionExpiryAcknowledgedEvent { - return { - type: SESSION_EXPIRY_ACKNOWLEDGED - }; -} - -export type SessionExpiredEvent = { - type: typeof SESSION_EXPIRED -} - -export type SessionExpiryAcknowledgedEvent = { - type: typeof SESSION_EXPIRY_ACKNOWLEDGED -} diff --git a/src/website/actions/users/getCurrentUser.ts b/src/website/actions/users/getCurrentUser.ts deleted file mode 100644 index 93a6cc77a1..0000000000 --- a/src/website/actions/users/getCurrentUser.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Dispatch } from "react"; - -import { MyProfile } from "../../domain/model/users"; -import userMgmtService from "../../services/userMgmt/service"; -import { HttpError } from "../../errors/httpError"; - -export const GET_CURRENT_USER_REQUESTED = "GET_CURRENT_USER_REQUESTED"; -export const GET_CURRENT_USER_SUCCEEDED = "GET_CURRENT_USER_SUCCEEDED"; -export const GET_CURRENT_USER_FAILED = "GET_CURRENT_USER_FAILED"; - -export default function() { - return async (dispatch: Dispatch) => { - const requestEvent: GetCurrentUserRequestedEvent = { - type: GET_CURRENT_USER_REQUESTED - }; - - dispatch(requestEvent); - - const result = await userMgmtService.getCurrentUser(); - - let outcomeEvent; - if (result.kind === "success") { - outcomeEvent = { - type: GET_CURRENT_USER_SUCCEEDED, - payload: result.myProfile - } as GetCurrentUserSucceededEvent; - } else { - outcomeEvent = { - type: GET_CURRENT_USER_FAILED, - httpError: result.kind === "httpError" ? result : undefined - } as GetCurrentUserFailedEvent; - } - - dispatch(outcomeEvent); - return outcomeEvent; - } -} - -export type GetCurrentUserOutcome = GetCurrentUserSucceededEvent | GetCurrentUserFailedEvent; - -export type GetCurrentUserRequestedEvent = { - type: typeof GET_CURRENT_USER_REQUESTED -} - -export type GetCurrentUserSucceededEvent = { - type: typeof GET_CURRENT_USER_SUCCEEDED, - payload: MyProfile -} - -export type GetCurrentUserFailedEvent = { - type: typeof GET_CURRENT_USER_FAILED, - httpError?: HttpError -} diff --git a/src/website/actions/users/getUsers.ts b/src/website/actions/users/getUsers.ts deleted file mode 100644 index c6102d264f..0000000000 --- a/src/website/actions/users/getUsers.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { Dispatch } from "react"; - -import { Option, Timestamp } from "../../domain/model/common"; -import { UserId, UserSummary } from "../../domain/model/users"; -import { GetUsersRequest } from "../../services/userMgmt/getUsers"; -import userMgmtService from "../../services/userMgmt/service"; -import { HttpError } from "../../errors/httpError"; - -export const GET_USERS_REQUESTED = "GET_USERS_REQUESTED"; -export const GET_USERS_SUCCEEDED = "GET_USERS_SUCCEEDED"; -export const GET_USERS_FAILED = "GET_USERS_FAILED"; - -export default function(users: UserId[], updatedSince: Option = null) { - return async (dispatch: Dispatch) => { - const request: GetUsersRequest = { - users, - updatedSince - }; - - const requestAction: GetUsersRequestedEvent = { - type: GET_USERS_REQUESTED, - payload: request - }; - - dispatch(requestAction); - - const result = await userMgmtService.getUsers(request); - - let outcomeEvent; - if (result.kind === "success") { - outcomeEvent = { - type: GET_USERS_SUCCEEDED, - payload: { - request, - result: { - users: result.users, - timestamp: result.timestamp - } - } - } as GetUsersSucceededEvent; - } else { - outcomeEvent = { - type: GET_USERS_FAILED, - payload: request, - httpError: result.kind === "httpError" ? result : undefined - } as GetUsersFailedEvent; - } - - dispatch(outcomeEvent); - } -} - -export type GetUsersRequestedEvent = { - type: typeof GET_USERS_REQUESTED, - payload: GetUsersRequest -} - -export type GetUsersSucceededEvent = { - type: typeof GET_USERS_SUCCEEDED, - payload: { - request: GetUsersRequest, - result: { - users: UserSummary[], - timestamp: Timestamp - } - } -} - -export type GetUsersFailedEvent = { - type: typeof GET_USERS_FAILED, - payload: GetUsersRequest, - httpError?: HttpError -} diff --git a/src/website/actions/users/markRemoteUserOnline.ts b/src/website/actions/users/markRemoteUserOnline.ts deleted file mode 100644 index a5f2b4d40b..0000000000 --- a/src/website/actions/users/markRemoteUserOnline.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { UserId } from "../../domain/model/users"; - -export const MARK_REMOTE_USER_ONLINE = "MARK_REMOTE_USER_ONLINE"; - -export default function(userId: UserId) : MarkRemoteUserOnlineEvent { - return { - type: MARK_REMOTE_USER_ONLINE, - payload: userId - }; -} - -export type MarkRemoteUserOnlineEvent = { - type: typeof MARK_REMOTE_USER_ONLINE, - payload: UserId -} diff --git a/src/website/actions/users/registerUser.ts b/src/website/actions/users/registerUser.ts deleted file mode 100644 index 27194981ad..0000000000 --- a/src/website/actions/users/registerUser.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { Dispatch } from "react"; - -import userMgmtService from "../../services/userMgmt/service"; -import { MyProfile } from "../../domain/model/users"; -import { HttpError } from "../../errors/httpError"; -import { startSpinning, stopSpinning } from "../app/modalSpinner"; - -export const REGISTER_USER_REQUESTED = "REGISTER_USER_REQUESTED"; -export const REGISTER_USER_SUCCEEDED = "REGISTER_USER_SUCCEEDED"; -export const REGISTER_USER_FAILED_USER_EXISTS = "REGISTER_USER_FAILED_USER_EXISTS"; -export const REGISTER_USER_FAILED_USERNAME_EXISTS = "REGISTER_USER_FAILED_USERNAME_EXISTS"; -export const REGISTER_USER_FAILED = "REGISTER_USER_FAILED"; -export const REGISTER_USER_LIMIT_REACHED = "REGISTER_USER_LIMIT_REACHED"; - -export default function(username: string) { - return async (dispatch: Dispatch) => { - - dispatch(startSpinning()); - - const requestEvent: RegisterUserRequestedEvent = { - type: REGISTER_USER_REQUESTED, - payload: username - }; - - dispatch(requestEvent); - - const result = await userMgmtService.registerUser(username); - - let outcomeEvent; - switch (result.kind) { - case "success": - outcomeEvent = { - type: REGISTER_USER_SUCCEEDED, - payload: result.myProfile - } as RegisterUserSucceededEvent; - break; - case "userExists": - outcomeEvent = { - type: REGISTER_USER_FAILED_USER_EXISTS - } as RegisterUserFailedUserExistsEvent; - break; - case "usernameTaken": - outcomeEvent = { - type: REGISTER_USER_FAILED_USERNAME_EXISTS, - payload: username - } as RegisterUserFailedUsernameExistsEvent; - break; - case "userLimitReached": - outcomeEvent = { - type: REGISTER_USER_LIMIT_REACHED, - payload: result.userLimit - } as RegisterUserLimitReachedEvent; - break; - case "httpError": - outcomeEvent = { - type: REGISTER_USER_FAILED, - httpError: result - } as RegisterUserFailedEvent; - break; - } - - dispatch(outcomeEvent); - - dispatch(stopSpinning()); - - return outcomeEvent; - } -} - -export type RegisterUserOutcomeEvent = RegisterUserSucceededEvent | RegisterUserFailedUserExistsEvent | RegisterUserFailedUsernameExistsEvent | RegisterUserFailedEvent | RegisterUserLimitReachedEvent; - -export type RegisterUserRequestedEvent = { - type: typeof REGISTER_USER_REQUESTED, - payload: string -} - -export type RegisterUserSucceededEvent = { - type: typeof REGISTER_USER_SUCCEEDED, - payload: MyProfile -} - -export type RegisterUserFailedEvent = { - type: typeof REGISTER_USER_FAILED, - httpError?: HttpError -} - -export type RegisterUserFailedUserExistsEvent = { - type: typeof REGISTER_USER_FAILED_USER_EXISTS -} - -export type RegisterUserFailedUsernameExistsEvent = { - type: typeof REGISTER_USER_FAILED_USERNAME_EXISTS, - payload: string -} - -export type RegisterUserLimitReachedEvent = { - type: typeof REGISTER_USER_LIMIT_REACHED, - payload: bigint -} diff --git a/src/website/actions/users/setProfileImage.ts b/src/website/actions/users/setProfileImage.ts deleted file mode 100644 index bd7078392e..0000000000 --- a/src/website/actions/users/setProfileImage.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { Dispatch } from "react"; -import { v1 as uuidv1 } from "uuid"; -import { UserId } from "../../domain/model/users"; -import dataService, { DataSource } from "../../services/data/CachingDataService"; -import usersService from "../../services/userMgmt/service"; -import { SetProfileImageResponse } from "../../services/userMgmt/setProfileImage"; -import { dataToBlobUrl } from "../../utils/blobFunctions"; - -export const SET_PROFILE_IMAGE_REQUESTED = "SET_PROFILE_IMAGE_REQUESTED"; -export const SET_PROFILE_IMAGE_SUCCEEDED = "SET_PROFILE_IMAGE_SUCCEEDED"; -export const SET_PROFILE_IMAGE_FAILED = "SET_PROFILE_IMAGE_FAILED"; -export const SET_PROFILE_IMAGE_DATA_UPLOAD_FAILED = "SET_PROFILE_IMAGE_DATA_UPLOAD_FAILED"; - -export default function(userId: UserId, data: Uint8Array) { - return async (dispatch: Dispatch) => { - const imageId = uuidv1().toString(); - - // Start uploading the image data - let putDataTask = dataService.putData(DataSource.Avatar, imageId, data, true); - - const blobUrl = dataToBlobUrl(data, null); - - // Dispatch the set profile image requested event - this will set the imageBlobUrl on "my profile" which will render the avatar image - const requestEvent: SetProfileImageRequestedEvent = { - type: SET_PROFILE_IMAGE_REQUESTED, - payload: { - userId, - imageId, - blobUrl - } - }; - - dispatch(requestEvent); - - // Wait for the media data to finish uploading - const succeeded = await putDataTask; - if (!succeeded) { - const outcomeEvent: SetProfileImageDataUploadFailedEvent = { - type: SET_PROFILE_IMAGE_DATA_UPLOAD_FAILED, - payload: { - userId, - imageId, - } - }; - dispatch(outcomeEvent); - return; - } - - // Set the imageId against the user profile on the IC - const response = await usersService.setProfileImage(imageId); - - let outcomeEvent: SetProfileImageOutcome; - if (response === SetProfileImageResponse.Success) { - outcomeEvent = { - type: SET_PROFILE_IMAGE_SUCCEEDED, - payload: { - userId, - imageId, - blobUrl - } - }; - } else { - outcomeEvent = { - type: SET_PROFILE_IMAGE_FAILED, - payload: { - userId, - imageId, - } - }; - } - - dispatch(outcomeEvent); - - return outcomeEvent; - } -} - -export type SetProfileImageOutcome = SetProfileImageSucceededEvent | SetProfileImageFailedEvent; - -export type SetProfileImageRequestedEvent = { - type: typeof SET_PROFILE_IMAGE_REQUESTED, - payload: { - userId: UserId, - imageId: string, - blobUrl: string - } -} - -export type SetProfileImageSucceededEvent = { - type: typeof SET_PROFILE_IMAGE_SUCCEEDED, - payload: { - userId: UserId, - imageId: string, - blobUrl: string - } -} - -export type SetProfileImageFailedEvent = { - type: typeof SET_PROFILE_IMAGE_FAILED, - payload: { - userId: UserId, - imageId: string - } -} - -export type SetProfileImageDataUploadFailedEvent = { - type: typeof SET_PROFILE_IMAGE_DATA_UPLOAD_FAILED, - payload: { - userId: UserId, - imageId: string - } -} diff --git a/src/website/actions/users/updateMinutesSinceLastOnline.ts b/src/website/actions/users/updateMinutesSinceLastOnline.ts deleted file mode 100644 index a2f1edcb1f..0000000000 --- a/src/website/actions/users/updateMinutesSinceLastOnline.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const UPDATE_MINUTES_SINCE_LAST_ONLINE = "UPDATE_MINUTES_SINCE_LAST_ONLINE"; - -export default function() : UpdateMinutesSinceLastOnline { - return { - type: UPDATE_MINUTES_SINCE_LAST_ONLINE - }; -} - -export type UpdateMinutesSinceLastOnline = { - type: typeof UPDATE_MINUTES_SINCE_LAST_ONLINE -} diff --git a/src/website/analytics/analyticsMiddleware.ts b/src/website/analytics/analyticsMiddleware.ts deleted file mode 100644 index 12c8a34521..0000000000 --- a/src/website/analytics/analyticsMiddleware.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Middleware } from "redux"; -import { RootState } from "../reducers"; -import trackEvent from "./eventTracker"; - -const analyticsMiddleware : Middleware<{}, RootState> = _store => next => event => { - trackEvent(event.type, event.payload); - return next(event); -} - -export default analyticsMiddleware; diff --git a/src/website/analytics/eventTracker.ts b/src/website/analytics/eventTracker.ts deleted file mode 100644 index e1243a8ea7..0000000000 --- a/src/website/analytics/eventTracker.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default function trackEvent(name: string, parameters?: {}) { - const dataLayer: any[] = (window as any).dataLayer; - if (dataLayer) { - const event = { ...parameters, event: name }; - dataLayer.push(event); - } -} diff --git a/src/website/analytics/ga/tagManagerBodyScript.html b/src/website/analytics/ga/tagManagerBodyScript.html deleted file mode 100644 index 228f7936cf..0000000000 --- a/src/website/analytics/ga/tagManagerBodyScript.html +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/src/website/analytics/ga/tagManagerHeaderScript.html b/src/website/analytics/ga/tagManagerHeaderScript.html deleted file mode 100644 index 967a94f8f7..0000000000 --- a/src/website/analytics/ga/tagManagerHeaderScript.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/website/assets/manifest.json b/src/website/assets/manifest.json deleted file mode 100644 index 316bf20f8c..0000000000 --- a/src/website/assets/manifest.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "background_color": "#41398b", - "description": "Chat application running end-to-end on the Internet Computer", - "display": "fullscreen", - "icons": [ - { - "src": "apple-touch-icon.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "oc-logo2.svg", - "type": "image/svg+xml", - "sizes": "any" - } - ], - "name": "OpenChat", - "short_name": "OpenChat", - "scope": "/", - "start_url": "/" -} \ No newline at end of file diff --git a/src/website/backgroundTasks.ts b/src/website/backgroundTasks.ts deleted file mode 100644 index 04e049ea94..0000000000 --- a/src/website/backgroundTasks.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { useEffect } from "react"; -import { useDispatch, useSelector } from "react-redux"; -import { RootState } from "./reducers"; -import userMgmtService from "./services/userMgmt/service"; -import { UserSummary } from "./domain/model/users"; -import * as chatFunctions from "./domain/model/chats"; -import * as setFunctions from "./utils/setFunctions"; -import * as stateFunctions from "./domain/stateFunctions"; -import RecurringTaskRunner from "./domain/RecurringTaskRunner"; -import RtcConnectionsHandler from "./domain/webRtc/RtcConnectionsHandler"; -import ExponentialBackoffRecurringTaskRunner, { StartOptions } from "./domain/ExponentialBackoffRecurringTaskRunner"; -import ChatsUpdater from "./domain/ChatsUpdater"; -import getAllChats from "./actions/chats/getAllChats"; -import getMessagesById from "./actions/chats/getMessagesById"; -import getUsers from "./actions/users/getUsers"; -import updateMinutesSinceLastOnline from "./actions/users/updateMinutesSinceLastOnline"; -import dataService from "./services/data/CachingDataService"; - -import { - APP_TITLE, - MARK_CURRENT_USER_AS_ONLINE_INTERVAL_MS, - PAGE_SIZE, - REFRESH_P2P_CONNECTIONS_MAX_INTERVAL_MS, - REFRESH_P2P_CONNECTIONS_MIN_INTERVAL_MS, - SCAVENGE_CACHE_INTERVAL_MS, - UPDATE_USERS_INTERVAL_MS -} from "./constants"; - -export function setupBackgroundTasks() { - const dispatch = useDispatch(); - - const chatsState = useSelector((state: RootState) => state.chatsState); - const usersState = useSelector((state: RootState) => state.usersState); - const sessionExpired = useSelector((state: RootState) => state.appState.sessionExpired); - const selectedChat = stateFunctions.getSelectedChat(chatsState); - const selectedChatUsers = selectedChat ? chatFunctions.getUsers(selectedChat) : []; - const usersOnline = (Object.values(usersState.userDictionary) as UserSummary[]) - .filter(u => u.minutesSinceLastOnline < 2) - .map(u => u.userId); - - const selectedChatUsersOnline = setFunctions.intersect(selectedChatUsers, usersOnline); - - useEffect(() => { - const count = sessionExpired ? 0 : chatFunctions.getUnreadChatCount(chatsState.chats); - document.title = (count > 0 ? `(${count}) ` : "") + APP_TITLE; - }, [chatsState.chats, sessionExpired]); - - // Each time 'usersState.me' changes and is not null, get the full list of chats - useEffect(() => { - if (usersState.me?.userId && !sessionExpired) { - dispatch(getAllChats()); - } - }, [usersState.me?.userId, sessionExpired]); - - // As new userIds are seen, fetch their usernames - useEffect(() => { - if (usersState.unknownUserIds.length && !sessionExpired) { - dispatch(getUsers(usersState.unknownUserIds)); - } - }, [usersState.unknownUserIds, sessionExpired]); - - // Whenever a chat has messages to download, call off to get those messages - useEffect(() => { - if (!sessionExpired) { - chatsState.chats.forEach(c => { - if (chatFunctions.isConfirmedChat(c) && c.messagesToDownload.length && !c.messagesDownloading.length) { - dispatch(getMessagesById(c.chatId, c.messagesToDownload.slice(0, PAGE_SIZE))); - } - }) - } - }, [chatsState.chats, sessionExpired]); - - // Check for new messages at regular intervals - useEffect(() => { - if (chatsState.runUpdateChatsTask && !sessionExpired) { - ChatsUpdater.startNew(chatsState.chatsSyncedUpTo); - return () => ChatsUpdater.stop(); - } - }, [chatsState.runUpdateChatsTask, chatsState.chatsSyncedUpTo, sessionExpired]); - - // Mark current user as online at regular intervals - useEffect(() => { - if (usersState.me?.userId && !sessionExpired) { - const markAsOnline: () => Promise = () => userMgmtService.markAsOnline(); - const taskRunner = RecurringTaskRunner.startNew(markAsOnline, MARK_CURRENT_USER_AS_ONLINE_INTERVAL_MS, false); - return () => taskRunner.stop(); - } - }, [usersState.me?.userId, sessionExpired]); - - // Update user details at regular intervals - const userIdsCount = usersState.userDictionary ? Object.keys(usersState.userDictionary).length : 0; - useEffect(() => { - if (usersState.userDictionary && !sessionExpired) { - const updateUsers: () => Promise = () => { - const updateUsersTask: Promise = dispatch(getUsers(Object.keys(usersState.userDictionary), usersState.usersSyncedUpTo)) as any; - return updateUsersTask.finally(() => dispatch(updateMinutesSinceLastOnline())); - } - const taskRunner = RecurringTaskRunner.startNew(updateUsers, UPDATE_USERS_INTERVAL_MS, true); - return () => taskRunner.stop(); - } - }, [userIdsCount, usersState.usersSyncedUpTo, sessionExpired]); - - // Each time the users in the selected chat change, attempt to make p2p connections to each user - useEffect(() => { - if (selectedChat && selectedChatUsersOnline.length && !sessionExpired) { - RtcConnectionsHandler.setupMissingConnections(selectedChatUsersOnline); - } - }, [selectedChatUsersOnline.join(), sessionExpired]); - - // Poll for new p2p connection details at regular intervals, this could be responses to our connection offers or new - // offers from other users trying to establish a p2p connection with us - useEffect(() => { - if (usersState.me?.userId && !sessionExpired) { - const taskRunner = ExponentialBackoffRecurringTaskRunner.startNew( - async () => { - const newConnectionCount = await RtcConnectionsHandler.getConnections(); - return newConnectionCount > 0; - }, REFRESH_P2P_CONNECTIONS_MIN_INTERVAL_MS, REFRESH_P2P_CONNECTIONS_MAX_INTERVAL_MS, 1.2, StartOptions.TriggerTaskAndReturn); - return () => taskRunner.stop(); - } - }, [usersState.me?.userId, sessionExpired]); - - useEffect(() => { - const scavengeCache: () => Promise = async () => { - await dataService.scavengeCache(); - //console.log(await navigator.storage.estimate()); - }; - - const taskRunner = RecurringTaskRunner.startNew(scavengeCache, SCAVENGE_CACHE_INTERVAL_MS, true); - return () => taskRunner.stop(); - }, []); -} diff --git a/src/website/components/App.tsx b/src/website/components/App.tsx deleted file mode 100644 index c3a0fd68a9..0000000000 --- a/src/website/components/App.tsx +++ /dev/null @@ -1,162 +0,0 @@ -import React, { useState } from "react"; -import { useSelector } from "react-redux"; -import Divider from "@material-ui/core/Divider"; -import Grid from "@material-ui/core/Grid"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { RootState } from "../reducers"; -import { Option } from "../domain/model/common"; -import LeftPanel from "./leftPanel/LeftPanel"; -import MainPanel from "./mainPanel/MainPanel"; -import RightPanel from "./rightPanel/RightPanel"; -import { setupBackgroundTasks } from "../backgroundTasks"; -import { LeftPanelType, MiddlePanelType, RightPanelType } from "../domain/model/panels"; -import { ViewMode } from "../domain/model/viewMode"; -import NotificationBar from "./NotificationBar"; - -export default App; - -const useStyles = makeStyles((theme: Theme) => ({ - grid: { - overflow: "hidden", - backgroundColor: theme.colors.sidePanel.backgroundColor, - flex: "1 0 auto", - }, - left: { - height: "100%", - width: "40%", - "&.rightPanelActive": { - width: "30%" - }, - "&.mobile": { - width: "100%" - } - }, - main: { - height: "100%", - backgroundColor: theme.colors.mainPanel.backgroundColor, - width: "60%", - "&.rightPanelActive": { - width: "40%" - }, - "&.mobile": { - width: "100%" - } - }, - right: { - height: "100%", - width: "30%", - "&.mobile": { - width: "100%" - } - }, - container: { - height: "100%", - overflow: "hidden", - display: "flex", - flexDirection: "column", - }, -})); - -function App() { - const classes = useStyles(); - const panel = useSelector((state: RootState) => state.appState.panelState); - const viewMode = useSelector((state: RootState) => state.appState.viewMode); - const [gridHeight, setGridHeight] = useState("100%"); - - setupBackgroundTasks(); - - function buildLeftPanel(): Option { - if (panel.leftPanel === LeftPanelType.None) { - return null; - } - - let className = classes.left; - if (viewMode === ViewMode.Mobile) { - className += " mobile"; - } else if (panel.rightPanel !== RightPanelType.None) { - className += " rightPanelActive"; - } - - return ( - <> - - - - - - ); - } - - function buildMainPanel(): Option { - if (panel.middlePanel === MiddlePanelType.None) { - return null; - } - - let className = "main-panel " + classes.main; - if (viewMode === ViewMode.Mobile) { - className += " mobile"; - } else if (panel.rightPanel !== RightPanelType.None) { - className += " rightPanelActive"; - } - - return ( - - - - ); - } - - function buildRightPanel(): Option { - if (panel.rightPanel === RightPanelType.None) { - return null; - } - - let className = classes.right; - if (viewMode === ViewMode.Mobile) { - className += " mobile"; - } - - return ( - <> - - - - - - ); - } - - function onNotificationBarRender(render: boolean) { - return render - ? setGridHeight("calc(100% - 32px)") - : setGridHeight("100%"); - } - - return ( -
- - - {buildLeftPanel()} - {buildMainPanel()} - {buildRightPanel()} - -
- ); -} - - diff --git a/src/website/components/AppRoot.tsx b/src/website/components/AppRoot.tsx deleted file mode 100644 index 4a0fe66fd3..0000000000 --- a/src/website/components/AppRoot.tsx +++ /dev/null @@ -1,205 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { Provider, useDispatch, useSelector } from "react-redux"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import useTheme from "@material-ui/core/styles/useTheme"; -import useMediaQuery from "@material-ui/core/useMediaQuery"; -import StyledEngineProvider from "@material-ui/styled-engine/StyledEngineProvider"; -import Container from "@material-ui/core/Container"; -import Backdrop from '@material-ui/core/Backdrop'; -import CircularProgress from '@material-ui/core/CircularProgress'; -import ModalContainer from "react-modal-promise"; -import { DelegationIdentity } from "@dfinity/identity"; -import { RootState } from "../reducers"; -import App from "./App"; -import store from "../store"; -import CanisterClientFactory from "../services/CanisterClientFactory"; -import Login from "./Login"; -import ThemeProvider from "./ThemeProvider"; -import { UserRegistrationStatus } from "../reducers/usersReducer"; -import RegisterUser from "./RegisterUser"; -import getCurrentUser from "../actions/users/getCurrentUser"; -import getAuthClient from "../utils/authClient"; -import { sessionExpiryAcknowledged } from "../actions/signin/notifySessionExpired"; -import SessionExpirationHandler from "../domain/SessionExpirationHandler"; -import switchViewMode from "../actions/app/switchViewMode"; -import { ViewMode } from "../domain/model/viewMode"; -import { gotoChatById } from "../actions/chats/gotoChat"; -import gotoHome from "../actions/app/gotoHome"; -import { alertDialog } from "./modals/Alert"; - -export default AppRoot; - -const useStyles = makeStyles((theme: Theme) => ({ - "@global": { - body: { - backgroundColor: theme.colors.outerBackgroundColor, - lineHeight: 1.5 - }, - header: { - backgroundColor: theme.colors.header.backgroundColor, - height: 52, - flexShrink: 0, - padding: "0 15px" - }, - input: { - backgroundColor: "transparent" - }, - a: { - color: theme.colors.linkColor - }, - "body, input": { - color: theme.colors.textColor - }, - "h1": { - fontSize: "6rem", - fontWeight: 300, - margin: 0, - [theme.breakpoints.down('sm')]: { - fontSize: "3rem" - } - } - }, - backdrop: { - zIndex: theme.zIndex.drawer + 1, - color: '#fff', - }, - container: { - padding: 24, - height: "100%", - "&.no-padding": { - padding: 0 - }, - [theme.breakpoints.down('sm')]: { - position: "fixed", - top: 0 - } - } -})); - -function AppRoot() { - return ( - - - - - - - - ); -} - -function AppContainer() { - const dispatch = useDispatch(); - const identity = getAuthClient().getIdentity(); - const isAnonymous = identity.getPrincipal().isAnonymous(); - const [canisterClientFactoryRequiresInit, setCanisterClientFactoryRequiresInit] = useState(!isAnonymous && CanisterClientFactory.current == null); - const sessionExpired = useSelector((state: RootState) => state.appState.sessionExpired); - const currentUser = useSelector((state: RootState) => state.usersState.me); - const userRegistrationStatus = useSelector((state: RootState) => state.usersState.userRegistrationStatus); - const currentViewMode = useSelector((state: RootState) => state.appState.viewMode); - const modalSpinner = useSelector((state: RootState) => state.appState.modalSpinner); - const classes = useStyles(); - const theme = useTheme(); - const targetViewMode = useMediaQuery(theme.breakpoints.down("sm")) ? ViewMode.Mobile : ViewMode.Desktop; - const removePadding = useMediaQuery(theme.breakpoints.down("lg")); - - let containerClass = classes.container; - - let component; - let large = false; - - if (canisterClientFactoryRequiresInit) { - component =
; - } else if (isAnonymous || (sessionExpired && userRegistrationStatus !== UserRegistrationStatus.Registered)) { - component = ; - } else { - switch (userRegistrationStatus) { - case UserRegistrationStatus.Unknown: - dispatch(getCurrentUser()); - component = null; - break; - case UserRegistrationStatus.NotRegistered: - component = ; - break; - case UserRegistrationStatus.Registered: - large = true; - component = ; - break; - } - } - - if (removePadding && large) { - containerClass += " no-padding"; - } - - useEffect(() => { - if (sessionExpired) { - (async () => { - await alertDialog({ - title: "Session Expired", - text: "Your session has expired - please login again", - }); - - dispatch(sessionExpiryAcknowledged()); - })() - } - }, [sessionExpired]); - - useEffect(() => { - if (currentViewMode !== targetViewMode) { - dispatch(switchViewMode(targetViewMode)); - } - }, [targetViewMode, currentViewMode]); - - useEffect(() => { - if (canisterClientFactoryRequiresInit) { - CanisterClientFactory.init(identity).then(_ => setCanisterClientFactoryRequiresInit(false)); - } - }, []); - - useEffect(() => { - window.onpopstate = function(event: PopStateEvent) { - if (event.state?.chatId) { - dispatch(gotoChatById(event.state.chatId, undefined, true)); - } else { - dispatch(gotoHome()); - } - }; - return () => { - window.onpopstate = () => null; - } - }, []); - - useEffect(() => { - // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/ - function setDocVh() { - // First we get the viewport height and we multiple it by 1% to get a value for a vh unit - let vh = window.innerHeight * 0.01; - // Then we set the value in the --vh custom property to the root of the document - document.documentElement.style.setProperty('--vh', `${vh}px`); - } - - window.onresize = () => setDocVh() - - setDocVh(); - }, []); - - useEffect(() => { - if (currentUser && !isAnonymous && identity instanceof DelegationIdentity) { - SessionExpirationHandler.startSession(); - } - }, [currentUser?.userId]); - - return ( - <> - - {component} - - - - - - - ); -} diff --git a/src/website/components/Login.tsx b/src/website/components/Login.tsx deleted file mode 100644 index 25be14bbeb..0000000000 --- a/src/website/components/Login.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import Button from "@material-ui/core/Button"; -import Paper from "@material-ui/core/Paper"; -import React from "react"; -import { useDispatch } from "react-redux"; -import login from "../actions/signin/login"; - -const useStyles = makeStyles((theme: Theme) => ({ - paper: { - color: theme.colors.loginRegister.textColor, - backgroundColor: theme.colors.loginRegister.backgroundColor, - textAlign: "center", - padding: 20 - }, - icon: { - width: 80, - height: 80 - }, - button: { - color: theme.colors.loginRegister.buttonTextColor, - backgroundColor: theme.colors.loginRegister.buttonBackgroundColor, - "&:hover": { - backgroundColor: theme.colors.loginRegister.buttonBackgroundColor, - } - } -})); - -export default function Login() { - const classes = useStyles(); - const dispatch = useDispatch(); - - return ( - - -

OpenChat

-

Welcome to OpenChat!

-

Before continuing you must sign-in to the Internet Computer.

- -
- ); -} diff --git a/src/website/components/NotificationBar.tsx b/src/website/components/NotificationBar.tsx deleted file mode 100644 index 0242144647..0000000000 --- a/src/website/components/NotificationBar.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { useSelector } from "react-redux"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import { RootState } from "../reducers"; -import CancelButton from "./shared/CloseButton"; -import * as notifications from "../notifications"; -import Backdrop from "@material-ui/core/Backdrop"; -import { ViewMode } from "../domain/model/viewMode"; - -export type Props = { - onRender: (render: boolean) => void, -}; - -export default React.memo(NotificationBar); - -const useStyles = makeStyles((theme: Theme) => ({ - topBar: { - display: "flex", - height: 32, - padding: 4, - textAlign: "center", - alignItems: "center", - backgroundColor: "#dea941", - color: "white", - "& button": { - background: "none!important", - textDecoration: "underline", - backgroundColor: "inherit", - color: "inherit", - } - }, - message: { - flex: "1 0 auto", - [theme.breakpoints.down('sm')]: { - fontSize: "14px" - }, - }, - cancelButton: { - width: 0, - height: 0, - }, -})); - -function NotificationBar(props: Props): JSX.Element { - const classes = useStyles(); - const myUserId = useSelector((state: RootState) => state.usersState.me?.userId!); - const [showBar, setShowBar] = useState(false); - const [showBackdrop, setShowBackdrop] = useState(false); - const viewMode = useSelector((state: RootState) => state.appState.viewMode); - - useEffect(() => { - (async () => { - let status = await notifications.status(); - if (status === notifications.Status.Prompt) { - renderBar(true); - } else if (status === notifications.Status.Granted) { - notifications.trySubscribe(myUserId); - } - })() - }, []); - - function renderBar(render: boolean) { - setShowBar(render); - props.onRender(render); - } - - async function onEnable() { - setShowBackdrop(true); - try { - let permission = await notifications.askForPermission(); - renderBar(false); - if (permission === "granted") { - notifications.trySubscribe(myUserId); - } - } finally { - setShowBackdrop(false); - } - } - - const message = viewMode === ViewMode.Mobile ? "Give permission to " : "OpenChat needs your permission to "; - - return ( - <> - theme.zIndex.drawer + 1 }} - > - { showBar ? -
-
{message}
- setShowBar(false)} className={classes.cancelButton} /> -
: null } - - ); -} diff --git a/src/website/components/RegisterUser.tsx b/src/website/components/RegisterUser.tsx deleted file mode 100644 index 9ad1bbd7f8..0000000000 --- a/src/website/components/RegisterUser.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import { useDispatch } from "react-redux"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import Paper from "@material-ui/core/Paper"; -import React from "react"; -import PersonIcon from '@material-ui/icons/Person'; -import Typography from "@material-ui/core/Typography"; -import registerUser, { RegisterUserOutcomeEvent, REGISTER_USER_FAILED_USERNAME_EXISTS, REGISTER_USER_FAILED_USER_EXISTS, REGISTER_USER_LIMIT_REACHED, REGISTER_USER_SUCCEEDED } from "../actions/users/registerUser"; -import NameInput from "./shared/NameInput"; - -const useStyles = makeStyles((theme: Theme) => ({ - paper: { - color: theme.colors.loginRegister.textColor, - backgroundColor: theme.colors.loginRegister.backgroundColor, - textAlign: "center", - padding: 20 - }, - icon: { - width: 80, - height: 80, - alignSelf: "center" - }, - button: { - color: theme.colors.loginRegister.buttonTextColor, - backgroundColor: theme.colors.loginRegister.buttonBackgroundColor, - "&:hover": { - backgroundColor: theme.colors.loginRegister.buttonBackgroundColor - } - }, - nameInput: { - margin: "auto", - maxWidth: 400, - marginTop: 30 - }, - errorText: { - minHeight: 20, - maxWidth: 400, - marginTop: 20, - color: "red", - alignSelf: "center" - }, - errorContainer: { - display: "flex", - justifyContent: "center" - } -})); - -export default function RegisterUser() { - const dispatch = useDispatch(); - const classes = useStyles(); - const [errorText, setErrorText] = React.useState(""); - - function handleSubmit(text: string) { - if (text && text.length > 2) { - setErrorText(""); - const registerUserAsync: () => Promise = () => dispatch(registerUser(text)) as any; - registerUserAsync().then((outcome) => { - switch (outcome.type) { - case REGISTER_USER_SUCCEEDED: - setErrorText(""); - break; - case REGISTER_USER_FAILED_USER_EXISTS: - setErrorText("You already have a name"); - break; - case REGISTER_USER_FAILED_USERNAME_EXISTS: - setErrorText("A user already exists with this username - please try another username"); - break; - case REGISTER_USER_LIMIT_REACHED: - setErrorText(`The number of users of this demo version of OpenChat has been limited to ${outcome.payload} and this limit has been reached. Check back soon for the full release!`); - break; - } - }); - } - } - - return ( - - -

Register user

- -
- - {errorText} - -
-
-); -} \ No newline at end of file diff --git a/src/website/components/ThemeProvider.tsx b/src/website/components/ThemeProvider.tsx deleted file mode 100644 index f56e586adb..0000000000 --- a/src/website/components/ThemeProvider.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { useSelector } from "react-redux"; -import MuiThemeProvider from "@material-ui/core/styles/ThemeProvider"; -import { darkTheme, lightTheme } from "../theme"; -import { RootState } from "../reducers"; -import { SelectedTheme } from "../domain/model/theme"; - -export interface Props { - children: React.ReactNode -} - -export default function ThemeProvider(props: Props) { - const selectedTheme = useSelector((state: RootState) => state.appState.selectedTheme); - const useSystemTheme = selectedTheme === SelectedTheme.SystemDefault; - const isSystemDarkModeQuery = window.matchMedia("(prefers-color-scheme: dark)"); - - const shouldDarkModeBeActive = isDarkModeSelected(); - - const [darkMode, setDarkMode] = useState(shouldDarkModeBeActive); - - if (darkMode !== shouldDarkModeBeActive) { - setDarkMode(shouldDarkModeBeActive) - } - - function isDarkModeSelected() : boolean { - return selectedTheme === SelectedTheme.Dark || - (selectedTheme === SelectedTheme.SystemDefault && isSystemDarkModeQuery.matches); - } - - function setDarkModeBasedOnSystemTheme() { - const isSystemDarkMode = isSystemDarkModeQuery.matches; - setDarkMode(isSystemDarkMode); - } - - useEffect(() => { - if (useSystemTheme) { - isSystemDarkModeQuery.addEventListener("change", setDarkModeBasedOnSystemTheme); - return () => isSystemDarkModeQuery.removeEventListener("change", setDarkModeBasedOnSystemTheme); - } - }, [useSystemTheme]); - - return ( - - {props.children} - - ); -} \ No newline at end of file diff --git a/src/website/components/leftPanel/ChatList.tsx b/src/website/components/leftPanel/ChatList.tsx deleted file mode 100644 index a63e8ab1fc..0000000000 --- a/src/website/components/leftPanel/ChatList.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React from "react"; -import { useSelector } from "react-redux"; -import List from "@material-ui/core/List"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { RootState } from "../../reducers"; -import * as chatListItemBuilder from "./ChatListItemBuilder"; - -export default React.memo(ChatList); - -const useStyles = makeStyles((_theme: Theme) => ({ - list: { - overflowX: "hidden", - overflowY: "auto" - } -})); - -function ChatList() { - const chatsState = useSelector((state: RootState) => state.chatsState); - const userDictionary: any = useSelector((state: RootState) => state.usersState.userDictionary); - const me = useSelector((state: RootState) => state.usersState.me?.userId) ?? ""; - const classes = useStyles(); - const selectedChatIndex = chatsState.selectedChatIndex; - - const chats = chatsState.chats.map((c, index) => { - return chatListItemBuilder.build(c, userDictionary, index, selectedChatIndex, me); - }); - - return ( - - {chats} - - ); -} diff --git a/src/website/components/leftPanel/ChatListItem.tsx b/src/website/components/leftPanel/ChatListItem.tsx deleted file mode 100644 index 2304d336e8..0000000000 --- a/src/website/components/leftPanel/ChatListItem.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import React from "react"; -import { useDispatch } from "react-redux"; -import ListItem from "@material-ui/core/ListItem"; -import ListItemIcon from "@material-ui/core/ListItemIcon"; -import Typography from "@material-ui/core/Typography"; -import { alpha } from "@material-ui/core/styles/colorManipulator"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { gotoChatByIndex } from "../../actions/chats/gotoChat"; -import { Option } from "../../domain/model/common"; -import { UserId } from "../../domain/model/users"; -import { formatMessageDate } from "../../formatters/date"; -import ParticipantsTyping from "../shared/ParticipantsTyping"; -import TextContent from "../shared/TextContent"; -import ThemTyping from "../shared/ThemTyping"; -import DefaultGroupChatIcon from "../shared/DefaultGroupChatIcon"; -import UserAvatar from "../shared/UserAvatar"; - -type Props = { - name: string, - date?: Date, - index: number, - selected: boolean, - latestMessage: string, - isGroup: boolean, - userId: Option, - userImageId: Option, - unreadCount: number, - themTyping: boolean, - userOnline: boolean, - participantsTyping: string[] -} - -const useStyles = makeStyles((theme: Theme) => ({ - listItem: { - backgroundColor: theme.colors.sidePanel.backgroundColor, - "&:hover": { - backgroundColor: theme.colors.sidePanel.listItemHoverBackgroundColor, - cursor: "pointer" - }, - "&.Mui-selected": { - backgroundColor: theme.colors.sidePanel.listItemSelectedBackgroundColor - } - }, - chatSummary: { - paddingLeft: 10, - width: "100%", - minWidth: 0 - }, - chatName: { - visibility: props => props.name.length ? "visible" : "hidden" - }, - latestMessage: { - color: alpha(theme.colors.textColor, 0.6), - whiteSpace: "nowrap", - overflow: "hidden", - textOverflow: "ellipsis", - }, - date: { - color: alpha(theme.colors.textColor, 0.6), - float: "right" - }, - unreadCount: { - fontSize: "0.75rem", - float: "right", - backgroundColor: theme.colors.green.main, - color: theme.colors.green.contrastText, - lineHeight: "20px", - borderRadius: 10, - textAlign: "center", - verticalAlign: "middle", - minWidth: 20, - padding: "0 4px" - } -})); - -export default React.memo(ChatListItem); - -function ChatListItem(props: Props) { - const dispatch = useDispatch(); - const classes = useStyles(props); - - const icon = props.isGroup - ? - : ; - - let snippet: JSX.Element; - if (props.themTyping) { - snippet = ; - } else if (props.participantsTyping.length) { - snippet = - } else { - snippet = ; - } - - return ( - dispatch(gotoChatByIndex(props.index))} className={classes.listItem} divider> - - {icon} - -
-
- {props.date ? formatMessageDate(props.date) : null} - {props.name.length ? props.name : "Loading"} -
-
- {props.unreadCount > 0 ?
{props.unreadCount}
: null} -
- {snippet} -
-
-
-
- ); -} diff --git a/src/website/components/leftPanel/ChatListItemBuilder.tsx b/src/website/components/leftPanel/ChatListItemBuilder.tsx deleted file mode 100644 index f5dd2d0ce2..0000000000 --- a/src/website/components/leftPanel/ChatListItemBuilder.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import React from "react"; -import ChatListItem from "./ChatListItem"; -import { Chat } from "../../domain/model/chats"; -import { Option } from "../../domain/model/common"; -import { UserId } from "../../domain/model/users"; -import * as chatFunctions from "../../domain/model/chats"; -import * as stateFunctions from "../../domain/stateFunctions"; -import { sentByMe } from "../../domain/model/messages"; -import { getContentAsText } from "../../domain/messageFunctions"; -import { formatCyclesText } from "../mainPanel/CyclesContent"; - -export function build(chat: Chat, userDictionary: any, index: number, selectedChatIndex: Option, me: UserId) : JSX.Element { - let name: string; - let key: string; - let isGroup: boolean; - let userId: Option = null; - let userImageId: Option = null; - let themTyping: boolean = false; - let userOnline = false; - let participantsTyping: string[] = []; - - if (chatFunctions.isDirectChat(chat)) { - const user = userDictionary.hasOwnProperty(chat.them) ? userDictionary[chat.them] : null; - name = user?.username ?? ""; - key = "D-" + chat.them.toString(); - isGroup = false; - themTyping = chatFunctions.isConfirmedChat(chat) && chat.themTyping; - userOnline = (userDictionary.hasOwnProperty(chat.them) ? userDictionary[chat.them].minutesSinceLastOnline < 2 : false); - userId = chat.them; - userImageId = user?.imageId ?? null; - } else { - name = chat.subject; - isGroup = true; - if (chatFunctions.isConfirmedChat(chat)) { - key = "G-" + chat.chatId.toString(); - participantsTyping = stateFunctions.getUsers(chat.participantsTyping, userDictionary).map(u => u.username); - } else { - key = "NG-" + chat.subject; - } - } - - let latestMessageText = ""; - for (let i = chat.messages.length - 1; i >= 0; i--) { - const message = chat.messages[i]; - if ("content" in message) { - if (message.content.kind === "cycles") { - latestMessageText = formatCyclesText(message.content.amount, sentByMe(message, me), name); - } else { - latestMessageText = getContentAsText(message.content); - } - break; - } - } - - return ( - - ); -} diff --git a/src/website/components/leftPanel/DefaultPanel.tsx b/src/website/components/leftPanel/DefaultPanel.tsx deleted file mode 100644 index b217d34160..0000000000 --- a/src/website/components/leftPanel/DefaultPanel.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import React, { useState } from "react"; -import { useSelector } from "react-redux"; -import ChatList from "./ChatList"; -import Header from "./Header"; -import SearchResults from "./SearchResults"; -import SearchBox from "../shared/SearchBox"; -import MyAvatar from "./MyAvatar"; -import { RootState } from "../../reducers"; -import UserMenu from "./UserMenu"; - -const PLACEHOLDER_TEXT = "Search chats and messages"; - -export default React.memo(DefaultPanel); - -function DefaultPanel() { - const [inputText, setInputText] = useState(""); - const myUsername = useSelector((state: RootState) => state.usersState.me?.username)!; - - const contentPanel = inputText.length - ? setInputText("")} /> - : ; - - const avatar = ; - - return ( - <> -
} /> - - {contentPanel} - - ); -} diff --git a/src/website/components/leftPanel/Header.tsx b/src/website/components/leftPanel/Header.tsx deleted file mode 100644 index 4f907cdcb7..0000000000 --- a/src/website/components/leftPanel/Header.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React from "react"; -import Grid from "@material-ui/core/Grid"; -import Typography from "@material-ui/core/Typography"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; - -export default React.memo(Header); - -type Props = { - leftIcon: JSX.Element, - title: string, - rightIcon: JSX.Element -} - -const useStyles = makeStyles((theme: Theme) => ({ - title: { - color: theme.colors.header.primaryTextColor, - marginLeft: 24, - whiteSpace: "nowrap" - } -})); - -function Header(props: Props) { - const classes = useStyles(); - - return ( - <> - - - - - {props.leftIcon} - - - {props.title} - - - - - {props.rightIcon} - - - - ); -} diff --git a/src/website/components/leftPanel/JoinGroupChatPanel.tsx b/src/website/components/leftPanel/JoinGroupChatPanel.tsx deleted file mode 100644 index 0be4a52637..0000000000 --- a/src/website/components/leftPanel/JoinGroupChatPanel.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import React from "react"; -import { useDispatch } from "react-redux"; -import { alpha } from "@material-ui/core/styles/colorManipulator"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { changeLeftPanel } from "../../actions/app/changeSidePanel"; -import Header from "./Header"; -import CancelButton from "../shared/CloseButton"; -import CreateGroupChatIcon from "../shared/CreateGroupChatIcon"; -import NameInput from "../shared/NameInput"; -import joinGroup from "../../actions/chats/joinGroup"; -import { LeftPanelType } from "../../domain/model/panels"; - -const PLACEHOLDER_TEXT = "Invite Code"; - -export default React.memo(JoinGroupChatPanel); - -const useStyles = makeStyles((theme: Theme) => ({ - nameInput: { - marginTop: 60, - marginLeft: 30 - }, - cancelButton: { - color: alpha(theme.colors.header.primaryTextColor, 0.6) - } -})); - -function JoinGroupChatPanel() { - const dispatch = useDispatch(); - const classes = useStyles(); - - function closePanel() { - dispatch(changeLeftPanel(LeftPanelType.Chats)); - } - - function handleSubmit(text: string) { - closePanel(); - - const chatId = BigInt("0x" + text); - - dispatch(joinGroup(chatId)); - } - - const newChatIcon = ; - - return ( - <> -
} /> - - - ); -} diff --git a/src/website/components/leftPanel/LeftPanel.tsx b/src/website/components/leftPanel/LeftPanel.tsx deleted file mode 100644 index 7d12b200d5..0000000000 --- a/src/website/components/leftPanel/LeftPanel.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from "react"; -import DefaultSidePanel from "./DefaultPanel"; -import JoinGroupChatSidePanel from "./JoinGroupChatPanel"; -import NewDirectChatSidePanel from "./NewDirectChatPanel"; -import NewGroupChatSidePanel from "./NewGroupChatPanel"; -import { LeftPanelType } from "../../domain/model/panels"; - -export default LeftPanel; - -type Props = { - type: LeftPanelType -} - -function LeftPanel(props: Props) { - switch (props.type) { - case LeftPanelType.None: - return null; - case LeftPanelType.Chats: - return ; - case LeftPanelType.JoinGroupChat: - return ; - case LeftPanelType.NewDirectChat: - return ; - case LeftPanelType.NewGroupChat: - return ; - } -} diff --git a/src/website/components/leftPanel/MessageSearchMatch.tsx b/src/website/components/leftPanel/MessageSearchMatch.tsx deleted file mode 100644 index 0174b6cf21..0000000000 --- a/src/website/components/leftPanel/MessageSearchMatch.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import React from "react"; -import { useDispatch, useSelector } from "react-redux"; -import ListItem from "@material-ui/core/ListItem"; -import Typography from "@material-ui/core/Typography"; -import { alpha } from "@material-ui/core/styles/colorManipulator"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { ChatId } from "../../domain/model/chats"; -import * as chatFunctions from "../../domain/model/chats"; -import * as stateFunctions from "../../domain/stateFunctions"; -import { LocalMessage } from "../../domain/model/messages"; -import { RootState } from "../../reducers"; -import { gotoChatByIndex } from "../../actions/chats/gotoChat"; -import { formatMessageDate } from "../../formatters/date"; -import TextContent from "../shared/TextContent"; -import { getContentAsText } from "../../domain/messageFunctions"; - -export default React.memo(MessageSearchMatch); - -type Props = { - chatId: ChatId, - message: LocalMessage, - searchTerm: string -} - -const useStyles = makeStyles((theme: Theme) => ({ - listItem: { - "&:hover": { - backgroundColor: theme.colors.sidePanel.listItemHoverBackgroundColor, - cursor: "pointer" - } - }, - messageSummary: { - width: "100%" - }, - messageSnippet: { - color: alpha(theme.colors.textColor, 0.6), - whiteSpace: "nowrap", - overflow: "hidden", - textOverflow: "ellipsis", - maxWidth: 450 - }, - date: { - color: alpha(theme.colors.textColor, 0.6), - float: "right" - } -})); - -function MessageSearchMatch(props: Props) { - const dispatch = useDispatch(); - const classes = useStyles(); - - const [chat, index] = useSelector((state: RootState) => - chatFunctions.getChat(state.chatsState.chats, props.chatId)); - - const userDictionary = useSelector((state: RootState) => state.usersState.userDictionary); - - let chatName: string; - if (chatFunctions.isDirectChat(chat)) { - chatName = stateFunctions.getUserSummary(chat.them, userDictionary)?.username ?? ""; - } else { - chatName = chat.subject; - } - - return ( - dispatch(gotoChatByIndex(index, props.message.id))} className={classes.listItem} divider> -
-
- {formatMessageDate(props.message.date)} - {chatName} -
-
-
- -
-
-
-
- ); -} diff --git a/src/website/components/leftPanel/MyAvatar.tsx b/src/website/components/leftPanel/MyAvatar.tsx deleted file mode 100644 index 4ae1cfdb46..0000000000 --- a/src/website/components/leftPanel/MyAvatar.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import React from "react"; -import { useDispatch, useSelector, shallowEqual } from "react-redux"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { RootState } from "../../reducers"; -import UserAvatar from "../shared/UserAvatar"; -import setProfileImage from "../../actions/users/setProfileImage"; -import { alertDialog } from "../../components/modals/Alert"; -import { MAX_AVATAR_SIZE } from "../../constants"; - -export default React.memo(MyAvatar); - -type Props = { - size: "sm" | "md" -} - -const useStyles = makeStyles((theme: Theme) => ({ - myAvatar: { - cursor: "pointer" - } -})); - -function MyAvatar(props: Props) { - const dispatch = useDispatch(); - const userImage = useSelector((state: RootState) => { - const me = state.usersState.me; - return me ? { - userId: me.userId, - imageId: me.imageId, - blobUrl: me.imageBlobUrl - } : null; - }, shallowEqual); - - const userExists = userImage !== null; - const classes = useStyles(); - - function onAvatarFileSelected(event: any) { - if (!userImage) { - return; - } - let files = event.target.files; - if (!files || !files[0]) { - return; - } - const file: File = files[0]; - const reader = new FileReader(); - reader.onload = function(e: any) { - const mimeType = file.type; - const data: ArrayBuffer = e.target.result; - - if (!mimeType.startsWith("image/")) { - alertDialog({ - title: "Invalid avatar image", - text: "You must choose an image" - }); - return; - } - - if (data.byteLength > MAX_AVATAR_SIZE) { - alertDialog({ - title: "Invalid avatar image", - text: "Your image file must be less than 256 Kb in size" - }); - return; - } - - dispatch(setProfileImage(userImage.userId, new Uint8Array(data))); - } - reader.readAsArrayBuffer(file); - } - - return ( - - ); -} - diff --git a/src/website/components/leftPanel/NewDirectChatPanel.tsx b/src/website/components/leftPanel/NewDirectChatPanel.tsx deleted file mode 100644 index 4a142c86b4..0000000000 --- a/src/website/components/leftPanel/NewDirectChatPanel.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import React, { useLayoutEffect, useRef, useState } from "react"; -import { useDispatch } from "react-redux"; -import List from "@material-ui/core/List"; -import { alpha } from "@material-ui/core/styles/colorManipulator"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { changeLeftPanel } from "../../actions/app/changeSidePanel"; -import userMgmtService from "../../services/userMgmt/service"; -import { SearchUsersRequest } from "../../services/userMgmt/searchUsers"; -import { fromUserSummary, UserSummary } from "../../domain/model/users"; -import gotoUser from "../../actions/chats/gotoUser"; -import SearchBox from "../shared/SearchBox"; -import UserListItem from "../shared/UserListItem"; -import Header from "./Header"; -import CloseButton from "../shared/CloseButton"; -import CreateGroupChatIcon from "../shared/CreateGroupChatIcon"; -import { LeftPanelType } from "../../domain/model/panels"; - -const PLACEHOLDER_TEXT = "Type a username"; - -export default React.memo(NewDirectChatPanel); - -const useStyles = makeStyles((theme: Theme) => ({ - closeButton: { - color: alpha(theme.colors.header.primaryTextColor, 0.6) - } -})); - -function NewDirectChatPanel() { - const dispatch = useDispatch(); - const classes = useStyles(); - - const emptyResults: UserSummary[] = []; - const [text, setText] = useState(""); - const [results, setResults] = useState(emptyResults); - const clearInput = () => setText(""); - const textBoxRef = useRef(null); - - function handleInputChange(text: string) { - setText(text); - - if (text.length > 0) { - const request: SearchUsersRequest = { - search_term: text, - max_results: 20 - }; - userMgmtService.searchUsers(request).then(response => { - setResults(response.users); - }); - } else { - setResults(emptyResults); - } - } - - function closePanel() { - clearInput(); - dispatch(changeLeftPanel(LeftPanelType.Chats)); - } - - function handleSelectUser(user: UserSummary) { - closePanel(); - dispatch(gotoUser(user)); - } - - useLayoutEffect(() => { - textBoxRef.current?.focus(); - }, []); - - return ( - <> -
} - title="Start a new chat" - rightIcon={} /> - - - {results.map(user => handleSelectUser(user)} />)} - - - ); -} diff --git a/src/website/components/leftPanel/NewGroupChatPanel.tsx b/src/website/components/leftPanel/NewGroupChatPanel.tsx deleted file mode 100644 index f1d917b664..0000000000 --- a/src/website/components/leftPanel/NewGroupChatPanel.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import React, { useState } from "react"; -import { useDispatch } from "react-redux"; -import Checkbox from "@material-ui/core/Checkbox"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import { alpha } from "@material-ui/core/styles/colorManipulator"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { changeLeftPanel } from "../../actions/app/changeSidePanel"; -import createGroupChat from "../../actions/chats/createGroupChat"; -import Header from "./Header"; -import CancelButton from "../shared/CloseButton"; -import CreateGroupChatIcon from "../shared/CreateGroupChatIcon"; -import NameInput from "../shared/NameInput"; -import { LeftPanelType } from "../../domain/model/panels"; - -const PLACEHOLDER_TEXT = "Group Name"; - -export default React.memo(NewGroupChatPanel); - -const useStyles = makeStyles((theme: Theme) => ({ - nameInput: { - marginTop: 60 - }, - textBox: { - marginLeft: 30 - }, - checkBox: { - margin: "20px auto 0" - }, - cancelButton: { - color: alpha(theme.colors.header.primaryTextColor, 0.6) - } -})); - -function NewGroupChatPanel() { - const dispatch = useDispatch(); - const classes = useStyles(); - const [chatHistoryVisibleToNewJoiners, setChatHistoryVisibleToNewJoiners] = useState(false); - - function closePanel() { - dispatch(changeLeftPanel(LeftPanelType.Chats)); - } - - function handleSubmit(text: string) { - closePanel(); - dispatch(createGroupChat(text, [], chatHistoryVisibleToNewJoiners)); - } - - const newChatIcon = ; - - const chatHistoryVisibleCheckBox = } - label="Chat history visible to new joiners" - className={classes.checkBox} - checked={chatHistoryVisibleToNewJoiners} - onChange={(_, checked) => setChatHistoryVisibleToNewJoiners(checked)} />; - - return ( - <> -
} /> - - - ); -} diff --git a/src/website/components/leftPanel/SearchResults.tsx b/src/website/components/leftPanel/SearchResults.tsx deleted file mode 100644 index d4bbcfde54..0000000000 --- a/src/website/components/leftPanel/SearchResults.tsx +++ /dev/null @@ -1,130 +0,0 @@ -import React, {useEffect, useState} from "react"; -import { useSelector } from "react-redux"; -import Box from "@material-ui/core/Box"; -import Divider from "@material-ui/core/Divider"; -import Grid from "@material-ui/core/Grid"; -import List from "@material-ui/core/List"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { RootState } from "../../reducers"; -import * as stateFunctions from "../../domain/stateFunctions"; -import { Chat, ChatId } from "../../domain/model/chats"; -import * as chatFunctions from "../../domain/model/chats"; -import { Option } from "../../domain/model/common"; -import { LocalMessage } from "../../domain/model/messages"; -import { UserId, UserSummary } from "../../domain/model/users"; -import * as chatListItemBuilder from "./ChatListItemBuilder"; -import MessageSearchMatch from "./MessageSearchMatch"; -import chatsService from "../../services/chats/service"; -import { SearchAllMessagesResponse } from "../../services/chats/searchAllMessages"; - -type Props = { - searchTerm: string, - clearSearchTerm: () => void -} - -type MessageMatch = { - chatId: ChatId, - message: LocalMessage -} - -const useStyles = makeStyles((theme: Theme) => ({ - searchResults: { - overflow: "auto" - }, - groupTitle: { - padding: "4px 16px" - } -})); - -export default React.memo(SearchResults); - -function SearchResults(props: Props) { - const chats = useSelector((state: RootState) => state.chatsState.chats); - const me = useSelector((state: RootState) => state.usersState.me?.userId) ?? ""; - const userDictionary: any = useSelector((state: RootState) => state.usersState.userDictionary); - const [messageMatches, setMessageMatches] = useState([]); - const getUser = (userId: UserId) => stateFunctions.getUserSummary(userId, userDictionary); - - const chatMatches = searchChats(chats, props.searchTerm, getUser); - - useEffect(() => { - // search messages - chatsService - .searchAllMessages(props.searchTerm, 20) - .then((res: SearchAllMessagesResponse) => { - if (res.kind === "success") { - const matches = res.result.matches; - setMessageMatches(matches); - } - }) - }, [props.searchTerm]); - - const classes = useStyles(); - - function createGroup(title: string, items: JSX.Element[]) { - return ( - - {title} - - - {items} - - - ); - } - - const groups: JSX.Element[] = []; - if (chatMatches.length) { - groups.push(createGroup("Chats", chatMatches.map(([chat, index]) => - chatListItemBuilder.build(chat, userDictionary, index, null, me)))); - } - - if (messageMatches.length) { - groups.push(createGroup("Messages", messageMatches.map(m => ))); - } - - return ( - - {groups} - - ); -} - -function searchChats(chats: Chat[], searchTerm: string, getUser: (userId: UserId) => Option) : [Chat, number][] { - searchTerm = searchTerm.toLowerCase(); - - const matches: [Chat, number][] = []; - for (let index = 0; index < chats.length; index++) { - const chat = chats[index]; - if (chatFunctions.isDirectChat(chat)) { - const user = getUser(chat.them); - if (user && user.username.toLowerCase().indexOf(searchTerm) >= 0) { - matches.push([chat, index]); - } - } else if (chat.subject.toLowerCase().indexOf(searchTerm) >= 0) { - matches.push([chat, index]); - } - } - - return matches; -} - -function searchUsers(users: UserSummary[], searchTerm: string) : UserSummary[] { - searchTerm = searchTerm.toLowerCase(); - - return users.filter(u => u.username.toLowerCase().indexOf(searchTerm) >= 0); -} - -function getUsersWithoutDirectChats(users: UserSummary[], chats: Chat[]) : UserSummary[] { - const usersWithDirectChats = new Set(); - for (const chat of chats.filter(chatFunctions.isDirectChat)) { - usersWithDirectChats.add(chat.them); - } - - return users.filter(u => !usersWithDirectChats.has(u.userId)); -} diff --git a/src/website/components/leftPanel/ThemeSelector.tsx b/src/website/components/leftPanel/ThemeSelector.tsx deleted file mode 100644 index 51b46f7d84..0000000000 --- a/src/website/components/leftPanel/ThemeSelector.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import React, { useState } from "react"; -import { useDispatch, useSelector } from "react-redux"; -import Dialog from "@material-ui/core/Dialog"; -import DialogActions from "@material-ui/core/DialogActions"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import RadioGroup from "@material-ui/core/RadioGroup"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Button from "@material-ui/core/Button"; -import Radio from '@material-ui/core/Radio'; -import useTheme from "@material-ui/core/styles/useTheme"; -import selectTheme from "../../actions/app/selectTheme"; -import { RootState } from "../../reducers"; -import { SelectedTheme } from "../../domain/model/theme"; - -export default ThemeSelector; - -type Props = { - onClose: () => void -} - -const options: ThemeOption[] = [ - { - name: "System default", - value: SelectedTheme.SystemDefault - }, { - name: "Light", - value: SelectedTheme.Light - }, { - name: "Dark", - value: SelectedTheme.Dark - } -]; - -type ThemeOption = { - name: string, - value: SelectedTheme -} - -function ThemeSelector(props: Props) { - const dispatch = useDispatch(); - const currentTheme = useSelector((state: RootState) => state.appState.selectedTheme); - const [value, setValue] = useState(currentTheme); - const theme = useTheme(); - - function handleChange(event: React.ChangeEvent) { - const selectedTheme = parseInt(event.target.value) as SelectedTheme; - setValue(selectedTheme); - } - - function handleOk() { - dispatch(selectTheme(value)); - props.onClose(); - } - - return ( - - Select theme - - - {options.map((option) => ( - } - label={option.name} - color={theme.colors.buttonColor} /> - ))} - - - - - - - - ) -} \ No newline at end of file diff --git a/src/website/components/leftPanel/UserMenu.tsx b/src/website/components/leftPanel/UserMenu.tsx deleted file mode 100644 index c2912feaa8..0000000000 --- a/src/website/components/leftPanel/UserMenu.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React, { useState } from "react"; -import { useDispatch } from "react-redux"; -import { alpha } from "@material-ui/core/styles/colorManipulator"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import MoreVertIcon from "@material-ui/icons/MoreVert"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { changeLeftPanel } from "../../actions/app/changeSidePanel"; -import PopOverMenu, { MenuItem } from "../shared/PopOverMenu"; -import ThemeSelector from "./ThemeSelector"; -import logout from "../../actions/signin/logout"; -import { alertDialog } from "../../components/modals/Alert"; -import { LeftPanelType } from "../../domain/model/panels"; -import { ABOUT_US } from "../../constants"; - -export default React.memo(UserMenu); - -const useStyles = makeStyles((theme: Theme) => ({ - menuIcon: { - color: alpha(theme.colors.header.primaryTextColor, 0.6) - } -})); - -function UserMenu() { - const dispatch = useDispatch(); - const classes = useStyles(); - const [themeSelectorOpen, setThemeSelectorOpen] = useState(false); - - const menuItems: MenuItem[] = []; - menuItems.push({ text: "New chat", action: () => dispatch(changeLeftPanel(LeftPanelType.NewDirectChat)) }); - menuItems.push({ text: "New group", action: () => dispatch(changeLeftPanel(LeftPanelType.NewGroupChat)) }); - menuItems.push({ text: "Join group", action: () => dispatch(changeLeftPanel(LeftPanelType.JoinGroupChat)) }); - menuItems.push({ text: "Theme", action: () => setThemeSelectorOpen(true) }); - menuItems.push({ text: "Internet Identity", action: () => window.open(process.env.IDP_URL, "_blank") }); - menuItems.push({ text: "TEST MODE", action: () => alertDialog(ABOUT_US) }); - menuItems.push({ text: "Logout", action: () => dispatch(logout()) }); - - return ( - <> - } placement="bottom-start" menuItems={menuItems} /> - {themeSelectorOpen - ? setThemeSelectorOpen(false)} /> - : null} - - ); -} - diff --git a/src/website/components/mainPanel/AttachFile.tsx b/src/website/components/mainPanel/AttachFile.tsx deleted file mode 100644 index 765056f14d..0000000000 --- a/src/website/components/mainPanel/AttachFile.tsx +++ /dev/null @@ -1,125 +0,0 @@ -import React from "react"; -import IconButton from "@material-ui/core/IconButton"; -import Paperclip from "../../icons/paperclip.svg"; -import { DraftMessageContent } from "../../domain/model/messages"; -import { dataToBlobUrl } from "../../utils/blobFunctions"; -import Dimensions from "../../utils/Dimensions"; -import { MAX_FILE_SIZE, MAX_IMAGE_SIZE, MAX_VIDEO_SIZE } from "../../constants"; - -export interface Props { - className: string, - onFileSelected: (content: DraftMessageContent) => void, - onFileValidationError: (error: FileValidationError, mimeType: string) => void -} - -export enum FileValidationError { - FileTooBig -} - -export default React.memo(AttachFile); - -function AttachFile(props: Props) { - return ( - - - - - ); - - function onMediaSelected(event: any) { - let files = event.target.files; - if (!files || !files[0]) { - return; - } - const file: File = files[0]; - const reader = new FileReader(); - reader.onload = async function(e: any) { - const mimeType = file.type; - const data: ArrayBuffer = e.target.result; - let content: DraftMessageContent; - - if ((mimeType.startsWith("image/") && data.byteLength > MAX_IMAGE_SIZE) || - (mimeType.startsWith("video/") && data.byteLength > MAX_VIDEO_SIZE) || - (data.byteLength > MAX_FILE_SIZE) ) { - props.onFileValidationError(FileValidationError.FileTooBig, mimeType); - return; - } - - if (mimeType.startsWith("video/") || mimeType.startsWith("image/")) { - const blobUrl = dataToBlobUrl(data, mimeType); - - const extract = mimeType.startsWith("image/") - ? await extractImageThumbnail(blobUrl) - : await extractVideoThumbnail(blobUrl) - - content = { - kind: "media", - caption: null, - mimeType: mimeType, - width: extract.dimensions.width, - height: extract.dimensions.height, - data: new Uint8Array(e.target.result), - blobUrl, - thumbnailData: extract.thumbnailData - }; - } else { - content = { - kind: "file", - caption: null, - name: file.name, - mimeType: mimeType, - data: new Uint8Array(e.target.result) - }; - } - - props.onFileSelected(content); - } - reader.readAsArrayBuffer(file); - } - - async function extractImageThumbnail(blobUrl: string) { - return new Promise((resolve, _) => { - const img = new Image; - img.onload = function() { - const extract = extractThumbnail(img, new Dimensions(img.width, img.height)); - resolve(extract); - } - img.src = blobUrl; - }); - } - - async function extractVideoThumbnail(blobUrl: string) { - return new Promise((resolve, _) => { - const video = document.createElement("video"); - video.addEventListener("loadedmetadata", function () { - video.addEventListener("seeked", function () { - const extract = extractThumbnail(video, new Dimensions(this.videoWidth, this.videoHeight)); - resolve(extract); - }); - video.currentTime = 1; - }); - video.src = blobUrl; - }); - } - - function extractThumbnail(original: HTMLImageElement | HTMLVideoElement, dimensions: Dimensions): MediaExtract { - const thumbnailDimensions = dimensions.scaleToFit(new Dimensions(25, 25)); - const canvas = document.createElement("canvas"); - canvas.width = thumbnailDimensions.width; - canvas.height = thumbnailDimensions.height; - const context = canvas.getContext("2d")!; - context.drawImage(original, 0, 0, canvas.width, canvas.height); - return{ - dimensions: dimensions, - thumbnailData: canvas.toDataURL() - }; - } - - type MediaExtract = { - dimensions: Dimensions, - thumbnailData: string - } -} \ No newline at end of file diff --git a/src/website/components/mainPanel/CyclesContent.tsx b/src/website/components/mainPanel/CyclesContent.tsx deleted file mode 100644 index 0d41135824..0000000000 --- a/src/website/components/mainPanel/CyclesContent.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React from "react"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import Typography from "@material-ui/core/Typography"; -import { formatCycles } from "../../formatters/cycles"; -import { Option } from "../../domain/model/common"; -import { CyclesContent as Cycles } from "../../domain/model/messages"; - -export default React.memo(CyclesContent); - -export interface Props { - content: Cycles, - sentByMe: boolean, - theirUsername: Option -} - -export function formatCyclesText(amount: bigint, sentTo: boolean, them: Option) : string { - return formatCycles(amount) + (sentTo ? " sent to " : " received from ") + (them ?? "unknown"); -} - -const useStyles = makeStyles((theme: Theme) => ({ - cycles: { - padding: "0 12px", - display: "flex", - alignItems: "center" - }, - icon: { - fontSize: 50, - marginRight: 12 - } -})); - -function CyclesContent(props : Props): JSX.Element { - const classes = useStyles(props); - return ( -
- 🎉 - {formatCyclesText(props.content.amount, props.sentByMe, props.theirUsername)} -
- ); -} diff --git a/src/website/components/mainPanel/DayChangeMarker.tsx b/src/website/components/mainPanel/DayChangeMarker.tsx deleted file mode 100644 index 3547e0884b..0000000000 --- a/src/website/components/mainPanel/DayChangeMarker.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React from "react"; -import Typography from "@material-ui/core/Typography"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { toDayOfWeekString, toLongDateString } from "../../formatters/date"; -import * as dateFunctions from "../../utils/dateFunctions"; - -type Props = { - date: Date -} - -const useStyles = makeStyles((theme: Theme) => ({ - dayChangeMarker: { - padding: "6px 12px", - borderRadius: 10, - color: theme.colors.dayChangeMarker.textColor, - backgroundColor: theme.colors.dayChangeMarker.backgroundColor, - alignSelf: "center", - position: "sticky", - top: 10, - zIndex: 60 - } -})); - -export default React.memo(DayChangeMarker); - -function DayChangeMarker(props : Props) { - const classes = useStyles(); - return {formatDate(props.date)}; -} - -function formatDate(date: Date) : string { - const startOfToday = dateFunctions.getStartOfToday(); - if (date >= startOfToday) { - return "Today"; - } - const startOfYesterday = dateFunctions.addDays(startOfToday, -1); - if (date >= startOfYesterday) { - return "Yesterday"; - } - const useDayNameOnly = date >= dateFunctions.addDays(startOfToday, -6); - return useDayNameOnly - ? toDayOfWeekString(date) - : toLongDateString(date); -} diff --git a/src/website/components/mainPanel/DirectChatMenu.tsx b/src/website/components/mainPanel/DirectChatMenu.tsx deleted file mode 100644 index e357ced67e..0000000000 --- a/src/website/components/mainPanel/DirectChatMenu.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React from "react"; -import { useDispatch, useSelector } from "react-redux"; -import { alpha } from "@material-ui/core/styles/colorManipulator"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import MoreVertIcon from "@material-ui/icons/MoreVert"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { RootState } from "../../reducers"; -import PopOverMenu, { MenuItem } from "../shared/PopOverMenu"; -import { ChatId } from "../../domain/model/chats"; -import { UserId } from "../../domain/model/users"; -import { blockUser } from "../../actions/chats/blockUser"; -import { markAllMessagesAsReadLocally } from "../../actions/chats/markMessagesAsRead"; -import { toggleNotifications } from "../../actions/chats/toggleNotifications"; - -export default React.memo(DirectChatMenu); - -type Props = { - chatId: ChatId, - userId: UserId, - muted: boolean, - any_unread: boolean, -} - -const useStyles = makeStyles((theme: Theme) => ({ - menuIcon: { - color: alpha(theme.colors.header.primaryTextColor, 0.6) - } -})); - -function DirectChatMenu(props: Props) { - const dispatch = useDispatch(); - const unblock = useSelector((state: RootState) => state.chatsState.blockedUsers).includes(props.userId); - const classes = useStyles(); - const menuItems: MenuItem[] = []; - // menuItems.push({ text: "Contact info", action: () => {} }); - menuItems.push({ text: props.muted ? "Unmute notifications" : "Mute notifications", action: () => dispatch(toggleNotifications(props.chatId, !props.muted)) }); - // menuItems.push({ text: "Delete chat", action: () => {} }); - menuItems.push({ text: unblock ? "Unblock user" : "Block user", action: () => dispatch(blockUser(props.userId, unblock)) }); - menuItems.push({ text: "Mark all as read", action: () => dispatch(markAllMessagesAsReadLocally(props.chatId)), disable: !props.any_unread }); - - return } - menuItems={menuItems} - placement="bottom-end" />; -} diff --git a/src/website/components/mainPanel/DraftFileMessage.tsx b/src/website/components/mainPanel/DraftFileMessage.tsx deleted file mode 100644 index 6fa48fd9b6..0000000000 --- a/src/website/components/mainPanel/DraftFileMessage.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from "react"; -import makeStyles from "@material-ui/styles/makeStyles"; -import formatFileSize from "../../formatters/fileSize"; - -type Props = { - mimeType: string, - name: string, - size: number -} - -export default React.memo(DraftMediaMessage); - -const useStyles = makeStyles(() => ({ - container: { - padding: 2, - backgroundColor: "#aaaaaa", - }, - file: { - minWidth: 300, - padding: "10px 9px", - backgroundColor: "#aaaaaa", - fontSize: 14, - lineHeight: 1, - display: "flex", - alignItems: "center" - }, - icon: { - backgroundImage: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAA8CAYAAADL94L/AAAByElEQVR4Ae3axdJTQRAFYFyegA3u8ALseCDcicsGhxt3x+G32BXc3X3NBnfXYTqp3sZlhuqpOlXZRL46He9ReJyJxGSTEreaPfEHZiX+1uSJvelVNu+Jvjd7Yk9zI8aSUe0eDpjCIYfNSuw5v/zF5In/6mU27478tXriLJvXjdSwPq1lCDTCmxjiCNav8GZYBVMwWKagX8kWjk9vCcMhYWhEFEw1+oV0wZjdPKY6Vn9EwmBDTYPwBoXCYPLGDQTJjkHQNQRJj0FQtmgs+C8wOHIIkh2DoDu5vD5Xfkz9hsTBWDyxhjDYUDqvLRYSY1JilSQGyyxXOt4QKJPX70NDQmI27gyxHcn9bH/5RFMNAUgoDI4afOAMHBiCdiDNj5woGAhgsCEYudSI1lBCRwoPL957slAoDDYEoPXb/ZVs3FE/y9072fDxsx4BMPVfGOpl1VY/y5++4EWM1Fm9LcCKpy8RpnchDGEIQxjCEIYwhCEMYQhDGMIQhjCEIQxhCEMYwhCGMIQhDGEIQxhYNlXiP+XHXLRDM5thQVpyzIfS2YtLceVEkRmzalsgMArPhp258bA6b/LEb8LqPM930VNdvY/fhMmCxw+Of+4BTcPInBo2AAAAAElFTkSuQmCC)", - backgroundSize: "contain", - width: 26, - height: 30 - }, - fileName: { - flex: "1 0 auto", - marginLeft: 8, - }, - fileSize: { - margin: "6px 0 3px 9px", - float: "left", - textAlign: "left", - display: "block", - zIndex: 10, - fontSize: 11, - } -})); - -function DraftMediaMessage(props: Props): JSX.Element { - const classes = useStyles(); - - return ( -
-
-
-
{props.name}
-
- {props.mimeType.toUpperCase()} - {formatFileSize(props.size)} -
- ); -} \ No newline at end of file diff --git a/src/website/components/mainPanel/DraftMediaMessage.tsx b/src/website/components/mainPanel/DraftMediaMessage.tsx deleted file mode 100644 index 63b99ac586..0000000000 --- a/src/website/components/mainPanel/DraftMediaMessage.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import React from "react"; -import makeStyles from "@material-ui/styles/makeStyles"; -import Image from "../shared/Image"; -import Video from "../shared/Video"; -import { Theme } from "@material-ui/core"; - -type Props = { - width: number, - height: number, - mimeType: string, - blobUrl: string -} - -type StyleProps = { - isLandscape: boolean -} - -export default React.memo(DraftMediaMessage); - -const useStyles = makeStyles(() => ({ - container: { - display: "flex", - alignItems: "center", - justifyContent: "center" - }, - media: { - margin: 14, - marginBottom: 4, - borderRadius: 16, - "& *": { - borderRadius: "inherit" - }, - "& img": { - maxWidth: props => props.isLandscape ? "calc(var(--vh, 1vh) * 50)" : "none", - maxHeight: props => props.isLandscape ? "none" : "calc(var(--vh, 1vh) * 50)", - width: props => props.isLandscape ? "100%" : "auto", - height: props => props.isLandscape ? "auto" : "100%", - } - } -})); - -function DraftMediaMessage(props: Props): JSX.Element { - const classes = useStyles({isLandscape: props.width > props.height}); - return ( -
-
- {props.mimeType.startsWith("image/") - ? - :
-
- ); -} \ No newline at end of file diff --git a/src/website/components/mainPanel/EmojiPicker.tsx b/src/website/components/mainPanel/EmojiPicker.tsx deleted file mode 100644 index 222566cbc9..0000000000 --- a/src/website/components/mainPanel/EmojiPicker.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import React from "react"; -import { useSelector } from "react-redux"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import useTheme from "@material-ui/core/styles/useTheme"; -import { EmojiData, Picker } from 'emoji-mart'; -import { RootState } from "../../reducers"; -import { ViewMode } from "../../domain/model/viewMode"; - -export default React.memo(EmojiPicker); - -type Props = { - onEmojiSelected: (text: string) => void -} - -type StyleProps = { - showSearch: boolean -} - -const useStyles = makeStyles((theme: Theme) => ({ - "@global": { - ".emoji-mart": { - backgroundColor: theme.colors.footer.backgroundColor + " !important", - border: 0, - borderRadius: 0 - }, - ".emoji-mart-search": { - paddingBottom: 6, - display: props => props.showSearch ? "block" : "none" - }, - ".emoji-mart-search input": { - paddingTop: 7, - backgroundColor: theme.colors.textBox.backgroundColor + " !important", - color: theme.colors.textBox.textColor + " !important" - }, - ".emoji-mart-category-label": { - top: -1 - }, - ".emoji-mart-category-label span": { - backgroundColor: theme.colors.footer.backgroundColor + " !important", - opacity: 0.9, - color: theme.colors.footer.mutedColor + " !important" - }, - ".emoji-mart-category .emoji-mart-emoji span": { - cursor: "pointer" - }, - ".emoji-mart-scroll": { - height: 215 - } - } -})); - -function EmojiPicker(props: Props) { - const currentViewMode = useSelector((state: RootState) => state.appState.viewMode); - const styleProps = { - showSearch: currentViewMode === ViewMode.Desktop - }; - useStyles(styleProps); - const theme = useTheme(); - - return ( - - ); - - function onSelectEmoji(emojiData: EmojiData) { - if ("native" in emojiData) { - props.onEmojiSelected(emojiData.native); - } - } -} - diff --git a/src/website/components/mainPanel/FileContent.tsx b/src/website/components/mainPanel/FileContent.tsx deleted file mode 100644 index 1d9ae97b0f..0000000000 --- a/src/website/components/mainPanel/FileContent.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import React from "react"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { FileContent as File } from "../../domain/model/messages"; -import dataService, { DataSource } from "../../services/data/CachingDataService"; -import { dataToBlobUrl } from "../../utils/blobFunctions"; - -export interface Props { - content: File, - sentByMe: boolean -} - -export default React.memo(FileContent); - -const useStyles = makeStyles((theme: Theme) => ({ - link: { - padding: "10px 9px", - fontSize: 14, - lineHeight: 1, - textDecoration: "none", - display: "flex", - alignItems: "center" - }, - icon: { - backgroundImage: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAA8CAYAAADL94L/AAAByElEQVR4Ae3axdJTQRAFYFyegA3u8ALseCDcicsGhxt3x+G32BXc3X3NBnfXYTqp3sZlhuqpOlXZRL46He9ReJyJxGSTEreaPfEHZiX+1uSJvelVNu+Jvjd7Yk9zI8aSUe0eDpjCIYfNSuw5v/zF5In/6mU27478tXriLJvXjdSwPq1lCDTCmxjiCNav8GZYBVMwWKagX8kWjk9vCcMhYWhEFEw1+oV0wZjdPKY6Vn9EwmBDTYPwBoXCYPLGDQTJjkHQNQRJj0FQtmgs+C8wOHIIkh2DoDu5vD5Xfkz9hsTBWDyxhjDYUDqvLRYSY1JilSQGyyxXOt4QKJPX70NDQmI27gyxHcn9bH/5RFMNAUgoDI4afOAMHBiCdiDNj5woGAhgsCEYudSI1lBCRwoPL957slAoDDYEoPXb/ZVs3FE/y9072fDxsx4BMPVfGOpl1VY/y5++4EWM1Fm9LcCKpy8RpnchDGEIQxjCEIYwhCEMYQhDGMIQhjCEIQxhCEMYwhCGMIQhDGEIQxhYNlXiP+XHXLRDM5thQVpyzIfS2YtLceVEkRmzalsgMArPhp258bA6b/LEb8LqPM930VNdvY/fhMmCxw+Of+4BTcPInBo2AAAAAElFTkSuQmCC)", - backgroundSize: "contain", - width: 26, - height: 30 - }, - fileName: { - flex: "1 0 auto", - marginLeft: 8, - color: props => props.sentByMe ? theme.colors.messageSentByMe.textColor : theme.colors.messageSentByElse.textColor - } -})); - -function FileContent(props : Props): JSX.Element { - const classes = useStyles(props); - const content = props.content; - - let downloading = false; - let title = content.blobDeleted ? `"${content.name}" no longer available` : `Download "${content.name}"`; - let name = content.blobDeleted ? `${content.name} no longer available` : content.name; - - return ( - -
-
{name}
-
- ); - - async function onClick(e: React.MouseEvent) { - - if (content.blobDeleted) { - return; - } - - const anchor = findAnchor(e.target); - const href = anchor.getAttribute("href"); - - // If the file is already downloading or the anchor is now pointing at the blob then return - if (downloading || href && href.startsWith("blob")) { - return; - } - - // Get the file from the IC - downloading = true; - - const result = await dataService.getData( - DataSource.FileMessage, - content.id, - content.size, - content.chunkSize); - - downloading = false; - if (result.kind !== "success") { - return; - } - - // Point anchor at blob and re-click it to trigger download - const blobUrl = dataToBlobUrl(result.data, content.mimeType); - anchor.setAttribute("href", blobUrl); - anchor.setAttribute("download", content.name) - anchor.click(); - - // Reset anchor back to initial state and remove the blob from memory - URL.revokeObjectURL(anchor.href); - anchor.removeAttribute("download"); - anchor.setAttribute("href", "#"); - } - - function findAnchor(node: any) : HTMLAnchorElement { - while (node != null && !(node instanceof HTMLAnchorElement)) { - node = node.parentNode; - } - return node; - } -} diff --git a/src/website/components/mainPanel/Footer.tsx b/src/website/components/mainPanel/Footer.tsx deleted file mode 100644 index 0be34e7850..0000000000 --- a/src/website/components/mainPanel/Footer.tsx +++ /dev/null @@ -1,362 +0,0 @@ -import React, { useEffect, useLayoutEffect, useRef, useState } from "react"; -import { useDispatch, useSelector } from "react-redux"; -import IconButton from "@material-ui/core/IconButton"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import SendButtonIcon from "@material-ui/icons/Send"; -import makeStyles from "@material-ui/styles/makeStyles"; -import ClickAwayListener from "@material-ui/core/ClickAwayListener"; -import { Option } from "../../domain/model/common"; -import * as chatFunctions from "../../domain/model/chats"; -import sendMessage from "../../actions/chats/sendMessage"; -import { getSelectedChat, getUserSummary } from "../../domain/stateFunctions"; -import AttachFile, { FileValidationError } from "./AttachFile"; -import { RootState } from "../../reducers"; -import SendCycles, { ISendCyclesRef } from "./SendCycles"; -import MessageTextInput, { IMessageTextInputRef } from "./MessageTextInput"; -import CurrentUserTypingHandler from "../../domain/CurrentUserTypingHandler"; -import Smiley from "../../icons/smiley.svg"; -import Dollar from "../../icons/dollar.svg"; -import EmojiPicker from "./EmojiPicker"; -import CloseButton from "../shared/CloseButton"; -import DraftMediaMessage from "./DraftMediaMessage"; -import DraftFileMessage from "./DraftFileMessage"; -import { DraftMessageContent } from "../../domain/model/messages"; -import ReplyToMessagePanel from "./ReplyToMessagePanel"; -import { alertDialog } from "../../components/modals/Alert"; - -export default React.memo(Footer); - -const useStyles = makeStyles((theme: Theme) => ({ - footer: { - display: "flex", - backgroundColor: theme.colors.footer.backgroundColor, - flexDirection: "column", - }, - container: { - color: "#9b9b9b", - padding: "11px 16px 11px 10px", - display: "flex", - alignItems: "center", - }, - buttons: { - display: "flex", - alignItems: "center", - }, - button: { - borderRadius: "50%", - height: 32, - width: 32, - padding: 0, - marginRight: 6, - cursor: "pointer", - "&:hover,:focus": { - backgroundColor: theme.colors.icon.hover, - }, - "& svg": { - verticalAlign: "middle", - pointerEvents: "none", - margin: 0, - padding: 0, - color: theme.colors.footer.iconColor, - }, - }, - sendButton: { - outline: 0, - height: 25, - border: 0, - margin: 0, - padding: 0, - cursor: "pointer", - alignSelf: "center", - backgroundColor: "transparent", - marginLeft: 20, - color: "#9b9b9b", - }, -})); - -enum MessagePanelState { - Closed, - EmojiPicker, - SendCycles, - SendFile, -} - -function Footer() { - const dispatch = useDispatch(); - const [messagePanelState, setMessagePanel] = useState( - MessagePanelState.Closed - ); - const [textBoxText, setTextBoxText] = useState(""); - const sendCyclesRef = useRef(null); - const textBoxRef = useRef(null); - const chat = useSelector((state: RootState) => - getSelectedChat(state.chatsState) - ); - // Hold draft (media) message - const draftMessageContentRef = useRef>(null); - const scrollBottomOverride = useRef(); - - const them = useSelector((state: RootState) => - chat != null && chatFunctions.isDirectChat(chat) - ? getUserSummary(chat.them, state.usersState.userDictionary) - : null - ); - - if (chat === null) { - return
; - } - - useEffect(() => { - if (messagePanelState !== MessagePanelState.Closed) { - changeMessagePanel(MessagePanelState.Closed, true); - } - }, [chat.chatId]); - - function changeMessagePanel( - state: MessagePanelState, - retainScrollBottom: boolean - ) { - if ( - state !== MessagePanelState.SendFile && - draftMessageContentRef.current - ) { - if (draftMessageContentRef.current.kind === "media") { - const blobUrl = draftMessageContentRef.current.blobUrl; - setTimeout(() => { - URL.revokeObjectURL(blobUrl); - }, 100); - } - - draftMessageContentRef.current = null; - } - - if (state === MessagePanelState.Closed) { - textBoxRef.current!.onFocusBack(); - } - - if (retainScrollBottom) { - const [_, scrollBottom] = chatFunctions.getScrollTopAndBottom()!; - scrollBottomOverride.current = scrollBottom; - } - setMessagePanel(state); - } - - useLayoutEffect(() => { - if (scrollBottomOverride.current != null) { - const messagesDiv = document.getElementById("messages")!; - messagesDiv.scrollTop = - messagesDiv.scrollHeight - - messagesDiv.clientHeight - - scrollBottomOverride.current; - scrollBottomOverride.current = undefined; - } - }); - - function onSendMessage() { - let draftMessage: Option = null; - - switch (messagePanelState) { - case MessagePanelState.SendCycles: - if (sendCyclesRef.current) { - draftMessage = { - kind: "cycles", - amount: sendCyclesRef.current.getCycles(), - caption: textBoxText, - }; - } - break; - case MessagePanelState.SendFile: - if ( - draftMessageContentRef.current && - (draftMessageContentRef.current.kind === "media" || - draftMessageContentRef.current.kind === "file") - ) { - draftMessage = { - ...draftMessageContentRef.current, - caption: textBoxText, - }; - } - break; - default: - if (textBoxText) { - draftMessage = { kind: "text", text: textBoxText }; - } - break; - } - - if (draftMessage) { - switch (draftMessage.kind) { - case "text": - if (draftMessage.text.length > 5000) { - alertDialog({ - title: "Text too long", - text: "Messages are limited to 5000 characters", - }); - return; - } - break; - default: - if (draftMessage.caption && draftMessage.caption.length > 500) { - alertDialog({ - title: "Text too long", - text: "Captions are limited to 500 characters", - }); - return; - } - break; - } - dispatch(sendMessage(chat!, draftMessage, chat!.replyContext)); - changeMessagePanel(MessagePanelState.Closed, false); - textBoxRef.current!.clearText(); - } - } - - function onFileAttached(content: DraftMessageContent) { - if (content.kind === "file") { - dispatch(sendMessage(chat!, content, chat!.replyContext)); - textBoxRef.current!.clearText(); - } else { - draftMessageContentRef.current = content; - changeMessagePanel(MessagePanelState.SendFile, true); - } - } - - function onFileValidationError(error: FileValidationError, mimeType: string) { - let title; - let type; - let size; - // TODO: derive size text from constants - if (mimeType.startsWith("image/")) { - title = "Image too big"; - type = "images"; - size = "1 Mb"; - } else if (mimeType.startsWith("video/")) { - title = "Video too big"; - type = "videos"; - size = "5 Mb"; - } else { - title = "File too big"; - type = "files"; - size = "1 Mb"; - } - let text = `You are limited to ${type} of size ${size}`; - - alertDialog({ title, text }); - } - - function onTextChanged(text: string) { - setTextBoxText(text); - - if (chat && chatFunctions.isConfirmedChat(chat)) { - CurrentUserTypingHandler.markTyping(chat.chatId); - } - } - - const classes = useStyles(); - - let messagePanel = null; - - switch (messagePanelState) { - case MessagePanelState.EmojiPicker: - messagePanel = ( - - ); - break; - case MessagePanelState.SendCycles: - if (chatFunctions.isDirectChat(chat)) { - messagePanel = ; - } - break; - case MessagePanelState.SendFile: - if (draftMessageContentRef.current) { - if (draftMessageContentRef.current.kind === "media") { - const draft = draftMessageContentRef.current; - messagePanel = ( - - ); - } else if (draftMessageContentRef.current.kind === "file") { - const draft = draftMessageContentRef.current; - messagePanel = ( - - ); - } - } - break; - } - - const closeButton = ( - changeMessagePanel(MessagePanelState.Closed, true)} - className={classes.button} - /> - ); - - return ( - textBoxRef.current?.onFocusAway()}> -
- - {messagePanel} -
-
- {messagePanelState !== MessagePanelState.EmojiPicker ? ( - - changeMessagePanel(MessagePanelState.EmojiPicker, true) - } - className={classes.button} - > - - - ) : ( - closeButton - )} - {messagePanelState != MessagePanelState.SendFile ? ( - - ) : ( - closeButton - )} - {them && messagePanelState !== MessagePanelState.SendCycles ? ( - - changeMessagePanel(MessagePanelState.SendCycles, true) - } - > - - - ) : them ? ( - closeButton - ) : null} -
- - -
-
-
- ); -} diff --git a/src/website/components/mainPanel/GroupChatMenu.tsx b/src/website/components/mainPanel/GroupChatMenu.tsx deleted file mode 100644 index 5f9594954a..0000000000 --- a/src/website/components/mainPanel/GroupChatMenu.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import React from "react"; -import { useDispatch } from "react-redux"; -import { alpha } from "@material-ui/core/styles/colorManipulator"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import MoreVertIcon from "@material-ui/icons/MoreVert"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { ChatId } from "../../domain/model/chats"; -import PopOverMenu, { MenuItem } from "../shared/PopOverMenu"; -import { changeRightPanel } from "../../actions/app/changeSidePanel"; -import leaveGroup from "../../actions/chats/leaveGroup"; -import { RightPanelType } from "../../domain/model/panels"; -import { markAllMessagesAsReadLocally } from "../../actions/chats/markMessagesAsRead"; -import { toggleNotifications } from "../../actions/chats/toggleNotifications"; - -export default React.memo(GroupChatMenu); - -export interface Props { - chatId: ChatId, - muted: boolean, - any_unread: boolean, -} - -const useStyles = makeStyles((theme: Theme) => ({ - menuIcon: { - color: alpha(theme.colors.header.primaryTextColor, 0.6) - } -})); - -function GroupChatMenu(props: Props) { - const dispatch = useDispatch(); - const classes = useStyles(); - - const menuItems: MenuItem[] = []; - menuItems.push({ text: "Participants", action: () => dispatch(changeRightPanel(RightPanelType.Participants)) }); - menuItems.push({ text: props.muted ? "Unmute notifications" : "Mute notifications", action: () => dispatch(toggleNotifications(props.chatId, !props.muted)) }); - menuItems.push({ text: "Mark all as read", action: () => dispatch(markAllMessagesAsReadLocally(props.chatId)), disable: !props.any_unread }); - menuItems.push({ text: "Leave group", action: () => { - if (confirm("Are you sure you want to leave this group?")) { - dispatch(leaveGroup(props.chatId)); - } - }}); - - return } menuItems={menuItems} placement="bottom-end" />; -} diff --git a/src/website/components/mainPanel/Header.tsx b/src/website/components/mainPanel/Header.tsx deleted file mode 100644 index 3f1c04c45d..0000000000 --- a/src/website/components/mainPanel/Header.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import React from "react"; -import { useDispatch, useSelector } from "react-redux"; -import Grid from "@material-ui/core/Grid"; -import Typography from "@material-ui/core/Typography"; -import { Theme } from "@material-ui/core/styles/createMuiTheme"; -import makeStyles from "@material-ui/styles/makeStyles"; -import { alpha } from "@material-ui/core/styles/colorManipulator"; -import { RootState } from "../../reducers"; -import UserAvatar from "../shared/UserAvatar"; -import * as chatFunctions from "../../domain/model/chats"; -import { Option } from "../../domain/model/common"; -import * as stateFunctions from "../../domain/stateFunctions"; -import { getSelectedChat } from "../../domain/stateFunctions"; -import { compareUsersOnlineFirst, fromUserSummary, isUserOnline, MyProfile, UserSummary } from "../../domain/model/users"; -import ParticipantsTyping from "../shared/ParticipantsTyping"; -import ThemTyping from "../shared/ThemTyping"; -import BackButton from "../shared/BackButton"; -import GroupChatMenu from "./GroupChatMenu"; -import DefaultGroupChatIcon from "../shared/DefaultGroupChatIcon"; -import LastOnline from "./LastOnline"; -import { changeRightPanel } from "../../actions/app/changeSidePanel"; -import { LeftPanelType, RightPanelType } from "../../domain/model/panels"; -import DirectChatMenu from "./DirectChatMenu"; - -export default React.memo(Header); - -const useStyles = makeStyles((theme: Theme) => ({ - titles: { - color: theme.colors.header.primaryTextColor, - lineHeight: "normal", - paddingLeft: 18 - }, - subtitle: { - color: theme.colors.header.secondaryTextColor, - width: "100%", - overflow: "hidden", - textOverflow: "ellipsis" - }, - closeButton: { - color: alpha(theme.colors.header.primaryTextColor, 0.6), - marginLeft: -6, - marginRight: 6, - } -})); - -function Header() { - const dispatch = useDispatch(); - - const me: Option = useSelector((state: RootState) => state.usersState.me); - const userDictionary: any = useSelector((state: RootState) => state.usersState.userDictionary); - const chat = useSelector((state: RootState) => getSelectedChat(state.chatsState)); - const leftPanelState = useSelector((state: RootState) => state.appState.panelState.leftPanel); - - if (chat === null) { - return
; - } - - let icon: JSX.Element; - let chatName: string = ""; - let subTitle: Option = null; - let chatMenu: Option = null; - - const any_unread = chatFunctions.getUnreadMessageCount(chat) > 0; - - if (chatFunctions.isDirectChat(chat)) { - let muted = false; - if (chatFunctions.isConfirmedChat(chat)) { - muted = chat.muted; - } - chatMenu = ; - let imageId = null; - let isOnline = false; - if (userDictionary.hasOwnProperty(chat.them)) { - const userSummary = userDictionary[chat.them] as UserSummary; - imageId = userSummary.imageId; - chatName = userSummary.username; - isOnline = isUserOnline(userSummary); - subTitle = chatFunctions.isConfirmedChat(chat) && chat.themTyping - ? - : ; - } - icon = ; - } else { - icon = ; - chatName = chat.subject; - - if (chatFunctions.isConfirmedChat(chat) && me) { - chatMenu = ; - if (chat.participantsTyping.length) { - const usernames = stateFunctions - .getUsers(chat.participantsTyping, userDictionary) - .map(u => u.username); - - subTitle = ; - } else { - const participants = stateFunctions.getUsers(chat.participants, userDictionary); - - let text = ""; - if (participants.length > 5) { - const onlineCount = participants.filter(p => isUserOnline(p)).length; - text = `${chat.participants.length} members (${onlineCount + 1} online) `; - } else { - const sortedParticipants = participants - .map(fromUserSummary) - .sort(compareUsersOnlineFirst); - - text = sortedParticipants - .map(u => u.username) - .concat(["You"]) - .join(", "); - } - - subTitle = - - (dispatch(changeRightPanel(RightPanelType.Participants)))}> - {text} - - ; - } - } - } - - const classes = useStyles(); - - return ( - - { - leftPanelState === LeftPanelType.None ? - - history.back()} className={classes.closeButton} /> - : null - } - - {icon} - - - - - {chatName} - - - {subTitle} - - - - {chatMenu - ? {chatMenu} - : null} - - ); -} diff --git a/src/website/components/mainPanel/LastOnline.tsx b/src/website/components/mainPanel/LastOnline.tsx deleted file mode 100644 index 924fa328a9..0000000000 --- a/src/website/components/mainPanel/LastOnline.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React from "react"; -import Typography from "@material-ui/core/Typography"; -import { Variant as TypographyVariant } from "@material-ui/core/styles/createTypography"; - -type Props = { - variant: TypographyVariant, - minutesSinceLastOnline: number -} - -export default React.memo(LastOnline); - -function LastOnline(props: Props) { - return {formatLastOnlineDate(props.minutesSinceLastOnline)}; -} - -function formatLastOnlineDate(minutesSinceLastOnline: number) : string { - if (isNaN(minutesSinceLastOnline)) { - return ""; - } - if (minutesSinceLastOnline < 2) { - return "Online now"; - } - let durationText: string; - if (minutesSinceLastOnline < 60) { - durationText = `${minutesSinceLastOnline} minutes`; - } else { - const hoursSinceLastOnline = Math.floor(minutesSinceLastOnline / 60); - if (hoursSinceLastOnline === 1) { - durationText = "1 hour"; - } else if (hoursSinceLastOnline < 24) { - durationText = `${hoursSinceLastOnline} hours`; - } else { - const daysSinceLastOnline = Math.floor(hoursSinceLastOnline / 24); - durationText = daysSinceLastOnline === 1 - ? "1 day" - : `${daysSinceLastOnline} days`; - } - } - return `Last online ${durationText} ago`; -} diff --git a/src/website/components/mainPanel/MainPanel.tsx b/src/website/components/mainPanel/MainPanel.tsx deleted file mode 100644 index e1b9de14e8..0000000000 --- a/src/website/components/mainPanel/MainPanel.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react"; -import { useSelector } from "react-redux"; -import { RootState } from "../../reducers"; -import MessagesList from "./MessagesList"; -import Header from "./Header"; -import Footer from "./Footer"; - -export default React.memo(MainPanel); - -function MainPanel() { - const showMainWindow = useSelector((state: RootState) => state.chatsState.selectedChatIndex !== null); - - if (!showMainWindow) { - return
; - } - - return ( - <> -
- -