Add Event Sources Logic (ActivityPub follows) #86

Open
linos wants to merge 95 commits from event_sources into main
3 changed files with 11 additions and 11 deletions
Showing only changes of commit 1eec93d342 - Show all commits

View file

@ -41,11 +41,6 @@ class Create {
return;
}
// Check that we are actually following this actor.
if ( ! Event_Sources::actor_is_event_source( $activity['actor'] ) ) {
return false;
}
// Check if Activity is public or not.
if ( ! is_activity_public( $activity ) ) {
return;
@ -56,6 +51,11 @@ class Create {
return;
}
// Check that we are actually following this actor.
if ( ! Event_Sources::actor_is_event_source( $activity['actor'] ) ) {
return false;
}
if ( Event_Sources::is_time_passed( $activity['object']['startTime'] ) ) {
return new \WP_Error(
'event_bridge_for_activitypub_not_accepting_events_from_the_past',

View file

@ -42,7 +42,7 @@ class Undo {
return;
}
// Check that we are actually following/or have a pending follow request this actor.
// Check that we are actually following/or have a pending follow request for this actor.
if ( ! Event_Sources::actor_is_event_source( $activity['actor'] ) ) {
return;
}

View file

@ -41,11 +41,6 @@ class Update {
return;
}
// Check that we are actually following this actor.
if ( ! Event_Sources::actor_is_event_source( $activity['actor'] ) ) {
return;
}
// Check if Activity is public or not.
if ( ! is_activity_public( $activity ) ) {
return;
@ -56,6 +51,11 @@ class Update {
return;
}
// Check that we are actually following this actor.
if ( ! Event_Sources::actor_is_event_source( $activity['actor'] ) ) {
return false;
}
if ( Event_Sources::is_time_passed( $activity['object']['startTime'] ) ) {
return;
}