123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class KeepalivechannelAction extends Action
- {
- protected $channelKey = null;
- protected $channel = null;
-
- function prepare($argarray)
- {
- parent::prepare($argarray);
- if (!$this->isPost()) {
-
- throw new ClientException(_m('You have to POST it.'));
- }
- $this->channelKey = $this->trimmed('channelkey');
- if (empty($this->channelKey)) {
-
- throw new ClientException(_m('No channel key argument.'));
- }
- $this->channel = Realtime_channel::getKV('channel_key', $this->channelKey);
- if (empty($this->channel)) {
-
- throw new ClientException(_m('No such channel.'));
- }
- return true;
- }
-
- function handle($argarray=null)
- {
- $this->channel->touch();
- header('HTTP/1.1 204 No Content');
- return;
- }
-
- function isReadOnly($args)
- {
- return false;
- }
- }
|