aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelclassified.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpanelclassified.cpp49
1 files changed, 46 insertions, 3 deletions
diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp
index 1e93c12..cb75f16 100644
--- a/linden/indra/newview/llpanelclassified.cpp
+++ b/linden/indra/newview/llpanelclassified.cpp
@@ -47,9 +47,11 @@
47#include "llbutton.h" 47#include "llbutton.h"
48#include "llcheckboxctrl.h" 48#include "llcheckboxctrl.h"
49#include "llclassifiedflags.h" 49#include "llclassifiedflags.h"
50#include "llclassifiedstatsresponder.h"
50#include "llviewercontrol.h" 51#include "llviewercontrol.h"
51#include "lllineeditor.h" 52#include "lllineeditor.h"
52#include "llfloateravatarinfo.h" 53#include "llfloateravatarinfo.h"
54#include "llfloaterclassified.h"
53#include "lltabcontainervertical.h" 55#include "lltabcontainervertical.h"
54#include "lltextbox.h" 56#include "lltextbox.h"
55#include "llcombobox.h" 57#include "llcombobox.h"
@@ -62,6 +64,7 @@
62#include "llworldmap.h" 64#include "llworldmap.h"
63#include "llfloaterworldmap.h" 65#include "llfloaterworldmap.h"
64#include "llviewergenericmessage.h" // send_generic_message 66#include "llviewergenericmessage.h" // send_generic_message
67#include "llviewerregion.h"
65#include "llviewerwindow.h" // for window width, height 68#include "llviewerwindow.h" // for window width, height
66#include "viewer.h" // app_abort_quit() 69#include "viewer.h" // app_abort_quit()
67 70
@@ -98,9 +101,10 @@ static LLDispatchClassifiedClickThrough sClassifiedClickThrough;
98//static 101//static
99std::list<LLPanelClassified*> LLPanelClassified::sAllPanels; 102std::list<LLPanelClassified*> LLPanelClassified::sAllPanels;
100 103
101LLPanelClassified::LLPanelClassified(BOOL in_finder) 104LLPanelClassified::LLPanelClassified(BOOL in_finder, bool from_search)
102: LLPanel("Classified Panel"), 105: LLPanel("Classified Panel"),
103 mInFinder(in_finder), 106 mInFinder(in_finder),
107 mFromSearch(from_search),
104 mDirty(false), 108 mDirty(false),
105 mForceClose(false), 109 mForceClose(false),
106 mLocationChanged(false), 110 mLocationChanged(false),
@@ -225,7 +229,7 @@ BOOL LLPanelClassified::postBuild()
225 mMatureCheck = LLViewerUICtrlFactory::getCheckBoxByName(this, "classified_mature_check"); 229 mMatureCheck = LLViewerUICtrlFactory::getCheckBoxByName(this, "classified_mature_check");
226 mMatureCheck->setCommitCallback(onCommitAny); 230 mMatureCheck->setCommitCallback(onCommitAny);
227 mMatureCheck->setCallbackUserData(this); 231 mMatureCheck->setCallbackUserData(this);
228 if (gAgent.mAccess < SIM_ACCESS_MATURE) 232 if (gAgent.isTeen())
229 { 233 {
230 // Teens don't get to set mature flag. JC 234 // Teens don't get to set mature flag. JC
231 mMatureCheck->setVisible(FALSE); 235 mMatureCheck->setVisible(FALSE);
@@ -364,7 +368,11 @@ void LLPanelClassified::setClassifiedID(const LLUUID& id)
364 mClassifiedID = id; 368 mClassifiedID = id;
365} 369}
366 370
367 371void LLPanelClassified::setClickThroughText(const std::string& text)
372{
373 if(mClickThroughText)
374 this->mClickThroughText->setText(text);
375}
368//static 376//static
369void LLPanelClassified::setClickThrough(const LLUUID& classified_id, 377void LLPanelClassified::setClickThrough(const LLUUID& classified_id,
370 S32 teleport, 378 S32 teleport,
@@ -380,6 +388,16 @@ void LLPanelClassified::setClickThrough(const LLUUID& classified_id,
380 continue; 388 continue;
381 } 389 }
382 390
391 // We need to see if we should use the new stat table or the old.
392 // If the SearchStatRequest capability exists, then the data will come
393 // from the new table.
394 std::string url = gAgent.getRegion()->getCapability("SearchStatRequest");
395
396 if (!url.empty())
397 {
398 return;
399 }
400
383 if (self->mClickThroughText) 401 if (self->mClickThroughText)
384 { 402 {
385 std::string msg = llformat("Clicks: %d teleport, %d map, %d profile", 403 std::string msg = llformat("Clicks: %d teleport, %d map, %d profile",
@@ -421,6 +439,18 @@ void LLPanelClassified::sendClassifiedInfoRequest()
421 439
422 mDataRequested = TRUE; 440 mDataRequested = TRUE;
423 mRequestedID = mClassifiedID; 441 mRequestedID = mClassifiedID;
442
443 // While we're at it let's get the stats from the new table if that
444 // capability exists.
445 std::string url = gAgent.getRegion()->getCapability("SearchStatRequest");
446 LLSD body;
447 body["classified_id"] = mClassifiedID;
448
449 if (!url.empty())
450 {
451 llinfos << "Classified stat request via capability" << llendl;
452 LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(this->getHandle()));
453 }
424 } 454 }
425} 455}
426 456
@@ -900,6 +930,19 @@ void LLPanelClassified::sendClassifiedClickMessage(const char* type)
900 strings.push_back(type); 930 strings.push_back(type);
901 LLUUID no_invoice; 931 LLUUID no_invoice;
902 send_generic_message("classifiedclick", strings, no_invoice); 932 send_generic_message("classifiedclick", strings, no_invoice);
933
934 // New classified click-through handling
935 LLSD body;
936 body["type"] = type;
937 body["from_search"] = mFromSearch;
938 body["classified_id"] = mClassifiedID;
939 std::string url = gAgent.getRegion()->getCapability("SearchStatTracking");
940
941 if (!url.empty())
942 {
943 llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl;
944 LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
945 }
903} 946}
904 947
905//////////////////////////////////////////////////////////////////////////////////////////// 948////////////////////////////////////////////////////////////////////////////////////////////