From: Mikael Nordfeldth Date: Tue, 25 Apr 2017 18:42:10 +0000 (+0200) Subject: Use getByID nistead of getKV for Feedsub in PushInQueueHandler X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a53284fe4f5c1a1249be64da1381c02be1098b1a;p=quix0rs-gnu-social.git Use getByID nistead of getKV for Feedsub in PushInQueueHandler --- diff --git a/plugins/OStatus/lib/pushinqueuehandler.php b/plugins/OStatus/lib/pushinqueuehandler.php index ac8a6c8429..961b848211 100644 --- a/plugins/OStatus/lib/pushinqueuehandler.php +++ b/plugins/OStatus/lib/pushinqueuehandler.php @@ -17,9 +17,7 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } /** * Process a feed distribution POST from a PuSH hub. @@ -41,15 +39,13 @@ class PushInQueueHandler extends QueueHandler $post = $data['post']; $hmac = $data['hmac']; - $feedsub = FeedSub::getKV('id', $feedsub_id); - if ($feedsub instanceof FeedSub) { - try { - $feedsub->receive($post, $hmac); - } catch(Exception $e) { - common_log(LOG_ERR, "Exception during PuSH input processing for $feedsub->uri: " . $e->getMessage()); - } - } else { - common_log(LOG_ERR, "Discarding POST to unknown feed subscription id $feedsub_id"); + try { + $feedsub = FeedSub::getByID($feedsub_id); + $feedsub->receive($post, $hmac); + } catch(NoResultException $e) { + common_log(LOG_INFO, "Discarding POST to unknown feed subscription id {$feedsub_id}"); + } catch(Exception $e) { + common_log(LOG_ERR, "Exception during PuSH input processing for {$feedsub->getUri()}: " . $e->getMessage()); } return true; }