. */ if (!defined('GNUSOCIAL')) { exit(1); } /** * Process a feed distribution POST from a PuSH hub. * @package FeedSub * @author Brion Vibber */ class PushInQueueHandler extends QueueHandler { function transport() { return 'pushin'; } function handle($data) { assert(is_array($data)); $feedsub_id = $data['feedsub_id']; $post = $data['post']; $hmac = $data['hmac']; 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; } }