Try to lookup the profile if we don't know it yet

This commit is contained in:
Mikael Nordfeldth 2014-11-24 23:50:42 +01:00
parent 720c2c9ff2
commit 8056097478

View File

@ -1342,7 +1342,7 @@ class OStatusPlugin extends Plugin
static public function onCheckActivityAuthorship(Activity $activity, Profile &$profile) static public function onCheckActivityAuthorship(Activity $activity, Profile &$profile)
{ {
try { try {
$oprofile = Ostatus_profile::getFromProfile($profile); $oprofile = Ostatus_profile::ensureProfileURI($profile->getUri());
$profile = $oprofile->checkAuthorship($activity); $profile = $oprofile->checkAuthorship($activity);
} catch (Exception $e) { } catch (Exception $e) {
common_log(LOG_ERR, 'Could not get a profile or check authorship ('.get_class($e).': "'.$e->getMessage().'") for activity ID: '.$activity->id); common_log(LOG_ERR, 'Could not get a profile or check authorship ('.get_class($e).': "'.$e->getMessage().'") for activity ID: '.$activity->id);