3 * StatusNet, the distributed open-source microblogging tool
5 * Show/add/remove list subscribers.
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
25 * @link http://status.net/
28 if (!defined('STATUSNET')) {
32 require_once INSTALLDIR . '/lib/apilistusers.php';
34 class ApiListSubscribersAction extends ApiListUsersAction
39 * @return boolean success
44 $result = Profile_tag_subscription::add($this->list,
49 _('An error occured.'),
56 switch($this->format) {
58 $this->showSingleXmlList($this->list);
61 $this->showSingleJsonList($this->list);
65 _('API method not found.'),
74 function handleDelete()
76 $args = array('profile_tag_id' => $this->list->id,
77 'profile_id' => $this->auth_user->id);
78 $ptag = Profile_tag_subscription::pkeyGet($args);
82 _('You are not subscribed to this list'),
89 Profile_tag_subscription::remove($this->list, $this->auth_user);
93 _('An error occured.'),
100 switch($this->format) {
102 $this->showSingleXmlList($this->list);
105 $this->showSingleJsonList($this->list);
109 _('API method not found.'),
121 $fn = array($this->list, 'getSubscribers');
122 list($this->users, $this->next_cursor, $this->prev_cursor) =
123 Profile_list::getAtCursor($fn, array(), $this->cursor, 20);