aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llagentlanguage.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llagentlanguage.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llagentlanguage.cpp (renamed from linden/indra/newview/llhippo.cpp)63
1 files changed, 29 insertions, 34 deletions
diff --git a/linden/indra/newview/llhippo.cpp b/linden/indra/newview/llagentlanguage.cpp
index 27c27e8..5656f76 100644
--- a/linden/indra/newview/llhippo.cpp
+++ b/linden/indra/newview/llagentlanguage.cpp
@@ -1,10 +1,10 @@
1/** 1/**
2 * @file llhippo.cpp 2 * @file llagentlanguage.cpp
3 * @brief Create a bug for our users to find 3 * @brief Transmit language information to server
4 * 4 *
5 * $LicenseInfo:firstyear=2003&license=viewergpl$ 5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2003-2008, Linden Research, Inc. 7 * Copyright (c) 2006-2008, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -30,41 +30,36 @@
30 */ 30 */
31 31
32#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
33 33#include "llagentlanguage.h"
34#include "llhippo.h"
35
36#include "llchat.h"
37
38#include "llagent.h" 34#include "llagent.h"
35#include "llviewercontrol.h"
39#include "llviewerregion.h" 36#include "llviewerregion.h"
40#include "llfloaterchat.h" // for add_chat
41 37
42void trigger_hippo_bug(void*) 38LLAgentLanguage::LLAgentLanguage()
43{ 39{
44 BOOL chat = FALSE; 40 gSavedSettings.getControl("Language")->getSignal()->connect(boost::bind(&update));
45 LLViewerRegion* region = gAgent.getRegion(); 41 gSavedSettings.getControl("SystemLanguage")->getSignal()->connect(boost::bind(&update));
46 const char* name = (region ? region->getName().c_str() : NULL); 42 gSavedSettings.getControl("LanguageIsPublic")->getSignal()->connect(boost::bind(&update));
43}
47 44
48 if (name)
49 {
50 if ( name[0] == 'A'
51 || name[0] == 'E'
52 || name[0] == 'I'
53 || name[0] == 'O'
54 || name[0] == 'U')
55 {
56 chat = TRUE;
57 }
58 else if (ll_frand() > 0.5f)
59 {
60 chat = TRUE;
61 }
62 }
63 45
64 if (chat) 46// send language settings to the sim
47// static
48bool LLAgentLanguage::update()
49{
50 LLSD body;
51 std::string url = gAgent.getRegion()->getCapability("UpdateAgentLanguage");
52 if (!url.empty())
65 { 53 {
66 LLChat chat("hippos!"); 54 std::string language = gSavedSettings.getString("Language");
67 chat.mFromName = "Ghostly Bug"; 55 if (language == "default")
68 LLFloaterChat::addChat(chat); 56 language = gSavedSettings.getString("SystemLanguage");
57
58 body["language"] = language;
59 body["language_is_public"] = gSavedSettings.getBOOL("LanguageIsPublic");
60
61 LLHTTPClient::post(url, body, new LLHTTPClient::Responder);
69 } 62 }
63 return true;
70} 64}
65