- async fn from_apub(
- note: Note,
- context: &LemmyContext,
- request_counter: &mut i32,
- ) -> Result<ApubComment, LemmyError> {
- let creator = note
- .attributed_to
- .dereference(context, context.client(), request_counter)
- .await?;
- let (post, parent_comment_id) = note.get_parents(context, request_counter).await?;
-
- let content = if let SourceCompat::Lemmy(source) = ¬e.source {
- source.content.clone()
- } else {
- parse_html(¬e.content)
- };
- let content_slurs_removed = remove_slurs(&content, &context.settings().slur_regex());
+ async fn from_json(note: Note, context: &Data<LemmyContext>) -> Result<ApubComment, LemmyError> {
+ let creator = note.attributed_to.dereference(context).await?;
+ let (post, parent_comment) = note.get_parents(context).await?;
+
+ let content = read_from_string_or_source(¬e.content, ¬e.media_type, ¬e.source);