Remove excessive db call

This commit is contained in:
Mikhail 2024-05-30 23:57:13 +02:00
parent ae0464b742
commit dfc28148e5
1 changed files with 2 additions and 2 deletions

View File

@ -871,8 +871,8 @@ async fn handle_incoming_message(
};
let room = core.get_room(&RoomId::try_from(channel_name.clone())?).await;
if let Some(room) = room {
let room_info = room.get_room_info().await;
let messages = user_handle.get_room_message_history(&room_info.id, limit).await?;
let room_id = &RoomId::try_from(channel_name.clone())?;
let messages = user_handle.get_room_message_history(room_id, limit).await?;
for message in messages {
let mut tags = vec![];
if user.enabled_capabilities.contains(Capabilities::ServerTime) {