@@ -862,23 +879,28 @@ HTML;
$guid = uuid();
// Construct the Message
- // The audience is public and it is sent to all followers
- // TODO: This will also need to be sent to the server of the user whose post it is
$message = [
"@context" => "https://www.w3.org/ns/activitystreams",
"id" => "https://{$server}/posts/{$guid}.json",
"type" => $type,
"actor" => "https://{$server}/{$username}",
"published"=> date( "c" ),
- "to" => [
- "https://www.w3.org/ns/activitystreams#Public"
- ],
- "cc" => [
- "https://{$server}/followers"
- ],
"object" => $postURl
];
+ // Annouces are sent to an audience
+ // The audience is public and it is sent to all followers
+ if ( $type == "Announce") {
+ $message = array_merge( $message,
+ array("to" => [
+ "https://www.w3.org/ns/activitystreams#Public"
+ ],
+ "cc" => [
+ "https://{$server}/followers"
+ ])
+ );
+ }
+
// Construct the Note
// This is for saving in the logs
$note = $message;
@@ -1157,6 +1179,11 @@ HTML;
// This creates a UI for the user to follow another user
function follow() {
+ if ( isset( $_GET["account"] ) ) {
+ $accountURl = htmlspecialchars( $_GET["account"] );
+ } else {
+ $announceURl = "";
+ }
echo <<< HTML
@@ -1170,7 +1197,7 @@ HTML;