[TheFreeNetwork] Do not allow lower priority protocols to handle remote actors already handled by the higher ones

This commit is contained in:
Diogo Cordeiro
2020-08-26 23:55:36 +01:00
committed by Diogo Peralta Cordeiro
parent a0a37352c8
commit c834d27dd6
7 changed files with 66 additions and 12 deletions

View File

@@ -287,7 +287,13 @@ class SalmonAction extends Action
if (!$this->oprofile instanceof Ostatus_profile) {
common_debug("We do not have a local profile to connect to this activity's author. Let's create one.");
// ensureActivityObjectProfile throws exception on failure
$this->oprofile = Ostatus_profile::ensureActivityObjectProfile($this->activity->actor);
try {
$this->oprofile = Ostatus_profile::ensureActivityObjectProfile($this->activity->actor);
} catch (AlreadyHandledException $e) {
// Some other federation protocol is handling this profile, let it go.
common_debug('SalmonAction found that this actor already was handled by another federation protocol: ' . $e->getMessage());
return;
}
}
}