aboutsummaryrefslogtreecommitdiffstats
path: root/modules/repeat.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-14 02:15:38 +0000
committerGravatar Sadie Powell2026-03-14 03:09:11 +0000
commit76f3f24c03c22576324e5af199d3e61d02a79b0d (patch)
treeefa6b9a0295e7b99dc8c0c47c8dd6030238c8cac /modules/repeat.cpp
parentConvert some methods to use string_view. (diff)
Rewrite sepstream and move to stringutils.
Diffstat (limited to 'modules/repeat.cpp')
-rw-r--r--modules/repeat.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/modules/repeat.cpp b/modules/repeat.cpp
index 6b506ddf2..2b47c4ec5 100644
--- a/modules/repeat.cpp
+++ b/modules/repeat.cpp
@@ -265,9 +265,9 @@ public:
}
private:
- bool ParseAction(irc::sepstream& stream, ChannelSettings::RepeatAction& action)
+ bool ParseAction(StringSplitter& stream, ChannelSettings::RepeatAction& action)
{
- std::string actionstr;
+ std::string_view actionstr;
if (!stream.GetToken(actionstr))
return false;
@@ -289,16 +289,12 @@ private:
bool ParseSettings(User* source, std::string& parameter, ChannelSettings& settings)
{
- irc::sepstream stream(parameter, ':');
- std::string item;
-
- if (!ParseAction(stream, settings.Action) || !stream.GetToken(item))
- return false;
-
- if ((settings.Lines = ConvToNum<unsigned int>(item)) == 0)
+ StringSplitter stream(parameter, ':');
+ if (!ParseAction(stream, settings.Action) || !stream.GetToken(settings.Lines) || settings.Lines == 0)
return false;
- if ((!stream.GetToken(item)) || !Duration::TryFrom(item, settings.Seconds) || (settings.Seconds == 0))
+ std::string_view item;
+ if (!stream.GetToken(item) || !Duration::TryFrom(item, settings.Seconds) || settings.Seconds == 0)
// Required parameter missing
return false;