fix(safety): prevent reporting own content or self
This commit is contained in:
@@ -64,6 +64,9 @@ pub enum Error {
|
||||
IsBot,
|
||||
BotIsPrivate,
|
||||
|
||||
// ? User safety related errors
|
||||
CannotReportYourself,
|
||||
|
||||
// ? Permission errors
|
||||
MissingPermission {
|
||||
permission: Permission,
|
||||
@@ -166,6 +169,8 @@ impl<'r> Responder<'r, 'static> for Error {
|
||||
Error::IsBot => Status::BadRequest,
|
||||
Error::BotIsPrivate => Status::Forbidden,
|
||||
|
||||
Error::CannotReportYourself => Status::BadRequest,
|
||||
|
||||
Error::MissingPermission { .. } => Status::Forbidden,
|
||||
Error::MissingUserPermission { .. } => Status::Forbidden,
|
||||
Error::NotElevated => Status::Forbidden,
|
||||
|
||||
Reference in New Issue
Block a user