INT-142 - add build number to 'Specify version' in Firestorm groupchats

Patch by Chaser Zaks
master
Liny 2019-06-18 16:28:59 -07:00
parent 11ddc21c81
commit e95fc10271
8 changed files with 158 additions and 14 deletions

View File

@ -1027,6 +1027,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>FSSupportGroupChatPrefixTesting</key>
<map>
<key>Comment</key>
<string>Adds (W 56789f* os) to testing group chat</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>AutoCloseOOC</key>
<map>
<key>Comment</key>

View File

@ -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)

View File

@ -60,11 +60,14 @@ public:
};
std::set<LLUUID> mSupportGroup;
std::set<LLUUID> 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);

View File

@ -386,8 +386,9 @@ void FSFloaterIM::sendMsgFromInputEditor(EChatType type)
utf8_text = FSCommon::applyMuPose(utf8_text);
// <FS:Techwolf Lupindo> Support group chat prefix
static LLCachedControl<bool> chat_prefix(gSavedSettings, "FSSupportGroupChatPrefix2");
if (chat_prefix && FSData::getInstance()->isSupportGroup(mSessionID))
static LLCachedControl<bool> chat_prefix_support(gSavedSettings, "FSSupportGroupChatPrefix2");
static LLCachedControl<bool> chat_prefix_testing(gSavedSettings, "FSSupportGroupChatPrefixTesting");
if ((chat_prefix_support || chat_prefix_testing) && FSData::getInstance()->isFirestormGroup(mSessionID))
{
// <FS:PP> FIRE-7075: Skin indicator
static LLCachedControl<std::string> 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.
}
// </FS:PP>
//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<bool> 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 + ") "));
}
// <FS:Techwolf Lupindo> Allow user to send system info.
@ -887,9 +916,19 @@ BOOL FSFloaterIM::postBuild()
getChild<LLButton>("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);
// <FS:Zi> Viewer version popup
if (isFSSupportGroup)
{

View File

@ -85,6 +85,22 @@ const std::string &LLVersionInfo::getVersion()
return version;
}
//<FS:CZ>
//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;
}
//</FS:CZ>
//static
const std::string &LLVersionInfo::getShortVersion()
{

View File

@ -56,6 +56,11 @@ public:
/// return the full viewer version as a string like "2.0.0.200030"
static const std::string &getVersion();
//<FS:CZ>
/// return the full viewer version as a string like "200030"
static const std::string &getBuildVersion();
//</FS:CZ>
/// return the viewer version as a string like "2.0.0"
static const std::string &getShortVersion();

View File

@ -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" />
<!-- END: FS Prefix -->
</layout_panel>
<layout_panel
name="testing_panel"
auto_resize="false"
user_resize="false"
top="0"
layout="topleft"
height="20"
width="105"
follows="left|top">
<icon
follows="left|right"
image_name="Toolbar_Middle_Off"
left="2"
name="dummy_icon_support_group_testing"
top="0"
height="20"
width="103"/>
<check_box
control_name="FSSupportGroupChatPrefixTesting"
follows="left|top"
height="19"
label="Specify build"
layout="topleft"
top="0"
left_delta="5"
name="FSSupportGroupChatPrefixTesting_toggle"
tool_tip="Adds your current viewer build 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. (This is seperate from the support groups)"
width="100" />
</layout_panel>
<!-- END: FS Prefix -->
<layout_panel
name="lp_bar"
auto_resize="true"

View File

@ -429,8 +429,29 @@
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" />
<!-- END: FS Prefix -->
</layout_panel>
<layout_panel
name="testing_panel"
auto_resize="false"
user_resize="false"
top="0"
layout="topleft"
height="20"
width="115"
follows="left|top">
<check_box
control_name="FSSupportGroupChatPrefixTesting"
follows="left|top"
height="19"
label="Specify build"
layout="topleft"
top="0"
left_delta="5"
name="FSSupportGroupChatPrefixTesting_toggle"
tool_tip="Adds your current viewer build 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. (This is seperate from the support groups)"
width="110" />
</layout_panel>
<!-- END: FS Prefix -->
</layout_stack>
<layout_stack