added input.mask. returns 'user@host'
This commit is contained in:
parent
0c3e78bdce
commit
3e5c2c94d9
3 changed files with 7 additions and 5 deletions
|
@ -163,6 +163,7 @@ class IRC(object):
|
|||
else:
|
||||
prefix, command, params = irc_noprefix_rem(msg).groups()
|
||||
nick, user, host = irc_netmask_rem(prefix).groups()
|
||||
mask = user + "@" + host
|
||||
paramlist = irc_param_ref(params)
|
||||
lastparam = ""
|
||||
if paramlist:
|
||||
|
@ -170,7 +171,7 @@ class IRC(object):
|
|||
paramlist[-1] = paramlist[-1][1:]
|
||||
lastparam = paramlist[-1]
|
||||
self.out.put([msg, prefix, command, params, nick, user, host,
|
||||
paramlist, lastparam])
|
||||
mask, paramlist, lastparam])
|
||||
if command == "PING":
|
||||
self.cmd("PONG", paramlist)
|
||||
|
||||
|
@ -225,6 +226,7 @@ class FakeIRC(IRC):
|
|||
else:
|
||||
prefix, command, params = irc_noprefix_rem(msg).groups()
|
||||
nick, user, host = irc_netmask_rem(prefix).groups()
|
||||
mask = user + "@" + host
|
||||
paramlist = irc_param_ref(params)
|
||||
lastparam = ""
|
||||
if paramlist:
|
||||
|
@ -232,7 +234,7 @@ class FakeIRC(IRC):
|
|||
paramlist[-1] = paramlist[-1][1:]
|
||||
lastparam = paramlist[-1]
|
||||
self.out.put([msg, prefix, command, params, nick, user, host,
|
||||
paramlist, lastparam])
|
||||
mask, paramlist, lastparam])
|
||||
if command == "PING":
|
||||
self.cmd("PONG", [params])
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ thread.stack_size(1024 * 512) # reduce vm size
|
|||
|
||||
class Input(dict):
|
||||
def __init__(self, conn, raw, prefix, command, params,
|
||||
nick, user, host, paraml, msg):
|
||||
nick, user, host, mask, paraml, msg):
|
||||
|
||||
chan = paraml[0].lower()
|
||||
if chan == conn.nick.lower(): # is a PM
|
||||
|
@ -35,7 +35,7 @@ class Input(dict):
|
|||
conn.cmd('NOTICE', [nick, msg])
|
||||
|
||||
dict.__init__(self, conn=conn, raw=raw, prefix=prefix, command=command,
|
||||
params=params, nick=nick, user=user, host=host,
|
||||
params=params, nick=nick, user=user, host=host, mask=mask,
|
||||
paraml=paraml, msg=msg, server=conn.server, chan=chan,
|
||||
notice=notice, say=say, reply=reply, pm=pm, bot=bot,
|
||||
me=me, set_nick=set_nick, lastparam=paraml[-1])
|
||||
|
|
Reference in a new issue