From c7b0dc6733e937f8457bf50041e4ff682abb6eb4 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Mon, 17 Oct 2011 21:12:22 -0700 Subject: Fixed vivox license appearing when enabling voice on opensim --- linden/indra/newview/llprefsvoice.cpp | 3 ++- linden/indra/newview/llstartup.cpp | 23 ++++++++++++++--------- linden/indra/newview/llvoiceclient.cpp | 12 ++++++++++++ linden/indra/newview/llvoiceclient.h | 1 + 4 files changed, 29 insertions(+), 10 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llprefsvoice.cpp b/linden/indra/newview/llprefsvoice.cpp index 0e8e816..cb52ee0 100644 --- a/linden/indra/newview/llprefsvoice.cpp +++ b/linden/indra/newview/llprefsvoice.cpp @@ -42,6 +42,7 @@ #include "llkeyboard.h" #include "llmodaldialog.h" #include "llviewercontrol.h" +#include "llvoiceclient.h" #include "lluictrlfactory.h" @@ -150,7 +151,7 @@ void LLPrefsVoice::apply() } bool enable_voice = childGetValue("enable_voice_check"); - if (enable_voice && !gSavedSettings.getBOOL("VivoxLicenseAccepted")) + if (enable_voice && LLVoiceClient::needsVivoxLicense()) { // This window enables voice chat if license is accepted FloaterVoiceLicense::getInstance()->open(); diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 08e12ce..922de18 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -1161,19 +1161,24 @@ bool idle_startup() // color init must be after saved settings loaded init_colors(); - if (!gSavedSettings.getBOOL("EnableVoiceChat") || - (gSavedSettings.getBOOL("EnableVoiceChat") && gSavedSettings.getBOOL("VivoxLicenseAccepted")) || - !gHippoGridManager->getConnectedGrid()->isSecondLife()) + // skipping over STATE_LOGIN_VOICE_LICENSE since we don't need it + // skipping over STATE_UPDATE_CHECK because that just waits for input + // We don't do this on non-SL grids either + if (LLVoiceClient::needsVivoxLicense()) { - // skipping over STATE_LOGIN_VOICE_LICENSE since we don't need it - // skipping over STATE_UPDATE_CHECK because that just waits for input - // We don't do this on non-SL grids either - LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); + if (gSavedSettings.getBOOL("EnableVoiceChat")) + { + LLStartUp::setStartupState(STATE_LOGIN_VOICE_LICENSE); + LLFirstUse::voiceLicenseAgreement(); + } + else + { + LLStartUp::setStartupState(STATE_LOGIN_AUTH_INIT); + } } else { - LLStartUp::setStartupState(STATE_LOGIN_VOICE_LICENSE); - LLFirstUse::voiceLicenseAgreement(); + LLStartUp::setStartupState(STATE_LOGIN_AUTH_INIT); } return FALSE; diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp index 946b289..7761605 100644 --- a/linden/indra/newview/llvoiceclient.cpp +++ b/linden/indra/newview/llvoiceclient.cpp @@ -58,11 +58,13 @@ #include "llimview.h" // for LLIMMgr #include "llimpanel.h" // for LLVoiceChannel #include "llparcel.h" +#include "llstartup.h" #include "llviewerparcelmgr.h" #include "llfirstuse.h" #include "llviewerwindow.h" #include "llviewercamera.h" #include "hippolimits.h" +#include "hippogridmanager.h" #include "llfloaterfriends.h" //VIVOX, inorder to refresh communicate panel #include "llfloaterchat.h" // for LLFloaterChat::addChat() @@ -76,6 +78,7 @@ // for MD5 hash #include "llmd5.h" + #define USE_SESSION_GROUPS 0 static bool sConnectingToAgni = false; @@ -7148,6 +7151,15 @@ void LLVoiceClient::avatarNameResolved(const LLUUID &id, const std::string &name } } +//static +bool LLVoiceClient::needsVivoxLicense() +{ + // assumes we're always using slvoice.exe on Second Life + bool needs_license = !gSavedSettings.getBOOL("VivoxLicenseAccepted") && + gHippoGridManager->getCurrentGrid()->isSecondLife(); + return needs_license; +} + class LLViewerParcelVoiceInfo : public LLHTTPNode { virtual void post( diff --git a/linden/indra/newview/llvoiceclient.h b/linden/indra/newview/llvoiceclient.h index f5c6d87..250f4cb 100644 --- a/linden/indra/newview/llvoiceclient.h +++ b/linden/indra/newview/llvoiceclient.h @@ -87,6 +87,7 @@ class LLVoiceClient: public LLSingleton public: static void init(LLPumpIO *pump); // Call this once at application startup (creates connector) static void terminate(); // Call this to clean up during shutdown + static bool needsVivoxLicense(); protected: bool writeString(const std::string &str); -- cgit v1.1