From a463087ec418baa6272e1d80ff6a085a42998ee3 Mon Sep 17 00:00:00 2001 From: Terence Eden Date: Sat, 2 Mar 2024 12:18:11 +0000 Subject: [PATCH] Support for updates --- index.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index c4891c7..7fde51e 100644 --- a/index.php +++ b/index.php @@ -268,10 +268,10 @@ $inbox_message = $body; $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 if ( match( $inbox_type ) { - "Follow", "Create", "Announce", "Like" => true, + "Follow", "Create", "Update", "Announce", "Like" => true, default => false, } ) { // Save the message in `/data/inbox/` @@ -1211,7 +1211,7 @@ HTML; $type = $inbox_message["type"]; // Render the message according to type - if ( "Create" == $type ) { + if ( "Create" == $type || "Update" == $type ) { // Get the HTML content and sanitise it. $content = $object["content"]; $content = strip_tags($content, $allowed_elements); @@ -1237,7 +1237,9 @@ HTML; } } - echo "
  • {$timeHTML} {$actorHTML} said:
    {$content}
  • "; + "Create" == $type ? $verb = "wrote" : $verb = "updated"; + + echo "
  • {$timeHTML} {$actorHTML} {$verb}:
    {$content}
  • "; } else if ( "Like" == $type ) { $objectHTML = "{$object}"; echo "
  • {$timeHTML} {$actorHTML} liked {$objectHTML}
  • ";