3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

coremods, plugins: migrate to snake case for protocol communication

This commit is contained in:
James Lu 2017-06-30 21:30:20 -07:00
parent 927fa9aac9
commit 61ed209abb
5 changed files with 10 additions and 10 deletions

View File

@ -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.spawnClient(nick, ident, host, modes=modes, opertype="PyLink Service",
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.

View File

@ -18,7 +18,7 @@ def spawnclient(irc, source, args):
except ValueError:
irc.error("Not enough arguments. Needs 3: nick, user, host.")
return
irc.spawnClient(nick, ident, host, manipulatable=True)
irc.spawn_client(nick, ident, host, manipulatable=True)
irc.reply("Done.")
@utils.add_cmd

View File

@ -78,7 +78,7 @@ def _changehost(irc, target, args):
if char not in allowed_chars:
new_host = new_host.replace(char, '-')
irc.updateClient(target, 'HOST', new_host)
irc.update_client(target, 'HOST', new_host)
# Only operate on the first match.
break

View File

@ -70,7 +70,7 @@ def jupe(irc, source, args):
irc.error("Invalid server name '%s'." % servername)
return
sid = irc.spawnServer(servername, desc=desc)
sid = irc.spawn_server(servername, desc=desc)
irc.call_hooks([irc.pseudoclient.uid, 'OPERCMDS_SPAWNSERVER',
{'name': servername, 'sid': sid, 'text': desc}])

View File

@ -219,7 +219,7 @@ def spawn_relay_server(irc, remoteirc):
suffix = conf.conf.get('relay', {}).get('server_suffix', 'relay')
# Strip any leading or trailing .'s
suffix = suffix.strip('.')
sid = irc.spawnServer('%s.%s' % (remoteirc.name, suffix),
sid = irc.spawn_server('%s.%s' % (remoteirc.name, suffix),
desc="PyLink Relay network - %s" %
(remoteirc.get_full_network_name()), endburst_delay=3)
except (RuntimeError, ValueError): # Network not initialized yet, or a server name conflict.
@ -326,7 +326,7 @@ def spawn_relay_user(irc, remoteirc, user, times_tagged=0):
realhost = None
ip = '0.0.0.0'
u = remoteirc.spawnClient(nick, ident=ident, host=host, realname=realname, modes=modes,
u = remoteirc.spawn_client(nick, ident=ident, host=host, realname=realname, modes=modes,
opertype=opertype, server=rsid, ip=ip, realhost=realhost).uid
try:
remoteirc.users[u].remote = (irc.name, user)
@ -477,7 +477,7 @@ def initialize_channel(irc, channel):
# Only update the topic if it's different from what we already have,
# and topic bursting is complete.
if remoteirc.channels[remotechan].topicset and topic != irc.channels[channel].topic:
irc.topicBurst(irc.sid, channel, topic)
irc.topic_burst(irc.sid, channel, topic)
# Send our users and channel modes to the other nets
relay_joins(irc, channel, irc.channels[channel].users, irc.channels[channel].ts)
@ -1291,7 +1291,7 @@ def handle_chgclient(irc, source, command, args):
newtext = normalize_host(remoteirc, text)
else: # Don't overwrite the original text variable on every iteration.
newtext = text
remoteirc.updateClient(user, field, newtext)
remoteirc.update_client(user, field, newtext)
except NotImplementedError: # IRCd doesn't support changing the field we want
log.debug('(%s) relay.handle_chgclient: Ignoring changing field %r of %s on %s (for %s/%s);'
' remote IRCd doesn\'t support it', irc.name, field,
@ -1372,9 +1372,9 @@ def handle_topic(irc, numeric, command, args):
remoteirc.topic(remoteuser, remotechan, topic)
else:
rsid = get_remote_sid(remoteirc, irc)
remoteirc.topicBurst(rsid, remotechan, topic)
remoteirc.topic_burst(rsid, remotechan, topic)
elif oldtopic: # Topic change blocked by claim.
irc.topicBurst(irc.sid, channel, oldtopic)
irc.topic_burst(irc.sid, channel, oldtopic)
utils.add_hook(handle_topic, 'TOPIC')