diff options
author | Sadie Powell <sadie@witchery.services> | 2023-10-19 22:52:05 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2023-10-19 22:52:05 +0100 |
commit | 78398a44816fdb5cc6d674edaf11e2665a181ce2 (patch) | |
tree | 4783179cd7070246e5abc1e806299c7fc8041932 /modules/protocol/inspircd.cpp | |
parent | 0f32d2e55375333c0eb8a6450f6db36071f40561 (diff) |
Add support for server-initiated logouts on InspIRCd.
Diffstat (limited to 'modules/protocol/inspircd.cpp')
-rw-r--r-- | modules/protocol/inspircd.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index e91e54b57..8e0581b13 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -1395,9 +1395,22 @@ class IRCDMessageMetadata : IRCDMessage if (params[1].equals_cs("accountname")) { User *u = User::Find(params[0]); - NickCore *nc = NickCore::Find(params[2]); - if (u && nc) - u->Login(nc); + if (!u) + return; // Should never happen. + + if (params[2].empty()) + { + // The user has been logged out by the IRC server. + u->Logout(); + } + else + { + // If we're bursting then then the user was probably logged + // in during a previous connection. + NickCore *nc = NickCore::Find(params[2]); + if (nc) + u->Login(nc); + } } /* |