Explorar el Código

fix #1619

Clean up channels during unregistration if necessary.
tags/v2.7.0-rc1
Shivaram Lingamneni hace 3 años
padre
commit
3cca1e2c39
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7
    0
      irc/channelmanager.go

+ 7
- 0
irc/channelmanager.go Ver fichero

@@ -176,6 +176,10 @@ func (cm *ChannelManager) maybeCleanup(channel *Channel, afterJoin bool) {
176 176
 		return
177 177
 	}
178 178
 
179
+	cm.maybeCleanupInternal(cfname, entry, afterJoin)
180
+}
181
+
182
+func (cm *ChannelManager) maybeCleanupInternal(cfname string, entry *channelManagerEntry, afterJoin bool) {
179 183
 	if afterJoin {
180 184
 		entry.pendingJoins -= 1
181 185
 	}
@@ -288,6 +292,9 @@ func (cm *ChannelManager) SetUnregistered(channelName string, account string) (e
288 292
 			entry.skeleton = skel
289 293
 			cm.chans[cfname] = entry
290 294
 		}
295
+		// #1619: if the channel has 0 members and was only being retained
296
+		// because it was registered, clean it up:
297
+		cm.maybeCleanupInternal(cfname, entry, false)
291 298
 	}
292 299
 	return nil
293 300
 }

Loading…
Cancelar
Guardar