X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fapiconversation.php;h=728d62c24b6f7f9a2c7a3c3dfb431183627b6dc1;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=dae9a41f71c09e27783884181aa803102ceb077e;hpb=1b7d1d9a4a41fe68f2ee2c31721a7e99da5a8cc6;p=quix0rs-gnu-social.git diff --git a/actions/apiconversation.php b/actions/apiconversation.php index dae9a41f71..728d62c24b 100644 --- a/actions/apiconversation.php +++ b/actions/apiconversation.php @@ -34,8 +34,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apiauth.php'; - /** * Show a stream of notices in a particular conversation * @@ -51,16 +49,9 @@ class ApiconversationAction extends ApiAuthAction protected $conversation = null; protected $notices = null; - /** - * For initializing members of the class. - * - * @param array $argarray misc. arguments - * - * @return boolean true - */ - function prepare($argarray) + protected function prepare(array $args=array()) { - parent::prepare($argarray); + parent::prepare($args); $convId = $this->trimmed('id'); @@ -69,7 +60,7 @@ class ApiconversationAction extends ApiAuthAction throw new ClientException(_('No conversation ID.')); } - $this->conversation = Conversation::staticGet('id', $convId); + $this->conversation = Conversation::getKV('id', $convId); if (empty($this->conversation)) { // TRANS: Client exception thrown when referring to a non-existing conversation ID (%d). @@ -77,9 +68,7 @@ class ApiconversationAction extends ApiAuthAction 404); } - $profile = Profile::current(); - - $stream = new ConversationNoticeStream($convId, $profile); + $stream = new ConversationNoticeStream($convId, $this->scoped); $notice = $stream->getNotices(($this->page-1) * $this->count, $this->count, @@ -101,7 +90,7 @@ class ApiconversationAction extends ApiAuthAction function handle($argarray=null) { $sitename = common_config('site', 'name'); - // TRANS: Timeline title for user and friends. %s is a user nickname. + // TRANS: Title for conversion timeline. $title = _m('TITLE', 'Conversation'); $id = common_local_url('apiconversation', array('id' => $this->conversation->id, 'format' => $this->format)); $link = common_local_url('conversation', array('id' => $this->conversation->id)); @@ -167,7 +156,7 @@ class ApiconversationAction extends ApiAuthAction * * @return boolean is read only action? */ - function isReadOnly($args) + function isReadOnly(array $args=array()) { if ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD') {