This commit is contained in:
Shyotl
2015-01-26 15:26:02 -06:00
163 changed files with 3529 additions and 3264 deletions

View File

@@ -8,6 +8,7 @@ if (STANDALONE)
include(FindPNG) include(FindPNG)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(libpng) use_prebuilt_binary(libpng)
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/)
if (WINDOWS) if (WINDOWS)
set(PNG_LIBRARIES libpng15) set(PNG_LIBRARIES libpng15)
elseif(DARWIN) elseif(DARWIN)
@@ -30,8 +31,7 @@ else (STANDALONE)
# #
set(PNG_PRELOAD_ARCHIVES -Wl,--whole-archive png16 -Wl,--no-whole-archive) set(PNG_PRELOAD_ARCHIVES -Wl,--whole-archive png16 -Wl,--no-whole-archive)
set(PNG_LIBRARIES png16) set(PNG_LIBRARIES png16)
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16) set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/libpng16)
endif () endif ()
endif() endif()
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -31,7 +31,6 @@ set(llcommon_SOURCE_FILES
llapr.cpp llapr.cpp
llaprpool.cpp llaprpool.cpp
llassettype.cpp llassettype.cpp
llavatarname.cpp
llbase32.cpp llbase32.cpp
llbase64.cpp llbase64.cpp
llcommon.cpp llcommon.cpp
@@ -56,7 +55,6 @@ set(llcommon_SOURCE_FILES
llfile.cpp llfile.cpp
llfindlocale.cpp llfindlocale.cpp
llfixedbuffer.cpp llfixedbuffer.cpp
llfoldertype.cpp
llformat.cpp llformat.cpp
llframetimer.cpp llframetimer.cpp
llheartbeat.cpp llheartbeat.cpp
@@ -135,7 +133,6 @@ set(llcommon_HEADER_FILES
llassoclist.h llassoclist.h
llatomic.h llatomic.h
llavatarconstants.h llavatarconstants.h
llavatarname.h
llbase32.h llbase32.h
llbase64.h llbase64.h
llboost.h llboost.h
@@ -177,7 +174,6 @@ set(llcommon_HEADER_FILES
llfile.h llfile.h
llfindlocale.h llfindlocale.h
llfixedbuffer.h llfixedbuffer.h
llfoldertype.h
llformat.h llformat.h
llframetimer.h llframetimer.h
llhandle.h llhandle.h

View File

@@ -1,115 +0,0 @@
/**
* @file llavatarname.cpp
* @brief Represents name-related data for an avatar, such as the
* username/SLID ("bobsmith123" or "james.linden") and the display
* name ("James Cook")
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llavatarname.h"
#include "lldate.h"
#include "llsd.h"
// Store these in pre-built std::strings to avoid memory allocations in
// LLSD map lookups
static const std::string USERNAME("username");
static const std::string DISPLAY_NAME("display_name");
static const std::string LEGACY_FIRST_NAME("legacy_first_name");
static const std::string LEGACY_LAST_NAME("legacy_last_name");
static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default");
static const std::string DISPLAY_NAME_EXPIRES("display_name_expires");
static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update");
LLAvatarName::LLAvatarName()
: mUsername(),
mDisplayName(),
mLegacyFirstName(),
mLegacyLastName(),
mIsDisplayNameDefault(false),
mIsTemporaryName(false),
mExpires(F64_MAX),
mNextUpdate(0.0)
{ }
bool LLAvatarName::operator<(const LLAvatarName& rhs) const
{
if (mUsername == rhs.mUsername)
return mDisplayName < rhs.mDisplayName;
else
return mUsername < rhs.mUsername;
}
LLSD LLAvatarName::asLLSD() const
{
LLSD sd;
sd[USERNAME] = mUsername;
sd[DISPLAY_NAME] = mDisplayName;
sd[LEGACY_FIRST_NAME] = mLegacyFirstName;
sd[LEGACY_LAST_NAME] = mLegacyLastName;
sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault;
sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires);
sd[DISPLAY_NAME_NEXT_UPDATE] = LLDate(mNextUpdate);
return sd;
}
void LLAvatarName::fromLLSD(const LLSD& sd)
{
mUsername = sd[USERNAME].asString();
mDisplayName = sd[DISPLAY_NAME].asString();
mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString();
mLegacyLastName = sd[LEGACY_LAST_NAME].asString();
mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean() || mUsername == mDisplayName;
LLDate expires = sd[DISPLAY_NAME_EXPIRES];
mExpires = expires.secondsSinceEpoch();
LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE];
mNextUpdate = next_update.secondsSinceEpoch();
}
std::string LLAvatarName::getCompleteName(bool linefeed) const
{
std::string name;
if (mUsername.empty() || mIsDisplayNameDefault)
// If the display name feature is off
// OR this particular display name is defaulted (i.e. based on user name),
// then display only the easier to read instance of the person's name.
{
name = mDisplayName;
}
else
{
name = mDisplayName + (linefeed ? "\n(" : " (") + mUsername + ")";
}
return name;
}
std::string LLAvatarName::getLegacyName() const
{
std::string name;
name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() );
name = mLegacyFirstName;
name += " ";
name += mLegacyLastName;
return name;
}

View File

@@ -65,7 +65,7 @@ LLEventTimer::~LLEventTimer()
void LLEventTimer::updateClass() void LLEventTimer::updateClass()
{ {
std::list<LLEventTimer*> completed_timers; std::list<LLEventTimer*> completed_timers;
for (instance_iter iter = beginInstances(); iter != endInstances(); ) for (instance_iter iter = beginInstances(), iter_end = endInstances(); iter != iter_end;)
{ {
LLEventTimer& timer = *iter++; LLEventTimer& timer = *iter++;
F32 et = timer.mEventTimer.getElapsedTimeF32(); F32 et = timer.mEventTimer.getElapsedTimeF32();

View File

@@ -345,7 +345,7 @@ LLFastTimer::DeclareTimer::DeclareTimer(const std::string& name)
void LLFastTimer::updateCachedPointers() void LLFastTimer::updateCachedPointers()
{ {
// Update DeclareTimer::mFrameState pointers. // Update DeclareTimer::mFrameState pointers.
for (DeclareTimer::instance_iter it = DeclareTimer::beginInstances(); it != DeclareTimer::endInstances(); ++it) for (DeclareTimer::instance_iter it = DeclareTimer::beginInstances(), it_end = DeclareTimer::endInstances(); it != it_end; ++it)
{ {
// update cached pointer // update cached pointer
it->mFrameState = &it->mTimer.getFrameState(); it->mFrameState = &it->mTimer.getFrameState();
@@ -537,7 +537,7 @@ void LLFastTimer::NamedTimer::buildHierarchy()
// set up initial tree // set up initial tree
{ {
for (instance_iter it = beginInstances(); it != endInstances(); ++it) for (instance_iter it = beginInstances(), it_end = endInstances(); it != it_end; ++it)
{ {
NamedTimer& timer = *it; NamedTimer& timer = *it;
if (&timer == NamedTimerFactory::instance().getRootTimer()) continue; if (&timer == NamedTimerFactory::instance().getRootTimer()) continue;
@@ -677,7 +677,7 @@ void LLFastTimer::NamedTimer::resetFrame()
LLSD sd; LLSD sd;
{ {
for (instance_iter it = beginInstances(); it != endInstances(); ++it) for (instance_iter it = beginInstances(), it_end = endInstances(); it != it_end; ++it)
{ {
NamedTimer& timer = *it; NamedTimer& timer = *it;
FrameState& info = timer.getFrameState(); FrameState& info = timer.getFrameState();
@@ -721,7 +721,7 @@ void LLFastTimer::NamedTimer::resetFrame()
// reset for next frame // reset for next frame
{ {
for (instance_iter it = beginInstances(); it != endInstances(); ++it) for (instance_iter it = beginInstances(), it_end = endInstances(); it != it_end; ++it)
{ {
NamedTimer& timer = *it; NamedTimer& timer = *it;
@@ -765,7 +765,7 @@ void LLFastTimer::NamedTimer::reset()
// reset all history // reset all history
{ {
for (instance_iter it = beginInstances(); it != endInstances(); ++it) for (instance_iter it = beginInstances(), it_end = endInstances(); it != it_end; ++it)
{ {
NamedTimer& timer = *it; NamedTimer& timer = *it;
if (&timer != NamedTimerFactory::instance().getRootTimer()) if (&timer != NamedTimerFactory::instance().getRootTimer())

View File

@@ -133,8 +133,6 @@ void LLMemory::updateMemoryInfo()
sMaxPhysicalMemInKB = U32_MAX ; sMaxPhysicalMemInKB = U32_MAX ;
sAvailPhysicalMemInKB = U32_MAX ; sAvailPhysicalMemInKB = U32_MAX ;
#endif #endif
return ;
} }
// //

View File

@@ -67,7 +67,7 @@ BOOL LLImagePNG::updateData()
} }
LLPngWrapper::ImageInfo infop; LLPngWrapper::ImageInfo infop;
if (! pngWrapper.readPng(getData(), NULL, &infop)) if (! pngWrapper.readPng(getData(), getDataSize(), NULL, &infop))
{ {
setLastError(pngWrapper.getErrorMessage()); setLastError(pngWrapper.getErrorMessage());
return FALSE; return FALSE;
@@ -102,7 +102,7 @@ BOOL LLImagePNG::decode(LLImageRaw* raw_image, F32 decode_time)
return FALSE; return FALSE;
} }
if (! pngWrapper.readPng(getData(), raw_image)) if (! pngWrapper.readPng(getData(), getDataSize(), raw_image))
{ {
setLastError(pngWrapper.getErrorMessage()); setLastError(pngWrapper.getErrorMessage());
return FALSE; return FALSE;

View File

@@ -93,6 +93,12 @@ void LLPngWrapper::errorHandler(png_structp png_ptr, png_const_charp msg)
void LLPngWrapper::readDataCallback(png_structp png_ptr, png_bytep dest, png_size_t length) void LLPngWrapper::readDataCallback(png_structp png_ptr, png_bytep dest, png_size_t length)
{ {
PngDataInfo *dataInfo = (PngDataInfo *) png_get_io_ptr(png_ptr); PngDataInfo *dataInfo = (PngDataInfo *) png_get_io_ptr(png_ptr);
if (S32(dataInfo->mOffset + length) > dataInfo->mDataSize)
{
png_error(png_ptr, "Data read error. Requested data size exceeds available data size.");
return;
}
U8 *src = &dataInfo->mData[dataInfo->mOffset]; U8 *src = &dataInfo->mData[dataInfo->mOffset];
memcpy(dest, src, length); memcpy(dest, src, length);
dataInfo->mOffset += static_cast<U32>(length); dataInfo->mOffset += static_cast<U32>(length);
@@ -120,7 +126,7 @@ void LLPngWrapper::writeFlush(png_structp png_ptr)
// The scanline also begins at the bottom of // The scanline also begins at the bottom of
// the image (per SecondLife conventions) instead of at the top, so we // the image (per SecondLife conventions) instead of at the top, so we
// must assign row-pointers in "reverse" order. // must assign row-pointers in "reverse" order.
BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop) BOOL LLPngWrapper::readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop)
{ {
try try
{ {
@@ -139,6 +145,7 @@ BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop)
PngDataInfo dataPtr; PngDataInfo dataPtr;
dataPtr.mData = src; dataPtr.mData = src;
dataPtr.mOffset = 0; dataPtr.mOffset = 0;
dataPtr.mDataSize = dataSize;
png_set_read_fn(mReadPngPtr, &dataPtr, &readDataCallback); png_set_read_fn(mReadPngPtr, &dataPtr, &readDataCallback);
png_set_sig_bytes(mReadPngPtr, 0); png_set_sig_bytes(mReadPngPtr, 0);

View File

@@ -49,7 +49,7 @@ public:
}; };
BOOL isValidPng(U8* src); BOOL isValidPng(U8* src);
BOOL readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop = NULL); BOOL readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop = NULL);
BOOL writePng(const LLImageRaw* rawImage, U8* dst); BOOL writePng(const LLImageRaw* rawImage, U8* dst);
U32 getFinalSize(); U32 getFinalSize();
const std::string& getErrorMessage(); const std::string& getErrorMessage();
@@ -66,6 +66,7 @@ private:
{ {
U8 *mData; U8 *mData;
U32 mOffset; U32 mOffset;
S32 mDataSize;
}; };
static void writeFlush(png_structp png_ptr); static void writeFlush(png_structp png_ptr);

View File

@@ -18,6 +18,7 @@ include_directories(
set(llinventory_SOURCE_FILES set(llinventory_SOURCE_FILES
llcategory.cpp llcategory.cpp
lleconomy.cpp lleconomy.cpp
llfoldertype.cpp
llinventory.cpp llinventory.cpp
llinventorydefines.cpp llinventorydefines.cpp
llinventorytype.cpp llinventorytype.cpp
@@ -35,6 +36,7 @@ set(llinventory_HEADER_FILES
llcategory.h llcategory.h
lleconomy.h lleconomy.h
llfoldertype.h
llinventory.h llinventory.h
llinventorydefines.h llinventorydefines.h
llinventorytype.h llinventorytype.h

View File

@@ -39,7 +39,7 @@
// This class handles folder types (similar to assettype, except for folders) // This class handles folder types (similar to assettype, except for folders)
// and operations on those. // and operations on those.
class LL_COMMON_API LLFolderType class LLFolderType
{ {
public: public:
// ! BACKWARDS COMPATIBILITY ! Folder type enums must match asset type enums. // ! BACKWARDS COMPATIBILITY ! Folder type enums must match asset type enums.

View File

@@ -35,6 +35,7 @@ set(llmessage_SOURCE_FILES
llares.cpp llares.cpp
llareslistener.cpp llareslistener.cpp
llassetstorage.cpp llassetstorage.cpp
llavatarname.cpp
llavatarnamecache.cpp llavatarnamecache.cpp
llblowfishcipher.cpp llblowfishcipher.cpp
llbuffer.cpp llbuffer.cpp
@@ -125,6 +126,7 @@ set(llmessage_HEADER_FILES
llares.h llares.h
llareslistener.h llareslistener.h
llassetstorage.h llassetstorage.h
llavatarname.h
llavatarnamecache.h llavatarnamecache.h
llblowfishcipher.h llblowfishcipher.h
llbuffer.h llbuffer.h

View File

@@ -907,7 +907,6 @@ AIHTTPTimeoutPolicy const* AIHTTPTimeoutPolicy::getTimeoutPolicyByName(std::stri
// Policy name Policy // Policy name Policy
P(assetReportHandler); P(assetReportHandler);
P(authHandler); P(authHandler);
P(avatarNameResponder);
P2(baseCapabilitiesComplete, transfer_18s_connect_5s); P2(baseCapabilitiesComplete, transfer_18s_connect_5s);
P(blockingLLSDPost); P(blockingLLSDPost);
P(blockingLLSDGet); P(blockingLLSDGet);
@@ -926,8 +925,6 @@ P(fetchScriptLimitsRegionSummaryResponder);
P(fnPtrResponder); P(fnPtrResponder);
P(floaterPermsResponder); P(floaterPermsResponder);
P2(gamingDataReceived, transfer_22s_connect_10s); P2(gamingDataReceived, transfer_22s_connect_10s);
P(groupBanDataResponder);
P2(groupMemberDataResponder, transfer_300s);
P2(groupProposalBallotResponder, transfer_300s); P2(groupProposalBallotResponder, transfer_300s);
P(homeLocationResponder); P(homeLocationResponder);
P2(HTTPGetResponder, reply_15s); P2(HTTPGetResponder, reply_15s);
@@ -936,8 +933,6 @@ P(iamHereVoice);
P2(inventoryModelFetchDescendentsResponder, transfer_300s); P2(inventoryModelFetchDescendentsResponder, transfer_300s);
P(inventoryModelFetchItemResponder); P(inventoryModelFetchItemResponder);
P(lcl_responder); P(lcl_responder);
P(MPImportGetResponder);
P(MPImportPostResponder);
P(mapLayerResponder); P(mapLayerResponder);
P(materialsResponder); P(materialsResponder);
P2(maturityPreferences, transfer_30s_connect_10s); P2(maturityPreferences, transfer_30s_connect_10s);
@@ -957,21 +952,16 @@ P(regionResponder);
P(remoteParcelRequestResponder); P(remoteParcelRequestResponder);
P(requestAgentUpdateAppearance); P(requestAgentUpdateAppearance);
P(responderIgnore); P(responderIgnore);
P(sessionInviteResponder);
P(setDisplayNameResponder); P(setDisplayNameResponder);
P2(simulatorFeaturesReceived, transfer_22s_connect_10s); P2(simulatorFeaturesReceived, transfer_22s_connect_10s);
P(startConferenceChatResponder);
P2(startGroupVoteResponder, transfer_300s); P2(startGroupVoteResponder, transfer_300s);
P(translationReceiver); P(translationReceiver);
P(uploadModelPremissionsResponder); P(uploadModelPremissionsResponder);
P(userReportResponder);
P(verifiedDestinationResponder); P(verifiedDestinationResponder);
P(viewerChatterBoxInvitationAcceptResponder); P(viewerChatterBoxInvitationAcceptResponder);
P(viewerMediaOpenIDResponder); P(viewerMediaOpenIDResponder);
P(viewerMediaWebProfileResponder); P(viewerMediaWebProfileResponder);
P(viewerStatsResponder); P(viewerStatsResponder);
P(vivoxVoiceAccountProvisionResponder);
P(vivoxVoiceClientCapResponder);
P(voiceCallCapResponder); P(voiceCallCapResponder);
P(webProfileResponders); P(webProfileResponders);
P(wholeModelFeeResponder); P(wholeModelFeeResponder);

View File

@@ -0,0 +1,254 @@
/**
* @file llavatarname.cpp
* @brief Represents name-related data for an avatar, such as the
* username/SLID ("bobsmith123" or "james.linden") and the display
* name ("James Cook")
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llavatarname.h"
#include "llcontrol.h" // For LLCachedControl
#include "lldate.h"
#include "llframetimer.h"
#include "llsd.h"
// Store these in pre-built std::strings to avoid memory allocations in
// LLSD map lookups
static const std::string USERNAME("username");
static const std::string DISPLAY_NAME("display_name");
static const std::string LEGACY_FIRST_NAME("legacy_first_name");
static const std::string LEGACY_LAST_NAME("legacy_last_name");
static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default");
static const std::string DISPLAY_NAME_EXPIRES("display_name_expires");
static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update");
bool LLAvatarName::sUseDisplayNames = true;
bool LLAvatarName::sUseUsernames = true;
// Minimum time-to-live (in seconds) for a name entry.
// Avatar name should always guarantee to expire reasonably soon by default
// so if the failure to get a valid expiration time was due to something temporary
// we will eventually request and get the right data.
const F64 MIN_ENTRY_LIFETIME = 60.0;
LLAvatarName::LLAvatarName()
: mUsername(),
mDisplayName(),
mLegacyFirstName(),
mLegacyLastName(),
mIsDisplayNameDefault(false),
mIsTemporaryName(false),
mExpires(F64_MAX),
mNextUpdate(0.0)
{ }
bool LLAvatarName::operator<(const LLAvatarName& rhs) const
{
if (mUsername == rhs.mUsername)
return mDisplayName < rhs.mDisplayName;
else
return mUsername < rhs.mUsername;
}
//static
void LLAvatarName::setUseDisplayNames(bool use)
{
sUseDisplayNames = use;
}
//static
bool LLAvatarName::useDisplayNames()
{
return sUseDisplayNames;
}
void LLAvatarName::setUseUsernames(bool use)
{
sUseUsernames = use;
}
bool LLAvatarName::useUsernames()
{
return sUseUsernames;
}
LLSD LLAvatarName::asLLSD() const
{
LLSD sd;
sd[USERNAME] = mUsername;
sd[DISPLAY_NAME] = mDisplayName;
sd[LEGACY_FIRST_NAME] = mLegacyFirstName;
sd[LEGACY_LAST_NAME] = mLegacyLastName;
sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault;
sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires);
sd[DISPLAY_NAME_NEXT_UPDATE] = LLDate(mNextUpdate);
return sd;
}
void LLAvatarName::fromLLSD(const LLSD& sd)
{
mUsername = sd[USERNAME].asString();
mDisplayName = sd[DISPLAY_NAME].asString();
mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString();
mLegacyLastName = sd[LEGACY_LAST_NAME].asString();
mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean() || mUsername == mDisplayName;
LLDate expires = sd[DISPLAY_NAME_EXPIRES];
mExpires = expires.secondsSinceEpoch();
LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE];
mNextUpdate = next_update.secondsSinceEpoch();
// Some avatars don't have explicit display names set. Force a legible display name here.
if (mDisplayName.empty())
{
mDisplayName = mUsername;
mIsDisplayNameDefault = true;
}
}
// Transform a string (typically provided by the legacy service) into a decent
// avatar name instance.
void LLAvatarName::fromString(const std::string& full_name)
{
mDisplayName = full_name;
std::string::size_type index = full_name.find(' ');
if (index != std::string::npos)
{
// The name is in 2 parts (first last)
mLegacyFirstName = full_name.substr(0, index);
mLegacyLastName = full_name.substr(index+1);
if (mLegacyLastName != "Resident")
{
mUsername = mLegacyFirstName + "." + mLegacyLastName;
mDisplayName = full_name;
LLStringUtil::toLower(mUsername);
}
else
{
// Very old names do have a dummy "Resident" last name
// that we choose to hide from users.
mUsername = mLegacyFirstName;
mDisplayName = mLegacyFirstName;
}
}
else
{
mLegacyFirstName = full_name;
mLegacyLastName = "";
mUsername = full_name;
mDisplayName = full_name;
}
mIsDisplayNameDefault = true;
mIsTemporaryName = true;
setExpires(MIN_ENTRY_LIFETIME);
}
void LLAvatarName::setExpires(F64 expires)
{
mExpires = LLFrameTimer::getTotalSeconds() + expires;
}
std::string LLAvatarName::getCompleteName(bool linefeed) const
{
std::string name;
if (sUseDisplayNames)
{
if (mUsername.empty() || mIsDisplayNameDefault)
{
// If this particular display name is defaulted (i.e. based on user name),
// then display only the easier to read instance of the person's name.
name = mDisplayName;
}
else
{
name = mDisplayName;
if (sUseUsernames)
{
name += (linefeed ? "\n(" : " (") + mUsername + ")";
}
}
}
else
{
name = getUserName();
}
return name;
}
std::string LLAvatarName::getLegacyName() const
{
if (mLegacyFirstName.empty() && mLegacyLastName.empty()) // display names disabled?
{
return mDisplayName;
}
static const LLCachedControl<bool> show_resident("LiruShowLastNameResident", false);
if (show_resident || mLegacyLastName != "Resident")
return mLegacyFirstName + ' ' + mLegacyLastName;
return mLegacyFirstName;
}
std::string LLAvatarName::getDisplayName() const
{
if (sUseDisplayNames)
{
return mDisplayName;
}
else
{
return getUserName();
}
}
std::string LLAvatarName::getUserName() const
{
std::string name;
if (mLegacyLastName.empty() /*|| (mLegacyLastName == "Resident")*/) // <alchemy/>
{
if (mLegacyFirstName.empty())
{
// If we cannot create a user name from the legacy strings, use the display name
name = mDisplayName;
}
else
{
// The last name might be empty if it defaulted to "Resident"
name = mLegacyFirstName;
}
}
else
{
name = mLegacyFirstName + " " + mLegacyLastName;
}
return name;
}
void LLAvatarName::dump() const
{
LL_DEBUGS("AvNameCache") << "LLAvatarName: "
<< "user '" << mUsername << "' "
<< "display '" << mDisplayName << "' "
<< "expires in " << mExpires - LLFrameTimer::getTotalSeconds() << " seconds"
<< LL_ENDL;
}

View File

@@ -30,19 +30,41 @@
#include <string> #include <string>
const S32& main_name_system();
class LLSD; class LLSD;
class LL_COMMON_API LLAvatarName class LLAvatarName
{ {
public: public:
LLAvatarName(); LLAvatarName();
bool operator<(const LLAvatarName& rhs) const; bool operator<(const LLAvatarName& rhs) const;
// Conversion to and from LLSD (cache file or server response)
LLSD asLLSD() const; LLSD asLLSD() const;
void fromLLSD(const LLSD& sd); void fromLLSD(const LLSD& sd);
// Used only in legacy mode when the display name capability is not provided server side
// or to otherwise create a temporary valid item.
void fromString(const std::string& full_name);
// Set the name object to become invalid in "expires" seconds from now
void setExpires(F64 expires);
// Set and get the display name flag set by the user in preferences.
static void setUseDisplayNames(bool use);
static bool useDisplayNames();
static void setUseUsernames(bool use);
static bool useUsernames();
// A name object is valid if not temporary and not yet expired (default is expiration not checked)
bool isValidName(F64 max_unrefreshed = 0.0f) const { return !mIsTemporaryName && (mExpires >= max_unrefreshed); }
// Return true if the name is made up from legacy or temporary data
bool isDisplayNameDefault() const { return mIsDisplayNameDefault; }
// For normal names, returns "James Linden (james.linden)" // For normal names, returns "James Linden (james.linden)"
// When display names are disabled returns just "James Linden" // When display names are disabled returns just "James Linden"
std::string getCompleteName(bool linefeed = false) const; std::string getCompleteName(bool linefeed = false) const;
@@ -52,10 +74,49 @@ public:
// *TODO: Eliminate this in favor of username only // *TODO: Eliminate this in favor of username only
std::string getLegacyName() const; std::string getLegacyName() const;
// "José Sanchez" or "James Linden", UTF-8 encoded Unicode
// Takes the display name preference into account. This is truly the name that should
// be used for all UI where an avatar name has to be used unless we truly want something else (rare)
std::string getDisplayName() const;
// Returns "James Linden" or "bobsmith123 Resident"
// Used where we explicitely prefer or need a non UTF-8 legacy (ASCII) name
// Also used for backwards compatibility with systems like voice and muting
std::string getUserName() const;
// Returns "james.linden" or the legacy name for very old names
std::string getAccountName() const { return mUsername; }
// Returns name in the format desired according to name_system
std::string getNSName(const S32& name_system = main_name_system()) const
{
switch (name_system)
{
case 1 : return getCompleteName();
case 2 : return getDisplayName();
case 3 : return getLegacyName() + (mIsDisplayNameDefault ? "" : " (" + mDisplayName + ")"); break;
default : return getLegacyName();
}
}
// Debug print of the object
void dump() const;
// Names can change, so need to keep track of when name was
// last checked.
// Unix time-from-epoch seconds for efficiency
F64 mExpires;
// You can only change your name every N hours, so record
// when the next update is allowed
// Unix time-from-epoch seconds
F64 mNextUpdate;
private:
// "bobsmith123" or "james.linden", US-ASCII only // "bobsmith123" or "james.linden", US-ASCII only
std::string mUsername; std::string mUsername;
// "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode // "José Sanchez" or "James Linden", UTF-8 encoded Unicode
// Contains data whether or not user has explicitly set // Contains data whether or not user has explicitly set
// a display name; may duplicate their username. // a display name; may duplicate their username.
std::string mDisplayName; std::string mDisplayName;
@@ -81,15 +142,12 @@ public:
// shown in UI, but are not serialized. // shown in UI, but are not serialized.
bool mIsTemporaryName; bool mIsTemporaryName;
// Names can change, so need to keep track of when name was // Global flag indicating if display name should be used or not
// last checked. // This will affect the output of the high level "get" methods
// Unix time-from-epoch seconds for efficiency static bool sUseDisplayNames;
F64 mExpires;
// Flag indicating if username should be shown after display name or not
// You can only change your name every N hours, so record static bool sUseUsernames;
// when the next update is allowed
// Unix time-from-epoch seconds
F64 mNextUpdate;
}; };
#endif #endif

View File

@@ -44,10 +44,6 @@ namespace LLAvatarNameCache
{ {
use_display_name_signal_t mUseDisplayNamesSignal; use_display_name_signal_t mUseDisplayNamesSignal;
// Manual override for display names - can disable even if the region
// supports it.
bool sUseDisplayNames = true;
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c // [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c
// RLVa override for display names // RLVa override for display names
bool sForceDisplayNames = false; bool sForceDisplayNames = false;
@@ -57,18 +53,22 @@ namespace LLAvatarNameCache
// current region supports display names. // current region supports display names.
bool sRunning = false; bool sRunning = false;
// Use the People API (modern) for fetching name if true. Use the old legacy protocol if false.
// For testing, there's a UsePeopleAPI setting that can be flipped (must restart viewer).
bool sUsePeopleAPI = true;
// Base lookup URL for name service. // Base lookup URL for name service.
// On simulator, loaded from indra.xml // On simulator, loaded from indra.xml
// On viewer, usually a simulator capability (at People API team's request) // On viewer, usually a simulator capability (at People API team's request)
// Includes the trailing slash, like "http://pdp60.lindenlab.com:8000/agents/" // Includes the trailing slash, like "http://pdp60.lindenlab.com:8000/agents/"
std::string sNameLookupURL; std::string sNameLookupURL;
// accumulated agent IDs for next query against service // Accumulated agent IDs for next query against service
typedef std::set<LLUUID> ask_queue_t; typedef std::set<LLUUID> ask_queue_t;
ask_queue_t sAskQueue; ask_queue_t sAskQueue;
// agent IDs that have been requested, but with no reply // Agent IDs that have been requested, but with no reply.
// maps agent ID to frame time request was made // Maps agent ID to frame time request was made.
typedef std::map<LLUUID, F64> pending_queue_t; typedef std::map<LLUUID, F64> pending_queue_t;
pending_queue_t sPendingQueue; pending_queue_t sPendingQueue;
@@ -79,21 +79,21 @@ namespace LLAvatarNameCache
typedef std::map<LLUUID, callback_signal_t*> signal_map_t; typedef std::map<LLUUID, callback_signal_t*> signal_map_t;
signal_map_t sSignalMap; signal_map_t sSignalMap;
// names we know about // The cache at last, i.e. avatar names we know about.
typedef std::map<LLUUID, LLAvatarName> cache_t; typedef std::map<LLUUID, LLAvatarName> cache_t;
cache_t sCache; cache_t sCache;
// Send bulk lookup requests a few times a second at most // Send bulk lookup requests a few times a second at most.
// only need per-frame timing resolution // Only need per-frame timing resolution.
LLFrameTimer sRequestTimer; LLFrameTimer sRequestTimer;
/// Maximum time an unrefreshed cache entry is allowed // Maximum time an unrefreshed cache entry is allowed.
const F64 MAX_UNREFRESHED_TIME = 20.0 * 60.0; const F64 MAX_UNREFRESHED_TIME = 20.0 * 60.0;
/// Time when unrefreshed cached names were checked last // Time when unrefreshed cached names were checked last.
static F64 sLastExpireCheck; static F64 sLastExpireCheck;
/// Time-to-live for a temp cache entry. // Time-to-live for a temp cache entry.
const F64 TEMP_CACHE_ENTRY_LIFETIME = 60.0; const F64 TEMP_CACHE_ENTRY_LIFETIME = 60.0;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
@@ -101,26 +101,21 @@ namespace LLAvatarNameCache
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Handle name response off network. // Handle name response off network.
// Optionally skip adding to cache, used when this is a fallback to the
// legacy name system.
void processName(const LLUUID& agent_id, void processName(const LLUUID& agent_id,
const LLAvatarName& av_name, const LLAvatarName& av_name);
bool add_to_cache);
void requestNamesViaCapability(); void requestNamesViaCapability();
// Legacy name system callback // Legacy name system callbacks
void legacyNameCallback(const LLUUID& agent_id, void legacyNameCallback(const LLUUID& agent_id,
const std::string& full_name, const std::string& full_name,
bool is_group bool is_group);
); void legacyNameFetch(const LLUUID& agent_id,
const std::string& full_name,
bool is_group);
void requestNamesViaLegacy(); void requestNamesViaLegacy();
// Fill in an LLAvatarName with the legacy name data
void buildLegacyName(const std::string& full_name,
LLAvatarName* av_name);
// Do a single callback to a given slot // Do a single callback to a given slot
void fireSignal(const LLUUID& agent_id, void fireSignal(const LLUUID& agent_id,
const callback_slot_t& slot, const callback_slot_t& slot,
@@ -174,31 +169,37 @@ namespace LLAvatarNameCache
</llsd> </llsd>
*/ */
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy avatarNameResponder_timeout;
class LLAvatarNameResponder : public LLHTTPClient::ResponderWithResult class LLAvatarNameResponder : public LLHTTPClient::ResponderWithResult
{ {
LOG_CLASS(LLAvatarNameResponder);
private: private:
// need to store agent ids that are part of this request in case of // need to store agent ids that are part of this request in case of
// an error, so we can flag them as unavailable // an error, so we can flag them as unavailable
std::vector<LLUUID> mAgentIDs; std::vector<LLUUID> mAgentIDs;
// Need the headers to look up Expires: and Retry-After: // Need the headers to look up Expires: and Retry-After:
virtual bool needsHeaders(void) const { return true; } /*virtual*/ bool needsHeaders() const { return true; }
/*virtual*/ char const* getName() const { return "LLAvatarNameResponder"; }
public: public:
LLAvatarNameResponder(const std::vector<LLUUID>& agent_ids) LLAvatarNameResponder(const std::vector<LLUUID>& agent_ids)
: mAgentIDs(agent_ids) : mAgentIDs(agent_ids)
{ } { }
/*virtual*/ void httpSuccess(void) protected:
/*virtual*/ void httpSuccess()
{ {
const LLSD& content = getContent();
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
// Pull expiration out of headers if available // Pull expiration out of headers if available
F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(mReceivedHeaders); F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(getResponseHeaders());
F64 now = LLFrameTimer::getTotalSeconds(); F64 now = LLFrameTimer::getTotalSeconds();
LLSD agents = mContent["agents"]; const LLSD& agents = content["agents"];
LLSD::array_const_iterator it = agents.beginArray(); LLSD::array_const_iterator it = agents.beginArray();
for ( ; it != agents.endArray(); ++it) for ( ; it != agents.endArray(); ++it)
{ {
@@ -211,24 +212,15 @@ public:
// Use expiration time from header // Use expiration time from header
av_name.mExpires = expires; av_name.mExpires = expires;
// Some avatars don't have explicit display names set LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result for " << agent_id << LL_ENDL;
if (av_name.mDisplayName.empty()) av_name.dump();
{
av_name.mDisplayName = av_name.mUsername;
}
LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result for " << agent_id << " "
<< "user '" << av_name.mUsername << "' "
<< "display '" << av_name.mDisplayName << "' "
<< "expires in " << expires - now << " seconds"
<< LL_ENDL;
// cache it and fire signals // cache it and fire signals
LLAvatarNameCache::processName(agent_id, av_name, true); LLAvatarNameCache::processName(agent_id, av_name);
} }
// Same logic as error response case // Same logic as error response case
LLSD unresolved_agents = mContent["bad_ids"]; const LLSD& unresolved_agents = content["bad_ids"];
S32 num_unresolved = unresolved_agents.size(); S32 num_unresolved = unresolved_agents.size();
if (num_unresolved > 0) if (num_unresolved > 0)
{ {
@@ -252,14 +244,13 @@ public:
<< LL_ENDL; << LL_ENDL;
} }
/*virtual*/ void httpFailure(void) /*virtual*/ void httpFailure()
{ {
// If there's an error, it might be caused by PeopleApi, // If there's an error, it might be caused by PeopleApi,
// or when loading textures on startup and using a very slow // or when loading textures on startup and using a very slow
// network, this query may time out. // network, this query may time out.
// What we should do depends on whether or not we have a cached name // What we should do depends on whether or not we have a cached name
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::httpFailure " << mStatus << " " << mReason LL_WARNS("AvNameCache") << dumpResponse() << LL_ENDL;
<< LL_ENDL;
// Add dummy records for any agent IDs in this request that we do not have cached already // Add dummy records for any agent IDs in this request that we do not have cached already
std::vector<LLUUID>::const_iterator it = mAgentIDs.begin(); std::vector<LLUUID>::const_iterator it = mAgentIDs.begin();
@@ -269,9 +260,6 @@ public:
LLAvatarNameCache::handleAgentError(agent_id); LLAvatarNameCache::handleAgentError(agent_id);
} }
} }
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return avatarNameResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLAvatarNameResponder"; }
}; };
// Provide some fallback for agents that return errors // Provide some fallback for agents that return errors
@@ -284,48 +272,34 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id)
LL_WARNS("AvNameCache") << "LLAvatarNameCache get legacy for agent " LL_WARNS("AvNameCache") << "LLAvatarNameCache get legacy for agent "
<< agent_id << LL_ENDL; << agent_id << LL_ENDL;
gCacheName->get(agent_id, false, // legacy compatibility gCacheName->get(agent_id, false, // legacy compatibility
boost::bind(&LLAvatarNameCache::legacyNameCallback, boost::bind(&LLAvatarNameCache::legacyNameFetch, _1, _2, _3));
_1, _2, _3));
} }
else else
{ {
// we have a chached (but probably expired) entry - since that would have // we have a cached (but probably expired) entry - since that would have
// been returned by the get method, there is no need to signal anyone // been returned by the get method, there is no need to signal anyone
// Clear this agent from the pending list // Clear this agent from the pending list
LLAvatarNameCache::sPendingQueue.erase(agent_id); LLAvatarNameCache::sPendingQueue.erase(agent_id);
LLAvatarName& av_name = existing->second; LLAvatarName& av_name = existing->second;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent " LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent " << agent_id << LL_ENDL;
<< agent_id av_name.dump();
<< "user '" << av_name.mUsername << "' "
<< "display '" << av_name.mDisplayName << "' " // Reset expiry time so we don't constantly rerequest.
<< "expires in " << av_name.mExpires - LLFrameTimer::getTotalSeconds() << " seconds" av_name.setExpires(TEMP_CACHE_ENTRY_LIFETIME);
<< LL_ENDL;
av_name.mExpires = LLFrameTimer::getTotalSeconds() + TEMP_CACHE_ENTRY_LIFETIME; // reset expiry time so we don't constantly rerequest.
} }
} }
void LLAvatarNameCache::processName(const LLUUID& agent_id, void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName& av_name)
const LLAvatarName& av_name,
bool add_to_cache)
{ {
if (add_to_cache) // Add to the cache
{ sCache[agent_id] = av_name;
// sCache[agent_id] = av_name;
// [SL:KB] - Patch: Agent-DisplayNames | Checked: 2010-12-28 (Catznip-2.4.0h) | Added: Catznip-2.4.0h
// Don't replace existing entries with dummies
cache_t::iterator itName = (av_name.mIsTemporaryName) ? sCache.find(agent_id) : sCache.end();
if (sCache.end() != itName)
itName->second.mExpires = av_name.mExpires;
else
sCache[agent_id] = av_name;
// [/SL:KB]
}
// Suppress request from the queue
sPendingQueue.erase(agent_id); sPendingQueue.erase(agent_id);
// signal everyone waiting on this name // Signal everyone waiting on this name
signal_map_t::iterator sig_it = sSignalMap.find(agent_id); signal_map_t::iterator sig_it = sSignalMap.find(agent_id);
if (sig_it != sSignalMap.end()) if (sig_it != sSignalMap.end())
{ {
@@ -356,7 +330,6 @@ void LLAvatarNameCache::requestNamesViaCapability()
std::vector<LLUUID> agent_ids; std::vector<LLUUID> agent_ids;
agent_ids.reserve(128); agent_ids.reserve(128);
U32 id_total = sAskQueue.size();
U32 ids = 0; U32 ids = 0;
ask_queue_t::const_iterator it; ask_queue_t::const_iterator it;
while(!sAskQueue.empty()) while(!sAskQueue.empty())
@@ -393,7 +366,7 @@ void LLAvatarNameCache::requestNamesViaCapability()
if (!url.empty()) if (!url.empty())
{ {
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability requested " LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability requested "
<< ids << "/" << id_total << "ids " << ids << " ids"
<< LL_ENDL; << LL_ENDL;
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids)); LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));
} }
@@ -403,22 +376,33 @@ void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id,
const std::string& full_name, const std::string& full_name,
bool is_group) bool is_group)
{ {
// Construct a dummy record for this name. By convention, SLID is blank // Put the received data in the cache
// Never expires, but not written to disk, so lasts until end of session. legacyNameFetch(agent_id, full_name, is_group);
LLAvatarName av_name;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameCallback " // Retrieve the name and set it to never (or almost never...) expire: when we are using the legacy
// protocol, we do not get an expiration date for each name and there's no reason to ask the
// data again and again so we set the expiration time to the largest value admissible.
std::map<LLUUID,LLAvatarName>::iterator av_record = sCache.find(agent_id);
LLAvatarName& av_name = av_record->second;
av_name.setExpires(MAX_UNREFRESHED_TIME);
}
void LLAvatarNameCache::legacyNameFetch(const LLUUID& agent_id,
const std::string& full_name,
bool is_group)
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameFetch "
<< "agent " << agent_id << " " << "agent " << agent_id << " "
<< "full name '" << full_name << "'" << "full name '" << full_name << "'"
<< ( is_group ? " [group]" : "" ) << ( is_group ? " [group]" : "" )
<< LL_ENDL; << LL_ENDL;
buildLegacyName(full_name, &av_name);
// Add to cache, because if we don't we'll keep rerequesting the // Construct an av_name record from this name.
// same record forever. buildLegacyName should always guarantee LLAvatarName av_name;
// that these records expire reasonably soon av_name.fromString(full_name);
// (in TEMP_CACHE_ENTRY_LIFETIME seconds), so if the failure was due
// to something temporary we will eventually request and get the right data. // Add to cache: we're still using the new cache even if we're using the old (legacy) protocol.
processName(agent_id, av_name, true); processName(agent_id, av_name);
} }
void LLAvatarNameCache::requestNamesViaLegacy() void LLAvatarNameCache::requestNamesViaLegacy()
@@ -440,25 +424,28 @@ void LLAvatarNameCache::requestNamesViaLegacy()
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaLegacy agent " << agent_id << LL_ENDL; LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaLegacy agent " << agent_id << LL_ENDL;
gCacheName->get(agent_id, false, // legacy compatibility gCacheName->get(agent_id, false, // legacy compatibility
boost::bind(&LLAvatarNameCache::legacyNameCallback, boost::bind(&LLAvatarNameCache::legacyNameCallback, _1, _2, _3));
_1, _2, _3));
} }
} }
void LLAvatarNameCache::initClass(bool running) void LLAvatarNameCache::initClass(bool running, bool usePeopleAPI)
{ {
sRunning = running; sRunning = running;
sUsePeopleAPI = usePeopleAPI;
} }
void LLAvatarNameCache::cleanupClass() void LLAvatarNameCache::cleanupClass()
{ {
sCache.clear();
} }
void LLAvatarNameCache::importFile(std::istream& istr) void LLAvatarNameCache::importFile(std::istream& istr)
{ {
LLSD data; LLSD data;
S32 parse_count = LLSDSerialize::fromXMLDocument(data, istr); if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr))
if (parse_count < 1) return; {
return;
}
// by convention LLSD storage is a map // by convention LLSD storage is a map
// we only store one entry in the map // we only store one entry in the map
@@ -490,7 +477,7 @@ void LLAvatarNameCache::exportFile(std::ostream& ostr)
const LLUUID& agent_id = it->first; const LLUUID& agent_id = it->first;
const LLAvatarName& av_name = it->second; const LLAvatarName& av_name = it->second;
// Do not write temporary or expired entries to the stored cache // Do not write temporary or expired entries to the stored cache
if (!av_name.mIsTemporaryName && av_name.mExpires >= max_unrefreshed) if (av_name.isValidName(max_unrefreshed))
{ {
// key must be a string // key must be a string
agents[agent_id.asString()] = av_name.asLLSD(); agents[agent_id.asString()] = av_name.asLLSD();
@@ -511,6 +498,11 @@ bool LLAvatarNameCache::hasNameLookupURL()
return !sNameLookupURL.empty(); return !sNameLookupURL.empty();
} }
bool LLAvatarNameCache::usePeopleAPI()
{
return hasNameLookupURL() && sUsePeopleAPI;
}
void LLAvatarNameCache::idle() void LLAvatarNameCache::idle()
{ {
// By convention, start running at first idle() call // By convention, start running at first idle() call
@@ -527,13 +519,12 @@ void LLAvatarNameCache::idle()
if (!sAskQueue.empty()) if (!sAskQueue.empty())
{ {
if (useDisplayNames()) if (usePeopleAPI())
{ {
requestNamesViaCapability(); requestNamesViaCapability();
} }
else else
{ {
// ...fall back to legacy name cache system
requestNamesViaLegacy(); requestNamesViaLegacy();
} }
} }
@@ -541,7 +532,7 @@ void LLAvatarNameCache::idle()
if (sAskQueue.empty()) if (sAskQueue.empty())
{ {
// cleared the list, reset the request timer. // cleared the list, reset the request timer.
sRequestTimer.reset(SECS_BETWEEN_REQUESTS); sRequestTimer.resetWithExpiry(SECS_BETWEEN_REQUESTS);
} }
// erase anything that has not been refreshed for more than MAX_UNREFRESHED_TIME // erase anything that has not been refreshed for more than MAX_UNREFRESHED_TIME
@@ -577,9 +568,8 @@ void LLAvatarNameCache::eraseUnrefreshed()
const LLAvatarName& av_name = it->second; const LLAvatarName& av_name = it->second;
if (av_name.mExpires < max_unrefreshed) if (av_name.mExpires < max_unrefreshed)
{ {
const LLUUID& agent_id = it->first; LL_DEBUGS("AvNameCache") << it->first
LL_DEBUGS("AvNameCache") << agent_id << " user '" << av_name.getAccountName() << "' "
<< " user '" << av_name.mUsername << "' "
<< "expired " << now - av_name.mExpires << " secs ago" << "expired " << now - av_name.mExpires << " secs ago"
<< LL_ENDL; << LL_ENDL;
sCache.erase(it++); sCache.erase(it++);
@@ -593,29 +583,6 @@ void LLAvatarNameCache::eraseUnrefreshed()
} }
} }
void LLAvatarNameCache::buildLegacyName(const std::string& full_name,
LLAvatarName* av_name)
{
llassert(av_name);
av_name->mUsername = "";
av_name->mDisplayName = full_name;
av_name->mIsDisplayNameDefault = true;
av_name->mIsTemporaryName = true;
av_name->mExpires = LLFrameTimer::getTotalSeconds() + TEMP_CACHE_ENTRY_LIFETIME;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::buildLegacyName "
<< full_name
<< LL_ENDL;
// [Ansariel/Henri]
// Why ain't those set? In case of disabled display names
// we would have to parse LLAvatarName::mDisplayName to get
// first and lastname if we need them. So do it already here
// for convenience.
std::istringstream fname(full_name);
fname >> av_name->mLegacyFirstName >> av_name->mLegacyLastName;
// [/Ansariel/Henri]
}
// fills in av_name if it has it in the cache, even if expired (can check expiry time) // fills in av_name if it has it in the cache, even if expired (can check expiry time)
// returns bool specifying if av_name was filled, false otherwise // returns bool specifying if av_name was filled, false otherwise
bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
@@ -623,36 +590,32 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
if (sRunning) if (sRunning)
{ {
// ...only do immediate lookups when cache is running // ...only do immediate lookups when cache is running
if (useDisplayNames()) std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end())
{ {
// ...use display names cache *av_name = it->second;
std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end())
{
*av_name = it->second;
// re-request name if entry is expired // re-request name if entry is expired
if (av_name->mExpires < LLFrameTimer::getTotalSeconds()) if (av_name->mExpires < LLFrameTimer::getTotalSeconds())
{
if (!isRequestPending(agent_id))
{ {
if (!isRequestPending(agent_id)) LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
{ << "refresh agent " << agent_id
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get " << LL_ENDL;
<< "refresh agent " << agent_id sAskQueue.insert(agent_id);
<< LL_ENDL;
sAskQueue.insert(agent_id);
}
} }
return true;
} }
return true;
} }
else else if (!usePeopleAPI())
{ {
// ...use legacy names cache
std::string full_name; std::string full_name;
if (gCacheName->getFullName(agent_id, full_name)) if (gCacheName->getFullName(agent_id, full_name))
{ {
buildLegacyName(full_name, av_name); av_name->fromString(full_name);
sCache[agent_id] = *av_name;
return true; return true;
} }
} }
@@ -669,35 +632,22 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
return false; return false;
} }
const S32& LLAvatarNameCache::phoenix_name_system() const S32& main_name_system()
{ {
static const LLCachedControl<S32> name_system("PhoenixNameSystem", 0); static const LLCachedControl<S32> name_system("PhoenixNameSystem", 0);
return name_system; return name_system;
} }
// Return true when name has been set to Phoenix Name System Name, if not return false. // Return true when name has been set to Name System Name, if not return false.
bool LLAvatarNameCache::getPNSName(const LLUUID& agent_id, std::string& name, const S32& name_system) bool LLAvatarNameCache::getNSName(const LLUUID& agent_id, std::string& name, const S32& name_system)
{ {
LLAvatarName avatar_name; LLAvatarName avatar_name;
if (get(agent_id, &avatar_name)) if (get(agent_id, &avatar_name))
getPNSName(avatar_name, name, name_system); name = avatar_name.getNSName(name_system);
else return false; else return false;
return true; return true;
} }
// get() with callback compatible version of getPNSName
void LLAvatarNameCache::getPNSName(const LLAvatarName& avatar_name, std::string& name, const S32& name_system)
{
switch (name_system)
{
case 0 : name = avatar_name.getLegacyName(); break;
case 1 : name = avatar_name.getCompleteName(); break;
case 2 : name = avatar_name.mDisplayName; break;
case 3 : name = avatar_name.getLegacyName() + (avatar_name.mIsDisplayNameDefault ? "" : " (" + avatar_name.mDisplayName + ")"); break;
default : name = avatar_name.getLegacyName(); break;
}
}
void LLAvatarNameCache::fireSignal(const LLUUID& agent_id, void LLAvatarNameCache::fireSignal(const LLUUID& agent_id,
const callback_slot_t& slot, const callback_slot_t& slot,
const LLAvatarName& av_name) const LLAvatarName& av_name)
@@ -714,30 +664,14 @@ LLAvatarNameCache::callback_connection_t LLAvatarNameCache::get(const LLUUID& ag
if (sRunning) if (sRunning)
{ {
// ...only do immediate lookups when cache is running // ...only do immediate lookups when cache is running
if (useDisplayNames()) std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end())
{ {
// ...use new cache const LLAvatarName& av_name = it->second;
std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end()) if (av_name.mExpires > LLFrameTimer::getTotalSeconds())
{ {
const LLAvatarName& av_name = it->second; // ...name already exists in cache, fire callback now
if (av_name.mExpires > LLFrameTimer::getTotalSeconds())
{
// ...name already exists in cache, fire callback now
fireSignal(agent_id, slot, av_name);
return connection;
}
}
}
else
{
// ...use old name system
std::string full_name;
if (gCacheName->getFullName(agent_id, full_name))
{
LLAvatarName av_name;
buildLegacyName(full_name, &av_name);
fireSignal(agent_id, slot, av_name); fireSignal(agent_id, slot, av_name);
return connection; return connection;
} }
@@ -778,7 +712,7 @@ bool LLAvatarNameCache::getForceDisplayNames()
void LLAvatarNameCache::setForceDisplayNames(bool force) void LLAvatarNameCache::setForceDisplayNames(bool force)
{ {
sForceDisplayNames = force; sForceDisplayNames = force;
if ( (!sUseDisplayNames) && (force) ) if ( (!LLAvatarName::useDisplayNames()) && (force) )
{ {
setUseDisplayNames(true); setUseDisplayNames(true);
} }
@@ -791,21 +725,20 @@ void LLAvatarNameCache::setUseDisplayNames(bool use)
// We need to force the use of the "display names" cache when @shownames=n restricted (and disallow toggling it) // We need to force the use of the "display names" cache when @shownames=n restricted (and disallow toggling it)
use |= getForceDisplayNames(); use |= getForceDisplayNames();
// [/RLVa:KB] // [/RLVa:KB]
if (use != sUseDisplayNames) if (use != LLAvatarName::useDisplayNames())
{ {
sUseDisplayNames = use; LLAvatarName::setUseDisplayNames(use);
LL_DEBUGS("AvNameCache") << "Display names are now: " << (use ? "on" : "off") << LL_ENDL;
// flush our cache
sCache.clear();
mUseDisplayNamesSignal(); mUseDisplayNamesSignal();
} }
} }
bool LLAvatarNameCache::useDisplayNames() void LLAvatarNameCache::setUseUsernames(bool use)
{ {
// Must be both manually set on and able to look up names. if (use != LLAvatarName::useUsernames())
return sUseDisplayNames && !sNameLookupURL.empty(); {
LLAvatarName::setUseUsernames(use);
mUseDisplayNamesSignal();
}
} }
void LLAvatarNameCache::erase(const LLUUID& agent_id) void LLAvatarNameCache::erase(const LLUUID& agent_id)
@@ -839,6 +772,7 @@ bool LLAvatarNameCache::expirationFromCacheControl(AIHTTPReceivedHeaders const&
{ {
bool fromCacheControl = false; bool fromCacheControl = false;
F64 now = LLFrameTimer::getTotalSeconds(); F64 now = LLFrameTimer::getTotalSeconds();
// Allow the header to override the default // Allow the header to override the default
std::string cache_control; std::string cache_control;
if (headers.getFirstValue("cache-control", cache_control)) if (headers.getFirstValue("cache-control", cache_control))

View File

@@ -32,46 +32,41 @@
#include <boost/signals2.hpp> #include <boost/signals2.hpp>
class LLUUID;
class AIHTTPReceivedHeaders; class AIHTTPReceivedHeaders;
class LLUUID;
namespace LLAvatarNameCache namespace LLAvatarNameCache
{ {
typedef boost::signals2::signal<void (void)> use_display_name_signal_t; typedef boost::signals2::signal<void (void)> use_display_name_signal_t;
// Until the cache is set running, immediate lookups will fail and // Until the cache is set running, immediate lookups will fail and
// async lookups will be queued. This allows us to block requests // async lookups will be queued. This allows us to block requests
// until we know if the first region supports display names. // until we know if the first region supports display names.
void initClass(bool running); void initClass(bool running, bool usePeopleAPI);
void cleanupClass(); void cleanupClass();
// Import/export the name cache to file.
void importFile(std::istream& istr); void importFile(std::istream& istr);
void exportFile(std::ostream& ostr); void exportFile(std::ostream& ostr);
// On the viewer, usually a simulator capabilitity // On the viewer, usually a simulator capabilitity.
// If empty, name cache will fall back to using legacy name // If empty, name cache will fall back to using legacy name lookup system.
// lookup system
void setNameLookupURL(const std::string& name_lookup_url); void setNameLookupURL(const std::string& name_lookup_url);
// Do we have a valid lookup URL, hence are we trying to use the // Do we have a valid lookup URL, i.e. are we trying to use the
// new display name lookup system? // more recent display name lookup system?
bool hasNameLookupURL(); bool hasNameLookupURL();
bool usePeopleAPI();
// Periodically makes a batch request for display names not already in // Periodically makes a batch request for display names not already in
// cache. Call once per frame. // cache. Called once per frame.
void idle(); void idle();
// If name is in cache, returns true and fills in provided LLAvatarName // If name is in cache, returns true and fills in provided LLAvatarName
// otherwise returns false // otherwise returns false.
bool get(const LLUUID& agent_id, LLAvatarName *av_name); bool get(const LLUUID& agent_id, LLAvatarName *av_name);
const S32& phoenix_name_system(); // If get() succeeds, returns true and fills in name string via void function below, otherwise returns false
// If get() succeeds, returns true and fills in name string bool getNSName(const LLUUID& agent_id, std::string& name, const S32& name_system = main_name_system());
// via void function below, otherwise returns false
bool getPNSName(const LLUUID& agent_id, std::string& name, const S32& name_system = phoenix_name_system());
// Perform a filling of name string according to Phoenix Name System,
// when we have an LLAvatarName already.
void getPNSName(const LLAvatarName& avatar_name, std::string& name, const S32& name_system = phoenix_name_system());
// Callback types for get() below // Callback types for get() below
typedef boost::signals2::signal< typedef boost::signals2::signal<
@@ -80,29 +75,29 @@ namespace LLAvatarNameCache
typedef callback_signal_t::slot_type callback_slot_t; typedef callback_signal_t::slot_type callback_slot_t;
typedef boost::signals2::connection callback_connection_t; typedef boost::signals2::connection callback_connection_t;
// Fetches name information and calls callback. // Fetches name information and calls callbacks.
// If name information is in cache, callback will be called immediately. // If name information is in cache, callbacks will be called immediately.
callback_connection_t get(const LLUUID& agent_id, callback_slot_t slot); callback_connection_t get(const LLUUID& agent_id, callback_slot_t slot);
// Allow display names to be explicitly disabled for testing. // Set display name: flips the switch and triggers the callbacks.
void setUseDisplayNames(bool use); void setUseDisplayNames(bool use);
bool useDisplayNames();
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c // [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c
bool getForceDisplayNames(); bool getForceDisplayNames();
void setForceDisplayNames(bool force); void setForceDisplayNames(bool force);
// [/RLVa:KB] // [/RLVa:KB]
void erase(const LLUUID& agent_id); void setUseUsernames(bool use);
/// Provide some fallback for agents that return errors
void handleAgentError(const LLUUID& agent_id);
void insert(const LLUUID& agent_id, const LLAvatarName& av_name); void insert(const LLUUID& agent_id, const LLAvatarName& av_name);
void erase(const LLUUID& agent_id);
/// Provide some fallback for agents that return errors.
void handleAgentError(const LLUUID& agent_id);
// Compute name expiration time from HTTP Cache-Control header, // Compute name expiration time from HTTP Cache-Control header,
// or return default value, in seconds from epoch. // or return default value, in seconds from epoch.
F64 nameExpirationFromHeaders(AIHTTPReceivedHeaders const& headers); F64 nameExpirationFromHeaders(const AIHTTPReceivedHeaders& headers);
void addUseDisplayNamesCallback(const use_display_name_signal_t::slot_type& cb); void addUseDisplayNamesCallback(const use_display_name_signal_t::slot_type& cb);
} }

View File

@@ -279,7 +279,9 @@ LLCacheName::Impl::Impl(LLMessageSystem* msg)
LLCacheName::Impl::~Impl() LLCacheName::Impl::~Impl()
{ {
for_each(mCache.begin(), mCache.end(), DeletePairedPointer()); for_each(mCache.begin(), mCache.end(), DeletePairedPointer());
mCache.clear();
for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer()); for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer());
mReplyQueue.clear();
} }
boost::signals2::connection LLCacheName::Impl::addPending(const LLUUID& id, const LLCacheNameCallback& callback) boost::signals2::connection LLCacheName::Impl::addPending(const LLUUID& id, const LLCacheNameCallback& callback)
@@ -309,8 +311,10 @@ boost::signals2::connection LLCacheName::addObserver(const LLCacheNameCallback&
bool LLCacheName::importFile(std::istream& istr) bool LLCacheName::importFile(std::istream& istr)
{ {
LLSD data; LLSD data;
if(LLSDSerialize::fromXMLDocument(data, istr) < 1) if(LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr))
{
return false; return false;
}
// We'll expire entries more than a week old // We'll expire entries more than a week old
U32 now = (U32)time(NULL); U32 now = (U32)time(NULL);
@@ -527,6 +531,7 @@ std::string LLCacheName::cleanFullName(const std::string& full_name)
} }
//static //static
// Transform hard-coded name provided by server to a more legible username
std::string LLCacheName::buildUsername(const std::string& full_name) std::string LLCacheName::buildUsername(const std::string& full_name)
{ {
// rare, but handle hard-coded error names returned from server // rare, but handle hard-coded error names returned from server
@@ -553,8 +558,9 @@ std::string LLCacheName::buildUsername(const std::string& full_name)
return username; return username;
} }
// if the input wasn't a correctly formatted legacy name just return it unchanged // if the input wasn't a correctly formatted legacy name, just return it
return full_name; // cleaned up from a potential terminal "Resident"
return cleanFullName(full_name);
} }
//static //static
@@ -562,13 +568,13 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
{ {
//boost::regexp was showing up in the crashreporter, so doing //boost::regexp was showing up in the crashreporter, so doing
//painfully manual parsing using substr. LF //painfully manual parsing using substr. LF
S32 open_paren = complete_name.rfind(" ("); size_t open_paren = complete_name.rfind(" (");
S32 close_paren = complete_name.rfind(')'); size_t close_paren = complete_name.rfind(')');
if (open_paren != std::string::npos && if (open_paren != std::string::npos &&
close_paren == complete_name.length()-1) close_paren == complete_name.length()-1)
{ {
S32 length = close_paren - open_paren - 2; size_t length = llmax(close_paren - open_paren - 2, (size_t)0);
std::string legacy_name = complete_name.substr(open_paren+2, length); std::string legacy_name = complete_name.substr(open_paren+2, length);
if (legacy_name.length() > 0) if (legacy_name.length() > 0)
@@ -577,7 +583,7 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name)
LLStringUtil::toUpper(cap_letter); LLStringUtil::toUpper(cap_letter);
legacy_name = cap_letter + legacy_name.substr(1); legacy_name = cap_letter + legacy_name.substr(1);
S32 separator = legacy_name.find('.'); size_t separator = legacy_name.find('.');
if (separator != std::string::npos) if (separator != std::string::npos)
{ {
@@ -668,32 +674,18 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, ol
// <edit> // <edit>
bool LLCacheName::getIfThere(const LLUUID& id, std::string& fullname, BOOL& is_group) bool LLCacheName::getIfThere(const LLUUID& id, std::string& fullname, BOOL& is_group)
{ {
if(id.isNull()) if (id.notNull())
if (LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id))
{ {
fullname = ""; fullname = (is_group = entry->mIsGroup) ? entry->mGroupName : entry->mFirstName + " " + entry->mLastName;
return false;
}
LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id );
if (entry)
{
if (entry->mIsGroup)
{
fullname = entry->mGroupName;
}
else
{
fullname = entry->mFirstName + " " + entry->mLastName;
}
is_group = entry->mIsGroup;
return true; return true;
} }
fullname = ""; fullname = "";
return false; return false;
} }
// </edit> // </edit>
void LLCacheName::processPending() void LLCacheName::processPending()
{ {
const F32 SECS_BETWEEN_PROCESS = 0.1f; const F32 SECS_BETWEEN_PROCESS = 0.1f;
@@ -705,7 +697,7 @@ void LLCacheName::processPending()
if(!impl.mUpstreamHost.isOk()) if(!impl.mUpstreamHost.isOk())
{ {
lldebugs << "LLCacheName::processPending() - bad upstream host." lldebugs << "LLCacheName::processPending() - bad upstream host."
<< llendl; << LL_ENDL;
return; return;
} }
@@ -756,7 +748,7 @@ void LLCacheName::dump()
<< iter->first << " = (group) " << iter->first << " = (group) "
<< entry->mGroupName << entry->mGroupName
<< " @ " << entry->mCreateTime << " @ " << entry->mCreateTime
<< llendl; << LL_ENDL;
} }
else else
{ {
@@ -764,7 +756,7 @@ void LLCacheName::dump()
<< iter->first << " = " << iter->first << " = "
<< buildFullName(entry->mFirstName, entry->mLastName) << buildFullName(entry->mFirstName, entry->mLastName)
<< " @ " << entry->mCreateTime << " @ " << entry->mCreateTime
<< llendl; << LL_ENDL;
} }
} }
} }
@@ -778,7 +770,7 @@ void LLCacheName::dumpStats()
<< " Pending=" << impl.mPendingQueue.size() << " Pending=" << impl.mPendingQueue.size()
<< " Reply=" << impl.mReplyQueue.size() << " Reply=" << impl.mReplyQueue.size()
// << " Observers=" << impl.mSignal.size() // << " Observers=" << impl.mSignal.size()
<< llendl; << LL_ENDL;
} }
void LLCacheName::clear() void LLCacheName::clear()
@@ -935,7 +927,7 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup)
<< (isGroup ? "group" : "user") << " name, " << (isGroup ? "group" : "user") << " name, "
<< "but found " << "but found "
<< (entry->mIsGroup ? "group" : "user") << (entry->mIsGroup ? "group" : "user")
<< ": " << id << llendl; << ": " << id << LL_ENDL;
} }
else else
{ {

View File

@@ -40,7 +40,7 @@ typedef boost::signals2::signal<void (const LLUUID& id,
bool is_group)> LLCacheNameSignal; bool is_group)> LLCacheNameSignal;
typedef LLCacheNameSignal::slot_type LLCacheNameCallback; typedef LLCacheNameSignal::slot_type LLCacheNameCallback;
// Old callback with user data for compatability // Old callback with user data for compatibility
typedef void (*old_callback_t)(const LLUUID&, const std::string&, bool, void*); typedef void (*old_callback_t)(const LLUUID&, const std::string&, bool, void*);
// Here's the theory: // Here's the theory:
@@ -107,7 +107,7 @@ public:
// otherwise, will request the data, and will call the callback when // otherwise, will request the data, and will call the callback when
// available. There is no garuntee the callback will ever be called. // available. There is no garuntee the callback will ever be called.
boost::signals2::connection get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback); boost::signals2::connection get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback);
//<edit> //<edit>
bool getIfThere(const LLUUID& id, std::string& fullname, BOOL& is_group); bool getIfThere(const LLUUID& id, std::string& fullname, BOOL& is_group);
//</edit> //</edit>

