3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

unreal: don't confuse legacy SERVER introductions from our uplink with protocol negotiation

Reported by Rascle on IRC.
This commit is contained in:
James Lu 2016-04-01 19:08:25 -07:00
parent fab404f8d6
commit efcc30c983

View File

@ -403,7 +403,7 @@ class UnrealProtocol(TS6BaseProtocol):
introducing legacy (non-SID) servers."""
# <- SERVER unreal.midnight.vpn 1 :U3999-Fhin6OoEM UnrealIRCd test server
sname = args[0]
if numeric == self.irc.uplink: # We're doing authentication
if numeric == self.irc.uplink and not irc.connected.is_set(): # We're doing authentication
for cap in self._neededCaps:
if cap not in self.caps:
raise ProtocolError("Not all required capabilities were met "
@ -425,6 +425,10 @@ class UnrealProtocol(TS6BaseProtocol):
raise ProtocolError("Protocol version too old! (needs at least %s "
"(Unreal 4.0.0-rc1), got %s)" % (self.min_proto_ver, protover))
self.irc.servers[numeric] = IrcServer(None, sname)
# Set irc.connected to True, meaning that protocol negotiation passed.
log.debug('(%s) self.irc.connected set!', self.irc.name)
self.irc.connected.set()
else:
# Legacy (non-SID) servers can still be introduced using the SERVER command.
# <- :services.int SERVER a.bc 2 :(H) [GL] a
@ -477,10 +481,6 @@ class UnrealProtocol(TS6BaseProtocol):
self.irc.cmodes.update({'halfop': 'h', 'admin': 'a', 'owner': 'q',
'op': 'o', 'voice': 'v'})
# Set irc.connected to True, meaning that protocol negotiation passed.
log.debug('(%s) self.irc.connected set!', self.irc.name)
self.irc.connected.set()
def handle_privmsg(self, source, command, args):
# Convert nicks to UIDs, where they exist.
target = self._getNick(args[0])