| 295 | return False |
| 296 | |
| 297 | def join( |
| 298 | self, |
| 299 | channel: str, |
| 300 | timeout: float, |
| 301 | prefix: str, |
| 302 | key: Optional[str] = None, |
| 303 | ) -> None: |
| 304 | |
| 305 | chan = normalise_channel(channel) |
| 306 | if chan in self.sm.ctx.joined: |
| 307 | # Nothing to do, we are already there. |
| 308 | return |
| 309 | deadline = time.monotonic() + float(timeout) |
| 310 | |
| 311 | for act in self.sm.request_join(chan, key=key): |
| 312 | if act.kind == IRCActionKind.SEND and act.line: |
| 313 | self._queue(act.line) |
| 314 | |
| 315 | while time.monotonic() < deadline and chan not in self.sm.ctx.joined: |
| 316 | self._flush(deadline) |
| 317 | self._handshake(self._tick(deadline), prefix=prefix) |
| 318 | |
| 319 | if chan not in self.sm.ctx.joined: |
| 320 | logger.debug("IRC join confirmation not observed for %s", chan) |
| 321 | |
| 322 | def privmsg(self, target: str, message: str, timeout: float) -> None: |
| 323 | """Handle the sending of private messages.""" |