aboutsummaryrefslogtreecommitdiff
path: root/http2irc.py
diff options
context:
space:
mode:
authorGravatar JustAnotherArchivist2021-10-10 02:31:58 +0000
committerGravatar JustAnotherArchivist2021-10-10 02:31:58 +0000
commit86301905a652d52510f05f66d6ab2f986c79ea9d (patch)
tree2d26ac4e7b835fcb2516d96f09f1da30d2c82bbf /http2irc.py
parentSeparate POST and GET auth (diff)
signature
Gracefully handle channel bans and other join errors
Diffstat (limited to 'http2irc.py')
-rw-r--r--http2irc.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/http2irc.py b/http2irc.py
index 31ae084..6ce47a6 100644
--- a/http2irc.py
+++ b/http2irc.py
@@ -655,8 +655,12 @@ class IRCClientProtocol(asyncio.Protocol):
ircstates.numerics.ERR_BANNEDFROMCHAN,
ircstates.numerics.ERR_BADCHANNELKEY,
):
- self.logger.error(f'Failed to join channel: {message!r}, terminating connection')
- self.transport.close()
+ self.logger.error(f'Failed to join channel {line.params[1]}: {message!r}')
+ errChannel = self.server.casefold(line.params[1])
+ for channel in self.channels:
+ if self.server.casefold(channel) == errChannel:
+ self.channels.remove(channel)
+ break
# PART errors
elif line.command == '442':