mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 05:26:59 +00:00
fix: don't allow mutual route if self
This commit is contained in:
@@ -22,6 +22,10 @@ pub struct MutualResponse {
|
||||
pub async fn req(db: &State<Database>, user: User, target: Ref) -> Result<Json<MutualResponse>> {
|
||||
let target = target.as_user(db).await?;
|
||||
|
||||
if target.id == user.id {
|
||||
return Err(Error::InvalidOperation);
|
||||
}
|
||||
|
||||
if perms(&user)
|
||||
.user(&target)
|
||||
.calc_user(db)
|
||||
|
||||
Reference in New Issue
Block a user