diff --git a/coremods/service_support.py b/coremods/service_support.py index 30516bc..c352283 100644 --- a/coremods/service_support.py +++ b/coremods/service_support.py @@ -58,7 +58,7 @@ def spawn_service(irc, source, command, args): userobj = irc.spawn_client(nick, ident, host, modes=modes, opertype="PyLink Service", manipulatable=sbot.manipulatable) - # Store the service name in the IrcUser object for easier access. + # Store the service name in the User object for easier access. userobj.service = name sbot.uids[irc.name] = u = userobj.uid diff --git a/plugins/example.py b/plugins/example.py index b994db0..2709e6b 100644 --- a/plugins/example.py +++ b/plugins/example.py @@ -18,7 +18,7 @@ def hook_privmsg(irc, source, command, args): channel = args['target'] text = args['text'] - # irc.pseudoclient stores the IrcUser object of the main PyLink client. + # irc.pseudoclient stores the User object of the main PyLink client. # (i.e. the user defined in the bot: section of the config) if utils.isChannel(channel) and irc.pseudoclient.nick in text: irc.msg(channel, 'hi there!') diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 9af5cb9..a3cf8d2 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -4,7 +4,7 @@ import base64 from pylinkirc import utils, conf from pylinkirc.log import log -from pylinkirc.classes import Protocol, IrcUser, IrcServer, ProtocolError +from pylinkirc.classes import Protocol, User, IrcServer, ProtocolError FALLBACK_REALNAME = 'PyLink Relay Mirror Client' COMMON_PREFIXMODES = [('h', 'halfop'), ('a', 'admin'), ('q', 'owner'), ('y', 'owner')] @@ -109,7 +109,7 @@ class ClientbotWrapperProtocol(IRCCommonProtocol): ts = ts or int(time.time()) log.debug('(%s) spawn_client stub called, saving nick %s as PUID %s', self.name, nick, uid) - u = self.users[uid] = IrcUser(nick, ts, uid, server, ident=ident, host=host, realname=realname, + u = self.users[uid] = User(nick, ts, uid, server, ident=ident, host=host, realname=realname, manipulatable=manipulatable, realhost=realhost, ip=ip) self.servers[server].users.add(uid) diff --git a/protocols/hybrid.py b/protocols/hybrid.py index 2480b63..d2c5fdb 100644 --- a/protocols/hybrid.py +++ b/protocols/hybrid.py @@ -105,7 +105,7 @@ class HybridProtocol(TS6Protocol): realname = realname or conf.conf['bot']['realname'] realhost = realhost or host raw_modes = self.join_modes(modes) - u = self.users[uid] = IrcUser(nick, ts, uid, server, ident=ident, host=host, realname=realname, + u = self.users[uid] = User(nick, ts, uid, server, ident=ident, host=host, realname=realname, realhost=realhost, ip=ip, manipulatable=manipulatable) self.apply_modes(uid, modes) self.servers[server].users.add(uid) @@ -177,7 +177,7 @@ class HybridProtocol(TS6Protocol): 'host=%s realname=%s ip=%s', self.name, nick, ts, uid, ident, host, realname, ip) - self.users[uid] = IrcUser(nick, ts, uid, numeric, ident, host, realname, host, ip) + self.users[uid] = User(nick, ts, uid, numeric, ident, host, realname, host, ip) parsedmodes = self.parse_modes(uid, [modes]) log.debug('(%s) handle_uid: Applying modes %s for %s', self.name, parsedmodes, uid) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 11a5a1b..c391bfe 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -53,7 +53,7 @@ class InspIRCdProtocol(TS6BaseProtocol): realname = realname or conf.conf['bot']['realname'] realhost = realhost or host raw_modes = self.join_modes(modes) - u = self.users[uid] = IrcUser(nick, ts, uid, server, ident=ident, host=host, realname=realname, + u = self.users[uid] = User(nick, ts, uid, server, ident=ident, host=host, realname=realname, realhost=realhost, ip=ip, manipulatable=manipulatable, opertype=opertype) self.apply_modes(uid, modes) @@ -163,7 +163,7 @@ class InspIRCdProtocol(TS6BaseProtocol): recognize ANY non-burst oper ups. Plugins don't have to call this function themselves, but they can - set the opertype attribute of an IrcUser object (in self.users), + set the opertype attribute of an User object (in self.users), and the change will be reflected here.""" userobj = self.users[target] try: @@ -577,7 +577,7 @@ class InspIRCdProtocol(TS6BaseProtocol): uid, ts, nick, realhost, host, ident, ip = args[0:7] self.check_nick_collision(nick) realname = args[-1] - self.users[uid] = userobj = IrcUser(nick, ts, uid, numeric, ident, host, realname, realhost, ip) + self.users[uid] = userobj = User(nick, ts, uid, numeric, ident, host, realname, realhost, ip) parsedmodes = self.parse_modes(uid, [args[8], args[9]]) self.apply_modes(uid, parsedmodes) diff --git a/protocols/p10.py b/protocols/p10.py index 018dfc1..a25d271 100644 --- a/protocols/p10.py +++ b/protocols/p10.py @@ -275,10 +275,9 @@ class P10Protocol(IRCS2SProtocol): realhost = realhost or host raw_modes = self.join_modes(modes) - # Initialize an IrcUser instance - u = self.users[uid] = IrcUser(nick, ts, uid, server, ident=ident, host=host, realname=realname, - realhost=realhost, ip=ip, manipulatable=manipulatable, - opertype=opertype) + # Initialize an User instance + u = self.users[uid] = User(nick, ts, uid, server, ident=ident, host=host, realname=realname, + realhost=realhost, ip=ip, manipulatable=manipulatable, opertype=opertype) # Fill in modes and add it to our users index self.apply_modes(uid, modes) @@ -856,7 +855,7 @@ class P10Protocol(IRCS2SProtocol): 'host=%s realname=%s realhost=%s ip=%s', self.name, nick, ts, uid, ident, host, realname, realhost, ip) - uobj = self.users[uid] = IrcUser(nick, ts, uid, source, ident, host, realname, realhost, ip) + uobj = self.users[uid] = User(nick, ts, uid, source, ident, host, realname, realhost, ip) self.servers[source].users.add(uid) # https://github.com/evilnet/nefarious2/blob/master/doc/p10.txt#L708 diff --git a/protocols/ratbox.py b/protocols/ratbox.py index 9377d5c..472affd 100644 --- a/protocols/ratbox.py +++ b/protocols/ratbox.py @@ -66,7 +66,7 @@ class RatboxProtocol(TS6Protocol): orig_realhost = realhost realhost = realhost or host - u = self.users[uid] = IrcUser(nick, ts, uid, server, ident=ident, host=host, realname=realname, + u = self.users[uid] = User(nick, ts, uid, server, ident=ident, host=host, realname=realname, realhost=realhost, ip=ip, manipulatable=manipulatable) self.apply_modes(uid, modes) self.servers[server].users.add(uid) diff --git a/protocols/ts6.py b/protocols/ts6.py index b58ee9b..fdc3339 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -50,7 +50,7 @@ class TS6Protocol(TS6BaseProtocol): realname = realname or conf.conf['bot']['realname'] realhost = realhost or host raw_modes = self.join_modes(modes) - u = self.users[uid] = IrcUser(nick, ts, uid, server, ident=ident, host=host, realname=realname, + u = self.users[uid] = User(nick, ts, uid, server, ident=ident, host=host, realname=realname, realhost=realhost, ip=ip, manipulatable=manipulatable, opertype=opertype) self.apply_modes(uid, modes) @@ -512,7 +512,7 @@ class TS6Protocol(TS6BaseProtocol): if ip == '0': # IP was invalid; something used for services. ip = '0.0.0.0' - self.users[uid] = IrcUser(nick, ts, uid, numeric, ident, host, realname, realhost, ip) + self.users[uid] = User(nick, ts, uid, numeric, ident, host, realname, realhost, ip) parsedmodes = self.parse_modes(uid, [modes]) log.debug('Applying modes %s for %s', parsedmodes, uid) diff --git a/protocols/unreal.py b/protocols/unreal.py index 4cc3834..28b248e 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -82,7 +82,7 @@ class UnrealProtocol(TS6BaseProtocol): modes |= {('+x', None), ('+t', None)} raw_modes = self.join_modes(modes) - u = self.users[uid] = IrcUser(nick, ts, uid, server, ident=ident, host=host, realname=realname, + u = self.users[uid] = User(nick, ts, uid, server, ident=ident, host=host, realname=realname, realhost=realhost, ip=ip, manipulatable=manipulatable, opertype=opertype) self.apply_modes(uid, modes) self.servers[server].users.add(uid) @@ -418,7 +418,7 @@ class UnrealProtocol(TS6BaseProtocol): realname = args[-1] - self.users[uid] = IrcUser(nick, ts, uid, numeric, ident, host, realname, realhost, ip) + self.users[uid] = User(nick, ts, uid, numeric, ident, host, realname, realhost, ip) self.servers[numeric].users.add(uid) # Handle user modes