Skip to content

Commit

Permalink
fix forbidden matrix messages
Browse files Browse the repository at this point in the history
  • Loading branch information
paulormart committed Oct 11, 2023
1 parent 4688adc commit 1c64a97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ impl Matrix {
.send()
.await?;

debug!("response {:?}", res);
debug!("response {:?} {:?}", res, res.status());
match res.status() {
reqwest::StatusCode::OK => {
let response = res.json::<SendRoomMessageResponse>().await?;
Expand All @@ -449,6 +449,11 @@ impl Matrix {
.dispatch_message(room_id, message, formatted_message)
.await;
}
reqwest::StatusCode::FORBIDDEN => {
let response = res.json::<ErrorResponse>().await?;
warn!("Matrix message not sent: {:?}", response.error);
Ok(None)
}
_ => {
let response = res.json::<ErrorResponse>().await?;
Err(MatrixError::Other(response.error))
Expand Down

0 comments on commit 1c64a97

Please sign in to comment.