]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
After discussions and thought, move umode +n to +s. This increases cross-ircd compat...
[user/henk/code/inspircd.git] / src / xline.cpp
index 610af2e6c305e332050c8fb9118270e3734c8547..0878ec286e5c412bde4d87bd66d4d74ab5b8c0d8 100644 (file)
@@ -116,6 +116,22 @@ XLineLookup* XLineManager::GetAll(const std::string &type)
        return &(n->second);
 }
 
+void XLineManager::DelAll(const std::string &type)
+{
+       ContainerIter n = lookup_lines.find(type);
+
+       if (n == lookup_lines.end())
+               return;
+
+       LookupIter x;
+
+       /* Delete all of a given type (this should probably use DelLine, but oh well) */
+       while ((x = n->second.begin()) != n->second.end())
+       {
+               ExpireLine(n, x);
+       }
+}
+
 std::vector<std::string> XLineManager::GetAllTypes()
 {
        std::vector<std::string> items;
@@ -419,7 +435,8 @@ void XLine::DefaultApply(User* u, const std::string &line, bool bancache)
        char sreason[MAXBUF];
        snprintf(sreason, MAXBUF, "%s-Lined: %s", line.c_str(), this->reason);
        if (*ServerInstance->Config->MoronBanner)
-               u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
+               u->WriteServ("NOTICE %s :*** %s", u->nick.c_str(), ServerInstance->Config->MoronBanner);
+
        if (ServerInstance->Config->HideBans)
                ServerInstance->Users->QuitUser(u, line + "-Lined", sreason);
        else
@@ -525,13 +542,13 @@ bool QLine::Matches(User *u)
 void QLine::Apply(User* u)
 {       
        /* Force to uuid on apply of qline, no need to disconnect any more :) */
-       u->ForceNickChange(u->uuid);
+       u->ForceNickChange(u->uuid.c_str());
 }
 
 
 bool ZLine::Matches(const std::string &str)
 {
-       if (match(str.c_str(), this->ipaddr, true))
+       if (match(str, this->ipaddr, true))
                return true;
        else
                return false;
@@ -539,7 +556,7 @@ bool ZLine::Matches(const std::string &str)
 
 bool QLine::Matches(const std::string &str)
 {
-       if (match(str.c_str(), this->nick))
+       if (match(str, this->nick))
                return true;
 
        return false;
@@ -547,17 +564,17 @@ bool QLine::Matches(const std::string &str)
 
 bool ELine::Matches(const std::string &str)
 {
-       return ((match(str.c_str(), matchtext.c_str(), true)));
+       return ((match(str, matchtext, true)));
 }
 
 bool KLine::Matches(const std::string &str)
 {
-       return ((match(str.c_str(), matchtext.c_str(), true)));
+       return ((match(str.c_str(), matchtext, true)));
 }
 
 bool GLine::Matches(const std::string &str)
 {
-       return ((match(str.c_str(), matchtext.c_str(), true)));
+       return ((match(str, matchtext, true)));
 }
 
 void ELine::OnAdd()