]> 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 4db389957f2a6b11bc06cb4e413b979641fad242..13146a08653709414942cd8160d37afd05f8fdbf 100644 (file)
@@ -107,24 +107,25 @@ userrec::userrec()
        server = (char*)FindServerNamePtr(Config->ServerName);
        reset_due = TIME;
        lines_in = fd = lastping = signon = idle_lastmsg = nping = registered = 0;
-       timeout = flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
+       modebits = timeout = flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
        haspassed = dns_done = false;
        recvq = "";
        sendq = "";
        chans.clear();
        invites.clear();
-        clientlist[tempnick]->chans.resize(MAXCHANS);
+        chans.resize(MAXCHANS);
         for (unsigned int n = 0; n < MAXCHANS; n++)
-        {       
-               clientlist[tempnick]->chans[n] = new ucrec();
-               clientlist[tempnick]->chans[n]->channel = NULL;
-               clientlist[tempnick]->chans[n]->uc_modes = 0;
+        {
+               ucrec* x = new ucrec();
+               chans[n] = x;
+               x->channel = NULL;
+               x->uc_modes = 0;
         }
 }
 
 userrec::~userrec()
 {
-       for (std::vector<ucrec*>::iterator n = clientlist[tempnick]->chans.begin(); n != clientlist[tempnick]->chans.end(); n++)
+       for (std::vector<ucrec*>::iterator n = chans.begin(); n != chans.end(); n++)
        {
                ucrec* x = (ucrec*)*n;
                delete x;
@@ -245,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;
@@ -294,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();
@@ -354,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)
        {
@@ -396,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.
@@ -404,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)
@@ -848,4 +849,3 @@ void force_nickchange(userrec* user,const char* newnick)
                 }
         }
 }
-