summaryrefslogtreecommitdiff
path: root/indra/newview/rlvcommon.h
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2024-09-02 01:39:17 +0200
committerKitty Barnett <develop@catznip.com>2024-09-02 01:39:17 +0200
commit7402fe6412e98e4b295ee3e04874f379c752f7a0 (patch)
tree65b3bfb411094953f7e2cac6df9d0c73462cb49e /indra/newview/rlvcommon.h
parentb82e9b73d35e41ed51063905dd31ccced9e97266 (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;
+ }
-// ============================================================================
+ // ============================================================================
+}