diff --git a/index.php b/index.php index 96169f0..222dc3c 100644 --- a/index.php +++ b/index.php @@ -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 "
  • {$timeHTML} {$actorHTML} {$verb}:
    {$content}
  • "; + // What sort of message is this? + "Create" == $type ? $verb = "wrote" : $verb = "updated"; + if ( $reply ) { + // Highlight that this is a reply + echo "
  • {$timeHTML} {$actorHTML} {$verb}:
    {$content}
  • "; + } else { + echo "
  • {$timeHTML} {$actorHTML} {$verb}:
    {$content}
  • "; + } + } else if ( "Like" == $type ) { $objectHTML = "{$object}"; echo "
  • {$timeHTML} {$actorHTML} liked {$objectHTML}
  • ";