summaryrefslogtreecommitdiffstats
path: root/webchat/serverCommands.js
diff options
context:
space:
mode:
Diffstat (limited to 'webchat/serverCommands.js')
-rw-r--r--webchat/serverCommands.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/webchat/serverCommands.js b/webchat/serverCommands.js
index dd755a97..303c4805 100644
--- a/webchat/serverCommands.js
+++ b/webchat/serverCommands.js
@@ -1,5 +1,10 @@
var serverCommands = {};
-serverCommands.say = function (serverstate, settings, params) {
+
+serverCommands.coi = function (serverstate, settings, params, id) {
+ return settings.conn.write({ result: { nick: settings.nick, addr: settings.addr}, id: id})
+}
+
+serverCommands.say = function (serverstate, settings, params, id) {
var nick = settings.nick
var message = params.msg
params.nick = nick
@@ -7,14 +12,14 @@ serverCommands.say = function (serverstate, settings, params) {
return serverstate.clients.notifyAll('message', params)
}
-serverCommands.nick = function (serverstate, settings, params) {
+serverCommands.nick = function (serverstate, settings, params, id) {
var oldnick = settings.nick
var newnick = params.nick
settings.nick = newnick
return serverstate.clients.notifyAll('nickchange', { nick: oldnick, newnick: newnick });
}
-serverCommands.badcommand = function (serversate, settings, params) {
+serverCommands.badcommand = function (serversate, settings, params, id) {
settings.conn.write(JSON.stringify({ method: 'usererror', params: { message: 'bad command' }}))
}