From eaa8650c9be413664ef52c56b504e9b7fdaafc38 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Thu, 13 Oct 2016 23:26:13 +0100 Subject: Temp fix, duplicate channel joining code --- index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 1142213..ca6857d 100644 --- a/index.js +++ b/index.js @@ -114,7 +114,6 @@ $("#send-message").keypress(function(e) { if (message.length > 6) { channel = message.substring(6, message.length); } - console.log() removeChannel(channel, true); } else if (message.indexOf("/whois") == 0) { console.log("whois "+message.substring(7, message.length)); @@ -179,8 +178,11 @@ function setTopic(channel, topic) { } function joinChannel(channel, sendJoin) { + + var channelObj = client.channel(channel); if (sendJoin) { - client.join(channel); + channelObj.join(); + channelObj.say("beep"); } chanId = $(".active.chat").attr("data-id") @@ -189,7 +191,7 @@ function joinChannel(channel, sendJoin) { $(".ui.menu").append(""+channel+""); $("#chan-container").append("
"); - var chanTab = $("[data-tab="+ channel +"].tab"); + var chanTab = $("[data-tab='"+ channel +"'].tab"); chanTab.append("
"); chanTab.append("
"); @@ -197,11 +199,12 @@ function joinChannel(channel, sendJoin) { $('.menu .item').tab({history:false}); + numChans++; } function removeChannel(channel, sendPart) { - chanId = $("[data-tab="+channel+"].chat").attr("data-id"); - $("[data-tab="+channel+"]").remove(); + chanId = $("[data-tab='"+channel+"'].chat").attr("data-id"); + $("[data-tab='"+channel+"']").remove(); if (sendPart) { client.part(channel); } -- cgit v1.2.3