PageRenderTime 21ms CodeModel.GetById 9ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #include "llviewerprecompiledheaders.h"
  28. #include "llclassifiedstatsresponder.h"
  29. #include "llpanelclassified.h"
  30. #include "llpanel.h"
  31. #include "llhttpclient.h"
  32. #include "llsdserialize.h"
  33. #include "llviewerregion.h"
  34. #include "llview.h"
  35. #include "message.h"
  36. LLClassifiedStatsResponder::LLClassifiedStatsResponder(LLUUID classified_id)
  37. :
  38. mClassifiedID(classified_id)
  39. {
  40. }
  41. /*virtual*/
  42. void LLClassifiedStatsResponder::result(const LLSD& content)
  43. {
  44. S32 teleport = content["teleport_clicks"].asInteger();
  45. S32 map = content["map_clicks"].asInteger();
  46. S32 profile = content["profile_clicks"].asInteger();
  47. S32 search_teleport = content["search_teleport_clicks"].asInteger();
  48. S32 search_map = content["search_map_clicks"].asInteger();
  49. S32 search_profile = content["search_profile_clicks"].asInteger();
  50. LLPanelClassifiedInfo::setClickThrough(
  51. mClassifiedID,
  52. teleport + search_teleport,
  53. map + search_map,
  54. profile + search_profile,
  55. true);
  56. }
  57. /*virtual*/
  58. void LLClassifiedStatsResponder::error(U32 status, const std::string& reason)
  59. {
  60. llinfos << "LLClassifiedStatsResponder::error("
  61. << status << ": " << reason << ")" << llendl;
  62. }