diff --git a/Cargo.lock b/Cargo.lock index 8d016c5e..e8c3abcb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3098,7 +3098,7 @@ dependencies = [ [[package]] name = "revolt-quark" version = "0.1.0" -source = "git+https://github.com/revoltchat/quark?rev=b1bc7eb0bab9f3cb3458fb4c8da4cb985177d2b2#b1bc7eb0bab9f3cb3458fb4c8da4cb985177d2b2" +source = "git+https://github.com/revoltchat/quark?rev=1eb92e3b5893075de1c11332bab76bffd88d4fa8#1eb92e3b5893075de1c11332bab76bffd88d4fa8" dependencies = [ "async-recursion", "async-std", diff --git a/Cargo.toml b/Cargo.toml index 36e42db6..f991cfaa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,5 +69,5 @@ schemars = "0.8.8" rocket_okapi = { git = "https://github.com/insertish/okapi", rev = "dcf0df115596ee07a587a7a543cddf3d7944645b", features = [ "swagger" ] } # quark -revolt-quark = { git = "https://github.com/revoltchat/quark", rev = "b1bc7eb0bab9f3cb3458fb4c8da4cb985177d2b2" } +revolt-quark = { git = "https://github.com/revoltchat/quark", rev = "1eb92e3b5893075de1c11332bab76bffd88d4fa8" } # revolt-quark = { path = "../quark" } diff --git a/src/routes/bots/delete.rs b/src/routes/bots/delete.rs index 62cd40c6..445deaa6 100644 --- a/src/routes/bots/delete.rs +++ b/src/routes/bots/delete.rs @@ -15,5 +15,5 @@ pub async fn delete_bot(db: &Db, user: User, target: Ref) -> Result/invite")] -pub async fn fetch_public_bot(db: &Db, target: Ref) -> Result> { +pub async fn fetch_public_bot(db: &Db, user: Option, target: Ref) -> Result> { let bot = target.as_bot(db).await?; - if !bot.public { + if !bot.public && user.map_or(true, |x| x.id != bot.owner) { return Err(Error::NotFound); }