forked from GNUsocial/gnu-social
[ActivityPub] Implement Failed Queue
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user