Преглед на файлове

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 години
родител
ревизия
5b317d4846
променени са 1 файла, в които са добавени 5 реда и са изтрити 3 реда
  1. 5
    3
      irc/channelmanager.go

+ 5
- 3
irc/channelmanager.go Целия файл

@@ -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…
Отказ
Запис