11
11
use Activitypub \Activity \Base_Object ;
12
12
use Activitypub \Collection \Actors ;
13
13
use Activitypub \Collection \Outbox ;
14
+ use Activitypub \Collection \Remote_Actors ;
14
15
use Activitypub \Scheduler \Actor ;
15
16
use Activitypub \Scheduler \Comment ;
16
17
use Activitypub \Scheduler \Post ;
@@ -156,19 +157,19 @@ public static function update_remote_actors() {
156
157
* @param int $number The number of remote Actors to update.
157
158
*/
158
159
$ number = apply_filters ( 'activitypub_update_remote_actors_number ' , $ number );
159
- $ actors = Actors ::get_outdated ( $ number );
160
+ $ actors = Remote_Actors ::get_outdated ( $ number );
160
161
161
162
foreach ( $ actors as $ actor ) {
162
163
$ meta = get_remote_metadata_by_actor ( $ actor ->guid , false );
163
164
164
165
if ( empty ( $ meta ) || ! is_array ( $ meta ) || is_wp_error ( $ meta ) ) {
165
- Actors ::add_error ( $ actor ->ID , 'Failed to fetch or parse metadata ' );
166
+ Remote_Actors ::add_error ( $ actor ->ID , 'Failed to fetch or parse metadata ' );
166
167
} else {
167
- $ id = Actors ::upsert ( $ meta );
168
+ $ id = Remote_Actors ::upsert ( $ meta );
168
169
if ( \is_wp_error ( $ id ) ) {
169
170
continue ;
170
171
}
171
- Actors ::clear_errors ( $ id );
172
+ Remote_Actors ::clear_errors ( $ id );
172
173
}
173
174
}
174
175
}
@@ -189,26 +190,26 @@ public static function cleanup_remote_actors() {
189
190
* @param int $number The number of remote Actors to clean up.
190
191
*/
191
192
$ number = apply_filters ( 'activitypub_cleanup_remote_actors_number ' , $ number );
192
- $ actors = Actors ::get_faulty ( $ number );
193
+ $ actors = Remote_Actors ::get_faulty ( $ number );
193
194
194
195
foreach ( $ actors as $ actor ) {
195
196
$ meta = get_remote_metadata_by_actor ( $ actor ->guid , false );
196
197
197
198
if ( Tombstone::exists ( $ meta ) ) {
198
199
\wp_delete_post ( $ actor ->ID );
199
200
} elseif ( empty ( $ meta ) || ! is_array ( $ meta ) || \is_wp_error ( $ meta ) ) {
200
- if ( Actors ::count_errors ( $ actor ->ID ) >= 5 ) {
201
+ if ( Remote_Actors ::count_errors ( $ actor ->ID ) >= 5 ) {
201
202
\wp_schedule_single_event ( \time (), 'activitypub_delete_actor_interactions ' , array ( $ actor ->guid ) );
202
203
\wp_delete_post ( $ actor ->ID );
203
204
} else {
204
- Actors ::add_error ( $ actor ->ID , $ meta );
205
+ Remote_Actors ::add_error ( $ actor ->ID , $ meta );
205
206
}
206
207
} else {
207
- $ id = Actors ::upsert ( $ meta );
208
+ $ id = Remote_Actors ::upsert ( $ meta );
208
209
if ( \is_wp_error ( $ id ) ) {
209
- Actors ::add_error ( $ actor ->ID , $ id );
210
+ Remote_Actors ::add_error ( $ actor ->ID , $ id );
210
211
} else {
211
- Actors ::clear_errors ( $ actor ->ID );
212
+ Remote_Actors ::clear_errors ( $ actor ->ID );
212
213
}
213
214
}
214
215
}
0 commit comments