diff options
Diffstat (limited to 'linden/indra/newview/llpanelclassified.cpp')
-rw-r--r-- | linden/indra/newview/llpanelclassified.cpp | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp index cb75f16..e0f750f 100644 --- a/linden/indra/newview/llpanelclassified.cpp +++ b/linden/indra/newview/llpanelclassified.cpp | |||
@@ -91,7 +91,8 @@ public: | |||
91 | S32 profile_clicks = atoi(strings[3].c_str()); | 91 | S32 profile_clicks = atoi(strings[3].c_str()); |
92 | LLPanelClassified::setClickThrough(classified_id, teleport_clicks, | 92 | LLPanelClassified::setClickThrough(classified_id, teleport_clicks, |
93 | map_clicks, | 93 | map_clicks, |
94 | profile_clicks); | 94 | profile_clicks, |
95 | false); | ||
95 | return true; | 96 | return true; |
96 | } | 97 | } |
97 | }; | 98 | }; |
@@ -127,7 +128,14 @@ LLPanelClassified::LLPanelClassified(BOOL in_finder, bool from_search) | |||
127 | mProfileBtn(NULL), | 128 | mProfileBtn(NULL), |
128 | mInfoText(NULL), | 129 | mInfoText(NULL), |
129 | mSetBtn(NULL), | 130 | mSetBtn(NULL), |
130 | mClickThroughText(NULL) | 131 | mClickThroughText(NULL), |
132 | mTeleportClicksOld(0), | ||
133 | mMapClicksOld(0), | ||
134 | mProfileClicksOld(0), | ||
135 | mTeleportClicksNew(0), | ||
136 | mMapClicksNew(0), | ||
137 | mProfileClicksNew(0) | ||
138 | |||
131 | { | 139 | { |
132 | sAllPanels.push_back(this); | 140 | sAllPanels.push_back(this); |
133 | 141 | ||
@@ -368,16 +376,12 @@ void LLPanelClassified::setClassifiedID(const LLUUID& id) | |||
368 | mClassifiedID = id; | 376 | mClassifiedID = id; |
369 | } | 377 | } |
370 | 378 | ||
371 | void LLPanelClassified::setClickThroughText(const std::string& text) | ||
372 | { | ||
373 | if(mClickThroughText) | ||
374 | this->mClickThroughText->setText(text); | ||
375 | } | ||
376 | //static | 379 | //static |
377 | void LLPanelClassified::setClickThrough(const LLUUID& classified_id, | 380 | void LLPanelClassified::setClickThrough(const LLUUID& classified_id, |
378 | S32 teleport, | 381 | S32 teleport, |
379 | S32 map, | 382 | S32 map, |
380 | S32 profile) | 383 | S32 profile, |
384 | bool from_new_table) | ||
381 | { | 385 | { |
382 | for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) | 386 | for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) |
383 | { | 387 | { |
@@ -388,22 +392,29 @@ void LLPanelClassified::setClickThrough(const LLUUID& classified_id, | |||
388 | continue; | 392 | continue; |
389 | } | 393 | } |
390 | 394 | ||
391 | // We need to see if we should use the new stat table or the old. | 395 | // We need to check to see if the data came from the new stat_table |
392 | // If the SearchStatRequest capability exists, then the data will come | 396 | // or the old classified table. We also need to cache the data from |
393 | // from the new table. | 397 | // the two separate sources so as to display the aggregate totals. |
394 | std::string url = gAgent.getRegion()->getCapability("SearchStatRequest"); | ||
395 | 398 | ||
396 | if (!url.empty()) | 399 | if (from_new_table) |
397 | { | 400 | { |
398 | return; | 401 | self->mTeleportClicksNew = teleport; |
402 | self->mMapClicksNew = map; | ||
403 | self->mProfileClicksNew = profile; | ||
404 | } | ||
405 | else | ||
406 | { | ||
407 | self->mTeleportClicksOld = teleport; | ||
408 | self->mMapClicksOld = map; | ||
409 | self->mProfileClicksOld = profile; | ||
399 | } | 410 | } |
400 | 411 | ||
401 | if (self->mClickThroughText) | 412 | if (self->mClickThroughText) |
402 | { | 413 | { |
403 | std::string msg = llformat("Clicks: %d teleport, %d map, %d profile", | 414 | std::string msg = llformat("Clicks: %d teleport, %d map, %d profile", |
404 | teleport, | 415 | self->mTeleportClicksNew + self->mTeleportClicksOld, |
405 | map, | 416 | self->mMapClicksNew + self->mMapClicksOld, |
406 | profile); | 417 | self->mProfileClicksNew + self->mProfileClicksOld); |
407 | self->mClickThroughText->setText(msg); | 418 | self->mClickThroughText->setText(msg); |
408 | } | 419 | } |
409 | } | 420 | } |
@@ -449,7 +460,7 @@ void LLPanelClassified::sendClassifiedInfoRequest() | |||
449 | if (!url.empty()) | 460 | if (!url.empty()) |
450 | { | 461 | { |
451 | llinfos << "Classified stat request via capability" << llendl; | 462 | llinfos << "Classified stat request via capability" << llendl; |
452 | LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(this->getHandle())); | 463 | LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(this->getHandle(), mClassifiedID)); |
453 | } | 464 | } |
454 | } | 465 | } |
455 | } | 466 | } |
@@ -929,7 +940,6 @@ void LLPanelClassified::sendClassifiedClickMessage(const char* type) | |||
929 | strings.push_back(mClassifiedID.asString()); | 940 | strings.push_back(mClassifiedID.asString()); |
930 | strings.push_back(type); | 941 | strings.push_back(type); |
931 | LLUUID no_invoice; | 942 | LLUUID no_invoice; |
932 | send_generic_message("classifiedclick", strings, no_invoice); | ||
933 | 943 | ||
934 | // New classified click-through handling | 944 | // New classified click-through handling |
935 | LLSD body; | 945 | LLSD body; |
@@ -938,11 +948,16 @@ void LLPanelClassified::sendClassifiedClickMessage(const char* type) | |||
938 | body["classified_id"] = mClassifiedID; | 948 | body["classified_id"] = mClassifiedID; |
939 | std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); | 949 | std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); |
940 | 950 | ||
951 | // If the capability exists send to the new database, otherwise send to the old one. | ||
941 | if (!url.empty()) | 952 | if (!url.empty()) |
942 | { | 953 | { |
943 | llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl; | 954 | llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl; |
944 | LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); | 955 | LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); |
945 | } | 956 | } |
957 | else | ||
958 | { | ||
959 | send_generic_message("classifiedclick", strings, no_invoice); | ||
960 | } | ||
946 | } | 961 | } |
947 | 962 | ||
948 | //////////////////////////////////////////////////////////////////////////////////////////// | 963 | //////////////////////////////////////////////////////////////////////////////////////////// |