-/** Channel mode +M - unidentified users cannot message channel
- */
-class AChannel_M : public SimpleChannelModeHandler
-{
- public:
- AChannel_M(Module* Creator) : SimpleChannelModeHandler(Creator, "regmoderated", 'M') { }
+ void unserialize(SerializeFormat format, Extensible* container, const std::string& value) CXX11_OVERRIDE
+ {
+ User* user = static_cast<User*>(container);
+
+ StringExtItem::unserialize(format, container, value);
+
+ // If we are being reloaded then don't send the numeric or run the event
+ if (format == FORMAT_INTERNAL)
+ return;
+
+ if (IS_LOCAL(user))
+ {
+ if (value.empty())
+ {
+ // Logged out.
+ user->WriteNumeric(RPL_LOGGEDOUT, user->GetFullHost(), "You are now logged out");
+ }
+ else
+ {
+ // Logged in.
+ user->WriteNumeric(RPL_LOGGEDIN, user->GetFullHost(), value, InspIRCd::Format("You are now logged in as %s", value.c_str()));
+ }
+ }
+
+ FOREACH_MOD_CUSTOM(eventprov, AccountEventListener, OnAccountChange, (user, value));
+ }