6 if e
.msg
[1] in ('PRIVMSG','NOTICE'):
7 address
= e
.network
.norm_case('%s!%s' % (e
.source
, e
.address
))
8 for mask
in conf
.get('ignore_masks',()):
9 if irc
.match_glob(address
, e
.network
.norm_case(mask
)):
12 def onCommandIgnore(e
):
13 if 'ignore_masks' not in conf
:
14 conf
['ignore_masks'] = []
16 for i
in conf
['ignore_masks']:
17 e
.window
.write('* %s' % i
)
18 elif 'c' in e
.switches
:
19 del conf
['ignore_masks']
20 e
.window
.write('* Cleared the ignore list.')
22 if '!' in e
.args
[0] or '*' in e
.args
[0] or '?' in e
.args
[0]:
25 mask
= '%s!*' % e
.args
[0]
27 if mask
in conf
['ignore_masks']:
28 conf
['ignore_masks'].remove(mask
)
29 e
.window
.write('* Removed %s from the ignore list' % e
.args
[0])
31 raise events
.CommandError("Couldn't find %s in the ignore list" % e
.args
[0])
33 if mask
in conf
['ignore_masks']:
34 e
.window
.write('* %s is already ignored' % e
.args
[0])
36 conf
['ignore_masks'].append(mask
)
37 e
.window
.write('* Ignoring messages from %s' % e
.args
[0])
41 /ignore \x02nick/mask\x02 to ignore a nickname or mask
42 /ignore -r \x02nick/mask\x02 to stop ignoring a nickname or mask
43 /ignore -l to view the ignore list
44 /ignore -c to clear the ignore list""")