View File

@@ -722,6 +722,11 @@ void LLHTTPClient::put(std::string const& url, LLSD const& body, ResponderPtr re
request(url, HTTP_PUT, new LLSDInjector(body), responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug), no_keep_alive, no_does_authentication, no_allow_compressed_reply); request(url, HTTP_PUT, new LLSDInjector(body), responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug), no_keep_alive, no_does_authentication, no_allow_compressed_reply);
} }
void LLHTTPClient::putRaw(const std::string& url, const char* data, S32 size, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug))
{
request(url, HTTP_PUT, new RawInjector(data, size), responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug), no_keep_alive, no_does_authentication, no_allow_compressed_reply);
}
void LLHTTPClient::post(std::string const& url, LLSD const& body, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug), EKeepAlive keepalive, AIStateMachine* parent, AIStateMachine::state_type new_parent_state) void LLHTTPClient::post(std::string const& url, LLSD const& body, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug), EKeepAlive keepalive, AIStateMachine* parent, AIStateMachine::state_type new_parent_state)
{ {
request(url, HTTP_POST, new LLSDInjector(body), responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug), keepalive, no_does_authentication, allow_compressed_reply, parent, new_parent_state); request(url, HTTP_POST, new LLSDInjector(body), responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug), keepalive, no_does_authentication, allow_compressed_reply, parent, new_parent_state);

View File

@@ -491,6 +491,10 @@ public:
static void put(std::string const& url, LLSD const& body, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) static void put(std::string const& url, LLSD const& body, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off))
{ AIHTTPHeaders headers; put(url, body, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); } { AIHTTPHeaders headers; put(url, body, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); }
static void putRaw(const std::string& url, const char* data, S32 size, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off));
static void putRaw(const std::string& url, const char* data, S32 size, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off))
{ AIHTTPHeaders headers; putRaw(url, data, size, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); }
static void getHeaderOnly(std::string const& url, ResponderHeadersOnly* responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)); static void getHeaderOnly(std::string const& url, ResponderHeadersOnly* responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off));
static void getHeaderOnly(std::string const& url, ResponderHeadersOnly* responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) static void getHeaderOnly(std::string const& url, ResponderHeadersOnly* responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off))
{ AIHTTPHeaders headers; getHeaderOnly(url, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); } { AIHTTPHeaders headers; getHeaderOnly(url, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); }

View File

@@ -91,45 +91,35 @@ LONG WINAPI myWin32ExceptionHandler( struct _EXCEPTION_POINTERS* exception_infop
return EXCEPTION_EXECUTE_HANDLER; return EXCEPTION_EXECUTE_HANDLER;
} }
// Taken from : http://blog.kalmbachnet.de/?postid=75 // Taken from : http://blog.kalmbach-software.de/2013/05/23/improvedpreventsetunhandledexceptionfilter/
// The MSVC 2005 CRT forces the call of the default-debugger (normally Dr.Watson) // The MSVC 2005 and above CRT forces the call of the default-debugger (normally Dr.Watson)
// even with the other exception handling code. This (terrifying) piece of code // even with the other exception handling code. This (terrifying) piece of code
// patches things so that doesn't happen. // patches things so that doesn't happen.
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI MyDummySetUnhandledExceptionFilter( static BOOL PreventSetUnhandledExceptionFilter()
LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter )
{ {
return NULL; HMODULE hKernel32 = LoadLibrary(TEXT("kernel32.dll"));
} if (hKernel32 == NULL) return FALSE;
void *pOrgEntry = GetProcAddress(hKernel32, "SetUnhandledExceptionFilter");
if (pOrgEntry == NULL) return FALSE;
BOOL PreventSetUnhandledExceptionFilter() #ifdef _M_IX86
{ // Code for x86:
// WARNING: This won't work on 64-bit Windows systems so we turn it off it. // 33 C0 xor eax,eax
// It should work for any flavor of 32-bit Windows we care about. // C2 04 00 ret 4
// If it's off, sometimes you will see an OS message when a plugin crashes unsigned char szExecute[] = { 0x33, 0xC0, 0xC2, 0x04, 0x00 };
#ifndef _WIN64 #elif _M_X64
HMODULE hKernel32 = LoadLibraryA( "kernel32.dll" ); // 33 C0 xor eax,eax
if ( NULL == hKernel32 ) // C3 ret
return FALSE; unsigned char szExecute[] = { 0x33, 0xC0, 0xC3 };
void *pOrgEntry = GetProcAddress( hKernel32, "SetUnhandledExceptionFilter" );
if( NULL == pOrgEntry )
return FALSE;
unsigned char newJump[ 100 ];
DWORD dwOrgEntryAddr = (DWORD)pOrgEntry;
dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far
void *pNewFunc = &MyDummySetUnhandledExceptionFilter;
DWORD dwNewEntryAddr = (DWORD) pNewFunc;
DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr;
newJump[ 0 ] = 0xE9; // JMP absolute
memcpy( &newJump[ 1 ], &dwRelativeAddr, sizeof( pNewFunc ) );
SIZE_T bytesWritten;
BOOL bRet = WriteProcessMemory( GetCurrentProcess(), pOrgEntry, newJump, sizeof( pNewFunc ) + 1, &bytesWritten );
return bRet;
#else #else
return FALSE; #error "The following code only works for x86 and x64!"
#endif #endif
DWORD oldProtect;
BOOL bRet = VirtualProtect(pOrgEntry, sizeof(szExecute), PAGE_EXECUTE_READWRITE, &oldProtect);
memcpy(pOrgEntry, szExecute, sizeof(szExecute));
VirtualProtect(pOrgEntry, sizeof(szExecute), oldProtect, &oldProtect);
return bRet;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@@ -2320,7 +2320,7 @@ void LLGLNamePool::release(GLuint name)
//static //static
void LLGLNamePool::upkeepPools() void LLGLNamePool::upkeepPools()
{ {
for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter) for (tracker_t::instance_iter iter = beginInstances(), iter_end = endInstances(); iter != iter_end; ++iter)
{ {
LLGLNamePool & pool = *iter; LLGLNamePool & pool = *iter;
pool.upkeep(); pool.upkeep();
@@ -2330,7 +2330,7 @@ void LLGLNamePool::upkeepPools()
//static //static
void LLGLNamePool::cleanupPools() void LLGLNamePool::cleanupPools()
{ {
for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter) for (tracker_t::instance_iter iter = beginInstances(), iter_end = endInstances(); iter != iter_end; ++iter)
{ {
LLGLNamePool & pool = *iter; LLGLNamePool & pool = *iter;
pool.cleanup(); pool.cleanup();

View File

@@ -160,6 +160,9 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *
LLComboBox* combo_box = new LLComboBox("combo_box", rect, label); LLComboBox* combo_box = new LLComboBox("combo_box", rect, label);
combo_box->setAllowTextEntry(allow_text_entry, max_chars); combo_box->setAllowTextEntry(allow_text_entry, max_chars);
if (LLFontGL* font = selectFont(node))
combo_box->mButton->setFont(font);
const std::string& contents = node->getValue(); const std::string& contents = node->getValue();
if (contents.find_first_not_of(" \n\t") != contents.npos) if (contents.find_first_not_of(" \n\t") != contents.npos)

View File

@@ -1498,23 +1498,8 @@ void LLFloater::draw()
} }
else else
{ {
// draw children
LLView* focused_child = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus());
BOOL focused_child_visible = FALSE;
if (focused_child && focused_child->getParent() == this)
{
focused_child_visible = focused_child->getVisible();
focused_child->setVisible(FALSE);
}
// don't call LLPanel::draw() since we've implemented custom background rendering // don't call LLPanel::draw() since we've implemented custom background rendering
LLView::draw(); LLView::draw();
if (focused_child_visible)
{
focused_child->setVisible(TRUE);
}
drawChild(focused_child);
} }
if( isBackgroundVisible() ) if( isBackgroundVisible() )

View File

@@ -107,6 +107,9 @@ LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFacto
flyout_button->mListPosition = ABOVE; flyout_button->mListPosition = ABOVE;
} }
if (LLFontGL* font = selectFont(node))
flyout_button->mActionButton->setFont(font);
flyout_button->initFromXML(node, parent); flyout_button->initFromXML(node, parent);
for (LLXMLNodePtr child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) for (LLXMLNodePtr child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())

View File

@@ -534,7 +534,7 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp)
//static //static
void LLLayoutStack::updateClass() void LLLayoutStack::updateClass()
{ {
for (instance_iter it = beginInstances(); it != endInstances(); ++it) for (instance_iter it = beginInstances(), it_end(endInstances()); it != it_end; ++it)
{ {
it->updateLayout(); it->updateLayout();
it->mAnimatedThisFrame = false; it->mAnimatedThisFrame = false;

View File

@@ -340,7 +340,8 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about // secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about // x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
// //
LLUrlEntryAgent::LLUrlEntryAgent() LLUrlEntryAgent::LLUrlEntryAgent() :
mAvatarNameCacheConnection()
{ {
mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/\\w+", mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/\\w+",
boost::regex::perl|boost::regex::icase); boost::regex::perl|boost::regex::icase);
@@ -371,6 +372,8 @@ void LLUrlEntryAgent::callObservers(const std::string &id,
void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id, void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
const LLAvatarName& av_name) const LLAvatarName& av_name)
{ {
mAvatarNameCacheConnection.disconnect();
std::string label = av_name.getCompleteName(); std::string label = av_name.getCompleteName();
// received the agent name from the server - tell our observers // received the agent name from the server - tell our observers
@@ -456,9 +459,11 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
} }
else else
{ {
LLAvatarNameCache::get(agent_id, if (mAvatarNameCacheConnection.connected())
boost::bind(&LLUrlEntryAgent::onAvatarNameCache, {
this, _1, _2)); mAvatarNameCacheConnection.disconnect();
}
mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgent::onAvatarNameCache, this, _1, _2));
addObserver(agent_id_string, url, cb); addObserver(agent_id_string, url, cb);
return LLTrans::getString("LoadingData"); return LLTrans::getString("LoadingData");
} }
@@ -499,6 +504,10 @@ std::string localize_slapp_label(const std::string& url, const std::string& full
{ {
return LLTrans::getString("SLappAgentRequestFriend") + " " + full_name; return LLTrans::getString("SLappAgentRequestFriend") + " " + full_name;
} }
if (LLStringUtil::endsWith(url, "/removefriend"))
{
return LLTrans::getString("SLappAgentRemoveFriend") + " " + full_name;
}
return full_name; return full_name;
} }
@@ -515,12 +524,15 @@ std::string LLUrlEntryAgent::getIcon(const std::string &url)
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) // secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username)
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) // x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username)
// //
LLUrlEntryAgentName::LLUrlEntryAgentName() LLUrlEntryAgentName::LLUrlEntryAgentName() :
mAvatarNameCacheConnection()
{} {}
void LLUrlEntryAgentName::onAvatarNameCache(const LLUUID& id, void LLUrlEntryAgentName::onAvatarNameCache(const LLUUID& id,
const LLAvatarName& av_name) const LLAvatarName& av_name)
{ {
mAvatarNameCacheConnection.disconnect();
std::string label = getName(av_name); std::string label = getName(av_name);
// received the agent name from the server - tell our observers // received the agent name from the server - tell our observers
callObservers(id.asString(), label, mIcon); callObservers(id.asString(), label, mIcon);
@@ -554,9 +566,11 @@ std::string LLUrlEntryAgentName::getLabel(const std::string &url, const LLUrlLab
} }
else else
{ {
LLAvatarNameCache::get(agent_id, if (mAvatarNameCacheConnection.connected())
boost::bind(&LLUrlEntryAgentCompleteName::onAvatarNameCache, {
this, _1, _2)); mAvatarNameCacheConnection.disconnect();
}
mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentName::onAvatarNameCache, this, _1, _2));
addObserver(agent_id_string, url, cb); addObserver(agent_id_string, url, cb);
return LLTrans::getString("LoadingData"); return LLTrans::getString("LoadingData");
} }
@@ -597,7 +611,7 @@ LLUrlEntryAgentDisplayName::LLUrlEntryAgentDisplayName()
std::string LLUrlEntryAgentDisplayName::getName(const LLAvatarName& avatar_name) std::string LLUrlEntryAgentDisplayName::getName(const LLAvatarName& avatar_name)
{ {
return avatar_name.mDisplayName; return avatar_name.getDisplayName();
} }
// //
@@ -613,7 +627,7 @@ LLUrlEntryAgentUserName::LLUrlEntryAgentUserName()
std::string LLUrlEntryAgentUserName::getName(const LLAvatarName& avatar_name) std::string LLUrlEntryAgentUserName::getName(const LLAvatarName& avatar_name)
{ {
return avatar_name.mUsername.empty() ? avatar_name.getLegacyName() : avatar_name.mUsername; return avatar_name.getAccountName();
} }
// //
@@ -1053,7 +1067,8 @@ LLUrlEntrySLLabel::LLUrlEntrySLLabel()
std::string LLUrlEntrySLLabel::getLabel(const std::string &url, const LLUrlLabelCallback &cb) std::string LLUrlEntrySLLabel::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{ {
return getLabelFromWikiLink(url); std::string label = getLabelFromWikiLink(url);
return (!LLUrlRegistry::instance().hasUrl(label)) ? label : getUrl(url);
} }
std::string LLUrlEntrySLLabel::getUrl(const std::string &string) const std::string LLUrlEntrySLLabel::getUrl(const std::string &string) const

