@@ -631,7 +631,7 @@ pub async fn join_room_by_id_helper(
|
||||
) -> Result<join_room_by_id::v3::Response> {
|
||||
let sender_user = sender_user.expect("user is authenticated");
|
||||
|
||||
if let Ok(true) = services().rooms.state_cache.is_joined(sender_user, room_id) {
|
||||
if matches!(services().rooms.state_cache.is_joined(sender_user, room_id), Ok(true)) {
|
||||
info!("{sender_user} is already joined in {room_id}");
|
||||
return Ok(join_room_by_id::v3::Response {
|
||||
room_id: room_id.into(),
|
||||
|
||||
@@ -104,14 +104,14 @@ fn is_report_valid(
|
||||
));
|
||||
}
|
||||
|
||||
if let Some(true) = score.map(|s| s > int!(0) || s < int!(-100)) {
|
||||
if score.map(|s| s > int!(0) || s < int!(-100)) == Some(true) {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::InvalidParam,
|
||||
"Invalid score, must be within 0 to -100",
|
||||
));
|
||||
};
|
||||
|
||||
if let Some(true) = reason.clone().map(|s| s.len() >= 750) {
|
||||
if reason.clone().map(|s| s.len() >= 750) == Some(true) {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::InvalidParam,
|
||||
"Reason too long, should be 750 characters or fewer",
|
||||
|
||||
Reference in New Issue
Block a user