aboutsummaryrefslogtreecommitdiffstats
path: root/include/clientprotocolmsg.h
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-06-17 15:37:26 +0100
committerGravatar Sadie Powell2026-06-17 15:39:58 +0100
commit33ab04fef638ab7fb6ec2eeea983b58c7e96c02f (patch)
tree6bd4da6a42df3deff3a7f955f56fa22c88f6a6f4 /include/clientprotocolmsg.h
parentMerge branch 'insp4' into master. (diff)
parentAllow an event hook for after messages are sent to a client. (diff)
Merge branch 'insp4' into master.
Diffstat (limited to 'include/clientprotocolmsg.h')
-rw-r--r--include/clientprotocolmsg.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/clientprotocolmsg.h b/include/clientprotocolmsg.h
index 285475cbd..243d5c423 100644
--- a/include/clientprotocolmsg.h
+++ b/include/clientprotocolmsg.h
@@ -49,19 +49,22 @@ namespace ClientProtocol
class CoreExport ClientProtocol::Messages::Numeric
: public ClientProtocol::Message
{
+private:
+ unsigned int numeric;
char numericstr[4];
- void InitCommand(unsigned int number)
+ void InitCommand(unsigned int num)
{
- snprintf(numericstr, sizeof(numericstr), "%03u", number);
+ this->numeric = num;
+ snprintf(numericstr, sizeof(numericstr), "%03u", num);
SetCommand(numericstr);
}
- void InitFromNumeric(const ::Numeric::Numeric& numeric)
+ void InitFromNumeric(const ::Numeric::Numeric& num)
{
- AddTags(numeric.GetParams().GetTags());
- InitCommand(numeric.GetNumeric());
- for (const auto& param : numeric.GetParams())
+ AddTags(num.GetParams().GetTags());
+ InitCommand(num.GetNumeric());
+ for (const auto& param : num.GetParams())
PushParamRef(param);
}
@@ -100,6 +103,9 @@ public:
InitCommand(num);
PushParam("*");
}
+
+ /** Retrieves the underlying numeric for this message. */
+ auto GetNumeric() const { return this->numeric; }
};
class CoreExport ClientProtocol::Messages::Reply