treat 437 the same as 433 (nickname already in use)

This commit is contained in:
jesopo 2019-07-04 10:44:52 +01:00
parent 3afbe5fd82
commit 689f977467
2 changed files with 11 additions and 2 deletions

View file

@ -239,6 +239,10 @@ class Module(ModuleManager.BaseModule):
@utils.hook("raw.received.433", default_event=True)
def handle_433(self, event):
core.handle_433(event)
# nickname/channel is temporarily unavailable
@utils.hook("raw.received.437")
def handle_437(self, event):
core.handle_437(event)
# we need a registered nickname for this channel
@utils.hook("raw.received.477", default_event=True)

View file

@ -140,6 +140,11 @@ def handle_354(event):
else:
target.identified_account = None
def _nick_in_use(server):
new_nick = "%s|" % server.connection_params.nickname
server.send_nick(new_nick)
def handle_433(event):
new_nick = "%s|" % event["server"].connection_params.nickname
event["server"].send_nick(new_nick)
_nick_in_use(event["server"])
def handle_437(event):
_nick_in_use(event["server"])