add events for restoring activities
This commit is contained in:
parent
75e671774d
commit
1996545947
@ -63,6 +63,11 @@ class ActivityImporter extends QueueHandler
|
||||
|
||||
$this->trusted = $trusted;
|
||||
|
||||
$done = null;
|
||||
|
||||
if (Event::handle('StartImportActivity',
|
||||
array($user, $author, $activity, $trusted, &$done))) {
|
||||
|
||||
try {
|
||||
switch ($activity->verb) {
|
||||
case ActivityVerb::FOLLOW:
|
||||
@ -75,19 +80,23 @@ class ActivityImporter extends QueueHandler
|
||||
$this->postNote($user, $author, $activity);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Unknown verb: {$activity->verb}");
|
||||
throw new ClientException("Unknown verb: {$activity->verb}");
|
||||
}
|
||||
Event::handle('EndImportActivity',
|
||||
array($user, $author, $activity, $trusted));
|
||||
$done = true;
|
||||
} catch (ClientException $ce) {
|
||||
common_log(LOG_WARNING, $ce->getMessage());
|
||||
return true;
|
||||
$done = true;
|
||||
} catch (ServerException $se) {
|
||||
common_log(LOG_ERR, $se->getMessage());
|
||||
return false;
|
||||
$done = false;
|
||||
} catch (Exception $e) {
|
||||
common_log(LOG_ERR, $e->getMessage());
|
||||
return false;
|
||||
$done = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return $done;
|
||||
}
|
||||
|
||||
function subscribeProfile($user, $author, $activity)
|
||||
|
Loading…
Reference in New Issue
Block a user