From ecabf153d01b4cb48944155a638e1cf4c1d80d98 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 9 May 2021 22:45:40 +0100 Subject: Add a new map-based method for building link data. The new link data is not currently used but will be in the near future. --- include/modules.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index 78ac0e41d..a617c93e0 100644 --- a/include/modules.h +++ b/include/modules.h @@ -297,6 +297,12 @@ class CoreExport Module : public Cullable, public usecountbase void DetachEvent(Implementation i); public: + /** Data which is synchronised between servers on link. */ + typedef std::map LinkData; + + /** Data which is synchronised between servers on link. */ + typedef std::map, std::optional>, irc::insensitive_swo> LinkDataDiff; + /** A list of modules. */ typedef std::vector List; @@ -329,10 +335,17 @@ class CoreExport Module : public Cullable, public usecountbase */ Cullable::Result Cull() override; + /** Compares our link data to that of another server. + * @param otherdata Link data from another server. + * @param diffs The difference between the two sets of link data. + */ + virtual void CompareLinkData(const LinkData& otherdata, LinkDataDiff& diffs); + /** Retrieves link compatibility data for this module. * @param data The location to store link compatibility data. + * @param compatdata The location to store link compatibility data for older protocols. */ - virtual void GetLinkData(std::string& data); + virtual void GetLinkData(LinkData& data, std::string& compatdata); /** Retrieves a string that represents the properties of this module. */ std::string GetPropertyString() const; -- cgit v1.3.1-10-gc9f91