mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-24 03:29:28 +01:00
fantasy, relay: migrate to irc.is_*
This commit is contained in:
parent
d79f1766b6
commit
ff8587736f
@ -12,7 +12,7 @@ def handle_fantasy(irc, source, command, args):
|
|||||||
channel = args['target']
|
channel = args['target']
|
||||||
orig_text = args['text']
|
orig_text = args['text']
|
||||||
|
|
||||||
if utils.isChannel(channel) and not irc.is_internal_client(source):
|
if irc.is_channel(channel) and not irc.is_internal_client(source):
|
||||||
# The following conditions must be met for an incoming message for
|
# The following conditions must be met for an incoming message for
|
||||||
# fantasy to trigger:
|
# fantasy to trigger:
|
||||||
# 1) The message target is a channel.
|
# 1) The message target is a channel.
|
||||||
|
@ -1216,7 +1216,7 @@ def handle_messages(irc, numeric, command, args):
|
|||||||
else:
|
else:
|
||||||
target = '#' + target
|
target = '#' + target
|
||||||
|
|
||||||
if utils.isChannel(target):
|
if irc.is_channel(target):
|
||||||
def _handle_messages_loop(irc, remoteirc, numeric, command, args, notice, target, text):
|
def _handle_messages_loop(irc, remoteirc, numeric, command, args, notice, target, text):
|
||||||
real_target = get_remote_channel(irc, remoteirc, target)
|
real_target = get_remote_channel(irc, remoteirc, target)
|
||||||
|
|
||||||
@ -1472,7 +1472,7 @@ def handle_mode(irc, numeric, command, args):
|
|||||||
target = args['target']
|
target = args['target']
|
||||||
modes = args['modes']
|
modes = args['modes']
|
||||||
|
|
||||||
if utils.isChannel(target):
|
if irc.is_channel(target):
|
||||||
# Use the old state of the channel to check for CLAIM access.
|
# Use the old state of the channel to check for CLAIM access.
|
||||||
oldchan = args.get('channeldata')
|
oldchan = args.get('channeldata')
|
||||||
|
|
||||||
@ -1789,7 +1789,7 @@ def create(irc, source, args):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
irc.error("Not enough arguments. Needs 1: channel.")
|
irc.error("Not enough arguments. Needs 1: channel.")
|
||||||
return
|
return
|
||||||
if not utils.isChannel(channel):
|
if not irc.is_channel(channel):
|
||||||
irc.error('Invalid channel %r.' % channel)
|
irc.error('Invalid channel %r.' % channel)
|
||||||
return
|
return
|
||||||
if not irc.has_cap('can-host-relay'):
|
if not irc.has_cap('can-host-relay'):
|
||||||
@ -1842,7 +1842,7 @@ def destroy(irc, source, args):
|
|||||||
irc.error("Not enough arguments. Needs 1-2: channel, network (optional).")
|
irc.error("Not enough arguments. Needs 1-2: channel, network (optional).")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not utils.isChannel(channel):
|
if not irc.is_channel(channel):
|
||||||
irc.error('Invalid channel %r.' % channel)
|
irc.error('Invalid channel %r.' % channel)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -1918,7 +1918,7 @@ def link(irc, source, args):
|
|||||||
remotenet = args.remotenet
|
remotenet = args.remotenet
|
||||||
|
|
||||||
for c in (channel, localchan):
|
for c in (channel, localchan):
|
||||||
if not utils.isChannel(c):
|
if not irc.is_channel(c):
|
||||||
irc.error('Invalid channel %r.' % c)
|
irc.error('Invalid channel %r.' % c)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -2021,7 +2021,7 @@ def delink(irc, source, args):
|
|||||||
|
|
||||||
permissions.check_permissions(irc, source, ['relay.delink'])
|
permissions.check_permissions(irc, source, ['relay.delink'])
|
||||||
|
|
||||||
if not utils.isChannel(channel):
|
if not irc.is_channel(channel):
|
||||||
irc.error('Invalid channel %r.' % channel)
|
irc.error('Invalid channel %r.' % channel)
|
||||||
return
|
return
|
||||||
entry = get_relay(irc, channel)
|
entry = get_relay(irc, channel)
|
||||||
@ -2145,7 +2145,7 @@ def linkacl(irc, source, args):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
irc.error(missingargs)
|
irc.error(missingargs)
|
||||||
return
|
return
|
||||||
if not utils.isChannel(channel):
|
if not irc.is_channel(channel):
|
||||||
irc.error('Invalid channel %r.' % channel)
|
irc.error('Invalid channel %r.' % channel)
|
||||||
return
|
return
|
||||||
relay = get_relay(irc, channel)
|
relay = get_relay(irc, channel)
|
||||||
|
Loading…
Reference in New Issue
Block a user