@@ -54,28 +54,35 @@ def doJoin(self, irc, msg):
54
54
fallthrough = self .registryValue ('fallthrough' , channel )
55
55
def do (type ):
56
56
cap = ircdb .makeChannelCapability (channel , type )
57
+ cap_auto = ircdb .makeChannelCapability (channel , 'auto' + type )
57
58
try :
58
- if ircdb .checkCapability (msg .prefix , cap ,
59
- ignoreOwner = not self .registryValue ('owner' )):
60
- if self .registryValue (type , channel ):
61
- self .log .info ('Scheduling auto-%s of %s in %s.' ,
62
- type , msg .prefix , channel )
63
- def dismiss ():
64
- """Determines whether or not a mode has already
65
- been applied."""
66
- l = getattr (irc .state .channels [channel ], type + 's' )
67
- return (msg .nick in l )
68
- msgmaker = getattr (ircmsgs , type )
69
- schedule_msg (msgmaker (channel , msg .nick ),
70
- dismiss )
71
- raise Continue # Even if fallthrough, let's only do one.
72
- elif not fallthrough :
73
- self .log .debug ('%s has %s, but supybot.plugins.AutoMode.%s'
74
- ' is not enabled in %s, refusing to fall '
75
- 'through.' , msg .prefix , cap , type , channel )
76
- raise Continue
59
+ apply_mode = ircdb .checkCapability (msg .prefix , cap ,
60
+ ignoreOwner = not self .registryValue ('owner' ))
77
61
except KeyError :
78
- pass
62
+ apply_mode = False
63
+ try :
64
+ override = ircdb .checkCapability (msg .prefix , cap_auto ,
65
+ ignoreOwner = not self .registryValue ('owner' ))
66
+ except KeyError :
67
+ override = False
68
+ if apply_mode or override :
69
+ if override or self .registryValue (type , channel ):
70
+ self .log .info ('Scheduling auto-%s of %s in %s.' ,
71
+ type , msg .prefix , channel )
72
+ def dismiss ():
73
+ """Determines whether or not a mode has already
74
+ been applied."""
75
+ l = getattr (irc .state .channels [channel ], type + 's' )
76
+ return (msg .nick in l )
77
+ msgmaker = getattr (ircmsgs , type )
78
+ schedule_msg (msgmaker (channel , msg .nick ),
79
+ dismiss )
80
+ raise Continue # Even if fallthrough, let's only do one.
81
+ elif not fallthrough :
82
+ self .log .debug ('%s has %s, but supybot.plugins.AutoMode.%s'
83
+ ' is not enabled in %s, refusing to fall '
84
+ 'through.' , msg .prefix , cap , type , channel )
85
+ raise Continue
79
86
def schedule_msg (msg , dismiss ):
80
87
def f ():
81
88
if not dismiss ():
0 commit comments