summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/usermanager.cpp16
-rw-r--r--src/users.cpp2
2 files changed, 13 insertions, 5 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index c593e149f..d81b83d20 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -49,7 +49,8 @@ namespace
}
UserManager::UserManager()
- : unregistered_count(0)
+ : already_sent_id(0)
+ , unregistered_count(0)
{
}
@@ -281,7 +282,6 @@ void UserManager::ServerNoticeAll(const char* text, ...)
void UserManager::GarbageCollect()
{
// Reset the already_sent IDs so we don't wrap it around and drop a message
- LocalUser::already_sent_id = 0;
for (LocalList::const_iterator i = local_users.begin(); i != local_users.end(); ++i)
(**i).already_sent = 0;
}
@@ -371,5 +371,15 @@ void UserManager::DoBackgroundUserStuff()
already_sent_t UserManager::NextAlreadySentId()
{
- return ++LocalUser::already_sent_id;
+ if (++already_sent_id == 0)
+ {
+ // Wrapped around, reset the already_sent ids of all users
+ already_sent_id = 1;
+ for (LocalList::iterator i = local_users.begin(); i != local_users.end(); ++i)
+ {
+ LocalUser* user = *i;
+ user->already_sent = 0;
+ }
+ }
+ return already_sent_id;
}
diff --git a/src/users.cpp b/src/users.cpp
index 258544312..93fd8d065 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -26,8 +26,6 @@
#include "inspircd.h"
#include "xline.h"
-already_sent_t LocalUser::already_sent_id = 0;
-
bool User::IsNoticeMaskSet(unsigned char sm)
{
if (!isalpha(sm))