Skip to content

Commit

Permalink
Try to do some basic identification of the relationship if ActivityPu…
Browse files Browse the repository at this point in the history
…b is not available
  • Loading branch information
akirk committed Feb 13, 2025
1 parent 2fefcd1 commit c342681
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions includes/class-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -1470,9 +1470,15 @@ public static function mastodon_api_get_posts_query_args( $args ) {

public static function mastodon_entity_relationship( $relationship, $user_id ) {
if ( ! class_exists( 'Friends\Feed_Parser_ActivityPub' ) ) {
return $relationship;
if ( ! is_wp_error( $user_id ) ) {
$user = User::get_user_by_id( $user_id );
if ( ! $user ) {
$user = User::get_user_by_id( 'friends-virtual-user-' . $user_id );
}
}
} else {
$user = Feed_Parser_ActivityPub::determine_mastodon_api_user( $user_id );
}
$user = Feed_Parser_ActivityPub::determine_mastodon_api_user( $user_id );
if ( $user instanceof self ) {
if ( ! $relationship instanceof \Enable_Mastodon_Apps\Entity\Relationship ) {
$relationship = new \Enable_Mastodon_Apps\Entity\Relationship();
Expand Down

0 comments on commit c342681

Please sign in to comment.