diff --git a/client/css/style.css b/client/css/style.css index cae597a8..2ab3fb1e 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -180,7 +180,7 @@ h2 { padding: 0 8px; } #chat .messages { - border-left: 8px solid #f0f0f0; + border-left: 8px solid #fafafa; bottom: 30px; left: 0; overflow-y: auto; diff --git a/lib/server.js b/lib/server.js index 9d52fa67..7016bc06 100644 --- a/lib/server.js +++ b/lib/server.js @@ -12,6 +12,7 @@ var networks = new models.Networks; var events = [ "join", "kick", + "mode", "motd", "message", "names", @@ -169,7 +170,37 @@ function input(json) { } break; + case "op": + case "deop": + case "voice": + case "devoice": case "mode": + if (!client || !args[1]) { + break; + } + + var mode; + var user; + if (cmd != "mode") { + user = args[1]; + mode = { + "op": "+o", + "deop": "-o", + "voice": "+v", + "devoice": "-v", + }[cmd]; + } else if (!args[2]) { + break; + } else { + mode = args[1]; + user = args[2]; + } + + client.mode( + channel.get("name"), + mode, + user + ); break; case "quit": @@ -212,6 +243,17 @@ function event(event, data) { }); break; + case "mode": + var chan = channels.findWhere({name: data[0].target}); + if (typeof chan !== "undefined") { + chan.addMessage({ + from: data[0].nick, + message: data[0].mode + " " + data[0].client, + type: "mode", + }); + } + break; + case "motd": var messages = data[0].motd; messages.forEach(function(msg) { diff --git a/node_modules/slate-irc b/node_modules/slate-irc index d2421f44..f992e474 160000 --- a/node_modules/slate-irc +++ b/node_modules/slate-irc @@ -1 +1 @@ -Subproject commit d2421f44df1683ccf7b2e6f956fc6c6a6d5d7a2a +Subproject commit f992e474d7ad7a79b129c289fb744c2522a99e8c