From 7af424b64acb96e0b8c59d7347bdb42423403c3d Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sat, 5 Sep 2020 20:46:37 +0000 Subject: [PATCH] [DB] Add rendered collumn to note table, so we can preserve microtags from other services --- src/Entity/Note.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 449b8e8b95..4116970f30 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -45,6 +45,7 @@ class Note extends Entity private int $id; private int $gsactor_id; private ?string $content; + private ?string $rendered; private ?int $reply_to; private ?bool $is_local; private ?string $source; @@ -87,6 +88,17 @@ class Note extends Entity return $this->content; } + public function setRendered(?string $rendered): self + { + $this->rendered = $rendered; + return $this; + } + + public function getRendered(): ?string + { + return $this->rendered; + } + public function setReplyTo(?int $reply_to): self { $this->reply_to = $reply_to; @@ -214,6 +226,7 @@ class Note extends Entity 'id' => ['type' => 'serial', 'not null' => true], 'gsactor_id' => ['type' => 'int', 'not null' => true, 'description' => 'who made the note'], 'content' => ['type' => 'text', 'description' => 'note content'], + 'rendered' => ['type' => 'text', 'description' => 'rendered note content if not local, so we can keep the microtags'], 'reply_to' => ['type' => 'int', 'description' => 'note replied to, null if root of a conversation'], 'is_local' => ['type' => 'bool', 'description' => 'was this note generated by a local actor'], 'source' => ['type' => 'varchar', 'length' => 32, 'description' => 'source of note, like "web", "im", or "clientname"'],