Skip to content
Snippets Groups Projects
Commit b60274fa authored by Vadim Savchuk's avatar Vadim Savchuk
Browse files

WIP on EXT-5687 (Classifieds are missing the clickthrough data).

Updating classieifed click stats when user presses "Teleport" or "Map" button in the picks/classifieds list side panel.

--HG--
branch : product-engine
parent eeb6e89e
No related branches found
No related tags found
No related merge requests found
...@@ -1548,17 +1548,25 @@ void LLPanelClassifiedInfo::stretchSnapshot() ...@@ -1548,17 +1548,25 @@ void LLPanelClassifiedInfo::stretchSnapshot()
mSnapshotStreched = true; mSnapshotStreched = true;
} }
void LLPanelClassifiedInfo::sendClickMessage(const std::string& type) // static
// *TODO: move out of the panel
void LLPanelClassifiedInfo::sendClickMessage(
const std::string& type,
bool from_search,
const LLUUID& classified_id,
const LLUUID& parcel_id,
const LLVector3d& global_pos,
const std::string& sim_name)
{ {
// You're allowed to click on your own ads to reassure yourself // You're allowed to click on your own ads to reassure yourself
// that the system is working. // that the system is working.
LLSD body; LLSD body;
body["type"] = type; body["type"] = type;
body["from_search"] = fromSearch(); body["from_search"] = from_search;
body["classified_id"] = getClassifiedId(); body["classified_id"] = classified_id;
body["parcel_id"] = getParcelId(); body["parcel_id"] = parcel_id;
body["dest_pos_global"] = getPosGlobal().getValue(); body["dest_pos_global"] = global_pos.getValue();
body["region_name"] = getSimName(); body["region_name"] = sim_name;
std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); std::string url = gAgent.getRegion()->getCapability("SearchStatTracking");
llinfos << "Sending click msg via capability (url=" << url << ")" << llendl; llinfos << "Sending click msg via capability (url=" << url << ")" << llendl;
...@@ -1566,6 +1574,18 @@ void LLPanelClassifiedInfo::sendClickMessage(const std::string& type) ...@@ -1566,6 +1574,18 @@ void LLPanelClassifiedInfo::sendClickMessage(const std::string& type)
LLHTTPClient::post(url, body, new LLClassifiedClickMessageResponder()); LLHTTPClient::post(url, body, new LLClassifiedClickMessageResponder());
} }
void LLPanelClassifiedInfo::sendClickMessage(const std::string& type)
{
sendClickMessage(
type,
fromSearch(),
getClassifiedId(),
getParcelId(),
getPosGlobal(),
getSimName());
}
void LLPanelClassifiedInfo::onMapClick() void LLPanelClassifiedInfo::onMapClick()
{ {
sendClickMessage("map"); sendClickMessage("map");
......
...@@ -266,6 +266,14 @@ class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver ...@@ -266,6 +266,14 @@ class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver
S32 profile, S32 profile,
bool from_new_table); bool from_new_table);
static void sendClickMessage(
const std::string& type,
bool from_search,
const LLUUID& classified_id,
const LLUUID& parcel_id,
const LLVector3d& global_pos,
const std::string& sim_name);
void setExitCallback(const commit_callback_t& cb); void setExitCallback(const commit_callback_t& cb);
void setEditClassifiedCallback(const commit_callback_t& cb); void setEditClassifiedCallback(const commit_callback_t& cb);
......
...@@ -578,7 +578,11 @@ void LLPanelPicks::onClickTeleport() ...@@ -578,7 +578,11 @@ void LLPanelPicks::onClickTeleport()
if(pick_item) if(pick_item)
pos = pick_item->getPosGlobal(); pos = pick_item->getPosGlobal();
else if(c_item) else if(c_item)
{
pos = c_item->getPosGlobal(); pos = c_item->getPosGlobal();
LLPanelClassifiedInfo::sendClickMessage("teleport", false,
c_item->getClassifiedId(), LLUUID::null, pos, LLStringUtil::null);
}
if (!pos.isExactlyZero()) if (!pos.isExactlyZero())
{ {
...@@ -597,7 +601,11 @@ void LLPanelPicks::onClickMap() ...@@ -597,7 +601,11 @@ void LLPanelPicks::onClickMap()
if (pick_item) if (pick_item)
pos = pick_item->getPosGlobal(); pos = pick_item->getPosGlobal();
else if(c_item) else if(c_item)
{
LLPanelClassifiedInfo::sendClickMessage("map", false,
c_item->getClassifiedId(), LLUUID::null, pos, LLStringUtil::null);
pos = c_item->getPosGlobal(); pos = c_item->getPosGlobal();
}
LLFloaterWorldMap::getInstance()->trackLocation(pos); LLFloaterWorldMap::getInstance()->trackLocation(pos);
LLFloaterReg::showInstance("world_map", "center"); LLFloaterReg::showInstance("world_map", "center");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment