summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-02-04 18:06:17 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-02-04 18:06:17 +0200
commitca6121979c6716aaf986fc6d0d469383471469f4 (patch)
treefb9be357745c845a4abae4853b0f1d13cef0dd31
parent2351809b5cb71d17461a6bec2041cbc1ad2efc91 (diff)
SL-14796 Updated code accordingly to changed event order
-rw-r--r--indra/newview/llagent.cpp30
-rw-r--r--indra/newview/llagent.h4
-rw-r--r--indra/newview/llchathistory.cpp1
3 files changed, 14 insertions, 21 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f31135ad4c..3c50493d79 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -387,6 +387,7 @@ LLAgent::LLAgent() :
mTeleportFinishedSlot(),
mTeleportFailedSlot(),
mIsMaturityRatingChangingDuringTeleport(false),
+ mTPNeedsNeabyChatSeparator(false),
mMaturityRatingChange(0U),
mIsDoSendMaturityPreferenceToServer(false),
mMaturityPreferenceRequestId(0U),
@@ -519,10 +520,6 @@ void LLAgent::cleanup()
{
mTeleportFailedSlot.disconnect();
}
- if (mParcelMgrConnection.connected())
- {
- mParcelMgrConnection.disconnect();
- }
}
//-----------------------------------------------------------------------------
@@ -3938,10 +3935,7 @@ void LLAgent::clearTeleportRequest()
LLVoiceClient::getInstance()->setHidden(FALSE);
}
mTeleportRequest.reset();
- if (mParcelMgrConnection.connected())
- {
- mParcelMgrConnection.disconnect();
- }
+ mTPNeedsNeabyChatSeparator = false;
}
void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange)
@@ -3953,7 +3947,7 @@ void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange)
void LLAgent::sheduleTeleportIM()
{
// is supposed to be called during teleport so we are still waiting for parcel
- mParcelMgrConnection = addParcelChangedCallback(onParcelReadyAfterTeleport);
+ mTPNeedsNeabyChatSeparator = true;
}
bool LLAgent::hasPendingTeleportRequest()
@@ -4003,6 +3997,12 @@ void LLAgent::startTeleportRequest()
void LLAgent::handleTeleportFinished()
{
LL_INFOS("Teleport") << "Agent handling teleport finished." << LL_ENDL;
+ if (mTPNeedsNeabyChatSeparator)
+ {
+ // parcel is ready at this point
+ addTPNearbyChatSeparator();
+ mTPNeedsNeabyChatSeparator = false;
+ }
clearTeleportRequest();
mTeleportCanceled.reset();
if (mIsMaturityRatingChangingDuringTeleport)
@@ -4066,14 +4066,11 @@ void LLAgent::handleTeleportFailed()
mIsMaturityRatingChangingDuringTeleport = false;
}
- if (mParcelMgrConnection.connected())
- {
- mParcelMgrConnection.disconnect();
- }
+ mTPNeedsNeabyChatSeparator = false;
}
/*static*/
-void LLAgent::onParcelReadyAfterTeleport()
+void LLAgent::addTPNearbyChatSeparator()
{
LLViewerRegion* agent_region = gAgent.getRegion();
LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
@@ -4106,11 +4103,6 @@ void LLAgent::onParcelReadyAfterTeleport()
args["do_not_log"] = TRUE;
nearby_chat->addMessage(chat, true, args);
}
-
- if (gAgent.mParcelMgrConnection.connected())
- {
- gAgent.mParcelMgrConnection.disconnect();
- }
}
/*static*/
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 8f8c2f6007..a792d3e11f 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -668,9 +668,9 @@ private:
LLTeleportRequestPtr mTeleportCanceled;
boost::signals2::connection mTeleportFinishedSlot;
boost::signals2::connection mTeleportFailedSlot;
- boost::signals2::connection mParcelMgrConnection;
bool mIsMaturityRatingChangingDuringTeleport;
+ bool mTPNeedsNeabyChatSeparator;
U8 mMaturityRatingChange;
bool hasPendingTeleportRequest();
@@ -687,7 +687,7 @@ private:
void handleTeleportFinished();
void handleTeleportFailed();
- static void onParcelReadyAfterTeleport();
+ static void addTPNearbyChatSeparator();
static void onCapabilitiesReceivedAfterTeleport();
//--------------------------------------------------------------------
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 2bb68dbbbe..c110e0d815 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -739,6 +739,7 @@ public:
break;
case CHAT_SOURCE_SYSTEM:
icon->setValue(LLSD("SL_Logo"));
+ break;
case CHAT_SOURCE_TELEPORT:
icon->setValue(LLSD("Command_Destinations_Icon"));
break;