- CommunityFollower::follow_accepted(context.pool(), community_id, person_id).await?;
-
- // Send the Subscribed message over websocket
- // Re-read the community_view to get the new SubscribedType
- let community_view =
- CommunityView::read(context.pool(), community_id, Some(person_id), None).await?;
-
- // Get the local_user_id
- let local_recipient_id = LocalUserView::read_person(context.pool(), person_id)
- .await?
- .local_user
- .id;
- let discussion_languages = CommunityLanguage::read(context.pool(), community_id).await?;
-
- let res = CommunityResponse {
- community_view,
- discussion_languages,
- };
-
- let message = serialize_websocket_message(&UserOperation::FollowCommunity, &res)?;
-
- context.chat_server().do_send(SendUserRoomMessage {
- recipient_id: local_recipient_id,
- message,
- websocket_id: None,
- });