mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
style: Reformat
This commit is contained in:
@@ -2,14 +2,19 @@ use std::collections::{BTreeMap, BTreeSet};
|
|||||||
|
|
||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
debug, debug_info, err, info, matrix::{pdu::PartialPdu, StateKey}, trace,
|
Err, Result, debug, debug_info, err, info,
|
||||||
warn,
|
matrix::{StateKey, pdu::PartialPdu},
|
||||||
Err, Result,
|
trace, warn,
|
||||||
};
|
};
|
||||||
use conduwuit_service::{appservice::RegistrationInfo, Services};
|
use conduwuit_service::{Services, appservice::RegistrationInfo};
|
||||||
use futures::FutureExt;
|
use futures::FutureExt;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
api::client::room::{self, create_room}, assign, events::{
|
CanonicalJsonObject, CanonicalJsonValue, Int, MilliSecondsSinceUnixEpoch, OwnedRoomAliasId,
|
||||||
|
OwnedUserId, RoomAliasId, RoomId, RoomVersionId, UserId,
|
||||||
|
api::client::room::{self, create_room},
|
||||||
|
assign,
|
||||||
|
events::{
|
||||||
|
TimelineEventType,
|
||||||
room::{
|
room::{
|
||||||
canonical_alias::RoomCanonicalAliasEventContent,
|
canonical_alias::RoomCanonicalAliasEventContent,
|
||||||
create::RoomCreateEventContent,
|
create::RoomCreateEventContent,
|
||||||
@@ -21,20 +26,15 @@ use ruma::{
|
|||||||
power_levels::RoomPowerLevelsEventContent,
|
power_levels::RoomPowerLevelsEventContent,
|
||||||
topic::RoomTopicEventContent,
|
topic::RoomTopicEventContent,
|
||||||
},
|
},
|
||||||
TimelineEventType,
|
},
|
||||||
}, int, room_version_rules::{AuthorizationRules, RoomIdFormatVersion},
|
int,
|
||||||
serde::{JsonObject, Raw}, CanonicalJsonObject, CanonicalJsonValue, Int, MilliSecondsSinceUnixEpoch,
|
room_version_rules::{AuthorizationRules, RoomIdFormatVersion},
|
||||||
OwnedRoomAliasId,
|
serde::{JsonObject, Raw},
|
||||||
OwnedUserId,
|
|
||||||
RoomAliasId,
|
|
||||||
RoomId,
|
|
||||||
RoomVersionId,
|
|
||||||
UserId,
|
|
||||||
};
|
};
|
||||||
use ruminuwuity::invite_permission_config::FilterLevel;
|
use ruminuwuity::invite_permission_config::FilterLevel;
|
||||||
use serde_json::{json, value::to_raw_value};
|
use serde_json::{json, value::to_raw_value};
|
||||||
|
|
||||||
use crate::{client::invite_helper, Ruma};
|
use crate::{Ruma, client::invite_helper};
|
||||||
|
|
||||||
/// # `POST /_matrix/client/v3/createRoom`
|
/// # `POST /_matrix/client/v3/createRoom`
|
||||||
///
|
///
|
||||||
@@ -298,10 +298,12 @@ pub(crate) async fn create_room_route(
|
|||||||
};
|
};
|
||||||
drop(state_lock);
|
drop(state_lock);
|
||||||
debug!("Room created with ID {room_id}");
|
debug!("Room created with ID {room_id}");
|
||||||
if let Some(expected_room_id) = expect_room_id && expected_room_id != room_id {
|
if let Some(expected_room_id) = expect_room_id
|
||||||
|
&& expected_room_id != room_id
|
||||||
|
{
|
||||||
return Err!(BadServerResponse(
|
return Err!(BadServerResponse(
|
||||||
"Room's final room ID was {room_id}, but expected {expected_room_id}"
|
"Room's final room ID was {room_id}, but expected {expected_room_id}"
|
||||||
))
|
));
|
||||||
}
|
}
|
||||||
let state_lock = services.rooms.state.mutex.lock(room_id.as_str()).await;
|
let state_lock = services.rooms.state.mutex.lock(room_id.as_str()).await;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user