only try SASL on CAP NEW when one of the new CAPs is SASL
This commit is contained in:
parent
61f1cdba9d
commit
1b3c537e0a
1 changed files with 6 additions and 3 deletions
|
@ -68,7 +68,7 @@ class Server(IServer):
|
||||||
elif emit.subcommand in ["ACK", "NAK"]:
|
elif emit.subcommand in ["ACK", "NAK"]:
|
||||||
await self._cap_ack(emit)
|
await self._cap_ack(emit)
|
||||||
elif emit.subcommand == "NEW":
|
elif emit.subcommand == "NEW":
|
||||||
await self._cap_new()
|
await self._cap_new(emit)
|
||||||
|
|
||||||
async def _on_read_line(self, line: Line):
|
async def _on_read_line(self, line: Line):
|
||||||
for i, (response, future) in enumerate(self._wait_for):
|
for i, (response, future) in enumerate(self._wait_for):
|
||||||
|
@ -137,8 +137,11 @@ class Server(IServer):
|
||||||
if not self._requested_caps:
|
if not self._requested_caps:
|
||||||
await self.send(build("CAP", ["END"]))
|
await self.send(build("CAP", ["END"]))
|
||||||
|
|
||||||
async def _cap_new(self):
|
async def _cap_new(self, emit: Emit):
|
||||||
await self._maybe_sasl()
|
if not emit.tokens is None:
|
||||||
|
tokens = [t.split("=", 1)[0] for t in emit.tokens]
|
||||||
|
if CAP_SASL.available(tokens):
|
||||||
|
await self._maybe_sasl()
|
||||||
|
|
||||||
async def _maybe_sasl(self) -> bool:
|
async def _maybe_sasl(self) -> bool:
|
||||||
if (self.sasl_state == SASLResult.NONE and
|
if (self.sasl_state == SASLResult.NONE and
|
||||||
|
|
Loading…
Reference in a new issue