- AChannel_M(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'M') { }
+ AChannel_M(Module* Creator) : SimpleChannelModeHandler(Creator, "regmoderated", 'M') { }
+};
+
+class AccountExtItemImpl : public AccountExtItem
+{
+ public:
+ AccountExtItemImpl(Module* mod)
+ : AccountExtItem("accountname", ExtensionItem::EXT_USER, mod)
+ {
+ }
+
+ 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());
+ }
+
+ AccountEvent(creator, user, value).Send();
+ }
+ else
+ {
+ // Logged out
+ AccountEvent(creator, user, "").Send();
+ }
+ }