1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Fix battle chats properly (without involving the database)

This commit is contained in:
NG (Graham)
2025-08-16 21:54:16 -04:00
parent 05bf4a097a
commit f63185c2cd
4 changed files with 10 additions and 125 deletions

View File

@@ -31,8 +31,10 @@ impl SimpleOperation<()> for JoinChannelProvider {
}
let user_info = user.user()?;
//let chat_user = super::get_chat_user(user_info.as_ref().as_ref());
self.chat_system.system_mut().await.join_channel(user_info.public_id().to_owned(), chann_name.string.clone());
let response = user_info.add_subscribed_channel(chann_name.string, crate::data::channel::ChatChannelType::from_u8(chann_ty as _)?).await?;
let ty = crate::data::channel::ChatChannelType::from_u8(chann_ty as _)?;
log::info!("User {} wants to join channel {} ({:?})", user_info.display_name().to_owned(), chann_name.string, ty);
self.chat_system.system_mut().await.join_channel(user_info.display_name().to_owned(), chann_name.string.clone(), ty);
let response = user_info.add_subscribed_channel(chann_name.string, ty).await?;
params.insert(CHANNEL_INFO_PARAM_KEY, response);
}
}