MAINT-7636 Crash in LLPanelClassifiedInfo::sendClickMessage(..)

meow-7.2.2
Mnikolenko ProductEngine 2017-07-25 17:39:40 +03:00
parent 548b372af2
commit 06c2f24df9
1 changed files with 30 additions and 25 deletions

View File

@ -208,19 +208,21 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key)
LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId());
gGenericDispatcher.addHandler("classifiedclickthrough", &sClassifiedClickThrough);
// While we're at it let's get the stats from the new table if that
// capability exists.
std::string url = gAgent.getRegion()->getCapability("SearchStatRequest");
if (!url.empty())
if (gAgent.getRegion())
{
LL_INFOS() << "Classified stat request via capability" << LL_ENDL;
LLSD body;
LLUUID classifiedId = getClassifiedId();
body["classified_id"] = classifiedId;
LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, body,
boost::bind(&LLPanelClassifiedInfo::handleSearchStatResponse, classifiedId, _1));
// While we're at it let's get the stats from the new table if that
// capability exists.
std::string url = gAgent.getRegion()->getCapability("SearchStatRequest");
if (!url.empty())
{
LL_INFOS() << "Classified stat request via capability" << LL_ENDL;
LLSD body;
LLUUID classifiedId = getClassifiedId();
body["classified_id"] = classifiedId;
LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, body,
boost::bind(&LLPanelClassifiedInfo::handleSearchStatResponse, classifiedId, _1));
}
}
// Update classified click stats.
// *TODO: Should we do this when opening not from search?
sendClickMessage("profile");
@ -540,21 +542,24 @@ void LLPanelClassifiedInfo::sendClickMessage(
const LLVector3d& global_pos,
const std::string& sim_name)
{
// You're allowed to click on your own ads to reassure yourself
// that the system is working.
LLSD body;
body["type"] = type;
body["from_search"] = from_search;
body["classified_id"] = classified_id;
body["parcel_id"] = parcel_id;
body["dest_pos_global"] = global_pos.getValue();
body["region_name"] = sim_name;
if (gAgent.getRegion())
{
// You're allowed to click on your own ads to reassure yourself
// that the system is working.
LLSD body;
body["type"] = type;
body["from_search"] = from_search;
body["classified_id"] = classified_id;
body["parcel_id"] = parcel_id;
body["dest_pos_global"] = global_pos.getValue();
body["region_name"] = sim_name;
std::string url = gAgent.getRegion()->getCapability("SearchStatTracking");
LL_INFOS() << "Sending click msg via capability (url=" << url << ")" << LL_ENDL;
LL_INFOS() << "body: [" << body << "]" << LL_ENDL;
LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, body,
"SearchStatTracking Click report sent.", "SearchStatTracking Click report NOT sent.");
std::string url = gAgent.getRegion()->getCapability("SearchStatTracking");
LL_INFOS() << "Sending click msg via capability (url=" << url << ")" << LL_ENDL;
LL_INFOS() << "body: [" << body << "]" << LL_ENDL;
LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, body,
"SearchStatTracking Click report sent.", "SearchStatTracking Click report NOT sent.");
}
}
void LLPanelClassifiedInfo::sendClickMessage(const std::string& type)