Merge Firestorm LGPL

Fri, 02 Mar 2018 12:06:56 +0100

author
Ansariel
date
Fri, 02 Mar 2018 12:06:56 +0100
changeset 55077
a6108d1c5449
parent 55076
3c1e808f4299
parent 54954
1c1b6f2218ab
child 55081
cd11db88290d

Merge Firestorm LGPL

autobuild.xml file | annotate | diff | revisions
indra/newview/llappviewer.cpp file | annotate | diff | revisions
indra/newview/llfloaterpreference.cpp file | annotate | diff | revisions
indra/newview/llfloatertwitter.cpp file | annotate | diff | revisions
indra/newview/llstartup.cpp file | annotate | diff | revisions
indra/newview/llviewermedia.cpp file | annotate | diff | revisions
indra/newview/skins/default/xui/de/notifications.xml file | annotate | diff | revisions
indra/newview/skins/default/xui/en/notifications.xml file | annotate | diff | revisions
indra/newview/skins/default/xui/pl/notifications.xml file | annotate | diff | revisions
     1.1 --- a/.hgtags	Wed Feb 14 22:17:38 2018 +0100
     1.2 +++ b/.hgtags	Fri Mar 02 12:06:56 2018 +0100
     1.3 @@ -571,3 +571,4 @@
     1.4  40ca7118765be85a043b31b011e4ee6bd9e33c95 5.0.9-release
     1.5  ad0e15543836d64d6399d28b32852510435e344a 5.1.0-release
     1.6  26d9e9bb166a9a417f35b1863223a597af8185fd 5.1.1-release
     1.7 +2eb917875efdfe920680b9049302d0f03721245d 5.1.2-release
     2.1 --- a/autobuild.xml	Wed Feb 14 22:17:38 2018 +0100
     2.2 +++ b/autobuild.xml	Fri Mar 02 12:06:56 2018 +0100
     2.3 @@ -952,7 +952,7 @@
     2.4                <key>hash_algorithm</key>
     2.5                <string>md5</string>
     2.6                <key>url</key>
     2.7 -              <string>file:///opt/firestorm/fmodstudio-1.10.02-darwin-.tar.bz2</string>
     2.8 +              <string>file:///opt/firestorm/fmodstudio-1.10.03-darwin-.tar.bz2</string>
     2.9              </map>
    2.10              <key>name</key>
    2.11              <string>darwin</string>
    2.12 @@ -990,18 +990,18 @@
    2.13              <key>archive</key>
    2.14              <map>
    2.15                <key>hash</key>
    2.16 -              <string>206f34d4a262a09323bc9d03cd81a2f6</string>
    2.17 +              <string>4be36322f3bf16dfbba67c8df574d446</string>
    2.18                <key>hash_algorithm</key>
    2.19                <string>md5</string>
    2.20                <key>url</key>
    2.21 -              <string>file:///c:/cygwin/opt/firestorm/fmodstudio-1.10.02-windows-173500059.tar.bz2</string>
    2.22 +              <string>file:///c:/cygwin/opt/firestorm/fmodstudio-1.10.03-windows-180491728.tar.bz2</string>
    2.23              </map>
    2.24              <key>name</key>
    2.25              <string>windows</string>
    2.26            </map>
    2.27          </map>
    2.28          <key>version</key>
    2.29 -        <string>1.10.02</string>
    2.30 +        <string>1.10.03</string>
    2.31        </map>
    2.32        <key>fmodex</key>
    2.33        <map>
    2.34 @@ -3548,9 +3548,9 @@
    2.35              <key>archive</key>
    2.36              <map>
    2.37                <key>hash</key>
    2.38 -              <string>c4d56d3e942169661a598035a9fbd533</string>
    2.39 -              <key>url</key>
    2.40 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/12112/71187/viewer_manager-1.0.511688-darwin64-511688.tar.bz2</string>
    2.41 +              <string>f1248b6692dcbb1a42db87ca8d9fed93</string>
    2.42 +              <key>url</key>
    2.43 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/13982/87166/viewer_manager-1.0.512801-darwin64-512801.tar.bz2</string>
    2.44              </map>
    2.45              <key>name</key>
    2.46              <string>darwin64</string>
    2.47 @@ -3572,9 +3572,9 @@
    2.48              <key>archive</key>
    2.49              <map>
    2.50                <key>hash</key>
    2.51 -              <string>61f324d880eaa303669b99e28e6cf64c</string>
    2.52 -              <key>url</key>
    2.53 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/12113/71193/viewer_manager-1.0.511688-windows-511688.tar.bz2</string>
    2.54 +              <string>c174ecc0893f8c193571b1dc80b823ad</string>
    2.55 +              <key>url</key>
    2.56 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/13983/87172/viewer_manager-1.0.512801-windows-512801.tar.bz2</string>
    2.57              </map>
    2.58              <key>name</key>
    2.59              <string>windows</string>
    2.60 @@ -3585,7 +3585,7 @@
    2.61          <key>source_type</key>
    2.62          <string>hg</string>
    2.63          <key>version</key>
    2.64 -        <string>1.0.511688</string>
    2.65 +        <string>1.0.512801</string>
    2.66        </map>
    2.67        <key>vlc-bin</key>
    2.68        <map>
     3.1 --- a/doc/contributions.txt	Wed Feb 14 22:17:38 2018 +0100
     3.2 +++ b/doc/contributions.txt	Fri Mar 02 12:06:56 2018 +0100
     3.3 @@ -218,6 +218,7 @@
     3.4  	MAINT-7059
     3.5  	MAINT-6519
     3.6  	MAINT-7899
     3.7 +	STORM-2151
     3.8  Aralara Rajal
     3.9  Arare Chantilly
    3.10  	CHUIBUG-191
     4.1 --- a/indra/cmake/Variables.cmake	Wed Feb 14 22:17:38 2018 +0100
     4.2 +++ b/indra/cmake/Variables.cmake	Fri Mar 02 12:06:56 2018 +0100
     4.3 @@ -12,10 +12,7 @@
     4.4  # Switches set here and in 00-Common.cmake must agree with
     4.5  # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables
     4.6  # Reading $LL_BUILD is an attempt to directly use those switches.
     4.7 -# <FS:Ansariel> This causes CMP0054 warning
     4.8 -#if ("$ENV{LL_BUILD}" STREQUAL "")
     4.9 -if ($ENV{LL_BUILD} STREQUAL "")
    4.10 -# </FS:Ansariel>
    4.11 +if ("$ENV{LL_BUILD}" STREQUAL "")
    4.12    message(FATAL_ERROR "Environment variable LL_BUILD must be set")
    4.13  endif ()
    4.14  
     5.1 --- a/indra/llcommon/llcoros.cpp	Wed Feb 14 22:17:38 2018 +0100
     5.2 +++ b/indra/llcommon/llcoros.cpp	Fri Mar 02 12:06:56 2018 +0100
     5.3 @@ -327,11 +327,13 @@
     5.4      // run the code the caller actually wants in the coroutine
     5.5      try
     5.6      {
     5.7 -#if LL_WINDOWS
     5.8 -        winlevel(callable);
     5.9 -#else
    5.10 +// <FS:Ansariel> Disable for more meaningful callstacks
    5.11 +//#if LL_WINDOWS
    5.12 +//        winlevel(callable);
    5.13 +//#else
    5.14 +// </FS:Ansariel>
    5.15          callable();
    5.16 -#endif
    5.17 +//#endif // <FS:Ansariel> Disable for more meaningful callstacks
    5.18      }
    5.19      catch (const LLContinueError&)
    5.20      {
    5.21 @@ -340,12 +342,14 @@
    5.22          // viewer will carry on.
    5.23          LOG_UNHANDLED_EXCEPTION(STRINGIZE("coroutine " << data->mName));
    5.24      }
    5.25 -    catch (...)
    5.26 -    {
    5.27 -        // Any OTHER kind of uncaught exception will cause the viewer to
    5.28 -        // crash, hopefully informatively.
    5.29 -        CRASH_ON_UNHANDLED_EXCEPTION(STRINGIZE("coroutine " << data->mName));
    5.30 -    }
    5.31 +    // <FS:Ansariel> Disable for more meaningful callstacks
    5.32 +    //catch (...)
    5.33 +    //{
    5.34 +    //    // Any OTHER kind of uncaught exception will cause the viewer to
    5.35 +    //    // crash, hopefully informatively.
    5.36 +    //   CRASH_ON_UNHANDLED_EXCEPTION(STRINGIZE("coroutine " << data->mName));
    5.37 +    //}
    5.38 +    // </FS:Ansariel>
    5.39      // This cleanup isn't perfectly symmetrical with the way we initially set
    5.40      // data->mPrev, but this is our last chance to reset Current.
    5.41      Current().reset(data->mPrev);
     6.1 --- a/indra/llcommon/llsdserialize.cpp	Wed Feb 14 22:17:38 2018 +0100
     6.2 +++ b/indra/llcommon/llsdserialize.cpp	Fri Mar 02 12:06:56 2018 +0100
     6.3 @@ -2127,22 +2127,13 @@
     6.4  	if( output )
     6.5  		free(output);
     6.6  
     6.7 -#if 0 //verify results work with unzip_llsd
     6.8 -	std::istringstream test(result);
     6.9 -	LLSD test_sd;
    6.10 -	if (!unzip_llsd(test_sd, test, result.size()))
    6.11 -	{
    6.12 -		LL_ERRS() << "Invalid compression result!" << LL_ENDL;
    6.13 -	}
    6.14 -#endif
    6.15 -
    6.16  	return result;
    6.17  }
    6.18  
    6.19  //decompress a block of LLSD from provided istream
    6.20  // not very efficient -- creats a copy of decompressed LLSD block in memory
    6.21  // and deserializes from that copy using LLSDSerialize
    6.22 -bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
    6.23 +LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, std::istream& is, S32 size)
    6.24  {
    6.25  	U8* result = NULL;
    6.26  	U32 cur_size = 0;
    6.27 @@ -2153,7 +2144,7 @@
    6.28  	U8 *in = new(std::nothrow) U8[size];
    6.29  	if (!in)
    6.30  	{
    6.31 -		return false;
    6.32 +		return ZR_MEM_ERROR;
    6.33  	}
    6.34  	is.read((char*) in, size); 
    6.35  
    6.36 @@ -2180,7 +2171,7 @@
    6.37  			if( result )
    6.38  				free(result);
    6.39  			delete [] in;
    6.40 -			return false;
    6.41 +			return ZR_DATA_ERROR;
    6.42  		}
    6.43  		
    6.44  		switch (ret)
    6.45 @@ -2195,7 +2186,7 @@
    6.46  			if( result )
    6.47  				free(result);
    6.48  			delete [] in;
    6.49 -			return false;
    6.50 +			return ZR_MEM_ERROR;
    6.51  			break;
    6.52  		}
    6.53  
    6.54 @@ -2210,7 +2201,7 @@
    6.55  				free(result);
    6.56  			}
    6.57  			delete[] in;
    6.58 -			return false;
    6.59 +			return ZR_MEM_ERROR;
    6.60  		}
    6.61  		result = new_result;
    6.62  		memcpy(result+cur_size, out, have);
    6.63 @@ -2227,37 +2218,58 @@
    6.64  		// free(result);
    6.65  		if( result )
    6.66  			free(result);
    6.67 -		return false;
    6.68 +		return ZR_DATA_ERROR;
    6.69  	}
    6.70  
    6.71  	//result now points to the decompressed LLSD block
    6.72  	{
    6.73 -		std::string res_str((char*) result, cur_size);
    6.74 +		std::istringstream istr;
    6.75 +		// Since we are using this for meshes, data we are dealing with tend to be large.
    6.76 +		// So string can potentially fail to allocate, make sure this won't cause problems
    6.77 +		try
    6.78 +		{
    6.79 +			std::string res_str((char*)result, cur_size);
    6.80  
    6.81 -		std::string deprecated_header("<? LLSD/Binary ?>");
    6.82 +			std::string deprecated_header("<? LLSD/Binary ?>");
    6.83  
    6.84 -		if (res_str.substr(0, deprecated_header.size()) == deprecated_header)
    6.85 +			if (res_str.substr(0, deprecated_header.size()) == deprecated_header)
    6.86 +			{
    6.87 +				res_str = res_str.substr(deprecated_header.size() + 1, cur_size);
    6.88 +			}
    6.89 +			cur_size = res_str.size();
    6.90 +
    6.91 +			istr.str(res_str);
    6.92 +		}
    6.93 +#ifdef LL_WINDOWS
    6.94 +		catch (std::length_error)
    6.95  		{
    6.96 -			res_str = res_str.substr(deprecated_header.size()+1, cur_size);
    6.97 -		}
    6.98 -		cur_size = res_str.size();
    6.99 -
   6.100 -		std::istringstream istr(res_str);
   6.101 -		
   6.102 -		if (!LLSDSerialize::fromBinary(data, istr, cur_size))
   6.103 -		{
   6.104 -			LL_DEBUGS() << "Failed to unzip LLSD block" << LL_ENDL;
   6.105  			// free(result);
   6.106  			if( result )
   6.107  				free(result);
   6.108 -			return false;
   6.109 -		}		
   6.110 +			return ZR_SIZE_ERROR;
   6.111 +		}
   6.112 +#endif
   6.113 +		catch (std::bad_alloc)
   6.114 +		{
   6.115 +			// free(result);
   6.116 +			if( result )
   6.117 +				free(result);
   6.118 +			return ZR_MEM_ERROR;
   6.119 +		}
   6.120 +
   6.121 +		if (!LLSDSerialize::fromBinary(data, istr, cur_size))
   6.122 +		{
   6.123 +			// free(result);
   6.124 +			if( result )
   6.125 +				free(result);
   6.126 +			return ZR_PARSE_ERROR;
   6.127 +		}
   6.128  	}
   6.129  
   6.130  	// free(result);
   6.131  	if( result )
   6.132  		free(result);
   6.133 -	return true;
   6.134 +	return ZR_OK;
   6.135  }
   6.136  //This unzip function will only work with a gzip header and trailer - while the contents
   6.137  //of the actual compressed data is the same for either format (gzip vs zlib ), the headers
     7.1 --- a/indra/llcommon/llsdserialize.h	Wed Feb 14 22:17:38 2018 +0100
     7.2 +++ b/indra/llcommon/llsdserialize.h	Fri Mar 02 12:06:56 2018 +0100
     7.3 @@ -814,8 +814,24 @@
     7.4  	}
     7.5  };
     7.6  
     7.7 +class LL_COMMON_API LLUZipHelper : public LLRefCount
     7.8 +{
     7.9 +public:
    7.10 +    typedef enum e_zip_result
    7.11 +    {
    7.12 +        ZR_OK = 0,
    7.13 +        ZR_MEM_ERROR,
    7.14 +        ZR_SIZE_ERROR,
    7.15 +        ZR_DATA_ERROR,
    7.16 +        ZR_PARSE_ERROR,
    7.17 +    } EZipRresult;
    7.18 +    // return OK or reason for failure
    7.19 +    static EZipRresult unzip_llsd(LLSD& data, std::istream& is, S32 size);
    7.20 +};
    7.21 +
    7.22  //dirty little zip functions -- yell at davep
    7.23  LL_COMMON_API std::string zip_llsd(LLSD& data);
    7.24 -LL_COMMON_API bool unzip_llsd(LLSD& data, std::istream& is, S32 size);
    7.25 +
    7.26 +
    7.27  LL_COMMON_API U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize,std::istream& is, S32 size);
    7.28  #endif // LL_LLSDSERIALIZE_H
     8.1 --- a/indra/llcommon/llthread.cpp	Wed Feb 14 22:17:38 2018 +0100
     8.2 +++ b/indra/llcommon/llthread.cpp	Fri Mar 02 12:06:56 2018 +0100
     8.3 @@ -129,50 +129,32 @@
     8.4  
     8.5      sThreadID = threadp->mID;
     8.6  
     8.7 -    try
     8.8 +    // Run the user supplied function
     8.9 +    do 
    8.10      {
    8.11 -        // Run the user supplied function
    8.12 -        do 
    8.13 +        try
    8.14          {
    8.15 -            try
    8.16 -            {
    8.17 -                threadp->run();
    8.18 -            }
    8.19 -            catch (const LLContinueError &e)
    8.20 -            {
    8.21 -                LL_WARNS("THREAD") << "ContinueException on thread '" << threadp->mName <<
    8.22 -                    "' reentering run(). Error what is: '" << e.what() << "'" << LL_ENDL;
    8.23 -                //output possible call stacks to log file.
    8.24 -                LLError::LLCallStacks::print();
    8.25 +            threadp->run();
    8.26 +        }
    8.27 +        catch (const LLContinueError &e)
    8.28 +        {
    8.29 +            LL_WARNS("THREAD") << "ContinueException on thread '" << threadp->mName <<
    8.30 +                "' reentering run(). Error what is: '" << e.what() << "'" << LL_ENDL;
    8.31 +            //output possible call stacks to log file.
    8.32 +            LLError::LLCallStacks::print();
    8.33  
    8.34 -                LOG_UNHANDLED_EXCEPTION("LLThread");
    8.35 -                continue;
    8.36 -            }
    8.37 -            break;
    8.38 +            LOG_UNHANDLED_EXCEPTION("LLThread");
    8.39 +            continue;
    8.40 +        }
    8.41 +        break;
    8.42  
    8.43 -        } while (true);
    8.44 +    } while (true);
    8.45  
    8.46 -        //LL_INFOS() << "LLThread::staticRun() Exiting: " << threadp->mName << LL_ENDL;
    8.47 +    //LL_INFOS() << "LLThread::staticRun() Exiting: " << threadp->mName << LL_ENDL;
    8.48  
    8.49 -        // We're done with the run function, this thread is done executing now.
    8.50 -        //NB: we are using this flag to sync across threads...we really need memory barriers here
    8.51 -        threadp->mStatus = STOPPED;
    8.52 -    }
    8.53 -    catch (std::bad_alloc)
    8.54 -    {
    8.55 -        threadp->mStatus = CRASHED;
    8.56 -        LLMemory::logMemoryInfo(TRUE);
    8.57 -
    8.58 -        //output possible call stacks to log file.
    8.59 -        LLError::LLCallStacks::print();
    8.60 -
    8.61 -        LL_ERRS("THREAD") << "Bad memory allocation in LLThread::staticRun() named '" << threadp->mName << "'!" << LL_ENDL;
    8.62 -    }
    8.63 -    catch (...)
    8.64 -    {
    8.65 -        threadp->mStatus = CRASHED;
    8.66 -        CRASH_ON_UNHANDLED_EXCEPTION("LLThread");
    8.67 -    }
    8.68 +    // We're done with the run function, this thread is done executing now.
    8.69 +    //NB: we are using this flag to sync across threads...we really need memory barriers here
    8.70 +    threadp->mStatus = STOPPED;
    8.71  
    8.72      delete threadp->mRecorder;
    8.73      threadp->mRecorder = NULL;
     9.1 --- a/indra/llimage/llimagedimensionsinfo.cpp	Wed Feb 14 22:17:38 2018 +0100
     9.2 +++ b/indra/llimage/llimagedimensionsinfo.cpp	Fri Mar 02 12:06:56 2018 +0100
     9.3 @@ -33,8 +33,6 @@
     9.4  // Value is true if one of Libjpeg's functions has encountered an error while working.
     9.5  static bool sJpegErrorEncountered = false;
     9.6  
     9.7 -FILE *nd_openFile( std::string const &aFile, std::string const &aMode ); // <FS:ND/> function to handle utf-8 filesnames under windows
     9.8 -
     9.9  bool LLImageDimensionsInfo::load(const std::string& src_filename,U32 codec)
    9.10  {
    9.11  	clean();
    9.12 @@ -165,14 +163,7 @@
    9.13  {
    9.14  	sJpegErrorEncountered = false;
    9.15  	clean();
    9.16 -
    9.17 -	// <FS:ND> Cannot just use fopen under windows. mSrcFilename might be an utf-8 filename
    9.18 -
    9.19 -	// FILE *fp = fopen (mSrcFilename.c_str(), "rb");
    9.20 -	FILE *fp =  nd_openFile (mSrcFilename.c_str(), "rb");
    9.21 -
    9.22 -	// </FS:ND>
    9.23 -
    9.24 +	FILE *fp = LLFile::fopen(mSrcFilename, "rb");
    9.25  	if (fp == NULL) 
    9.26  	{
    9.27  		setLastError("Unable to open file for reading", mSrcFilename);
    9.28 @@ -231,14 +222,3 @@
    9.29  	mInfile.seek(APR_SET, 0);
    9.30  	return nread == min_len;
    9.31  }
    9.32 -
    9.33 -// <FS:ND> extra case for windows, convert utf-8 filenames to ut-16, then call _wfopen
    9.34 -FILE *nd_openFile( std::string const &aFile, std::string const &aMode )
    9.35 -{
    9.36 -#if	LL_WINDOWS
    9.37 -	return _wfopen( utf8str_to_utf16str( aFile ) .c_str(), utf8str_to_utf16str( aMode ).c_str());
    9.38 -#else
    9.39 -	return ::fopen(aFile.c_str(),aMode.c_str());
    9.40 -#endif
    9.41 -}
    9.42 -// </FS:ND>
    10.1 --- a/indra/llmath/llvolume.cpp	Wed Feb 14 22:17:38 2018 +0100
    10.2 +++ b/indra/llmath/llvolume.cpp	Fri Mar 02 12:06:56 2018 +0100
    10.3 @@ -2391,9 +2391,10 @@
    10.4  	//input stream is now pointing at a zlib compressed block of LLSD
    10.5  	//decompress block
    10.6  	LLSD mdl;
    10.7 -	if (!unzip_llsd(mdl, is, size))
    10.8 -	{
    10.9 -		LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD, will probably fetch from sim again." << LL_ENDL;
   10.10 +	U32 uzip_result = LLUZipHelper::unzip_llsd(mdl, is, size);
   10.11 +	if (uzip_result != LLUZipHelper::ZR_OK)
   10.12 +	{
   10.13 +		LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD with code " << uzip_result << " , will probably fetch from sim again." << LL_ENDL;
   10.14  		return false;
   10.15  	}
   10.16  	
   10.17 @@ -2700,11 +2701,17 @@
   10.18  			}
   10.19  		}
   10.20  	}
   10.21 +
   10.22 +	if (!cacheOptimize())
   10.23 +	{
   10.24 +		// Out of memory?
   10.25 +		LL_WARNS() << "Failed to optimize!" << LL_ENDL;
   10.26 +		mVolumeFaces.clear();
   10.27 +		return false;
   10.28 +	}
   10.29  	
   10.30  	mSculptLevel = 0;  // success!
   10.31  
   10.32 -	cacheOptimize();
   10.33 -
   10.34  	return true;
   10.35  }
   10.36  
   10.37 @@ -2736,12 +2743,16 @@
   10.38  	mSculptLevel = 0;
   10.39  }
   10.40  
   10.41 -void LLVolume::cacheOptimize()
   10.42 +bool LLVolume::cacheOptimize()
   10.43  {
   10.44  	for (S32 i = 0; i < mVolumeFaces.size(); ++i)
   10.45  	{
   10.46 -		mVolumeFaces[i].cacheOptimize();
   10.47 -	}
   10.48 +		if (!mVolumeFaces[i].cacheOptimize())
   10.49 +		{
   10.50 +			return false;
   10.51 +		}
   10.52 +	}
   10.53 +	return true;
   10.54  }
   10.55  
   10.56  
   10.57 @@ -5226,7 +5237,7 @@
   10.58  };
   10.59  
   10.60  
   10.61 -void LLVolumeFace::cacheOptimize()
   10.62 +bool LLVolumeFace::cacheOptimize()
   10.63  { //optimize for vertex cache according to Forsyth method: 
   10.64    // http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html
   10.65  	
   10.66 @@ -5237,7 +5248,7 @@
   10.67  	
   10.68  	if (mNumVertices < 3)
   10.69  	{ //nothing to do
   10.70 -		return;
   10.71 +		return true;
   10.72  	}
   10.73  
   10.74  	//mapping of vertices to triangles and indices
   10.75 @@ -5246,8 +5257,16 @@
   10.76  	//mapping of triangles do vertices
   10.77  	std::vector<LLVCacheTriangleData> triangle_data;
   10.78  
   10.79 -	triangle_data.resize(mNumIndices/3);
   10.80 -	vertex_data.resize(mNumVertices);
   10.81 +	try
   10.82 +	{
   10.83 +		triangle_data.resize(mNumIndices / 3);
   10.84 +		vertex_data.resize(mNumVertices);
   10.85 +	}
   10.86 +	catch (std::bad_alloc)
   10.87 +	{
   10.88 +		LL_WARNS("LLVOLUME") << "Resize failed" << LL_ENDL;
   10.89 +		return false;
   10.90 +	}
   10.91  
   10.92  	for (U32 i = 0; i < mNumIndices; i++)
   10.93  	{ //populate vertex data and triangle data arrays
   10.94 @@ -5359,7 +5378,8 @@
   10.95  	LLVector4a* pos = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+size);
   10.96  	if (pos == NULL)
   10.97  	{
   10.98 -		LL_ERRS("LLVOLUME") << "Allocation of positions vector[" << sizeof(LLVector4a) * 2 * num_verts + size  << "] failed. " << LL_ENDL;
   10.99 +		LL_WARNS("LLVOLUME") << "Allocation of positions vector[" << sizeof(LLVector4a) * 2 * num_verts + size  << "] failed. " << LL_ENDL;
  10.100 +		return false;
  10.101  	}
  10.102  	LLVector4a* norm = pos + num_verts;
  10.103  	LLVector2* tc = (LLVector2*) (norm + num_verts);
  10.104 @@ -5370,7 +5390,9 @@
  10.105  		wght = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
  10.106  		if (wght == NULL)
  10.107  		{
  10.108 -			LL_ERRS("LLVOLUME") << "Allocation of weights[" << sizeof(LLVector4a) * num_verts << "] failed" << LL_ENDL;
  10.109 +			ll_aligned_free<64>(pos);
  10.110 +			LL_WARNS("LLVOLUME") << "Allocation of weights[" << sizeof(LLVector4a) * num_verts << "] failed" << LL_ENDL;
  10.111 +			return false;
  10.112  		}
  10.113  	}
  10.114  
  10.115 @@ -5380,13 +5402,28 @@
  10.116  		binorm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
  10.117  		if (binorm == NULL)
  10.118  		{
  10.119 -			LL_ERRS("LLVOLUME") << "Allocation of binormals[" << sizeof(LLVector4a)*num_verts << "] failed" << LL_ENDL;
  10.120 +			ll_aligned_free<64>(pos);
  10.121 +			ll_aligned_free_16(wght);
  10.122 +			LL_WARNS("LLVOLUME") << "Allocation of binormals[" << sizeof(LLVector4a)*num_verts << "] failed" << LL_ENDL;
  10.123 +			return false;
  10.124  		}
  10.125  	}
  10.126  
  10.127  	//allocate mapping of old indices to new indices
  10.128  	std::vector<S32> new_idx;
  10.129 -	new_idx.resize(mNumVertices, -1);
  10.130 +
  10.131 +	try
  10.132 +	{
  10.133 +		new_idx.resize(mNumVertices, -1);
  10.134 +	}
  10.135 +	catch (std::bad_alloc)
  10.136 +	{
  10.137 +		ll_aligned_free<64>(pos);
  10.138 +		ll_aligned_free_16(wght);
  10.139 +		ll_aligned_free_16(binorm);
  10.140 +		LL_WARNS("LLVOLUME") << "Resize failed: " << mNumVertices << LL_ENDL;
  10.141 +		return false;
  10.142 +	}
  10.143  
  10.144  	S32 cur_idx = 0;
  10.145  	for (U32 i = 0; i < mNumIndices; ++i)
  10.146 @@ -5432,6 +5469,7 @@
  10.147  	//std::string result = llformat("ACMR pre/post: %.3f/%.3f  --  %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks);
  10.148  	//LL_INFOS() << result << LL_ENDL;
  10.149  
  10.150 +	return true;
  10.151  }
  10.152  
  10.153  void LLVolumeFace::createOctree(F32 scaler, const LLVector4a& center, const LLVector4a& size)
    11.1 --- a/indra/llmath/llvolume.h	Wed Feb 14 22:17:38 2018 +0100
    11.2 +++ b/indra/llmath/llvolume.h	Fri Mar 02 12:06:56 2018 +0100
    11.3 @@ -906,7 +906,7 @@
    11.4  	};
    11.5  
    11.6  	void optimize(F32 angle_cutoff = 2.f);
    11.7 -	void cacheOptimize();
    11.8 +	bool cacheOptimize();
    11.9  
   11.10  	void createOctree(F32 scaler = 0.25f, const LLVector4a& center = LLVector4a(0,0,0), const LLVector4a& size = LLVector4a(0.5f,0.5f,0.5f));
   11.11  
   11.12 @@ -1075,7 +1075,7 @@
   11.13  	void copyVolumeFaces(const LLVolume* volume);
   11.14  	void copyFacesTo(std::vector<LLVolumeFace> &faces) const;
   11.15  	void copyFacesFrom(const std::vector<LLVolumeFace> &faces);
   11.16 -	void cacheOptimize();
   11.17 +	bool cacheOptimize();
   11.18  
   11.19  private:
   11.20  	void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type);
    12.1 --- a/indra/llmessage/llavatarnamecache.cpp	Wed Feb 14 22:17:38 2018 +0100
    12.2 +++ b/indra/llmessage/llavatarnamecache.cpp	Fri Mar 02 12:06:56 2018 +0100
    12.3 @@ -855,7 +855,7 @@
    12.4  
    12.5      // Legacy method
    12.6      LLUUID id;
    12.7 -    if (gCacheName->getUUID(name, id))
    12.8 +    if (gCacheName && gCacheName->getUUID(name, id))
    12.9      {
   12.10          return id;
   12.11      }
    13.1 --- a/indra/llprimitive/llmodel.cpp	Wed Feb 14 22:17:38 2018 +0100
    13.2 +++ b/indra/llprimitive/llmodel.cpp	Fri Mar 02 12:06:56 2018 +0100
    13.3 @@ -1360,7 +1360,7 @@
    13.4  
    13.5  		LLSD skin_data;
    13.6  
    13.7 -		if (unzip_llsd(skin_data, is, size))
    13.8 +		if (LLUZipHelper::unzip_llsd(skin_data, is, size) == LLUZipHelper::ZR_OK)
    13.9  		{
   13.10  			mSkinInfo.fromLLSD(skin_data);
   13.11  			return true;
   13.12 @@ -1381,7 +1381,7 @@
   13.13  
   13.14  		LLSD data;
   13.15  
   13.16 -		if (unzip_llsd(data, is, size))
   13.17 +		if (LLUZipHelper::unzip_llsd(data, is, size) == LLUZipHelper::ZR_OK)
   13.18  		{
   13.19  			mPhysics.fromLLSD(data);
   13.20  			updateHullCenters();
    14.1 --- a/indra/llrender/llimagegl.cpp	Wed Feb 14 22:17:38 2018 +0100
    14.2 +++ b/indra/llrender/llimagegl.cpp	Fri Mar 02 12:06:56 2018 +0100
    14.3 @@ -630,7 +630,7 @@
    14.4  }
    14.5  
    14.6  static LLTrace::BlockTimerStatHandle FTM_SET_IMAGE("setImage");
    14.7 -void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
    14.8 +BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
    14.9  {
   14.10  	LL_RECORD_BLOCK_TIME(FTM_SET_IMAGE);
   14.11  	bool is_compressed = false;
   14.12 @@ -795,19 +795,33 @@
   14.13  						llassert(prev_mip_data);
   14.14  						llassert(cur_mip_size == bytes*4);
   14.15  #endif
   14.16 -						U8* new_data = new U8[bytes];
   14.17 +						U8* new_data = new(std::nothrow) U8[bytes];
   14.18 +						if (!new_data)
   14.19 +						{
   14.20 +							stop_glerror();
   14.21 +
   14.22 +							if (prev_mip_data)
   14.23 +								delete[] prev_mip_data;
   14.24 +							if (cur_mip_data)
   14.25 +								delete[] cur_mip_data;
   14.26 +							
   14.27 +							mGLTextureCreated = false;
   14.28 +							return FALSE;
   14.29 +						}
   14.30 +						else
   14.31 +						{
   14.32  
   14.33  #ifdef SHOW_ASSERT
   14.34 -						llassert(prev_mip_data);
   14.35 -						llassert(cur_mip_size == bytes*4);
   14.36 -						llassert_always(new_data);
   14.37 +							llassert(prev_mip_data);
   14.38 +							llassert(cur_mip_size == bytes * 4);
   14.39  #endif
   14.40  
   14.41 -						LLImageBase::generateMip(prev_mip_data, new_data, w, h, mComponents);
   14.42 -						cur_mip_data = new_data;
   14.43 +							LLImageBase::generateMip(prev_mip_data, new_data, w, h, mComponents);
   14.44 +							cur_mip_data = new_data;
   14.45  #ifdef SHOW_ASSERT
   14.46 -						cur_mip_size = bytes; 
   14.47 +							cur_mip_size = bytes;
   14.48  #endif
   14.49 +						}
   14.50  
   14.51  					}
   14.52  					llassert(w > 0 && h > 0 && cur_mip_data);
   14.53 @@ -894,6 +908,7 @@
   14.54  	}
   14.55  	stop_glerror();
   14.56  	mGLTextureCreated = true;
   14.57 +	return TRUE;
   14.58  }
   14.59  
   14.60  BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image)
   14.61 @@ -1363,8 +1378,7 @@
   14.62  	if (mTexName != 0 && discard_level == mCurrentDiscardLevel)
   14.63  	{
   14.64  		// This will only be true if the size has not changed
   14.65 -		setImage(data_in, data_hasmips);
   14.66 -		return TRUE;
   14.67 +		return setImage(data_in, data_hasmips);
   14.68  	}
   14.69  	
   14.70  	U32 old_name = mTexName;
   14.71 @@ -1406,7 +1420,11 @@
   14.72  
   14.73  	mCurrentDiscardLevel = discard_level;	
   14.74  
   14.75 -	setImage(data_in, data_hasmips);
   14.76 +	if (!setImage(data_in, data_hasmips))
   14.77 +	{
   14.78 +		stop_glerror();
   14.79 +		return FALSE;
   14.80 +	}
   14.81  
   14.82  	// Set texture options to our defaults.
   14.83  	gGL.getTexUnit(0)->setHasMipMaps(mHasMipMaps);
    15.1 --- a/indra/llrender/llimagegl.h	Wed Feb 14 22:17:38 2018 +0100
    15.2 +++ b/indra/llrender/llimagegl.h	Fri Mar 02 12:06:56 2018 +0100
    15.3 @@ -108,7 +108,7 @@
    15.4  		S32 category = sMaxCategories-1);
    15.5  	BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, S32 usename = 0);
    15.6  	void setImage(const LLImageRaw* imageraw);
    15.7 -	void setImage(const U8* data_in, BOOL data_hasmips = FALSE);
    15.8 +	BOOL setImage(const U8* data_in, BOOL data_hasmips = FALSE);
    15.9  	BOOL setSubImage(const LLImageRaw* imageraw, S32 x_pos, S32 y_pos, S32 width, S32 height, BOOL force_fast_update = FALSE);
   15.10  	BOOL setSubImage(const U8* datap, S32 data_width, S32 data_height, S32 x_pos, S32 y_pos, S32 width, S32 height, BOOL force_fast_update = FALSE);
   15.11  	BOOL setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_pos, S32 width, S32 height);
    16.1 --- a/indra/llrender/llvertexbuffer.cpp	Wed Feb 14 22:17:38 2018 +0100
    16.2 +++ b/indra/llrender/llvertexbuffer.cpp	Fri Mar 02 12:06:56 2018 +0100
    16.3 @@ -1223,10 +1223,12 @@
    16.4  
    16.5  	if (mFence)
    16.6  	{
    16.7 +		// Sanity check. We have weird crashes in this destructor (on delete). Yet mFence is disabled.
    16.8 +		// TODO: mFence was added in scope of SH-2038, but was never enabled, consider removing mFence.
    16.9 +		LL_ERRS() << "LLVertexBuffer destruction failed" << LL_ENDL;
   16.10  		delete mFence;
   16.11 +		mFence = NULL;
   16.12  	}
   16.13 -	
   16.14 -	mFence = NULL;
   16.15  
   16.16  	sVertexCount -= mNumVerts;
   16.17  	sIndexCount -= mNumIndices;
    17.1 --- a/indra/llui/llbadge.cpp	Wed Feb 14 22:17:38 2018 +0100
    17.2 +++ b/indra/llui/llbadge.cpp	Fri Mar 02 12:06:56 2018 +0100
    17.3 @@ -236,7 +236,7 @@
    17.4  	{
    17.5  		LLView* owner_view = mOwner.get();
    17.6  
    17.7 -		if (owner_view)
    17.8 +		if (owner_view && owner_view->isInVisibleChain())
    17.9  		{
   17.10  			//
   17.11  			// Calculate badge size based on label text
    18.1 --- a/indra/llui/llurlentry.cpp	Wed Feb 14 22:17:38 2018 +0100
    18.2 +++ b/indra/llui/llurlentry.cpp	Fri Mar 02 12:06:56 2018 +0100
    18.3 @@ -193,31 +193,32 @@
    18.4  
    18.5  std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const
    18.6  {
    18.7 -	LLUriParser up(unescapeUrl(url));
    18.8 +	LLUriParser up(escapeUrl(url));
    18.9  	up.normalize();
   18.10  
   18.11  	std::string label;
   18.12  	up.extractParts();
   18.13  	up.glueFirst(label);
   18.14  
   18.15 -	return label;
   18.16 +	return unescapeUrl(label);
   18.17  }
   18.18  
   18.19  std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const
   18.20  {
   18.21 -	LLUriParser up(unescapeUrl(url));
   18.22 +	std::string escaped_url = escapeUrl(url);
   18.23 +	LLUriParser up(escaped_url);
   18.24  
   18.25  	std::string label;
   18.26  	up.extractParts();
   18.27  	up.glueFirst(label, false);
   18.28  
   18.29 -	size_t pos = url.find(label);
   18.30 +	size_t pos = escaped_url.find(label);
   18.31  	if (pos == std::string::npos)
   18.32  	{
   18.33  		return "";
   18.34  	}
   18.35  	pos += label.size();
   18.36 -	return url.substr(pos);
   18.37 +	return unescapeUrl(escaped_url.substr(pos));
   18.38  }
   18.39  
   18.40  
    19.1 --- a/indra/llui/llurlregistry.cpp	Wed Feb 14 22:17:38 2018 +0100
    19.2 +++ b/indra/llui/llurlregistry.cpp	Fri Mar 02 12:06:56 2018 +0100
    19.3 @@ -271,7 +271,7 @@
    19.4  			}
    19.5  		}
    19.6  	}
    19.7 -	
    19.8 +
    19.9  	// did we find a match? if so, return its details in the match object
   19.10  	if (match_entry)
   19.11  	{
   19.12 @@ -282,33 +282,6 @@
   19.13  		// fill in the LLUrlMatch object and return it
   19.14  		std::string url = text.substr(match_start, match_end - match_start + 1);
   19.15  
   19.16 -		LLUrlEntryBase *stripped_entry = NULL;
   19.17 -		if((match_entry != mUrlEntryNoLink) && (match_entry != mUrlEntryHTTPLabel) && (match_entry !=mUrlEntrySLLabel)
   19.18 -		        && LLStringUtil::containsNonprintable(url))
   19.19 -		{
   19.20 -			LLStringUtil::stripNonprintable(url);
   19.21 -
   19.22 -			std::vector<LLUrlEntryBase *>::iterator iter;
   19.23 -			for (iter = mUrlEntry.begin(); iter != mUrlEntry.end(); ++iter)
   19.24 -			{
   19.25 -				LLUrlEntryBase *url_entry = *iter;
   19.26 -				U32 start = 0, end = 0;
   19.27 -				if (matchRegex(url.c_str(), url_entry->getPattern(), start, end))
   19.28 -				{
   19.29 -					if (mLLUrlEntryInvalidSLURL == *iter)
   19.30 -					{
   19.31 -						if(url_entry && url_entry->isSLURLvalid(url))
   19.32 -						{
   19.33 -							continue;
   19.34 -						}
   19.35 -					}
   19.36 -					stripped_entry = url_entry;
   19.37 -					break;
   19.38 -				}
   19.39 -			}
   19.40 -		}
   19.41 -
   19.42 -
   19.43  		// <FS:Ansariel> Fix the "nolink>" fail; Fix from Alchemy viewer, courtesy of Drake Arconis
   19.44  		//if (match_entry == mUrlEntryTrusted)
   19.45  		//{
   19.46 @@ -326,12 +299,10 @@
   19.47  		}
   19.48  		// </FS:Ansariel>
   19.49  
   19.50 -		std::string url_label = stripped_entry? stripped_entry->getLabel(url, cb) : match_entry->getLabel(url, cb);
   19.51 -		std::string url_query = stripped_entry? stripped_entry->getQuery(url) : match_entry->getQuery(url);
   19.52  		match.setValues(match_start, match_end,
   19.53  						match_entry->getUrl(url),
   19.54 -						url_label,
   19.55 -						url_query,
   19.56 +						match_entry->getLabel(url, cb),
   19.57 +						match_entry->getQuery(url),
   19.58  						match_entry->getTooltip(url),
   19.59  						match_entry->getIcon(url),
   19.60  						match_entry->getStyle(),
    20.1 --- a/indra/llvfs/lldir_win32.cpp	Wed Feb 14 22:17:38 2018 +0100
    20.2 +++ b/indra/llvfs/lldir_win32.cpp	Fri Mar 02 12:06:56 2018 +0100
    20.3 @@ -285,7 +285,8 @@
    20.4  		LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
    20.5  	}
    20.6  
    20.7 -	mCAFile = getExpandedFilename(LL_PATH_APP_SETTINGS, "ca-bundle.crt");
    20.8 +	//mCAFile = getExpandedFilename(LL_PATH_APP_SETTINGS, "ca-bundle.crt");
    20.9 +	mCAFile = getExpandedFilename(LL_PATH_EXECUTABLE, "app_settings", "ca-bundle.crt"); //<FS:LO> Fix running firestorm from visual studio
   20.10  }
   20.11  
   20.12  U32 LLDir_Win32::countFilesInDir(const std::string &dirname, const std::string &mask)
    21.1 --- a/indra/llwindow/llwindowwin32.cpp	Wed Feb 14 22:17:38 2018 +0100
    21.2 +++ b/indra/llwindow/llwindowwin32.cpp	Fri Mar 02 12:06:56 2018 +0100
    21.3 @@ -427,12 +427,10 @@
    21.4  	memset(mPrevGammaRamp, 0, sizeof(mPrevGammaRamp));
    21.5  	mCustomGammaSet = FALSE;
    21.6  	
    21.7 -	// <FS:Ansariel> Respect "Hide pointer while typing" Windows preference setting
    21.8  	if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &mMouseVanish, 0))
    21.9  	{
   21.10  		mMouseVanish = TRUE;
   21.11  	}
   21.12 -	// </FS:Ansariel>
   21.13  
   21.14  	// Initialize the keyboard
   21.15  	gKeyboard = new LLKeyboardWin32();
   21.16 @@ -1109,7 +1107,14 @@
   21.17  		mhInstance,
   21.18  		NULL);
   21.19  
   21.20 -	LL_INFOS("Window") << "window is created." << LL_ENDL ;
   21.21 +	if (mWindowHandle)
   21.22 +	{
   21.23 +		LL_INFOS("Window") << "window is created." << LL_ENDL ;
   21.24 +	}
   21.25 +	else
   21.26 +	{
   21.27 +		LL_WARNS("Window") << "Window creation failed, code: " << GetLastError() << LL_ENDL;
   21.28 +	}
   21.29  
   21.30  	//-----------------------------------------------------------------------
   21.31  	// Create GL drawing context
   21.32 @@ -1424,7 +1429,16 @@
   21.33  			mhInstance,
   21.34  			NULL);
   21.35  
   21.36 -		LL_INFOS("Window") << "recreate window done." << LL_ENDL ;
   21.37 +
   21.38 +		if (mWindowHandle)
   21.39 +		{
   21.40 +			LL_INFOS("Window") << "recreate window done." << LL_ENDL ;
   21.41 +		}
   21.42 +		else
   21.43 +		{
   21.44 +			// Note: if value is NULL GetDC retrieves the DC for the entire screen.
   21.45 +			LL_WARNS("Window") << "Window recreation failed, code: " << GetLastError() << LL_ENDL;
   21.46 +		}
   21.47  
   21.48  		if (!(mhDC = GetDC(mWindowHandle)))
   21.49  		{
   21.50 @@ -1693,10 +1707,7 @@
   21.51  
   21.52  void LLWindowWin32::hideCursorUntilMouseMove()
   21.53  {
   21.54 -	// <FS:Ansariel> Respect "Hide pointer while typing" Windows preference setting
   21.55 -	//if (!mHideCursorPermanent)
   21.56  	if (!mHideCursorPermanent && mMouseVanish)
   21.57 -	// </FS:Ansariel>
   21.58  	{
   21.59  		hideCursor();
   21.60  		mHideCursorPermanent = FALSE;
   21.61 @@ -2673,11 +2684,11 @@
   21.62  			}
   21.63  
   21.64  		case WM_SETFOCUS:
   21.65 -			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SETFOCUS");
   21.66  			if (gDebugWindowProc)
   21.67  			{
   21.68  				LL_INFOS("Window") << "WINDOWPROC SetFocus" << LL_ENDL;
   21.69  			}
   21.70 +			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SETFOCUS");
   21.71  
   21.72  			// <FS:Ansariel> Stop flashing when we gain focus
   21.73  			if (window_imp->mWindowHandle)
   21.74 @@ -2695,11 +2706,11 @@
   21.75  			return 0;
   21.76  
   21.77  		case WM_KILLFOCUS:
   21.78 -			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KILLFOCUS");
   21.79  			if (gDebugWindowProc)
   21.80  			{
   21.81  				LL_INFOS("Window") << "WINDOWPROC KillFocus" << LL_ENDL;
   21.82  			}
   21.83 +			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KILLFOCUS");
   21.84  			window_imp->mCallbacks->handleFocusLost(window_imp);
   21.85  			return 0;
   21.86  
   21.87 @@ -2714,7 +2725,6 @@
   21.88  
   21.89  			break;
   21.90  
   21.91 -		// <FS:Ansariel> Respect "Hide pointer while typing" Windows preference setting
   21.92  		case WM_SETTINGCHANGE:
   21.93  			{
   21.94  				if (w_param == SPI_SETMOUSEVANISH)
   21.95 @@ -2726,7 +2736,6 @@
   21.96  				}
   21.97  			}
   21.98  			break;
   21.99 -		// </FS:Ansariel>
  21.100  		}
  21.101  
  21.102  	window_imp->mCallbacks->handlePauseWatchdog(window_imp);	
    22.1 --- a/indra/llwindow/llwindowwin32.h	Wed Feb 14 22:17:38 2018 +0100
    22.2 +++ b/indra/llwindow/llwindowwin32.h	Fri Mar 02 12:06:56 2018 +0100
    22.3 @@ -222,7 +222,6 @@
    22.4  	U32				mRawWParam;
    22.5  	U32				mRawLParam;
    22.6  
    22.7 -	// <FS:Ansariel> Respect "Hide pointer while typing" Windows preference setting
    22.8  	BOOL			mMouseVanish;
    22.9  
   22.10  	friend class LLWindowManager;
    23.1 --- a/indra/newview/VIEWER_VERSION.txt	Wed Feb 14 22:17:38 2018 +0100
    23.2 +++ b/indra/newview/VIEWER_VERSION.txt	Fri Mar 02 12:06:56 2018 +0100
    23.3 @@ -1,1 +1,1 @@
    23.4 -5.1.2
    23.5 +5.1.3
    24.1 --- a/indra/newview/app_settings/grids.xml	Wed Feb 14 22:17:38 2018 +0100
    24.2 +++ b/indra/newview/app_settings/grids.xml	Fri Mar 02 12:06:56 2018 +0100
    24.3 @@ -408,42 +408,19 @@
    24.4          </map>
    24.5      <key>login.aurorascape.com:8002</key>
    24.6          <map>
    24.7 -		<key>DEPRECATED</key>
    24.8 +        <key>DEPRECATED</key>
    24.9              <string>TRUE</string>
   24.10          <key>name</key>
   24.11              <string>login.aurorascape.com:8002</string>
   24.12          </map>
   24.13      <key>login.avination.com/</key>
   24.14          <map>
   24.15 -        <key>LastModified</key>
   24.16 -            <date>2011-08-28T12:00:00.00Z</date>
   24.17 -        <key>about</key>
   24.18 -            <string>https://www.avination.com/</string>
   24.19 -        <key>grid_login_id</key>
   24.20 -            <string>login.avination.com/</string>
   24.21 -        <key>gridname</key>
   24.22 -            <string>Avination</string>
   24.23 -        <key>gridnick</key>
   24.24 -            <string>avination</string>
   24.25 -        <key>helperuri</key>
   24.26 -            <string>https://secure.3dhosting.de/</string>
   24.27 -        <key>login_identifier_types</key>
   24.28 -            <array>
   24.29 -                <string>agent</string>
   24.30 -                <string>account</string>
   24.31 -            </array>
   24.32 -        <key>loginpage</key>
   24.33 -            <string>https://www.avination.com/welcome.php</string>
   24.34 -        <key>loginuri</key>
   24.35 -            <array>
   24.36 -                <string>https://login.avination.com/</string>
   24.37 -            </array>
   24.38 +        <key>DEPRECATED</key>
   24.39 +            <string>TRUE</string>
   24.40          <key>name</key>
   24.41              <string>login.avination.com/</string>
   24.42 -        <key>register</key>
   24.43 -            <string>https://www.avination.com/join.html</string>
   24.44 -        <key>slurl_base</key>
   24.45 -            <string>https://login.avination.com/</string>
   24.46 +        <key>LastModified</key>
   24.47 +            <date>2018-02-28T15:36:26.43Z</date>
   24.48          </map>
   24.49      <key>login.francogrid.org:80</key>
   24.50          <map>
    25.1 --- a/indra/newview/fsfloaterimport.cpp	Wed Feb 14 22:17:38 2018 +0100
    25.2 +++ b/indra/newview/fsfloaterimport.cpp	Fri Mar 02 12:06:56 2018 +0100
    25.3 @@ -241,7 +241,7 @@
    25.4  		filestream.seekg(0, std::ios::end);
    25.5  		S32 file_size = (S32)filestream.tellg();
    25.6  		filestream.seekg(0, std::ios::beg);
    25.7 -		if (unzip_llsd(mManifest, filestream, file_size))
    25.8 +		if (LLUZipHelper::unzip_llsd(mManifest, filestream, file_size) == LLUZipHelper::ZR_OK)
    25.9  		{
   25.10  			file_loaded = true;
   25.11  		}
    26.1 --- a/indra/newview/installers/windows/installer_template.nsi	Wed Feb 14 22:17:38 2018 +0100
    26.2 +++ b/indra/newview/installers/windows/installer_template.nsi	Fri Mar 02 12:06:56 2018 +0100
    26.3 @@ -408,16 +408,16 @@
    26.4  # Write URL registry info
    26.5  WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life"
    26.6  WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "URL Protocol" ""
    26.7 -WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\DefaultIcon" "" '"$INSTDIR\$INSTEXE"'
    26.8 +WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"'
    26.9  
   26.10  # URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks.
   26.11 -WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$INSTEXE" -url "%1"'
   26.12 -WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info"(default)" "URL:Second Life"
   26.13 +WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"'
   26.14 +WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "(default)" "URL:Second Life"
   26.15  WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "URL Protocol" ""
   26.16 -WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$INSTEXE"'
   26.17 +WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"'
   26.18  
   26.19  # URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks.
   26.20 -WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$INSTEXE" -url "%1"'
   26.21 +WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"'
   26.22  
   26.23  # Only allow Launcher to be the icon
   26.24  # <FS:Ansariel> Remove VMP
    27.1 --- a/indra/newview/llappearancemgr.cpp	Wed Feb 14 22:17:38 2018 +0100
    27.2 +++ b/indra/newview/llappearancemgr.cpp	Fri Mar 02 12:06:56 2018 +0100
    27.3 @@ -2302,8 +2302,9 @@
    27.4  		//if replacing - make sure bridge stays.
    27.5  		if (!append && FSLSLBridge::instance().getBridge())
    27.6  		{
    27.7 -			LL_INFOS("FSLSLBridge") << "reinserting bridge at outfit replace" << LL_ENDL;
    27.8 +			LL_INFOS("FSLSLBridge") << "Reinserting bridge at outfit replace" << LL_ENDL;
    27.9  			obj_items.insert(obj_items.end(), FSLSLBridge::instance().getBridge());
   27.10 +			LL_INFOS("FSLSLBridge") << "Bridge reinserted" << LL_ENDL;
   27.11  		}
   27.12  	}
   27.13  	// </FS:TT>
    28.1 --- a/indra/newview/llappviewer.cpp	Wed Feb 14 22:17:38 2018 +0100
    28.2 +++ b/indra/newview/llappviewer.cpp	Fri Mar 02 12:06:56 2018 +0100
    28.3 @@ -936,22 +936,30 @@
    28.4  		LLFile::rmdir(base_dir + "data");
    28.5  		
    28.6  		// Delete per-user files below
    28.7 -		std::string per_user_dir_glob = base_dir + "*" + delem;
    28.8 -		
    28.9 -		LLFile::remove(per_user_dir_glob + "filters.xml");
   28.10 -		LLFile::remove(per_user_dir_glob + "medialist.xml");
   28.11 -		LLFile::remove(per_user_dir_glob + "plugin_cookies.xml");
   28.12 -		LLFile::remove(per_user_dir_glob + "screen_last.bmp");
   28.13 -		LLFile::remove(per_user_dir_glob + "search_history.xml");
   28.14 -		LLFile::remove(per_user_dir_glob + "settings_friends_groups.xml");
   28.15 -		LLFile::remove(per_user_dir_glob + "settings_per_account.xml");
   28.16 -		LLFile::remove(per_user_dir_glob + "teleport_history.xml");
   28.17 -		LLFile::remove(per_user_dir_glob + "texture_list_last.xml");
   28.18 -		LLFile::remove(per_user_dir_glob + "toolbars.xml");
   28.19 -		LLFile::remove(per_user_dir_glob + "typed_locations.xml");
   28.20 -		LLFile::remove(per_user_dir_glob + "url_history.xml");
   28.21 -		LLFile::remove(per_user_dir_glob + "volume_settings.xml");
   28.22 -		LLFile::rmdir(per_user_dir_glob + "browser_profile");
   28.23 +		LLDirIterator dir_it(base_dir, "*");
   28.24 +		std::string dir_name;
   28.25 +		while (dir_it.next(dir_name))
   28.26 +		{
   28.27 +			if (LLFile::isdir(base_dir + delem + dir_name))
   28.28 +			{
   28.29 +				std::string per_user_dir_glob = base_dir + delem + dir_name + delem;
   28.30 +
   28.31 +				LLFile::remove(per_user_dir_glob + "filters.xml");
   28.32 +				LLFile::remove(per_user_dir_glob + "medialist.xml");
   28.33 +				LLFile::remove(per_user_dir_glob + "plugin_cookies.xml");
   28.34 +				LLFile::remove(per_user_dir_glob + "screen_last.bmp");
   28.35 +				LLFile::remove(per_user_dir_glob + "search_history.xml");
   28.36 +				LLFile::remove(per_user_dir_glob + "settings_friends_groups.xml");
   28.37 +				LLFile::remove(per_user_dir_glob + "settings_per_account.xml");
   28.38 +				LLFile::remove(per_user_dir_glob + "teleport_history.xml");
   28.39 +				LLFile::remove(per_user_dir_glob + "texture_list_last.xml");
   28.40 +				LLFile::remove(per_user_dir_glob + "toolbars.xml");
   28.41 +				LLFile::remove(per_user_dir_glob + "typed_locations.xml");
   28.42 +				LLFile::remove(per_user_dir_glob + "url_history.xml");
   28.43 +				LLFile::remove(per_user_dir_glob + "volume_settings.xml");
   28.44 +				LLFile::rmdir(per_user_dir_glob + "browser_profile");
   28.45 +			}
   28.46 +		}
   28.47  	}
   28.48  // </FS>
   28.49  	init_default_trans_args();
   28.50 @@ -1721,7 +1729,7 @@
   28.51  				//	}
   28.52  				//}
   28.53  				//last_call = LLTimer::getTotalTime();
   28.54 -				// </FS:Ansariel>
   28.55 +				// </FS:Ansariel>
   28.56  
   28.57  				display();
   28.58  
   28.59 @@ -1831,21 +1839,21 @@
   28.60  			}
   28.61  
   28.62  			// <FS:Ansariel> FIRE-22297: FPS limiter not working properly on Mac/Linux
   28.63 -			static LLCachedControl<U32> max_fps(gSavedSettings, "FramePerSecondLimit");
   28.64 -			static LLCachedControl<bool> fsLimitFramerate(gSavedSettings, "FSLimitFramerate");
   28.65 +			static LLCachedControl<U32> max_fps(gSavedSettings, "FramePerSecondLimit");
   28.66 +			static LLCachedControl<bool> fsLimitFramerate(gSavedSettings, "FSLimitFramerate");
   28.67  			if (fsLimitFramerate && LLStartUp::getStartupState() == STATE_STARTED && !gTeleportDisplay && !logoutRequestSent() && max_fps > F_APPROXIMATELY_ZERO)
   28.68 -			{
   28.69 -				// Sleep a while to limit frame rate.
   28.70 -				F32 min_frame_time = 1.f / (F32)max_fps;
   28.71 -				S32 milliseconds_to_sleep = llclamp((S32)((min_frame_time - frameTimer.getElapsedTimeF64()) * 1000.f), 0, 1000);
   28.72 -				if (milliseconds_to_sleep > 0)
   28.73 -				{
   28.74 -					LL_RECORD_BLOCK_TIME(FTM_SLEEP);
   28.75 -					ms_sleep(milliseconds_to_sleep);
   28.76 -				}
   28.77 -			}
   28.78 +			{
   28.79 +				// Sleep a while to limit frame rate.
   28.80 +				F32 min_frame_time = 1.f / (F32)max_fps;
   28.81 +				S32 milliseconds_to_sleep = llclamp((S32)((min_frame_time - frameTimer.getElapsedTimeF64()) * 1000.f), 0, 1000);
   28.82 +				if (milliseconds_to_sleep > 0)
   28.83 +				{
   28.84 +					LL_RECORD_BLOCK_TIME(FTM_SLEEP);
   28.85 +					ms_sleep(milliseconds_to_sleep);
   28.86 +				}
   28.87 +			}
   28.88  			frameTimer.reset();
   28.89 -			// </FS:Ansariel>
   28.90 +			// </FS:Ansariel>
   28.91  
   28.92  			resumeMainloopTimeout();
   28.93  
    29.1 --- a/indra/newview/llchatitemscontainerctrl.cpp	Wed Feb 14 22:17:38 2018 +0100
    29.2 +++ b/indra/newview/llchatitemscontainerctrl.cpp	Fri Mar 02 12:06:56 2018 +0100
    29.3 @@ -265,27 +265,28 @@
    29.4  
    29.5  	S32 chars_in_line = mMsgText->getRect().getWidth() / messageFont->getWidth("c");
    29.6  	S32 max_lines = notification["available_height"].asInteger() / (mMsgText->getTextPixelHeight() + 4);
    29.7 -	S32 new_line_chars = std::count(messageText.begin(), messageText.end(), '\n');
    29.8 -	S32 lines_count = (messageText.size() - new_line_chars) / chars_in_line + new_line_chars + 1;
    29.9 +	int lines = 0;
   29.10 +	int chars = 0;
   29.11  
   29.12 -	//Remove excessive chars if message is not fit in available height. MAINT-6891
   29.13 -	if(lines_count > max_lines)
   29.14 +	//Remove excessive chars if message does not fit in available height. MAINT-6891
   29.15 +	std::string::iterator it;
   29.16 +	for (it = messageText.begin(); it < messageText.end() && lines < max_lines; it++)
   29.17  	{
   29.18 -		while(lines_count > max_lines)
   29.19 +		if (*it == '\n')
   29.20 +			++lines;
   29.21 +		else
   29.22 +			++chars;
   29.23 +
   29.24 +		if (chars >= chars_in_line)
   29.25  		{
   29.26 -			std::size_t nl_pos = messageText.rfind('\n');
   29.27 -			if (nl_pos != std::string::npos)
   29.28 -			{
   29.29 -				nl_pos = nl_pos > messageText.length() - chars_in_line? nl_pos : messageText.length() - chars_in_line;
   29.30 -				messageText.erase(messageText.begin() + nl_pos, messageText.end());
   29.31 -			}
   29.32 -			else
   29.33 -			{
   29.34 -				messageText.erase(messageText.end() - chars_in_line, messageText.end());
   29.35 -			}
   29.36 -			new_line_chars = std::count(messageText.begin(), messageText.end(), '\n');
   29.37 -			lines_count = (messageText.size() - new_line_chars) / chars_in_line + new_line_chars;
   29.38 +			chars = 0;
   29.39 +			++lines;
   29.40  		}
   29.41 +	}
   29.42 +
   29.43 +	if (it < messageText.end())
   29.44 +	{
   29.45 +		messageText.erase(it, messageText.end());
   29.46  		messageText += " ...";
   29.47  	}
   29.48  
    30.1 --- a/indra/newview/llfilepicker.cpp	Wed Feb 14 22:17:38 2018 +0100
    30.2 +++ b/indra/newview/llfilepicker.cpp	Fri Mar 02 12:06:56 2018 +0100
    30.3 @@ -359,11 +359,7 @@
    30.4  					dirname = filename + "\\";
    30.5  				else
    30.6  					mFiles.push_back(dirname + filename);
    30.7 -				
    30.8 -				// </FS:ND> Do not add the length of the utf8 string, but use the length of the utf16 string
    30.9 -				// tptrw += filename.size();
   30.10 -				tptrw += wcslen( tptrw );
   30.11 -				// </FS:ND>
   30.12 +				tptrw += wcslen(tptrw);
   30.13  			}
   30.14  		}
   30.15  	}
    31.1 --- a/indra/newview/llfloateravatarrendersettings.cpp	Wed Feb 14 22:17:38 2018 +0100
    31.2 +++ b/indra/newview/llfloateravatarrendersettings.cpp	Fri Mar 02 12:06:56 2018 +0100
    31.3 @@ -91,20 +91,11 @@
    31.4      LLFloater::postBuild();
    31.5      mAvatarSettingsList = getChild<LLNameListCtrl>("render_settings_list");
    31.6      mAvatarSettingsList->setRightMouseDownCallback(boost::bind(&LLFloaterAvatarRenderSettings::onAvatarListRightClick, this, _1, _2, _3));
    31.7 -    this->setVisibleCallback(boost::bind(&LLFloaterAvatarRenderSettings::removePicker, this));
    31.8      getChild<LLFilterEditor>("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterAvatarRenderSettings::onFilterEdit, this, _2));
    31.9  
   31.10  	return TRUE;
   31.11  }
   31.12  
   31.13 -void LLFloaterAvatarRenderSettings::removePicker()
   31.14 -{
   31.15 -    if(mPicker.get())
   31.16 -    {
   31.17 -        mPicker.get()->closeFloater();
   31.18 -    }
   31.19 -}
   31.20 -
   31.21  void LLFloaterAvatarRenderSettings::draw()
   31.22  {
   31.23      if(mNeedsUpdate)
   31.24 @@ -265,8 +256,6 @@
   31.25      {
   31.26          root_floater->addDependentFloater(picker);
   31.27      }
   31.28 -
   31.29 -    mPicker = picker->getHandle();
   31.30  }
   31.31  
   31.32  void LLFloaterAvatarRenderSettings::callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting)
    32.1 --- a/indra/newview/llfloateravatarrendersettings.h	Wed Feb 14 22:17:38 2018 +0100
    32.2 +++ b/indra/newview/llfloateravatarrendersettings.h	Fri Mar 02 12:06:56 2018 +0100
    32.3 @@ -68,7 +68,6 @@
    32.4      bool mNeedsUpdate;
    32.5      LLListContextMenu* mContextMenu;
    32.6      LLNameListCtrl* mAvatarSettingsList;
    32.7 -    LLHandle<LLFloater> mPicker;
    32.8  
    32.9      std::string mNameFilter;
   32.10  };
    33.1 --- a/indra/newview/llfloatermediasettings.cpp	Wed Feb 14 22:17:38 2018 +0100
    33.2 +++ b/indra/newview/llfloatermediasettings.cpp	Fri Mar 02 12:06:56 2018 +0100
    33.3 @@ -171,8 +171,12 @@
    33.4  void LLFloaterMediaSettings::initValues( const LLSD& media_settings, bool editable )
    33.5  {
    33.6  	if (sInstance->hasFocus()) return;
    33.7 -	
    33.8 -	sInstance->clearValues(editable);
    33.9 +
   33.10 +	// Clear values
   33.11 +	sInstance->mPanelMediaSettingsGeneral->clearValues(sInstance->mPanelMediaSettingsGeneral, editable, false /*don't update preview*/);
   33.12 +	sInstance->mPanelMediaSettingsSecurity->clearValues(sInstance->mPanelMediaSettingsSecurity,	editable);
   33.13 +	sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions,  editable);
   33.14 +
   33.15  	// update all panels with values from simulator
   33.16  	sInstance->mPanelMediaSettingsGeneral->
   33.17  		initValues( sInstance->mPanelMediaSettingsGeneral, media_settings, editable );
    34.1 --- a/indra/newview/llfloaterpreference.cpp	Wed Feb 14 22:17:38 2018 +0100
    34.2 +++ b/indra/newview/llfloaterpreference.cpp	Fri Mar 02 12:06:56 2018 +0100
    34.3 @@ -2225,7 +2225,6 @@
    34.4  	BOOL shaders = ctrl_shader_enable->get();
    34.5  	if (shaders)
    34.6  	{
    34.7 -		terrain_detail->setValue(1);
    34.8  		terrain_detail->setEnabled(FALSE);
    34.9  		terrain_text->setEnabled(FALSE);
   34.10  	}
    35.1 --- a/indra/newview/llfloatersearch.cpp	Wed Feb 14 22:17:38 2018 +0100
    35.2 +++ b/indra/newview/llfloatersearch.cpp	Fri Mar 02 12:06:56 2018 +0100
    35.3 @@ -103,6 +103,7 @@
    35.4  	mCategoryPaths["events"]       = "search/events";
    35.5  	mCategoryPaths["groups"]       = "search/groups";
    35.6  	mCategoryPaths["wiki"]         = "search/wiki";
    35.7 +	mCategoryPaths["land"]         = "land";
    35.8  	mCategoryPaths["destinations"] = "destinations";
    35.9  	mCategoryPaths["classifieds"]  = "classifieds";
   35.10  }
    36.1 --- a/indra/newview/llfloatertools.cpp	Wed Feb 14 22:17:38 2018 +0100
    36.2 +++ b/indra/newview/llfloatertools.cpp	Fri Mar 02 12:06:56 2018 +0100
    36.3 @@ -1608,7 +1608,6 @@
    36.4  	
    36.5  	std::string multi_media_info_str = LLTrans::getString("Multiple Media");
    36.6  	std::string media_title = "";
    36.7 -	mNeedMediaTitle = false;
    36.8  	// update UI depending on whether "object" (prim or face) has media
    36.9  	// and whether or not you are allowed to edit it.
   36.10  	
   36.11 @@ -1626,17 +1625,12 @@
   36.12  			{
   36.13  				// initial media title is the media URL (until we get the name)
   36.14  				media_title = media_data_get.getHomeURL();
   36.15 -
   36.16 -				// kick off a navigate and flag that we need to update the title
   36.17 -				navigateToTitleMedia( media_data_get.getHomeURL() );
   36.18 -				mNeedMediaTitle = true;
   36.19  			}
   36.20  			// else all faces might be empty. 
   36.21  		}
   36.22  		else // there' re Different Medias' been set on on the faces.
   36.23  		{
   36.24  			media_title = multi_media_info_str;
   36.25 -			mNeedMediaTitle = false;
   36.26  		}
   36.27  		
   36.28  		// <FS:Ansariel> Don't exist as of 30-01-2017
   36.29 @@ -1655,7 +1649,6 @@
   36.30  		if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia)
   36.31  		{
   36.32  			media_title = multi_media_info_str;
   36.33 -			mNeedMediaTitle = false;
   36.34  		}
   36.35  		else
   36.36  		{
   36.37 @@ -1664,10 +1657,6 @@
   36.38  			{
   36.39  				// initial media title is the media URL (until we get the name)
   36.40  				media_title = media_data_get.getHomeURL();
   36.41 -
   36.42 -				// kick off a navigate and flag that we need to update the title
   36.43 -				navigateToTitleMedia( media_data_get.getHomeURL() );
   36.44 -				mNeedMediaTitle = true;
   36.45  			}
   36.46  		}
   36.47  		
   36.48 @@ -1678,6 +1667,8 @@
   36.49  		getChildView("delete_media")->setEnabled(TRUE);
   36.50  		getChildView("add_media")->setEnabled(editable);
   36.51  	}
   36.52 +
   36.53 +	navigateToTitleMedia(media_title);
   36.54  	media_info->setText(media_title);
   36.55  	
   36.56  	// load values for media settings
   36.57 @@ -1767,16 +1758,31 @@
   36.58  //
   36.59  void LLFloaterTools::navigateToTitleMedia( const std::string url )
   36.60  {
   36.61 -	if ( mTitleMedia )
   36.62 +	std::string multi_media_info_str = LLTrans::getString("Multiple Media");
   36.63 +	if (url.empty() || multi_media_info_str == url)
   36.64 +	{
   36.65 +		// nothing to show
   36.66 +		mNeedMediaTitle = false;
   36.67 +	}
   36.68 +	else if (mTitleMedia)
   36.69  	{
   36.70  		LLPluginClassMedia* media_plugin = mTitleMedia->getMediaPlugin();
   36.71 -		if ( media_plugin )
   36.72 +
   36.73 +		if ( media_plugin ) // Shouldn't this be after navigateTo creates plugin?
   36.74  		{
   36.75  			// if it's a movie, we don't want to hear it
   36.76  			media_plugin->setVolume( 0 );
   36.77  		};
   36.78 -		mTitleMedia->navigateTo( url );
   36.79 -	};
   36.80 +
   36.81 +		// check if url changed or if we need a new media source
   36.82 +		if (mTitleMedia->getCurrentNavUrl() != url || media_plugin == NULL)
   36.83 +		{
   36.84 +			mTitleMedia->navigateTo( url );
   36.85 +		}
   36.86 +
   36.87 +		// flag that we need to update the title (even if no request were made)
   36.88 +		mNeedMediaTitle = true;
   36.89 +	}
   36.90  }
   36.91  
   36.92  //////////////////////////////////////////////////////////////////////////////
    37.1 --- a/indra/newview/llfloatertools.h	Wed Feb 14 22:17:38 2018 +0100
    37.2 +++ b/indra/newview/llfloatertools.h	Fri Mar 02 12:06:56 2018 +0100
    37.3 @@ -108,8 +108,6 @@
    37.4  	void onClickBtnAddMedia();
    37.5  	void onClickBtnEditMedia();
    37.6  	void clearMediaSettings();
    37.7 -	void updateMediaTitle();
    37.8 -	void navigateToTitleMedia( const std::string url );
    37.9  	bool selectedMediaEditable();
   37.10  	void updateLandImpacts();
   37.11  
   37.12 @@ -125,6 +123,8 @@
   37.13  	void refreshMedia();
   37.14  	void getMediaState();
   37.15  	void updateMediaSettings();
   37.16 +	void navigateToTitleMedia( const std::string url ); // navigate if changed
   37.17 +	void updateMediaTitle();
   37.18  	static bool deleteMediaConfirm(const LLSD& notification, const LLSD& response);
   37.19  	static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
   37.20  	static void setObjectType( LLPCode pcode );
    38.1 --- a/indra/newview/llinventorybridge.cpp	Wed Feb 14 22:17:38 2018 +0100
    38.2 +++ b/indra/newview/llinventorybridge.cpp	Fri Mar 02 12:06:56 2018 +0100
    38.3 @@ -43,6 +43,7 @@
    38.4  #include "llfloatermarketplacelistings.h"
    38.5  #include "llfloateroutfitphotopreview.h"
    38.6  #include "llfloatersidepanelcontainer.h"
    38.7 +#include "llsidepanelinventory.h"
    38.8  #include "llfloaterworldmap.h"
    38.9  #include "llfolderview.h"
   38.10  #include "llfriendcard.h"
   38.11 @@ -2032,11 +2033,27 @@
   38.12  	LLInventoryObject *obj = getInventoryObject();
   38.13  	if (obj && obj->getIsLinkType())
   38.14  	{
   38.15 -		LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
   38.16 -		if (active_panel)
   38.17 -		{
   38.18 -			active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
   38.19 -		}
   38.20 +		const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX);
   38.21 +		// <FS:Ansariel> Optional hiding of Received Items folder aka Inbox
   38.22 +		//if (gInventory.isObjectDescendentOf(obj->getLinkedUUID(), inbox_id))
   38.23 +		if (gInventory.isObjectDescendentOf(obj->getLinkedUUID(), inbox_id) && !gSavedSettings.getBOOL("FSShowInboxFolder"))
   38.24 +		// </FS:Ansariel>
   38.25 +		{
   38.26 +			LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
   38.27 +			if (sidepanel_inventory && sidepanel_inventory->getInboxPanel())
   38.28 +			{
   38.29 +				sidepanel_inventory->getInboxPanel()->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
   38.30 +			}
   38.31 +		}
   38.32 +		else
   38.33 +		{
   38.34 +			LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
   38.35 +			if (active_panel)
   38.36 +			{
   38.37 +				active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
   38.38 +			}
   38.39 +		}
   38.40 +
   38.41  	}
   38.42  }
   38.43  
    39.1 --- a/indra/newview/llinventoryfunctions.cpp	Wed Feb 14 22:17:38 2018 +0100
    39.2 +++ b/indra/newview/llinventoryfunctions.cpp	Fri Mar 02 12:06:56 2018 +0100
    39.3 @@ -886,6 +886,10 @@
    39.4  		LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
    39.5  		if (main_inventory)
    39.6  		{
    39.7 +			// <FS:Ansariel> FIRE-5160: Don't reset inventory filter when clearing search term
    39.8 +			main_inventory->showAllItemsPanel();
    39.9 +			main_inventory->resetFilters();
   39.10 +			// </FS:Ansariel>
   39.11  			main_inventory->onFilterEdit("");
   39.12  		}
   39.13  	}
    40.1 --- a/indra/newview/llinventorymodel.cpp	Wed Feb 14 22:17:38 2018 +0100
    40.2 +++ b/indra/newview/llinventorymodel.cpp	Fri Mar 02 12:06:56 2018 +0100
    40.3 @@ -664,6 +664,11 @@
    40.4  		return LLUUID::null;
    40.5  	}
    40.6  
    40.7 +	if (!gMessageSystem)
    40.8 +	{
    40.9 +		return LLUUID::null;
   40.10 +	}
   40.11 +
   40.12  	// Add the category to the internal representation
   40.13  	LLPointer<LLViewerInventoryCategory> cat =
   40.14  		new LLViewerInventoryCategory(id, parent_id, preferred_type, name, gAgent.getID());
    41.1 --- a/indra/newview/llinventorypanel.cpp	Wed Feb 14 22:17:38 2018 +0100
    41.2 +++ b/indra/newview/llinventorypanel.cpp	Fri Mar 02 12:06:56 2018 +0100
    41.3 @@ -326,11 +326,14 @@
    41.4      }
    41.5      
    41.6  	// <FS:Ansariel> Optional hiding of Received Items folder aka Inbox
    41.7 -	if (!gSavedSettings.getBOOL("FSShowInboxFolder"))
    41.8 +	if (getName() != "Worn Items")
    41.9  	{
   41.10 -		getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX));
   41.11 +		if (!gSavedSettings.getBOOL("FSShowInboxFolder"))
   41.12 +		{
   41.13 +			getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX));
   41.14 +		}
   41.15 +		gSavedSettings.getControl("FSShowInboxFolder")->getSignal()->connect(boost::bind(&LLInventoryPanel::updateShowInboxFolder, this, _2));
   41.16  	}
   41.17 -	gSavedSettings.getControl("FSShowInboxFolder")->getSignal()->connect(boost::bind(&LLInventoryPanel::updateShowInboxFolder, this, _2));
   41.18  	// </FS:Ansariel> Optional hiding of Received Items folder aka Inbox
   41.19  
   41.20  	// set the filter for the empty folder if the debug setting is on
   41.21 @@ -1622,56 +1625,43 @@
   41.22  }
   41.23  
   41.24  //static
   41.25 -void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel)
   41.26 +void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel, BOOL take_keyboard_focus, BOOL reset_filter)
   41.27  {
   41.28  	LLInventoryPanel *active_panel;
   41.29 +	bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)));
   41.30 +	bool show_inbox = gSavedSettings.getBOOL("FSShowInboxFolder"); // <FS:Ansariel> Optional hiding of Received Items folder aka Inbox
   41.31 +
   41.32  	// <FS:Ansariel> FIRE-22167: Make "Show in Main View" work properly
   41.33 -	//if (main_panel)
   41.34 +	//if (main_panel && !in_inbox)
   41.35  	//{
   41.36  	//	LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory")->selectAllItemsPanel();
   41.37  	//}
   41.38  	// </FS:Ansariel>
   41.39 +
   41.40  	active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open);
   41.41  
   41.42  	if (active_panel)
   41.43  	{
   41.44  		LL_DEBUGS("Messaging") << "Highlighting" << obj_id  << LL_ENDL;
   41.45 -		
   41.46 -		LLViewerInventoryItem * item = gInventory.getItem(obj_id);
   41.47 -		LLViewerInventoryCategory * cat = gInventory.getCategory(obj_id);
   41.48 -		
   41.49 -		bool in_inbox = false;
   41.50 -		
   41.51 -		LLViewerInventoryCategory * parent_cat = NULL;
   41.52 -		
   41.53 -		if (item)
   41.54 +
   41.55 +		if (reset_filter)
   41.56  		{
   41.57 -			parent_cat = gInventory.getCategory(item->getParentUUID());
   41.58 +			reset_inventory_filter();
   41.59  		}
   41.60 -		else if (cat)
   41.61 -		{
   41.62 -			parent_cat = gInventory.getCategory(cat->getParentUUID());
   41.63 -		}
   41.64 -		
   41.65 -		if (parent_cat)
   41.66 -		{
   41.67 -			in_inbox = (LLFolderType::FT_INBOX == parent_cat->getPreferredType());
   41.68 -		}
   41.69 -		
   41.70 -		if (in_inbox)
   41.71 +
   41.72 +		// <FS:Ansariel> Optional hiding of Received Items folder aka Inbox
   41.73 +		//if (in_inbox)
   41.74 +		if (in_inbox && !show_inbox)
   41.75 +		// </FS:Ansariel>
   41.76  		{
   41.77  			LLSidepanelInventory * sidepanel_inventory =	LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
   41.78  			LLInventoryPanel * inventory_panel = NULL;
   41.79 -			
   41.80 -			if (in_inbox)
   41.81 -			{
   41.82 -				sidepanel_inventory->openInbox();
   41.83 -				inventory_panel = sidepanel_inventory->getInboxPanel();
   41.84 -			}
   41.85 +			sidepanel_inventory->openInbox();
   41.86 +			inventory_panel = sidepanel_inventory->getInboxPanel();
   41.87  
   41.88  			if (inventory_panel)
   41.89  			{
   41.90 -				inventory_panel->setSelection(obj_id, TAKE_FOCUS_YES);
   41.91 +				inventory_panel->setSelection(obj_id, take_keyboard_focus);
   41.92  			}
   41.93  		}
   41.94  		else
   41.95 @@ -1689,7 +1679,7 @@
   41.96  			{
   41.97  				floater_inventory->setFocus(TRUE);
   41.98  			}
   41.99 -			active_panel->setSelection(obj_id, TAKE_FOCUS_YES);
  41.100 +			active_panel->setSelection(obj_id, take_keyboard_focus);
  41.101  		}
  41.102  	}
  41.103  }
    42.1 --- a/indra/newview/llinventorypanel.h	Wed Feb 14 22:17:38 2018 +0100
    42.2 +++ b/indra/newview/llinventorypanel.h	Fri Mar 02 12:06:56 2018 +0100
    42.3 @@ -213,13 +213,13 @@
    42.4  	bool attachObject(const LLSD& userdata);
    42.5  	static void idle(void* user_data);
    42.6  
    42.7 +	void updateFolderLabel(const LLUUID& folder_id);
    42.8 +
    42.9  	// <FS:Ansariel> Optional hiding of empty system folders
   42.10  	void updateHideEmptySystemFolders(const LLSD &data);
   42.11  	// <FS:Ansariel> Optional hiding of Inbox folder
   42.12  	void updateShowInboxFolder(const LLSD &data);
   42.13  
   42.14 -	void updateFolderLabel(const LLUUID& folder_id);
   42.15 -
   42.16  	// DEBUG ONLY:
   42.17  	static void dumpSelectionInformation(void* user_data);
   42.18  
   42.19 @@ -231,8 +231,12 @@
   42.20  	// Find whichever inventory panel is active / on top.
   42.21  	// "Auto_open" determines if we open an inventory panel if none are open.
   42.22  	static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE);
   42.23 -	
   42.24 -	static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel = FALSE);
   42.25 +
   42.26 +	static void openInventoryPanelAndSetSelection(BOOL auto_open,
   42.27 +													const LLUUID& obj_id,
   42.28 +													BOOL main_panel = FALSE,
   42.29 +													BOOL take_keyboard_focus = TAKE_FOCUS_YES,
   42.30 +													BOOL reset_filter = FALSE);
   42.31  
   42.32  	void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
   42.33  	void removeItemID(const LLUUID& id);
    43.1 --- a/indra/newview/llmaterialmgr.cpp	Wed Feb 14 22:17:38 2018 +0100
    43.2 +++ b/indra/newview/llmaterialmgr.cpp	Fri Mar 02 12:06:56 2018 +0100
    43.3 @@ -410,9 +410,10 @@
    43.4  	std::istringstream content_stream(content_string);
    43.5  
    43.6  	LLSD response_data;
    43.7 -	if (!unzip_llsd(response_data, content_stream, content_binary.size()))
    43.8 +	U32 uzip_result = LLUZipHelper::unzip_llsd(response_data, content_stream, content_binary.size());
    43.9 +	if (uzip_result != LLUZipHelper::ZR_OK)
   43.10  	{
   43.11 -		LL_WARNS("Materials") << "Cannot unzip LLSD binary content" << LL_ENDL;
   43.12 +		LL_WARNS("Materials") << "Cannot unzip LLSD binary content: " << uzip_result << LL_ENDL;
   43.13  		return;
   43.14  	}
   43.15  
   43.16 @@ -452,9 +453,10 @@
   43.17  	std::istringstream content_stream(content_string);
   43.18  
   43.19  	LLSD response_data;
   43.20 -	if (!unzip_llsd(response_data, content_stream, content_binary.size()))
   43.21 +	U32 uzip_result = LLUZipHelper::unzip_llsd(response_data, content_stream, content_binary.size());
   43.22 +	if (uzip_result != LLUZipHelper::ZR_OK)
   43.23  	{
   43.24 -		LL_WARNS("Materials") << "Cannot unzip LLSD binary content" << LL_ENDL;
   43.25 +		LL_WARNS("Materials") << "Cannot unzip LLSD binary content: " << uzip_result << LL_ENDL;
   43.26  		return;
   43.27  	}
   43.28  
   43.29 @@ -520,9 +522,10 @@
   43.30  	std::istringstream content_stream(content_string);
   43.31  
   43.32  	LLSD response_data;
   43.33 -	if (!unzip_llsd(response_data, content_stream, content_binary.size()))
   43.34 +	U32 uzip_result = LLUZipHelper::unzip_llsd(response_data, content_stream, content_binary.size());
   43.35 +	if (uzip_result != LLUZipHelper::ZR_OK)
   43.36  	{
   43.37 -		LL_WARNS("Materials") << "Cannot unzip LLSD binary content" << LL_ENDL;
   43.38 +		LL_WARNS("Materials") << "Cannot unzip LLSD binary content: " << uzip_result << LL_ENDL;
   43.39  		return;
   43.40  	}
   43.41  	else
    44.1 --- a/indra/newview/llmeshrepository.cpp	Wed Feb 14 22:17:38 2018 +0100
    44.2 +++ b/indra/newview/llmeshrepository.cpp	Fri Mar 02 12:06:56 2018 +0100
    44.3 @@ -1279,7 +1279,12 @@
    44.4  				LLMeshRepository::sCacheBytesRead += size;
    44.5  				++LLMeshRepository::sCacheReads;
    44.6  				file.seek(offset);
    44.7 -				U8* buffer = new U8[size];
    44.8 +				U8* buffer = new(std::nothrow) U8[size];
    44.9 +				if (!buffer)
   44.10 +				{
   44.11 +					LL_WARNS(LOG_MESH) << "Failed to allocate memory for skin info" << LL_ENDL;
   44.12 +					return false;
   44.13 +				}
   44.14  				file.read(buffer, size);
   44.15  
   44.16  				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
   44.17 @@ -1378,7 +1383,12 @@
   44.18  				++LLMeshRepository::sCacheReads;
   44.19  
   44.20  				file.seek(offset);
   44.21 -				U8* buffer = new U8[size];
   44.22 +				U8* buffer = new(std::nothrow) U8[size];
   44.23 +				if (!buffer)
   44.24 +				{
   44.25 +					LL_WARNS(LOG_MESH) << "Failed to allocate memory for mesh decomposition" << LL_ENDL;
   44.26 +					return false;
   44.27 +				}
   44.28  				file.read(buffer, size);
   44.29  
   44.30  				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
   44.31 @@ -1476,7 +1486,12 @@
   44.32  				LLMeshRepository::sCacheBytesRead += size;
   44.33  				++LLMeshRepository::sCacheReads;
   44.34  				file.seek(offset);
   44.35 -				U8* buffer = new U8[size];
   44.36 +				U8* buffer = new(std::nothrow) U8[size];
   44.37 +				if (!buffer)
   44.38 +				{
   44.39 +					LL_WARNS(LOG_MESH) << "Failed to allocate memory for physics shape" << LL_ENDL;
   44.40 +					return false;
   44.41 +				}
   44.42  				file.read(buffer, size);
   44.43  
   44.44  				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
   44.45 @@ -1855,9 +1870,11 @@
   44.46  
   44.47  		std::istringstream stream(res_str);
   44.48  
   44.49 -		if (!unzip_llsd(skin, stream, data_size))
   44.50 +		U32 uzip_result = LLUZipHelper::unzip_llsd(skin, stream, data_size);
   44.51 +		if (uzip_result != LLUZipHelper::ZR_OK)
   44.52  		{
   44.53  			LL_WARNS(LOG_MESH) << "Mesh skin info parse error.  Not a valid mesh asset!  ID:  " << mesh_id
   44.54 +							   << " uzip result" << uzip_result
   44.55  							   << LL_ENDL;
   44.56  			return false;
   44.57  		}
   44.58 @@ -1887,9 +1904,11 @@
   44.59  
   44.60  		std::istringstream stream(res_str);
   44.61  
   44.62 -		if (!unzip_llsd(decomp, stream, data_size))
   44.63 +		U32 uzip_result = LLUZipHelper::unzip_llsd(decomp, stream, data_size);
   44.64 +		if (uzip_result != LLUZipHelper::ZR_OK)
   44.65  		{
   44.66  			LL_WARNS(LOG_MESH) << "Mesh decomposition parse error.  Not a valid mesh asset!  ID:  " << mesh_id
   44.67 +							   << " uzip result: " << uzip_result
   44.68  							   << LL_ENDL;
   44.69  			return false;
   44.70  		}
   44.71 @@ -5080,26 +5099,32 @@
   44.72          gInventory.notifyObservers();
   44.73          success = true;
   44.74  
   44.75 +        LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
   44.76 +
   44.77          // Show the preview panel for textures and sounds to let
   44.78          // user know that the image (or snapshot) arrived intact.
   44.79 -        LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel();
   44.80 +        LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
   44.81          if (panel)
   44.82          {
   44.83 -            LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
   44.84  
   44.85              panel->setSelection(
   44.86                  server_response["new_inventory_item"].asUUID(),
   44.87                  TAKE_FOCUS_NO);
   44.88 -
   44.89 -            // restore keyboard focus
   44.90 -            gFocusMgr.setKeyboardFocus(focus);
   44.91          }
   44.92 +        else
   44.93 +        {
   44.94 +            LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, server_response["new_inventory_item"].asUUID(), TRUE, TAKE_FOCUS_NO, TRUE);
   44.95 +        }
   44.96 +
   44.97 +        // restore keyboard focus
   44.98 +        gFocusMgr.setKeyboardFocus(focus);
   44.99      }
  44.100      else
  44.101      {
  44.102          LL_WARNS() << "Can't find a folder to put it in" << LL_ENDL;
  44.103      }
  44.104  
  44.105 +    // Todo: This is mesh repository code, is following code really needed?
  44.106      // remove the "Uploading..." message
  44.107      LLUploadDialog::modalUploadFinished();
  44.108  
    45.1 --- a/indra/newview/llmutelist.cpp	Wed Feb 14 22:17:38 2018 +0100
    45.2 +++ b/indra/newview/llmutelist.cpp	Fri Mar 02 12:06:56 2018 +0100
    45.3 @@ -331,14 +331,7 @@
    45.4  				// </FS:Ansariel>
    45.5  				notifyObservers();
    45.6  				notifyObserversDetailed(localmute);
    45.7 -				if(!(localmute.mFlags & LLMute::flagParticles))
    45.8 -				{
    45.9 -					//Kill all particle systems owned by muted task
   45.10 -					if(localmute.mType == LLMute::AGENT || localmute.mType == LLMute::OBJECT)
   45.11 -					{
   45.12 -						LLViewerPartSim::getInstance()->clearParticlesByOwnerID(localmute.mID);
   45.13 -					}
   45.14 -				}
   45.15 +
   45.16  				//mute local lights that are attached to the avatar
   45.17  				LLVOAvatar *avatarp = find_avatar(localmute.mID);
   45.18  				if (avatarp)
    46.1 --- a/indra/newview/lloutfitslist.cpp	Wed Feb 14 22:17:38 2018 +0100
    46.2 +++ b/indra/newview/lloutfitslist.cpp	Fri Mar 02 12:06:56 2018 +0100
    46.3 @@ -1081,7 +1081,8 @@
    46.4      // Reset selection if the outfit is selected.
    46.5      if (category_id == mSelectedOutfitUUID)
    46.6      {
    46.7 -        signalSelectionOutfitUUID(LLUUID::null);
    46.8 +        mSelectedOutfitUUID = LLUUID::null;
    46.9 +        signalSelectionOutfitUUID(mSelectedOutfitUUID);
   46.10      }
   46.11  }
   46.12  
    47.1 --- a/indra/newview/llpanellogin.cpp	Wed Feb 14 22:17:38 2018 +0100
    47.2 +++ b/indra/newview/llpanellogin.cpp	Fri Mar 02 12:06:56 2018 +0100
    47.3 @@ -301,12 +301,24 @@
    47.4  
    47.5  	// Load favorites into the combo.
    47.6  	std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple();
    47.7 +	LLStringUtil::toLower(user_defined_name);
    47.8  	std::replace(user_defined_name.begin(), user_defined_name.end(), '.', ' ');
    47.9  	std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
   47.10  	std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
   47.11  	mUsernameLength = user_defined_name.length();
   47.12  	updateLoginButtons();
   47.13  
   47.14 +	std::string::size_type index = user_defined_name.find(' ');
   47.15 +	if (index != std::string::npos)
   47.16 +	{
   47.17 +		std::string username = user_defined_name.substr(0, index);
   47.18 +		std::string lastname = user_defined_name.substr(index+1);
   47.19 +		if (lastname == "resident")
   47.20 +		{
   47.21 +			user_defined_name = username;
   47.22 +		}
   47.23 +	}
   47.24 +
   47.25  	LLSD fav_llsd;
   47.26  	llifstream file;
   47.27  	file.open(filename.c_str());
   47.28 @@ -494,7 +506,7 @@
   47.29  	LL_INFOS("Credentials") << "Setting authenticator field " << authenticator["type"].asString() << LL_ENDL;
   47.30  	if(authenticator.isMap() && 
   47.31  	   authenticator.has("secret") && 
   47.32 -	   (authenticator["secret"].asString().size() > 0))
   47.33 +	   (authenticator["secret"].asString().size() > 0) && remember)
   47.34  	{
   47.35  		
   47.36  		// This is a MD5 hex digest of a password.
   47.37 @@ -803,7 +815,8 @@
   47.38  	params["login_content_version"] = gSavedSettings.getString("LoginContentVersion");
   47.39  
   47.40  	// Make an LLURI with this augmented info
   47.41 -	LLURI login_uri(LLURI::buildHTTP(login_page.authority(),
   47.42 +	std::string url = login_page.scheme().empty()? login_page.authority() : login_page.scheme() + "://" + login_page.authority();
   47.43 +	LLURI login_uri(LLURI::buildHTTP(url,
   47.44  									 login_page.path(),
   47.45  									 params));
   47.46  
    48.1 --- a/indra/newview/llpanelmaininventory.cpp	Wed Feb 14 22:17:38 2018 +0100
    48.2 +++ b/indra/newview/llpanelmaininventory.cpp	Fri Mar 02 12:06:56 2018 +0100
    48.3 @@ -44,6 +44,7 @@
    48.4  #include "llfloaterreg.h"
    48.5  #include "llmenubutton.h"
    48.6  #include "lloutfitobserver.h"
    48.7 +#include "llpanelmarketplaceinbox.h"
    48.8  #include "llpreviewtexture.h"
    48.9  #include "llresmgr.h"
   48.10  #include "llscrollcontainer.h"
   48.11 @@ -246,7 +247,9 @@
   48.12  		mWornItemsPanel->setFilterWorn();
   48.13  		mWornItemsPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
   48.14  		mWornItemsPanel->setFilterLinks(LLInventoryFilter::FILTERLINK_EXCLUDE_LINKS);
   48.15 -		mWornItemsPanel->getFilter().markDefault();
   48.16 +		LLInventoryFilter& worn_filter = mWornItemsPanel->getFilter();
   48.17 +		worn_filter.setFilterCategoryTypes(worn_filter.getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX));
   48.18 +		worn_filter.markDefault();
   48.19  		mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2));
   48.20  
   48.21  		// <FS:Ansariel> Firestorm additions
   48.22 @@ -665,10 +668,10 @@
   48.23  	{
   48.24  		// <FS:Ansariel> FIRE-5160: Don't reset inventory filter when clearing search term
   48.25  		//initially_active = mActivePanel->getFilter().isNotDefault();
   48.26 -		//mActivePanel->setFilterSubString(LLStringUtil::null);
   48.27 +		//setFilterSubString(LLStringUtil::null);
   48.28  		//mActivePanel->setFilterTypes(0xffffffffffffffffULL);
   48.29  		//mActivePanel->setFilterLinks(LLInventoryFilter::FILTERLINK_INCLUDE_LINKS);
   48.30 -		mActivePanel->setFilterSubString(LLStringUtil::null);
   48.31 +		setFilterSubString(LLStringUtil::null);
   48.32  		// </FS:Ansariel>
   48.33  	}
   48.34  
   48.35 @@ -687,6 +690,16 @@
   48.36  		mActivePanel->getRootFolder()->scrollToShowSelection();
   48.37  	}
   48.38  	mFilterSubString = "";
   48.39 +
   48.40 +	LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
   48.41 +	if (sidepanel_inventory)
   48.42 +	{
   48.43 +		LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox");
   48.44 +		if (inbox_panel)
   48.45 +		{
   48.46 +			inbox_panel->onClearSearch();
   48.47 +		}
   48.48 +	}
   48.49  }
   48.50  
   48.51  void LLPanelMainInventory::onFilterEdit(const std::string& search_string )
   48.52 @@ -740,6 +753,16 @@
   48.53  		setFilterSubString(mFilterSubString);
   48.54  	}
   48.55  	// </FS:Ansariel> Separate search for inventory tabs from Satomi Ahn (FIRE-913 & FIRE-6862)
   48.56 +
   48.57 +	LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
   48.58 +	if (sidepanel_inventory)
   48.59 +	{
   48.60 +		LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox");
   48.61 +		if (inbox_panel)
   48.62 +		{
   48.63 +			inbox_panel->onFilterEdit(search_string);
   48.64 +		}
   48.65 +	}
   48.66  }
   48.67  
   48.68  // <FS:Zi> Filter dropdown
   48.69 @@ -1038,8 +1061,17 @@
   48.70  		// </FS:Ansariel>
   48.71  	}
   48.72  
   48.73 +	if(mCategoryCount != gInventory.getCategoryCount())
   48.74 +	{
   48.75 +		mCategoryCount = gInventory.getCategoryCount();
   48.76 +		mCategoryCountString = "";
   48.77 +		LLLocale locale(LLLocale::USER_LOCALE);
   48.78 +		LLResMgr::getInstance()->getIntegerString(mCategoryCountString, mCategoryCount);
   48.79 +	}
   48.80 +
   48.81  	LLStringUtil::format_map_t string_args;
   48.82  	string_args["[ITEM_COUNT]"] = mItemCountString;
   48.83 +	string_args["[CATEGORY_COUNT]"] = mCategoryCountString;
   48.84  	string_args["[FILTER]"] = getFilterText();
   48.85  
   48.86  	std::string text = "";
   48.87 @@ -1058,6 +1090,7 @@
   48.88  	}
   48.89  	
   48.90      mCounterCtrl->setValue(text);
   48.91 +    mCounterCtrl->setToolTip(text);
   48.92  }
   48.93  
   48.94  void LLPanelMainInventory::onFocusReceived()
   48.95 @@ -1218,7 +1251,6 @@
   48.96  
   48.97  	// Get data needed for filter display
   48.98  	U32 filter_types = mFilter->getFilterObjectTypes();
   48.99 -	std::string filter_string = mFilter->getFilterSubString();
  48.100  	LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState();
  48.101  	U32 hours = mFilter->getHoursAgo();
  48.102  	U32 date_search_direction = mFilter->getDateSearchDirection();
    49.1 --- a/indra/newview/llpanelmaininventory.h	Wed Feb 14 22:17:38 2018 +0100
    49.2 +++ b/indra/newview/llpanelmaininventory.h	Fri Mar 02 12:06:56 2018 +0100
    49.3 @@ -160,7 +160,7 @@
    49.4  
    49.5  	LLFilterEditor*				mFilterEditor;
    49.6  	LLTabContainer*				mFilterTabs;
    49.7 -    LLUICtrl*                   mCounterCtrl;
    49.8 +	LLUICtrl*					mCounterCtrl;
    49.9  	LLHandle<LLFloater>			mFinderHandle;
   49.10  	LLInventoryPanel*			mActivePanel;
   49.11  	LLInventoryPanel*			mWornItemsPanel;
   49.12 @@ -169,7 +169,9 @@
   49.13  	std::string					mFilterText;
   49.14  	std::string					mFilterSubString;
   49.15  	S32							mItemCount;
   49.16 -	std::string 				mItemCountString;
   49.17 +	std::string					mItemCountString;
   49.18 +	S32							mCategoryCount;
   49.19 +	std::string					mCategoryCountString;
   49.20  	LLComboBox*					mSearchTypeCombo;
   49.21  
   49.22  	// <FS:Zi> Filter dropdown
    50.1 --- a/indra/newview/llpanelmarketplaceinbox.cpp	Wed Feb 14 22:17:38 2018 +0100
    50.2 +++ b/indra/newview/llpanelmarketplaceinbox.cpp	Fri Mar 02 12:06:56 2018 +0100
    50.3 @@ -51,11 +51,15 @@
    50.4  	, mFreshCountCtrl(NULL)
    50.5  	, mInboxButton(NULL)
    50.6  	, mInventoryPanel(NULL)
    50.7 +	, mSavedFolderState(NULL)
    50.8  {
    50.9 +	mSavedFolderState = new LLSaveFolderState();
   50.10 +	mSavedFolderState->setApply(FALSE);
   50.11  }
   50.12  
   50.13  LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
   50.14  {
   50.15 +	delete mSavedFolderState;
   50.16  }
   50.17  
   50.18  // virtual
   50.19 @@ -102,6 +106,7 @@
   50.20  	// Set the sort order newest to oldest
   50.21  	mInventoryPanel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_DATE);
   50.22  	mInventoryPanel->getFilter().markDefault();
   50.23 +	mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
   50.24  
   50.25  	// Set selection callback for proper update of inventory status buttons
   50.26  	// <FS:Ansariel> FIRE-21948: Show element count in Received Items folder
   50.27 @@ -202,6 +207,38 @@
   50.28  	return item_count;
   50.29  }
   50.30  
   50.31 +void LLPanelMarketplaceInbox::onClearSearch()
   50.32 +{
   50.33 +	if (mInventoryPanel)
   50.34 +	{
   50.35 +		mInventoryPanel->setFilterSubString(LLStringUtil::null);
   50.36 +		mSavedFolderState->setApply(TRUE);
   50.37 +		mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
   50.38 +		LLOpenFoldersWithSelection opener;
   50.39 +		mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
   50.40 +		mInventoryPanel->getRootFolder()->scrollToShowSelection();
   50.41 +	}
   50.42 +}
   50.43 +
   50.44 +void LLPanelMarketplaceInbox::onFilterEdit(const std::string& search_string)
   50.45 +{
   50.46 +	if (mInventoryPanel)
   50.47 +	{
   50.48 +
   50.49 +		if (search_string == "")
   50.50 +		{
   50.51 +			onClearSearch();
   50.52 +		}
   50.53 +
   50.54 +		if (!mInventoryPanel->getFilter().isNotDefault())
   50.55 +		{
   50.56 +			mSavedFolderState->setApply(FALSE);
   50.57 +			mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
   50.58 +		}
   50.59 +		mInventoryPanel->setFilterSubString(search_string);
   50.60 +	}
   50.61 +}
   50.62 +
   50.63  std::string LLPanelMarketplaceInbox::getBadgeString() const
   50.64  {
   50.65  	std::string item_count_str("");
    51.1 --- a/indra/newview/llpanelmarketplaceinbox.h	Wed Feb 14 22:17:38 2018 +0100
    51.2 +++ b/indra/newview/llpanelmarketplaceinbox.h	Fri Mar 02 12:06:56 2018 +0100
    51.3 @@ -29,7 +29,6 @@
    51.4  
    51.5  #include "llpanel.h"
    51.6  #include "llfolderview.h"
    51.7 -
    51.8  class LLButton;
    51.9  class LLInventoryPanel;
   51.10  class LLUICtrl;
   51.11 @@ -57,6 +56,9 @@
   51.12  	
   51.13  	LLInventoryPanel * setupInventoryPanel();
   51.14  
   51.15 +	void onClearSearch();
   51.16 +	void onFilterEdit(const std::string& search_string);
   51.17 +
   51.18  	U32 getFreshItemCount() const;
   51.19  	U32 getTotalItemCount() const;
   51.20  
   51.21 @@ -75,6 +77,7 @@
   51.22  	LLUICtrl *			mFreshCountCtrl;
   51.23  	LLButton *			mInboxButton;
   51.24  	LLInventoryPanel *	mInventoryPanel;
   51.25 +	LLSaveFolderState*			mSavedFolderState;
   51.26  };
   51.27  
   51.28  
    52.1 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp	Wed Feb 14 22:17:38 2018 +0100
    52.2 +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp	Fri Mar 02 12:06:56 2018 +0100
    52.3 @@ -64,6 +64,12 @@
    52.4  LLInboxInventoryPanel::~LLInboxInventoryPanel()
    52.5  {}
    52.6  
    52.7 +void LLInboxInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
    52.8 +{
    52.9 +	LLInventoryPanel::initFromParams(params);
   52.10 +	getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX));
   52.11 +}
   52.12 +
   52.13  LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop)
   52.14  {
   52.15  	LLUIColor item_color = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
   52.16 @@ -162,18 +168,16 @@
   52.17  	LLFolderViewFolder::draw();
   52.18  }
   52.19  
   52.20 -void LLInboxFolderViewFolder::selectItem()
   52.21 +BOOL LLInboxFolderViewFolder::handleMouseDown( S32 x, S32 y, MASK mask )
   52.22  {
   52.23  	deFreshify();
   52.24 -
   52.25 -	LLFolderViewFolder::selectItem();
   52.26 +	return LLFolderViewFolder::handleMouseDown(x, y, mask);
   52.27  }
   52.28  
   52.29 -void LLInboxFolderViewFolder::toggleOpen()
   52.30 +BOOL LLInboxFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask )
   52.31  {
   52.32  	deFreshify();
   52.33 -
   52.34 -	LLFolderViewFolder::toggleOpen();
   52.35 +	return LLFolderViewFolder::handleDoubleClick(x, y, mask);
   52.36  }
   52.37  
   52.38  void LLInboxFolderViewFolder::computeFreshness()
    53.1 --- a/indra/newview/llpanelmarketplaceinboxinventory.h	Wed Feb 14 22:17:38 2018 +0100
    53.2 +++ b/indra/newview/llpanelmarketplaceinboxinventory.h	Fri Mar 02 12:06:56 2018 +0100
    53.3 @@ -46,6 +46,7 @@
    53.4  	~LLInboxInventoryPanel();
    53.5  
    53.6  	// virtual
    53.7 +	void initFromParams(const LLInventoryPanel::Params&);
    53.8  	LLFolderViewFolder*	createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop);
    53.9  	LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);
   53.10  };
   53.11 @@ -68,8 +69,8 @@
   53.12      void addItem(LLFolderViewItem* item);
   53.13  	void draw();
   53.14  	
   53.15 -	void selectItem();
   53.16 -	void toggleOpen();
   53.17 +	BOOL handleMouseDown(S32 x, S32 y, MASK mask);
   53.18 +	BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
   53.19  
   53.20  	void computeFreshness();
   53.21  	void deFreshify();
    54.1 --- a/indra/newview/llpanelmediasettingsgeneral.cpp	Wed Feb 14 22:17:38 2018 +0100
    54.2 +++ b/indra/newview/llpanelmediasettingsgeneral.cpp	Fri Mar 02 12:06:56 2018 +0100
    54.3 @@ -196,7 +196,7 @@
    54.4  
    54.5  ////////////////////////////////////////////////////////////////////////////////
    54.6  // static 
    54.7 -void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
    54.8 +void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable, bool update_preview)
    54.9  {	
   54.10  	LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
   54.11  	self->mAutoLoop->clear();
   54.12 @@ -217,7 +217,10 @@
   54.13  	self->mHeightPixels ->setEnabled(editable);
   54.14  	self->mHomeURL ->setEnabled(editable);
   54.15  	self->mWidthPixels ->setEnabled(editable);
   54.16 -	self->updateMediaPreview();
   54.17 +	if (update_preview)
   54.18 +	{
   54.19 +		self->updateMediaPreview();
   54.20 +	}
   54.21  }
   54.22  
   54.23  // static
    55.1 --- a/indra/newview/llpanelmediasettingsgeneral.h	Wed Feb 14 22:17:38 2018 +0100
    55.2 +++ b/indra/newview/llpanelmediasettingsgeneral.h	Fri Mar 02 12:06:56 2018 +0100
    55.3 @@ -59,7 +59,7 @@
    55.4  
    55.5  	void setParent( LLFloaterMediaSettings* parent );
    55.6  	static void initValues( void* userdata, const LLSD& media_settings ,bool editable);
    55.7 -	static void clearValues( void* userdata, bool editable);
    55.8 +	static void clearValues( void* userdata, bool editable, bool update_preview = true);
    55.9  	
   55.10  	// Navigates the current selected face to the Home URL.
   55.11  	// If 'only_if_current_is_empty' is "true", it only performs
    56.1 --- a/indra/newview/llpanelplaces.cpp	Wed Feb 14 22:17:38 2018 +0100
    56.2 +++ b/indra/newview/llpanelplaces.cpp	Fri Mar 02 12:06:56 2018 +0100
    56.3 @@ -428,11 +428,16 @@
    56.4  			mPlaceInfoType = key_type;
    56.5  			mPosGlobal.setZero();
    56.6  			mItem = NULL;
    56.7 +			mRegionId.setNull();
    56.8  			togglePlaceInfoPanel(TRUE);
    56.9  
   56.10  			if (mPlaceInfoType == AGENT_INFO_TYPE)
   56.11  			{
   56.12  				mPlaceProfile->setInfoType(LLPanelPlaceInfo::AGENT);
   56.13 +				if (gAgent.getRegion())
   56.14 +				{
   56.15 +					mRegionId = gAgent.getRegion()->getRegionID();
   56.16 +				}
   56.17  			}
   56.18  			else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE)
   56.19  			{
   56.20 @@ -505,6 +510,8 @@
   56.21  	if (!parcel_mgr)
   56.22  		return;
   56.23  
   56.24 +	mParcelLocalId = parcel_mgr->getAgentParcel()->getLocalID();
   56.25 +
   56.26  	// Start using LLViewerParcelMgr for land selection if
   56.27  	// information about nearby land is requested.
   56.28  	// Otherwise stop using land selection and deselect land.
   56.29 @@ -861,10 +868,21 @@
   56.30  	{
   56.31  		menu = mPlaceMenu;
   56.32  
   56.33 +		bool landmark_item_enabled = false;
   56.34 +		LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
   56.35 +		if (is_agent_place_info_visible
   56.36 +			&& gAgent.getRegion()
   56.37 +			&& mRegionId == gAgent.getRegion()->getRegionID()
   56.38 +			&& parcel_mgr
   56.39 +			&& parcel_mgr->getAgentParcel()->getLocalID() == mParcelLocalId)
   56.40 +		{
   56.41 +			// Floater still shows location identical to agent's position
   56.42 +			landmark_item_enabled = !LLLandmarkActions::landmarkAlreadyExists();
   56.43 +		}
   56.44 +
   56.45  		// Enable adding a landmark only for agent current parcel and if
   56.46  		// there is no landmark already pointing to that parcel in agent's inventory.
   56.47 -		menu->getChild<LLMenuItemCallGL>("landmark")->setEnabled(is_agent_place_info_visible &&
   56.48 -																 !LLLandmarkActions::landmarkAlreadyExists());
   56.49 +		menu->getChild<LLMenuItemCallGL>("landmark")->setEnabled(landmark_item_enabled);
   56.50  		// STORM-411
   56.51  		// Creating landmarks for remote locations is impossible.
   56.52  		// So hide menu item "Make a Landmark" in "Teleport History Profile" panel.
    57.1 --- a/indra/newview/llpanelplaces.h	Wed Feb 14 22:17:38 2018 +0100
    57.2 +++ b/indra/newview/llpanelplaces.h	Fri Mar 02 12:06:56 2018 +0100
    57.3 @@ -153,6 +153,10 @@
    57.4  	// Information type currently shown in Place Information panel
    57.5  	std::string					mPlaceInfoType;
    57.6  
    57.7 +	// Region and parcel ids, to detect location changes in case of AGENT_INFO_TYPE
    57.8 +	LLUUID						mRegionId;
    57.9 +	S32							mParcelLocalId;
   57.10 +
   57.11  	bool						isLandmarkEditModeOn;
   57.12  
   57.13  	// Holds info whether "My Landmarks" and "Teleport History" tabs have been created.
    58.1 --- a/indra/newview/llstartup.cpp	Wed Feb 14 22:17:38 2018 +0100
    58.2 +++ b/indra/newview/llstartup.cpp	Fri Mar 02 12:06:56 2018 +0100
    58.3 @@ -1132,7 +1132,6 @@
    58.4  		set_startup_status(0.03f, msg.c_str(), gAgent.mMOTD.c_str());
    58.5  		display_startup();
    58.6  		// LLViewerMedia::initBrowser();
    58.7 -		show_release_notes_if_required();
    58.8  		LLStartUp::setStartupState( STATE_LOGIN_SHOW );
    58.9  		return FALSE;
   58.10  	}
   58.11 @@ -1165,6 +1164,7 @@
   58.12  			// </FS:Zi>
   58.13  			init_menus();
   58.14  		}
   58.15 +		show_release_notes_if_required();
   58.16  
   58.17  		if (show_connect_box)
   58.18  		{
    59.1 --- a/indra/newview/llviewerassetupload.cpp	Wed Feb 14 22:17:38 2018 +0100
    59.2 +++ b/indra/newview/llviewerassetupload.cpp	Fri Mar 02 12:06:56 2018 +0100
    59.3 @@ -796,17 +796,22 @@
    59.4          {
    59.5              success = true;
    59.6  
    59.7 +            LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
    59.8 +
    59.9              // Show the preview panel for textures and sounds to let
   59.10              // user know that the image (or snapshot) arrived intact.
   59.11 -            LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel();
   59.12 +            LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
   59.13              if (panel)
   59.14              {
   59.15 -                LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
   59.16                  panel->setSelection(serverInventoryItem, TAKE_FOCUS_NO);
   59.17 +            }
   59.18 +            else
   59.19 +            {
   59.20 +                LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, TRUE, TAKE_FOCUS_NO, TRUE);
   59.21 +            }
   59.22  
   59.23 -                // restore keyboard focus
   59.24 -                gFocusMgr.setKeyboardFocus(focus);
   59.25 -            }
   59.26 +            // restore keyboard focus
   59.27 +            gFocusMgr.setKeyboardFocus(focus);
   59.28          }
   59.29          else
   59.30          {
    60.1 --- a/indra/newview/llviewermedia.cpp	Wed Feb 14 22:17:38 2018 +0100
    60.2 +++ b/indra/newview/llviewermedia.cpp	Fri Mar 02 12:06:56 2018 +0100
    60.3 @@ -796,13 +796,24 @@
    60.4  				}
    60.5  			}
    60.6  			// update the audio stream here as well
    60.7 +			static bool restore_parcel_audio = false;
    60.8  			if( !inworld_audio_enabled)
    60.9  			{
   60.10  				if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio())
   60.11  				{
   60.12  					LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade();
   60.13 +					restore_parcel_audio = true;
   60.14  				}
   60.15  			}
   60.16 +            else
   60.17 +            {
   60.18 +                if(gAudiop && LLViewerMedia::hasParcelAudio() && restore_parcel_audio && gSavedSettings.getBOOL("MediaTentativeAutoPlay"))
   60.19 +                {
   60.20 +                    LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL());
   60.21 +                    restore_parcel_audio = false;
   60.22 +                }
   60.23 +            }
   60.24 +
   60.25  			pimpl->setPriority(new_priority);
   60.26  
   60.27  			if(pimpl->getUsedInUI())
    61.1 --- a/indra/newview/llviewermessage.cpp	Wed Feb 14 22:17:38 2018 +0100
    61.2 +++ b/indra/newview/llviewermessage.cpp	Fri Mar 02 12:06:56 2018 +0100
    61.3 @@ -935,7 +935,7 @@
    61.4  	 */
    61.5  	bool isSelectionChanged()
    61.6  	{	
    61.7 -		LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get());
    61.8 +		LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel();
    61.9  
   61.10  		if (NULL == active_panel)
   61.11  		{
   61.12 @@ -945,7 +945,7 @@
   61.13  		// get selected items (without destination folder)
   61.14  		selected_items_t selected_items;
   61.15   		
   61.16 - 		std::set<LLFolderViewItem*> selection =    LLInventoryPanel::getActiveInventoryPanel()->getRootFolder()->getSelectionList();
   61.17 +		std::set<LLFolderViewItem*> selection = active_panel->getRootFolder()->getSelectionList();
   61.18  		for (std::set<LLFolderViewItem*>::iterator it = selection.begin(),    end_it = selection.end();
   61.19  			it != end_it;
   61.20  			++it)
    62.1 --- a/indra/newview/llviewerobject.cpp	Wed Feb 14 22:17:38 2018 +0100
    62.2 +++ b/indra/newview/llviewerobject.cpp	Fri Mar 02 12:06:56 2018 +0100
    62.3 @@ -288,7 +288,9 @@
    62.4  	mPhysicsShapeUnknown(true),
    62.5  	mAttachmentItemID(LLUUID::null),
    62.6  	mLastUpdateType(OUT_UNKNOWN),
    62.7 -	mLastUpdateCached(FALSE)
    62.8 +	mLastUpdateCached(FALSE),
    62.9 +	mCachedMuteListUpdateTime(0),
   62.10 +	mCachedOwnerInMuteList(false)
   62.11  {
   62.12  	if (!is_global)
   62.13  	{
   62.14 @@ -5245,6 +5247,30 @@
   62.15  	}
   62.16  }
   62.17  
   62.18 +bool LLViewerObject::isOwnerInMuteList(LLUUID id)
   62.19 +{
   62.20 +	LLUUID owner_id = id.isNull() ? mOwnerID : id;
   62.21 +	if (isAvatar() || owner_id.isNull())
   62.22 +	{
   62.23 +		return false;
   62.24 +	}
   62.25 +	bool muted = false;
   62.26 +	F64 now = LLFrameTimer::getTotalSeconds();
   62.27 +	if (now < mCachedMuteListUpdateTime)
   62.28 +	{
   62.29 +		muted = mCachedOwnerInMuteList;
   62.30 +	}
   62.31 +	else
   62.32 +	{
   62.33 +		muted = LLMuteList::getInstance()->isMuted(owner_id);
   62.34 +
   62.35 +		const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1;
   62.36 +		mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES;
   62.37 +		mCachedOwnerInMuteList = muted;
   62.38 +	}
   62.39 +	return muted;
   62.40 +}
   62.41 +
   62.42  LLVOAvatar* LLViewerObject::asAvatar()
   62.43  {
   62.44  	return NULL;
    63.1 --- a/indra/newview/llviewerobject.h	Wed Feb 14 22:17:38 2018 +0100
    63.2 +++ b/indra/newview/llviewerobject.h	Fri Mar 02 12:06:56 2018 +0100
    63.3 @@ -432,6 +432,8 @@
    63.4  	void updateText(); // update text label position
    63.5  	virtual void updateDrawable(BOOL force_damped); // force updates on static objects
    63.6  
    63.7 +	bool isOwnerInMuteList(LLUUID item_id = LLUUID());
    63.8 +
    63.9  	void setDrawableState(U32 state, BOOL recursive = TRUE);
   63.10  	void clearDrawableState(U32 state, BOOL recursive = TRUE);
   63.11  	BOOL isDrawableState(U32 state, BOOL recursive = TRUE) const;
   63.12 @@ -840,6 +842,9 @@
   63.13  	static BOOL sVelocityInterpolate;
   63.14  	static BOOL sPingInterpolate;
   63.15  
   63.16 +	bool mCachedOwnerInMuteList;
   63.17 +	F64 mCachedMuteListUpdateTime;
   63.18 +
   63.19  	//--------------------------------------------------------------------
   63.20  	// For objects that are attachments
   63.21  	//--------------------------------------------------------------------
    64.1 --- a/indra/newview/llviewerpartsim.cpp	Wed Feb 14 22:17:38 2018 +0100
    64.2 +++ b/indra/newview/llviewerpartsim.cpp	Fri Mar 02 12:06:56 2018 +0100
    64.3 @@ -37,6 +37,7 @@
    64.4  #include "llviewerregion.h"
    64.5  #include "llvopartgroup.h"
    64.6  #include "llworld.h"
    64.7 +#include "llmutelist.h"
    64.8  #include "pipeline.h"
    64.9  #include "llspatialpartition.h"
   64.10  #include "llvoavatarself.h"
   64.11 @@ -714,6 +715,11 @@
   64.12  				upd = FALSE;
   64.13  			}
   64.14  
   64.15 +			if(vobj && vobj->isOwnerInMuteList(mViewerPartSources[i]->getOwnerUUID()))
   64.16 +			{
   64.17 +				upd = FALSE;
   64.18 +			}
   64.19 +
   64.20  			if (upd && vobj && (vobj->getPCode() == LL_PCODE_VOLUME))
   64.21  			{
   64.22  				if(vobj->getAvatar() && vobj->getAvatar()->isTooComplex())
    65.1 --- a/indra/newview/llviewerwindow.cpp	Wed Feb 14 22:17:38 2018 +0100
    65.2 +++ b/indra/newview/llviewerwindow.cpp	Fri Mar 02 12:06:56 2018 +0100
    65.3 @@ -1483,7 +1483,7 @@
    65.4  {
    65.5  	// Let the voice chat code check for its PTT key.  Note that this never affects event processing.
    65.6  	LLVoiceClient::getInstance()->keyDown(key, mask);
    65.7 -	
    65.8 +
    65.9  	if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
   65.10  	{
   65.11  		gAgent.clearAFK();
   65.12 @@ -2118,7 +2118,11 @@
   65.13  	// (But wait to add it as a child of the root view so that it will be in front of the 
   65.14  	// other views.)
   65.15  	MainPanel* main_view = new MainPanel();
   65.16 -	main_view->buildFromFile("main_view.xml");
   65.17 +	if (!main_view->buildFromFile("main_view.xml"))
   65.18 +	{
   65.19 +		LL_ERRS() << "Failed to initialize viewer: Viewer couldn't process file main_view.xml, "
   65.20 +				<< "if this problem happens again, please validate your installation." << LL_ENDL;
   65.21 +	}
   65.22  	main_view->setShape(full_window);
   65.23  	getRootView()->addChild(main_view);
   65.24  
   65.25 @@ -2539,6 +2543,7 @@
   65.26  LLViewerWindow::~LLViewerWindow()
   65.27  {
   65.28  	LL_INFOS() << "Destroying Window" << LL_ENDL;
   65.29 +	gDebugWindowProc = TRUE; // event catching, at this point it shouldn't output at all
   65.30  	destroyWindow();
   65.31  
   65.32  	delete mDebugText;
   65.33 @@ -5531,7 +5536,7 @@
   65.34  // <FS:Ansariel> Threaded filepickers
   65.35  void do_save_image(LLImageFormatted* image, const std::string& snapshot_dir, const std::string& base_name, const std::string& extension, boost::function<void(bool)> callback)
   65.36  {
   65.37 -	if (snapshot_dir.empty())
   65.38 +	if (snapshot_dir.empty() || !LLFile::isdir(snapshot_dir))
   65.39  	{
   65.40  		if (callback)
   65.41  		{
   65.42 @@ -5708,13 +5713,14 @@
   65.43  	//	err = LLFile::stat( filepath, &stat_info );
   65.44  	//	i++;
   65.45  	//}
   65.46 -	//while( -1 != err );  // search until the file is not found (i.e., stat() gives an error).
   65.47 +	//while( -1 != err  // Search until the file is not found (i.e., stat() gives an error).
   65.48 +	//		&& is_snapshot_name_loc_set); // Or stop if we are rewriting.
   65.49  
   65.50  	//LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL;
   65.51  	//return image->save(filepath);
   65.52  
   65.53  	// Get a base file location if needed.
   65.54 -	if (force_picker || !isSnapshotLocSet())
   65.55 +	if (force_picker || !isSnapshotLocSet() || !LLFile::isdir(sSnapshotDir))
   65.56  	{
   65.57  		std::string proposed_name( sSnapshotBaseName );
   65.58  
    66.1 --- a/indra/newview/llworldmapview.cpp	Wed Feb 14 22:17:38 2018 +0100
    66.2 +++ b/indra/newview/llworldmapview.cpp	Fri Mar 02 12:06:56 2018 +0100
    66.3 @@ -1926,11 +1926,10 @@
    66.4  		case MAP_ITEM_LAND_FOR_SALE:
    66.5  		case MAP_ITEM_LAND_FOR_SALE_ADULT:
    66.6  			{
    66.7 +				LLVector3d pos_global = viewPosToGlobal(x, y);
    66.8 +				LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global);
    66.9  				LLFloaterReg::hideInstance("world_map");
   66.10 -				// <FS:Ansariel> FIRE-6904: Double Clicking Land Sales Price Tags in WorldMap causes Search Error
   66.11 -				//LLFloaterReg::showInstance("search", LLSD().with("category", "destinations").with("query", id));
   66.12 -				LLUrlAction::executeSLURL(LLSLURL("parcel", id, "about").getSLURLString());
   66.13 -				// </FS:Ansariel>
   66.14 +				LLFloaterReg::showInstance("search", LLSD().with("category", "land").with("query", info->getName()));
   66.15  				break;
   66.16  			}
   66.17  		case MAP_ITEM_CLASSIFIED:
    67.1 --- a/indra/newview/particleeditor.cpp	Wed Feb 14 22:17:38 2018 +0100
    67.2 +++ b/indra/newview/particleeditor.cpp	Fri Mar 02 12:06:56 2018 +0100
    67.3 @@ -622,15 +622,15 @@
    67.4  	}
    67.5  }
    67.6  
    67.7 -void ParticleEditor::scriptInjectReturned( )
    67.8 +void ParticleEditor::scriptInjectReturned()
    67.9  {
   67.10  	setCanClose(TRUE);
   67.11  
   67.12  	// play it safe, because some time may have passed
   67.13  	LLViewerObject* object = gObjectList.findObject(mObject->getID());
   67.14 -	if (!object)
   67.15 +	if (!object || mObject->isDead())
   67.16  	{
   67.17 -		LL_DEBUGS() << "object went away!" << LL_ENDL;
   67.18 +		LL_WARNS() << "Can't inject script - object is dead or went away!" << LL_ENDL;
   67.19  		mMainPanel->setEnabled(TRUE);
   67.20  		return;
   67.21  	}
    68.1 --- a/indra/newview/skins/default/xui/de/notifications.xml	Wed Feb 14 22:17:38 2018 +0100
    68.2 +++ b/indra/newview/skins/default/xui/de/notifications.xml	Fri Mar 02 12:06:56 2018 +0100
    68.3 @@ -4837,17 +4837,21 @@
    68.4      </form>
    68.5    </notification>
    68.6  
    68.7 -  <!-- Firestorm Phantom -->
    68.8 -
    68.9 -  <notification name="PhantomOn">
   68.10 -Phantom-Modus eingeschaltet.
   68.11 -  </notification>
   68.12 -
   68.13 -  <notification name="PhantomOff">
   68.14 -Phantom-Modus ausgeschaltet.
   68.15 -  </notification>
   68.16 -
   68.17 -<!-- Firestorm Phantom -->
   68.18 +	<notification name="PhantomOn">
   68.19 +		Phantom-Modus eingeschaltet.
   68.20 +	</notification>
   68.21 +	<notification name="PhantomOff">
   68.22 +		Phantom-Modus ausgeschaltet.
   68.23 +	</notification>
   68.24 +	<notification label="Alle Einstellungen zurücksetzen" name="FirestormClearSettingsPrompt">
   68.25 +		Ein Zurücksetzen aller Einstellungen kann bei Problemen hilfreich sein, allerdings müssen Sie anschließend jegliche Anpassungen erneut vornehmen.
   68.26 +
   68.27 +Sind Sie sicher, dass Sie alle Einstellungen zurücksetzen möchten?
   68.28 +		<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
   68.29 +	</notification>
   68.30 +	<notification name="SettingsWillClear">
   68.31 +		Einstellungen werden nach einem Neustart von [APP_NAME] zurückgesetzt.
   68.32 +	</notification>
   68.33  
   68.34    <!-- ## Zi: Particle Editor -->
   68.35    <notification name="ParticleScriptFindFolderFailed">
    69.1 --- a/indra/newview/skins/default/xui/en/notifications.xml	Wed Feb 14 22:17:38 2018 +0100
    69.2 +++ b/indra/newview/skins/default/xui/en/notifications.xml	Fri Mar 02 12:06:56 2018 +0100
    69.3 @@ -9214,10 +9214,15 @@
    69.4     icon="alertmodal.tga"
    69.5     name="NoVoiceConnect-GIAB"
    69.6     type="alertmodal">
    69.7 -We're having trouble connecting to your voice server.
    69.8 -
    69.9 -Voice communications will not be available.
   69.10 +We are unable to connect to the voice server.
   69.11 +
   69.12 +Ports that must be allowed for voice are:
   69.13 +:TCP: 80, 443
   69.14 +:UDP: 3478, 3479, 5060, 5062, 6250, 12000-32000
   69.15 +
   69.16  Please check your network and firewall setup.
   69.17 +Disable any SIP ALG feature in your router.
   69.18 +
   69.19  [http://wiki.phoenixviewer.com/fs_voice More troubleshooting tips can be found here]
   69.20      <tag>voice</tag>
   69.21    <tag>fail</tag>
    70.1 --- a/indra/newview/skins/default/xui/en/panel_notification.xml	Wed Feb 14 22:17:38 2018 +0100
    70.2 +++ b/indra/newview/skins/default/xui/en/panel_notification.xml	Fri Mar 02 12:06:56 2018 +0100
    70.3 @@ -71,7 +71,6 @@
    70.4        mouse_opaque="false"
    70.5        name="text_editor_box"
    70.6        read_only="true"
    70.7 -      tab_stop="false"
    70.8        text_color="White"
    70.9        text_readonly_color="White"
   70.10        top="10"
    71.1 --- a/indra/newview/skins/default/xui/pl/notifications.xml	Wed Feb 14 22:17:38 2018 +0100
    71.2 +++ b/indra/newview/skins/default/xui/pl/notifications.xml	Fri Mar 02 12:06:56 2018 +0100
    71.3 @@ -3422,20 +3422,30 @@
    71.4  Proszę sprawdź swoją sieć i ustawienia firewall.
    71.5  	</notification>
    71.6  	<notification name="NoVoiceConnect">
    71.7 -		Występuje problem z Twoim połączeniem głosowym:
    71.8 +		Nie możemy połączyć się z serwerem głosowym:
    71.9  
   71.10  &lt;nolink&gt;[HOSTID]&lt;/nolink&gt;
   71.11  
   71.12 -Komunikacja głosowa nie będzie dostępna.
   71.13 +Porty, które muszą być otwarte dla połączeń głosowych, to:
   71.14 +:TCP: 80, 443
   71.15 +:UDP: 3478, 3479, 5060, 5062, 6250, 12000-32000
   71.16 +
   71.17  Proszę sprawdź swoją sieć i ustawienia firewall.
   71.18 +Wyłącz wszelkie funkcjonalności SIP ALG (Application Layer Gateway) w swoim routerze.
   71.19 +
   71.20  [http://wiki.phoenixviewer.com/fs_voice Więcej wskazówek można znaleźć tutaj]
   71.21  		<usetemplate name="okignore" ignoretext="Ostrzegaj mnie, gdy przeglądarka nie może połączyć się z serwerem głosu" />
   71.22  	</notification>
   71.23  	<notification name="NoVoiceConnect-GIAB">
   71.24 -		Występuje problem z Twoim połączeniem głosowym.
   71.25 +		Nie możemy połączyć się z serwerem głosowym.
   71.26  
   71.27 -Komunikacja głosowa nie będzie dostępna.
   71.28 +Porty, które muszą być otwarte dla połączeń głosowych, to:
   71.29 +:TCP: 80, 443
   71.30 +:UDP: 3478, 3479, 5060, 5062, 6250, 12000-32000
   71.31 +
   71.32  Proszę sprawdź swoją sieć i ustawienia firewall.
   71.33 +Wyłącz wszelkie funkcjonalności SIP ALG (Application Layer Gateway) w swoim routerze.
   71.34 +
   71.35  [http://wiki.phoenixviewer.com/fs_voice Więcej wskazówek można znaleźć tutaj]
   71.36  	</notification>
   71.37  	<notification name="AvatarRezLeftNotification">

mercurial