aboutsummaryrefslogtreecommitdiff
path: root/http2irc.py
diff options
context:
space:
mode:
Diffstat (limited to 'http2irc.py')
-rw-r--r--http2irc.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/http2irc.py b/http2irc.py
index da47dc2..a73f23d 100644
--- a/http2irc.py
+++ b/http2irc.py
@@ -871,7 +871,16 @@ class IRCClient:
self._protocol = None
def update_config(self, config):
- needReconnect = self.config['irc'] != config['irc']
+ ircSectionReconnectNeededKeys = [
+ 'host', 'port', # If we're connecting to different server
+ 'ssl', # Using or no longer using SSL,
+ 'family', # Via a different protocol
+ 'nick', # TODO: Changing nick could be implemented without reconnects
+ 'real', # Might be able to work without reconnects on certain IRCds.
+ 'certfile', 'certkeyfile' # If using different certificate.
+ ]
+ needReconnect = any(self.config['irc'][key] != config['irc'][key] for key in ircSectionReconnectNeededKeys)
+
self.config = config
if self._transport: # if currently connected:
if needReconnect:
@@ -879,6 +888,8 @@ class IRCClient:
else:
self.channels = {map_['ircchannel'] for map_ in config['maps'].values()}
self._protocol.update_channels(self.channels)
+ self._protocol.config = config
+
def _get_ssl_context(self):
ctx = SSL_CONTEXTS[self.config['irc']['ssl']]