checkAuthorship events, Ostatus_profile rewrite to handle it
Lost dependency of OStatus plugin for lib/microappplugin.php, whoo! also noting which plugins should be upgraded to new saveActivity support. Favorite plugin won't work with the new system just yet, it doesn't have the necessary functions to extract activity objects, but that's coming in the next (few) commits.
This commit is contained in:
@@ -1365,4 +1365,19 @@ class OStatusPlugin extends Plugin
|
||||
{
|
||||
list($mentions, $groups) = Ostatus_profile::filterAttention($actor, $attention_uris);
|
||||
}
|
||||
|
||||
// FIXME: Maybe this shouldn't be so authoritative that it breaks other remote profile lookups?
|
||||
static public function onCheckActivityAuthorship(Activity $activity, Profile &$profile)
|
||||
{
|
||||
try {
|
||||
$oprofile = Ostatus_profile::getFromProfile($profile);
|
||||
$oprofile = $oprofile->checkAuthorship($activity);
|
||||
$profile = $oprofile->localProfile();
|
||||
} catch (Exception $e) {
|
||||
common_log(LOG_ERR, 'Could not get a profile or check authorship ('.get_class($e).': "'.$e->getMessage().'")');
|
||||
$profile = null;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user