summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js68
1 files changed, 1 insertions, 67 deletions
diff --git a/index.js b/index.js
index b4333e5..48f55a0 100644
--- a/index.js
+++ b/index.js
@@ -62,6 +62,7 @@ console.log($("#channel-input").val());
version: "blachat 0.1.3"
});
+ globals.myNick = myNick
commands.init(client)
handlers.setChannels(channels)
handlers.handleCommands(client)
@@ -170,23 +171,6 @@ client.addListener('raw', function(message) {
}
});
-client.addListener('ctcp-version', function(from, to, text, message) {
- client.ctcp(from, "VERSION", "VERSION "+progName + " v"+ version)
-});
-
-client.addListener('quit', function(nick, reason, channels, message) {
- channels.forEach(function(channel) {
- channel = channel.replace("#","")
- if($(".ui.users[data-tab=chan-"+channel+"] [data-nick="+nick+"]").length > 0) {
- $(".ui.users[data-tab=chan-"+channel+"] [data-nick="+nick+"]").remove();
- }
- var chatTab = $("[data-tab=chan-"+ channel +"].chat");
- chatTab.append("<p class='chat-line'>"+nick+" quit ("+reason+")</p>")
- chatTab.scrollTop(chatTab.prop("scrollHeight"));
- });
-
-});
-
client.addListener('kick', function(channel, nick, by, reason, message) {
if (myNick == nick) {
removeChannel(channel, false);
@@ -213,54 +197,4 @@ client.addListener('kill', function(nick, reason, channels, message) {
});
});
-
-client.addListener('+mode', function(channel, by, mode, argument, message) {
- console.log(message)
- channel = channel.replace("#","")
- var chatTab = $("[data-tab=chan-"+ channel +"].chat");
- var modeLine = mode;
- if (mode == "o") {
- modeLine = " gives channel operator status to " + argument;
- } else if (mode == "v") {
- modeLine = " gives voice to " + argument;
- } else if (mode == "h") {
- modeLine = " gives channel half-operator status to " + argument;
- } else if (mode == "q") {
- modeLine = " gives channel owner status to " + argument;
- } else if (argument == myNick) {
- modeLine = " sets mode +" + mode + " on " + argument;
- } else if (argument != null) {
- modeLine = " sets mode " + mode + " " + argument + " on #" +channel;
- } else {
- modeLine = " sets mode +"+mode+" on #" +channel
- }
- var chatTab = $("[data-tab=chan-"+ channel +"].chat");
- chatTab.append("<p class='chat-line'>"+by+modeLine+"</p>");
- chatTab.scrollTop(chatTab.prop("scrollHeight"));
-});
-
-client.addListener('-mode', function(channel, by, mode, argument, message) {
- channel = channel.replace("#","")
- var chatTab = $("[data-tab=chan-"+ channel +"].chat");
- var modeLine = mode;
- if (mode == "o") {
- modeLine = " removes channel operator status from ";
- } else if (mode == "v") {
- modeLine = " removes voice from ";
- } else if (mode == "h") {
- modeLine = " removes channel half-operator status from ";
- } else if (mode == "q") {
- modeLine = " removes channel owner status from ";
- } else if (argument == myNick) {
- modeLine = " sets mode -"+mode+" on " + argument;
- } else if (argument != null) {
- modeLine = " sets mode -" + mode + " " + argument + " on #" +channel;
- } else {
- modeLine = " sets mode -"+mode+" on #" +channel
- }
- var chatTab = $("[data-tab=chan-"+ channel +"].chat");
- chatTab.append("<p class='chat-line'>"+by+modeLine+"</p>");
- chatTab.scrollTop(chatTab.prop("scrollHeight"));
-});
-
}