From 855db48bbba753508d68b7d91ec858855e003c9c Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Fri, 14 Oct 2016 18:17:34 +0100 Subject: Implement topic function --- handlers.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'handlers.js') diff --git a/handlers.js b/handlers.js index 0e26d7f..0e27c25 100644 --- a/handlers.js +++ b/handlers.js @@ -41,7 +41,22 @@ module.exports.handleCommands = function(myClient) { $(".ui.users[data-tab='"+channel+"']").append("
"+mode+nick+"
") } }) - }); + }) + + client.on('topic', function(event) { + channel = event.channel + topic = event.topic + //TODO: Handle topicsetby to add the user and time for the topic + nick = "vov" + time = "vov" + var chatTab = $("[data-tab='"+ channel +"'].chat"); + if($(".ui.tab[data-tab='"+channel+"']").length == 0) { + joinChannel(channel, false) + } + chatTab.append("

Topic for "+channel+" is "+topic+" - set by "+nick+" at "+time+"

") + var topicTab = $("[data-tab='"+ channel +"'].topic"); + topicTab.html("

"+topic+"

") + }) } -- cgit v1.2.3