summaryrefslogtreecommitdiff
path: root/indra/newview/rlvcommon.h
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2024-09-02 01:39:17 +0200
committerErik Kundiman <erik@megapahit.org>2025-05-11 16:27:57 +0800
commit838a398036ec96f2fd2149c0560182913e00860b (patch)
tree17a7e9749e9b5edb323f90f0729a0dfd160d26cd /indra/newview/rlvcommon.h
parent3558444264ce3dce900f75156033bcf3956360b7 (diff)
Add basic scaffolding to support reply commands and handle @versionXXX as an illustration
Diffstat (limited to 'indra/newview/rlvcommon.h')
-rw-r--r--indra/newview/rlvcommon.h49
1 files changed, 37 insertions, 12 deletions
diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h
index 288d48e373..79ac6e1704 100644
--- a/indra/newview/rlvcommon.h
+++ b/indra/newview/rlvcommon.h
@@ -1,16 +1,41 @@
#pragma once
-// ============================================================================
-// RlvStrings
-//
-
-class RlvStrings
+namespace Rlv
{
-public:
- static std::string getVersion(bool wants_legacy);
- static std::string getVersionAbout();
- static std::string getVersionImplNum();
- static std::string getVersionNum();
-};
+ // ============================================================================
+ // RlvStrings
+ //
+
+ class Strings
+ {
+ public:
+ static std::string getVersion(bool wants_legacy);
+ static std::string getVersionAbout();
+ static std::string getVersionImplNum();
+ static std::string getVersionNum();
+ };
+
+ // ============================================================================
+ // RlvUtil
+ //
+
+ namespace Util
+ {
+ bool isValidReplyChannel(S32 nChannel, bool isLoopback = false);
+ bool sendChatReply(S32 nChannel, const std::string& strUTF8Text);
+ bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text);
+ };
+
+ inline bool Util::isValidReplyChannel(S32 nChannel, bool isLoopback)
+ {
+ return (nChannel > (!isLoopback ? 0 : -1)) && (CHAT_CHANNEL_DEBUG != nChannel);
+ }
+
+ inline bool Util::sendChatReply(const std::string& strChannel, const std::string& strUTF8Text)
+ {
+ S32 nChannel;
+ return LLStringUtil::convertToS32(strChannel, nChannel) ? sendChatReply(nChannel, strUTF8Text) : false;
+ }
-// ============================================================================
+ // ============================================================================
+}