fix: some compile time errors
Only 174 errors left!
This commit is contained in:
parent
82e7f57b38
commit
057f8364cc
118 changed files with 2139 additions and 2433 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::{database::DatabaseGuard, utils::HtmlEscape, Error, Result, Ruma};
|
||||
use crate::{utils::HtmlEscape, Error, Result, Ruma, services};
|
||||
use ruma::{
|
||||
api::client::{error::ErrorKind, room::report_content},
|
||||
events::room::message,
|
||||
|
@ -10,12 +10,11 @@ use ruma::{
|
|||
/// Reports an inappropriate event to homeserver admins
|
||||
///
|
||||
pub async fn report_event_route(
|
||||
db: DatabaseGuard,
|
||||
body: Ruma<report_content::v3::IncomingRequest>,
|
||||
) -> Result<report_content::v3::Response> {
|
||||
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
|
||||
let pdu = match db.rooms.get_pdu(&body.event_id)? {
|
||||
let pdu = match services().rooms.get_pdu(&body.event_id)? {
|
||||
Some(pdu) => pdu,
|
||||
_ => {
|
||||
return Err(Error::BadRequest(
|
||||
|
@ -39,7 +38,7 @@ pub async fn report_event_route(
|
|||
));
|
||||
};
|
||||
|
||||
db.admin
|
||||
services().admin
|
||||
.send_message(message::RoomMessageEventContent::text_html(
|
||||
format!(
|
||||
"Report received from: {}\n\n\
|
||||
|
@ -66,7 +65,5 @@ pub async fn report_event_route(
|
|||
),
|
||||
));
|
||||
|
||||
db.flush()?;
|
||||
|
||||
Ok(report_content::v3::Response {})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue