]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Made it compile :p
[user/henk/code/inspircd.git] / src / users.cpp
index a0929d684f2c8f95c829dae8fe111d91e8a0d757..13146a08653709414942cd8160d37afd05f8fdbf 100644 (file)
@@ -246,7 +246,7 @@ void userrec::RemoveInvite(irc::string &channel)
                }
 }
 
-bool userrec::HasPermission(std::string &command)
+bool userrec::HasPermission(const std::string &command)
 {
        char* mycmd;
        char* savept;
@@ -295,7 +295,7 @@ bool userrec::HasPermission(std::string &command)
 }
 
 
-bool userrec::AddBuffer(std::string a)
+bool userrec::AddBuffer(const std::string &a)
 {
         std::string b = "";
        char* n = (char*)a.c_str();
@@ -355,9 +355,9 @@ std::string userrec::GetBuffer()
         return ret;
 }
 
-void userrec::AddWriteBuf(std::string data)
+void userrec::AddWriteBuf(const std::string &data)
 {
-       if (this->GetWriteError() != "")
+       if (*this->GetWriteError())
                return;
        if (sendq.length() + data.length() > (unsigned)this->sendqmax)
        {
@@ -397,7 +397,7 @@ void userrec::FlushWriteBuf()
        }
 }
 
-void userrec::SetWriteError(std::string error)
+void userrec::SetWriteError(const std::string &error)
 {
        log(DEBUG,"Setting error string for %s to '%s'",this->nick,error.c_str());
        // don't try to set the error twice, its already set take the first string.
@@ -405,9 +405,9 @@ void userrec::SetWriteError(std::string error)
                this->WriteError = error;
 }
 
-std::string userrec::GetWriteError()
+const char* userrec::GetWriteError()
 {
-       return this->WriteError;
+       return this->WriteError.c_str();
 }
 
 void AddOper(userrec* user)
@@ -849,4 +849,3 @@ void force_nickchange(userrec* user,const char* newnick)
                 }
         }
 }
-