summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-10-11 01:01:30 +0100
committerPeter Powell <petpow@saberuk.com>2017-10-11 01:29:34 +0100
commit3c02b8018a6cd455676939ddf7a0145f060680a8 (patch)
treeac0bd118dcd16695a754c0fa21653c892be931a6 /src/modules
parent0c6c30e7148aa8ea79a2fae205f0e7153ddd1bf8 (diff)
Send RPL_LOGGEDOUT to clients when they log out of their account.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_services_account.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index 1ff206ed1..4f43ada3e 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -26,6 +26,13 @@
#include "modules/account.h"
#include "modules/exemption.h"
+enum
+{
+ // From IRCv3 sasl-3.1.
+ RPL_LOGGEDIN = 900,
+ RPL_LOGGEDOUT = 901
+};
+
/** Channel mode +r - mark a channel as identified
*/
class Channel_r : public ModeHandler
@@ -124,15 +131,19 @@ class AccountExtItemImpl : public AccountExtItem
if (format == FORMAT_INTERNAL)
return;
- if (!value.empty())
+ if (IS_LOCAL(user))
{
- // Logged in
- if (IS_LOCAL(user))
+ if (value.empty())
+ {
+ // Logged out.
+ user->WriteNumeric(RPL_LOGGEDOUT, user->GetFullHost(), "You are now logged out");
+ }
+ else
{
- user->WriteNumeric(900, user->GetFullHost(), value, InspIRCd::Format("You are now logged in as %s", value.c_str()));
+ // Logged in.
+ user->WriteNumeric(RPL_LOGGEDIN, user->GetFullHost(), value, InspIRCd::Format("You are now logged in as %s", value.c_str()));
}
}
- // If value is empty then logged out
FOREACH_MOD_CUSTOM(eventprov, AccountEventListener, OnAccountChange, (user, value));
}