diff --git a/server.go b/server.go index ce5a7b4..26eece6 100644 --- a/server.go +++ b/server.go @@ -225,31 +225,15 @@ func (s *Server) handleCommand(client *Client, command string, args []string) { return } + // Valid topic get if len(args) == 1 { - client.reply(rplTopic, channel.name, channel.topic) + client.reply(rplTopic, channel.name, s.name) return } - clientMode := channel.modeMap[client.key] - if channel.mode.topicLocked && !clientMode.operator { - client.reply(errNoPriv) - return - } - - if args[1] == ":" { - channel.topic = "" - for _, client := range channel.clientMap { - client.reply(rplNoTopic, channel.name) - } - } else { - topic := strings.Join(args[1:], " ") - topic = strings.TrimPrefix(topic, ":") - channel.topic = topic - - for _, client := range channel.clientMap { - client.reply(rplTopic, channel.name, channel.topic) - } - } + // Disallow topic set + client.reply(errNoPriv) + return case "LIST": if client.registered == false {