Support for updates

merge-requests/5/head
Terence Eden 2024-03-02 12:18:11 +00:00
rodzic 5e99f4c74f
commit a463087ec4
1 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -268,10 +268,10 @@
$inbox_message = $body; $inbox_message = $body;
$inbox_type = $inbox_message["type"]; $inbox_type = $inbox_message["type"];
// Save any Follow, Create, Announce, Like messages // Save any Follow, Create, Update, Announce, Like messages
// This ignores Delete, Undo, and anything else // This ignores Delete, Undo, and anything else
if ( match( $inbox_type ) { if ( match( $inbox_type ) {
"Follow", "Create", "Announce", "Like" => true, "Follow", "Create", "Update", "Announce", "Like" => true,
default => false, default => false,
} ) { } ) {
// Save the message in `/data/inbox/` // Save the message in `/data/inbox/`
@ -1211,7 +1211,7 @@ HTML;
$type = $inbox_message["type"]; $type = $inbox_message["type"];
// Render the message according to type // Render the message according to type
if ( "Create" == $type ) { if ( "Create" == $type || "Update" == $type ) {
// Get the HTML content and sanitise it. // Get the HTML content and sanitise it.
$content = $object["content"]; $content = $object["content"];
$content = strip_tags($content, $allowed_elements); $content = strip_tags($content, $allowed_elements);
@ -1237,7 +1237,9 @@ HTML;
} }
} }
echo "<li>{$timeHTML} {$actorHTML} said: <blockquote>{$content}</blockquote></li>"; "Create" == $type ? $verb = "wrote" : $verb = "updated";
echo "<li>{$timeHTML} {$actorHTML} {$verb}: <blockquote>{$content}</blockquote></li>";
} else if ( "Like" == $type ) { } else if ( "Like" == $type ) {
$objectHTML = "<a href=\"$object\">{$object}</a>"; $objectHTML = "<a href=\"$object\">{$object}</a>";
echo "<li>{$timeHTML} {$actorHTML} liked {$objectHTML}<br></li>"; echo "<li>{$timeHTML} {$actorHTML} liked {$objectHTML}<br></li>";