summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/usermanager.h15
-rw-r--r--include/users.h1
2 files changed, 10 insertions, 6 deletions
diff --git a/include/usermanager.h b/include/usermanager.h
index eee076802..941569e8c 100644
--- a/include/usermanager.h
+++ b/include/usermanager.h
@@ -56,6 +56,11 @@ class CoreExport UserManager : public fakederef<UserManager>
*/
LocalList local_users;
+ /** Last used already sent id, used when sending messages to neighbors to help determine whether the message has
+ * been sent to a particular user or not. See User::ForEachNeighbor() for more info.
+ */
+ already_sent_t already_sent_id;
+
public:
/** Constructor, initializes variables
*/
@@ -83,11 +88,6 @@ class CoreExport UserManager : public fakederef<UserManager>
*/
unsigned int unregistered_count;
- /**
- * Reset the already_sent IDs so we don't wrap it around and drop a message
- */
- void GarbageCollect();
-
/** Perform background user events such as PING checks
*/
void DoBackgroundUserStuff();
@@ -186,4 +186,9 @@ class CoreExport UserManager : public fakederef<UserManager>
* @param ... The format arguments
*/
void ServerNoticeAll(const char* text, ...) CUSTOM_PRINTF(2, 3);
+
+ /** Retrieves the next already sent id, guaranteed to be not equal to any user's already_sent field
+ * @return Next already_sent id
+ */
+ already_sent_t NextAlreadySentId();
};
diff --git a/include/users.h b/include/users.h
index 03540018b..fa346a329 100644
--- a/include/users.h
+++ b/include/users.h
@@ -720,7 +720,6 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node<Local
*/
unsigned int CommandFloodPenalty;
- static already_sent_t already_sent_id;
already_sent_t already_sent;
/** Check if the user matches a G or K line, and disconnect them if they do.