View File

@@ -32,6 +32,7 @@
#include "lluicolor.h" #include "lluicolor.h"
#include "llstyle.h" #include "llstyle.h"
#include "llavatarname.h"
#include "llhost.h" // for resolving parcel name by parcel id #include "llhost.h" // for resolving parcel name by parcel id
#include <boost/signals2.hpp> #include <boost/signals2.hpp>
@@ -93,7 +94,7 @@ public:
virtual std::string getLocation(const std::string &url) const { return ""; } virtual std::string getLocation(const std::string &url) const { return ""; }
/// Should this link text be underlined only when mouse is hovered over it? /// Should this link text be underlined only when mouse is hovered over it?
virtual bool underlineOnHoverOnly(const std::string &string) const { return false; } virtual bool underlineOnHoverOnly(const std::string &string) const { return true; } // <alchemy/>
virtual LLUUID getID(const std::string &string) const { return LLUUID::null; } virtual LLUUID getID(const std::string &string) const { return LLUUID::null; }
@@ -171,6 +172,13 @@ class LLUrlEntryAgent : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryAgent(); LLUrlEntryAgent();
~LLUrlEntryAgent()
{
if (mAvatarNameCacheConnection.connected())
{
mAvatarNameCacheConnection.disconnect();
}
}
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
/*virtual*/ std::string getIcon(const std::string &url); /*virtual*/ std::string getIcon(const std::string &url);
/*virtual*/ std::string getTooltip(const std::string &string) const; /*virtual*/ std::string getTooltip(const std::string &string) const;
@@ -181,6 +189,7 @@ protected:
/*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon); /*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon);
private: private:
void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name);
boost::signals2::connection mAvatarNameCacheConnection;
}; };
/// ///
@@ -192,6 +201,13 @@ class LLUrlEntryAgentName : public LLUrlEntryBase, public boost::signals2::track
{ {
public: public:
LLUrlEntryAgentName(); LLUrlEntryAgentName();
~LLUrlEntryAgentName()
{
if (mAvatarNameCacheConnection.connected())
{
mAvatarNameCacheConnection.disconnect();
}
}
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
//*virtual*/ LLStyle::Params getStyle() const; //*virtual*/ LLStyle::Params getStyle() const;
protected: protected:
@@ -199,6 +215,7 @@ protected:
virtual std::string getName(const LLAvatarName& avatar_name) = 0; virtual std::string getName(const LLAvatarName& avatar_name) = 0;
private: private:
void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name);
boost::signals2::connection mAvatarNameCacheConnection;
}; };

View File

@@ -9900,17 +9900,6 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key> <key>Value</key>
<integer>0</integer> <integer>0</integer>
</map> </map>
<key>LegacyMultiAttachmentSupport</key>
<map>
<key>Comment</key>
<string>Converts legacy "secondary attachment points" to multi-attachments for other avatars</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>LimitDragDistance</key> <key>LimitDragDistance</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
@@ -16785,6 +16774,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key> <key>Value</key>
<integer>0</integer> <integer>0</integer>
</map> </map>
<key>UsePeopleAPI</key>
<map>
<key>Comment</key>
<string>Use the people API cap for avatar name fetching, use old legacy protocol if false. Requires restart.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>UseStartScreen</key> <key>UseStartScreen</key>
<map> <map>
<key>Comment</key> <key>Comment</key>

View File

@@ -219,9 +219,7 @@ struct ProfCtrlListAccum : public LLControlGroup::ApplyFunctor
#endif //PROF_CTRL_CALLS #endif //PROF_CTRL_CALLS
void spew_key_to_name(const LLUUID& targetKey, const LLAvatarName& av_name) void spew_key_to_name(const LLUUID& targetKey, const LLAvatarName& av_name)
{ {
std::string object_name; cmdline_printchat(llformat("%s: %s", targetKey.asString().c_str(), av_name.getNSName().c_str()));
LLAvatarNameCache::getPNSName(av_name, object_name);
cmdline_printchat(llformat("%s: %s", targetKey.asString().c_str(), object_name.c_str()));
} }
bool cmd_line_chat(std::string revised_text, EChatType type) bool cmd_line_chat(std::string revised_text, EChatType type)
{ {
@@ -525,37 +523,24 @@ LLUUID cmdline_partial_name2key(std::string partial_name)
std::string av_name; std::string av_name;
LLStringUtil::toLower(partial_name); LLStringUtil::toLower(partial_name);
LLWorld::getInstance()->getAvatars(&avatars); LLWorld::getInstance()->getAvatars(&avatars);
typedef std::vector<LLUUID>::const_iterator av_iter;
bool has_avatarlist = LLFloaterAvatarList::instanceExists(); bool has_avatarlist = LLFloaterAvatarList::instanceExists();
if(has_avatarlist) if (has_avatarlist)
LLFloaterAvatarList::getInstance()->updateAvatarList(); LLFloaterAvatarList::getInstance()->updateAvatarList();
for(av_iter i = avatars.begin(); i != avatars.end(); ++i) for(std::vector<LLUUID>::const_iterator i = avatars.begin(); i != avatars.end(); ++i)
{ {
if(has_avatarlist) if (LLAvatarListEntry* entry = has_avatarlist ? LLFloaterAvatarList::instance().getAvatarEntry(*i) : NULL)
{ av_name = entry->getName();
LLAvatarListEntry* entry = LLFloaterAvatarList::getInstance()->getAvatarEntry(*i); else if (gCacheName->getFullName(*i, av_name));
if(entry) else if (LLVOAvatar* avatarp = gObjectList.findAvatar(*i))
{ av_name = avatarp->getFullname();
av_name = entry->getName(); else
} continue;
}
if (av_name.empty() && !gCacheName->getFullName(*i, av_name))
{
LLVOAvatar *avatarp = gObjectList.findAvatar(*i);
if(avatarp)
{
av_name = avatarp->getFullname();
}
}
LLStringUtil::toLower(av_name); LLStringUtil::toLower(av_name);
if(strstr(av_name.c_str(), partial_name.c_str())) if (av_name.find(partial_name) != std::string::npos)
{
return *i; return *i;
}
} }
return LLUUID::null; return LLUUID::null;
} }
void cmdline_tp2name(std::string target) void cmdline_tp2name(std::string target)

View File

@@ -562,6 +562,7 @@ RMDir "$SMPROGRAMS\$INSTSHORTCUT"
Delete "$DESKTOP\$INSTSHORTCUT.lnk" Delete "$DESKTOP\$INSTSHORTCUT.lnk"
Delete "$INSTDIR\$INSTSHORTCUT.lnk" Delete "$INSTDIR\$INSTSHORTCUT.lnk"
Delete "$INSTDIR\$INSTSHORTCUT Portable.lnk"
Delete "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" Delete "$INSTDIR\Uninstall $INSTSHORTCUT.lnk"
; Clean up cache and log files. ; Clean up cache and log files.

View File

@@ -59,7 +59,7 @@ void LFFloaterInvPanel::closeAll()
{ {
// We must make a copy first, because LLInstanceTracker doesn't allow destruction while having iterators to it. // We must make a copy first, because LLInstanceTracker doesn't allow destruction while having iterators to it.
std::vector<LFFloaterInvPanel*> cache; std::vector<LFFloaterInvPanel*> cache;
for (instance_iter i = beginInstances(); i != endInstances(); ++i) for (instance_iter i = beginInstances(), end(endInstances()); i != end; ++i)
{ {
cache.push_back(&*i); cache.push_back(&*i);
} }

View File

@@ -21,6 +21,7 @@
#include "llagent.h" #include "llagent.h"
#include "llviewerregion.h" #include "llviewerregion.h"
#include "llmutelist.h"
#include "hippogridmanager.h" #include "hippogridmanager.h"
LFSimFeatureHandler::LFSimFeatureHandler() LFSimFeatureHandler::LFSimFeatureHandler()
@@ -33,6 +34,7 @@ LFSimFeatureHandler::LFSimFeatureHandler()
{ {
if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Remove this line if we ever handle SecondLife sim features if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Remove this line if we ever handle SecondLife sim features
gAgent.addRegionChangedCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this)); gAgent.addRegionChangedCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this));
LLMuteList::instance().mGodLastNames.insert("Linden");
} }
ExportPolicy LFSimFeatureHandler::exportPolicy() const ExportPolicy LFSimFeatureHandler::exportPolicy() const
@@ -108,5 +110,33 @@ void LFSimFeatureHandler::setSupportedFeatures()
mShoutRange.reset(); mShoutRange.reset();
mWhisperRange.reset(); mWhisperRange.reset();
} }
LLMuteList& mute_list(LLMuteList::instance());
mute_list.mGodLastNames.clear();
mute_list.mGodFullNames.clear();
if (info.has("god_names"))
{
const LLSD& god_names(info["god_names"]);
if (god_names.has("last_names"))
{
const LLSD& last_names(god_names["last_names"]);
for (LLSD::array_const_iterator it = last_names.beginArray(); it != last_names.endArray(); ++it)
mute_list.mGodLastNames.insert((*it).asString());
}
if (god_names.has("full_names"))
{
const LLSD& full_names(god_names["full_names"]);
for (LLSD::array_const_iterator it = full_names.beginArray(); it != full_names.endArray(); ++it)
mute_list.mGodFullNames.insert((*it).asString());
}
}
else
{
mute_list.mGodLastNames.insert("Linden");
}
} }
} }

View File

@@ -131,10 +131,10 @@ void LLAvatarActions::removeFriendsDialog(const uuid_vec_t& ids)
if(ids.size() == 1) if(ids.size() == 1)
{ {
LLUUID agent_id = ids[0]; LLUUID agent_id = ids[0];
std::string av_name; LLAvatarName av_name;
if(LLAvatarNameCache::getPNSName(agent_id, av_name)) if(LLAvatarNameCache::get(agent_id, &av_name))
{ {
args["NAME"] = av_name; args["NAME"] = av_name.getNSName();
} }
msgType = "RemoveFromFriends"; msgType = "RemoveFromFriends";
@@ -354,19 +354,11 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa
} }
else else
{ {
std::string username = av_name.mUsername; std::string url = getProfileURL(av_name.getAccountName());
if (username.empty())
{
username = LLCacheName::buildUsername(av_name.mDisplayName);
}
llinfos << "opening web profile for " << username << llendl;
std::string url = getProfileURL(username);
// PROFILES: open in webkit window // PROFILES: open in webkit window
LLFloaterWebContent::Params p; LLFloaterWebContent::Params p;
p.url(url). p.url(url).id(agent_id.asString());
id(agent_id.asString());
LLFloaterWebProfile::showInstance(get_profile_floater_name(agent_id), p); LLFloaterWebProfile::showInstance(get_profile_floater_name(agent_id), p);
} }
} }
@@ -423,14 +415,14 @@ void LLAvatarActions::hideProfile(const LLUUID& id)
// static // static
void LLAvatarActions::showOnMap(const LLUUID& id) void LLAvatarActions::showOnMap(const LLUUID& id)
{ {
std::string av_name; LLAvatarName av_name;
if (!LLAvatarNameCache::getPNSName(id, av_name)) if (!LLAvatarNameCache::get(id, &av_name))
{ {
LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::showOnMap, id)); LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::showOnMap, id));
return; return;
} }
gFloaterWorldMap->trackAvatar(id, av_name); gFloaterWorldMap->trackAvatar(id, av_name.getNSName());
LLFloaterWorldMap::show(true); LLFloaterWorldMap::show(true);
} }
@@ -519,7 +511,7 @@ void LLAvatarActions::on_avatar_name_cache_teleport_request(const LLUUID& id, co
name = RlvStrings::getAnonym(av_name.getLegacyName()); name = RlvStrings::getAnonym(av_name.getLegacyName());
else else
// [RLVa:KB] // [RLVa:KB]
LLAvatarNameCache::getPNSName(av_name, name); name = av_name.getNSName();
notification["NAME"] = name; notification["NAME"] = name;
LLSD payload; LLSD payload;
@@ -841,7 +833,7 @@ void LLAvatarActions::buildResidentsString(std::vector<LLAvatarName> avatar_name
const std::string& separator = LLTrans::getString("words_separator"); const std::string& separator = LLTrans::getString("words_separator");
for (std::vector<LLAvatarName>::const_iterator it = avatar_names.begin(); ; ) for (std::vector<LLAvatarName>::const_iterator it = avatar_names.begin(); ; )
{ {
residents_string.append((*it).getCompleteName()); residents_string.append((*it).getNSName());
if (++it == avatar_names.end()) if (++it == avatar_names.end())
{ {
break; break;

View File

@@ -38,35 +38,29 @@
#include "llcallingcard.h" #include "llcallingcard.h"
#include <vector>
#include <algorithm> #include <algorithm>
//#include <iterator>
#include "indra_constants.h" #include "indra_constants.h"
#include "llcachename.h" //#include "llcachename.h"
#include "llstl.h" #include "llstl.h"
#include "lltimer.h" #include "lltimer.h"
#include "lluuid.h" #include "lluuid.h"
#include "message.h" #include "message.h"
#include "llagent.h" #include "llagent.h"
#include "llbutton.h" #include "llavatarnamecache.h"
//#include "llinventory.h"
#include "llinventorymodel.h"
#include "llinventoryobserver.h" #include "llinventoryobserver.h"
#include "llinventorymodel.h"
#include "llnotifications.h" #include "llnotifications.h"
#include "llnotificationsutil.h"
#include "llresmgr.h" #include "llresmgr.h"
#include "llimview.h" #include "llimview.h"
#include "lltrans.h"
#include "llviewercontrol.h" #include "llviewercontrol.h"
#include "llviewernetwork.h"
#include "llviewerobjectlist.h" #include "llviewerobjectlist.h"
#include "llviewerwindow.h"
#include "llvoavatar.h" #include "llvoavatar.h"
#include "llavataractions.h"
#include "llimview.h" #include "llimview.h"
#include "llimpanel.h" #include "llimpanel.h"
#include "llavatarname.h"
#include "llavatarnamecache.h"
///---------------------------------------------------------------------------- ///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs /// Local function declarations, constants, enums, and typedefs
@@ -111,8 +105,6 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id,
LLAvatarTracker::LLAvatarTracker() : LLAvatarTracker::LLAvatarTracker() :
mTrackingData(NULL), mTrackingData(NULL),
mTrackedAgentValid(false), mTrackedAgentValid(false),
//mInventory(NULL),
//mInventoryObserver(NULL),
mModifyMask(0x0) mModifyMask(0x0)
{ {
} }
@@ -121,7 +113,9 @@ LLAvatarTracker::~LLAvatarTracker()
{ {
deleteTrackingData(); deleteTrackingData();
std::for_each(mObservers.begin(), mObservers.end(), DeletePointer()); std::for_each(mObservers.begin(), mObservers.end(), DeletePointer());
mObservers.clear();
std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer()); std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
mBuddyInfo.clear();
} }
void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name) void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name)
@@ -184,13 +178,13 @@ LLVector3d LLAvatarTracker::getGlobalPos()
if(!mTrackedAgentValid || !mTrackingData) return LLVector3d(); if(!mTrackedAgentValid || !mTrackingData) return LLVector3d();
LLVector3d global_pos; LLVector3d global_pos;
LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID); LLVOAvatar* av = gObjectList.findAvatar(mTrackingData->mAvatarID);
if(avatarp && !avatarp->isDead()) if(av && !av->isDead())
{ {
global_pos = avatarp->getPositionGlobal(); global_pos = av->getPositionGlobal();
// HACK - for making the tracker point above the avatar's head // HACK - for making the tracker point above the avatar's head
// rather than its groin // rather than its groin
global_pos.mdV[VZ] += 0.7f * (avatarp->mBodySize.mV[VZ] + avatarp->mAvatarOffset.mV[VZ]); global_pos.mdV[VZ] += 0.7f * (av->mBodySize.mV[VZ] + av->mAvatarOffset.mV[VZ]);
mTrackingData->mGlobalPositionEstimate = global_pos; mTrackingData->mGlobalPositionEstimate = global_pos;
} }
@@ -210,10 +204,10 @@ void LLAvatarTracker::getDegreesAndDist(F32& rot,
LLVector3d global_pos; LLVector3d global_pos;
LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID); LLViewerObject* object = gObjectList.findObject(mTrackingData->mAvatarID);
if(avatarp && !avatarp->isDead()) if(object && !object->isDead())
{ {
global_pos = avatarp->getPositionGlobal(); global_pos = object->getPositionGlobal();
mTrackingData->mGlobalPositionEstimate = global_pos; mTrackingData->mGlobalPositionEstimate = global_pos;
} }
else else
@@ -272,7 +266,7 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds)
<< ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline") << ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline")
<< ", TO: " << mBuddyInfo[agent_id]->getRightsGrantedTo() << ", TO: " << mBuddyInfo[agent_id]->getRightsGrantedTo()
<< ", FROM: " << mBuddyInfo[agent_id]->getRightsGrantedFrom() << ", FROM: " << mBuddyInfo[agent_id]->getRightsGrantedFrom()
<< llendl; << LL_ENDL;
} }
else else
{ {
@@ -282,7 +276,7 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds)
<< " [" << (e_r->isOnline() ? "Online" : "Offline") << "->" << (n_r->isOnline() ? "Online" : "Offline") << " [" << (e_r->isOnline() ? "Online" : "Offline") << "->" << (n_r->isOnline() ? "Online" : "Offline")
<< ", " << e_r->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo() << ", " << e_r->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo()
<< ", " << e_r->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo() << ", " << e_r->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo()
<< "]" << llendl; << "]" << LL_ENDL;
} }
} }
notifyObservers(); notifyObservers();
@@ -315,6 +309,7 @@ void LLAvatarTracker::terminateBuddy(const LLUUID& id)
msg->nextBlock("ExBlock"); msg->nextBlock("ExBlock");
msg->addUUID("OtherID", id); msg->addUUID("OtherID", id);
gAgent.sendReliableMessage(); gAgent.sendReliableMessage();
addChangedMask(LLFriendObserver::REMOVE, id); addChangedMask(LLFriendObserver::REMOVE, id);
delete buddy; delete buddy;
} }
@@ -345,7 +340,7 @@ void LLAvatarTracker::setBuddyOnline(const LLUUID& id, bool is_online)
else else
{ {
llwarns << "!! No buddy info found for " << id llwarns << "!! No buddy info found for " << id
<< ", setting to " << (is_online ? "Online" : "Offline") << llendl; << ", setting to " << (is_online ? "Online" : "Offline") << LL_ENDL;
} }
} }
@@ -462,7 +457,7 @@ void LLAvatarTracker::findAgent()
msg->nextBlockFast(_PREHASH_AgentBlock); msg->nextBlockFast(_PREHASH_AgentBlock);
msg->addUUIDFast(_PREHASH_Hunter, gAgentID); msg->addUUIDFast(_PREHASH_Hunter, gAgentID);
msg->addUUIDFast(_PREHASH_Prey, mTrackingData->mAvatarID); msg->addUUIDFast(_PREHASH_Prey, mTrackingData->mAvatarID);
msg->addU32Fast(_PREHASH_SpaceIP, 0); // will get filled in by simulator msg->addIPAddrFast(_PREHASH_SpaceIP, 0); // will get filled in by simulator // <alchemy/>
msg->nextBlockFast(_PREHASH_LocationBlock); msg->nextBlockFast(_PREHASH_LocationBlock);
const F64 NO_LOCATION = 0.0; const F64 NO_LOCATION = 0.0;
msg->addF64Fast(_PREHASH_GlobalX, NO_LOCATION); msg->addF64Fast(_PREHASH_GlobalX, NO_LOCATION);
@@ -640,20 +635,40 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg)
{ {
std::string fullname; std::string fullname;
LLSD args; LLSD args;
if (LLAvatarNameCache::getPNSName(agent_id, fullname)) if (LLAvatarNameCache::getNSName(agent_id, fullname))
args["NAME"] = fullname; args["NAME"] = fullname;
LLSD payload; LLSD payload;
payload["from_id"] = agent_id; payload["from_id"] = agent_id;
if(LLRelationship::GRANT_MODIFY_OBJECTS & new_rights) if(LLRelationship::GRANT_MODIFY_OBJECTS & new_rights)
{ {
LLNotificationsUtil::add("GrantedModifyRights",args, payload); LLNotifications::instance().add("GrantedModifyRights",args, payload);
} }
else else
{ {
LLNotificationsUtil::add("RevokedModifyRights",args, payload); LLNotifications::instance().add("RevokedModifyRights",args, payload);
} }
} }
// <Alchemy>
if ((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MAP_LOCATION)
{
std::string fullname;
LLSD args;
if (LLAvatarNameCache::getNSName(agent_id, fullname))
args["NAME"] = fullname;
LLSD payload;
payload["from_id"] = agent_id;
if (LLRelationship::GRANT_MAP_LOCATION & new_rights)
{
LLNotifications::instance().add("GrantedMapRights", args, payload);
}
else
{
LLNotifications::instance().add("RevokedMapRights", args, payload);
}
}
// </Alchemy>
(mBuddyInfo[agent_id])->setRightsFrom(new_rights); (mBuddyInfo[agent_id])->setRightsFrom(new_rights);
} }
} }
@@ -697,7 +712,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
else else
{ {
llwarns << "Received online notification for unknown buddy: " llwarns << "Received online notification for unknown buddy: "
<< agent_id << " is " << (online ? "ONLINE" : "OFFLINE") << llendl; << agent_id << " is " << (online ? "ONLINE" : "OFFLINE") << LL_ENDL;
} }
if(tracking_id == agent_id) if(tracking_id == agent_id)
@@ -711,9 +726,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
if(chat_notify) if(chat_notify)
{ {
// Look up the name of this agent for the notification // Look up the name of this agent for the notification
LLAvatarNameCache::get(agent_id, LLAvatarNameCache::get(agent_id,boost::bind(&on_avatar_name_cache_notify,_1, _2, online, payload));
boost::bind(&on_avatar_name_cache_notify,
_1, _2, online, payload));
} }
mModifyMask |= LLFriendObserver::ONLINE; mModifyMask |= LLFriendObserver::ONLINE;
@@ -729,22 +742,33 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id,
{ {
// Popup a notify box with online status of this agent // Popup a notify box with online status of this agent
// Use display name only because this user is your friend // Use display name only because this user is your friend
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
LLSD args; LLSD args;
args["NAME"] = name; args["NAME"] = av_name.getNSName();
args["STATUS"] = online ? LLTrans::getString("OnlineStatus") : LLTrans::getString("OfflineStatus");
// Popup a notify box with online status of this agent // Popup a notify box with online status of this agent
LLNotificationPtr notification = LLNotificationsUtil::add(online ? "FriendOnline" : "FriendOffline", args, payload); LLNotificationPtr notification;
if (online)
{
notification =
LLNotifications::instance().add("FriendOnlineOffline",
args,
payload,
boost::bind(&LLAvatarActions::startIM, agent_id));
}
else
{
notification =
LLNotifications::instance().add("FriendOnlineOffline", args, payload);
}
// If there's an open IM session with this agent, send a notification there too. // If there's an open IM session with this agent, send a notification there too.
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id); if (LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(session_id))
if (floater)
{ {
std::string notifyMsg = notification->getMessage(); std::string notify_msg = notification->getMessage();
if (!notifyMsg.empty()) if (!notify_msg.empty())
floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor")); floater->addHistoryLine(notify_msg, gSavedSettings.getColor4("SystemChatColor"));
} }
} }
@@ -812,7 +836,7 @@ void LLTrackingData::agentFound(const LLUUID& prey,
if(prey != mAvatarID) if(prey != mAvatarID)
{ {
llwarns << "LLTrackingData::agentFound() - found " << prey llwarns << "LLTrackingData::agentFound() - found " << prey
<< " but looking for " << mAvatarID << llendl; << " but looking for " << mAvatarID << LL_ENDL;
} }
mHaveInfo = true; mHaveInfo = true;
mAgentGone.setTimerExpirySec(OFFLINE_SECONDS); mAgentGone.setTimerExpirySec(OFFLINE_SECONDS);
@@ -821,8 +845,8 @@ void LLTrackingData::agentFound(const LLUUID& prey,
bool LLTrackingData::haveTrackingInfo() bool LLTrackingData::haveTrackingInfo()
{ {
LLVOAvatar* avatarp = gObjectList.findAvatar(mAvatarID); LLViewerObject* object = gObjectList.findObject(mAvatarID);
if(avatarp && !avatarp->isDead()) if(object && !object->isDead())
{ {
mCoarseLocationTimer.checkExpirationAndReset(COARSE_FREQUENCY); mCoarseLocationTimer.checkExpirationAndReset(COARSE_FREQUENCY);
mUpdateTimer.setTimerExpirySec(FIND_FREQUENCY); mUpdateTimer.setTimerExpirySec(FIND_FREQUENCY);
@@ -876,7 +900,7 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship
{ {
LLAvatarName av_name; LLAvatarName av_name;
LLAvatarNameCache::get( buddy_id, &av_name); LLAvatarNameCache::get( buddy_id, &av_name);
buddy_map_t::value_type value(av_name.mDisplayName, buddy_id); buddy_map_t::value_type value(av_name.getDisplayName(), buddy_id);
if(buddy->isOnline() && buddy->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) if(buddy->isOnline() && buddy->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION))
{ {
mMappable.insert(value); mMappable.insert(value);
@@ -898,7 +922,9 @@ bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship*
const S32& friend_name_system(); const S32& friend_name_system();
bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy)
{ {
LLAvatarNameCache::getPNSName(buddy_id, mFullName, friend_name_system()); LLAvatarName av_name;
LLAvatarNameCache::get(buddy_id, &av_name);
mFullName = av_name.getNSName(friend_name_system());
buddy_map_t::value_type value(mFullName, buddy_id); buddy_map_t::value_type value(mFullName, buddy_id);
if(buddy->isOnline()) if(buddy->isOnline())
{ {
@@ -910,5 +936,3 @@ bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* bud
} }
return true; return true;
} }

View File

@@ -41,8 +41,20 @@ LLExternalEditor::EErrorCode LLExternalEditor::setCommand(const std::string& env
std::string cmd = findCommand(env_var, override); std::string cmd = findCommand(env_var, override);
if (cmd.empty()) if (cmd.empty())
{ {
llwarns << "Editor command is empty or not set" << llendl; #if LL_WINDOWS
return EC_NOT_SPECIFIED; cmd = getenv("COMSPEC") + std::string(" /C START \"%s\"");
#elif LL_DARWIN
cmd = "/usr/bin/open \"%s\"";
#elif LL_LINUX
// xdg-open might not actually be installed on all distros, but it's our best bet.
cmd = "/usr/bin/xdg-open \"%s\"";
#endif
cmd = findCommand(LLStringUtil::null, cmd);
if (cmd.empty())
{
llwarns << "Failed to find generic open handler." << llendl;
return EC_NOT_SPECIFIED;
}
} }
// Add the filename marker if missing. // Add the filename marker if missing.

View File

@@ -170,12 +170,6 @@ LLFloaterAbout::LLFloaterAbout()
LLViewerRegion* region = gAgent.getRegion(); LLViewerRegion* region = gAgent.getRegion();
if (region) if (region)
{ {
LLStyleSP server_link_style(new LLStyle);
server_link_style->setVisible(true);
server_link_style->setFontName(LLStringUtil::null);
server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes"));
server_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
// [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10) // [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10)
if (RlvActions::canShowLocation()) if (RlvActions::canShowLocation())
{ {
@@ -209,7 +203,14 @@ LLFloaterAbout::LLFloaterAbout()
support.append("\n"); support.append("\n");
support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);
const std::string url(region->getCapability("ServerReleaseNotes"));
if (!url.empty())
{
LLStyleSP server_link_style(new LLStyle(*viewer_link_style));
server_link_style->setLinkHREF(url);
support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);
}
support = "\n\n"; support = "\n\n";
} }

View File

@@ -546,7 +546,7 @@ void LLFloaterAvatarList::updateAvatarList()
const LLUUID& avid = avatar_ids[i]; const LLUUID& avid = avatar_ids[i];
std::string name; std::string name;
static const LLCachedControl<S32> namesystem("RadarNameSystem"); static const LLCachedControl<S32> namesystem("RadarNameSystem");
if (!LLAvatarNameCache::getPNSName(avid, name, namesystem)) continue; //prevent (Loading...) if (!LLAvatarNameCache::getNSName(avid, name, namesystem)) continue; //prevent (Loading...)
LLVector3d position = positions[i]; LLVector3d position = positions[i];
@@ -622,9 +622,8 @@ void LLFloaterAvatarList::expireAvatarList()
for(av_list_t::iterator it = mAvatars.begin(); it != mAvatars.end();) for(av_list_t::iterator it = mAvatars.begin(); it != mAvatars.end();)
{ {
LLAvatarListEntry* entry = it->get(); LLAvatarListEntry* entry = it->get();
if (!entry->isDead()) if (entry->getAlive() && !entry->isDead())
{ {
entry->getAlive();
++it; ++it;
} }
else else

View File

@@ -53,6 +53,7 @@
#include "lldraghandle.h" #include "lldraghandle.h"
#include "message.h" #include "message.h"
//#include "llsdserialize.h"
//put it back as a member once the legacy path is out? //put it back as a member once the legacy path is out?
static std::map<LLUUID, LLAvatarName> sAvatarNameMap; static std::map<LLUUID, LLAvatarName> sAvatarNameMap;
@@ -333,9 +334,9 @@ void LLFloaterAvatarPicker::populateNearMe()
else else
{ {
element["columns"][0]["column"] = "name"; element["columns"][0]["column"] = "name";
element["columns"][0]["value"] = av_name.mDisplayName; element["columns"][0]["value"] = av_name.getDisplayName();
element["columns"][1]["column"] = "username"; element["columns"][1]["column"] = "username";
element["columns"][1]["value"] = av_name.mUsername; element["columns"][1]["value"] = av_name.getUserName();
sAvatarNameMap[av] = av_name; sAvatarNameMap[av] = av_name;
} }
@@ -514,7 +515,6 @@ protected:
else else
{ {
llwarns << "avatar picker failed " << dumpResponse() << LL_ENDL; llwarns << "avatar picker failed " << dumpResponse() << LL_ENDL;
} }
} }
@@ -670,8 +670,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
// Not for us // Not for us
if (agent_id != gAgent.getID()) return; if (agent_id != gAgent.getID()) return;
if (!instanceExists()) return; LLFloaterAvatarPicker* floater = instanceExists() ? getInstance() : NULL;
LLFloaterAvatarPicker* floater = getInstance();
// floater is closed or these are not results from our last request // floater is closed or these are not results from our last request
if (NULL == floater || query_id != floater->mQueryID) if (NULL == floater || query_id != floater->mQueryID)
@@ -713,9 +712,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
found_one = TRUE; found_one = TRUE;
LLAvatarName av_name; LLAvatarName av_name;
av_name.mLegacyFirstName = first_name; av_name.fromString(avatar_name);
av_name.mLegacyLastName = last_name;
av_name.mDisplayName = avatar_name;
const LLUUID& agent_id = avatar_id; const LLUUID& agent_id = avatar_id;
sAvatarNameMap[agent_id] = av_name; sAvatarNameMap[agent_id] = av_name;

View File

@@ -75,6 +75,7 @@
// //
LLColor4 agent_chat_color(const LLUUID& id, const std::string&, bool local_chat = true); LLColor4 agent_chat_color(const LLUUID& id, const std::string&, bool local_chat = true);
LLColor4 get_text_color(const LLChat& chat, bool from_im = false); LLColor4 get_text_color(const LLChat& chat, bool from_im = false);
void show_log_browser(const std::string&, const std::string&);
// //
// Member Functions // Member Functions
@@ -89,12 +90,10 @@ LLFloaterChat::LLFloaterChat(const LLSD& seed)
// do not automatically open singleton floaters (as result of getInstance()) // do not automatically open singleton floaters (as result of getInstance())
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chat_history.xml", &getFactoryMap(), /*no_open =*/false); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chat_history.xml", &getFactoryMap(), /*no_open =*/false);
childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes LLTextEditor* history_editor_with_mute = getChild<LLTextEditor>("Chat History Editor with mute");
//childSetCommitCallback("translate chat",onClickToggleTranslateChat,this); getChild<LLUICtrl>("show mutes")->setCommitCallback(boost::bind(&LLFloaterChat::onClickToggleShowMute, this, _2, getChild<LLTextEditor>("Chat History Editor"), history_editor_with_mute));
//childSetValue("translate chat", gSavedSettings.getBOOL("TranslateChat")); history_editor_with_mute->setVisible(false);
childSetVisible("Chat History Editor with mute",FALSE); getChild<LLUICtrl>("chat_history_open")->setCommitCallback(boost::bind(show_log_browser, "chat", "chat"));
childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this);
childSetAction("chat_history_open", onClickChatHistoryOpen, this);
} }
LLFloaterChat::~LLFloaterChat() LLFloaterChat::~LLFloaterChat()
@@ -104,16 +103,7 @@ LLFloaterChat::~LLFloaterChat()
void LLFloaterChat::draw() void LLFloaterChat::draw()
{ {
// enable say and shout only when text available mChatPanel->refresh();
mToggleActiveSpeakersBtn->setValue(mPanel->getVisible());
LLChatBar* chat_barp = mChatPanel;
if (chat_barp)
{
chat_barp->refresh();
}
mPanel->refreshSpeakers(); mPanel->refreshSpeakers();
LLFloater::draw(); LLFloater::draw();
} }
@@ -122,22 +112,12 @@ BOOL LLFloaterChat::postBuild()
{ {
mPanel = getChild<LLParticipantList>("active_speakers_panel"); mPanel = getChild<LLParticipantList>("active_speakers_panel");
LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE); getChild<LLUICtrl>("toggle_active_speakers_btn")->setCommitCallback(boost::bind(&LLFloaterChat::onClickToggleActiveSpeakers, this, _2));
if (chat_barp)
{
chat_barp->setGestureCombo(getChild<LLComboBox>( "Gesture"));
}
mToggleActiveSpeakersBtn.connect(this,"toggle_active_speakers_btn");
mChatPanel.connect(this,"chat_panel"); mChatPanel.connect(this,"chat_panel");
mChatPanel->setGestureCombo(getChild<LLComboBox>( "Gesture"));
return TRUE; return TRUE;
} }
void LLFloaterChat::onOpen()
{
gSavedSettings.setBOOL("ShowChatHistory", true);
}
// public virtual // public virtual
void LLFloaterChat::onClose(bool app_quitting) void LLFloaterChat::onClose(bool app_quitting)
{ {
@@ -169,8 +149,7 @@ void LLFloaterChat::onFocusReceived()
if (getVisible() && chat_editor->getVisible()) if (getVisible() && chat_editor->getVisible())
{ {
gFocusMgr.setKeyboardFocus(chat_editor); gFocusMgr.setKeyboardFocus(chat_editor);
chat_editor->setFocus(true);
chat_editor->setFocus(TRUE);
} }
LLFloater::onFocusReceived(); LLFloater::onFocusReceived();
@@ -213,10 +192,14 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
chat.mURL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str()); chat.mURL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str());
} }
if(chat.mSourceType == CHAT_SOURCE_OBJECT && !chat.mFromName.length()) if (chat.mSourceType == CHAT_SOURCE_OBJECT)
{ {
chat.mFromName = LLTrans::getString("Unnamed"); LLStringUtil::trim(chat.mFromName);
line = chat.mFromName + line; if (!chat.mFromName.length())
{
chat.mFromName = LLTrans::getString("Unnamed");
line = chat.mFromName + line;
}
} }
static const LLCachedControl<bool> italicize("LiruItalicizeActions"); static const LLCachedControl<bool> italicize("LiruItalicizeActions");
@@ -227,7 +210,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
{ {
std::string start_line = line.substr(0, chat.mFromName.length() + 1); std::string start_line = line.substr(0, chat.mFromName.length() + 1);
line = line.substr(chat.mFromName.length() + 1); line = line.substr(chat.mFromName.length() + 1);
LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL); LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID, chat.mURL);
sourceStyle->mItalic = is_irc; sourceStyle->mItalic = is_irc;
edit->appendStyledText(start_line, false, prepend_newline, sourceStyle); edit->appendStyledText(start_line, false, prepend_newline, sourceStyle);
prepend_newline = false; prepend_newline = false;
@@ -240,13 +223,13 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
void log_chat_text(const LLChat& chat) void log_chat_text(const LLChat& chat)
{ {
std::string histstr; std::string histstr;
if (gSavedPerAccountSettings.getBOOL("LogChatTimestamp")) if (gSavedPerAccountSettings.getBOOL("LogChatTimestamp"))
histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText; histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText;
else else
histstr = chat.mText; histstr = chat.mText;
LLLogChat::saveHistory(std::string("chat"),histstr); LLLogChat::saveHistory(std::string("chat"), histstr);
} }
// static // static
void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
@@ -275,7 +258,7 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
} }
// [/RLVa:KB] // [/RLVa:KB]
if ( gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file) if (gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file)
{ {
log_chat_text(chat); log_chat_text(chat);
} }
@@ -298,8 +281,8 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
// could flash the chat button in the status bar here. JC // could flash the chat button in the status bar here. JC
LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD()); LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD());
LLViewerTextEditor* history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor"); LLViewerTextEditor* history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor");
LLViewerTextEditor* history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute"); LLViewerTextEditor* history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute");
history_editor->setParseHTML(TRUE); history_editor->setParseHTML(TRUE);
history_editor_with_mute->setParseHTML(TRUE); history_editor_with_mute->setParseHTML(TRUE);
@@ -347,72 +330,12 @@ void LLFloaterChat::setHistoryCursorAndScrollToEnd()
} }
//static
void LLFloaterChat::onClickMute(void *data)
{
LLFloaterChat* self = (LLFloaterChat*)data;
LLComboBox* chatter_combo = self->getChild<LLComboBox>("chatter combobox");
const std::string& name = chatter_combo->getSimple();
LLUUID id = chatter_combo->getCurrentID();
if (name.empty()) return;
LLMute mute(id);
mute.setFromDisplayName(name);
LLMuteList::getInstance()->add(mute);
LLFloaterMute::showInstance();
}
//static //static
void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data) void LLFloaterChat::onClickToggleShowMute(bool show_mute, LLTextEditor* history_editor, LLTextEditor* history_editor_with_mute)
{ {
LLFloaterChat* floater = (LLFloaterChat*)data; history_editor->setVisible(!show_mute);
history_editor_with_mute->setVisible(show_mute);
(show_mute ? history_editor_with_mute : history_editor)->setCursorAndScrollToEnd();
//LLCheckBoxCtrl*
BOOL show_mute = floater->getChild<LLCheckBoxCtrl>("show mutes")->get();
LLViewerTextEditor* history_editor = floater->getChild<LLViewerTextEditor>("Chat History Editor");
LLViewerTextEditor* history_editor_with_mute = floater->getChild<LLViewerTextEditor>("Chat History Editor with mute");
if (!history_editor || !history_editor_with_mute)
return;
//BOOL show_mute = floater->mShowMuteCheckBox->get();
if (show_mute)
{
history_editor->setVisible(FALSE);
history_editor_with_mute->setVisible(TRUE);
history_editor_with_mute->setCursorAndScrollToEnd();
}
else
{
history_editor->setVisible(TRUE);
history_editor_with_mute->setVisible(FALSE);
history_editor->setCursorAndScrollToEnd();
}
}
// Update the "TranslateChat" pref after "translate chat" checkbox is toggled in
// the "Local Chat" floater.
//static
void LLFloaterChat::onClickToggleTranslateChat(LLUICtrl* caller, void *data)
{
LLFloaterChat* floater = (LLFloaterChat*)data;
BOOL translate_chat = floater->getChild<LLCheckBoxCtrl>("translate chat")->get();
gSavedSettings.setBOOL("TranslateChat", translate_chat);
}
// Update the "translate chat" checkbox after the "TranslateChat" pref is set in
// some other place (e.g. prefs dialog).
//static
void LLFloaterChat::updateSettings()
{
BOOL translate_chat = gSavedSettings.getBOOL("TranslateChat");
LLFloaterChat::getInstance(LLSD())->getChild<LLCheckBoxCtrl>("translate chat")->set(translate_chat);
} }
// Put a line of chat in all the right places // Put a line of chat in all the right places
@@ -596,24 +519,24 @@ LLColor4 get_text_color(const LLChat& chat, bool from_im)
//static //static
void LLFloaterChat::loadHistory() void LLFloaterChat::loadHistory()
{ {
LLLogChat::loadHistory(std::string("chat"), &chatFromLogFile, (void *)LLFloaterChat::getInstance(LLSD())); LLLogChat::loadHistory("chat", &chatFromLogFile, (void*)LLFloaterChat::getInstance());
} }
//static //static
void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , std::string line, void* userdata) void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata)
{ {
switch (type) switch (type)
{ {
case LLLogChat::LOG_EMPTY: case LLLogChat::LOG_EMPTY:
if (gSavedPerAccountSettings.getBOOL("LogChat"))
addChatHistory(static_cast<LLFloaterChat*>(userdata)->getString("IM_logging_string"), false);
break;
case LLLogChat::LOG_END: case LLLogChat::LOG_END:
// *TODO: nice message from XML file here if (gSavedPerAccountSettings.getBOOL("LogChat"))
addChatHistory(static_cast<LLFloaterChat*>(userdata)->getString("IM_end_log_string"), false);
break; break;
case LLLogChat::LOG_LINE: case LLLogChat::LOG_LINE:
{ addChatHistory(line, FALSE);
LLChat chat;
chat.mText = line;
addChatHistory(chat, FALSE);
}
break; break;
default: default:
// nothing // nothing
@@ -630,29 +553,18 @@ void* LLFloaterChat::createSpeakersPanel(void* data)
//static //static
void* LLFloaterChat::createChatPanel(void* data) void* LLFloaterChat::createChatPanel(void* data)
{ {
LLChatBar* chatp = new LLChatBar(); return new LLChatBar;
return chatp;
} }
// static // static
void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) void LLFloaterChat::onClickToggleActiveSpeakers(const LLSD& val)
{ {
LLFloaterChat* self = (LLFloaterChat*)userdata;
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
self->childSetVisible("active_speakers_panel", mPanel->setVisible(val && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
(!self->childIsVisible("active_speakers_panel")) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) );
// [/RLVa:KB] // [/RLVa:KB]
//self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); //mPanel->setVisible(val);
} }
void show_log_browser(const std::string& name = "chat", const std::string& id = "chat");
// static
void LLFloaterChat::onClickChatHistoryOpen(void* userdata)
{
show_log_browser();
}
//static //static
bool LLFloaterChat::visible(LLFloater* instance, const LLSD& key) bool LLFloaterChat::visible(LLFloater* instance, const LLSD& key)

View File

@@ -40,17 +40,9 @@
#include "llfloater.h" #include "llfloater.h"
#include "lllogchat.h" #include "lllogchat.h"
class LLButton;
class LLChat; class LLChat;
class LLComboBox;
class LLLineEditor;
class LLViewerTextEditor;
class LLMessageSystem;
class LLUUID;
class LLCheckBoxCtrl;
class LLParticipantList;
class LLLogChat;
class LLChatBar; class LLChatBar;
class LLParticipantList;
class LLFloaterChat class LLFloaterChat
: public LLFloater, public LLUISingleton<LLFloaterChat, LLFloaterChat> : public LLFloater, public LLUISingleton<LLFloaterChat, LLFloaterChat>
@@ -61,13 +53,11 @@ public:
virtual void draw(); virtual void draw();
virtual BOOL postBuild(); virtual BOOL postBuild();
virtual void onOpen();
virtual void onClose(bool app_quitting); virtual void onClose(bool app_quitting);
virtual void onFocusReceived(); virtual void onFocusReceived();
virtual void handleVisibilityChange(BOOL cur_visibility); virtual void handleVisibilityChange(BOOL cur_visibility);
virtual void setMinimized(BOOL); virtual void setMinimized(BOOL);
void updateConsoleVisibility(); void updateConsoleVisibility();
void updateSettings();
static void setHistoryCursorAndScrollToEnd(); static void setHistoryCursorAndScrollToEnd();
@@ -80,12 +70,9 @@ public:
static void triggerAlerts(const std::string& text); static void triggerAlerts(const std::string& text);
static void onClickMute(void *data); void onClickToggleShowMute(bool show_mute, class LLTextEditor* history_editor, LLTextEditor* history_editor_with_mute);
static void onClickToggleShowMute(LLUICtrl* caller, void *data); void onClickToggleActiveSpeakers(const LLSD& val);
static void onClickToggleTranslateChat(LLUICtrl* caller, void *data); static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata);
static void onClickToggleActiveSpeakers(void* userdata);
static void onClickChatHistoryOpen(void* userdata);
static void chatFromLogFile(LLLogChat::ELogLineType type,std::string line, void* userdata);
static void loadHistory(); static void loadHistory();
static void* createSpeakersPanel(void* data); static void* createSpeakersPanel(void* data);
static void* createChatPanel(void* data); static void* createChatPanel(void* data);
@@ -100,7 +87,6 @@ public:
BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE ); BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
CachedUICtrl<LLButton> mToggleActiveSpeakersBtn;
CachedUICtrl<LLChatBar> mChatPanel; CachedUICtrl<LLChatBar> mChatPanel;
}; };

