PageRenderTime 98ms CodeModel.GetById 76ms app.highlight 5ms RepoModel.GetById 15ms app.codeStats 0ms

/indra/newview/llclassifiedstatsresponder.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 69 lines | 34 code | 7 blank | 28 comment | 0 complexity | 37673d06173e9c87a31ec5ea5375ff8d MD5 | raw file
 1/** 
 2 * @file llclassifiedstatsresponder.cpp
 3 * @brief Receives information about classified ad click-through
 4 * counts for display in the classified information UI.
 5 *
 6 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include "llclassifiedstatsresponder.h"
31
32#include "llpanelclassified.h"
33#include "llpanel.h"
34#include "llhttpclient.h"
35#include "llsdserialize.h"
36#include "llviewerregion.h"
37#include "llview.h"
38#include "message.h"
39
40LLClassifiedStatsResponder::LLClassifiedStatsResponder(LLUUID classified_id)
41:
42mClassifiedID(classified_id)
43{
44}
45
46/*virtual*/
47void LLClassifiedStatsResponder::result(const LLSD& content)
48{
49	S32 teleport = content["teleport_clicks"].asInteger();
50	S32 map = content["map_clicks"].asInteger();
51	S32 profile = content["profile_clicks"].asInteger();
52	S32 search_teleport = content["search_teleport_clicks"].asInteger();
53	S32 search_map = content["search_map_clicks"].asInteger();
54	S32 search_profile = content["search_profile_clicks"].asInteger();
55
56	LLPanelClassifiedInfo::setClickThrough(
57		mClassifiedID, 
58		teleport + search_teleport, 
59		map + search_map,
60		profile + search_profile,
61		true);
62}
63
64/*virtual*/
65void LLClassifiedStatsResponder::error(U32 status, const std::string& reason)
66{
67	llinfos << "LLClassifiedStatsResponder::error("
68		<< status << ": " << reason << ")" << llendl;
69}