+ ModResult OnPreEventSend(LocalUser* user, const ClientProtocol::Event& ev, ClientProtocol::MessageList& messagelist) CXX11_OVERRIDE
+ {
+ const ClientProtocol::Events::Join& join = static_cast<const ClientProtocol::Events::Join&>(ev);
+ const Membership* const memb = join.GetMember();
+ const User* const u = memb->user;
+ if ((unjoined.get(memb)) && (u != user))
+ return MOD_RES_DENY;
+ return MOD_RES_PASSTHRU;
+ }
+};
+
+}
+
+class ModuleDelayJoin
+ : public Module
+ , public CTCTags::EventListener
+ , public Names::EventListener
+{
+ public:
+ LocalIntExt unjoined;
+ JoinHook joinhook;
+ DelayJoinMode djm;
+
+ ModuleDelayJoin()
+ : CTCTags::EventListener(this)
+ , Names::EventListener(this)
+ , unjoined("delayjoin", ExtensionItem::EXT_MEMBERSHIP, this)
+ , joinhook(this, unjoined)
+ , djm(this, unjoined)