diff options
author | Sadie Powell <sadie@witchery.services> | 2021-02-19 01:08:08 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2021-02-19 01:08:08 +0000 |
commit | 3f6e694e5034e13e4cb8120ae276a63e12698387 (patch) | |
tree | 1768152f1f6868da42b664735e34f89f57e18a61 /modules/protocol/solanum.cpp | |
parent | c2646d67bb65c75062f7a09d747fe6fec3407bc5 (diff) |
Send the appropriate messages for Solanum's IDENTIFIED feature.
Diffstat (limited to 'modules/protocol/solanum.cpp')
-rw-r--r-- | modules/protocol/solanum.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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<bool>("use_server_side_mlock"); |