remove commented-out proof of concept auto-join stuff
This commit is contained in:
parent
5618028b7b
commit
47223c257c
1 changed files with 0 additions and 23 deletions
|
@ -5,29 +5,6 @@ from ircstates.numerics import *
|
||||||
from .contexts import ServerContext
|
from .contexts import ServerContext
|
||||||
from .matching import Response, ResponseOr, ParamAny, ParamFolded
|
from .matching import Response, ResponseOr, ParamAny, ParamFolded
|
||||||
|
|
||||||
"""
|
|
||||||
class JoinContext(ServerContext):
|
|
||||||
async def enlighten(self, channels: List[str]):
|
|
||||||
folded = [self.server.casefold(c) for c in channels]
|
|
||||||
waiting = len(folded)
|
|
||||||
while waiting:
|
|
||||||
line = await self.server.wait_for(ResponseOr(
|
|
||||||
Response("JOIN", [ParamAny()])
|
|
||||||
))
|
|
||||||
|
|
||||||
if (line.command == "JOIN" and
|
|
||||||
self.server.casefold(line.params[0]) in folded):
|
|
||||||
waiting -= 1
|
|
||||||
|
|
||||||
for channel in folded:
|
|
||||||
await self.server.send(build("WHO", [channel]))
|
|
||||||
line = await self.wait_for(
|
|
||||||
Response(RPL_ENDOFWHO, [ParamAny(), ParamFolded(channel)])
|
|
||||||
)
|
|
||||||
|
|
||||||
return [self.server.channels[c] for c in folded]
|
|
||||||
"""
|
|
||||||
|
|
||||||
class WHOContext(ServerContext):
|
class WHOContext(ServerContext):
|
||||||
async def ensure(self, channel: str):
|
async def ensure(self, channel: str):
|
||||||
folded = self.server.casefold(channel)
|
folded = self.server.casefold(channel)
|
||||||
|
|
Loading…
Reference in a new issue