| @@ -129,9 +129,32 @@ | ||
| 129 | 129 | return array( new Subscription( $term ) ); |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - return array(); | |
| 133 | + // Feeds of a user-backed friend aren't child terms of a subscription | |
| 134 | + // term but are attached to the user as object terms, see | |
| 135 | + // User::save_feeds(). | |
| 136 | + $object_ids = get_objects_in_term( $this->term->term_id, self::TAXONOMY ); | |
| 137 | + if ( is_wp_error( $object_ids ) ) { | |
| 138 | + return array(); | |
| 139 | + } | |
| 140 | + | |
| 141 | + $users = array(); | |
| 142 | + foreach ( $object_ids as $object_id ) { | |
| 143 | + $user = User::get_user_by_id( $object_id ); | |
| 144 | + if ( ! $user ) { | |
| 145 | + continue; | |
| 146 | + } | |
| 147 | + | |
| 148 | + // The same object id can belong to an ap_actor post, so only accept | |
| 149 | + // the user if this feed really is one of theirs. | |
| 150 | + $feeds = $user->get_feeds(); | |
| 151 | + if ( isset( $feeds[ $this->term->term_id ] ) ) { | |
| 152 | + $users[] = $user; | |
| 153 | + } | |
| 154 | + } | |
| 155 | + | |
| 156 | + return $users; | |
| 134 | 157 | } |
| 135 | 158 | |
| 136 | 159 | /** |
| 137 | 160 | * Whether the feed is active (=subscribed). |