aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-12 15:15:38 +0000
committerGravatar Sadie Powell2026-03-12 15:38:54 +0000
commit7ed7c7ba0dfd3f73a7d8a621988d7e99f07a23ef (patch)
tree1f98a809b4018a6cabfe17aa2549507072840438 /include
parentMove channel settings to the <channels> tag. (diff)
Move <options:defaultmodes> to <channels> and rework.
- The default prefix modes are now separate from the default channel modes. This should result in less accidentally broken configs. - The privs are now pre-parsed to a list of mode references. This should improve performance slightly as the repeated mode lookups are gone. It also allows us to write warnings to the debug log when the default privs are invalid. - Channels can now have a default topic.
Diffstat (limited to 'include')
-rw-r--r--include/channels.h2
-rw-r--r--include/configreader.h3
-rw-r--r--include/membership.h2
-rw-r--r--include/mode.h3
-rw-r--r--include/modules.h2
5 files changed, 6 insertions, 6 deletions
diff --git a/include/channels.h b/include/channels.h
index b0d5a5814..a389aa3ad 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -247,7 +247,7 @@ public:
* @param created_by_local True if this channel was just created by a local user (passed to modules in the OnUserJoin hook)
* @return A newly created Membership object, or NULL if the user was already inside the channel or if the user is a server user
*/
- Membership* ForceJoin(User* user, const std::string* privs = nullptr, bool bursting = false, bool created_by_local = false);
+ Membership* ForceJoin(User* user, const PrefixMode::Set* privs = nullptr, bool bursting = false, bool created_by_local = false);
/** Write to all users on a channel except some users
* @param protoev Event to send, may contain any number of messages.
diff --git a/include/configreader.h b/include/configreader.h
index 8ae4ba21f..a99d6ff76 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -439,9 +439,6 @@ public:
/** The value to show in the comment field of the RPL_VERSION. */
std::string CustomVersion;
- /** The modes to set on a new channel. May contain channel prefix modes to set on the channel creator. */
- std::string DefaultModes;
-
/** If non-empty then the value to replace the server name with in public messages. */
std::string HideServer;
diff --git a/include/membership.h b/include/membership.h
index 3a3d3c01c..7153f2d00 100644
--- a/include/membership.h
+++ b/include/membership.h
@@ -51,7 +51,7 @@ public:
/** List of prefix mode letters this member has,
* sorted by prefix rank, highest first
*/
- std::set<PrefixMode*, PrefixMode::Sorter> modes;
+ PrefixMode::Set modes;
/** Id of this Membership, set by the protocol module, other components should never read or
* write this field.
diff --git a/include/mode.h b/include/mode.h
index 6f8474250..c577a8551 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -380,6 +380,9 @@ public:
}
};
+ /** Holds a list of prefix modes ordered by rank. */
+ using Set = std::set<PrefixMode*, PrefixMode::Sorter>;
+
/**
* Constructor
* @param Creator The module creating this mode
diff --git a/include/modules.h b/include/modules.h
index b0be5ce80..35f1eb529 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -425,7 +425,7 @@ public:
* @param override Whether the channel join can be blocked by returning MOD_RES_DENY.
* @return 1 To prevent the join, 0 to allow it.
*/
- virtual ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven, bool override) ATTR_NOT_NULL(2);
+ virtual ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, PrefixMode::Set& privs, const std::string& keygiven, bool override) ATTR_NOT_NULL(2);
/** Called whenever a user is about to be kicked.
* Returning a value of 1 from this function stops the process immediately, causing no