- virtual int OnUserList(User* user, Channel* Ptr, CUList* &nameslist)
- {
- /* For +D channels ... */
- if (Ptr->IsModeSet('D'))
- {
- /* Modify the names list, erasing users with the delay join metadata
- * for this channel (havent spoken yet)
- */
- nl = *nameslist;
-
- for (CUListIter n = nameslist->begin(); n != nameslist->end(); ++n)
- {
- if (n->first->GetExt("delayjoin_notspoken"))
- nl.erase(n->first);
- }
-
- nl[user] = user->nick;
- nameslist = &nl;
- }
- return 0;
- }
-
- virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
- {
- if (channel->IsModeSet('D'))
- {
- silent = true;
- /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */
- user->WriteFrom(user, "JOIN %s", channel->name);
-
- /* This metadata tells the module the user is delayed join on this specific channel */
- user->Extend(std::string("delayjoin_")+channel->name);
-
- /* This metadata tells the module the user is delayed join on at least one (or more) channels.
- * It is only cleared when the user is no longer on ANY +D channels.
- */
- if (!user->GetExt("delayjoin"))
- user->Extend("delayjoin");
- }
- }
+ModuleDelayJoin::~ModuleDelayJoin()
+{
+}
+
+Version ModuleDelayJoin::GetVersion()
+{
+ return Version("Allows for delay-join channels (+D) where users don't appear to join until they speak", VF_VENDOR);
+}