From 3f6e694e5034e13e4cb8120ae276a63e12698387 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 19 Feb 2021 01:08:08 +0000 Subject: [PATCH] Send the appropriate messages for Solanum's IDENTIFIED feature. --- modules/protocol/solanum.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/modules/protocol/solanum.cpp b/modules/protocol/solanum.cpp index 78ec13cec..1375b1928 100644 --- a/modules/protocol/solanum.cpp +++ b/modules/protocol/solanum.cpp @@ -379,6 +379,27 @@ class ProtoSolanum : public Module ModuleManager::UnloadModule(m_ratbox, NULL); } + void OnUserLogin(User *u) anope_override + { + // If the user has logged into their current nickname then mark them as such. + NickAlias *na = NickAlias::Find(u->nick); + UplinkSocket::Message(Me) << "ENCAP * IDENTIFIED " << u->GetUID() << " " << (na && na->nc == u->Account() ? na->nick : "OFF"); + } + + void OnNickLogout(User *u) anope_override + { + // We don't know what account the user was logged into so send in all cases. + UplinkSocket::Message(Me) << "ENCAP * IDENTIFIED " << u->GetUID() << " OFF"; + } + + void OnUserNickChange(User *u, const Anope::string &) anope_override + { + // If the user is logged into an account check if we need to mark them + // as not identified to their nick. + if (u->Account()) + OnUserLogin(u); + } + void OnReload(Configuration::Conf *conf) anope_override { use_server_side_mlock = conf->GetModule(this)->Get("use_server_side_mlock");