- let object = PostOrComment::Comment(updated_comment.into());
- Vote::send(
- &object,
- &local_user_view.person.clone().into(),
- community_id,
- VoteType::Like,
- context,
- )
- .await?;
-
- let person_id = local_user_view.person.id;
- let comment_id = inserted_comment.id;
- let comment_view = blocking(context.pool(), move |conn| {
- CommentView::read(conn, comment_id, Some(person_id))
- })
- .await??;
-
- // If its a comment to yourself, mark it as read
- if local_user_view.person.id == comment_view.get_recipient_id() {
- let comment_id = inserted_comment.id;
- blocking(context.pool(), move |conn| {
- Comment::update_read(conn, comment_id, true)
- })
- .await?
- .map_err(|e| ApiError::err("couldnt_update_comment", e))?;
- }