mirror of
https://github.com/jlu5/PyLink.git
synced 2025-10-15 07:57:21 +02:00
services_support: ignore invalid autojoin channels
Reported by @rvzm on IRC. Closes #308.
This commit is contained in:
parent
d855c6b2ea
commit
a9fe0499e6
@ -58,8 +58,11 @@ def spawn_service(irc, source, command, args):
|
|||||||
channels = set(irc.serverdata.get('channels', [])) | sbot.extra_channels.get(irc.name, set())
|
channels = set(irc.serverdata.get('channels', [])) | sbot.extra_channels.get(irc.name, set())
|
||||||
|
|
||||||
for chan in channels:
|
for chan in channels:
|
||||||
|
if utils.isChannel(chan):
|
||||||
irc.proto.join(u, chan)
|
irc.proto.join(u, chan)
|
||||||
irc.callHooks([irc.sid, 'PYLINK_SERVICE_JOIN', {'channel': chan, 'users': [u]}])
|
irc.callHooks([irc.sid, 'PYLINK_SERVICE_JOIN', {'channel': chan, 'users': [u]}])
|
||||||
|
else:
|
||||||
|
log.warning('(%s) Ignoring invalid autojoin channel %r.', irc.name, chan)
|
||||||
|
|
||||||
utils.add_hook(spawn_service, 'PYLINK_NEW_SERVICE')
|
utils.add_hook(spawn_service, 'PYLINK_NEW_SERVICE')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user