diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cull_list.cpp | 16 | ||||
-rw-r--r-- | src/userprocess.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 6 |
3 files changed, 20 insertions, 4 deletions
diff --git a/src/cull_list.cpp b/src/cull_list.cpp index a8188701a..b7254fd0b 100644 --- a/src/cull_list.cpp +++ b/src/cull_list.cpp @@ -87,6 +87,12 @@ CullItem::CullItem(userrec* u, std::string &r) this->reason = r; } +CullItem::CullItem(userrec* u, const char* r) +{ + this->user = u; + this->reason = r; +} + userrec* CullItem::GetUser() { return this->user; @@ -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; diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 30f7d49f8..0c72a53b5 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -404,7 +404,7 @@ void DoBackgroundUserStuff(time_t TIME) */ curr->FlushWriteBuf(); - if (curr->GetWriteError() != "") + if (*curr->GetWriteError()) { GlobalGoners.AddItem(curr,curr->GetWriteError()); continue; diff --git a/src/users.cpp b/src/users.cpp index a0929d684..3b6a10197 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -357,7 +357,7 @@ std::string userrec::GetBuffer() void userrec::AddWriteBuf(std::string data) { - if (this->GetWriteError() != "") + if (*this->GetWriteError()) return; if (sendq.length() + data.length() > (unsigned)this->sendqmax) { @@ -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) |