+ AChannel_M(Module* Creator) : SimpleChannelModeHandler(Creator, "regmoderated", 'M') { }
+};
+
+class AccountExtItemImpl : public AccountExtItem
+{
+ Events::ModuleEventProvider eventprov;
+
+ public:
+ AccountExtItemImpl(Module* mod)
+ : AccountExtItem("accountname", ExtensionItem::EXT_USER, mod)
+ , eventprov(mod, "event/account")
+ {
+ }
+
+ void unserialize(SerializeFormat format, Extensible* container, const std::string& value)
+ {
+ User* user = static_cast<User*>(container);
+
+ StringExtItem::unserialize(format, container, value);
+ if (!value.empty())
+ {
+ // Logged in
+ if (IS_LOCAL(user))
+ {
+ user->WriteNumeric(900, "%s %s :You are now logged in as %s",
+ user->GetFullHost().c_str(), value.c_str(), value.c_str());
+ }
+ }
+ // If value is empty then logged out
+
+ FOREACH_MOD_CUSTOM(eventprov, AccountEventListener, OnAccountChange, (user, value));
+ }