From ae02596214bb12e9c6a08f0ee338bef381200aa1 Mon Sep 17 00:00:00 2001 From: Jeremy Latt Date: Sat, 15 Feb 2014 19:56:38 -0800 Subject: [PATCH] get rid of extra topic messages --- irc/channel.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/irc/channel.go b/irc/channel.go index 5072c40b..8a42be7f 100644 --- a/irc/channel.go +++ b/irc/channel.go @@ -242,20 +242,18 @@ func (m *TopicCommand) HandleChannel(channel *Channel) { return } - if m.setTopic { - if channel.flags[OpOnlyTopic] { - client.Reply(ErrChanOPrivIsNeeded(channel)) - return - } - - channel.topic = m.topic + if !m.setTopic { channel.GetTopic(client) - channel.Reply(RplTopicMsg(client, channel)) return } - channel.GetTopic(client) - return + if channel.flags[OpOnlyTopic] { + client.Reply(ErrChanOPrivIsNeeded(channel)) + return + } + + channel.topic = m.topic + channel.Reply(RplTopicMsg(client, channel)) } func (m *PrivMsgCommand) HandleChannel(channel *Channel) {