Change function signature of getAnonym to return std::string rather than reference and do not return "nobody" in case RLVa is disabled.

master
Nicky 2019-10-09 22:32:19 +02:00
parent 22c24e188a
commit 1d94fc7ce6
5 changed files with 9 additions and 12 deletions

View File

@ -56,7 +56,7 @@ LLControlGroup gWarningSettings("Warnings"); // persists ignored dialogs/warning
#include "llavatarname.h"
// Stub for rlvGetAnonym
const std::string& rlvGetAnonym(const LLAvatarName& avName)
std::string rlvGetAnonym(const LLAvatarName& avName)
{
static std::string strAnonym = "A resident";
return strAnonym;

View File

@ -929,7 +929,7 @@ std::string LLUrlEntryAgentUserName::getName(const LLAvatarName& avatar_name)
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
// Defined in rlvcommon.cpp - redirects to RlvStrings::getAnonym() since we can't really get to that class from here
extern const std::string& rlvGetAnonym(const LLAvatarName& avName);
extern std::string rlvGetAnonym(const LLAvatarName& avName);
//
// LLUrlEntryAgentRLVAnonymizedName Describes an RLV anonymized agent name Url, e.g.,

View File

@ -37,7 +37,7 @@
// [RLVa:KB] - Checked: 2010-11-12 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
// Stub for rlvGetAnonym
const std::string& rlvGetAnonym(const LLAvatarName& avName)
std::string rlvGetAnonym(const LLAvatarName& avName)
{
static std::string strAnonym = "A resident";
return strAnonym;

View File

@ -344,13 +344,10 @@ void RlvStrings::saveToFile(const std::string& strFilePath)
}
// Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a
const std::string& RlvStrings::getAnonym(const std::string& strName)
std::string RlvStrings::getAnonym(const std::string& strName)
{
if (!rlv_handler_t::isEnabled())
{
static std::string strNobody = LLTrans::getString("AvatarNameNobody");
return strNobody;
}
return strName;
const char* pszName = strName.c_str(); U32 nHash = 0;
@ -912,7 +909,7 @@ BOOL rlvEnableSharedWearEnabler(void* pParam)
*/
// Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
const std::string& rlvGetAnonym(const LLAvatarName& avName)
std::string rlvGetAnonym(const LLAvatarName& avName)
{
return RlvStrings::getAnonym(avName);
}

View File

@ -145,8 +145,8 @@ public:
static void loadFromFile(const std::string& strFilePath, bool fDefault);
static void saveToFile(const std::string& strFilePath);
static const std::string& getAnonym(const LLAvatarName& avName); // @shownames
static const std::string& getAnonym(const std::string& strName); // @shownames
static std::string getAnonym(const LLAvatarName& avName); // @shownames
static std::string getAnonym(const std::string& strName); // @shownames
static const std::string& getString(const std::string& strStringName);
static const char* getStringFromReturnCode(ERlvCmdRet eRet);
static const std::string& getStringMapPath() { return m_StringMapPath; }
@ -307,7 +307,7 @@ template<typename T> struct RlvPredValuesEqual
//
// Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
inline const std::string& RlvStrings::getAnonym(const LLAvatarName& avName)
inline std::string RlvStrings::getAnonym(const LLAvatarName& avName)
{
return getAnonym(avName.getLegacyName());
}