View File

@@ -38,6 +38,7 @@
#include "llagentcamera.h" #include "llagentcamera.h"
#include "llagentwearables.h" #include "llagentwearables.h"
#include "llappearancemgr.h" #include "llappearancemgr.h"
#include "llflyoutbutton.h"
#include "llmakeoutfitdialog.h" #include "llmakeoutfitdialog.h"
#include "llmorphview.h" #include "llmorphview.h"
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
@@ -154,11 +155,9 @@ LLFloaterCustomize::~LLFloaterCustomize()
// virtual // virtual
BOOL LLFloaterCustomize::postBuild() BOOL LLFloaterCustomize::postBuild()
{ {
mMakeOutfitBtn = getChild<LLUICtrl>("Make Outfit"); mMakeOutfitBtn = getChild<LLFlyoutButton>("Make Outfit");
getChild<LLUICtrl>("Make Outfit")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this)); mMakeOutfitBtn->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this, _2));
mSaveOutfitBtn = getChild<LLUICtrl>("Save Outfit"); refreshCurrentOutfitName(); // Initialize flyout list entry for save outfit
mSaveOutfitBtn->setCommitCallback(boost::bind(&LLAppearanceMgr::updateBaseOutfit, LLAppearanceMgr::getInstance()));
refreshCurrentOutfitName(); // Initialize tooltip for save outfit button
getChild<LLUICtrl>("Ok")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnOk, this)); getChild<LLUICtrl>("Ok")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnOk, this));
getChild<LLUICtrl>("Cancel")->setCommitCallback(boost::bind(&LLFloater::onClickClose, this)); getChild<LLUICtrl>("Cancel")->setCommitCallback(boost::bind(&LLFloater::onClickClose, this));
@@ -201,11 +200,11 @@ BOOL LLFloaterCustomize::postBuild()
void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name) void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name)
{ {
// Set current outfit status (wearing/unsaved). // Set current outfit status (wearing/unsaved).
bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); //bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty();
//std::string cof_status_str = getString(dirty ? "Unsaved Changes" : "Now Wearing"); //std::string cof_status_str = getString(dirty ? "Unsaved Changes" : "Now Wearing");
//mOutfitStatus->setText(cof_status_str); //mOutfitStatus->setText(cof_status_str);
mSaveOutfitBtn->setEnabled(dirty); // No use saving unless dirty
mMakeOutfitBtn->remove(0);
if (name.empty()) if (name.empty())
{ {
std::string outfit_name; std::string outfit_name;
@@ -214,22 +213,21 @@ void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name)
//mCurrentLookName->setText(outfit_name); //mCurrentLookName->setText(outfit_name);
LLStringUtil::format_map_t args; LLStringUtil::format_map_t args;
args["[OUTFIT]"] = outfit_name; args["[OUTFIT]"] = outfit_name;
mSaveOutfitBtn->setToolTip(getString("Save changes to", args)); mMakeOutfitBtn->add(getString("Save changes to", args), LLSD(true));
return; return;
} }
std::string string_name = gAgentWearables.isCOFChangeInProgress() ? "Changing outfits" : "No Outfit"; std::string string_name = gAgentWearables.isCOFChangeInProgress() ? "Changing outfits" : "No Outfit";
//mCurrentLookName->setText(getString(string_name)); //mCurrentLookName->setText(getString(string_name));
mSaveOutfitBtn->setToolTip(getString(string_name)); mMakeOutfitBtn->add(getString(string_name), LLSD());
//mOpenOutfitBtn->setEnabled(FALSE); //mOpenOutfitBtn->setEnabled(FALSE);
mSaveOutfitBtn->setEnabled(false); // Can't save right now
} }
else else
{ {
//mCurrentLookName->setText(name); //mCurrentLookName->setText(name);
LLStringUtil::format_map_t args; LLStringUtil::format_map_t args;
args["[OUTFIT]"] = name; args["[OUTFIT]"] = name;
mSaveOutfitBtn->setToolTip(getString("Save changes to", args)); mMakeOutfitBtn->add(getString("Save changes to", args), LLSD(true));
// Can't just call update verbs since the folder link may not have been created yet. // Can't just call update verbs since the folder link may not have been created yet.
//mOpenOutfitBtn->setEnabled(TRUE); //mOpenOutfitBtn->setEnabled(TRUE);
} }
@@ -539,9 +537,12 @@ void LLFloaterCustomize::onBtnOk()
close(false); close(false);
} }
void LLFloaterCustomize::onBtnMakeOutfit() void LLFloaterCustomize::onBtnMakeOutfit(const LLSD& val)
{ {
new LLMakeOutfitDialog(true); // LLMakeOutfitDialog deletes itself. if (val && LLAppearanceMgr::instance().isOutfitDirty()) // No use saving unless dirty
LLAppearanceMgr::instance().updateBaseOutfit();
else
new LLMakeOutfitDialog(true); // LLMakeOutfitDialog deletes itself.
} }
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////

View File

@@ -99,7 +99,7 @@ public:
private: private:
// Callbacks // Callbacks
void onBtnOk(); void onBtnOk();
void onBtnMakeOutfit(); void onBtnMakeOutfit(const LLSD& val);
void onBtnImport(); void onBtnImport();
void onBtnImport_continued(AIFilePicker* filepicker); void onBtnImport_continued(AIFilePicker* filepicker);
void onBtnExport(); void onBtnExport();
@@ -120,7 +120,7 @@ private:
LLScrollingPanelList* mScrollingPanelList; LLScrollingPanelList* mScrollingPanelList;
LLScrollContainer* mScrollContainer; LLScrollContainer* mScrollContainer;
LLView *mMetricHeight, *mImperialHeight; LLView *mMetricHeight, *mImperialHeight;
LLUICtrl *mMakeOutfitBtn, *mSaveOutfitBtn; class LLFlyoutButton* mMakeOutfitBtn;
LLTabContainer* mTabContainer; LLTabContainer* mTabContainer;
LLPointer<LLVisualParamReset> mResetParams; LLPointer<LLVisualParamReset> mResetParams;

View File

@@ -40,53 +40,12 @@
#include "llagent.h" #include "llagent.h"
LLFloaterDisplayName* LLFloaterDisplayName::sInstance = NULL; LLFloaterDisplayName::LLFloaterDisplayName(const LLSD&)
LLFloaterDisplayName::LLFloaterDisplayName()
: LLFloater(std::string("Display Names Floater")) : LLFloater(std::string("Display Names Floater"))
{ {
LLFloaterDisplayName::sInstance = this; LLUICtrlFactory::getInstance()->buildFloater(this, "floater_display_name.xml");
} }
// virtual
LLFloaterDisplayName::~LLFloaterDisplayName()
{
LLFloaterDisplayName::sInstance = NULL;
}
BOOL LLFloaterDisplayName::postBuild()
{
childSetAction("reset_btn", onReset, this);
childSetAction("cancel_btn", onCancel, this);
childSetAction("save_btn", onSave, this);
center();
return TRUE;
}
void LLFloaterDisplayName::show()
{
if (LLFloaterDisplayName::sInstance)
{
LLFloaterDisplayName::sInstance->open(); /*Flawfinder: ignore*/
return;
}
LLFloaterDisplayName *self = new LLFloaterDisplayName();
// Builds and adds to gFloaterView
LLUICtrlFactory::getInstance()->buildFloater(self, "floater_display_name.xml");
// Fix up rectangle
self->open(); /*Flawfinder: ignore*/
}
void LLFloaterDisplayName::onOpen() void LLFloaterDisplayName::onOpen()
{ {
getChild<LLUICtrl>("display_name_editor")->clear(); getChild<LLUICtrl>("display_name_editor")->clear();
@@ -112,16 +71,10 @@ void LLFloaterDisplayName::onOpen()
std::string hour = next_update_local.asString().substr(11,2); std::string hour = next_update_local.asString().substr(11,2);
std::string minute = next_update_local.asString().substr(14,2); std::string minute = next_update_local.asString().substr(14,2);
std::string second = next_update_local.asString().substr(17,2); std::string second = next_update_local.asString().substr(17,2);
std::string next_update_string_date = std::string next_update_string_date = llformat("%s/%s/%s",year.c_str(),month.c_str(), day.c_str());
llformat("%s/%s/%s",year.c_str(),month.c_str(), std::string next_update_string_time = llformat("%s:%s:%s",hour.c_str(),minute.c_str(), second.c_str());
day.c_str()); getChild<LLUICtrl>("lockout_text")->setTextArg("[DATE]", next_update_string_date);
std::string next_update_string_time = getChild<LLUICtrl>("lockout_text")->setTextArg("[TIME]", next_update_string_time);
llformat("%s:%s:%s",hour.c_str(),minute.c_str(),
second.c_str());
getChild<LLUICtrl>("lockout_text")->setTextArg("[DATE]",
next_update_string_date);
getChild<LLUICtrl>("lockout_text")->setTextArg("[TIME]",
next_update_string_time);
getChild<LLUICtrl>("lockout_text")->setVisible(true); getChild<LLUICtrl>("lockout_text")->setVisible(true);
getChild<LLUICtrl>("save_btn")->setEnabled(false); getChild<LLUICtrl>("save_btn")->setEnabled(false);
getChild<LLUICtrl>("display_name_editor")->setEnabled(false); getChild<LLUICtrl>("display_name_editor")->setEnabled(false);
@@ -139,6 +92,16 @@ void LLFloaterDisplayName::onOpen()
} }
} }
BOOL LLFloaterDisplayName::postBuild()
{
getChild<LLUICtrl>("reset_btn")->setCommitCallback(boost::bind(&LLFloaterDisplayName::onReset, this));
getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterDisplayName::onCancel, this));
getChild<LLUICtrl>("save_btn")->setCommitCallback(boost::bind(&LLFloaterDisplayName::onSave, this));
center();
return TRUE;
}
void LLFloaterDisplayName::onCacheSetName(bool success, void LLFloaterDisplayName::onCacheSetName(bool success,
const std::string& reason, const std::string& reason,
@@ -151,10 +114,6 @@ void LLFloaterDisplayName::onCacheSetName(bool success,
LLSD args; LLSD args;
args["DISPLAY_NAME"] = content["display_name"]; args["DISPLAY_NAME"] = content["display_name"];
LLNotificationsUtil::add("SetDisplayNameSuccess", args); LLNotificationsUtil::add("SetDisplayNameSuccess", args);
// Re-fetch my name, as it may have been sanitized by the service
//LLAvatarNameCache::get(getAvatarId(),
// boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2));
return; return;
} }
@@ -167,7 +126,7 @@ void LLFloaterDisplayName::onCacheSetName(bool success,
if (!error_tag.empty() if (!error_tag.empty()
&& LLNotificationTemplates::getInstance()->templateExists(error_tag)) && LLNotificationTemplates::getInstance()->templateExists(error_tag))
{ {
LLNotifications::instance().add(error_tag); LLNotificationsUtil::add(error_tag);
return; return;
} }
@@ -186,34 +145,30 @@ void LLFloaterDisplayName::onCacheSetName(bool success,
LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
} }
void LLFloaterDisplayName::onCancel(void* data) void LLFloaterDisplayName::onCancel()
{ {
LLFloaterDisplayName* self = (LLFloaterDisplayName*)data; setVisible(false);
self->setVisible(false);
} }
void LLFloaterDisplayName::onReset(void* data) void LLFloaterDisplayName::onReset()
{ {
LLFloaterDisplayName* self = (LLFloaterDisplayName*)data; if (LLAvatarNameCache::hasNameLookupURL())
if (LLAvatarNameCache::useDisplayNames())
{ {
LLViewerDisplayName::set("", LLViewerDisplayName::set("", boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3));
boost::bind(&LLFloaterDisplayName::onCacheSetName, self, _1, _2, _3));
} }
else else
{ {
LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
} }
self->setVisible(false); setVisible(false);
} }
void LLFloaterDisplayName::onSave(void* data) void LLFloaterDisplayName::onSave()
{ {
LLFloaterDisplayName* self = (LLFloaterDisplayName*)data; std::string display_name_utf8 = getChild<LLUICtrl>("display_name_editor")->getValue().asString();
std::string display_name_utf8 = self->getChild<LLUICtrl>("display_name_editor")->getValue().asString(); std::string display_name_confirm = getChild<LLUICtrl>("display_name_confirm")->getValue().asString();
std::string display_name_confirm = self->getChild<LLUICtrl>("display_name_confirm")->getValue().asString();
if (display_name_utf8.compare(display_name_confirm)) if (display_name_utf8.compare(display_name_confirm))
{ {
@@ -231,17 +186,16 @@ void LLFloaterDisplayName::onSave(void* data)
return; return;
} }
if (LLAvatarNameCache::useDisplayNames()) if (LLAvatarNameCache::hasNameLookupURL())
{ {
LLViewerDisplayName::set(display_name_utf8, LLViewerDisplayName::set(display_name_utf8, boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3));
boost::bind(&LLFloaterDisplayName::onCacheSetName, self, _1, _2, _3));
} }
else else
{ {
LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
} }
self->setVisible(false); setVisible(false);
} }

View File

@@ -28,24 +28,21 @@
class LLFloaterDisplayName : public LLFloater class LLFloaterDisplayName : public LLFloater
, public LLFloaterSingleton<LLFloaterDisplayName>
{ {
public: public:
LLFloaterDisplayName(); LLFloaterDisplayName(const LLSD&);
virtual ~LLFloaterDisplayName(); virtual ~LLFloaterDisplayName() { }
/*virtual*/ BOOL postBuild(); /*virtual*/ BOOL postBuild();
static void onSave(void* data); void onSave();
static void onReset(void* data); void onReset();
static void onCancel(void* data); void onCancel();
static void show();
/*virtual*/ void onOpen(); /*virtual*/ void onOpen();
private: private:
void onCacheSetName(bool success, void onCacheSetName(bool success,
const std::string& reason, const std::string& reason,
const LLSD& content); const LLSD& content);
protected:
static LLFloaterDisplayName* sInstance;
}; };

View File

@@ -330,9 +330,7 @@ const S32& friend_name_system()
static void update_friend_item(LLScrollListItem* item, const LLAvatarName& avname) static void update_friend_item(LLScrollListItem* item, const LLAvatarName& avname)
{ {
std::string name; item->getColumn(1)->setValue(avname.getNSName(friend_name_system()));
LLAvatarNameCache::getPNSName(avname, name, friend_name_system());
item->getColumn(1)->setValue(name);
} }
void LLPanelFriends::addFriend(const LLUUID& agent_id) void LLPanelFriends::addFriend(const LLUUID& agent_id)
@@ -343,7 +341,7 @@ void LLPanelFriends::addFriend(const LLUUID& agent_id)
bool isOnline = relation_info->isOnline(); bool isOnline = relation_info->isOnline();
std::string fullname; std::string fullname;
bool have_name = LLAvatarNameCache::getPNSName(agent_id, fullname, friend_name_system()); bool have_name = LLAvatarNameCache::getNSName(agent_id, fullname, friend_name_system());
if (!have_name) gCacheName->getFullName(agent_id, fullname); if (!have_name) gCacheName->getFullName(agent_id, fullname);
LLScrollListItem::Params element; LLScrollListItem::Params element;
@@ -353,7 +351,6 @@ void LLPanelFriends::addFriend(const LLUUID& agent_id)
static const LLCachedControl<LLColor4> sDefaultColor(gColors, "DefaultListText"); static const LLCachedControl<LLColor4> sDefaultColor(gColors, "DefaultListText");
static const LLCachedControl<LLColor4> sMutedColor("AscentMutedColor"); static const LLCachedControl<LLColor4> sMutedColor("AscentMutedColor");
friend_column.color(LLAvatarActions::isBlocked(agent_id) ? sMutedColor : sDefaultColor); friend_column.color(LLAvatarActions::isBlocked(agent_id) ? sMutedColor : sDefaultColor);
element.columns.add(friend_column);
LLScrollListCell::Params cell; LLScrollListCell::Params cell;
cell.column("icon_online_status").type("icon"); cell.column("icon_online_status").type("icon");
@@ -417,7 +414,7 @@ void LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh
bool isOnline = info->isOnline(); bool isOnline = info->isOnline();
std::string fullname; std::string fullname;
if (LLAvatarNameCache::getPNSName(agent_id, fullname, friend_name_system())) if (LLAvatarNameCache::getNSName(agent_id, fullname, friend_name_system()))
{ {
itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(info->getChangeSerialNum()); itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(info->getChangeSerialNum());
} }
@@ -847,7 +844,7 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke comm
{ {
LLSD args; LLSD args;
std::string fullname; std::string fullname;
if (LLAvatarNameCache::getPNSName(rights.begin()->first, fullname, friend_name_system())) if (LLAvatarNameCache::getNSName(rights.begin()->first, fullname, friend_name_system()))
args["NAME"] = fullname; args["NAME"] = fullname;
LLNotificationsUtil::add(command == GRANT ? "GrantModifyRights" : "RevokeModifyRights", LLNotificationsUtil::add(command == GRANT ? "GrantModifyRights" : "RevokeModifyRights",

View File

@@ -182,20 +182,27 @@ LLPanelGroups::~LLPanelGroups()
gAgent.removeListener(this); gAgent.removeListener(this);
} }
void LLPanelGroups::setTexts()
{
LLUICtrl* ctrl(getChild<LLUICtrl>("groupcount"));
size_t count(gAgent.mGroups.size());
ctrl->setTextArg("[COUNT]", llformat("%d", count));
int maxgroups(gHippoLimits->getMaxAgentGroups());
ctrl->setTextArg("[MAX]", llformat("%d", maxgroups));
ctrl->setTextArg("[LEFT]", llformat("%d", maxgroups - count));
}
// clear the group list, and get a fresh set of info. // clear the group list, and get a fresh set of info.
void LLPanelGroups::reset() void LLPanelGroups::reset()
{ {
getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size())); setTexts();
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups()));
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID()); init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID());
enableButtons(); enableButtons();
} }
BOOL LLPanelGroups::postBuild() BOOL LLPanelGroups::postBuild()
{ {
getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size())); setTexts();
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",gHippoLimits->getMaxAgentGroups()));
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("group list"); LLScrollListCtrl *list = getChild<LLScrollListCtrl>("group list");
if (list) if (list)

View File

@@ -106,6 +106,9 @@ protected:
// initialize based on the type // initialize based on the type
BOOL postBuild(); BOOL postBuild();
// set the text displays
void setTexts();
// highlight_id is a group id to highlight // highlight_id is a group id to highlight
void enableButtons(); void enableButtons();

View File

@@ -239,54 +239,57 @@ void LLFloaterInspect::refresh()
// actual name and set a placeholder. // actual name and set a placeholder.
if (LLAvatarNameCache::get(idOwner, &av_name)) if (LLAvatarNameCache::get(idOwner, &av_name))
{ {
// owner_name = av_name.getCompleteName(); // owner_name = av_name.getNSName();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a // [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idOwner != gAgent.getID()) && bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idOwner != gAgent.getID()) &&
(!obj->mPermissions->isGroupOwned()); (!obj->mPermissions->isGroupOwned());
owner_name = (!fRlvFilterOwner) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); owner_name = (!fRlvFilterOwner) ? av_name.getNSName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB] // [/RLVa:KB]
} }
else else
{ {
owner_name = LLTrans::getString("RetrievingData"); owner_name = LLTrans::getString("RetrievingData");
LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::dirty, this)); if (mOwnerNameCacheConnection.find(idOwner) == mOwnerNameCacheConnection.end())
} mOwnerNameCacheConnection.emplace(idOwner, LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::onGetOwnerNameCallback, this, _1)));
if (LLAvatarNameCache::get(idCreator, &av_name))
{
// creator_name = av_name.getCompleteName();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
const LLUUID& idCreator = obj->mPermissions->getCreator();
LLAvatarNameCache::get(idCreator, &av_name);
bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idCreator != gAgent.getID()) &&
( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) );
creator_name = (!fRlvFilterCreator) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
}
else
{
creator_name = LLTrans::getString("RetrievingData");
LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::dirty, this));
} }
// <edit> // <edit>
if (LLAvatarNameCache::get(idLastOwner, &av_name)) if (LLAvatarNameCache::get(idLastOwner, &av_name))
{ {
// last_owner_name = av_name.getCompleteName(); // last_owner_name = av_name.getNSName();
// [RLVa:LF] - Copied from the above creator check Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a // [RLVa:LF] - Copied from the above creator check Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
LLAvatarNameCache::get(idLastOwner, &av_name); LLAvatarNameCache::get(idLastOwner, &av_name);
bool fRlvFilterLastOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idLastOwner != gAgent.getID()) && bool fRlvFilterLastOwner = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && idLastOwner != gAgent.getID() &&
( (obj->mPermissions->getOwner() == idLastOwner) || (RlvUtil::isNearbyAgent(idLastOwner)) ); (obj->mPermissions->getOwner() == idLastOwner || RlvUtil::isNearbyAgent(idLastOwner));
last_owner_name = (!fRlvFilterLastOwner) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); last_owner_name = (!fRlvFilterLastOwner) ? av_name.getNSName() : RlvStrings::getAnonym(av_name);
// [/RLVa:LF] // [/RLVa:LF]
} }
else else
{ {
last_owner_name = LLTrans::getString("RetrievingData"); last_owner_name = LLTrans::getString("RetrievingData");
LLAvatarNameCache::get(idLastOwner, boost::bind(&LLFloaterInspect::dirty, this)); if (mLastOwnerNameCacheConnection.find(idLastOwner) == mLastOwnerNameCacheConnection.end())
mLastOwnerNameCacheConnection.emplace(idLastOwner, LLAvatarNameCache::get(idLastOwner, boost::bind(&LLFloaterInspect::onGetLastOwnerNameCallback, this, _1)));
} }
// </edit> // </edit>
if (LLAvatarNameCache::get(idCreator, &av_name))
{
// creator_name = av_name.getNSName();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
const LLUUID& idCreator = obj->mPermissions->getCreator();
LLAvatarNameCache::get(idCreator, &av_name);
bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idCreator != gAgent.getID()) &&
( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) );
creator_name = (!fRlvFilterCreator) ? av_name.getNSName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
}
else
{
creator_name = LLTrans::getString("RetrievingData");
if (mCreatorNameCacheConnection.find(idCreator) == mCreatorNameCacheConnection.end())
mCreatorNameCacheConnection.emplace(idCreator, LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetCreatorNameCallback, this, _1)));
}
row["id"] = obj->getObject()->getID(); row["id"] = obj->getObject()->getID();
row["columns"][0]["column"] = "object_name"; row["columns"][0]["column"] = "object_name";
row["columns"][0]["type"] = "text"; row["columns"][0]["type"] = "text";
@@ -321,8 +324,8 @@ void LLFloaterInspect::refresh()
row["columns"][5]["value"] = llformat("%d",obj->getObject()->getNumVertices()); row["columns"][5]["value"] = llformat("%d",obj->getObject()->getNumVertices());
// inventory silliness // inventory silliness
S32 scripts,total_inv; S32 scripts,total_inv;
std::map<LLUUID,std::pair<S32,S32> >::iterator itr = mInventoryNums.find(obj->getObject()->getID()); std::map<LLUUID,std::pair<U32,U32> >::iterator itr = mInventoryNums.find(obj->getObject()->getID());
if(itr != mInventoryNums.end()) if (itr != mInventoryNums.end())
{ {
scripts = itr->second.first; scripts = itr->second.first;
total_inv = itr->second.second; total_inv = itr->second.second;
@@ -331,10 +334,10 @@ void LLFloaterInspect::refresh()
{ {
scripts = 0; scripts = 0;
total_inv = 0; total_inv = 0;
if(std::find(mQueue.begin(),mQueue.end(),obj->getObject()->getID()) == mQueue.end()) if (std::find(mQueue.begin(),mQueue.end(),obj->getObject()->getID()) == mQueue.end())
{ {
mQueue.push_back(obj->getObject()->getID()); mQueue.push_back(obj->getObject()->getID());
registerVOInventoryListener(obj->getObject(),NULL); registerVOInventoryListener(obj->getObject(), NULL);
requestVOInventory(); requestVOInventory();
} }
} }
@@ -365,23 +368,19 @@ void LLFloaterInspect::refresh()
} }
// <edit> // <edit>
void LLFloaterInspect::inventoryChanged(LLViewerObject* viewer_object, LLInventoryObject::object_list_t* inv, S32, void* q_id) void LLFloaterInspect::inventoryChanged(LLViewerObject* viewer_object, LLInventoryObject::object_list_t* inv, S32, void*)
{ {
std::vector<LLUUID>::iterator iter = std::find(mQueue.begin(),mQueue.end(),viewer_object->getID()); std::vector<LLUUID>::iterator iter = std::find(mQueue.begin(),mQueue.end(),viewer_object->getID());
if (viewer_object && inv && iter != mQueue.end() ) if (viewer_object && inv && iter != mQueue.end())
{ {
S32 scripts = 0; U32 scripts = 0;
LLInventoryObject::object_list_t::const_iterator end = inv->end(); LLInventoryObject::object_list_t::const_iterator end = inv->end();
for (LLInventoryObject::object_list_t::const_iterator it = inv->begin(); it != end; ++it) for (LLInventoryObject::object_list_t::const_iterator it = inv->begin(); it != end; ++it)
{ if ((*it)->getType() == LLAssetType::AT_LSL_TEXT)
if((*it)->getType() == LLAssetType::AT_LSL_TEXT)
{
++scripts; ++scripts;
}
}
mInventoryNums[viewer_object->getID()] = std::make_pair(scripts,inv->size()); mInventoryNums[viewer_object->getID()] = std::make_pair(scripts,inv->size());
mQueue.erase(iter); mQueue.erase(iter);
mDirty = TRUE; setDirty();
} }
} }
// </edit> // </edit>
@@ -401,6 +400,24 @@ void LLFloaterInspect::dirty()
setDirty(); setDirty();
} }
void LLFloaterInspect::onGetOwnerNameCallback(const LLUUID& id)
{
mOwnerNameCacheConnection.erase(id);
setDirty();
}
void LLFloaterInspect::onGetLastOwnerNameCallback(const LLUUID& id)
{
mLastOwnerNameCacheConnection.erase(id);
setDirty();
}
void LLFloaterInspect::onGetCreatorNameCallback(const LLUUID& id)
{
mCreatorNameCacheConnection.erase(id);
setDirty();
}
void LLFloaterInspect::draw() void LLFloaterInspect::draw()
{ {
if (mDirty) if (mDirty)

View File

@@ -38,6 +38,7 @@
#include "llavatarname.h" #include "llavatarname.h"
#include "llfloater.h" #include "llfloater.h"
#include "llvoinventorylistener.h" #include "llvoinventorylistener.h"
#include <boost/container/map.hpp>
//class LLTool; //class LLTool;
class LLObjectSelection; class LLObjectSelection;
@@ -72,14 +73,21 @@ protected:
// </edit> // </edit>
private: private:
LLFloaterInspect(const LLSD&); void onGetOwnerNameCallback(const LLUUID& id);
void onGetLastOwnerNameCallback(const LLUUID& id); // <edit/>
void onGetCreatorNameCallback(const LLUUID& id);
LLFloaterInspect(const LLSD& key);
virtual ~LLFloaterInspect(void); virtual ~LLFloaterInspect(void);
LLSafeHandle<LLObjectSelection> mObjectSelection; LLSafeHandle<LLObjectSelection> mObjectSelection;
// <edit> // <edit>
std::map<LLUUID,std::pair<S32,S32> > mInventoryNums; //<scripts,total> std::map<LLUUID,std::pair<U32,U32> > mInventoryNums; //<scripts,total>
std::vector<LLUUID> mQueue; std::vector<LLUUID> mQueue;
// </edit> // </edit>
boost::container::map<LLUUID, boost::signals2::scoped_connection> mOwnerNameCacheConnection;
boost::container::map<LLUUID, boost::signals2::scoped_connection> mLastOwnerNameCacheConnection; // <edit/>
boost::container::map<LLUUID, boost::signals2::scoped_connection> mCreatorNameCacheConnection;
}; };
#endif //LL_LLFLOATERINSPECT_H #endif //LL_LLFLOATERINSPECT_H

