From 971f1f64f1f42a51bced51665ae693a9d37750a0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 9 Mar 2010 13:41:05 -0800 Subject: Added scripts/command.php, can be used to run commands such as subscription on behalf of users. This includes whatever support for extended command parsing plugins may have added. Example: ./scripts/command.php -nbrionv sub update@status.net --- lib/channel.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib') diff --git a/lib/channel.php b/lib/channel.php index 3cd168786..689bca0be 100644 --- a/lib/channel.php +++ b/lib/channel.php @@ -47,6 +47,25 @@ class Channel } } +class CLIChannel extends Channel +{ + function source() + { + return 'cli'; + } + + function output($user, $text) + { + $site = common_config('site', 'name'); + print "[{$user->nickname}@{$site}] $text\n"; + } + + function error($user, $text) + { + $this->output($user, $text); + } +} + class XMPPChannel extends Channel { -- cgit v1.2.3-54-g00ecf