- 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)).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 response = CommunityResponse {
- community_view,
- discussion_languages,
- };
-
- context
- .chat_server()
- .send_user_room_message(
- &UserOperation::FollowCommunity,
- &response,
- local_recipient_id,
- None,
- )
- .await?;