mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-04 08:59:23 +01:00
Merge remote-tracking branch 'supybot/master' into testing
This commit is contained in:
commit
74b98f5c2a
@ -402,6 +402,15 @@ class IrcState(IrcCommandDispatcher):
|
|||||||
"""Returns the hostmask for a given nick."""
|
"""Returns the hostmask for a given nick."""
|
||||||
return self.nicksToHostmasks[nick]
|
return self.nicksToHostmasks[nick]
|
||||||
|
|
||||||
|
def do004(self, irc, msg):
|
||||||
|
"""Handles parsing the 004 reply
|
||||||
|
|
||||||
|
Supported user and channel modes are cached"""
|
||||||
|
# msg.args = [nick, server, ircd-version, umodes, modes,
|
||||||
|
# modes that require arguments? (non-standard)]
|
||||||
|
self.supported['umodes'] = msg.args[3]
|
||||||
|
self.supported['chanmodes'] = msg.args[4]
|
||||||
|
|
||||||
_005converters = utils.InsensitivePreservingDict({
|
_005converters = utils.InsensitivePreservingDict({
|
||||||
'modes': int,
|
'modes': int,
|
||||||
'keylen': int,
|
'keylen': int,
|
||||||
@ -956,9 +965,14 @@ class Irc(IrcCommandDispatcher):
|
|||||||
# Let's reset nicks in case we had to use a weird one.
|
# Let's reset nicks in case we had to use a weird one.
|
||||||
self.alternateNicks = conf.supybot.nick.alternates()[:]
|
self.alternateNicks = conf.supybot.nick.alternates()[:]
|
||||||
umodes = conf.supybot.protocols.irc.umodes()
|
umodes = conf.supybot.protocols.irc.umodes()
|
||||||
|
supported = self.supported.get('umodes')
|
||||||
if umodes:
|
if umodes:
|
||||||
if umodes[0] not in '+-':
|
addSub = '+'
|
||||||
umodes = '+' + umodes
|
if umodes[0] in '+-':
|
||||||
|
(addSub, umodes) = (umodes[0], umodes[1:])
|
||||||
|
if supported:
|
||||||
|
umodes = filter(lamda m: m in supported, umodes)
|
||||||
|
umodes = ''.join(addSub, umodes)
|
||||||
log.info('Sending user modes to %s: %s', self.network, umodes)
|
log.info('Sending user modes to %s: %s', self.network, umodes)
|
||||||
self.sendMsg(ircmsgs.mode(self.nick, umodes))
|
self.sendMsg(ircmsgs.mode(self.nick, umodes))
|
||||||
do377 = do422 = do376
|
do377 = do422 = do376
|
||||||
|
Loading…
Reference in New Issue
Block a user