summaryrefslogtreecommitdiff
path: root/lib/channel.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-09 13:41:05 -0800
committerBrion Vibber <brion@pobox.com>2010-03-09 13:41:05 -0800
commit971f1f64f1f42a51bced51665ae693a9d37750a0 (patch)
tree846e77bde641a32f70f6d45bc8de3ca44480c530 /lib/channel.php
parent32532c7c42971ca337e5bf55c5deb60312a63816 (diff)
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
Diffstat (limited to 'lib/channel.php')
-rw-r--r--lib/channel.php19
1 files changed, 19 insertions, 0 deletions
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
{