Skip to content

Commit

Permalink
Also detect standard fediverse urls and assign the post-format status (
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk authored Jul 23, 2023
1 parent 211afbe commit 86d5695
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions feed-parsers/class-feed-parser-activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ public function feed_support_confidence( $url, $mime_type, $title, $content = nu
return 10;
}

if ( preg_match( '/^https?:\/\/[^\/]+\/+@[a-z0-9-]+$/i', $url ) ) {
return 10;
}

if ( 'application/activity+json' === $mime_type ) {
return 10;
}
Expand Down Expand Up @@ -291,6 +295,7 @@ public function update_feed_details( $feed_details ) {
// Disable polling.
$feed_details['interval'] = YEAR_IN_SECONDS;
$feed_details['next-poll'] = gmdate( 'Y-m-d H:i:s', time() + YEAR_IN_SECONDS );
$feed_details['post-format'] = 'status';

return $feed_details;
}
Expand Down

0 comments on commit 86d5695

Please sign in to comment.