From 804691a4763f9c74ceb939150f70da00bcc9c5eb Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 4 Jun 2018 19:45:08 +1200 Subject: [PATCH] unregister users that fail to log in to the upstream hub --- NTFServer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NTFServer.go b/NTFServer.go index 7723b7f..e7fa328 100644 --- a/NTFServer.go +++ b/NTFServer.go @@ -328,6 +328,10 @@ func (this *NTFServer) HandleHubMessage(msg upstreamMessage) { log.Printf("Delivering public message to group chat: %s", err.Error()) } + case libnmdc.EVENT_BAD_LOGIN_FAILURE: + this.DirectMessageTelegramUser(msg.telegramUserId, "The hub disconnected in a permanent way (login failure?). Consider re-registering with a different nick.") + this.kickAndDrop(msg.telegramUserId) + case libnmdc.EVENT_USER_JOINED, libnmdc.EVENT_USER_PART, libnmdc.EVENT_USER_UPDATED_INFO, libnmdc.EVENT_USERCOMMAND, libnmdc.EVENT_DEBUG_MESSAGE, libnmdc.EVENT_HUBNAME_CHANGED: // ignore