Browse Source

Fix IRC regression

master
Neil Booth 8 years ago
parent
commit
956d1b8039
  1. 8
      server/irc.py

8
server/irc.py

@ -41,6 +41,7 @@ class IRC(LoggedClass):
ssl_text = port_text('s', env.report_ssl_port, 50002) ssl_text = port_text('s', env.report_ssl_port, 50002)
# If this isn't something the client expects you won't appear # If this isn't something the client expects you won't appear
# in the client's network dialog box # in the client's network dialog box
self.env = env
version = '1.0' version = '1.0'
self.real_name = '{} v{} {} {}'.format(env.report_host, version, self.real_name = '{} v{} {} {}'.format(env.report_host, version,
tcp_text, ssl_text) tcp_text, ssl_text)
@ -54,16 +55,15 @@ class IRC(LoggedClass):
self.irc_port = env.coin.IRC_PORT self.irc_port = env.coin.IRC_PORT
self.peer_regexp = re.compile('({}[^!]*)!'.format(self.prefix)) self.peer_regexp = re.compile('({}[^!]*)!'.format(self.prefix))
self.peers = {} self.peers = {}
self.disabled = env.irc is None
async def start(self, caught_up): async def start(self, caught_up):
'''Start IRC connections once caught up if enabled in environment.''' '''Start IRC connections once caught up if enabled in environment.'''
await caught_up.wait() await caught_up.wait()
try: try:
if self.disabled: if self.env.irc:
self.logger.info('IRC is disabled')
else:
await self.join() await self.join()
else:
self.logger.info('IRC is disabled')
except asyncio.CancelledError: except asyncio.CancelledError:
pass pass
except Exception as e: except Exception as e:

Loading…
Cancel
Save