View File

@@ -58,32 +58,37 @@
// LLFloaterObjectIMInfo // LLFloaterObjectIMInfo
LLFloaterObjectIMInfo::LLFloaterObjectIMInfo(const LLSD& seed) LLFloaterObjectIMInfo::LLFloaterObjectIMInfo(const LLSD& seed)
: mObjectID(), mName(), mSLurl(), mOwnerID(), mGroupOwned(false) : mName(), mSLurl(), mOwnerID(), mGroupOwned(false)
{ {
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_object_im_info.xml"); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_object_im_info.xml");
if (getRect().mLeft == 0 if (!getRect().mLeft && !getRect().mBottom)
&& getRect().mBottom == 0)
{
center(); center();
}
} }
BOOL LLFloaterObjectIMInfo::postBuild(void) static void show_avatar_profile(const LLUUID& id)
{ {
childSetAction("Mute",onClickMute,this); // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g
childSetActionTextbox("OwnerName",onClickOwner, this); if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || !RlvUtil::isNearbyAgent(id))
childSetActionTextbox("Slurl",onClickMap, this); return;
// [/RLVa:KB]
LLAvatarActions::showProfile(id);
}
BOOL LLFloaterObjectIMInfo::postBuild()
{
getChild<LLUICtrl>("Mute")->setCommitCallback(boost::bind(&LLFloaterObjectIMInfo::onClickMute, this));
getChild<LLTextBox>("OwnerName")->setClickedCallback(boost::bind(boost::ref(mGroupOwned) ? boost::bind(LLGroupActions::show, boost::ref(mOwnerID)) : boost::bind(show_avatar_profile, boost::ref(mOwnerID))));
getChild<LLTextBox>("Slurl")->setClickedCallback(boost::bind(LLUrlAction::showLocationOnMap, "secondlife://" + static_cast<std::string>(boost::ref(mSLurl))));
return true; return true;
} }
void LLFloaterObjectIMInfo::update(LLSD& data) void LLFloaterObjectIMInfo::update(const LLSD& data)
{ {
// Extract appropriate object information from input LLSD // Extract appropriate object information from input LLSD
// (Eventually, it might be nice to query server for details // (Eventually, it might be nice to query server for details
// rather than require caller to pass in the information.) // rather than require caller to pass in the information.)
mObjectID = data["object_id"].asUUID();
mName = data["name"].asString(); mName = data["name"].asString();
mOwnerID = data["owner_id"].asUUID(); mOwnerID = data["owner_id"].asUUID();
mGroupOwned = data["group_owned"].asBoolean(); mGroupOwned = data["group_owned"].asBoolean();
@@ -100,7 +105,8 @@ void LLFloaterObjectIMInfo::update(LLSD& data)
childSetText("ObjectName",mName); childSetText("ObjectName",mName);
childSetText("Slurl",mSLurl); childSetText("Slurl",mSLurl);
childSetText("OwnerName",std::string("")); childSetText("OwnerName", LLStringUtil::null);
getChildView("ObjectID")->setValue(data["object_id"].asUUID());
// bool my_object = (owner_id == gAgentID); // bool my_object = (owner_id == gAgentID);
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g
@@ -108,77 +114,43 @@ void LLFloaterObjectIMInfo::update(LLSD& data)
// [/RLVa:KB] // [/RLVa:KB]
childSetEnabled("Mute",!my_object); childSetEnabled("Mute",!my_object);
if (gCacheName) gCacheName->get(mOwnerID,mGroupOwned,boost::bind(&LLFloaterObjectIMInfo::nameCallback,this,_1,_2,_3)); if (gCacheName)
gCacheName->get(mOwnerID, mGroupOwned, boost::bind(&LLFloaterObjectIMInfo::nameCallback, this, _2));
} }
//static void LLFloaterObjectIMInfo::onClickMute()
void LLFloaterObjectIMInfo::onClickMap(void* data)
{ {
LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
std::string url = "secondlife://" + self->mSLurl;
LLUrlAction::showLocationOnMap(url);
}
//static
void LLFloaterObjectIMInfo::onClickOwner(void* data)
{
LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
if (self->mGroupOwned)
{
LLGroupActions::show(self->mOwnerID);
}
// else
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g
else if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (!RlvUtil::isNearbyAgent(self->mOwnerID)) ) if (!mGroupOwned && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && RlvUtil::isNearbyAgent(mOwnerID))
// [/RLVa:KB]
{
LLAvatarActions::showProfile(self->mOwnerID);
}
}
//static
void LLFloaterObjectIMInfo::onClickMute(void* data)
{
LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
LLMute::EType mute_type = (self->mGroupOwned) ? LLMute::GROUP : LLMute::AGENT;
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g
if ( (LLMute::GROUP != mute_type) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(self->mOwnerID)) )
{
return; return;
}
// [/RLVa:KB] // [/RLVa:KB]
LLMute mute(self->mOwnerID, self->mName, mute_type); LLMuteList::instance().add(LLMute(mOwnerID, mName, mGroupOwned ? LLMute::GROUP : LLMute::AGENT));
LLMuteList::getInstance()->add(mute);
LLFloaterMute::showInstance(); LLFloaterMute::showInstance();
self->close(); close();
} }
//static //static
void LLFloaterObjectIMInfo::nameCallback(const LLUUID& id, const std::string& full_name, bool is_group) void LLFloaterObjectIMInfo::nameCallback(const std::string& full_name)
{ {
mName = full_name; childSetText("OwnerName", mName =
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g
if ( (!is_group) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(id)) ) (!mGroupOwned && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && RlvUtil::isNearbyAgent(mOwnerID)) ? RlvStrings::getAnonym(mName) :
{
mName = RlvStrings::getAnonym(mName);
}
// [/RLVa:KB] // [/RLVa:KB]
full_name);
childSetText("OwnerName", mName);
} }
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// LLObjectIMInfoHandler // LLObjectIMHandler
//moved to llchathistory.cpp in v2 //moved to llchathistory.cpp in v2
class LLObjectIMInfoHandler : public LLCommandHandler // support for secondlife:///app/objectim/{UUID}/ SLapps
class LLObjectIMHandler : public LLCommandHandler
{ {
public: public:
LLObjectIMInfoHandler() : LLCommandHandler("objectim", UNTRUSTED_THROTTLE) { } // requests will be throttled from a non-trusted browser
LLObjectIMHandler() : LLCommandHandler("objectim", UNTRUSTED_THROTTLE) { }
bool handle(const LLSD& params, const LLSD& query_map,LLMediaCtrl* web) bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
{ {
if (params.size() < 1) if (params.size() < 1)
{ {
@@ -197,12 +169,8 @@ public:
payload["name"] = query_map["name"]; payload["name"] = query_map["name"];
payload["slurl"] = LLWeb::escapeURL(query_map["slurl"]); payload["slurl"] = LLWeb::escapeURL(query_map["slurl"]);
payload["group_owned"] = query_map["groupowned"]; payload["group_owned"] = query_map["groupowned"];
LLFloaterObjectIMInfo::showInstance()->update(payload); LLFloaterObjectIMInfo::showInstance()->update(payload);
return true; return true;
} }
}; };
LLObjectIMHandler gObjectIMHandler;
// Creating the object registers with the dispatcher.
LLObjectIMInfoHandler gObjectIMHandler;

View File

@@ -41,19 +41,16 @@ public:
LLFloaterObjectIMInfo(const LLSD& sd); LLFloaterObjectIMInfo(const LLSD& sd);
virtual ~LLFloaterObjectIMInfo() { }; virtual ~LLFloaterObjectIMInfo() { };
/*virtual*/ BOOL postBuild(void); /*virtual*/ BOOL postBuild();
void update(LLSD& payload); void update(const LLSD& payload);
// UI Handlers // UI Handlers
static void onClickMap(void* data); void onClickMute();
static void onClickOwner(void* data);
static void onClickMute(void* data);
void nameCallback(const LLUUID& id, const std::string& full_name, bool is_group); void nameCallback(const std::string& full_name);
private: private:
LLUUID mObjectID;
LLUUID mOwnerID; LLUUID mOwnerID;
std::string mSLurl; std::string mSLurl;
std::string mName; std::string mName;

View File

@@ -981,7 +981,7 @@ void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_
//static //static
void LLFloaterProperties::dirtyAll() void LLFloaterProperties::dirtyAll()
{ {
for(instance_iter it = beginInstances();it!=endInstances();++it) for(instance_iter it = beginInstances(), it_end(endInstances()); it != it_end; ++it)
{ {
it->dirty(); it->dirty();
} }

View File

@@ -1303,7 +1303,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
if(texture_ctrl) if(texture_ctrl)
{ {
lldebugs << "Detail Texture " << i << ": " lldebugs << "Detail Texture " << i << ": "
<< compp->getDetailTextureID(i) << llendl; << compp->getDetailTextureID(i) << LL_ENDL;
LLUUID tmp_id(compp->getDetailTextureID(i)); LLUUID tmp_id(compp->getDetailTextureID(i));
texture_ctrl->setImageAssetID(tmp_id); texture_ctrl->setImageAssetID(tmp_id);
} }
@@ -2260,7 +2260,7 @@ void LLPanelEstateInfo::refreshFromEstate()
const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
getChild<LLUICtrl>("estate_name")->setValue(estate_info.getName()); getChild<LLUICtrl>("estate_name")->setValue(estate_info.getName());
LLAvatarNameCache::get(estate_info.getOwnerID(), boost::bind(&LLPanelEstateInfo::setOwnerPNSName, this, _1, _2)); LLAvatarNameCache::get(estate_info.getOwnerID(), boost::bind(&LLPanelEstateInfo::setOwnerName, this, boost::bind(&LLAvatarName::getNSName, _2, main_name_system())));
getChild<LLUICtrl>("externally_visible_check")->setValue(estate_info.getIsExternallyVisible()); getChild<LLUICtrl>("externally_visible_check")->setValue(estate_info.getIsExternallyVisible());
getChild<LLUICtrl>("voice_chat_check")->setValue(estate_info.getAllowVoiceChat()); getChild<LLUICtrl>("voice_chat_check")->setValue(estate_info.getAllowVoiceChat());
@@ -2425,13 +2425,6 @@ void LLPanelEstateInfo::setOwnerName(const std::string& name)
getChild<LLUICtrl>("estate_owner")->setValue(LLSD(name)); getChild<LLUICtrl>("estate_owner")->setValue(LLSD(name));
} }
void LLPanelEstateInfo::setOwnerPNSName(const LLUUID& agent_id, const LLAvatarName& av_name)
{
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
setOwnerName(name);
}
void LLPanelEstateInfo::clearAccessLists() void LLPanelEstateInfo::clearAccessLists()
{ {
LLNameListCtrl* name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); LLNameListCtrl* name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list");

View File

@@ -322,7 +322,6 @@ public:
const std::string getOwnerName() const; const std::string getOwnerName() const;
void setOwnerName(const std::string& name); void setOwnerName(const std::string& name);
void setOwnerPNSName(const LLUUID& agent_id, const LLAvatarName& av_name);
protected: protected:
virtual BOOL sendUpdate(); virtual BOOL sendUpdate();

View File

@@ -52,7 +52,6 @@
// viewer project includes // viewer project includes
#include "llagent.h" #include "llagent.h"
#include "llagentui.h"
#include "llbutton.h" #include "llbutton.h"
#include "lltexturectrl.h" #include "lltexturectrl.h"
#include "llscrolllistctrl.h" #include "llscrolllistctrl.h"
@@ -80,14 +79,12 @@
#include "llviewernetwork.h" #include "llviewernetwork.h"
#include "llassetuploadresponders.h" #include "llassetuploadresponders.h"
#include "llagentui.h"
#include "lltrans.h" #include "lltrans.h"
const U32 INCLUDE_SCREENSHOT = 0x01 << 0; const U32 INCLUDE_SCREENSHOT = 0x01 << 0;
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy userReportResponder_timeout;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Globals // Globals
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -106,7 +103,8 @@ LLFloaterReporter::LLFloaterReporter()
mPicking( FALSE), mPicking( FALSE),
mPosition(), mPosition(),
mCopyrightWarningSeen( FALSE ), mCopyrightWarningSeen( FALSE ),
mResourceDatap(new LLResourceData()) mResourceDatap(new LLResourceData()),
mAvatarNameCacheConnection()
{ {
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml"); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml");
} }
@@ -174,6 +172,7 @@ BOOL LLFloaterReporter::postBuild()
pick_btn->setImages(std::string("UIImgFaceUUID"), pick_btn->setImages(std::string("UIImgFaceUUID"),
std::string("UIImgFaceSelectedUUID") ); std::string("UIImgFaceSelectedUUID") );
childSetAction("pick_btn", onClickObjPicker, this); childSetAction("pick_btn", onClickObjPicker, this);
childSetAction("select_abuser", boost::bind(&LLFloaterReporter::onClickSelectAbuser, this)); childSetAction("select_abuser", boost::bind(&LLFloaterReporter::onClickSelectAbuser, this));
childSetAction("send_btn", onClickSend, this); childSetAction("send_btn", onClickSend, this);
@@ -190,6 +189,11 @@ BOOL LLFloaterReporter::postBuild()
// virtual // virtual
LLFloaterReporter::~LLFloaterReporter() LLFloaterReporter::~LLFloaterReporter()
{ {
if (mAvatarNameCacheConnection.connected())
{
mAvatarNameCacheConnection.disconnect();
}
// child views automatically deleted // child views automatically deleted
mObjectID = LLUUID::null; mObjectID = LLUUID::null;
@@ -254,14 +258,6 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
if (regionp) if (regionp)
{ {
getChild<LLUICtrl>("sim_field")->setValue(regionp->getName()); getChild<LLUICtrl>("sim_field")->setValue(regionp->getName());
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
/*
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
{
childSetText("sim_field", RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
}
*/
// [/RLVa:KB]
LLVector3d global_pos; LLVector3d global_pos;
global_pos.setVec(objectp->getPositionRegion()); global_pos.setVec(objectp->getPositionRegion());
setPosBox(global_pos); setPosBox(global_pos);
@@ -315,26 +311,25 @@ void LLFloaterReporter::callbackAvatarID(const uuid_vec_t& ids, const std::vecto
void LLFloaterReporter::setFromAvatarID(const LLUUID& avatar_id) void LLFloaterReporter::setFromAvatarID(const LLUUID& avatar_id)
{ {
mAbuserID = mObjectID = avatar_id; mAbuserID = mObjectID = avatar_id;
std::string avatar_link;
if (LLAvatarNameCache::getPNSName(avatar_id, avatar_link)) if (mAvatarNameCacheConnection.connected())
{ {
getChild<LLUICtrl>("owner_name")->setValue(avatar_link); mAvatarNameCacheConnection.disconnect();
getChild<LLUICtrl>("object_name")->setValue(avatar_link);
getChild<LLUICtrl>("abuser_name_edit")->setValue(avatar_link);
return;
} }
mAvatarNameCacheConnection = LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterReporter::onAvatarNameCache, this, _1, _2));
LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterReporter::onAvatarNameCache, this, _1, _2));
} }
void LLFloaterReporter::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name) void LLFloaterReporter::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name)
{ {
std::string avatar_link; mAvatarNameCacheConnection.disconnect();
LLAvatarNameCache::getPNSName(av_name, avatar_link);
getChild<LLUICtrl>("owner_name")->setValue(avatar_link); if (mObjectID == avatar_id)
getChild<LLUICtrl>("object_name")->setValue(avatar_link); {
getChild<LLUICtrl>("abuser_name_edit")->setValue(avatar_link); mOwnerName = av_name.getNSName();
getChild<LLUICtrl>("owner_name")->setValue(av_name.getNSName());
getChild<LLUICtrl>("object_name")->setValue(av_name.getNSName());
getChild<LLUICtrl>("abuser_name_edit")->setValue(av_name.getNSName());
}
} }
@@ -472,7 +467,6 @@ void LLFloaterReporter::showFromMenu(EReportType report_type)
} }
} }
// static // static
void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name) void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name)
{ {
@@ -598,6 +592,7 @@ LLSD LLFloaterReporter::gatherReport()
const char* platform = "Lnx"; const char* platform = "Lnx";
#elif LL_SOLARIS #elif LL_SOLARIS
const char* platform = "Sol"; const char* platform = "Sol";
const char* short_platform = "O:S";
#else #else
const char* platform = "???"; const char* platform = "???";
#endif #endif
@@ -718,23 +713,24 @@ public:
/*virtual*/ char const* getName(void) const { return "LLUserReportScreenshotResponder"; } /*virtual*/ char const* getName(void) const { return "LLUserReportScreenshotResponder"; }
}; };
class LLUserReportResponder : public LLHTTPClient::ResponderWithResult class LLUserReportResponder : public LLHTTPClient::ResponderWithCompleted
{ {
LOG_CLASS(LLUserReportResponder);
public: public:
LLUserReportResponder() { } LLUserReportResponder() { }
/*virtual*/ void httpFailure(void) private:
{ void httpCompleted()
// *TODO do some user messaging here
LLUploadDialog::modalUploadFinished();
}
/*virtual*/ void httpSuccess(void)
{ {
if (!isGoodStatus(mStatus))
{
// *TODO do some user messaging here
LL_WARNS("UserReport") << dumpResponse() << LL_ENDL;
}
// we don't care about what the server returns // we don't care about what the server returns
LLUploadDialog::modalUploadFinished(); LLUploadDialog::modalUploadFinished();
} }
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return userReportResponder_timeout; } char const* getName() const { return "LLUserReportResponder"; }
/*virtual*/ char const* getName(void) const { return "LLUserReportResponder"; }
}; };
void LLFloaterReporter::sendReportViaCaps(std::string url, std::string sshot_url, const LLSD& report) void LLFloaterReporter::sendReportViaCaps(std::string url, std::string sshot_url, const LLSD& report)

View File

@@ -141,6 +141,7 @@ private:
std::list<LLMeanCollisionData*> mMCDList; std::list<LLMeanCollisionData*> mMCDList;
std::string mDefaultSummary; std::string mDefaultSummary;
LLResourceData* mResourceDatap; LLResourceData* mResourceDatap;
boost::signals2::connection mAvatarNameCacheConnection;
}; };
#endif #endif

View File

