From 748c1bc1589c53dbbc8d0e1414cc549028829311 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 25 Jun 2017 02:06:49 -0700 Subject: [PATCH] coremods: migrate irc.proto calls to irc --- coremods/handlers.py | 8 ++++---- coremods/service_support.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/coremods/handlers.py b/coremods/handlers.py index 2ff9208..539b198 100644 --- a/coremods/handlers.py +++ b/coremods/handlers.py @@ -11,7 +11,7 @@ def handle_whois(irc, source, command, args): target = args['target'] user = irc.users.get(target) - f = lambda num, source, text: irc.proto.numeric(irc.sid, num, source, text) + f = lambda num, source, text: irc.numeric(irc.sid, num, source, text) # Get the server that the target is on. server = irc.getServer(target) @@ -118,7 +118,7 @@ def handle_mode(irc, source, command, args): # client, revert any forced deoper attempts. if irc.isInternalClient(target) and not irc.isInternalClient(source): if ('-o', None) in modes and (target == irc.pseudoclient.uid or not irc.isManipulatableClient(target)): - irc.proto.mode(irc.sid, target, {('+o', None)}) + irc.mode(irc.sid, target, {('+o', None)}) utils.add_hook(handle_mode, 'MODE') def handle_operup(irc, source, command, args): @@ -143,11 +143,11 @@ def handle_version(irc, source, command, args): """Handles requests for the PyLink server version.""" # 351 syntax is usually ". : fullversion = irc.version() - irc.proto.numeric(irc.sid, 351, source, fullversion) + irc.numeric(irc.sid, 351, source, fullversion) utils.add_hook(handle_version, 'VERSION') def handle_time(irc, source, command, args): """Handles requests for the PyLink server time.""" timestring = time.ctime() - irc.proto.numeric(irc.sid, 391, source, '%s :%s' % (irc.hostname(), timestring)) + irc.numeric(irc.sid, 391, source, '%s :%s' % (irc.hostname(), timestring)) utils.add_hook(handle_time, 'TIME') diff --git a/coremods/service_support.py b/coremods/service_support.py index 248f195..62a8b03 100644 --- a/coremods/service_support.py +++ b/coremods/service_support.py @@ -14,7 +14,7 @@ def spawn_service(irc, source, command, args): # Service name name = args['name'] - if name != 'pylink' and not irc.proto.hasCap('can-spawn-clients'): + if name != 'pylink' and not irc.hasCap('can-spawn-clients'): log.debug("(%s) Not spawning service %s because the server doesn't support spawning clients", irc.name, name) return @@ -55,7 +55,7 @@ def spawn_service(irc, source, command, args): userobj = irc.users[u] else: log.debug('(%s) spawn_service: Spawning new client %s', irc.name, nick) - userobj = irc.proto.spawnClient(nick, ident, host, modes=modes, opertype="PyLink Service", + userobj = irc.spawnClient(nick, ident, host, modes=modes, opertype="PyLink Service", manipulatable=sbot.manipulatable) # Store the service name in the IrcUser object for easier access.