mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +01:00
Added RFE #871165, doInvite for Admin.
This commit is contained in:
parent
8d6956f4ae
commit
85e0783cb9
18
src/Admin.py
18
src/Admin.py
@ -66,7 +66,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
del self.joins[channel]
|
del self.joins[channel]
|
||||||
irc.error(msg, 'Cannot join %s, it\'s full.' % channel)
|
irc.error(msg, 'Cannot join %s, it\'s full.' % channel)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.log.warning('Got 471 without Admin.join being called.')
|
self.log.debug('Got 471 without Admin.join being called.')
|
||||||
|
|
||||||
def do473(self, irc, msg):
|
def do473(self, irc, msg):
|
||||||
try:
|
try:
|
||||||
@ -75,7 +75,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
del self.joins[channel]
|
del self.joins[channel]
|
||||||
irc.error(msg, 'Cannot join %s, I was not invited.' % channel)
|
irc.error(msg, 'Cannot join %s, I was not invited.' % channel)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.log.warning('Got 473 without Admin.join being called.')
|
self.log.debug('Got 473 without Admin.join being called.')
|
||||||
|
|
||||||
def do474(self, irc, msg):
|
def do474(self, irc, msg):
|
||||||
try:
|
try:
|
||||||
@ -84,7 +84,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
del self.joins[channel]
|
del self.joins[channel]
|
||||||
irc.error(msg, 'Cannot join %s, it\'s banned me.' % channel)
|
irc.error(msg, 'Cannot join %s, it\'s banned me.' % channel)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.log.warning('Got 474 without Admin.join being called.')
|
self.log.debug('Got 474 without Admin.join being called.')
|
||||||
|
|
||||||
def do475(self, irc, msg):
|
def do475(self, irc, msg):
|
||||||
try:
|
try:
|
||||||
@ -93,7 +93,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
del self.joins[channel]
|
del self.joins[channel]
|
||||||
irc.error(msg, 'Cannot join %s, my keyword was wrong.' % channel)
|
irc.error(msg, 'Cannot join %s, my keyword was wrong.' % channel)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.log.warning('Got 475 without Admin.join being called.')
|
self.log.debug('Got 475 without Admin.join being called.')
|
||||||
|
|
||||||
def doJoin(self, irc, msg):
|
def doJoin(self, irc, msg):
|
||||||
if msg.prefix == irc.prefix:
|
if msg.prefix == irc.prefix:
|
||||||
@ -101,7 +101,15 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
del self.joins[msg.args[0]]
|
del self.joins[msg.args[0]]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
s = 'Joined a channel without Admin.join being called'
|
s = 'Joined a channel without Admin.join being called'
|
||||||
self.log.warning(s)
|
self.log.debug(s)
|
||||||
|
|
||||||
|
def doInvite(self, irc, msg):
|
||||||
|
if msg.args[1] not in irc.state.channels:
|
||||||
|
if conf.alwaysJoinOnInvite:
|
||||||
|
irc.queueMsg(ircmsgs.join(msg.args[1]))
|
||||||
|
else:
|
||||||
|
if ircdb.checkCapability(msg.prefix, 'admin'):
|
||||||
|
irc.queueMsg(ircmsgs.join(msg.args[1]))
|
||||||
|
|
||||||
def join(self, irc, msg, args):
|
def join(self, irc, msg, args):
|
||||||
"""<channel>[,<key>] [<channel>[,<key>] ...]
|
"""<channel>[,<key>] [<channel>[,<key>] ...]
|
||||||
|
@ -187,6 +187,14 @@ requireChannelCommandsToBeSentInChannel = False
|
|||||||
###
|
###
|
||||||
followIdentificationThroughNickChanges = False
|
followIdentificationThroughNickChanges = False
|
||||||
|
|
||||||
|
###
|
||||||
|
# alwaysJoinOnInvite: Causes the bot to always join a channel when it's
|
||||||
|
# invited. Defaults to False, in which case the bot will
|
||||||
|
# only join if the user inviting it has the 'admin'
|
||||||
|
# capability.
|
||||||
|
###
|
||||||
|
alwaysJoinOnInvite = False
|
||||||
|
|
||||||
###
|
###
|
||||||
# enablePipeSyntax: Supybot allows nested commands; generally, commands are
|
# enablePipeSyntax: Supybot allows nested commands; generally, commands are
|
||||||
# nested via [square brackets]. Supybot can also use a
|
# nested via [square brackets]. Supybot can also use a
|
||||||
|
Loading…
Reference in New Issue
Block a user