aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/llagent.cpp26
-rw-r--r--linden/indra/newview/llagent.h1
-rw-r--r--linden/indra/newview/llstartup.cpp40
-rw-r--r--linden/indra/newview/llviewerregion.cpp16
5 files changed, 83 insertions, 11 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index e9705de..7cc10af 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -5734,6 +5734,17 @@
5734 <key>Value</key> 5734 <key>Value</key>
5735 <real>6.0</real> 5735 <real>6.0</real>
5736 </map> 5736 </map>
5737 <key>PreferredMaturity</key>
5738 <map>
5739 <key>Comment</key>
5740 <string>Setting for the user's preferred maturity level.</string>
5741 <key>Persist</key>
5742 <integer>1</integer>
5743 <key>Type</key>
5744 <string>U32</string>
5745 <key>Value</key>
5746 <integer>13</integer>
5747 </map>
5737 <key>PreviewAnimRect</key> 5748 <key>PreviewAnimRect</key>
5738 <map> 5749 <map>
5739 <key>Comment</key> 5750 <key>Comment</key>
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index edcb82c..e6438f4 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -4894,6 +4894,32 @@ void LLAgent::setTeen(bool teen)
4894 } 4894 }
4895} 4895}
4896 4896
4897//static
4898void LLAgent::convertTextToMaturity(char text) // HACK: remove when based on 1.23
4899{
4900 if ('A' == text)
4901 {
4902 mAccess = SIM_ACCESS_ADULT;
4903 //return SIM_ACCESS_ADULT;
4904 }
4905 else if ('M'== text)
4906 {
4907 mAccess = SIM_ACCESS_MATURE;
4908 //return SIM_ACCESS_MATURE;
4909 }
4910 else if ('P'== text)
4911 {
4912 mAccess = SIM_ACCESS_PG;
4913 //return SIM_ACCESS_PG;
4914 }
4915 else
4916 {
4917 mAccess = SIM_ACCESS_MIN;
4918 //return SIM_ACCESS_MIN;
4919 }
4920 gSavedSettings.setU32("PreferredMaturity", mAccess);
4921}
4922
4897void LLAgent::buildFullname(std::string& name) const 4923void LLAgent::buildFullname(std::string& name) const
4898{ 4924{
4899 if (mAvatarObject) 4925 if (mAvatarObject)
diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h
index d6854e4..bf0eeeb 100644
--- a/linden/indra/newview/llagent.h
+++ b/linden/indra/newview/llagent.h
@@ -255,6 +255,7 @@ public:
255 U8 getGodLevel() const; 255 U8 getGodLevel() const;
256 bool isTeen() const; 256 bool isTeen() const;
257 void setTeen(bool teen); 257 void setTeen(bool teen);
258 void convertTextToMaturity(char text);// HACK: remove when based on 1.23
258 BOOL isGroupTitleHidden() const { return mHideGroupTitle; } 259 BOOL isGroupTitleHidden() const { return mHideGroupTitle; }
259 BOOL isGroupMember() const { return !mGroupID.isNull(); } // This is only used for building titles! 260 BOOL isGroupMember() const { return !mGroupID.isNull(); } // This is only used for building titles!
260 const LLUUID &getGroupID() const { return mGroupID; } 261 const LLUUID &getGroupID() const { return mGroupID; }
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 8ec5d98..346f7dd 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -1425,20 +1425,13 @@ bool idle_startup()
1425 gSavedSettings.setBOOL("RememberPassword", remember_password); 1425 gSavedSettings.setBOOL("RememberPassword", remember_password);
1426 1426
1427 // This fixes Imprudence 1.2 thinking it's a teen. 1427 // This fixes Imprudence 1.2 thinking it's a teen.
1428 // Will need updating for the 1.23 merge. 1428 // Will need fixing for the 1.23 merge.
1429 // this is their actual ability to access content 1429 // this is their actual ability to access content
1430 text = LLUserAuth::getInstance()->getResponse("agent_access_max"); 1430 text = LLUserAuth::getInstance()->getResponse("agent_access_max");
1431 if (!text.empty()) 1431 if (!text.empty())
1432 { 1432 {
1433 // agent_access can be 'A', 'M', and 'PG'. 1433 // agent_access can be 'A', 'M', and 'PG'.
1434 if (text[0] == 'PG') 1434 gAgent.convertTextToMaturity(text[0]);
1435 {
1436 gAgent.setTeen(true);
1437 }
1438 else
1439 {
1440 gAgent.setTeen(false);
1441 }
1442 } 1435 }
1443 else // we're on an older sim version (prolly an opensim) 1436 else // we're on an older sim version (prolly an opensim)
1444 { 1437 {
@@ -2623,6 +2616,35 @@ bool idle_startup()
2623 gDebugView->mFastTimerView->setVisible(TRUE); 2616 gDebugView->mFastTimerView->setVisible(TRUE);
2624#endif 2617#endif
2625 2618
2619 // HACK: remove this when based on 1.23
2620 // Send our preferred maturity.
2621 // Update agent access preference on the server
2622 std::string url = gAgent.getRegion()->getCapability("UpdateAgentInformation");
2623 if (!url.empty())
2624 {
2625 U32 preferredMaturity = gSavedSettings.getU32("PreferredMaturity");
2626 // Set new access preference
2627 LLSD access_prefs = LLSD::emptyMap();
2628 if (preferredMaturity == SIM_ACCESS_PG)
2629 {
2630 access_prefs["max"] = "PG";
2631 }
2632 else if (preferredMaturity == SIM_ACCESS_MATURE)
2633 {
2634 access_prefs["max"] = "M";
2635 }
2636 if (preferredMaturity == SIM_ACCESS_ADULT)
2637 {
2638 access_prefs["max"] = "A";
2639 }
2640
2641 LLSD body = LLSD::emptyMap();
2642 body["access_prefs"] = access_prefs;
2643 llinfos << "Sending access prefs update to " << (access_prefs["max"].asString()) << " via capability to: "
2644 << url << llendl;
2645 LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); // Ignore response
2646 }
2647
2626 LLAppViewer::instance()->initMainloopTimeout("Mainloop Init"); 2648 LLAppViewer::instance()->initMainloopTimeout("Mainloop Init");
2627 2649
2628 return TRUE; 2650 return TRUE;
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index 1c527e0..0ba0879 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -542,6 +542,7 @@ std::string LLViewerRegion::regionFlagsToString(U32 flags)
542const char* SIM_ACCESS_STR[] = { "Free Trial", 542const char* SIM_ACCESS_STR[] = { "Free Trial",
543 "PG", 543 "PG",
544 "Mature", 544 "Mature",
545 "Adult",
545 "Offline", 546 "Offline",
546 "Unknown" }; 547 "Unknown" };
547 548
@@ -559,12 +560,15 @@ std::string LLViewerRegion::accessToString(U8 sim_access)
559 case SIM_ACCESS_MATURE: 560 case SIM_ACCESS_MATURE:
560 return SIM_ACCESS_STR[2]; 561 return SIM_ACCESS_STR[2];
561 562
562 case SIM_ACCESS_DOWN: 563 case SIM_ACCESS_ADULT:
563 return SIM_ACCESS_STR[3]; 564 return SIM_ACCESS_STR[3];
564 565
566 case SIM_ACCESS_DOWN:
567 return SIM_ACCESS_STR[4];
568
565 case SIM_ACCESS_MIN: 569 case SIM_ACCESS_MIN:
566 default: 570 default:
567 return SIM_ACCESS_STR[4]; 571 return SIM_ACCESS_STR[5];
568 } 572 }
569} 573}
570 574
@@ -584,6 +588,10 @@ U8 LLViewerRegion::stringToAccess(const std::string& access_str)
584 { 588 {
585 sim_access = SIM_ACCESS_MATURE; 589 sim_access = SIM_ACCESS_MATURE;
586 } 590 }
591 else if (access_str == SIM_ACCESS_STR[3])
592 {
593 sim_access = SIM_ACCESS_ADULT;
594 }
587 return sim_access; 595 return sim_access;
588} 596}
589 597
@@ -601,6 +609,9 @@ std::string LLViewerRegion::accessToShortString(U8 sim_access)
601 case SIM_ACCESS_MATURE: 609 case SIM_ACCESS_MATURE:
602 return "M"; 610 return "M";
603 611
612 case SIM_ACCESS_ADULT:
613 return "A";
614
604 case SIM_ACCESS_MIN: 615 case SIM_ACCESS_MIN:
605 default: 616 default:
606 return "U"; 617 return "U";
@@ -1419,6 +1430,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1419 capabilityNames.append("SendUserReportWithScreenshot"); 1430 capabilityNames.append("SendUserReportWithScreenshot");
1420 capabilityNames.append("ServerReleaseNotes"); 1431 capabilityNames.append("ServerReleaseNotes");
1421 capabilityNames.append("StartGroupProposal"); 1432 capabilityNames.append("StartGroupProposal");
1433 capabilityNames.append("UpdateAgentInformation");
1422 capabilityNames.append("UpdateAgentLanguage"); 1434 capabilityNames.append("UpdateAgentLanguage");
1423 capabilityNames.append("UpdateGestureAgentInventory"); 1435 capabilityNames.append("UpdateGestureAgentInventory");
1424 capabilityNames.append("UpdateNotecardAgentInventory"); 1436 capabilityNames.append("UpdateNotecardAgentInventory");