1 use lemmy_api_common::{blocking, community::CommunityResponse};
2 use lemmy_db_schema::CommunityId;
3 use lemmy_db_views_actor::community_view::CommunityView;
4 use lemmy_utils::LemmyError;
5 use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext};
10 pub mod undo_block_user;
13 pub(crate) async fn send_websocket_message<
14 OP: ToString + Send + lemmy_websocket::OperationType + 'static,
16 community_id: CommunityId,
18 context: &LemmyContext,
19 ) -> Result<(), LemmyError> {
20 let community_view = blocking(context.pool(), move |conn| {
21 CommunityView::read(conn, community_id, None)
25 let res = CommunityResponse { community_view };
27 context.chat_server().do_send(SendCommunityRoomMessage {