[ActivityPub] Implement Failed Queue

This commit is contained in:
Diogo Cordeiro
2020-08-29 16:09:10 +01:00
committed by Diogo Peralta Cordeiro
parent 751b23f6fe
commit 82f1fc7ca2
7 changed files with 204 additions and 16 deletions

View File

@@ -19,14 +19,15 @@
*
* @package GNUsocial
* @author Bruno Casteleiro <brunoccast@fc.up.pt>
* @copyright 2019 Free Software Foundation, Inc http://www.fsf.org
* @author Diogo Cordeiro <diogo@fc.up.pt>
* @copyright 2019-2020 Free Software Foundation, Inc http://www.fsf.org
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
defined('GNUSOCIAL') || die();
/**
* @copyright 2019 Free Software Foundation, Inc http://www.fsf.org
* @copyright 2019-2020 Free Software Foundation, Inc http://www.fsf.org
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
class ActivityPubQueueHandler extends QueueHandler
@@ -73,19 +74,24 @@ class ActivityPubQueueHandler extends QueueHandler
$notice->getAttentionProfiles()
);
// Handling a Create?
if (ActivityUtils::compareVerbs($notice->verb, [ActivityVerb::POST, ActivityVerb::SHARE])) {
return $this->handle_create($profile, $notice, $other);
}
try {
// Handling a Create?
if (ActivityUtils::compareVerbs($notice->verb, [ActivityVerb::POST, ActivityVerb::SHARE])) {
return $this->handle_create($profile, $notice, $other);
}
// Handling a Like?
if (ActivityUtils::compareVerbs($notice->verb, [ActivityVerb::FAVORITE])) {
return $this->onEndFavorNotice($profile, $notice, $other);
}
// Handling a Like?
if (ActivityUtils::compareVerbs($notice->verb, [ActivityVerb::FAVORITE])) {
return $this->onEndFavorNotice($profile, $notice, $other);
}
// Handling a Delete Note?
if (ActivityUtils::compareVerbs($notice->verb, [ActivityVerb::DELETE])) {
return $this->onStartDeleteOwnNotice($profile, $notice, $other);
// Handling a Delete Note?
if (ActivityUtils::compareVerbs($notice->verb, [ActivityVerb::DELETE])) {
return $this->onStartDeleteOwnNotice($profile, $notice, $other);
}
} catch (Exception $e) {
// Postman handles issues with the failed queue
common_debug('ActivityPub Queue Handler:'.$e->getMessage());
}
return true;