1 use lemmy_api_common::{blocking, post::PostResponse};
2 use lemmy_db_schema::PostId;
3 use lemmy_db_views::post_view::PostView;
4 use lemmy_utils::LemmyError;
5 use lemmy_websocket::{messages::SendPost, LemmyContext};
10 pub(crate) async fn send_websocket_message<
11 OP: ToString + Send + lemmy_websocket::OperationType + 'static,
15 context: &LemmyContext,
16 ) -> Result<(), LemmyError> {
17 let post_view = blocking(context.pool(), move |conn| {
18 PostView::read(conn, post_id, None)
22 let res = PostResponse { post_view };
24 context.chat_server().do_send(SendPost {