diff --git a/Cargo.lock b/Cargo.lock index 7682ea68416046396a158930bf234b31d047162e..309aa6d64f43facd2d31f503f354446ae8b35903 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "addr2line" version = "0.14.1" @@ -2473,7 +2475,7 @@ dependencies = [ [[package]] name = "revolt" -version = "0.3.3-alpha.7" +version = "0.3.3-alpha.8" dependencies = [ "async-std", "async-tungstenite", diff --git a/Cargo.toml b/Cargo.toml index c849473dc79d2b3404fa229c8be559ca69c604ae..18b51b50650cf8ef137da9f11f5b744f534a001e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt" -version = "0.3.3-alpha.7-patch.0" +version = "0.3.3-alpha.8" authors = ["Paul Makles <paulmakles@gmail.com>"] edition = "2018" diff --git a/src/database/permissions/user.rs b/src/database/permissions/user.rs index 4515e5c3452b25c05dac773992d7bf04814a5022..4ff42bfce28a15c26e6f689629a58ea50e6b7753 100644 --- a/src/database/permissions/user.rs +++ b/src/database/permissions/user.rs @@ -68,14 +68,12 @@ impl<'a> PermissionCalculator<'a> { || get_collection("channels") .find_one( doc! { - "$or": [ - { "type": "Group" }, - { "type": "DirectMessage" }, - ], - "$and": [ - { "recipients": &self.perspective.id }, - { "recipients": target } - ] + "channel_type": { + "$in": ["Group", "DirectMessage"] + }, + "recipients": { + "$all": [ &self.perspective.id, target ] + } }, None, ) diff --git a/src/routes/root.rs b/src/routes/root.rs index 99439089dd9ba04425588237b62ecdedbec7dec5..0bb35a2c176442e37ff4d927f98c0a73a287d903 100644 --- a/src/routes/root.rs +++ b/src/routes/root.rs @@ -9,7 +9,7 @@ use rocket_contrib::json::JsonValue; #[get("/")] pub async fn root() -> JsonValue { json!({ - "revolt": "0.3.3-alpha.7-patch.0", + "revolt": "0.3.3-alpha.8", "features": { "registration": !*DISABLE_REGISTRATION, "captcha": {