123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- if (!defined('STATUSNET')) {
- exit(1);
- }
- 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'];
- $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");
- }
- return true;
- }
- }
|