- $converter = new CommonMarkConverter([
- 'html_input' => 'strip',
- 'max_nesting_level' => 10,
- 'allow_unsafe_links' => false,
- ]);
+ if ($comment->parent_id) {
+ throw new NotifyException('Only top-level comments can be un-archived.', '/', 400);
+ }
+
+ $comment->archived = false;
+ $comment->save();
+
+ ActivityService::add(ActivityType::COMMENT_UPDATE, $comment);
+
+ return $comment;
+ }
+
+ /**
+ * Delete a comment from the system.
+ */
+ public function delete(Comment $comment): void
+ {
+ $comment->delete();