X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fu_listmode.h;h=7f2d9fa25ed007e17c7da45ebce399d3d2b18acd;hb=3ec7995bf4981119115d14ce2cfce0cb5795f803;hp=0e2f051036f7288b6501f90e38f2913a987ae593;hpb=4a4443c79bad2e5397140a8aea55d6cc6cadd1ab;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/u_listmode.h b/include/u_listmode.h index 0e2f05103..7f2d9fa25 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -1,3 +1,16 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits + * + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ + #ifndef INSPIRCD_LISTMODE_PROVIDER #define INSPIRCD_LISTMODE_PROVIDER @@ -32,7 +45,7 @@ class ListItem : public classbase { public: std::string nick; - std::string mask; + irc::string mask; std::string time; }; @@ -49,6 +62,21 @@ public: typedef std::vector modelist; typedef std::vector limitlist; +class ListModeRequest : public Request +{ + public: + userrec* user; + chanrec* chan; + + ListModeRequest(Module* sender, Module* target, userrec* u, chanrec* c) : Request(sender, target, "LM_CHECKLIST"), user(u), chan(c) + { + } + + ~ListModeRequest() + { + } +}; + /** The base class for listmodes defined by u_listmode.h */ class ListModeBase : public ModeHandler @@ -98,25 +126,24 @@ class ListModeBase : public ModeHandler user->WriteServ("%s %s %s %s %s %s", listnumeric.c_str(), user->nick, channel->name, it->mask.c_str(), it->nick.c_str(), it->time.c_str()); } } - user->WriteServ("%s %s %s %s", endoflistnumeric.c_str(), user->nick, channel->name, endofliststring.c_str()); + user->WriteServ("%s %s %s :%s", endoflistnumeric.c_str(), user->nick, channel->name, endofliststring.c_str()); } virtual void RemoveMode(chanrec* channel) { - ServerInstance->Log(DEBUG,"Removing listmode base from %s %s",channel->name,infokey.c_str()); modelist* el; channel->GetExt(infokey, el); if (el) { - ServerInstance->Log(DEBUG,"Channel is extended with a list"); - irc::modestacker modestack(true); + irc::modestacker modestack(false); std::deque stackresult; const char* mode_junk[MAXMODES+1]; + mode_junk[0] = channel->name; userrec* n = new userrec(ServerInstance); n->SetFd(FD_MAGIC_NUMBER); for(modelist::iterator it = el->begin(); it != el->end(); it++) { - modestack.Push(this->GetModeChar(), it->mask); + modestack.Push(this->GetModeChar(), assign(it->mask)); } while (modestack.GetStackedLine(stackresult)) { @@ -223,7 +250,7 @@ class ListModeBase : public ModeHandler { // And now add the mask onto the list... ListItem e; - e.mask = parameter; + e.mask = assign(parameter); e.nick = source->nick; e.time = stringtime(); @@ -309,7 +336,7 @@ class ListModeBase : public ModeHandler { for (modelist::iterator it = list->begin(); it != list->end(); it++) { - modestack.Push(std::string(1, mode)[0], it->mask); + modestack.Push(std::string(1, mode)[0], assign(it->mask)); } } while (modestack.GetStackedLine(stackresult))