Removing empty channels.

Removing empty channels when the channel becomes vacated.
This commit is contained in:
claudemiro
2015-01-16 13:17:22 -03:00
parent 0d4e9742b9
commit a51629f7b5
3 changed files with 29 additions and 3 deletions
+4 -1
View File
@@ -176,9 +176,12 @@ func (c *Channel) Unsubscribe(a *App, conn *Connection) error {
a.TriggerMemberRemovedHook(c, subscription)
}
// WebHook
if !c.IsOccupied() {
// WebHook
a.TriggerChannelVacatedHook(c)
// Remove the empty Channel
a.RemoveChannel(c)
}
return nil