3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +01:00

pr/insp: remove checks for valid nick/channel; they're done in plugins now

This commit is contained in:
James Lu 2015-07-08 23:00:50 -07:00
parent edfcacfdd1
commit f01269287e

View File

@ -57,8 +57,6 @@ def joinClient(irc, client, channel):
server = utils.isInternalClient(irc, client) server = utils.isInternalClient(irc, client)
if not server: if not server:
raise LookupError('No such PyLink PseudoClient exists.') raise LookupError('No such PyLink PseudoClient exists.')
if not utils.isChannel(channel):
raise ValueError('Invalid channel name %r.' % channel)
# One channel per line here! # One channel per line here!
_sendFromServer(irc, server, "FJOIN {channel} {ts} {modes} :,{uid}".format( _sendFromServer(irc, server, "FJOIN {channel} {ts} {modes} :,{uid}".format(
ts=irc.channels[channel].ts, uid=client, channel=channel, ts=irc.channels[channel].ts, uid=client, channel=channel,
@ -70,8 +68,6 @@ def partClient(irc, client, channel, reason=None):
if not utils.isInternalClient(irc, client): if not utils.isInternalClient(irc, client):
raise LookupError('No such PyLink PseudoClient exists.') raise LookupError('No such PyLink PseudoClient exists.')
msg = "PART %s" % channel msg = "PART %s" % channel
if not utils.isChannel(channel):
raise ValueError('Invalid channel name %r.' % channel)
if reason: if reason:
msg += " :%s" % reason msg += " :%s" % reason
_sendFromUser(irc, client, msg) _sendFromUser(irc, client, msg)
@ -123,10 +119,6 @@ def nickClient(irc, numeric, newnick):
Changes the nick of a PyLink PseudoClient.""" Changes the nick of a PyLink PseudoClient."""
if not utils.isInternalClient(irc, numeric): if not utils.isInternalClient(irc, numeric):
raise LookupError('No such PyLink PseudoClient exists.') raise LookupError('No such PyLink PseudoClient exists.')
if newnick == '0':
newnick = numeric
elif not utils.isNick(newnick):
raise ValueError('Invalid nickname %r.' % newnick)
_sendFromUser(irc, numeric, 'NICK %s %s' % (newnick, int(time.time()))) _sendFromUser(irc, numeric, 'NICK %s %s' % (newnick, int(time.time())))
irc.users[numeric].nick = newnick irc.users[numeric].nick = newnick