From e95fc1027107085939bb53135870f69beb4d2e7b Mon Sep 17 00:00:00 2001 From: Liny Date: Tue, 18 Jun 2019 16:28:59 -0700 Subject: [PATCH] INT-142 - add build number to 'Specify version' in Firestorm groupchats Patch by Chaser Zaks --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/fsdata.cpp | 22 ++++++- indra/newview/fsdata.h | 3 + indra/newview/fsfloaterim.cpp | 61 +++++++++++++++---- indra/newview/llversioninfo.cpp | 16 +++++ indra/newview/llversioninfo.h | 5 ++ .../default/xui/en/floater_fs_im_session.xml | 31 +++++++++- .../vintage/xui/en/floater_fs_im_session.xml | 23 ++++++- 8 files changed, 158 insertions(+), 14 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f899151476..71a2d2f6c6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1027,6 +1027,17 @@ Value 0 + FSSupportGroupChatPrefixTesting + + Comment + Adds (W 56789f* os) to testing group chat + Persist + 1 + Type + Boolean + Value + 0 + AutoCloseOOC Comment diff --git a/indra/newview/fsdata.cpp b/indra/newview/fsdata.cpp index 0c25e81319..ec11b9d502 100644 --- a/indra/newview/fsdata.cpp +++ b/indra/newview/fsdata.cpp @@ -563,6 +563,16 @@ void FSData::processAgents(const LLSD& data) } } + if (data.has("TestingGroups")) + { + const LLSD& testing_groups = data["TestingGroups"]; + for(LLSD::map_const_iterator itr = testing_groups.beginMap(); itr != testing_groups.endMap(); ++itr) + { + mTestingGroup.insert(LLUUID(itr->first)); + LL_DEBUGS("fsdata") << "Added " << itr->first << " to mTestingGroup" << LL_ENDL; + } + } + // The presence of just the key is enough to determine that legacy search needs to be disabled on this grid. if (data.has("DisableLegacySearch")) { @@ -821,9 +831,19 @@ LLSD FSData::allowedLogin() } } +bool FSData::isFirestormGroup(const LLUUID& id) +{ + return mSupportGroup.count(id) || mTestingGroup.count(id); +} + bool FSData::isSupportGroup(const LLUUID& id) { - return (mSupportGroup.count(id)); + return mSupportGroup.count(id); +} + +bool FSData::isTestingGroup(const LLUUID& id) +{ + return mTestingGroup.count(id); } bool FSData::isAgentFlag(const LLUUID& agent_id, flags_t flag) diff --git a/indra/newview/fsdata.h b/indra/newview/fsdata.h index 769aa4203e..6bfe2b77b2 100644 --- a/indra/newview/fsdata.h +++ b/indra/newview/fsdata.h @@ -60,11 +60,14 @@ public: }; std::set mSupportGroup; + std::set mTestingGroup; bool isDeveloper(const LLUUID& avatar_id); bool isSupport(const LLUUID& avatar_id); bool isQA(const LLUUID& avatar_id); + bool isFirestormGroup(const LLUUID& id); bool isSupportGroup(const LLUUID& id); + bool isTestingGroup(const LLUUID& id); // returns -1 if agent is not found. S32 getAgentFlags(const LLUUID& avatar_id); diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp index 1d3183a88e..bb34dbe98b 100644 --- a/indra/newview/fsfloaterim.cpp +++ b/indra/newview/fsfloaterim.cpp @@ -386,8 +386,9 @@ void FSFloaterIM::sendMsgFromInputEditor(EChatType type) utf8_text = FSCommon::applyMuPose(utf8_text); // Support group chat prefix - static LLCachedControl chat_prefix(gSavedSettings, "FSSupportGroupChatPrefix2"); - if (chat_prefix && FSData::getInstance()->isSupportGroup(mSessionID)) + static LLCachedControl chat_prefix_support(gSavedSettings, "FSSupportGroupChatPrefix2"); + static LLCachedControl chat_prefix_testing(gSavedSettings, "FSSupportGroupChatPrefixTesting"); + if ((chat_prefix_support || chat_prefix_testing) && FSData::getInstance()->isFirestormGroup(mSessionID)) { // FIRE-7075: Skin indicator static LLCachedControl FSInternalSkinCurrent(gSavedSettings, "FSInternalSkinCurrent"); @@ -402,18 +403,46 @@ void FSFloaterIM::sendMsgFromInputEditor(EChatType type) skin_indicator = skin_indicator.substr(0, 1); // "FS 4.4.1f os", "FS 4.4.1v", "FS 4.4.1a", "FS 4.4.1s os", "FS 4.4.1m os" etc. } // - + + //Address size check #if ADDRESS_SIZE == 32 - std::string str_fs_tag = "FS "; + std::string str_address_size_tag = "32"; #else - std::string str_fs_tag = "FS64 "; + std::string str_address_size_tag = ""; #endif - std::string str_os_tag; + + //OpenSim check + std::string str_opensim_tag; #ifdef OPENSIM - str_os_tag = " os"; + str_opensim_tag = " os"; #endif + + //Operating System check +#if LL_WINDOWS + std::string str_operating_system_tag = "W"; +#elif LL_LINUX + std::string str_operating_system_tag = "L"; +#elif LL_DARWIN + std::string str_operating_system_tag = "M"; +#endif + + //RLV check + static LLCachedControl chat_prefix_rlv(gSavedSettings, "RestrainedLove"); + std::string str_rlv_enabled = ""; + if(chat_prefix_rlv) + str_rlv_enabled = "*"; + + + //Build it up size_t insert_pos = is_irc_me_prefix(utf8_text) ? 4 : 0; - utf8_text.insert(insert_pos, ("(" + str_fs_tag + LLVersionInfo::getShortVersion() + skin_indicator + str_os_tag + ") ")); + + //For testing/beta groups, we display the build version since it doesn't speed by and this might change often + if(chat_prefix_testing && FSData::getInstance()->isTestingGroup(mSessionID)) + utf8_text.insert(insert_pos, ("(" + str_address_size_tag + str_operating_system_tag + " " + LLVersionInfo::getBuildVersion() + skin_indicator + str_rlv_enabled + str_opensim_tag + ") ")); + + //For release support groups, only display the short version(Major.Minor.Patch) since chat can speed by. This makes it easier on Support's eyes. + else if(chat_prefix_support && FSData::getInstance()->isSupportGroup(mSessionID)) + utf8_text.insert(insert_pos, ("(" + str_address_size_tag + str_operating_system_tag + " " + LLVersionInfo::getShortVersion() + skin_indicator + str_rlv_enabled + str_opensim_tag + ") ")); } // Allow user to send system info. @@ -887,9 +916,19 @@ BOOL FSFloaterIM::postBuild() getChild("send_chat")->setCommitCallback(boost::bind(&FSFloaterIM::sendMsgFromInputEditor, this, CHAT_TYPE_NORMAL)); - bool isFSSupportGroup = FSData::getInstance()->isSupportGroup(mSessionID); - childSetVisible("support_panel", isFSSupportGroup); - + bool isFSSupportGroup = FSData::getInstance()->isFirestormGroup(mSessionID); + + //Hide them first + childSetVisible("testing_panel", FALSE); + childSetVisible("support_panel", FALSE); + + //Then show them if they are relevant + if(FSData::getInstance()->isTestingGroup(mSessionID)) + childSetVisible("testing_panel", TRUE); + + else if(FSData::getInstance()->isSupportGroup(mSessionID)) + childSetVisible("support_panel", TRUE); + // Viewer version popup if (isFSSupportGroup) { diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 3d000d4267..8d5168ba24 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -85,6 +85,22 @@ const std::string &LLVersionInfo::getVersion() return version; } +// +//static +const std::string &LLVersionInfo::getBuildVersion() +{ + static std::string build_version(""); + if (build_version.empty()) + { + std::ostringstream stream; + stream << LLVersionInfo::getBuild(); + // cache the version string + build_version = stream.str(); + } + return build_version; +} +// + //static const std::string &LLVersionInfo::getShortVersion() { diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h index 5c3b7bf878..fed6b0efb5 100644 --- a/indra/newview/llversioninfo.h +++ b/indra/newview/llversioninfo.h @@ -56,6 +56,11 @@ public: /// return the full viewer version as a string like "2.0.0.200030" static const std::string &getVersion(); +// + /// return the full viewer version as a string like "200030" + static const std::string &getBuildVersion(); +// + /// return the viewer version as a string like "2.0.0" static const std::string &getShortVersion(); diff --git a/indra/newview/skins/default/xui/en/floater_fs_im_session.xml b/indra/newview/skins/default/xui/en/floater_fs_im_session.xml index 8931b32e2f..ac2d45a1b1 100644 --- a/indra/newview/skins/default/xui/en/floater_fs_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_fs_im_session.xml @@ -452,8 +452,37 @@ name="FSSupportGroupChatPrefix_toggle" tool_tip="Adds your current viewer version and skin information to the front of messages sent by you to this group which will assist support staff in correctly diagnosing your issues and improve accuracy in answering your questions" width="110" /> - + + + + + - + + + +