From 5b317d4846e186eb7c51cd8881bfd74b2e2f6791 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Tue, 13 Jul 2021 08:47:16 -0400 Subject: [PATCH] fix #1751 RENAME (channel rename) that was a simple case change (e.g. renaming #chan to #CHAN) would delete the channel :-| --- irc/channelmanager.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/irc/channelmanager.go b/irc/channelmanager.go index 6b91b885..c8af03f6 100644 --- a/irc/channelmanager.go +++ b/irc/channelmanager.go @@ -320,9 +320,11 @@ func (cm *ChannelManager) Rename(name string, newName string) (err error) { defer func() { if channel != nil && info.Founder != "" { channel.Store(IncludeAllAttrs) - // we just flushed the channel under its new name, therefore this delete - // cannot be overwritten by a write to the old name: - cm.server.channelRegistry.Delete(info) + if oldCfname != newCfname { + // we just flushed the channel under its new name, therefore this delete + // cannot be overwritten by a write to the old name: + cm.server.channelRegistry.Delete(info) + } } }()