@@ -184,27 +184,33 @@ void LLPanelScriptLimitsInfo::updateChild(LLUICtrl* child_ctr)
// Responders // Responders
///---------------------------------------------------------------------------- ///----------------------------------------------------------------------------
void fetchScriptLimitsRegionInfoResponder::httpSuccess(void) void fetchScriptLimitsRegionInfoResponder::httpSuccess()
{ {
const LLSD& content = getContent();
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
//we don't need to test with a fake response here (shouldn't anyway) //we don't need to test with a fake response here (shouldn't anyway)
#ifdef DUMP_REPLIES_TO_LLINFOS #ifdef DUMP_REPLIES_TO_LLINFOS
LLSDNotationStreamer notation_streamer(mContent); LLSDNotationStreamer notation_streamer(content);
std::ostringstream nice_llsd; std::ostringstream nice_llsd;
nice_llsd << notation_streamer; nice_llsd << notation_streamer;
OSMessageBox(nice_llsd.str(), "main cap response:", 0); OSMessageBox(nice_llsd.str(), "main cap response:", 0);
llinfos << "main cap response:" << mContent << llendl; llinfos << "main cap response:" << content << LL_ENDL;
#endif #endif
// at this point we have an llsd which should contain ether one or two urls to the services we want. // at this point we have an llsd which should contain ether one or two urls to the services we want.
// first we look for the details service: // first we look for the details service:
if(mContent.has("ScriptResourceDetails")) if(content.has("ScriptResourceDetails"))
{ {
LLHTTPClient::get(mContent["ScriptResourceDetails"], new fetchScriptLimitsRegionDetailsResponder(mInfo)); LLHTTPClient::get(content["ScriptResourceDetails"], new fetchScriptLimitsRegionDetailsResponder(mInfo));
} }
else else
{ {
@@ -216,19 +222,20 @@ void fetchScriptLimitsRegionInfoResponder::httpSuccess(void)
} }
// then the summary service: // then the summary service:
if(mContent.has("ScriptResourceSummary")) if(content.has("ScriptResourceSummary"))
{ {
LLHTTPClient::get(mContent["ScriptResourceSummary"], new fetchScriptLimitsRegionSummaryResponder(mInfo)); LLHTTPClient::get(content["ScriptResourceSummary"], new fetchScriptLimitsRegionSummaryResponder(mInfo));
} }
} }
void fetchScriptLimitsRegionInfoResponder::httpFailure(void) void fetchScriptLimitsRegionInfoResponder::httpFailure()
{ {
llwarns << "fetchScriptLimitsRegionInfoResponder error [status:" << mStatus << "]: " << mReason << llendl; llwarns << dumpResponse() << LL_ENDL;
} }
void fetchScriptLimitsRegionSummaryResponder::httpSuccess(void) void fetchScriptLimitsRegionSummaryResponder::httpSuccess()
{ {
const LLSD& content_ref = getContent();
#ifdef USE_FAKE_RESPONSES #ifdef USE_FAKE_RESPONSES
LLSD fake_content; LLSD fake_content;
@@ -265,10 +272,16 @@ void fetchScriptLimitsRegionSummaryResponder::httpSuccess(void)
#else #else
const LLSD& content = mContent; const LLSD& content = content_ref;
#endif #endif
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
#ifdef DUMP_REPLIES_TO_LLINFOS #ifdef DUMP_REPLIES_TO_LLINFOS
@@ -309,13 +322,14 @@ void fetchScriptLimitsRegionSummaryResponder::httpSuccess(void)
} }
} }
void fetchScriptLimitsRegionSummaryResponder::httpFailure(void) void fetchScriptLimitsRegionSummaryResponder::httpFailure()
{ {
llwarns << "fetchScriptLimitsRegionSummaryResponder error [status:" << mStatus << "]: " << mReason << llendl; llwarns << dumpResponse() << LL_ENDL;
} }
void fetchScriptLimitsRegionDetailsResponder::httpSuccess(void) void fetchScriptLimitsRegionDetailsResponder::httpSuccess()
{ {
const LLSD& content_ref = getContent();
#ifdef USE_FAKE_RESPONSES #ifdef USE_FAKE_RESPONSES
/* /*
Updated detail service, ** denotes field added: Updated detail service, ** denotes field added:
@@ -374,10 +388,16 @@ result (map)
#else #else
const LLSD& content = mContent; const LLSD& content = content_ref;
#endif #endif
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
#ifdef DUMP_REPLIES_TO_LLINFOS #ifdef DUMP_REPLIES_TO_LLINFOS
LLSDNotationStreamer notation_streamer(content); LLSDNotationStreamer notation_streamer(content);
@@ -418,13 +438,14 @@ result (map)
} }
} }
void fetchScriptLimitsRegionDetailsResponder::httpFailure(void) void fetchScriptLimitsRegionDetailsResponder::httpFailure()
{ {
llwarns << "fetchScriptLimitsRegionDetailsResponder error [status:" << mStatus << "]: " << mReason << llendl; llwarns << dumpResponse() << LL_ENDL;
} }
void fetchScriptLimitsAttachmentInfoResponder::httpSuccess(void) void fetchScriptLimitsAttachmentInfoResponder::httpSuccess()
{ {
const LLSD& content_ref = getContent();
#ifdef USE_FAKE_RESPONSES #ifdef USE_FAKE_RESPONSES
@@ -456,16 +477,22 @@ void fetchScriptLimitsAttachmentInfoResponder::httpSuccess(void)
summary["used"] = used; summary["used"] = used;
fake_content["summary"] = summary; fake_content["summary"] = summary;
fake_content["attachments"] = mContent["attachments"]; fake_content["attachments"] = content_ref["attachments"];
const LLSD& content = fake_content; const LLSD& content = fake_content;
#else #else
const LLSD& content = mContent; const LLSD& content = content_ref;
#endif #endif
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
#ifdef DUMP_REPLIES_TO_LLINFOS #ifdef DUMP_REPLIES_TO_LLINFOS
LLSDNotationStreamer notation_streamer(content); LLSDNotationStreamer notation_streamer(content);
@@ -514,9 +541,9 @@ void fetchScriptLimitsAttachmentInfoResponder::httpSuccess(void)
} }
} }
void fetchScriptLimitsAttachmentInfoResponder::httpFailure(void) void fetchScriptLimitsAttachmentInfoResponder::httpFailure()
{ {
llwarns << "fetchScriptLimitsAttachmentInfoResponder error [status:" << mStatus << "]: " << mReason << llendl; llwarns << dumpResponse() << LL_ENDL;
} }
///---------------------------------------------------------------------------- ///----------------------------------------------------------------------------
@@ -604,7 +631,7 @@ void LLPanelScriptLimitsRegionMemory::onNameCache(
} }
std::string name; std::string name;
LLAvatarNameCache::getPNSName(id, name); LLAvatarNameCache::getNSName(id, name);
std::vector<LLSD>::iterator id_itor; std::vector<LLSD>::iterator id_itor;
for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor) for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor)
@@ -706,7 +733,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
} }
else else
{ {
name_is_cached = LLAvatarNameCache::getPNSName(owner_id, owner_buf); // username name_is_cached = LLAvatarNameCache::getNSName(owner_id, owner_buf); // username
} }
if(!name_is_cached) if(!name_is_cached)
{ {
@@ -720,30 +747,39 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
} }
} }
LLSD item_params; LLScrollListItem::Params item_params;
item_params["id"] = task_id; item_params.value = task_id;
item_params["columns"][0]["column"] = "size"; LLScrollListCell::Params cell_params;
item_params["columns"][0]["value"] = size; //cell_params.font = LLFontGL::getFontSansSerif();
item_params["columns"][1]["column"] = "urls"; cell_params.column = "size";
item_params["columns"][1]["value"] = urls; cell_params.value = size;
item_params.columns.add(cell_params);
item_params["columns"][2]["column"] = "name"; cell_params.column = "urls";
item_params["columns"][2]["value"] = name_buf; cell_params.value = urls;
item_params.columns.add(cell_params);
item_params["columns"][3]["column"] = "owner"; cell_params.column = "name";
item_params["columns"][3]["value"] = owner_buf; cell_params.value = name_buf;
item_params.columns.add(cell_params);
item_params["columns"][4]["column"] = "parcel"; cell_params.column = "owner";
item_params["columns"][4]["value"] = parcel_name; cell_params.value = owner_buf;
item_params.columns.add(cell_params);
item_params["columns"][5]["column"] = "location"; cell_params.column = "parcel";
item_params["columns"][5]["value"] = has_locations cell_params.value = parcel_name;
item_params.columns.add(cell_params);
cell_params.column = "location";
cell_params.value = has_locations
? llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z) ? llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z)
: ""; : "";
item_params.columns.add(cell_params);
list->addElement(item_params); list->addRow(item_params);
LLSD element; LLSD element;
element["owner_id"] = owner_id; element["owner_id"] = owner_id;
@@ -878,13 +914,17 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain()
} }
LLParcel* parcel = instance->getCurrentSelectedParcel(); LLParcel* parcel = instance->getCurrentSelectedParcel();
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
if (!parcel) //Pretend we have the parcel we're on selected.
LLUUID current_region_id = gAgent.getRegion()->getRegionID();
// <alchemy> Fall back to the parcel we're on if none is selected.
// Fixes parcel script info intermittently working and broken in toolbar button.
if (!parcel)
{ {
parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
region = gAgent.getRegion(); region = gAgent.getRegion();
} }
// </alchemy>
LLUUID current_region_id = gAgent.getRegion()->getRegionID();
if ((region) && (parcel)) if ((region) && (parcel))
{ {
@@ -921,7 +961,7 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain()
{ {
llwarns << "Can't get parcel info for script information request" << region_id llwarns << "Can't get parcel info for script information request" << region_id
<< ". Region: " << region->getName() << ". Region: " << region->getName()
<< " does not support RemoteParcelRequest" << llendl; << " does not support RemoteParcelRequest" << LL_ENDL;
std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError"); std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting)); getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting));

View File

@@ -545,7 +545,8 @@ void LLFloaterTools::refresh()
// Added in Link Num value -HgB // Added in Link Num value -HgB
S32 prim_count = LLSelectMgr::getInstance()->getEditSelection()->getObjectCount(); S32 prim_count = LLSelectMgr::getInstance()->getEditSelection()->getObjectCount();
std::string value_string; std::string value_string;
if ((prim_count == 1) && gSavedSettings.getBOOL("EditLinkedParts")) //Selecting a single prim in "Edit Linked" mode, show link number bool edit_linked(gSavedSettings.getBOOL("EditLinkedParts"));
if (edit_linked && prim_count == 1) //Selecting a single prim in "Edit Linked" mode, show link number
{ {
link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost(); link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost();
childSetTextArg("link_num_obj_count", "[DESC]", std::string("Link number:")); childSetTextArg("link_num_obj_count", "[DESC]", std::string("Link number:"));
@@ -573,6 +574,12 @@ void LLFloaterTools::refresh()
} }
} }
} }
else if (edit_linked)
{
childSetTextArg("link_num_obj_count", "[DESC]", std::string("Selected prims:"));
LLResMgr::getInstance()->getIntegerString(value_string, prim_count);
link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost();
}
else else
{ {
childSetTextArg("link_num_obj_count", "[DESC]", std::string("Selected objects:")); childSetTextArg("link_num_obj_count", "[DESC]", std::string("Selected objects:"));
@@ -606,7 +613,7 @@ void LLFloaterTools::refresh()
LLStringUtil::format_map_t selection_args; LLStringUtil::format_map_t selection_args;
selection_args["OBJ_COUNT"] = llformat("%.1d", prim_count); selection_args["OBJ_COUNT"] = llformat("%.1d", prim_count);
selection_args["LAND_IMPACT"] = llformat("%.1d", (S32)link_cost); selection_args["LAND_IMPACT"] = llformat(edit_linked ? "%.2f" : "%.0f", link_cost);
std::ostringstream selection_info; std::ostringstream selection_info;

View File

@@ -149,8 +149,7 @@ void LLFloaterWebContent::showInstance(const std::string& window_class, Params&
LLSD key = p; LLSD key = p;
instance_iter it = beginInstances(); for(instance_iter it(beginInstances()), it_end(endInstances()); it != it_end; ++it)
for(;it!=endInstances();++it)
{ {
if(it->mKey["window_class"].asString() == window_class) if(it->mKey["window_class"].asString() == window_class)
{ {
@@ -255,8 +254,7 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p)
std::vector<LLFloaterWebContent*> instances; std::vector<LLFloaterWebContent*> instances;
instances.reserve(instanceCount()); instances.reserve(instanceCount());
instance_iter it = beginInstances(); for(instance_iter it(beginInstances()), it_end(endInstances()); it != it_end;++it)
for(;it!=endInstances();++it)
{ {
if(it->mKey["window_class"].asString() == p.window_class.getValue()) if(it->mKey["window_class"].asString() == p.window_class.getValue())
instances.push_back(&*it); instances.push_back(&*it);

View File

@@ -68,8 +68,7 @@ void LLFloaterWebProfile::showInstance(const std::string& window_class, Params&
LLSD key = p; LLSD key = p;
instance_iter it = beginInstances(); for(instance_iter it(beginInstances()), it_end(endInstances()); it != it_end; ++it)
for(;it!=endInstances();++it)
{ {
if(it->mKey["window_class"].asString() == window_class) if(it->mKey["window_class"].asString() == window_class)
{ {

View File

@@ -57,7 +57,7 @@ public:
virtual PermissionMask getPermissionMask() const = 0; virtual PermissionMask getPermissionMask() const = 0;
virtual LLFolderType::EType getPreferredType() const = 0; virtual LLFolderType::EType getPreferredType() const = 0;
virtual LLPointer<LLUIImage> getIcon() const = 0; virtual LLPointer<LLUIImage> getIcon() const = 0;
virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); } virtual LLPointer<LLUIImage> getIconOpen() const { return getIcon(); }
virtual LLFontGL::StyleFlags getLabelStyle() const = 0; virtual LLFontGL::StyleFlags getLabelStyle() const = 0;
virtual std::string getLabelSuffix() const = 0; virtual std::string getLabelSuffix() const = 0;
virtual void openItem( void ) = 0; virtual void openItem( void ) = 0;

View File

@@ -537,7 +537,7 @@ bool LLGroupMgrGroupData::changeRoleMember(const LLUUID& role_id,
// Already recorded this change? Weird. // Already recorded this change? Weird.
llinfos << "Received duplicate change for " llinfos << "Received duplicate change for "
<< " role: " << role_id << " member " << member_id << " role: " << role_id << " member " << member_id
<< " change " << (rmc == RMC_ADD ? "ADD" : "REMOVE") << llendl; << " change " << (rmc == RMC_ADD ? "ADD" : "REMOVE") << LL_ENDL;
} }
else else
{ {
@@ -783,9 +783,12 @@ void LLGroupMgrGroupData::sendRoleChanges()
break; break;
} }
case RC_UPDATE_ALL: case RC_UPDATE_ALL:
// fall through
case RC_UPDATE_POWERS: case RC_UPDATE_POWERS:
need_power_recalc = true; need_power_recalc = true;
// fall through
case RC_UPDATE_DATA: case RC_UPDATE_DATA:
// fall through
default: default:
{ {
LLGroupRoleData* group_role_data = (*role_it).second; LLGroupRoleData* group_role_data = (*role_it).second;
@@ -1201,6 +1204,8 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
name = LLTrans::getString("group_role_owners"); name = LLTrans::getString("group_role_owners");
} }
lldebugs << "Adding role data: " << name << " {" << role_id << "}" << llendl; lldebugs << "Adding role data: " << name << " {" << role_id << "}" << llendl;
LLGroupRoleData* rd = new LLGroupRoleData(role_id,name,title,desc,powers,member_count); LLGroupRoleData* rd = new LLGroupRoleData(role_id,name,title,desc,powers,member_count);
group_datap->mRoles[role_id] = rd; group_datap->mRoles[role_id] = rd;
@@ -1474,7 +1479,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data)
} }
else else
{ {
// *TODO:translate // *TODO: Translate
LLSD args; LLSD args;
args["MESSAGE"] = message; args["MESSAGE"] = message;
LLNotificationsUtil::add("UnableToCreateGroup", args); LLNotificationsUtil::add("UnableToCreateGroup", args);
@@ -1617,6 +1622,7 @@ void LLGroupMgr::sendGroupMembersRequest(const LLUUID& group_id)
} }
} }
void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id) void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id)
{ {
lldebugs << "LLGroupMgr::sendGroupRoleDataRequest" << llendl; lldebugs << "LLGroupMgr::sendGroupRoleDataRequest" << llendl;
@@ -1652,7 +1658,7 @@ void LLGroupMgr::sendGroupRoleMembersRequest(const LLUUID& group_id)
// *TODO: KLW FIXME: Should we start a member or role data request? // *TODO: KLW FIXME: Should we start a member or role data request?
llinfos << " Pending: " << (group_datap->mPendingRoleMemberRequest ? "Y" : "N") llinfos << " Pending: " << (group_datap->mPendingRoleMemberRequest ? "Y" : "N")
<< " MemberDataComplete: " << (group_datap->mMemberDataComplete ? "Y" : "N") << " MemberDataComplete: " << (group_datap->mMemberDataComplete ? "Y" : "N")
<< " RoleDataComplete: " << (group_datap->mRoleDataComplete ? "Y" : "N") << llendl; << " RoleDataComplete: " << (group_datap->mRoleDataComplete ? "Y" : "N") << LL_ENDL;
group_datap->mPendingRoleMemberRequest = TRUE; group_datap->mPendingRoleMemberRequest = TRUE;
return; return;
} }
@@ -1885,8 +1891,6 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
bool start_message = true; bool start_message = true;
LLMessageSystem* msg = gMessageSystem; LLMessageSystem* msg = gMessageSystem;
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id); LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap) return; if (!group_datap) return;
@@ -1952,10 +1956,6 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
} }
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy groupBanDataResponder_timeout;
extern AIHTTPTimeoutPolicy groupMemberDataResponder_timeout;
// Responder class for capability group management // Responder class for capability group management
class GroupBanDataResponder : public LLHTTPClient::ResponderWithResult class GroupBanDataResponder : public LLHTTPClient::ResponderWithResult
{ {
@@ -1964,8 +1964,7 @@ public:
virtual ~GroupBanDataResponder() {} virtual ~GroupBanDataResponder() {}
virtual void httpSuccess(); virtual void httpSuccess();
virtual void httpFailure(); virtual void httpFailure();
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return groupBanDataResponder_timeout; } virtual char const* getName() const { return "GroupBanDataResponder"; }
/*virtual*/ char const* getName(void) const { return "GroupBanDataResponder"; }
private: private:
LLUUID mGroupID; LLUUID mGroupID;
BOOL mForceRefresh; BOOL mForceRefresh;
@@ -1984,18 +1983,14 @@ void GroupBanDataResponder::httpFailure()
void GroupBanDataResponder::httpSuccess() void GroupBanDataResponder::httpSuccess()
{ {
if (mContent.size()) if (mContent.has("ban_list"))
{ {
if (mContent.has("ban_list")) // group ban data received
{ LLGroupMgr::processGroupBanRequest(mContent);
// group ban data received
LLGroupMgr::processGroupBanRequest(mContent);
mForceRefresh = false;
}
} }
if (mForceRefresh) else if (mForceRefresh)
{ {
// no ban data received, refreshing data successful operation // no ban data received, refreshing data after successful operation
LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID);
} }
} }
@@ -2097,25 +2092,34 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content)
// Responder class for capability group management // Responder class for capability group management
class GroupMemberDataResponder : public LLHTTPClient::ResponderWithResult class GroupMemberDataResponder : public LLHTTPClient::ResponderWithResult
{ {
LOG_CLASS(GroupMemberDataResponder);
public: public:
GroupMemberDataResponder() {} GroupMemberDataResponder() {}
virtual ~GroupMemberDataResponder() {} virtual ~GroupMemberDataResponder() {}
/*virtual*/ void httpSuccess(void);
/*virtual*/ void httpFailure(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return groupMemberDataResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "GroupMemberDataResponder"; }
private: private:
/* virtual */ void httpSuccess();
/* virtual */ void httpFailure();
/* virtual */ char const* getName() const { return "GroupMemberDataResponder"; }
LLSD mMemberData; LLSD mMemberData;
}; };
void GroupMemberDataResponder::httpFailure(void) void GroupMemberDataResponder::httpFailure()
{ {
LL_WARNS("GrpMgr") << "Error receiving group member data." << LL_ENDL; LL_WARNS("GrpMgr") << "Error receiving group member data "
<< dumpResponse() << LL_ENDL;
} }
void GroupMemberDataResponder::httpSuccess(void) void GroupMemberDataResponder::httpSuccess()
{ {
LLGroupMgr::processCapGroupMembersRequest(mContent); const LLSD& content = getContent();
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
LLGroupMgr::processCapGroupMembersRequest(content);
} }
@@ -2164,6 +2168,7 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id)
mLastGroupMembersRequestFrame = gFrameCount; mLastGroupMembersRequestFrame = gFrameCount;
} }
// static // static
void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
{ {
@@ -2274,10 +2279,12 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
// I'm going to be dumb and just call services I most likely don't need // I'm going to be dumb and just call services I most likely don't need
// with the thought being that the system might need it to be done. // with the thought being that the system might need it to be done.
// //
// TODO: Refactor to reduce multiple calls for data we already have. // TODO:
// Refactor to reduce multiple calls for data we already have.
if (group_datap->mTitles.size() < 1) if (group_datap->mTitles.size() < 1)
LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id); LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id);
group_datap->mMemberDataComplete = true; group_datap->mMemberDataComplete = true;
group_datap->mMemberRequestID.setNull(); group_datap->mMemberRequestID.setNull();
// Make the role-member data request // Make the role-member data request
@@ -2289,8 +2296,10 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
group_datap->mChanged = TRUE; group_datap->mChanged = TRUE;
LLGroupMgr::getInstance()->notifyObservers(GC_MEMBER_DATA); LLGroupMgr::getInstance()->notifyObservers(GC_MEMBER_DATA);
} }
void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id) void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id)
{ {
lldebugs << "LLGroupMgr::sendGroupRoleChanges" << llendl; lldebugs << "LLGroupMgr::sendGroupRoleChanges" << llendl;

View File

@@ -49,6 +49,8 @@ enum LLGroupChange
GC_ALL GC_ALL
}; };
const U32 GB_MAX_BANNED_AGENTS = 500;
class LLGroupMgrObserver class LLGroupMgrObserver
{ {
public: public:
@@ -262,7 +264,7 @@ public:
const LLUUID& getMemberVersion() const { return mMemberVersion; } const LLUUID& getMemberVersion() const { return mMemberVersion; }
void clearBanList() { mBanList.clear(); } void clearBanList() { mBanList.clear(); }
void getBanList(const LLUUID& ban_i, const LLGroupBanData& ban_data = LLGroupBanData()); void getBanList(const LLUUID& group_id, LLGroupBanData& ban_data);
const LLGroupBanData& getBanEntry(const LLUUID& ban_id) { return mBanList[ban_id]; } const LLGroupBanData& getBanEntry(const LLUUID& ban_id) { return mBanList[ban_id]; }
void createBanEntry(const LLUUID& ban_id, const LLGroupBanData& ban_data = LLGroupBanData()); void createBanEntry(const LLUUID& ban_id, const LLGroupBanData& ban_data = LLGroupBanData());

View File

@@ -285,7 +285,7 @@ void LLHoverView::updateText()
{ {
// [/RLVa:KB] // [/RLVa:KB]
std::string complete_name; std::string complete_name;
if (!LLAvatarNameCache::getPNSName(hit_object->getID(), complete_name)) if (!LLAvatarNameCache::getNSName(hit_object->getID(), complete_name))
complete_name = firstname->getString() + std::string(" ") + lastname->getString(); complete_name = firstname->getString() + std::string(" ") + lastname->getString();
if (title) if (title)
@@ -408,7 +408,7 @@ void LLHoverView::updateText()
{ {
line.append(LLTrans::getString("TooltipPublic")); line.append(LLTrans::getString("TooltipPublic"));
} }
else if(LLAvatarNameCache::getPNSName(owner, name)) else if (LLAvatarNameCache::getNSName(owner, name))
{ {
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))

View File

@@ -550,7 +550,7 @@ void LLHUDEffectLookAt::render()
static const LLCachedControl<S32> lookAtNames("LookAtNameSystem"); static const LLCachedControl<S32> lookAtNames("LookAtNameSystem");
if (lookAtNames < 0) return; if (lookAtNames < 0) return;
std::string text; std::string text;
if (!LLAvatarNameCache::getPNSName(static_cast<LLVOAvatar*>(mSourceObject.get())->getID(), text, lookAtNames)) return; if (!LLAvatarNameCache::getNSName(static_cast<LLVOAvatar*>(mSourceObject.get())->getID(), text, lookAtNames)) return;
if (text.length() > 9 && 0 == text.compare(text.length() - 9, 9, " Resident")) if (text.length() > 9 && 0 == text.compare(text.length() - 9, 9, " Resident"))
text.erase(text.length() - 9); text.erase(text.length() - 9);
LLVector3 offset = gAgentCamera.getCameraPositionAgent() - target; LLVector3 offset = gAgentCamera.getCameraPositionAgent() - target;

View File

@@ -69,7 +69,6 @@
// [/RLVa:KB] // [/RLVa:KB]
class AIHTTPTimeoutPolicy; class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy startConferenceChatResponder_timeout;
extern AIHTTPTimeoutPolicy sessionInviteResponder_timeout; extern AIHTTPTimeoutPolicy sessionInviteResponder_timeout;
// //
@@ -172,7 +171,7 @@ public:
mAgents = agents_to_invite; mAgents = agents_to_invite;
} }
/*virtual*/ void httpFailure(void) /*virtual*/ void httpFailure()
{ {
//try an "old school" way. //try an "old school" way.
if ( mStatus == 400 ) if ( mStatus == 400 )
@@ -191,9 +190,7 @@ public:
//and it is not worth the effort switching over all //and it is not worth the effort switching over all
//the possible different language translations //the possible different language translations
} }
/*virtual*/ char const* getName() const { return "LLStartConferenceChatResponder"; }
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return startConferenceChatResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLStartConferenceChatResponder"; }
private: private:
LLUUID mTempSessionID; LLUUID mTempSessionID;
@@ -347,6 +344,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(
case IM_SESSION_P2P_INVITE: case IM_SESSION_P2P_INVITE:
mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mLogLabel, mOtherParticipantUUID); mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mLogLabel, mOtherParticipantUUID);
LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this); LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this);
LLMuteList::instance().addObserver(this);
mDing = gSavedSettings.getBOOL("LiruNewMessageSoundIMsOn"); mDing = gSavedSettings.getBOOL("LiruNewMessageSoundIMsOn");
break; break;
default: default:
@@ -401,11 +399,9 @@ LLFloaterIMPanel::LLFloaterIMPanel(
void LLFloaterIMPanel::onAvatarNameLookup(const LLAvatarName& avatar_name) void LLFloaterIMPanel::onAvatarNameLookup(const LLAvatarName& avatar_name)
{ {
std::string title; setTitle(avatar_name.getNSName());
LLAvatarNameCache::getPNSName(avatar_name, title);
setTitle(title);
const S32& ns(gSavedSettings.getS32("IMNameSystem")); const S32& ns(gSavedSettings.getS32("IMNameSystem"));
LLAvatarNameCache::getPNSName(avatar_name, title, ns); std::string title(avatar_name.getNSName(ns));
if (!ns || ns == 3) // Remove Resident, if applicable. if (!ns || ns == 3) // Remove Resident, if applicable.
{ {
size_t pos(title.find(" Resident")); size_t pos(title.find(" Resident"));
@@ -420,6 +416,7 @@ void LLFloaterIMPanel::onAvatarNameLookup(const LLAvatarName& avatar_name)
LLFloaterIMPanel::~LLFloaterIMPanel() LLFloaterIMPanel::~LLFloaterIMPanel()
{ {
LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this); LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this);
LLMuteList::instance().removeObserver(this);
delete mSpeakers; delete mSpeakers;
mSpeakers = NULL; mSpeakers = NULL;
@@ -465,6 +462,13 @@ void LLFloaterIMPanel::changed(U32 mask)
*/ */
} }
// virtual
void LLFloaterIMPanel::onChangeDetailed(const LLMute& mute)
{
if (mute.mID == mOtherParticipantUUID)
rebuildDynamics(getChild<LLComboBox>("instant_message_flyout"));
}
// virtual // virtual
BOOL LLFloaterIMPanel::postBuild() BOOL LLFloaterIMPanel::postBuild()
{ {
@@ -640,20 +644,14 @@ void LLFloaterIMPanel::draw()
class LLSessionInviteResponder : public LLHTTPClient::ResponderIgnoreBody class LLSessionInviteResponder : public LLHTTPClient::ResponderIgnoreBody
{ {
public: public:
LLSessionInviteResponder(const LLUUID& session_id) LLSessionInviteResponder(const LLUUID& session_id) : mSessionID(session_id) {}
{
mSessionID = session_id;
}
/*virtual*/ void httpFailure(void) /*virtual*/ void httpFailure()
{ {
llwarns << "Error inviting all agents to session [status:" llwarns << "Error inviting all agents to session [status:" << mStatus << "]: " << mReason << llendl;
<< mStatus << "]: " << mReason << llendl;
//throw something back to the viewer here? //throw something back to the viewer here?
} }
/*virtual*/ char const* getName() const { return "LLSessionInviteResponder"; }
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return sessionInviteResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLSessionInviteResponder"; }
private: private:
LLUUID mSessionID; LLUUID mSessionID;
@@ -705,38 +703,38 @@ bool LLFloaterIMPanel::inviteToSession(const LLDynamicArray<LLUUID>& ids)
void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incolor, bool log_to_file, const LLUUID& source, const std::string& name) void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incolor, bool log_to_file, const LLUUID& source, const std::string& name)
{ {
static const LLCachedControl<bool> mKeywordsChangeColor(gSavedPerAccountSettings, "KeywordsChangeColor", false); bool is_agent(gAgentID == source), from_user(source.notNull());
static const LLCachedControl<LLColor4> mKeywordsColor(gSavedPerAccountSettings, "KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f)); if (!is_agent)
if (gAgentID != source)
{ {
static const LLCachedControl<bool> mKeywordsChangeColor(gSavedPerAccountSettings, "KeywordsChangeColor", false);
if (mKeywordsChangeColor) if (mKeywordsChangeColor)
{ {
if (AscentKeyword::hasKeyword(utf8msg, 2)) if (AscentKeyword::hasKeyword(utf8msg, 2))
{ {
static const LLCachedControl<LLColor4> mKeywordsColor(gSavedPerAccountSettings, "KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f));
incolor = mKeywordsColor; incolor = mKeywordsColor;
} }
} }
if (mDing && (!hasFocus() || !gFocusMgr.getAppHasFocus())) bool focused(hasFocus());
if (mDing && (!focused || !gFocusMgr.getAppHasFocus()))
{ {
static const LLCachedControl<std::string> ding("LiruNewMessageSound"); static const LLCachedControl<std::string> ding("LiruNewMessageSound");
static const LLCachedControl<std::string> dong("LiruNewMessageSoundForSystemMessages"); static const LLCachedControl<std::string> dong("LiruNewMessageSoundForSystemMessages");
LLUI::sAudioCallback(LLUUID(source.notNull() ? ding : dong)); LLUI::sAudioCallback(LLUUID(from_user ? ding : dong));
} }
}
const LLColor4& color = incolor; // start tab flashing when receiving im for background session from user
// start tab flashing when receiving im for background session from user if (from_user)
if (source.notNull())
{
LLMultiFloater* hostp = getHost();
if( !isInVisibleChain()
&& hostp
&& source != gAgentID)
{ {
hostp->setFloaterFlashing(this, TRUE); bool invisible(!isInVisibleChain());
LLMultiFloater* host = getHost();
if (invisible && host)
host->setFloaterFlashing(this, true);
if (invisible || (!host && focused))
++mNumUnreadMessages;
} }
} }
// Now we're adding the actual line of text, so erase the // Now we're adding the actual line of text, so erase the
@@ -760,15 +758,15 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol
// Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text.
if (name == SYSTEM_FROM) if (name == SYSTEM_FROM)
{ {
mHistoryEditor->appendColoredText(name,false,prepend_newline,color); mHistoryEditor->appendColoredText(name,false,prepend_newline,incolor);
} }
else else
{ {
// IRC style text starts with a colon here; empty names and system messages aren't irc style. // IRC style text starts with a colon here; empty names and system messages aren't irc style.
static const LLCachedControl<bool> italicize("LiruItalicizeActions"); static const LLCachedControl<bool> italicize("LiruItalicizeActions");
is_irc = italicize && utf8msg[0] != ':'; is_irc = italicize && utf8msg[0] != ':';
if (source.notNull()) if (from_user)
LLAvatarNameCache::getPNSName(source, show_name); LLAvatarNameCache::getNSName(source, show_name);
// Convert the name to a hotlink and add to message. // Convert the name to a hotlink and add to message.
LLStyleSP source_style = LLStyleMap::instance().lookupAgent(source); LLStyleSP source_style = LLStyleMap::instance().lookupAgent(source);
source_style->mItalic = is_irc; source_style->mItalic = is_irc;
@@ -780,9 +778,9 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol
// Append the chat message in style // Append the chat message in style
{ {
LLStyleSP style(new LLStyle); LLStyleSP style(new LLStyle);
style->setColor(color); style->setColor(incolor);
style->mItalic = is_irc; style->mItalic = is_irc;
style->mBold = gSavedSettings.getBOOL("SingularityBoldGroupModerator") && isModerator(source); style->mBold = from_user && gSavedSettings.getBOOL("SingularityBoldGroupModerator") && isModerator(source);
mHistoryEditor->appendStyledText(utf8msg, false, prepend_newline, style); mHistoryEditor->appendStyledText(utf8msg, false, prepend_newline, style);
} }
@@ -803,13 +801,8 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol
// [/Ansariel: Display name support] // [/Ansariel: Display name support]
} }
if (source.notNull()) if (from_user)
{ {
if (!isInVisibleChain() || (!hasFocus() && getParent() == gFloaterView))
{
mNumUnreadMessages++;
}
mSpeakers->speakerChatted(source); mSpeakers->speakerChatted(source);
mSpeakers->setSpeakerTyping(source, FALSE); mSpeakers->setSpeakerTyping(source, FALSE);
} }
@@ -962,7 +955,7 @@ void LLFloaterIMPanel::removeDynamics(LLComboBox* flyout)
flyout->remove(mDing ? getString("ding on") : getString("ding off")); flyout->remove(mDing ? getString("ding on") : getString("ding off"));
flyout->remove(mRPMode ? getString("rp mode on") : getString("rp mode off")); flyout->remove(mRPMode ? getString("rp mode on") : getString("rp mode off"));
flyout->remove(LLAvatarActions::isFriend(mOtherParticipantUUID) ? getString("remove friend") : getString("add friend")); flyout->remove(LLAvatarActions::isFriend(mOtherParticipantUUID) ? getString("remove friend") : getString("add friend"));
//flyout->remove(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute")); flyout->remove(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute"));
} }
void LLFloaterIMPanel::addDynamics(LLComboBox* flyout) void LLFloaterIMPanel::addDynamics(LLComboBox* flyout)
@@ -970,7 +963,7 @@ void LLFloaterIMPanel::addDynamics(LLComboBox* flyout)
flyout->add(mDing ? getString("ding on") : getString("ding off"), 6); flyout->add(mDing ? getString("ding on") : getString("ding off"), 6);
flyout->add(mRPMode ? getString("rp mode on") : getString("rp mode off"), 7); flyout->add(mRPMode ? getString("rp mode on") : getString("rp mode off"), 7);
flyout->add(LLAvatarActions::isFriend(mOtherParticipantUUID) ? getString("remove friend") : getString("add friend"), 8); flyout->add(LLAvatarActions::isFriend(mOtherParticipantUUID) ? getString("remove friend") : getString("add friend"), 8);
//flyout->add(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute"), 9); flyout->add(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute"), 9);
} }
void copy_profile_uri(const LLUUID& id, bool group = false); void copy_profile_uri(const LLUUID& id, bool group = false);
@@ -999,7 +992,7 @@ void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value)
if (option == 6) mDing = !mDing; if (option == 6) mDing = !mDing;
else if (option == 7) mRPMode = !mRPMode; else if (option == 7) mRPMode = !mRPMode;
else if (option == 8) LLAvatarActions::isFriend(mOtherParticipantUUID) ? LLAvatarActions::removeFriendDialog(mOtherParticipantUUID) : LLAvatarActions::requestFriendshipDialog(mOtherParticipantUUID); else if (option == 8) LLAvatarActions::isFriend(mOtherParticipantUUID) ? LLAvatarActions::removeFriendDialog(mOtherParticipantUUID) : LLAvatarActions::requestFriendshipDialog(mOtherParticipantUUID);
//else if (option == 9) LLAvatarActions::toggleBlock(mOtherParticipantUUID); else if (option == 9) LLAvatarActions::toggleBlock(mOtherParticipantUUID);
// Last add them back // Last add them back
addDynamics(flyout); addDynamics(flyout);
@@ -1008,15 +1001,19 @@ void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value)
void show_log_browser(const std::string& name, const std::string& id) void show_log_browser(const std::string& name, const std::string& id)
{ {
#if LL_WINDOWS || LL_DARWIN // Singu TODO: Linux? const std::string file(LLLogChat::makeLogFileName(name));
if (gSavedSettings.getBOOL("LiruLegacyLogLaunch")) if (gSavedSettings.getBOOL("LiruLegacyLogLaunch"))
{ {
gViewerWindow->getWindow()->ShellEx(LLLogChat::makeLogFileName(name)); #if LL_WINDOWS || LL_DARWIN
gViewerWindow->getWindow()->ShellEx(file);
#elif LL_LINUX
// xdg-open might not actually be installed on all distros, but it's our best bet.
if (!std::system(("/usr/bin/xdg-open \"" + file +'"').c_str())) // 0 = success, otherwise fallback on internal browser.
#endif
return; return;
} }
#endif
LLFloaterWebContent::Params p; LLFloaterWebContent::Params p;
p.url("file:///" + LLLogChat::makeLogFileName(name)); p.url("file:///" + file);
p.id(id); p.id(id);
p.show_chrome(false); p.show_chrome(false);
p.trusted_content(true); p.trusted_content(true);
@@ -1434,7 +1431,7 @@ void LLFloaterIMPanel::processIMTyping(const LLIMInfo* im_info, bool typing)
{ {
// other user started typing // other user started typing
std::string name; std::string name;
if (!LLAvatarNameCache::getPNSName(im_info->mFromID, name)) name = im_info->mName; if (!LLAvatarNameCache::getNSName(im_info->mFromID, name)) name = im_info->mName;
addTypingIndicator(name); addTypingIndicator(name);
} }
else else

View File

@@ -35,6 +35,7 @@
#include "llcallingcard.h" #include "llcallingcard.h"
#include "llfloater.h" #include "llfloater.h"
#include "lllogchat.h" #include "lllogchat.h"
#include "llmutelist.h"
class LLAvatarName; class LLAvatarName;
class LLIMSpeakerMgr; class LLIMSpeakerMgr;
@@ -46,7 +47,7 @@ class LLParticipantList;
class LLViewerTextEditor; class LLViewerTextEditor;
class LLVoiceChannel; class LLVoiceChannel;
class LLFloaterIMPanel : public LLFloater, public LLFriendObserver class LLFloaterIMPanel : public LLFloater, public LLFriendObserver, public LLMuteListObserver
{ {
public: public:
@@ -65,6 +66,8 @@ public:
void onAvatarNameLookup(const LLAvatarName& avatar_name); void onAvatarNameLookup(const LLAvatarName& avatar_name);
/*virtual*/ void changed(U32 mask); // From LLFriendObserver, check friend status /*virtual*/ void changed(U32 mask); // From LLFriendObserver, check friend status
/*virtual*/ void onChange() {}
/*virtual*/ void onChangeDetailed(const LLMute& mute); // From LLMuteListObserver, check for mute status changes for OtherParticipant
/*virtual*/ BOOL postBuild(); /*virtual*/ BOOL postBuild();
// Check typing timeout timer. // Check typing timeout timer.

View File

@@ -480,7 +480,13 @@ void LLIMMgr::addMessage(
} }
// now add message to floater // now add message to floater
const LLColor4& color = agent_chat_color(other_participant_id, from, false); LLColor4 color = agent_chat_color(other_participant_id, from, false);
if (dialog == IM_BUSY_AUTO_RESPONSE)
{
color *= .75f;
color += LLColor4::transparent*.25f;
}
if ( !link_name ) if ( !link_name )
{ {
floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally
@@ -1091,7 +1097,7 @@ void LLIMMgr::noteOfflineUsers(
std::string full_name; std::string full_name;
if (info if (info
&& !info->isOnline() && !info->isOnline()
&& LLAvatarNameCache::getPNSName(ids.get(i), full_name)) && LLAvatarNameCache::getNSName(ids.get(i), full_name))
{ {
LLUIString offline = LLTrans::getString("offline_message"); LLUIString offline = LLTrans::getString("offline_message");
offline.setArg("[NAME]", full_name); offline.setArg("[NAME]", full_name);

View File

@@ -60,11 +60,16 @@ extern LLUUID gAgentID;
using namespace LLOldEvents; using namespace LLOldEvents;
namespace LLInventoryAction
{
bool doToSelected(LLFolderView* folder, std::string action);
}
typedef LLMemberListener<LLPanelObjectInventory> object_inventory_listener_t; typedef LLMemberListener<LLPanelObjectInventory> object_inventory_listener_t;
typedef LLMemberListener<LLInventoryView> inventory_listener_t; typedef LLMemberListener<LLInventoryView> inventory_listener_t;
typedef LLMemberListener<LLInventoryPanel> inventory_panel_listener_t; typedef LLMemberListener<LLInventoryPanel> inventory_panel_listener_t;
bool doToSelected(LLFolderView* folder, std::string action) bool LLInventoryAction::doToSelected(LLFolderView* folder, std::string action)
{ {
LLInventoryModel* model = &gInventory; LLInventoryModel* model = &gInventory;
if ("rename" == action) if ("rename" == action)
@@ -136,7 +141,7 @@ class LLDoToSelectedPanel : public object_inventory_listener_t
LLFolderView* folder = panel->getRootFolder(); LLFolderView* folder = panel->getRootFolder();
if(!folder) return true; if(!folder) return true;
return doToSelected(folder, userdata.asString()); return LLInventoryAction::doToSelected(folder, userdata.asString());
} }
}; };
@@ -148,7 +153,7 @@ class LLDoToSelectedFloater : public inventory_listener_t
LLFolderView* folder = panel->getRootFolder(); LLFolderView* folder = panel->getRootFolder();
if(!folder) return true; if(!folder) return true;
return doToSelected(folder, userdata.asString()); return LLInventoryAction::doToSelected(folder, userdata.asString());
} }
}; };
@@ -160,7 +165,7 @@ class LLDoToSelected : public inventory_panel_listener_t
LLFolderView* folder = panel->getRootFolder(); LLFolderView* folder = panel->getRootFolder();
if(!folder) return true; if(!folder) return true;
return doToSelected(folder, userdata.asString()); return LLInventoryAction::doToSelected(folder, userdata.asString());
} }
}; };

View File

@@ -3008,7 +3008,7 @@ LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type)
return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE)); return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE));
} }
LLUIImagePtr LLFolderBridge::getOpenIcon() const LLUIImagePtr LLFolderBridge::getIconOpen() const
{ {
return LLUI::getUIImage(LLViewerFolderType::lookupIconName(getPreferredType(), TRUE)); return LLUI::getUIImage(LLViewerFolderType::lookupIconName(getPreferredType(), TRUE));

View File

@@ -255,7 +255,7 @@ public:
virtual LLFolderType::EType getPreferredType() const; virtual LLFolderType::EType getPreferredType() const;
virtual LLUIImagePtr getIcon() const; virtual LLUIImagePtr getIcon() const;
virtual LLUIImagePtr getOpenIcon() const; virtual LLUIImagePtr getIconOpen() const;
static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); static LLUIImagePtr getIcon(LLFolderType::EType preferred_type);
virtual BOOL renameItem(const std::string& new_name); virtual BOOL renameItem(const std::string& new_name);

View File

@@ -705,7 +705,7 @@ LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * br
return new LLFolderViewFolder( return new LLFolderViewFolder(
bridge->getDisplayName(), bridge->getDisplayName(),
bridge->getIcon(), bridge->getIcon(),
bridge->getOpenIcon(), bridge->getIconOpen(),
LLUI::getUIImage("inv_link_overlay.tga"), LLUI::getUIImage("inv_link_overlay.tga"),
mFolderRoot.get(), mFolderRoot.get(),
bridge); bridge);
@@ -716,7 +716,7 @@ LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge
return new LLFolderViewItem( return new LLFolderViewItem(
bridge->getDisplayName(), bridge->getDisplayName(),
bridge->getIcon(), bridge->getIcon(),
bridge->getOpenIcon(), bridge->getIconOpen(),
LLUI::getUIImage("inv_link_overlay.tga"), LLUI::getUIImage("inv_link_overlay.tga"),
bridge->getCreationDate(), bridge->getCreationDate(),
mFolderRoot.get(), mFolderRoot.get(),

View File

@@ -120,9 +120,6 @@ LLSD getMarketplaceStringSubstitutions()
return marketplace_sub_map; return marketplace_sub_map;
} }
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy MPImportGetResponder_timeout;
extern AIHTTPTimeoutPolicy MPImportPostResponder_timeout;
namespace LLMarketplaceImport namespace LLMarketplaceImport
{ {
@@ -194,7 +191,6 @@ namespace LLMarketplaceImport
sImportId = mContent; sImportId = mContent;
} }
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return MPImportPostResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLImportPostResponder"; } /*virtual*/ char const* getName(void) const { return "LLImportPostResponder"; }
}; };
@@ -254,7 +250,6 @@ namespace LLMarketplaceImport
sImportResults = mContent; sImportResults = mContent;
} }
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return MPImportGetResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLImportGetResponder"; } /*virtual*/ char const* getName(void) const { return "LLImportGetResponder"; }
}; };

View File

@@ -565,9 +565,12 @@ void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
if (ensureMediaSourceExists()) if (ensureMediaSourceExists())
{ {
mCurrentNavUrl = url_in; if (mCurrentNavUrl != url_in)
mMediaSource->setSize(mTextureWidth, mTextureHeight); {
mMediaSource->navigateTo(url_in, mime_type, mime_type.empty()); mCurrentNavUrl = url_in;
mMediaSource->setSize(mTextureWidth, mTextureHeight);
mMediaSource->navigateTo(url_in, mime_type, mime_type.empty());
}
} }
} }
@@ -970,6 +973,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
case MEDIA_EVENT_LOCATION_CHANGED: case MEDIA_EVENT_LOCATION_CHANGED:
{ {
LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_LOCATION_CHANGED, new uri is: " << self->getLocation() << LL_ENDL; LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_LOCATION_CHANGED, new uri is: " << self->getLocation() << LL_ENDL;
mCurrentNavUrl = self->getLocation();
}; };
break; break;

View File

@@ -116,12 +116,6 @@
// [/RLVa:LF] // [/RLVa:LF]
#include "shfloatermediaticker.h" #include "shfloatermediaticker.h"
void handle_chat()
{
// give focus to chatbar if it's open but not focused
static const LLCachedControl<bool> chat_visible("ChatVisible",true);
(chat_visible && gFocusMgr.childHasKeyboardFocus(gChatBar)) ? LLChatBar::stopChat() : LLChatBar::startChat(NULL);
}
void handle_debug_avatar_textures(void*); void handle_debug_avatar_textures(void*);
template<typename T> void handle_singleton_toggle(void*); template<typename T> void handle_singleton_toggle(void*);
void show_outfit_dialog() { new LLMakeOutfitDialog(false); } void show_outfit_dialog() { new LLMakeOutfitDialog(false); }
@@ -177,12 +171,10 @@ struct MenuFloaterDict : public LLSingleton<MenuFloaterDict>
registerFloater("build", boost::bind(toggle_build)); registerFloater("build", boost::bind(toggle_build));
registerFloater("buy currency", boost::bind(LLFloaterBuyCurrency::buyCurrency)); registerFloater("buy currency", boost::bind(LLFloaterBuyCurrency::buyCurrency));
registerFloater("buy land", boost::bind(&LLViewerParcelMgr::startBuyLand, boost::bind(LLViewerParcelMgr::getInstance), false)); registerFloater("buy land", boost::bind(&LLViewerParcelMgr::startBuyLand, boost::bind(LLViewerParcelMgr::getInstance), false));
registerFloater("chatbar", boost::bind(handle_chat));
registerFloater("complaint reporter", boost::bind(LLFloaterReporter::showFromMenu, COMPLAINT_REPORT)); registerFloater("complaint reporter", boost::bind(LLFloaterReporter::showFromMenu, COMPLAINT_REPORT));
registerFloater("DayCycle", boost::bind(LLFloaterDayCycle::show), boost::bind(LLFloaterDayCycle::isOpen)); registerFloater("DayCycle", boost::bind(LLFloaterDayCycle::show), boost::bind(LLFloaterDayCycle::isOpen));
registerFloater("debug avatar", boost::bind(handle_debug_avatar_textures, (void*)NULL)); registerFloater("debug avatar", boost::bind(handle_debug_avatar_textures, (void*)NULL));
registerFloater("debug settings", boost::bind(handle_singleton_toggle<LLFloaterSettingsDebug>, (void*)NULL)); registerFloater("debug settings", boost::bind(handle_singleton_toggle<LLFloaterSettingsDebug>, (void*)NULL));
registerFloater("displayname", boost::bind(LLFloaterDisplayName::show));
registerFloater("edit ui", boost::bind(LLFloaterEditUI::show, (void*)NULL)); registerFloater("edit ui", boost::bind(LLFloaterEditUI::show, (void*)NULL));
registerFloater("EnvSettings", boost::bind(LLFloaterEnvSettings::show), boost::bind(LLFloaterEnvSettings::isOpen)); registerFloater("EnvSettings", boost::bind(LLFloaterEnvSettings::show), boost::bind(LLFloaterEnvSettings::isOpen));
registerFloater("fly", boost::bind(LLAgent::toggleFlying)); registerFloater("fly", boost::bind(LLAgent::toggleFlying));
@@ -229,6 +221,7 @@ struct MenuFloaterDict : public LLSingleton<MenuFloaterDict>
registerFloater<LLFloaterChat> ("chat history"); registerFloater<LLFloaterChat> ("chat history");
registerFloater<LLFloaterChatterBox> ("communicate"); registerFloater<LLFloaterChatterBox> ("communicate");
registerFloater<LLFloaterDestinations> ("destinations"); registerFloater<LLFloaterDestinations> ("destinations");
registerFloater<LLFloaterDisplayName> ("displayname");
registerFloater<LLFloaterMyFriends> ("friends", 0); registerFloater<LLFloaterMyFriends> ("friends", 0);
registerFloater<LLFloaterGesture> ("gestures"); registerFloater<LLFloaterGesture> ("gestures");
registerFloater<LLFloaterMyFriends> ("groups", 1); registerFloater<LLFloaterMyFriends> ("groups", 1);

View File

@@ -50,6 +50,8 @@
#include "llmutelist.h" #include "llmutelist.h"
#include "pipeline.h"
#include <boost/tokenizer.hpp> #include <boost/tokenizer.hpp>
#include "lldispatcher.h" #include "lldispatcher.h"
@@ -62,9 +64,8 @@
#include "llimpanel.h" #include "llimpanel.h"
#include "llimview.h" #include "llimview.h"
#include "llnotifications.h" #include "llnotifications.h"
#include "lluistring.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h" #include "llviewerobjectlist.h"
#include "lltrans.h"
namespace namespace
{ {
@@ -105,12 +106,6 @@ static LLDispatchEmptyMuteList sDispatchEmptyMuteList;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LLMute() // LLMute()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
const char BY_NAME_SUFFIX[] = " (by name)";
const char AGENT_SUFFIX[] = " (resident)";
const char OBJECT_SUFFIX[] = " (object)";
const char GROUP_SUFFIX[] = " (group)";
const char EXTERNAL_SUFFIX[] = " (avaline)";
LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags)
: mID(id), : mID(id),
@@ -136,79 +131,29 @@ LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags)
} }
std::string LLMute::getDisplayName() const std::string LLMute::getDisplayType() const
{ {
std::string name_with_suffix = mName;
switch (mType) switch (mType)
{ {
case BY_NAME: case BY_NAME:
default: default:
name_with_suffix += BY_NAME_SUFFIX; return LLTrans::getString("MuteByName");
break; break;
case AGENT: case AGENT:
name_with_suffix += AGENT_SUFFIX; return LLTrans::getString("MuteAgent");
break; break;
case OBJECT: case OBJECT:
name_with_suffix += OBJECT_SUFFIX; return LLTrans::getString("MuteObject");
break; break;
case GROUP: case GROUP:
name_with_suffix += GROUP_SUFFIX; return LLTrans::getString("MuteGroup");
break; break;
case EXTERNAL: case EXTERNAL:
name_with_suffix += EXTERNAL_SUFFIX; return LLTrans::getString("MuteExternal");
break; break;
} }
return name_with_suffix;
} }
void LLMute::setFromDisplayName(const std::string& display_name)
{
size_t pos = 0;
mName = display_name;
pos = mName.rfind(GROUP_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = GROUP;
return;
}
pos = mName.rfind(OBJECT_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = OBJECT;
return;
}
pos = mName.rfind(AGENT_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = AGENT;
return;
}
pos = mName.rfind(BY_NAME_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = BY_NAME;
return;
}
pos = mName.rfind(EXTERNAL_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = EXTERNAL;
return;
}
llwarns << "Unable to set mute from display name " << display_name << llendl;
return;
}
/* static */ /* static */
LLMuteList* LLMuteList::getInstance() LLMuteList* LLMuteList::getInstance()
@@ -232,9 +177,6 @@ LLMuteList::LLMuteList() :
mIsLoaded(FALSE) mIsLoaded(FALSE)
{ {
gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList); gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList);
checkNewRegion();
gAgent.addRegionChangedCallback(boost::bind(&LLMuteList::checkNewRegion, this));
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -327,6 +269,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
llinfos << "Muting by name " << mute.mName << llendl; llinfos << "Muting by name " << mute.mName << llendl;
updateAdd(mute); updateAdd(mute);
notifyObservers(); notifyObservers();
notifyObserversDetailed(mute);
return TRUE; return TRUE;
} }
else else
@@ -375,6 +318,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
llinfos << "Muting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << llendl; llinfos << "Muting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << llendl;
updateAdd(localmute); updateAdd(localmute);
notifyObservers(); notifyObservers();
notifyObserversDetailed(localmute);
if(!(localmute.mFlags & LLMute::flagParticles)) if(!(localmute.mFlags & LLMute::flagParticles))
{ {
//Kill all particle systems owned by muted task //Kill all particle systems owned by muted task
@@ -472,19 +416,23 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
} }
// Must be after erase. // Must be after erase.
notifyObserversDetailed(localmute);
setLoaded(); // why is this here? -MG setLoaded(); // why is this here? -MG
} }
else
// Clean up any legacy mutes
string_set_t::iterator legacy_it = mLegacyMutes.find(mute.mName);
if (legacy_it != mLegacyMutes.end())
{ {
// Database representation of legacy mute is UUID null. // Clean up any legacy mutes
LLMute mute(LLUUID::null, *legacy_it, LLMute::BY_NAME); string_set_t::iterator legacy_it = mLegacyMutes.find(mute.mName);
updateRemove(mute); if (legacy_it != mLegacyMutes.end())
mLegacyMutes.erase(legacy_it); {
// Must be after erase. // Database representation of legacy mute is UUID null.
setLoaded(); // why is this here? -MG LLMute mute(LLUUID::null, *legacy_it, LLMute::BY_NAME);
updateRemove(mute);
mLegacyMutes.erase(legacy_it);
// Must be after erase.
notifyObserversDetailed(mute);
setLoaded(); // why is this here? -MG
}
} }
return found; return found;
@@ -537,15 +485,13 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& full_na
if (reason == LLMuteList::AR_IM) if (reason == LLMuteList::AR_IM)
{ {
LLFloaterIMPanel *timp = gIMMgr->findFloaterBySession(agent_id); if (LLFloaterIMPanel* timp = gIMMgr->findFloaterBySession(agent_id))
if (timp)
{ {
timp->addHistoryLine(message); timp->addHistoryLine(message);
} }
} }
LLChat auto_chat(message); LLFloaterChat::addChat(message, FALSE, FALSE);
LLFloaterChat::addChat(auto_chat, FALSE, FALSE);
} }
} }
@@ -701,14 +647,10 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) c
LLViewerObject* mute_object = get_object_to_mute_from_id(id); LLViewerObject* mute_object = get_object_to_mute_from_id(id);
LLUUID id_to_check = (mute_object) ? mute_object->getID() : id; LLUUID id_to_check = (mute_object) ? mute_object->getID() : id;
if (id_to_check == gAgentID) return false; // Can't mute self.
// don't need name or type for lookup // don't need name or type for lookup
LLMute mute(id_to_check); LLMute mute(id_to_check);
// Can't mute self.
if (mute.mID == gAgent.getID() && !mute_object)
{
getInstance()->remove(mute);
return false;
}
mute_set_t::const_iterator mute_it = mMutes.find(mute); mute_set_t::const_iterator mute_it = mMutes.find(mute);
if (mute_it != mMutes.end()) if (mute_it != mMutes.end())
{ {
@@ -721,7 +663,8 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) c
} }
// empty names can't be legacy-muted // empty names can't be legacy-muted
if (name.empty()) return FALSE; bool avatar = mute_object && mute_object->isAvatar();
if (name.empty() || avatar) return FALSE;
// Look in legacy pile // Look in legacy pile
string_set_t::const_iterator legacy_it = mLegacyMutes.find(name); string_set_t::const_iterator legacy_it = mLegacyMutes.find(name);
@@ -849,52 +792,15 @@ void LLMuteList::notifyObservers()
} }
} }
void LLMuteList::checkNewRegion() void LLMuteList::notifyObserversDetailed(const LLMute& mute)
{ {
LLViewerRegion* regionp = gAgent.getRegion(); for (observer_set_t::iterator it = mObservers.begin();
if (!regionp) return; it != mObservers.end();
)
if (regionp->getFeaturesReceived())
{ {
parseSimulatorFeatures(); LLMuteListObserver* observer = *it;
} observer->onChangeDetailed(mute);
else // In case onChange() deleted an entry.
{ it = mObservers.upper_bound(observer);
regionp->setFeaturesReceivedCallback(boost::bind(&LLMuteList::parseSimulatorFeatures, this));
}
}
void LLMuteList::parseSimulatorFeatures()
{
LLViewerRegion* regionp = gAgent.getRegion();
if (!regionp) return;
LLSD info;
regionp->getSimulatorFeatures(info);
mGodLastNames.clear();
mGodFullNames.clear();
if (info.has("god_names"))
{
if (info["god_names"].has("last_names"))
{
LLSD godNames = info["god_names"]["last_names"];
for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); ++godNames_it)
mGodLastNames.insert((*godNames_it).asString());
}
if (info["god_names"].has("full_names"))
{
LLSD godNames = info["god_names"]["full_names"];
for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); ++godNames_it)
mGodFullNames.insert((*godNames_it).asString());
}
}
else // Just use Linden
{
mGodLastNames.insert("Linden");
} }
} }

