Highlight replies
rodzic
edbf35c4d3
commit
ce30c1d378
17
index.php
17
index.php
|
@ -1152,7 +1152,7 @@ HTML;
|
||||||
|
|
||||||
// Displays the most recent 200 messages in the inbox
|
// Displays the most recent 200 messages in the inbox
|
||||||
function read() {
|
function read() {
|
||||||
global $server, $directories;
|
global $server, $username, $directories;
|
||||||
|
|
||||||
// Get all the files in the inbox
|
// Get all the files in the inbox
|
||||||
$inbox_files = array_reverse( glob( $directories["inbox"] . "/*.json") );
|
$inbox_files = array_reverse( glob( $directories["inbox"] . "/*.json") );
|
||||||
|
@ -1220,7 +1220,7 @@ HTML;
|
||||||
// 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);
|
||||||
|
|
||||||
// Add any images
|
// Add any images
|
||||||
if ( isset( $object["attachment"] ) ) {
|
if ( isset( $object["attachment"] ) ) {
|
||||||
foreach ( $object["attachment"] as $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 ) {
|
} 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>";
|
||||||
|
|
Ładowanie…
Reference in New Issue