3 * StatusNet, the distributed open-source microblogging tool
\r
5 * Extend the IMChannel class to allow commands to send messages
\r
6 * to a channel instead of PMing a user
\r
10 * LICENCE: This program is free software: you can redistribute it and/or modify
\r
11 * it under the terms of the GNU Affero General Public License as published by
\r
12 * the Free Software Foundation, either version 3 of the License, or
\r
13 * (at your option) any later version.
\r
15 * This program is distributed in the hope that it will be useful,
\r
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
18 * GNU Affero General Public License for more details.
\r
20 * You should have received a copy of the GNU Affero General Public License
\r
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
24 * @package StatusNet
\r
25 * @author Luke Fitzgerald <lw.fitzgerald@googlemail.com>
\r
26 * @copyright 2010 StatusNet, Inc.
\r
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
\r
28 * @link http://status.net/
\r
31 if (!defined('STATUSNET') && !defined('LACONICA')) {
\r
35 class ChannelResponseChannel extends IMChannel {
\r
36 protected $ircChannel;
\r
39 * Construct a ChannelResponseChannel
\r
41 * @param IMplugin $imPlugin IMPlugin
\r
42 * @param string $ircChannel IRC Channel to reply to
\r
43 * @return ChannelResponseChannel
\r
45 public function __construct($imPlugin, $ircChannel) {
\r
46 $this->ircChannel = $ircChannel;
\r
47 parent::__construct($imPlugin);
\r
51 * Send a message using the plugin
\r
53 * @param User $user User
\r
54 * @param string $text Message text
\r
57 public function output($user, $text) {
\r
58 $text = $user->nickname.': ['.common_config('site', 'name') . '] ' . $text;
\r
59 $this->imPlugin->sendMessage($this->ircChannel, $text);
\r