View File

@@ -64,18 +64,12 @@ public:
LLMute(const LLUUID& id, const std::string& name = std::string(), EType type = BY_NAME, U32 flags = 0); LLMute(const LLUUID& id, const std::string& name = std::string(), EType type = BY_NAME, U32 flags = 0);
// Returns name + suffix based on type // Returns localized type name of muted item
// For example: "James Tester (resident)" std::string getDisplayType() const;
std::string getDisplayName() const;
// Converts a UI name into just the agent or object name
// For example: "James Tester (resident)" sets the name to "James Tester"
// and the type to AGENT.
void setFromDisplayName(const std::string& display_name);
public: public:
LLUUID mID; // agent or object id LLUUID mID; // agent or object id
std::string mName; // agent or object name std::string mName; // agent or object name, does not store last name "Resident"
EType mType; // needed for UI display of existing mutes EType mType; // needed for UI display of existing mutes
U32 mFlags; // flags pertaining to this mute entry U32 mFlags; // flags pertaining to this mute entry
}; };
@@ -119,6 +113,9 @@ public:
BOOL isLinden(const std::string& name) const; BOOL isLinden(const std::string& name) const;
bool isLinden(const LLUUID& id) const; bool isLinden(const LLUUID& id) const;
// <singu/> Quick way to check if LLMute is in the set
bool hasMute(const LLMute& mute) const { return mMutes.find(mute) != mMutes.end(); }
BOOL isLoaded() const { return mIsLoaded; } BOOL isLoaded() const { return mIsLoaded; }
std::vector<LLMute> getMutes() const; std::vector<LLMute> getMutes() const;
@@ -135,6 +132,7 @@ private:
void setLoaded(); void setLoaded();
void notifyObservers(); void notifyObservers();
void notifyObserversDetailed(const LLMute &mute);
void updateAdd(const LLMute& mute); void updateAdd(const LLMute& mute);
void updateRemove(const LLMute& mute); void updateRemove(const LLMute& mute);
@@ -145,9 +143,6 @@ private:
static void onFileMuteList(void** user_data, S32 code, LLExtStat ext_status); static void onFileMuteList(void** user_data, S32 code, LLExtStat ext_status);
void checkNewRegion();
void parseSimulatorFeatures();
private: private:
struct compare_by_name struct compare_by_name
{ {
@@ -182,6 +177,7 @@ private:
friend class LLDispatchEmptyMuteList; friend class LLDispatchEmptyMuteList;
friend class LFSimFeatureHandler;
std::set<std::string> mGodLastNames; std::set<std::string> mGodLastNames;
std::set<std::string> mGodFullNames; std::set<std::string> mGodFullNames;
}; };
@@ -191,6 +187,7 @@ class LLMuteListObserver
public: public:
virtual ~LLMuteListObserver() { } virtual ~LLMuteListObserver() { }
virtual void onChange() = 0; virtual void onChange() = 0;
virtual void onChangeDetailed(const LLMute& ) { }
}; };

View File

@@ -189,7 +189,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
} }
else if (LLAvatarNameCache::get(id, &av_name)) else if (LLAvatarNameCache::get(id, &av_name))
{ {
LLAvatarNameCache::getPNSName(av_name, fullname, mNameSystem); fullname = av_name.getNSName(mNameSystem);
} }
else else
{ {
@@ -287,7 +287,7 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
} }
std::string name; std::string name;
LLAvatarNameCache::getPNSName(av_name, name, mNameSystem); name = av_name.getNSName(mNameSystem);
// Append optional suffix. // Append optional suffix.
if (!suffix.empty()) if (!suffix.empty())

View File

@@ -329,14 +329,15 @@ void LLNetMap::draw()
F32 relative_x = (rel_region_pos.mV[0] / region_width) * mScale; F32 relative_x = (rel_region_pos.mV[0] / region_width) * mScale;
F32 relative_y = (rel_region_pos.mV[1] / region_width) * mScale; F32 relative_y = (rel_region_pos.mV[1] / region_width) * mScale;
const F32 real_width(regionp->getWidth());
// Background region rectangle. // Background region rectangle.
F32 bottom = relative_y; F32 bottom = relative_y;
F32 left = relative_x; F32 left = relative_x;
// <FS:CR> Aurora Sim // <FS:CR> Aurora Sim
//F32 top = bottom + mScale ; //F32 top = bottom + mScale ;
//F32 right = left + mScale ; //F32 right = left + mScale ;
F32 top = bottom + (regionp->getWidth() / REGION_WIDTH_METERS) * mScale ; F32 top = bottom + (real_width / REGION_WIDTH_METERS) * mScale ;
F32 right = left + (regionp->getWidth() / REGION_WIDTH_METERS) * mScale ; F32 right = left + (real_width / REGION_WIDTH_METERS) * mScale ;
// </FS:CR> Aurora Sim // </FS:CR> Aurora Sim
if (regionp == region) gGL.color4fv(this_region_color().mV); if (regionp == region) gGL.color4fv(this_region_color().mV);
@@ -349,23 +350,34 @@ void LLNetMap::draw()
if (s_fUseWorldMapTextures) if (s_fUseWorldMapTextures)
{ {
LLViewerTexture* pRegionImage = regionp->getWorldMapTile(); const LLViewerRegion::tex_matrix_t& tiles(regionp->getWorldMapTiles());
if ( (pRegionImage) && (pRegionImage->hasGLTexture()) )
{
gGL.getTexUnit(0)->bind(pRegionImage);
gGL.begin(LLRender::QUADS);
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(left, top);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex2f(left, bottom);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(right, bottom);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex2f(right, top);
gGL.end();
pRegionImage->setBoostLevel(LLViewerTexture::BOOST_MAP_VISIBLE); for (S32 i(0), scaled_width(real_width/region_width), square_width(scaled_width*scaled_width); i < square_width; ++i)
fRenderTerrain = false; {
const F32 y(i/scaled_width);
const F32 x(i - y*scaled_width);
const F32 local_left(left + x*mScale);
const F32 local_right(local_left + mScale);
const F32 local_bottom(bottom + y*mScale);
const F32 local_top(local_bottom + mScale);
LLViewerTexture* pRegionImage = tiles[x*scaled_width+y];
if (pRegionImage && pRegionImage->hasGLTexture())
{
gGL.getTexUnit(0)->bind(pRegionImage);
gGL.begin(LLRender::QUADS);
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(local_left, local_top);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex2f(local_left, local_bottom);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(local_right, local_bottom);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex2f(local_right, local_top);
gGL.end();
pRegionImage->setBoostLevel(LLViewerTexture::BOOST_MAP_VISIBLE);
fRenderTerrain = false;
}
} }
} }
// [/SL:KB] // [/SL:KB]
@@ -952,7 +964,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& tool_tip, LLRect* stick
LLVector3d targetPosition = (*current).second; LLVector3d targetPosition = (*current).second;
std::string fullName; std::string fullName;
if (targetUUID.notNull() && LLAvatarNameCache::getPNSName(targetUUID, fullName)) if (targetUUID.notNull() && LLAvatarNameCache::getNSName(targetUUID, fullName))
{ {
//tool_tip.append(fullName); //tool_tip.append(fullName);
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
@@ -1143,17 +1155,18 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const
// //
// Draw the north and east region borders // Draw the north and east region borders
// //
const S32 borderY = originY + llround(REGION_WIDTH_METERS * mObjectMapTPM); const F32 real_width(pRegion->getWidth());
const S32 borderY = originY + llround(real_width * mObjectMapTPM);
if ( (borderY >= 0) && (borderY < imgHeight) ) if ( (borderY >= 0) && (borderY < imgHeight) )
{ {
S32 curX = llclamp(originX, 0, imgWidth), endX = llclamp(originX + llround(REGION_WIDTH_METERS * mObjectMapTPM), 0, imgWidth - 1); S32 curX = llclamp(originX, 0, imgWidth), endX = llclamp(originX + llround(real_width * mObjectMapTPM), 0, imgWidth - 1);
for (; curX <= endX; curX++) for (; curX <= endX; curX++)
pTextureData[borderY * imgWidth + curX] = clrOverlay.mAll; pTextureData[borderY * imgWidth + curX] = clrOverlay.mAll;
} }
const S32 borderX = originX + llround(REGION_WIDTH_METERS * mObjectMapTPM); const S32 borderX = originX + llround(real_width * mObjectMapTPM);
if ( (borderX >= 0) && (borderX < imgWidth) ) if ( (borderX >= 0) && (borderX < imgWidth) )
{ {
S32 curY = llclamp(originY, 0, imgHeight), endY = llclamp(originY + llround(REGION_WIDTH_METERS * mObjectMapTPM), 0, imgHeight - 1); S32 curY = llclamp(originY, 0, imgHeight), endY = llclamp(originY + llround(real_width * mObjectMapTPM), 0, imgHeight - 1);
for (; curY <= endY; curY++) for (; curY <= endY; curY++)
pTextureData[curY * imgWidth + borderX] = clrOverlay.mAll; pTextureData[curY * imgWidth + borderX] = clrOverlay.mAll;
} }
@@ -1162,7 +1175,7 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const
// Render parcel lines // Render parcel lines
// //
static const F32 GRID_STEP = PARCEL_GRID_STEP_METERS; static const F32 GRID_STEP = PARCEL_GRID_STEP_METERS;
static const S32 GRIDS_PER_EDGE = REGION_WIDTH_METERS / GRID_STEP; static const S32 GRIDS_PER_EDGE = real_width / GRID_STEP;
const U8* pOwnership = pRegion->getParcelOverlay()->getOwnership(); const U8* pOwnership = pRegion->getParcelOverlay()->getOwnership();
const U8* pCollision = (pRegion->getHandle() == LLViewerParcelMgr::instance().getCollisionRegionHandle()) ? LLViewerParcelMgr::instance().getCollisionBitmap() : NULL; const U8* pCollision = (pRegion->getHandle() == LLViewerParcelMgr::instance().getCollisionRegionHandle()) ? LLViewerParcelMgr::instance().getCollisionBitmap() : NULL;

File diff suppressed because it is too large Load Diff

View File

@@ -38,6 +38,7 @@
#include "lluuid.h" #include "lluuid.h"
#include "llmediactrl.h" #include "llmediactrl.h"
#include "llavatarpropertiesprocessor.h" #include "llavatarpropertiesprocessor.h"
#include "llmutelist.h"
class LLAvatarName; class LLAvatarName;
class LLCheckBoxCtrl; class LLCheckBoxCtrl;
@@ -88,12 +89,10 @@ class LLPanelAvatarFirstLife : public LLPanelAvatarTab
public: public:
LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar); LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar);
/*virtual*/ BOOL postBuild(void); /*virtual*/ BOOL postBuild();
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type); /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
static void onClickImage( void *userdata); void onClickImage();
void enableControls(BOOL own_avatar); void enableControls(BOOL own_avatar);
}; };
@@ -101,33 +100,35 @@ public:
class LLPanelAvatarSecondLife class LLPanelAvatarSecondLife
: public LLPanelAvatarTab : public LLPanelAvatarTab
, public LLMuteListObserver
{ {
public: public:
LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar ); LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar );
~LLPanelAvatarSecondLife();
/*virtual*/ BOOL postBuild(void); /*virtual*/ BOOL postBuild();
/*virtual*/ void refresh(); /*virtual*/ void refresh();
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type); /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
/*virtual*/ void onChange() {}
/*virtual*/ void onChangeDetailed(const LLMute& mute);
static void onClickImage( void *userdata); void onClickImage();
static void onClickFriends( void *userdata); void onClickFriends();
static void onDoubleClickGroup(void* userdata); void onDoubleClickGroup();
static void onClickPublishHelp(void *userdata);
static void onClickPartnerHelp(void *userdata);
static bool onClickPartnerHelpLoadURL(const LLSD& notification, const LLSD& response); static bool onClickPartnerHelpLoadURL(const LLSD& notification, const LLSD& response);
static void onClickPartnerInfo(void *userdata);
// Clear out the controls anticipating new network data. // Clear out the controls anticipating new network data.
void clearControls(); void clearControls();
void enableControls(BOOL own_avatar); void enableControls(BOOL own_avatar);
void updateOnlineText(BOOL online, BOOL have_calling_card); void updateOnlineText(BOOL online, BOOL have_calling_card);
void updatePartnerName(); void updatePartnerName(const LLAvatarName& name);
void setPartnerID(LLUUID id) { mPartnerID = id; } void setPartnerID(LLUUID id) { mPartnerID = id; }
private: private:
LLUUID mPartnerID; LLUUID mPartnerID;
boost::signals2::connection mCacheConnection;
}; };
@@ -139,7 +140,7 @@ class LLPanelAvatarWeb :
public: public:
LLPanelAvatarWeb(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); LLPanelAvatarWeb(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
/*virtual*/ ~LLPanelAvatarWeb(); /*virtual*/ ~LLPanelAvatarWeb();
/*virtual*/ BOOL postBuild(void); /*virtual*/ BOOL postBuild();
/*virtual*/ void refresh(); /*virtual*/ void refresh();
@@ -149,11 +150,8 @@ public:
void setWebURL(std::string url); void setWebURL(std::string url);
void load(std::string url); void load(const std::string& url);
void onURLKeystroke(LLLineEditor* editor);
void onCommitLoad(const LLSD& value); void onCommitLoad(const LLSD& value);
void onCommitURL(const LLSD& value);
static void onClickWebProfileHelp(void *);
// inherited from LLViewerMediaObserver // inherited from LLViewerMediaObserver
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
@@ -170,7 +168,7 @@ class LLPanelAvatarAdvanced : public LLPanelAvatarTab
public: public:
LLPanelAvatarAdvanced(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); LLPanelAvatarAdvanced(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
/*virtual*/ BOOL postBuild(void); /*virtual*/ BOOL postBuild();
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type); /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
@@ -197,7 +195,7 @@ class LLPanelAvatarNotes : public LLPanelAvatarTab
public: public:
LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
/*virtual*/ BOOL postBuild(void); /*virtual*/ BOOL postBuild();
/*virtual*/ void refresh(); /*virtual*/ void refresh();
@@ -212,7 +210,7 @@ class LLPanelAvatarClassified : public LLPanelAvatarTab
public: public:
LLPanelAvatarClassified(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); LLPanelAvatarClassified(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
/*virtual*/ BOOL postBuild(void); /*virtual*/ BOOL postBuild();
/*virtual*/ void refresh(); /*virtual*/ void refresh();
@@ -230,11 +228,13 @@ public:
void deleteClassifiedPanels(); void deleteClassifiedPanels();
private: private:
static void onClickNew(void* data); void onClickNew();
static void onClickDelete(void* data); void onClickDelete();
bool callbackDelete(const LLSD& notification, const LLSD& response); bool callbackDelete(const LLSD& notification, const LLSD& response);
bool callbackNew(const LLSD& notification, const LLSD& response); bool callbackNew(const LLSD& notification, const LLSD& response);
bool mInDirectory;
}; };
@@ -253,13 +253,13 @@ public:
void deletePickPanels(); void deletePickPanels();
private: private:
static void onClickNew(void* data); void onClickNew();
static void onClickDelete(void* data); void onClickDelete();
//Pick import and export - RK //Pick import and export - RK
static void onClickImport(void* data); void onClickImport();
static void onClickImport_continued(void* self, bool import); static void onClickImport_continued(void* self, bool import);
static void onClickExport(void* data); void onClickExport();
bool callbackDelete(const LLSD& notification, const LLSD& response); bool callbackDelete(const LLSD& notification, const LLSD& response);
@@ -310,12 +310,12 @@ public:
void selectTab(S32 tabnum); void selectTab(S32 tabnum);
void selectTabByName(std::string tab_name); void selectTabByName(std::string tab_name);
BOOL haveData() { return mHaveProperties && mHaveStatistics; } bool haveData() const { return mHaveProperties && mHaveStatistics; }
BOOL isEditable() const { return mAllowEdit; } bool isEditable() const { return mAllowEdit; }
static void onClickGetKey(void *userdata); void onClickCopy(const LLSD& val);
static void onClickOK( void *userdata); void onClickOK();
static void onClickCancel( void *userdata); void onClickCancel();
private: private:
void enableOKIfReady(); void enableOKIfReady();
@@ -347,15 +347,16 @@ public:
private: private:
LLUUID mAvatarID; // for which avatar is this window? LLUUID mAvatarID; // for which avatar is this window?
BOOL mIsFriend; // Are we friends? bool mIsFriend; // Are we friends?
BOOL mHaveProperties; bool mHaveProperties;
BOOL mHaveStatistics; bool mHaveStatistics;
// only update note if data received from database and // only update note if data received from database and
// note is changed from database version // note is changed from database version
bool mHaveNotes; bool mHaveNotes;
std::string mLastNotes; std::string mLastNotes;
LLTabContainer* mTab; LLTabContainer* mTab;
BOOL mAllowEdit; bool mAllowEdit;
boost::signals2::connection mCacheConnection;
typedef std::list<LLPanelAvatar*> panel_list_t; typedef std::list<LLPanelAvatar*> panel_list_t;
static panel_list_t sAllPanels; static panel_list_t sAllPanels;

View File

@@ -407,6 +407,7 @@ void LLPanelDisplay::refresh()
mAvatarVP = gSavedSettings.getBOOL("RenderAvatarVP"); mAvatarVP = gSavedSettings.getBOOL("RenderAvatarVP");
mDeferred = gSavedSettings.getBOOL("RenderDeferred"); mDeferred = gSavedSettings.getBOOL("RenderDeferred");
mDeferredDoF = gSavedSettings.getBOOL("RenderDepthOfField"); mDeferredDoF = gSavedSettings.getBOOL("RenderDepthOfField");
mDeferredSSAO = gSavedSettings.getBOOL("RenderDeferredSSAO");
// combo boxes // combo boxes
mReflectionDetail = gSavedSettings.getS32("RenderReflectionDetail"); mReflectionDetail = gSavedSettings.getS32("RenderReflectionDetail");
@@ -672,6 +673,7 @@ void LLPanelDisplay::cancel()
gSavedSettings.setBOOL("RenderAvatarVP", mAvatarVP); gSavedSettings.setBOOL("RenderAvatarVP", mAvatarVP);
gSavedSettings.setBOOL("RenderDeferred", mDeferred); gSavedSettings.setBOOL("RenderDeferred", mDeferred);
gSavedSettings.setBOOL("RenderDepthOfField", mDeferredDoF); gSavedSettings.setBOOL("RenderDepthOfField", mDeferredDoF);
gSavedSettings.setBOOL("RenderDeferredSSAO", mDeferredSSAO);
gSavedSettings.setS32("RenderReflectionDetail", mReflectionDetail); gSavedSettings.setS32("RenderReflectionDetail", mReflectionDetail);
gSavedSettings.setS32("RenderShadowDetail", mShadowDetail); gSavedSettings.setS32("RenderShadowDetail", mShadowDetail);

View File

@@ -125,6 +125,7 @@ protected:
BOOL mWindLight; BOOL mWindLight;
BOOL mDeferred; BOOL mDeferred;
BOOL mDeferredDoF; BOOL mDeferredDoF;
bool mDeferredSSAO;
BOOL mAvatarVP; BOOL mAvatarVP;
S32 mReflectionDetail; S32 mReflectionDetail;

View File

@@ -159,9 +159,7 @@ void LLPanelGroupBulkImpl::onAvatarNameCache(const LLUUID& agent_id, const LLAva
std::vector<std::string> names; std::vector<std::string> names;
uuid_vec_t agent_ids; uuid_vec_t agent_ids;
agent_ids.push_back(agent_id); agent_ids.push_back(agent_id);
std::string name; names.push_back(av_name.getNSName());
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
addUsers(names, agent_ids); addUsers(names, agent_ids);
} }
@@ -351,9 +349,7 @@ void LLPanelGroupBulk::addUserCallback(const LLUUID& id, const LLAvatarName& av_
std::vector<std::string> names; std::vector<std::string> names;
uuid_vec_t agent_ids; uuid_vec_t agent_ids;
agent_ids.push_back(id); agent_ids.push_back(id);
std::string name; names.push_back(av_name.getNSName());
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
mImplementation->addUsers(names, agent_ids); mImplementation->addUsers(names, agent_ids);
} }
@@ -411,9 +407,7 @@ void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids)
} }
else else
{ {
std::string name; names.push_back(av_name.getNSName());
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
} }
} }
} }

View File

@@ -71,3 +71,4 @@ protected:
}; };
#endif // LL_LLPANELGROUPBULK_H #endif // LL_LLPANELGROUPBULK_H

View File

@@ -31,6 +31,7 @@
#include "llagent.h" #include "llagent.h"
#include "llavatarnamecache.h" #include "llavatarnamecache.h"
#include "llavataractions.h"
#include "llfloateravatarpicker.h" #include "llfloateravatarpicker.h"
#include "llbutton.h" #include "llbutton.h"
#include "llcallingcard.h" #include "llcallingcard.h"
@@ -101,6 +102,9 @@ BOOL LLPanelGroupBulkBan::postBuild()
} }
mImplementation->mTooManySelected = getString("ban_selection_too_large"); mImplementation->mTooManySelected = getString("ban_selection_too_large");
mImplementation->mBanNotPermitted = getString("ban_not_permitted");
mImplementation->mBanLimitFail = getString("ban_limit_fail");
mImplementation->mCannotBanYourself = getString("cant_ban_yourself");
update(); update();
return TRUE; return TRUE;
@@ -108,6 +112,25 @@ BOOL LLPanelGroupBulkBan::postBuild()
void LLPanelGroupBulkBan::submit() void LLPanelGroupBulkBan::submit()
{ {
if (!gAgent.hasPowerInGroup(mImplementation->mGroupID, GP_GROUP_BAN_ACCESS))
{
// Fail! Agent no longer have ban rights. Permissions could have changed after button was pressed.
LLSD msg;
msg["MESSAGE"] = mImplementation->mBanNotPermitted;
LLNotificationsUtil::add("GenericAlert", msg);
(*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData);
return;
}
LLGroupMgrGroupData * group_datap = LLGroupMgr::getInstance()->getGroupData(mImplementation->mGroupID);
if (group_datap && group_datap->mBanList.size() >= GB_MAX_BANNED_AGENTS)
{
// Fail! Size limit exceeded. List could have updated after button was pressed.
LLSD msg;
msg["MESSAGE"] = mImplementation->mBanLimitFail;
LLNotificationsUtil::add("GenericAlert", msg);
(*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData);
return;
}
std::vector<LLUUID> banned_agent_list; std::vector<LLUUID> banned_agent_list;
std::vector<LLScrollListItem*> agents = mImplementation->mBulkAgentList->getAllData(); std::vector<LLScrollListItem*> agents = mImplementation->mBulkAgentList->getAllData();
std::vector<LLScrollListItem*>::iterator iter = agents.begin(); std::vector<LLScrollListItem*>::iterator iter = agents.begin();
@@ -117,8 +140,8 @@ void LLPanelGroupBulkBan::submit()
banned_agent_list.push_back(agent->getUUID()); banned_agent_list.push_back(agent->getUUID());
} }
const S32 MAX_GROUP_BANS = 100; // Max invites per request. 100 to match server cap. const S32 MAX_BANS_PER_REQUEST = 100; // Max bans per request. 100 to match server cap.
if (banned_agent_list.size() > MAX_GROUP_BANS) if (banned_agent_list.size() > MAX_BANS_PER_REQUEST)
{ {
// Fail! // Fail!
LLSD msg; LLSD msg;
@@ -128,33 +151,100 @@ void LLPanelGroupBulkBan::submit()
return; return;
} }
LLGroupMgrGroupData * group_datap = LLGroupMgr::getInstance()->getGroupData(mImplementation->mGroupID); // remove already banned users and yourself from request.
std::vector<LLAvatarName> banned_avatar_names;
std::vector<LLAvatarName> out_of_limit_names;
bool banning_self = FALSE;
std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgent.getID());
if (conflict != banned_agent_list.end())
{
banned_agent_list.erase(conflict);
banning_self = TRUE;
}
if (group_datap) if (group_datap)
{ {
BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList) BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList)
{ {
const LLUUID& group_ban_agent_id = group_ban_pair.first; const LLUUID& group_ban_agent_id = group_ban_pair.first;
if (std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id) != banned_agent_list.end()) std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id);
if (conflict != banned_agent_list.end())
{ {
// Fail! LLAvatarName av_name;
std::string av_name; LLAvatarNameCache::get(group_ban_agent_id, &av_name);
LLAvatarNameCache::getPNSName(group_ban_agent_id, av_name); banned_avatar_names.push_back(av_name);
LLStringUtil::format_map_t string_args; banned_agent_list.erase(conflict);
string_args["[RESIDENT]"] = av_name; if (banned_agent_list.size() == 0)
{
LLSD msg; break;
msg["MESSAGE"] = getString("already_banned", string_args); }
LLNotificationsUtil::add("GenericAlert", msg);
(*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData);
return;
} }
} }
// this check should always be the last one before we send the request.
// Otherwise we have a possibility of cutting more then we need to.
if (banned_agent_list.size() > GB_MAX_BANNED_AGENTS - group_datap->mBanList.size())
{
std::vector<LLUUID>::iterator exeedes_limit = banned_agent_list.begin() + GB_MAX_BANNED_AGENTS - group_datap->mBanList.size();
for (std::vector<LLUUID>::iterator itor = exeedes_limit ;
itor != banned_agent_list.end(); ++itor)
{
LLAvatarName av_name;
LLAvatarNameCache::get(*itor, &av_name);
out_of_limit_names.push_back(av_name);
}
banned_agent_list.erase(exeedes_limit,banned_agent_list.end());
}
} }
LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mImplementation->mGroupID, LLGroupMgr::BAN_CREATE | LLGroupMgr::BAN_UPDATE, banned_agent_list); // sending request and ejecting members
LLGroupMgr::getInstance()->sendGroupMemberEjects(mImplementation->mGroupID, banned_agent_list); if (banned_agent_list.size() != 0)
{
LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mImplementation->mGroupID, LLGroupMgr::BAN_CREATE | LLGroupMgr::BAN_UPDATE, banned_agent_list);
LLGroupMgr::getInstance()->sendGroupMemberEjects(mImplementation->mGroupID, banned_agent_list);
}
// building notification
if (banned_avatar_names.size() > 0 || banning_self || out_of_limit_names.size() > 0)
{
std::string reasons;
if(banned_avatar_names.size() > 0)
{
reasons = "\n " + buildResidentsArgument(banned_avatar_names, "residents_already_banned");
}
if(banning_self)
{
reasons += "\n " + mImplementation->mCannotBanYourself;
}
if(out_of_limit_names.size() > 0)
{
reasons += "\n " + buildResidentsArgument(out_of_limit_names, "ban_limit_reached");
}
LLStringUtil::format_map_t msg_args;
msg_args["[REASONS]"] = reasons;
LLSD msg;
if (banned_agent_list.size() == 0)
{
msg["MESSAGE"] = getString("ban_failed", msg_args);
}
else
{
msg["MESSAGE"] = getString("partial_ban", msg_args);
}
LLNotificationsUtil::add("GenericAlert", msg);
}
//then close //then close
(*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData); (*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData);
} }
std::string LLPanelGroupBulkBan::buildResidentsArgument(std::vector<LLAvatarName> avatar_names, const std::string &format)
{
std::string names_string;
LLAvatarActions::buildResidentsString(avatar_names, names_string);
LLStringUtil::format_map_t args;
args["[RESIDENTS]"] = names_string;
return getString(format, args);
}

View File

@@ -40,7 +40,10 @@ public:
virtual BOOL postBuild(); virtual BOOL postBuild();
//static void callbackClickSubmit(void* userdata);
virtual void submit(); virtual void submit();
private:
std::string buildResidentsArgument(std::vector<LLAvatarName> avatar_names, const std::string &format);
}; };
#endif // LL_LLPANELGROUPBULKBAN_H #endif // LL_LLPANELGROUPBULKBAN_H

View File

@@ -74,6 +74,9 @@ public:
std::string mLoadingText; std::string mLoadingText;
std::string mTooManySelected; std::string mTooManySelected;
std::string mBanNotPermitted;
std::string mBanLimitFail;
std::string mCannotBanYourself;
std::set<LLUUID> mInviteeIDs; std::set<LLUUID> mInviteeIDs;
@@ -94,3 +97,4 @@ public:
}; };
#endif // LL_LLPANELGROUPBULKIMPL_H #endif // LL_LLPANELGROUPBULKIMPL_H

View File

@@ -51,6 +51,8 @@
#include "lluictrlfactory.h" #include "lluictrlfactory.h"
#include "llviewerwindow.h" #include "llviewerwindow.h"
#include <boost/foreach.hpp>
class LLPanelGroupInvite::impl : public boost::signals2::trackable class LLPanelGroupInvite::impl : public boost::signals2::trackable
{ {
public: public:
@@ -69,7 +71,7 @@ public:
static void callbackClickAdd(void* userdata); static void callbackClickAdd(void* userdata);
static void callbackClickRemove(void* userdata); static void callbackClickRemove(void* userdata);
static void callbackSelect(LLUICtrl* ctrl, void* userdata); static void callbackSelect(LLUICtrl* ctrl, void* userdata);
void callbackAddUsers(const uuid_vec_t& agent_idsa); void callbackAddUsers(const uuid_vec_t& agent_ids);
void onAvatarNameCache(const LLUUID& agent_id, void onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name); const LLAvatarName& av_name);
@@ -93,6 +95,8 @@ public:
void (*mCloseCallback)(void* data); void (*mCloseCallback)(void* data);
void* mCloseCallbackUserData; void* mCloseCallbackUserData;
std::map<LLUUID, boost::signals2::connection> mAvatarNameCacheConnection;
}; };
@@ -106,14 +110,20 @@ LLPanelGroupInvite::impl::impl(const LLUUID& group_id):
mGroupName( NULL ), mGroupName( NULL ),
mConfirmedOwnerInvite( false ), mConfirmedOwnerInvite( false ),
mCloseCallback( NULL ), mCloseCallback( NULL ),
mCloseCallbackUserData( NULL ) mCloseCallbackUserData( NULL ),
mAvatarNameCacheConnection()
{ {
} }
LLPanelGroupInvite::impl::~impl() LLPanelGroupInvite::impl::~impl()
{ {
for (std::map<LLUUID, boost::signals2::connection>::const_iterator it = mAvatarNameCacheConnection.begin(); it != mAvatarNameCacheConnection.end(); ++it)
if ((*it).second.connected())
(*it).second.disconnect();
} }
const S32 MAX_GROUP_INVITES = 100; // Max invites per request. 100 to match server cap.
void LLPanelGroupInvite::impl::addUsers(const std::vector<std::string>& names, void LLPanelGroupInvite::impl::addUsers(const std::vector<std::string>& names,
const uuid_vec_t& agent_ids) const uuid_vec_t& agent_ids)
{ {
@@ -191,7 +201,6 @@ void LLPanelGroupInvite::impl::submitInvitations()
role_member_pairs[item->getUUID()] = role_id; role_member_pairs[item->getUUID()] = role_id;
} }
const S32 MAX_GROUP_INVITES = 100; // Max invites per request. 100 to match server cap.
if (role_member_pairs.size() > MAX_GROUP_INVITES) if (role_member_pairs.size() > MAX_GROUP_INVITES)
{ {
// Fail! // Fail!
@@ -381,7 +390,12 @@ void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids)
std::vector<std::string> names; std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++) for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{ {
LLAvatarNameCache::get(agent_ids[i], const LLUUID& id(agent_ids[i]);
if (mAvatarNameCacheConnection[id].connected())
{
mAvatarNameCacheConnection[id].disconnect();
}
mAvatarNameCacheConnection[id] = LLAvatarNameCache::get(id,
boost::bind(&LLPanelGroupInvite::impl::onAvatarNameCache, this, _1, _2)); boost::bind(&LLPanelGroupInvite::impl::onAvatarNameCache, this, _1, _2));
} }
} }
@@ -389,6 +403,10 @@ void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids)
void LLPanelGroupInvite::impl::onAvatarNameCache(const LLUUID& agent_id, void LLPanelGroupInvite::impl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name) const LLAvatarName& av_name)
{ {
if (mAvatarNameCacheConnection[agent_id].connected())
{
mAvatarNameCacheConnection[agent_id].disconnect();
}
std::vector<std::string> names; std::vector<std::string> names;
uuid_vec_t agent_ids; uuid_vec_t agent_ids;
agent_ids.push_back(agent_id); agent_ids.push_back(agent_id);
@@ -476,9 +494,7 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids)
} }
else else
{ {
std::string name; names.push_back(av_name.getNSName());
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
} }
} }
} }
@@ -491,9 +507,7 @@ void LLPanelGroupInvite::addUserCallback(const LLUUID& id, const LLAvatarName& a
std::vector<std::string> names; std::vector<std::string> names;
uuid_vec_t agent_ids; uuid_vec_t agent_ids;
agent_ids.push_back(id); agent_ids.push_back(id);
std::string name; names.push_back(av_name.getNSName());
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
mImplementation->addUsers(names, agent_ids); mImplementation->addUsers(names, agent_ids);
} }

View File

