Browse Source

fix #1751

RENAME (channel rename) that was a simple case change (e.g.
renaming #chan to #CHAN) would delete the channel :-|
tags/v2.8.0-rc1
Shivaram Lingamneni 2 years ago
parent
commit
5b317d4846
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      irc/channelmanager.go

+ 5
- 3
irc/channelmanager.go View File

@@ -320,9 +320,11 @@ func (cm *ChannelManager) Rename(name string, newName string) (err error) {
320 320
 	defer func() {
321 321
 		if channel != nil && info.Founder != "" {
322 322
 			channel.Store(IncludeAllAttrs)
323
-			// we just flushed the channel under its new name, therefore this delete
324
-			// cannot be overwritten by a write to the old name:
325
-			cm.server.channelRegistry.Delete(info)
323
+			if oldCfname != newCfname {
324
+				// we just flushed the channel under its new name, therefore this delete
325
+				// cannot be overwritten by a write to the old name:
326
+				cm.server.channelRegistry.Delete(info)
327
+			}
326 328
 		}
327 329
 	}()
328 330
 

Loading…
Cancel
Save