Browse Source

fix #1619

Clean up channels during unregistration if necessary.
tags/v2.7.0-rc1
Shivaram Lingamneni 3 years ago
parent
commit
3cca1e2c39
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      irc/channelmanager.go

+ 7
- 0
irc/channelmanager.go View File

176
 		return
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
 	if afterJoin {
183
 	if afterJoin {
180
 		entry.pendingJoins -= 1
184
 		entry.pendingJoins -= 1
181
 	}
185
 	}
288
 			entry.skeleton = skel
292
 			entry.skeleton = skel
289
 			cm.chans[cfname] = entry
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
 	return nil
299
 	return nil
293
 }
300
 }

Loading…
Cancel
Save