Highlight replies

main
Terence Eden 2024-03-02 21:35:56 +00:00
rodzic edbf35c4d3
commit ce30c1d378
1 zmienionych plików z 13 dodań i 4 usunięć

Wyświetl plik

@ -1152,7 +1152,7 @@ HTML;
// Displays the most recent 200 messages in the inbox
function read() {
global $server, $directories;
global $server, $username, $directories;
// Get all the files in the inbox
$inbox_files = array_reverse( glob( $directories["inbox"] . "/*.json") );
@ -1220,7 +1220,7 @@ HTML;
// Get the HTML content and sanitise it.
$content = $object["content"];
$content = strip_tags($content, $allowed_elements);
// Add any images
if ( isset( $object["attachment"] ) ) {
foreach ( $object["attachment"] as $attachment ) {
@ -1242,9 +1242,18 @@ HTML;
}
}
"Create" == $type ? $verb = "wrote" : $verb = "updated";
// Check to see if the user has been specifically CC'd
$reply = in_array( "https://{$server}/{$username}", $object["cc"] );
echo "<li>{$timeHTML} {$actorHTML} {$verb}: <blockquote>{$content}</blockquote></li>";
// What sort of message is this?
"Create" == $type ? $verb = "wrote" : $verb = "updated";
if ( $reply ) {
// Highlight that this is a reply
echo "<li><mark>{$timeHTML} {$actorHTML} {$verb}:</mark> <blockquote>{$content}</blockquote></li>";
} else {
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>";