summaryrefslogtreecommitdiff
path: root/handlers.js
diff options
context:
space:
mode:
Diffstat (limited to 'handlers.js')
-rw-r--r--handlers.js17
1 files changed, 16 insertions, 1 deletions
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("<div class=item data-nick="+nick+">"+mode+nick+"</div>")
}
})
- });
+ })
+
+ 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("<p class='chat-line'>Topic for "+channel+" is "+topic+" - set by "+nick+" at "+time+"</p>")
+ var topicTab = $("[data-tab='"+ channel +"'].topic");
+ topicTab.html("<p class='topic-line'>"+topic+"</p>")
+ })
}