mirror of https://github.com/Shizmob/pydle.git
Merge pull request #3 from rfw/master
Fix error behaviour and edge cases.
This commit is contained in:
commit
00587532f1
|
@ -272,10 +272,7 @@ class BasicClient:
|
|||
del self.users[nickname]
|
||||
|
||||
def _format_hostmask(self, nickname):
|
||||
if nickname not in self.users:
|
||||
raise KeyError('Unknown user "{usr}".'.format(usr=nickname))
|
||||
|
||||
user = self.users[nickname]
|
||||
user = self.users.get(nickname, {"username": "*", "hostname": "*"})
|
||||
return '{n}!{u}@{h}'.format(n=nickname, u=user['username'] or '*', h=user['hostname'] or '*')
|
||||
|
||||
|
||||
|
@ -914,6 +911,11 @@ class BasicClient:
|
|||
# MOTD is done, let's tell our bot the connection is ready.
|
||||
self.on_connect()
|
||||
|
||||
def on_raw_422(self, message):
|
||||
""" MOTD is missing. """
|
||||
self.motd = None
|
||||
self.on_connect()
|
||||
|
||||
def on_raw_421(self, message):
|
||||
""" Server responded with 'unknown command'. """
|
||||
self.logger.warn('Server responded with "Unknown command: {}"'.format(message.params[0]))
|
||||
|
|
|
@ -83,7 +83,7 @@ class IRCv3_1Support(sasl.SASLSupport, tls.TLSSupport):
|
|||
self._sync_user(nick, user, host)
|
||||
|
||||
# Emit a fake join message.
|
||||
fakemsg = self._construct_message('JOIN', channels, source=message.source)
|
||||
fakemsg = self._create_message('JOIN', channels, source=message.source)
|
||||
super().on_raw_join(fakemsg)
|
||||
|
||||
if account == NO_ACCOUNT:
|
||||
|
|
Loading…
Reference in New Issue