浏览代码

fix #1619

Clean up channels during unregistration if necessary.
tags/v2.7.0-rc1
Shivaram Lingamneni 3 年前
父节点
当前提交
3cca1e2c39
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7
    0
      irc/channelmanager.go

+ 7
- 0
irc/channelmanager.go 查看文件

@@ -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
 }

正在加载...
取消
保存