summaryrefslogtreecommitdiff
path: root/src/usermanager.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-04 19:23:16 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-04 19:23:16 +0200
commitbb3aa2fb37071f48a5312df8688c0a6990644fbb (patch)
treee48e8f3d6bac2f608e9ad18b6af88fc0a712e310 /src/usermanager.cpp
parent7b823baf68b7512a36ac513f3c6b0d920776fa59 (diff)
Stop recreating hashmaps every hour, move garbage collection code related to local users to UserManager
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r--src/usermanager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 58cbb7e5b..2d9c3f281 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -389,3 +389,14 @@ int UserManager::ModeCount(const char mode)
}
return c;
}
+
+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 (LocalUserList::const_iterator i = this->local_users.begin(); i != this->local_users.end(); i++)
+ {
+ (**i).already_sent = 0;
+ (**i).RemoveExpiredInvites();
+ }
+}