Add an option for including the setter's full mask in list modes.

This commit is contained in:
Sadie Powell 2023-09-21 20:17:13 +01:00
parent e9271fcb49
commit 136a1ef6a2
4 changed files with 13 additions and 1 deletions

View File

@ -609,6 +609,10 @@
# falling back to IPv4 otherwise.
defaultbind="auto"
# maskinlist: If enabled then channels will show the nick!user@host of a list
# mode setter in the mode list instead of just the nick of the list mode setter.
maskinlist="yes"
# maskintopic: If enabled then channels will show the nick!user@host of the topic
# setter in the topic instead of just the nick of the topic setter.
maskintopic="yes"

View File

@ -489,6 +489,9 @@ public:
/** The maximum number of local connections that can be made to the IRC server. */
size_t SoftLimit;
/** Whether to store the full nick!duser\@dhost as a list mode setter instead of just their nick. */
bool MaskInList;
/** Whether to store the full nick!duser\@dhost as a topic setter instead of just their nick. */
bool MaskInTopic;

View File

@ -362,6 +362,7 @@ void ServerConfig::Fill()
// Read the <options> config.
const auto& options = ConfValue("options");
DefaultModes = options->getString("defaultmodes", "not");
MaskInList = options->getBool("maskinlist");
MaskInTopic = options->getBool("maskintopic", options->getBool("hostintopic"));
NoSnoticeStack = options->getBool("nosnoticestack");
SyntaxHints = options->getBool("syntaxhints");

View File

@ -199,7 +199,11 @@ bool ListModeBase::OnModeChange(User* source, User*, Channel* channel, Modes::Ch
}
// Add the new entry to the list.
cd->list.emplace_back(change.param, change.set_by.value_or(source->nick), change.set_at.value_or(ServerInstance->Time()));
cd->list.emplace_back(
change.param,
change.set_by.value_or(ServerInstance->Config->MaskInList ? source->GetMask() : source->nick),
change.set_at.value_or(ServerInstance->Time())
);
return true;
}
else