aboutsummaryrefslogtreecommitdiffstats
path: root/modules/spanningtree/ijoin.cpp
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 /modules/spanningtree/ijoin.cpp
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 'modules/spanningtree/ijoin.cpp')
-rw-r--r--modules/spanningtree/ijoin.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/modules/spanningtree/ijoin.cpp b/modules/spanningtree/ijoin.cpp
index 01d5f75e5..6072d293c 100644
--- a/modules/spanningtree/ijoin.cpp
+++ b/modules/spanningtree/ijoin.cpp
@@ -40,17 +40,25 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, Params& params)
return CmdResult::FAILURE;
}
- bool apply_modes;
+ auto apply_modes = false;
+ PrefixMode::Set modes;
if (params.size() > 4)
{
time_t RemoteTS = ServerCommand::ExtractTS(params[3]);
- apply_modes = (RemoteTS <= chan->age);
+ if (RemoteTS <= chan->age)
+ {
+ apply_modes = true;
+ for (const auto modechr : params[4])
+ {
+ auto* pm = ServerInstance->Modes.FindPrefixMode(modechr);
+ if (pm)
+ modes.insert(pm);
+ }
+ }
}
- else
- apply_modes = false;
// Join the user and set the membership id to what they sent
- Membership* memb = chan->ForceJoin(user, apply_modes ? &params[4] : nullptr);
+ auto* memb = chan->ForceJoin(user, apply_modes ? &modes : nullptr);
if (!memb)
return CmdResult::FAILURE;