Support for updates
rodzic
5e99f4c74f
commit
a463087ec4
10
index.php
10
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 "<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 ) {
|
||||
$objectHTML = "<a href=\"$object\">{$object}</a>";
|
||||
echo "<li>{$timeHTML} {$actorHTML} liked {$objectHTML}<br></li>";
|
||||
|
|
Ładowanie…
Reference in New Issue