Explorar el Código

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 hace 2 años
padre
commit
5b317d4846
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5
    3
      irc/channelmanager.go

+ 5
- 3
irc/channelmanager.go Ver fichero

@@ -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…
Cancelar
Guardar