From 05743d4b4edccb1ba9671f427cb44740b5da6903 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Fri, 30 Aug 2013 16:33:18 +0100 Subject: [PATCH] Cleaned up the /TOPIC command slightly --- server.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server.go b/server.go index d3fab30..d07492c 100644 --- a/server.go +++ b/server.go @@ -214,10 +214,8 @@ func (s *Server) handleEvent(e Event) { return } - channelName := args[0] - if len(args) == 1 { - e.client.reply(rplTopic, channelName, channel.topic) + e.client.reply(rplTopic, channel.name, channel.topic) return } @@ -230,7 +228,7 @@ func (s *Server) handleEvent(e Event) { if args[1] == ":" { channel.topic = "" for _, client := range channel.clientMap { - client.reply(rplNoTopic, channelName) + client.reply(rplNoTopic, channel.name) } } else { topic := strings.Join(args[1:], " ") @@ -238,7 +236,7 @@ func (s *Server) handleEvent(e Event) { channel.topic = topic for _, client := range channel.clientMap { - client.reply(rplTopic, channelName, channel.topic) + client.reply(rplTopic, channel.name, channel.topic) } }