+<?php\r
+/**\r
+ * StatusNet, the distributed open-source microblogging tool\r
+ *\r
+ * Override the IMChannel class to allow commands to send messages\r
+ * to a channel instead of PMing a user\r
+ *\r
+ * PHP version 5\r
+ *\r
+ * LICENCE: This program is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Affero General Public License as published by\r
+ * the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU Affero General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Affero General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * @category Network\r
+ * @package StatusNet\r
+ * @author Luke Fitzgerald <lw.fitzgerald@googlemail.com>\r
+ * @copyright 2010 StatusNet, Inc.\r
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0\r
+ * @link http://status.net/\r
+ */\r
+\r
+if (!defined('STATUSNET') && !defined('LACONICA')) {\r
+ exit(1);\r
+}\r
+\r
+class ChannelResponseChannel extends IMChannel {\r
+ protected $ircChannel;\r
+\r
+ public function __construct($imPlugin, $ircChannel) {\r
+ $this->ircChannel = $ircChannel;\r
+ parent::__construct($imPlugin);\r
+ }\r
+\r
+ public function output($user, $text) {\r
+ $text = $user->nickname.': ['.common_config('site', 'name') . '] ' . $text;\r
+ $this->imPlugin->send_message($this->ircChannel, $text);\r
+ }\r
+}
\ No newline at end of file