mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 13:09:23 +01:00
core: move clearing channels on kick/part to coremods/handlers
This is for consistency with the rest of the state cleanup code.
This commit is contained in:
parent
16faac83eb
commit
c7159b9cad
@ -181,6 +181,12 @@ def _state_cleanup_core(irc, source, channel):
|
|||||||
irc.name, source, irc.users[source].nick)
|
irc.name, source, irc.users[source].nick)
|
||||||
irc._remove_client(source)
|
irc._remove_client(source)
|
||||||
|
|
||||||
|
# Clear empty non-permanent channels.
|
||||||
|
if channel in irc.channels and not (irc._channels[channel].users or ((irc.cmodes.get('permanent'), None) \
|
||||||
|
in irc._channels[channel].modes)):
|
||||||
|
log.debug('(%s) state_cleanup: removing empty channel %s', irc.name, channel)
|
||||||
|
del irc._channels[channel]
|
||||||
|
|
||||||
def _state_cleanup_part(irc, source, command, args):
|
def _state_cleanup_part(irc, source, command, args):
|
||||||
for channel in args['channels']:
|
for channel in args['channels']:
|
||||||
_state_cleanup_core(irc, source, channel)
|
_state_cleanup_core(irc, source, channel)
|
||||||
|
@ -653,10 +653,6 @@ class IRCS2SProtocol(IRCCommonProtocol):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
reason = ''
|
reason = ''
|
||||||
|
|
||||||
# Clear empty non-permanent channels.
|
|
||||||
if not (self._channels[channel].users or ((self.cmodes.get('permanent'), None) in self._channels[channel].modes)):
|
|
||||||
del self._channels[channel]
|
|
||||||
|
|
||||||
if channels:
|
if channels:
|
||||||
return {'channels': channels, 'text': reason}
|
return {'channels': channels, 'text': reason}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user