@@ -74,7 +74,7 @@ bool agentCanAddToRole(const LLUUID& group_id,
if (!gdatap) if (!gdatap)
{ {
llwarns << "agentCanAddToRole " llwarns << "agentCanAddToRole "
<< "-- No group data!" << llendl; << "-- No group data!" << LL_ENDL;
return false; return false;
} }
@@ -783,7 +783,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
// Regardless of whether or not this ability is allowed by all or some, we want to prevent // Regardless of whether or not this ability is allowed by all or some, we want to prevent
// the group managers from accidentally disabling either of the two additional abilities // the group managers from accidentally disabling either of the two additional abilities
// tied with GP_GROUP_BAN_ACCESS // tied with GP_GROUP_BAN_ACCESS.
if ( (allowed_by_all & GP_GROUP_BAN_ACCESS) == GP_GROUP_BAN_ACCESS || if ( (allowed_by_all & GP_GROUP_BAN_ACCESS) == GP_GROUP_BAN_ACCESS ||
(allowed_by_some & GP_GROUP_BAN_ACCESS) == GP_GROUP_BAN_ACCESS) (allowed_by_some & GP_GROUP_BAN_ACCESS) == GP_GROUP_BAN_ACCESS)
{ {
@@ -1218,7 +1218,7 @@ void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, c
{ {
LLSD args; LLSD args;
std::string av_name; std::string av_name;
LLAvatarNameCache::getPNSName(*i, av_name); LLAvatarNameCache::getNSName(*i, av_name);
args["AVATAR_NAME"] = av_name; args["AVATAR_NAME"] = av_name;
args["GROUP_NAME"] = group_data->mName; args["GROUP_NAME"] = group_data->mName;
@@ -1699,6 +1699,12 @@ void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data)
mHasMatch = TRUE; mHasMatch = TRUE;
} }
const S32& group_member_name_system()
{
static const LLCachedControl<S32> name_system("GroupMembersNameSystem", 0);
return name_system;
}
void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name, const LLUUID& av_id) void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name, const LLUUID& av_id)
{ {
avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(av_id); avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(av_id);
@@ -1720,9 +1726,8 @@ void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemb
} }
// trying to avoid unnecessary hash lookups // trying to avoid unnecessary hash lookups
std::string name; // Singu Note: Diverge from LL Viewer and filter by name displayed
LLAvatarNameCache::getPNSName(av_name, name); // Singu Note: Diverge from LL Viewer and filter by name displayed if (matchesSearchFilter(av_name.getNSName(group_member_name_system())))
if (matchesSearchFilter(name))
{ {
addMemberToList(member); addMemberToList(member);
if(!mMembersList->getEnabled()) if(!mMembersList->getEnabled())
@@ -1771,11 +1776,11 @@ void LLPanelGroupMembersSubTab::updateMembers()
continue; continue;
// Do filtering on name if it is already in the cache. // Do filtering on name if it is already in the cache.
// Singu Note: Diverge from LL Viewer and filter by name displayed LLAvatarName av_name;
std::string fullname; if (LLAvatarNameCache::get(mMemberProgress->first, &av_name))
if (LLAvatarNameCache::getPNSName(mMemberProgress->first, fullname))
{ {
if (matchesSearchFilter(fullname)) // Singu Note: Diverge from LL Viewer and filter by name displayed
if (matchesSearchFilter(av_name.getNSName(group_member_name_system())))
{ {
addMemberToList(mMemberProgress->second); addMemberToList(mMemberProgress->second);
} }

View File

@@ -92,48 +92,43 @@
const S32 BLACK_BORDER_HEIGHT = 160; const S32 BLACK_BORDER_HEIGHT = 160;
const S32 MAX_PASSWORD = 16; const S32 MAX_PASSWORD = 16;
LLPanelLogin *LLPanelLogin::sInstance = NULL; LLPanelLogin* LLPanelLogin::sInstance = NULL;
BOOL LLPanelLogin::sCapslockDidNotification = FALSE;
static bool nameSplit(const std::string& full, std::string& first, std::string& last) { static bool nameSplit(const std::string& full, std::string& first, std::string& last)
{
std::vector<std::string> fragments; std::vector<std::string> fragments;
boost::algorithm::split(fragments, full, boost::is_any_of(" .")); boost::algorithm::split(fragments, full, boost::is_any_of(" ."));
if (!fragments.size() || !fragments[0].length()) if (!fragments.size() || !fragments[0].length())
return false; return false;
first = fragments[0]; first = fragments[0];
if (fragments.size() == 1) last = (fragments.size() == 1) ?
{ gHippoGridManager->getCurrentGrid()->isAurora() ? "" : "Resident" :
if (gHippoGridManager->getCurrentGrid()->isAurora()) fragments[1];
last = "";
else
last = "Resident";
}
else
last = fragments[1];
return (fragments.size() <= 2); return (fragments.size() <= 2);
} }
static std::string nameJoin(const std::string& first,const std::string& last, bool strip_resident) { static std::string nameJoin(const std::string& first,const std::string& last, bool strip_resident)
{
if (last.empty() || (strip_resident && boost::algorithm::iequals(last, "Resident"))) if (last.empty() || (strip_resident && boost::algorithm::iequals(last, "Resident")))
return first; return first;
else { else if (std::islower(last[0]))
if(std::islower(last[0])) return first + "." + last;
return first + "." + last; else
else return first + " " + last;
return first + " " + last;
}
} }
static std::string getDisplayString(const std::string& first, const std::string& last, const std::string& grid, bool is_secondlife) { static std::string getDisplayString(const std::string& first, const std::string& last, const std::string& grid, bool is_secondlife)
{
//grid comes via LLSavedLoginEntry, which uses full grid names, not nicks //grid comes via LLSavedLoginEntry, which uses full grid names, not nicks
if(grid == gHippoGridManager->getDefaultGridName()) if (grid == gHippoGridManager->getDefaultGridName())
return nameJoin(first, last, is_secondlife); return nameJoin(first, last, is_secondlife);
else else
return nameJoin(first, last, is_secondlife) + " (" + grid + ")"; return nameJoin(first, last, is_secondlife) + " (" + grid + ")";
} }
static std::string getDisplayString(const LLSavedLoginEntry& entry) { static std::string getDisplayString(const LLSavedLoginEntry& entry)
{
return getDisplayString(entry.getFirstName(), entry.getLastName(), entry.getGrid(), entry.isSecondLife()); return getDisplayString(entry.getFirstName(), entry.getLastName(), entry.getGrid(), entry.isSecondLife());
} }
@@ -176,18 +171,18 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
reshape(rect.getWidth(), rect.getHeight()); reshape(rect.getWidth(), rect.getHeight());
LLComboBox* username_combo(getChild<LLComboBox>("username_combo")); LLComboBox* username_combo(getChild<LLComboBox>("username_combo"));
username_combo->setCommitCallback(boost::bind(LLPanelLogin::onSelectLoginEntry, _1, this)); username_combo->setCommitCallback(boost::bind(LLPanelLogin::onSelectLoginEntry, _2));
username_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLoginComboLostFocus, this, username_combo)); username_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLoginComboLostFocus, this, username_combo));
username_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNotPipe); username_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNotPipe);
username_combo->setSuppressTentative(true); username_combo->setSuppressTentative(true);
username_combo->setSuppressAutoComplete(true); username_combo->setSuppressAutoComplete(true);
childSetCommitCallback("remember_name_check", onNameCheckChanged); getChild<LLUICtrl>("remember_name_check")->setCommitCallback(boost::bind(&LLPanelLogin::onNameCheckChanged, this, _2));
LLLineEditor* password_edit(getChild<LLLineEditor>("password_edit")); LLLineEditor* password_edit(getChild<LLLineEditor>("password_edit"));
password_edit->setKeystrokeCallback(onPassKey); password_edit->setKeystrokeCallback(boost::bind(LLPanelLogin::onPassKey));
// STEAM-14: When user presses Enter with this field in focus, initiate login // STEAM-14: When user presses Enter with this field in focus, initiate login
password_edit->setCommitCallback(mungePassword, this); password_edit->setCommitCallback(boost::bind(&LLPanelLogin::mungePassword, this, _2));
password_edit->setDrawAsterixes(TRUE); password_edit->setDrawAsterixes(TRUE);
getChild<LLUICtrl>("remove_login")->setCommitCallback(boost::bind(&LLPanelLogin::confirmDelete, this)); getChild<LLUICtrl>("remove_login")->setCommitCallback(boost::bind(&LLPanelLogin::confirmDelete, this));
@@ -203,7 +198,7 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
location_combo->setAllowTextEntry(TRUE, 128, FALSE); location_combo->setAllowTextEntry(TRUE, 128, FALSE);
location_combo->setFocusLostCallback( boost::bind(&LLPanelLogin::onLocationSLURL, this) ); location_combo->setFocusLostCallback( boost::bind(&LLPanelLogin::onLocationSLURL, this) );
LLComboBox *server_choice_combo = getChild<LLComboBox>("grids_combo"); LLComboBox* server_choice_combo = getChild<LLComboBox>("grids_combo");
server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectGrid, _1)); server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectGrid, _1));
server_choice_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onSelectGrid, server_choice_combo)); server_choice_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onSelectGrid, server_choice_combo));
@@ -211,7 +206,7 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
updateGridCombo(); updateGridCombo();
LLSLURL start_slurl(LLStartUp::getStartSLURL()); LLSLURL start_slurl(LLStartUp::getStartSLURL());
if ( !start_slurl.isSpatial() ) // has a start been established by the command line or NextLoginLocation ? if (!start_slurl.isSpatial()) // has a start been established by the command line or NextLoginLocation ?
{ {
// no, so get the preference setting // no, so get the preference setting
std::string defaultStartLocation = gSavedSettings.getString("LoginLocation"); std::string defaultStartLocation = gSavedSettings.getString("LoginLocation");
@@ -246,7 +241,7 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
findChild<LLPanel>("login_html")->setDefaultBtn(connect_btn); findChild<LLPanel>("login_html")->setDefaultBtn(connect_btn);
} }
childSetAction("grids_btn", onClickGrids, this); getChild<LLUICtrl>("grids_btn")->setCommitCallback(boost::bind(LLPanelLogin::onClickGrids));
std::string channel = gVersionChannel; std::string channel = gVersionChannel;
@@ -258,7 +253,7 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
LLTextBox* channel_text = getChild<LLTextBox>("channel_text"); LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
channel_text->setTextArg("[CHANNEL]", channel); // though not displayed channel_text->setTextArg("[CHANNEL]", channel); // though not displayed
channel_text->setTextArg("[VERSION]", version); channel_text->setTextArg("[VERSION]", version);
channel_text->setClickedCallback(boost::bind(&LLPanelLogin::onClickVersion,(void*)NULL)); channel_text->setClickedCallback(boost::bind(LLFloaterAbout::show,(void*)NULL));
LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text"); LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
forgot_password_text->setClickedCallback(boost::bind(&onClickForgotPassword)); forgot_password_text->setClickedCallback(boost::bind(&onClickForgotPassword));
@@ -286,7 +281,7 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
for (LLSavedLoginsList::const_reverse_iterator i = saved_login_entries.rbegin(); for (LLSavedLoginsList::const_reverse_iterator i = saved_login_entries.rbegin();
i != saved_login_entries.rend(); ++i) i != saved_login_entries.rend(); ++i)
{ {
LLSD e = i->asLLSD(); const LLSD& e = i->asLLSD();
if (e.isMap() && gHippoGridManager->getGrid(i->getGrid())) if (e.isMap() && gHippoGridManager->getGrid(i->getGrid()))
username_combo->add(getDisplayString(*i), e); username_combo->add(getDisplayString(*i), e);
} }
@@ -297,44 +292,27 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
} }
} }
void LLPanelLogin::setSiteIsAlive( bool alive ) void LLPanelLogin::setSiteIsAlive(bool alive)
{ {
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html"); if (LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html"))
// if the contents of the site was retrieved
if ( alive )
{ {
if ( web_browser ) if (alive) // if the contents of the site was retrieved
{
loadLoginPage(); loadLoginPage();
else // the site is not available (missing page, server down, other badness)
web_browser->setVisible(true);
}
}
else
// the site is not available (missing page, server down, other badness)
{
if ( web_browser )
{
// hide browser control (revealing default one)
web_browser->setVisible( FALSE );
web_browser->navigateTo( "data:text/html,%3Chtml%3E%3Cbody%20bgcolor=%22#000000%22%3E%3C/body%3E%3C/html%3E", "text/html" ); web_browser->navigateTo( "data:text/html,%3Chtml%3E%3Cbody%20bgcolor=%22#000000%22%3E%3C/body%3E%3C/html%3E", "text/html" );
} web_browser->setVisible(alive);
} }
} }
void LLPanelLogin::mungePassword(LLUICtrl* caller, void* user_data) void LLPanelLogin::mungePassword(const std::string& password)
{ {
LLPanelLogin* self = (LLPanelLogin*)user_data;
LLLineEditor* editor = (LLLineEditor*)caller;
std::string password = editor->getText();
// Re-md5 if we've changed at all // Re-md5 if we've changed at all
if (password != self->mIncomingPassword) if (password != mIncomingPassword)
{ {
LLMD5 pass((unsigned char *)password.c_str()); LLMD5 pass((unsigned char *)password.c_str());
char munged_password[MD5HEX_STR_SIZE]; char munged_password[MD5HEX_STR_SIZE];
pass.hex_digest(munged_password); pass.hex_digest(munged_password);
self->mMungedPassword = munged_password; mMungedPassword = munged_password;
} }
} }
@@ -359,10 +337,8 @@ LLPanelLogin::~LLPanelLogin()
LLSavedLogins::saveFile(mLoginHistoryData, login_hist_filepath); LLSavedLogins::saveFile(mLoginHistoryData, login_hist_filepath);
LLPanelLogin::sInstance = NULL; LLPanelLogin::sInstance = NULL;
if ( gFocusMgr.getDefaultKeyboardFocus() == this ) if (gFocusMgr.getDefaultKeyboardFocus() == this)
{
gFocusMgr.setDefaultKeyboardFocus(NULL); gFocusMgr.setDefaultKeyboardFocus(NULL);
}
} }
// virtual // virtual
@@ -411,25 +387,11 @@ BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask)
return TRUE; return TRUE;
} }
if (('P' == key) && (MASK_CONTROL == mask))
{
LLFloaterPreference::show(NULL);
return TRUE;
}
if (('T' == key) && (MASK_CONTROL == mask)) if (('T' == key) && (MASK_CONTROL == mask))
{ {
new LLFloaterSimple("floater_test.xml"); new LLFloaterSimple("floater_test.xml");
return TRUE; return TRUE;
} }
//Singu TODO: Re-implement f1 help.
/*if ( KEY_F1 == key )
{
llinfos << "Spawning HTML help window" << llendl;
gViewerHtmlHelp.show();
return TRUE;
}*/
# if !LL_RELEASE_FOR_DOWNLOAD # if !LL_RELEASE_FOR_DOWNLOAD
if ( KEY_F2 == key ) if ( KEY_F2 == key )
@@ -601,9 +563,7 @@ void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus)
} }
// static // static
void LLPanelLogin::getFields(std::string *firstname, void LLPanelLogin::getFields(std::string& firstname, std::string& lastname, std::string& password)
std::string *lastname,
std::string *password)
{ {
if (!sInstance) if (!sInstance)
{ {
@@ -611,11 +571,11 @@ void LLPanelLogin::getFields(std::string *firstname,
return; return;
} }
nameSplit(sInstance->getChild<LLComboBox>("username_combo")->getTextEntry(), *firstname, *lastname); nameSplit(sInstance->getChild<LLComboBox>("username_combo")->getTextEntry(), firstname, lastname);
LLStringUtil::trim(*firstname); LLStringUtil::trim(firstname);
LLStringUtil::trim(*lastname); LLStringUtil::trim(lastname);
*password = sInstance->mMungedPassword; password = sInstance->mMungedPassword;
} }
// static // static
@@ -649,9 +609,6 @@ void LLPanelLogin::updateLocationSelectorsVisibility()
// [/RLVa:KB] // [/RLVa:KB]
sInstance->getChildView("location_panel")->setVisible(show_start); sInstance->getChildView("location_panel")->setVisible(show_start);
bool show_server = gSavedSettings.getBOOL("ForceShowGrid");
sInstance->getChildView("grids_panel")->setVisible(show_server);
} }
} }
@@ -674,19 +631,19 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
* and the grid selector to match the new value. * and the grid selector to match the new value.
*/ */
enum LLSLURL::SLURL_TYPE new_slurl_type = new_start_slurl.getType(); enum LLSLURL::SLURL_TYPE new_slurl_type = new_start_slurl.getType();
switch ( new_slurl_type ) switch (new_slurl_type)
{ {
case LLSLURL::LOCATION: case LLSLURL::LOCATION:
{ {
location_combo->setCurrentByIndex( 2 ); location_combo->setCurrentByIndex(2);
location_combo->setTextEntry(new_start_slurl.getLocationString()); location_combo->setTextEntry(new_start_slurl.getLocationString());
} }
break; break;
case LLSLURL::HOME_LOCATION: case LLSLURL::HOME_LOCATION:
location_combo->setCurrentByIndex( 0 ); // home location location_combo->setCurrentByIndex(0); // home location
break; break;
case LLSLURL::LAST_LOCATION: case LLSLURL::LAST_LOCATION:
location_combo->setCurrentByIndex( 1 ); // last location location_combo->setCurrentByIndex(1); // last location
break; break;
default: default:
LL_WARNS("AppInit")<<"invalid login slurl, using home"<<LL_ENDL; LL_WARNS("AppInit")<<"invalid login slurl, using home"<<LL_ENDL;
@@ -708,8 +665,7 @@ void LLPanelLogin::close()
{ {
if (sInstance) if (sInstance)
{ {
LLPanelLogin::sInstance->getParent()->removeChild( LLPanelLogin::sInstance ); sInstance->getParent()->removeChild(sInstance);
delete sInstance; delete sInstance;
sInstance = NULL; sInstance = NULL;
} }
@@ -719,27 +675,21 @@ void LLPanelLogin::close()
void LLPanelLogin::setAlwaysRefresh(bool refresh) void LLPanelLogin::setAlwaysRefresh(bool refresh)
{ {
if (sInstance && LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) if (sInstance && LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP)
{ if (LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html"))
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
if (web_browser)
{
web_browser->setAlwaysRefresh(refresh); web_browser->setAlwaysRefresh(refresh);
}
}
} }
void LLPanelLogin::updateGridCombo() void LLPanelLogin::updateGridCombo()
{ {
const std::string &defaultGrid = gHippoGridManager->getDefaultGridName(); const std::string& defaultGrid = gHippoGridManager->getDefaultGridName();
LLComboBox *grids = getChild<LLComboBox>("grids_combo"); LLComboBox* grids = getChild<LLComboBox>("grids_combo");
std::string top_entry; std::string top_entry;
grids->removeall(); grids->removeall();
const HippoGridInfo *curGrid = gHippoGridManager->getCurrentGrid(); const HippoGridInfo* curGrid = gHippoGridManager->getCurrentGrid();
const HippoGridInfo *defGrid = gHippoGridManager->getGrid(defaultGrid); const HippoGridInfo* defGrid = gHippoGridManager->getGrid(defaultGrid);
S32 idx(-1); S32 idx(-1);
HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
@@ -755,14 +705,14 @@ void LLPanelLogin::updateGridCombo()
{ {
if (defGrid) if (defGrid)
{ {
grids->add(defGrid->getGridName(),ADD_TOP); grids->add(defGrid->getGridName(), ADD_TOP);
++idx; ++idx;
} }
grids->setCurrentByIndex(idx); grids->setCurrentByIndex(idx);
} }
else else
{ {
grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label grids->setLabel(LLStringUtil::null); // LLComboBox::removeall() does not clear the label
} }
} }
@@ -800,7 +750,8 @@ void LLPanelLogin::loadLoginPage()
// Grid // Grid
if (gHippoGridManager->getCurrentGrid()->isSecondLife()) { if (gHippoGridManager->getCurrentGrid()->isSecondLife())
{
// find second life grid from login URI // find second life grid from login URI
// yes, this is heuristic, but hey, it is just to get the right login page... // yes, this is heuristic, but hey, it is just to get the right login page...
std::string tmp = gHippoGridManager->getCurrentGrid()->getLoginUri(); std::string tmp = gHippoGridManager->getCurrentGrid()->getLoginUri();
@@ -827,7 +778,7 @@ void LLPanelLogin::loadLoginPage()
// add OS info // add OS info
params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
// Make an LLURI with this augmented info // Make an LLURI with this augmented info
LLURI login_uri(LLURI::buildHTTP(login_page.authority(), LLURI login_uri(LLURI::buildHTTP(login_page.authority(),
login_page.path(), login_page.path(),
@@ -855,67 +806,33 @@ void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent ev
{ {
} }
bool LLPanelLogin::getRememberLogin()
{
bool remember = false;
if (sInstance)
{
LLCheckBoxCtrl* remember_login = sInstance->getChild<LLCheckBoxCtrl>("remember_name_check");
if (remember_login)
{
remember = remember_login->getValue().asBoolean();
}
}
else
{
llwarns << "Attempted to query rememberLogin with no login view shown" << llendl;
}
return remember;
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Protected methods // Protected methods
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// static
void LLPanelLogin::onClickConnect() void LLPanelLogin::onClickConnect()
{ {
// JC - Make sure the fields all get committed. // JC - Make sure the fields all get committed.
gFocusMgr.setKeyboardFocus(NULL); gFocusMgr.setKeyboardFocus(NULL);
std::string first, last, password; std::string first, last;
if (nameSplit(getChild<LLComboBox>("username_combo")->getTextEntry(), first, last)) if (nameSplit(getChild<LLComboBox>("username_combo")->getTextEntry(), first, last))
{
// has both first and last name typed
LLStartUp::setStartupState(STATE_LOGIN_CLEANUP); LLStartUp::setStartupState(STATE_LOGIN_CLEANUP);
} else if (gHippoGridManager->getCurrentGrid()->getRegisterUrl().empty())
LLNotificationsUtil::add("MustHaveAccountToLogInNoLinks");
else else
{ LLNotificationsUtil::add("MustHaveAccountToLogIn", LLSD(), LLSD(),
if (gHippoGridManager->getCurrentGrid()->getRegisterUrl().empty()) { LLPanelLogin::newAccountAlertCallback);
LLNotificationsUtil::add("MustHaveAccountToLogInNoLinks");
} else {
LLNotificationsUtil::add("MustHaveAccountToLogIn", LLSD(), LLSD(),
LLPanelLogin::newAccountAlertCallback);
}
}
} }
// static // static
bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD& response) bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD& response)
{ {
S32 option = LLNotification::getSelectedOption(notification, response); if (0 == LLNotification::getSelectedOption(notification, response))
if (0 == option)
{ {
llinfos << "Going to account creation URL" << llendl; llinfos << "Going to account creation URL" << llendl;
LLWeb::loadURLExternal( CREATE_ACCOUNT_URL ); LLWeb::loadURLExternal(CREATE_ACCOUNT_URL);
}
else
{
sInstance->setFocus(TRUE);
} }
return false; return false;
} }
@@ -924,18 +841,20 @@ bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD&
// static // static
void LLPanelLogin::onClickNewAccount() void LLPanelLogin::onClickNewAccount()
{ {
const std::string &url = gHippoGridManager->getCurrentGrid()->getRegisterUrl(); const std::string& url = gHippoGridManager->getCurrentGrid()->getRegisterUrl();
if (!url.empty()) { if (!url.empty())
{
llinfos << "Going to account creation URL." << llendl; llinfos << "Going to account creation URL." << llendl;
LLWeb::loadURLExternal(url); LLWeb::loadURLExternal(url);
} else { }
else
{
llinfos << "Account creation URL is empty." << llendl; llinfos << "Account creation URL is empty." << llendl;
sInstance->setFocus(TRUE);
} }
} }
// static // static
void LLPanelLogin::onClickGrids(void*) void LLPanelLogin::onClickGrids()
{ {
//LLFloaterPreference::overrideLastTab(LLPreferenceCore::TAB_GRIDS); //LLFloaterPreference::overrideLastTab(LLPreferenceCore::TAB_GRIDS);
LLFloaterPreference::show(NULL); LLFloaterPreference::show(NULL);
@@ -943,39 +862,30 @@ void LLPanelLogin::onClickGrids(void*)
} }
// static // static
void LLPanelLogin::onClickVersion(void*)
{
LLFloaterAbout::show(NULL);
}
//static
void LLPanelLogin::onClickForgotPassword() void LLPanelLogin::onClickForgotPassword()
{ {
if (sInstance ) const std::string& url = gHippoGridManager->getCurrentGrid()->getPasswordUrl();
{ if (!url.empty())
const std::string &url = gHippoGridManager->getCurrentGrid()->getPasswordUrl(); LLWeb::loadURLExternal(url);
if (!url.empty()) { else
LLWeb::loadURLExternal(url); llwarns << "Link for 'forgotton password' not set." << llendl;
} else {
llwarns << "Link for 'forgotton password' not set." << llendl;
}
}
} }
// static // static
void LLPanelLogin::onPassKey(LLLineEditor* caller) void LLPanelLogin::onPassKey()
{ {
if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == FALSE) static bool sCapslockDidNotification = false;
if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == false)
{ {
LLNotificationsUtil::add("CapsKeyOn"); LLNotificationsUtil::add("CapsKeyOn");
sCapslockDidNotification = TRUE; sCapslockDidNotification = true;
} }
} }
void LLPanelLogin::onCurGridChange(HippoGridInfo* new_grid, HippoGridInfo* old_grid) void LLPanelLogin::onCurGridChange(HippoGridInfo* new_grid, HippoGridInfo* old_grid)
{ {
refreshLoginPage(); refreshLoginPage();
if(old_grid != new_grid) //Changed grid? Reset the location combobox if (old_grid != new_grid) //Changed grid? Reset the location combobox
{ {
std::string defaultStartLocation = gSavedSettings.getString("LoginLocation"); std::string defaultStartLocation = gSavedSettings.getString("LoginLocation");
LLSLURL defaultStart(defaultStartLocation); LLSLURL defaultStart(defaultStartLocation);
@@ -1074,66 +984,39 @@ void LLPanelLogin::onLocationSLURL()
} }
//Special handling of name combobox. Facilitates grid-changing by account selection. //Special handling of name combobox. Facilitates grid-changing by account selection.
// static void LLPanelLogin::onSelectLoginEntry(const LLSD& selected_entry)
void LLPanelLogin::onSelectLoginEntry(LLUICtrl* ctrl, void* data)
{ {
if (sInstance) if (selected_entry.isMap())
{ setFields(LLSavedLoginEntry(selected_entry));
LLComboBox* combo = sInstance->getChild<LLComboBox>("username_combo"); // This stops the automatic matching of the first name to a selected grid.
if (ctrl == combo) LLViewerLogin::getInstance()->setNameEditted(true);
{
LLSD selected_entry = combo->getSelectedValue();
if (!selected_entry.isUndefined())
{
LLSavedLoginEntry entry(selected_entry);
setFields(entry);
}
// This stops the automatic matching of the first name to a selected grid.
LLViewerLogin::getInstance()->setNameEditted(true);
}
}
} }
void LLPanelLogin::onLoginComboLostFocus(LLComboBox* combo_box) void LLPanelLogin::onLoginComboLostFocus(LLComboBox* combo_box)
{ {
if(combo_box->isTextDirty()) if (combo_box->isTextDirty())
{ {
clearPassword(); childSetText("password_edit", mIncomingPassword = mMungedPassword = LLStringUtil::null);
combo_box->resetTextDirty(); combo_box->resetTextDirty();
} }
} }
// static void LLPanelLogin::onNameCheckChanged(const LLSD& value)
void LLPanelLogin::onNameCheckChanged(LLUICtrl* ctrl, void* data)
{ {
if (sInstance) if (LLCheckBoxCtrl* remember_pass_check = findChild<LLCheckBoxCtrl>("remember_check"))
{ {
LLCheckBoxCtrl* remember_login_check = sInstance->getChild<LLCheckBoxCtrl>("remember_name_check"); if (value.asBoolean())
LLCheckBoxCtrl* remember_pass_check = sInstance->getChild<LLCheckBoxCtrl>("remember_check");
if (remember_login_check && remember_pass_check)
{ {
if (remember_login_check->getValue().asBoolean()) remember_pass_check->setEnabled(true);
{ }
remember_pass_check->setEnabled(true); else
} {
else remember_pass_check->setValue(LLSD(false));
{ remember_pass_check->setEnabled(false);
remember_pass_check->setValue(LLSD(false));
remember_pass_check->setEnabled(false);
}
} }
} }
} }
// static
void LLPanelLogin::clearPassword()
{
std::string blank;
sInstance->childSetText("password_edit", blank);
sInstance->mIncomingPassword = blank;
sInstance->mMungedPassword = blank;
}
void LLPanelLogin::confirmDelete() void LLPanelLogin::confirmDelete()
{ {
LLNotificationsUtil::add("ConfirmDeleteUser", LLSD(), LLSD(), boost::bind(&LLPanelLogin::removeLogin, this, boost::bind(LLNotificationsUtil::getSelectedOption, _1, _2))); LLNotificationsUtil::add("ConfirmDeleteUser", LLSD(), LLSD(), boost::bind(&LLPanelLogin::removeLogin, this, boost::bind(LLNotificationsUtil::getSelectedOption, _1, _2)));

View File

@@ -76,7 +76,7 @@ public:
*/ */
static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = true); static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = true);
static void getFields(std::string *firstname, std::string *lastname, std::string *password); static void getFields(std::string& firstname, std::string& lastname, std::string& password);
static void setLocation(const LLSLURL& slurl); static void setLocation(const LLSLURL& slurl);
@@ -94,8 +94,8 @@ public:
static void refreshLoginPage(); static void refreshLoginPage();
static void giveFocus(); static void giveFocus();
static void setAlwaysRefresh(bool refresh); static void setAlwaysRefresh(bool refresh);
static void mungePassword(LLUICtrl* caller, void* user_data); void mungePassword(const std::string& password);
// inherited from LLViewerMediaObserver // inherited from LLViewerMediaObserver
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
@@ -109,15 +109,13 @@ private:
void onClickConnect(); void onClickConnect();
static void onClickNewAccount(); static void onClickNewAccount();
static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response); static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response);
static void onClickGrids(void*); static void onClickGrids();
static void onSelectGrid(LLUICtrl *ctrl); static void onSelectGrid(LLUICtrl *ctrl);
static void onClickVersion(void*);
static void onClickForgotPassword(); static void onClickForgotPassword();
static void onPassKey(LLLineEditor* caller); static void onPassKey();
static void onSelectLoginEntry(LLUICtrl*, void*); static void onSelectLoginEntry(const LLSD& selected_entry);
void onLoginComboLostFocus(LLComboBox* combo_box); void onLoginComboLostFocus(LLComboBox* combo_box);
static void onNameCheckChanged(LLUICtrl* ctrl, void* data); void onNameCheckChanged(const LLSD& value);
static void clearPassword();
void confirmDelete(); void confirmDelete();
void removeLogin(bool knot); void removeLogin(bool knot);
@@ -132,12 +130,6 @@ public:
return (sInstance ? sInstance->mLoginHistoryData : LLSavedLogins()); return (sInstance ? sInstance->mLoginHistoryData : LLSavedLogins());
} }
/**
* @brief Returns the state of the "remember resident name" checkbox if it exists.
* @return Checkbox state, or false if the instance is not instantiated.
*/
static bool getRememberLogin();
private: private:
LLPointer<LLUIImage> mLogoImage; LLPointer<LLUIImage> mLogoImage;
@@ -145,7 +137,6 @@ private:
std::string mMungedPassword; std::string mMungedPassword;
static LLPanelLogin* sInstance; static LLPanelLogin* sInstance;
static BOOL sCapslockDidNotification;
LLSavedLogins mLoginHistoryData; LLSavedLogins mLoginHistoryData;
}; };

View File

@@ -91,7 +91,7 @@ LLFolderViewFolder * LLOutboxInventoryPanel::createFolderViewFolder(LLInvFVBridg
return new LLOutboxFolderViewFolder( return new LLOutboxFolderViewFolder(
bridge->getDisplayName(), bridge->getDisplayName(),
bridge->getIcon(), bridge->getIcon(),
bridge->getOpenIcon(), bridge->getIconOpen(),
LLUI::getUIImage("inv_link_overlay.tga"), LLUI::getUIImage("inv_link_overlay.tga"),
mFolderRoot.get(), mFolderRoot.get(),
bridge); bridge);
@@ -102,7 +102,7 @@ LLFolderViewItem * LLOutboxInventoryPanel::createFolderViewItem(LLInvFVBridge *
return new LLOutboxFolderViewItem( return new LLOutboxFolderViewItem(
bridge->getDisplayName(), bridge->getDisplayName(),
bridge->getIcon(), bridge->getIcon(),
bridge->getOpenIcon(), bridge->getIconOpen(),
LLUI::getUIImage("inv_link_overlay.tga"), LLUI::getUIImage("inv_link_overlay.tga"),
bridge->getCreationDate(), bridge->getCreationDate(),
mFolderRoot.get(), mFolderRoot.get(),

View File

@@ -1821,7 +1821,7 @@ void LLPanelObjectInventory::createFolderViews(LLInventoryObject* inventory_root
LLFolderViewFolder* new_folder = NULL; LLFolderViewFolder* new_folder = NULL;
new_folder = new LLFolderViewFolder(inventory_root->getName(), new_folder = new LLFolderViewFolder(inventory_root->getName(),
bridge->getIcon(), bridge->getIcon(),
bridge->getOpenIcon(), bridge->getIconOpen(),
NULL, NULL,
mFolders, mFolders,
bridge); bridge);
@@ -1860,7 +1860,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li
{ {
view = new LLFolderViewFolder(obj->getName(), view = new LLFolderViewFolder(obj->getName(),
bridge->getIcon(), bridge->getIcon(),
bridge->getOpenIcon(), bridge->getIconOpen(),
NULL, NULL,
mFolders, mFolders,
bridge); bridge);
@@ -1871,7 +1871,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li
{ {
view = new LLFolderViewItem(obj->getName(), view = new LLFolderViewItem(obj->getName(),
bridge->getIcon(), bridge->getIcon(),
bridge->getOpenIcon(), bridge->getIconOpen(),
NULL, NULL,
bridge->getCreationDate(), bridge->getCreationDate(),
mFolders, mFolders,

View File

@@ -262,15 +262,13 @@ void LLPreview::draw()
{ {
mDirty = FALSE; mDirty = FALSE;
const LLViewerInventoryItem *item = getItem(); const LLViewerInventoryItem *item = getItem();
if (item) refreshFromItem(item);
{
refreshFromItem(item);
}
} }
} }
void LLPreview::refreshFromItem(const LLInventoryItem* item) void LLPreview::refreshFromItem(const LLInventoryItem* item)
{ {
if (!item) return;
setTitle(llformat("%s: %s",getTitleName(),item->getName().c_str())); setTitle(llformat("%s: %s",getTitleName(),item->getName().c_str()));
childSetText("desc",item->getDescription()); childSetText("desc",item->getDescription());

View File

@@ -3347,51 +3347,71 @@ void renderPhysicsShapes(LLSpatialGroup* group)
for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i) for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{ {
LLDrawable* drawable = *i; LLDrawable* drawable = *i;
LLVOVolume* volume = drawable->getVOVolume(); if (!drawable)
if (volume && !volume->isAttachment() && volume->getPhysicsShapeType() != LLViewerObject::PHYSICS_SHAPE_NONE )
{ {
if (!group->mSpatialPartition->isBridge()) continue;
}
if (drawable->isSpatialBridge())
{
LLSpatialBridge* bridge = drawable->asPartition()->asBridge();
if (bridge)
{ {
gGL.pushMatrix(); gGL.pushMatrix();
LLVector3 trans = drawable->getRegion()->getOriginAgent(); gGL.multMatrix(bridge->mDrawable->getRenderMatrix());
gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]); bridge->renderPhysicsShapes();
renderPhysicsShape(drawable, volume);
gGL.popMatrix(); gGL.popMatrix();
} }
else
{
renderPhysicsShape(drawable, volume);
}
} }
else else
{ {
LLViewerObject* object = drawable->getVObj(); LLVOVolume* volume = drawable->getVOVolume();
if (object && object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) if (volume && !volume->isAttachment() && volume->getPhysicsShapeType() != LLViewerObject::PHYSICS_SHAPE_NONE )
{ {
gGL.pushMatrix(); if (!group->mSpatialPartition->isBridge())
gGL.multMatrix(object->getRegion()->mRenderMatrix);
//push face vertices for terrain
for (S32 i = 0; i < drawable->getNumFaces(); ++i)
{ {
LLFace* face = drawable->getFace(i); gGL.pushMatrix();
if (face) LLVector3 trans = drawable->getRegion()->getOriginAgent();
gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
renderPhysicsShape(drawable, volume);
gGL.popMatrix();
}
else
{
renderPhysicsShape(drawable, volume);
}
}
else
{
LLViewerObject* object = drawable->getVObj();
if (object && object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH)
{
gGL.pushMatrix();
gGL.multMatrix(object->getRegion()->mRenderMatrix);
//push face vertices for terrain
for (S32 i = 0; i < drawable->getNumFaces(); ++i)
{ {
LLVertexBuffer* buff = face->getVertexBuffer(); LLFace* face = drawable->getFace(i);
if (buff) if (face)
{ {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); LLVertexBuffer* buff = face->getVertexBuffer();
if (buff)
{
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
buff->setBuffer(LLVertexBuffer::MAP_VERTEX); buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
gGL.diffuseColor3f(0.2f, 0.5f, 0.3f); gGL.diffuseColor3f(0.2f, 0.5f, 0.3f);
buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0); buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
gGL.diffuseColor3f(0.2f, 1.f, 0.3f); gGL.diffuseColor3f(0.2f, 1.f, 0.3f);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0); buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
}
} }
} }
gGL.popMatrix();
} }
gGL.popMatrix();
} }
} }
} }

View File

@@ -92,7 +92,7 @@ void LLSpeaker::onNameCache(const LLAvatarName& full_name)
if (!name_system) if (!name_system)
mDisplayName = gCacheName->cleanFullName(full_name.getLegacyName()); mDisplayName = gCacheName->cleanFullName(full_name.getLegacyName());
else else
LLAvatarNameCache::getPNSName(full_name, mDisplayName, name_system); mDisplayName = full_name.getNSName(name_system);
} }
bool LLSpeaker::isInVoiceChannel() bool LLSpeaker::isInVoiceChannel()

Some files were not shown because too many files have changed in this diff Show More