]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cull_list.cpp
Convert more by-values to const references, optimise ConfigReader a bit
[user/henk/code/inspircd.git] / src / cull_list.cpp
index 224a9e3da0b55fc9792aec1f314f54a570bcbc82..b7254fd0b0d3bd3ba3b4a6fed6fe69fd2986257c 100644 (file)
@@ -81,12 +81,18 @@ bool CullList::IsValid(userrec* user)
        return false;
 }
 
-CullItem::CullItem(userrec* u, std::string r)
+CullItem::CullItem(userrec* u, std::string &r)
 {
         this->user = u;
         this->reason = r;
 }
 
+CullItem::CullItem(userrec* u, const char* r)
+{
+       this->user = u;
+       this->reason = r;
+}
+
 userrec* CullItem::GetUser()
 {
         return this->user;
@@ -103,7 +109,7 @@ CullList::CullList()
         exempt.clear();
 }
 
-void CullList::AddItem(userrec* user, std::string reason)
+void CullList::AddItem(userrec* user, std::string &reason)
 {
        if (exempt.find(user) == exempt.end())
        {
@@ -113,6 +119,16 @@ void CullList::AddItem(userrec* user, std::string reason)
        }
 }
 
+void CullList::AddItem(userrec* user, const char* reason)
+{
+       if (exempt.find(user) == exempt.end())
+       {
+               CullItem item(user,reason);
+               list.push_back(item);
+               exempt[user] = user->signon;
+       }
+}
+
 int CullList::Apply()
 {
         int n = 0;