summaryrefslogtreecommitdiffstats
path: root/webchat/serverCommands.js
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-11-11 20:16:45 +0100
committerlassulus <lassulus@googlemail.com>2013-11-11 20:16:45 +0100
commitc6a7cd9027150fca42500b3bbc78be01993856f6 (patch)
tree0fbf009f8cbec49087f1621553a5fa4e92ce16dd /webchat/serverCommands.js
parent52ee854fa72607eb00229f5c251393ac392fd4f8 (diff)
webchat: request handling
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' }}))
}