diff --git a/index.php b/index.php
index ae72335..988d4aa 100644
--- a/index.php
+++ b/index.php
@@ -677,12 +677,12 @@ HTML;
// ActivityPub specification - https://www.w3.org/TR/activitystreams-vocabulary/#questions
// Mastodon documentation - https://docs.joinmastodon.org/spec/activitypub/#Question
if ( isset( $object["oneOf"] ) ) {
- $content .= "
Poll Results
";
+ $content .= "Poll Results:
";
foreach ( $object["oneOf"] as $pollOption ) {
$pollOptionName = htmlspecialchars( $pollOption["name"] );
$pollOptionValue = htmlspecialchars( $pollOption["replies"]["totalItems"] );
- $content .= "
{$pollOptionName}: $pollOptionValue";
+ $content .= "{$pollOptionName}: $pollOptionValue
";
}
}
if ( isset( $object["anyOf"] ) ) {
@@ -691,7 +691,7 @@ HTML;
$pollOptionName = htmlspecialchars( $pollOption["name"] );
$pollOptionValue = htmlspecialchars( $pollOption["replies"]["totalItems"] );
- $content .= "
{$pollOptionName}: $pollOptionValue";
+ $content .= "{$pollOptionName}: $pollOptionValue
";
}
}
@@ -716,6 +716,13 @@ HTML;
}
}
+ // Buttons to repost or favourite a message
+ if ( "read" == $style ) {
+ $interactHTML = "🔁 ⚝";
+ } else {
+ $interactHTML = "";
+ }
+
// What sort of message is this?
switch ( $type ) {
case "Create":
@@ -732,9 +739,9 @@ HTML;
if ( $reply ) {
// Highlight that this is a reply
- echo "{$timeHTML} {$actorHTML} {$verb}{$replyTo}: {$content}
";
+ echo "{$timeHTML} {$actorHTML} {$verb}{$replyTo}: {$content}
{$interactHTML}";
} else {
- echo "{$timeHTML} {$actorHTML} {$verb}{$replyTo}: {$content}
";
+ echo "{$timeHTML} {$actorHTML} {$verb}{$replyTo}: {$content}
{$interactHTML}";
}
} else if ( "Like" == $type ) {
@@ -760,6 +767,17 @@ die();
// User Interface for Writing:
// This creates a basic HTML form. Type in your message and your password. It then POSTs the data to the `/send` endpoint.
function write() {
+ if ( isset( $_GET["announce"] ) && filter_var( $_GET["announce"], FILTER_VALIDATE_URL ) ) {
+ $announceURl = $_GET["announce"];
+ } else {
+ $announceURl = "";
+ }
+
+ if ( isset( $_GET["like"] ) && filter_var( $_GET["like"], FILTER_VALIDATE_URL ) ) {
+ $likeURl = $_GET["like"];
+ } else {
+ $likeURl = "";
+ }
echo <<< HTML
@@ -793,7 +811,7 @@ echo <<< HTML