feat(core): add a limit to no. of outgoing pending friend requests

This commit is contained in:
Paul Makles
2024-06-23 19:39:18 +01:00
parent e8e9613169
commit 80666848cc
5 changed files with 26 additions and 0 deletions

View File

@@ -60,6 +60,9 @@ pub enum ErrorType {
Blocked,
BlockedByOther,
NotFriends,
TooManyPendingFriendRequests {
max: usize,
},
// ? Channel related errors
UnknownChannel,

View File

@@ -25,6 +25,7 @@ impl<'r> Responder<'r, 'static> for Error {
ErrorType::Blocked => Status::Conflict,
ErrorType::BlockedByOther => Status::Forbidden,
ErrorType::NotFriends => Status::Forbidden,
ErrorType::TooManyPendingFriendRequests { .. } => Status::BadRequest,
ErrorType::UnknownChannel => Status::NotFound,
ErrorType::UnknownMessage => Status::NotFound,