Cleaned up the /TOPIC command slightly
This commit is contained in:
parent
b245c56143
commit
05743d4b4e
@ -214,10 +214,8 @@ func (s *Server) handleEvent(e Event) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
channelName := args[0]
|
|
||||||
|
|
||||||
if len(args) == 1 {
|
if len(args) == 1 {
|
||||||
e.client.reply(rplTopic, channelName, channel.topic)
|
e.client.reply(rplTopic, channel.name, channel.topic)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +228,7 @@ func (s *Server) handleEvent(e Event) {
|
|||||||
if args[1] == ":" {
|
if args[1] == ":" {
|
||||||
channel.topic = ""
|
channel.topic = ""
|
||||||
for _, client := range channel.clientMap {
|
for _, client := range channel.clientMap {
|
||||||
client.reply(rplNoTopic, channelName)
|
client.reply(rplNoTopic, channel.name)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
topic := strings.Join(args[1:], " ")
|
topic := strings.Join(args[1:], " ")
|
||||||
@ -238,7 +236,7 @@ func (s *Server) handleEvent(e Event) {
|
|||||||
channel.topic = topic
|
channel.topic = topic
|
||||||
|
|
||||||
for _, client := range channel.clientMap {
|
for _, client := range channel.clientMap {
|
||||||
client.reply(rplTopic, channelName, channel.topic)
|
client.reply(rplTopic, channel.name, channel.topic)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user