- void OnText(User* user, void* dest, int target_type, const std::string &text, char status, CUList &exempt_list)
- {
- if (target_type != TYPE_CHANNEL)
- return;
-
- Channel* channel = (Channel*) dest;
-
- if (!user->GetExt(std::string("delayjoin_")+channel->name))
- return;
-
- /* Display the join to everyone else (the user who joined got it earlier) */
- this->WriteCommonFrom(user, channel, "JOIN %s", channel->name);
-
- std::string n = this->ServerInstance->Modes->ModeString(user, channel);
- if (n.length() > 0)
- this->WriteCommonFrom(user, channel, "MODE %s +%s", channel->name, n.c_str());
-
- /* Shrink off the neccessary metadata for a specific channel */
- user->Shrink(std::string("delayjoin_")+channel->name);
-
- /* Check if the user is left on any other +D channels, if so don't take away the
- * metadata that says theyre on one or more channels
- */
- for (UCListIter f = user->chans.begin(); f != user->chans.end(); f++)
- if (f->first->IsModeSet('D'))
- return;
-
- user->Shrink("delayjoin");
- }
-
- void WriteCommonFrom(User *user, Channel* channel, const char* text, ...)
- {
- va_list argsPtr;
- char textbuffer[MAXBUF];
- char tb[MAXBUF];
+void ModuleDelayJoin::OnText(User* user, void* dest, int target_type, const std::string &text, char status, CUList &exempt_list)
+{
+ /* Server origin */
+ if (!user)
+ return;