Order the items and make the outbox more accurate

merge-requests/5/head
Terence Eden 2024-03-06 09:21:13 +00:00
rodzic b8742c5104
commit e29034a1e3
1 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -182,6 +182,11 @@
// Number of users
$totalItems = count( $following_files );
// Sort users by most recent first
usort( $following_files, function( $a, $b ) {
return filemtime($b) - filemtime($a);
});
// Create a list of all accounts being followed
$items = array();
foreach ( $following_files as $following_file ) {
@ -210,6 +215,11 @@
// Number of users
$totalItems = count( $follower_files );
// Sort users by most recent first
usort( $follower_files, function( $a, $b ) {
return filemtime($b) - filemtime($a);
});
// Create a list of everyone being followed
$items = array();
foreach ( $follower_files as $follower_file ) {
@ -1224,8 +1234,9 @@ HTML;
// Create an ordered list
$orderedItems = [];
foreach ( $posts as $post ) {
$postData = json_decode( file_get_contents( $post ), true );
$orderedItems[] = array(
"type" => "Create",
"type" => $postData["type"],
"actor" => "https://{$server}/{$username}",
"object" => "https://{$server}/{$post}"
);