Update/Modernize LLAvatarName and LLAvatarNameCache and _EVERYTHING_ they touch

Fairly certain this adds the feature in which the user may click the online notification to open a chat with the user coming online.

Translators may want to look at the xml changes of this change to see what to update

Removes old LegacyMultiAttachmentSupport patch
Moves LLAvatarName-centric functions into LLAvatarName from elsewhere.
Adds boost::signals2::connections to name polling places.
Removes more old icky static callbacks
Merge from Alchemy, credit where due~
Update notifications.xml to have a bunch of the tags from upstream to ease diffing
This commit is contained in:
Inusaito Sayori
2014-12-16 17:55:23 -05:00
parent 39d27e3a4e
commit 0e48a2196f
55 changed files with 1891 additions and 1390 deletions

View File

@@ -907,7 +907,6 @@ AIHTTPTimeoutPolicy const* AIHTTPTimeoutPolicy::getTimeoutPolicyByName(std::stri
// Policy name Policy
P(assetReportHandler);
P(authHandler);
P(avatarNameResponder);
P2(baseCapabilitiesComplete, transfer_18s_connect_5s);
P(blockingLLSDPost);
P(blockingLLSDGet);
@@ -926,8 +925,6 @@ P(fetchScriptLimitsRegionSummaryResponder);
P(fnPtrResponder);
P(floaterPermsResponder);
P2(gamingDataReceived, transfer_22s_connect_10s);
P(groupBanDataResponder);
P2(groupMemberDataResponder, transfer_300s);
P2(groupProposalBallotResponder, transfer_300s);
P(homeLocationResponder);
P2(HTTPGetResponder, reply_15s);
@@ -962,14 +959,11 @@ P(startConferenceChatResponder);
P2(startGroupVoteResponder, transfer_300s);
P(translationReceiver);
P(uploadModelPremissionsResponder);
P(userReportResponder);
P(verifiedDestinationResponder);
P(viewerChatterBoxInvitationAcceptResponder);
P(viewerMediaOpenIDResponder);
P(viewerMediaWebProfileResponder);
P(viewerStatsResponder);
P(vivoxVoiceAccountProvisionResponder);
P(vivoxVoiceClientCapResponder);
P(voiceCallCapResponder);
P(webProfileResponders);
P(wholeModelFeeResponder);

View File

@@ -30,6 +30,7 @@
#include "llavatarname.h"
#include "lldate.h"
#include "llframetimer.h"
#include "llsd.h"
// Store these in pre-built std::strings to avoid memory allocations in
@@ -42,6 +43,15 @@ 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(),
@@ -61,6 +71,27 @@ bool LLAvatarName::operator<(const LLAvatarName& rhs) const
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;
@@ -85,27 +116,90 @@ void LLAvatarName::fromLLSD(const LLSD& sd)
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;
}
}
// 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 (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.
if (sUseDisplayNames)
{
name = mDisplayName;
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 = mDisplayName + (linefeed ? "\n(" : " (") + mUsername + ")";
name = getUserName();
}
return name;
}
std::string LLAvatarName::getLegacyName() const
{
if (mLegacyFirstName.empty() && mLegacyLastName.empty()) // display names disabled?
{
return mDisplayName;
}
std::string name;
name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() );
name = mLegacyFirstName;
@@ -113,3 +207,48 @@ std::string LLAvatarName::getLegacyName() const
name += mLegacyLastName;
return name;
}
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,6 +30,8 @@
#include <string>
const S32& main_name_system();
class LLSD;
class LLAvatarName
@@ -39,10 +41,30 @@ public:
bool operator<(const LLAvatarName& rhs) const;
// Conversion to and from LLSD (cache file or server response)
LLSD asLLSD() const;
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)"
// When display names are disabled returns just "James Linden"
std::string getCompleteName(bool linefeed = false) const;
@@ -52,10 +74,49 @@ public:
// *TODO: Eliminate this in favor of username only
std::string getLegacyName() const;
// "Jos<6F> 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
std::string mUsername;
// "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode
// "Jos<EFBFBD> Sanchez" or "James Linden", UTF-8 encoded Unicode
// Contains data whether or not user has explicitly set
// a display name; may duplicate their username.
std::string mDisplayName;
@@ -81,15 +142,12 @@ public:
// shown in UI, but are not serialized.
bool mIsTemporaryName;
// 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;
// Global flag indicating if display name should be used or not
// This will affect the output of the high level "get" methods
static bool sUseDisplayNames;
// Flag indicating if username should be shown after display name or not
static bool sUseUsernames;
};
#endif

View File

@@ -44,10 +44,6 @@ namespace LLAvatarNameCache
{
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 override for display names
bool sForceDisplayNames = false;
@@ -57,18 +53,22 @@ namespace LLAvatarNameCache
// current region supports display names.
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.
// On simulator, loaded from indra.xml
// On viewer, usually a simulator capability (at People API team's request)
// Includes the trailing slash, like "http://pdp60.lindenlab.com:8000/agents/"
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;
ask_queue_t sAskQueue;
// agent IDs that have been requested, but with no reply
// maps agent ID to frame time request was made
// Agent IDs that have been requested, but with no reply.
// Maps agent ID to frame time request was made.
typedef std::map<LLUUID, F64> pending_queue_t;
pending_queue_t sPendingQueue;
@@ -79,21 +79,21 @@ namespace LLAvatarNameCache
typedef std::map<LLUUID, callback_signal_t*> signal_map_t;
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;
cache_t sCache;
// Send bulk lookup requests a few times a second at most
// only need per-frame timing resolution
// Send bulk lookup requests a few times a second at most.
// Only need per-frame timing resolution.
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;
/// Time when unrefreshed cached names were checked last
// Time when unrefreshed cached names were checked last.
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;
//-----------------------------------------------------------------------
@@ -101,26 +101,21 @@ namespace LLAvatarNameCache
//-----------------------------------------------------------------------
// 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,
const LLAvatarName& av_name,
bool add_to_cache);
const LLAvatarName& av_name);
void requestNamesViaCapability();
// Legacy name system callback
// Legacy name system callbacks
void legacyNameCallback(const LLUUID& agent_id,
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();
// 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
void fireSignal(const LLUUID& agent_id,
const callback_slot_t& slot,
@@ -174,31 +169,37 @@ namespace LLAvatarNameCache
</llsd>
*/
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy avatarNameResponder_timeout;
class LLAvatarNameResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(LLAvatarNameResponder);
private:
// need to store agent ids that are part of this request in case of
// an error, so we can flag them as unavailable
std::vector<LLUUID> mAgentIDs;
// 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:
LLAvatarNameResponder(const std::vector<LLUUID>& 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
F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(mReceivedHeaders);
F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(getResponseHeaders());
F64 now = LLFrameTimer::getTotalSeconds();
LLSD agents = mContent["agents"];
const LLSD& agents = content["agents"];
LLSD::array_const_iterator it = agents.beginArray();
for ( ; it != agents.endArray(); ++it)
{
@@ -211,24 +212,15 @@ public:
// Use expiration time from header
av_name.mExpires = expires;
// Some avatars don't have explicit display names set
if (av_name.mDisplayName.empty())
{
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;
LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result for " << agent_id << LL_ENDL;
av_name.dump();
// cache it and fire signals
LLAvatarNameCache::processName(agent_id, av_name, true);
LLAvatarNameCache::processName(agent_id, av_name);
}
// 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();
if (num_unresolved > 0)
{
@@ -252,14 +244,13 @@ public:
<< LL_ENDL;
}
/*virtual*/ void httpFailure(void)
/*virtual*/ void httpFailure()
{
// If there's an error, it might be caused by PeopleApi,
// or when loading textures on startup and using a very slow
// network, this query may time out.
// What we should do depends on whether or not we have a cached name
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::httpFailure " << mStatus << " " << mReason
<< LL_ENDL;
LL_WARNS("AvNameCache") << dumpResponse() << LL_ENDL;
// 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();
@@ -269,9 +260,6 @@ public:
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
@@ -284,48 +272,34 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id)
LL_WARNS("AvNameCache") << "LLAvatarNameCache get legacy for agent "
<< agent_id << LL_ENDL;
gCacheName->get(agent_id, false, // legacy compatibility
boost::bind(&LLAvatarNameCache::legacyNameCallback,
_1, _2, _3));
boost::bind(&LLAvatarNameCache::legacyNameFetch, _1, _2, _3));
}
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
// Clear this agent from the pending list
LLAvatarNameCache::sPendingQueue.erase(agent_id);
LLAvatarName& av_name = existing->second;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent "
<< agent_id
<< "user '" << av_name.mUsername << "' "
<< "display '" << av_name.mDisplayName << "' "
<< "expires in " << av_name.mExpires - LLFrameTimer::getTotalSeconds() << " seconds"
<< LL_ENDL;
av_name.mExpires = LLFrameTimer::getTotalSeconds() + TEMP_CACHE_ENTRY_LIFETIME; // reset expiry time so we don't constantly rerequest.
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent " << agent_id << LL_ENDL;
av_name.dump();
// Reset expiry time so we don't constantly rerequest.
av_name.setExpires(TEMP_CACHE_ENTRY_LIFETIME);
}
}
void LLAvatarNameCache::processName(const LLUUID& agent_id,
const LLAvatarName& av_name,
bool add_to_cache)
void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName& av_name)
{
if (add_to_cache)
{
// 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]
}
// Add to the cache
sCache[agent_id] = av_name;
// Suppress request from the queue
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);
if (sig_it != sSignalMap.end())
{
@@ -356,7 +330,6 @@ void LLAvatarNameCache::requestNamesViaCapability()
std::vector<LLUUID> agent_ids;
agent_ids.reserve(128);
U32 id_total = sAskQueue.size();
U32 ids = 0;
ask_queue_t::const_iterator it;
while(!sAskQueue.empty())
@@ -393,7 +366,7 @@ void LLAvatarNameCache::requestNamesViaCapability()
if (!url.empty())
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability requested "
<< ids << "/" << id_total << "ids "
<< ids << " ids"
<< LL_ENDL;
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));
}
@@ -403,22 +376,33 @@ void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id,
const std::string& full_name,
bool is_group)
{
// Construct a dummy record for this name. By convention, SLID is blank
// Never expires, but not written to disk, so lasts until end of session.
LLAvatarName av_name;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameCallback "
// Put the received data in the cache
legacyNameFetch(agent_id, full_name, is_group);
// 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 << " "
<< "full name '" << full_name << "'"
<< ( is_group ? " [group]" : "" )
<< LL_ENDL;
buildLegacyName(full_name, &av_name);
// Add to cache, because if we don't we'll keep rerequesting the
// same record forever. buildLegacyName should always guarantee
// that these records expire reasonably soon
// (in TEMP_CACHE_ENTRY_LIFETIME seconds), so if the failure was due
// to something temporary we will eventually request and get the right data.
processName(agent_id, av_name, true);
// Construct an av_name record from this name.
LLAvatarName av_name;
av_name.fromString(full_name);
// Add to cache: we're still using the new cache even if we're using the old (legacy) protocol.
processName(agent_id, av_name);
}
void LLAvatarNameCache::requestNamesViaLegacy()
@@ -440,25 +424,28 @@ void LLAvatarNameCache::requestNamesViaLegacy()
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaLegacy agent " << agent_id << LL_ENDL;
gCacheName->get(agent_id, false, // legacy compatibility
boost::bind(&LLAvatarNameCache::legacyNameCallback,
_1, _2, _3));
boost::bind(&LLAvatarNameCache::legacyNameCallback, _1, _2, _3));
}
}
void LLAvatarNameCache::initClass(bool running)
void LLAvatarNameCache::initClass(bool running, bool usePeopleAPI)
{
sRunning = running;
sUsePeopleAPI = usePeopleAPI;
}
void LLAvatarNameCache::cleanupClass()
{
sCache.clear();
}
void LLAvatarNameCache::importFile(std::istream& istr)
{
LLSD data;
S32 parse_count = LLSDSerialize::fromXMLDocument(data, istr);
if (parse_count < 1) return;
if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr))
{
return;
}
// by convention LLSD storage is a 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 LLAvatarName& av_name = it->second;
// 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
agents[agent_id.asString()] = av_name.asLLSD();
@@ -511,6 +498,11 @@ bool LLAvatarNameCache::hasNameLookupURL()
return !sNameLookupURL.empty();
}
bool LLAvatarNameCache::usePeopleAPI()
{
return hasNameLookupURL() && sUsePeopleAPI;
}
void LLAvatarNameCache::idle()
{
// By convention, start running at first idle() call
@@ -527,13 +519,12 @@ void LLAvatarNameCache::idle()
if (!sAskQueue.empty())
{
if (useDisplayNames())
if (usePeopleAPI())
{
requestNamesViaCapability();
}
else
{
// ...fall back to legacy name cache system
requestNamesViaLegacy();
}
}
@@ -541,7 +532,7 @@ void LLAvatarNameCache::idle()
if (sAskQueue.empty())
{
// 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
@@ -577,9 +568,8 @@ void LLAvatarNameCache::eraseUnrefreshed()
const LLAvatarName& av_name = it->second;
if (av_name.mExpires < max_unrefreshed)
{
const LLUUID& agent_id = it->first;
LL_DEBUGS("AvNameCache") << agent_id
<< " user '" << av_name.mUsername << "' "
LL_DEBUGS("AvNameCache") << it->first
<< " user '" << av_name.getAccountName() << "' "
<< "expired " << now - av_name.mExpires << " secs ago"
<< LL_ENDL;
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)
// returns bool specifying if av_name was filled, false otherwise
bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
@@ -623,38 +590,24 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
if (sRunning)
{
// ...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
std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end())
{
*av_name = it->second;
*av_name = it->second;
// re-request name if entry is expired
if (av_name->mExpires < LLFrameTimer::getTotalSeconds())
{
if (!isRequestPending(agent_id))
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
<< "refresh agent " << agent_id
<< LL_ENDL;
sAskQueue.insert(agent_id);
}
}
return true;
}
}
else
{
// ...use legacy names cache
std::string full_name;
if (gCacheName->getFullName(agent_id, full_name))
// re-request name if entry is expired
if (av_name->mExpires < LLFrameTimer::getTotalSeconds())
{
buildLegacyName(full_name, av_name);
return true;
if (!isRequestPending(agent_id))
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
<< "refresh agent " << agent_id
<< LL_ENDL;
sAskQueue.insert(agent_id);
}
}
return true;
}
}
@@ -669,35 +622,22 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
return false;
}
const S32& LLAvatarNameCache::phoenix_name_system()
const S32& main_name_system()
{
static const LLCachedControl<S32> name_system("PhoenixNameSystem", 0);
return name_system;
}
// Return true when name has been set to Phoenix Name System Name, if not return false.
bool LLAvatarNameCache::getPNSName(const LLUUID& agent_id, std::string& name, const S32& name_system)
// Return true when name has been set to Name System Name, if not return false.
bool LLAvatarNameCache::getNSName(const LLUUID& agent_id, std::string& name, const S32& name_system)
{
LLAvatarName avatar_name;
if (get(agent_id, &avatar_name))
getPNSName(avatar_name, name, name_system);
name = avatar_name.getNSName(name_system);
else return false;
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,
const callback_slot_t& slot,
const LLAvatarName& av_name)
@@ -714,30 +654,14 @@ LLAvatarNameCache::callback_connection_t LLAvatarNameCache::get(const LLUUID& ag
if (sRunning)
{
// ...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
std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end())
const LLAvatarName& av_name = it->second;
if (av_name.mExpires > LLFrameTimer::getTotalSeconds())
{
const LLAvatarName& av_name = it->second;
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);
// ...name already exists in cache, fire callback now
fireSignal(agent_id, slot, av_name);
return connection;
}
@@ -778,7 +702,7 @@ bool LLAvatarNameCache::getForceDisplayNames()
void LLAvatarNameCache::setForceDisplayNames(bool force)
{
sForceDisplayNames = force;
if ( (!sUseDisplayNames) && (force) )
if ( (!LLAvatarName::useDisplayNames()) && (force) )
{
setUseDisplayNames(true);
}
@@ -791,21 +715,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)
use |= getForceDisplayNames();
// [/RLVa:KB]
if (use != sUseDisplayNames)
if (use != LLAvatarName::useDisplayNames())
{
sUseDisplayNames = use;
LL_DEBUGS("AvNameCache") << "Display names are now: " << (use ? "on" : "off") << LL_ENDL;
// flush our cache
sCache.clear();
LLAvatarName::setUseDisplayNames(use);
mUseDisplayNamesSignal();
}
}
bool LLAvatarNameCache::useDisplayNames()
void LLAvatarNameCache::setUseUsernames(bool use)
{
// Must be both manually set on and able to look up names.
return sUseDisplayNames && !sNameLookupURL.empty();
if (use != LLAvatarName::useUsernames())
{
LLAvatarName::setUseUsernames(use);
mUseDisplayNamesSignal();
}
}
void LLAvatarNameCache::erase(const LLUUID& agent_id)
@@ -839,6 +762,7 @@ bool LLAvatarNameCache::expirationFromCacheControl(AIHTTPReceivedHeaders const&
{
bool fromCacheControl = false;
F64 now = LLFrameTimer::getTotalSeconds();
// Allow the header to override the default
std::string cache_control;
if (headers.getFirstValue("cache-control", cache_control))

View File

@@ -32,46 +32,41 @@
#include <boost/signals2.hpp>
class LLUUID;
class AIHTTPReceivedHeaders;
class LLUUID;
namespace LLAvatarNameCache
{
typedef boost::signals2::signal<void (void)> use_display_name_signal_t;
// Until the cache is set running, immediate lookups will fail and
// async lookups will be queued. This allows us to block requests
// until we know if the first region supports display names.
void initClass(bool running);
void initClass(bool running, bool usePeopleAPI);
void cleanupClass();
// Import/export the name cache to file.
void importFile(std::istream& istr);
void exportFile(std::ostream& ostr);
// On the viewer, usually a simulator capabilitity
// If empty, name cache will fall back to using legacy name
// lookup system
// On the viewer, usually a simulator capabilitity.
// If empty, name cache will fall back to using legacy name lookup system.
void setNameLookupURL(const std::string& name_lookup_url);
// Do we have a valid lookup URL, hence are we trying to use the
// new display name lookup system?
// Do we have a valid lookup URL, i.e. are we trying to use the
// more recent display name lookup system?
bool hasNameLookupURL();
bool usePeopleAPI();
// Periodically makes a batch request for display names not already in
// cache. Call once per frame.
// cache. Called once per frame.
void idle();
// 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);
const S32& phoenix_name_system();
// If get() succeeds, returns true and fills in name string
// 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());
// If get() succeeds, returns true and fills in name string via void function below, otherwise returns false
bool getNSName(const LLUUID& agent_id, std::string& name, const S32& name_system = main_name_system());
// Callback types for get() below
typedef boost::signals2::signal<
@@ -80,29 +75,29 @@ namespace LLAvatarNameCache
typedef callback_signal_t::slot_type callback_slot_t;
typedef boost::signals2::connection callback_connection_t;
// Fetches name information and calls callback.
// If name information is in cache, callback will be called immediately.
// Fetches name information and calls callbacks.
// If name information is in cache, callbacks will be called immediately.
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);
bool useDisplayNames();
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c
bool getForceDisplayNames();
void setForceDisplayNames(bool force);
// [/RLVa:KB]
void erase(const LLUUID& agent_id);
/// Provide some fallback for agents that return errors
void handleAgentError(const LLUUID& agent_id);
void setUseUsernames(bool use);
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,
// 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);
}

View File

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

View File

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

View File

@@ -340,7 +340,8 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
// secondlife:///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+",
boost::regex::perl|boost::regex::icase);
@@ -371,6 +372,8 @@ void LLUrlEntryAgent::callObservers(const std::string &id,
void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
const LLAvatarName& av_name)
{
mAvatarNameCacheConnection.disconnect();
std::string label = av_name.getCompleteName();
// 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
{
LLAvatarNameCache::get(agent_id,
boost::bind(&LLUrlEntryAgent::onAvatarNameCache,
this, _1, _2));
if (mAvatarNameCacheConnection.connected())
{
mAvatarNameCacheConnection.disconnect();
}
mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgent::onAvatarNameCache, this, _1, _2));
addObserver(agent_id_string, url, cb);
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;
}
if (LLStringUtil::endsWith(url, "/removefriend"))
{
return LLTrans::getString("SLappAgentRemoveFriend") + " " + 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)
// 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,
const LLAvatarName& av_name)
{
mAvatarNameCacheConnection.disconnect();
std::string label = getName(av_name);
// received the agent name from the server - tell our observers
callObservers(id.asString(), label, mIcon);
@@ -554,9 +566,11 @@ std::string LLUrlEntryAgentName::getLabel(const std::string &url, const LLUrlLab
}
else
{
LLAvatarNameCache::get(agent_id,
boost::bind(&LLUrlEntryAgentCompleteName::onAvatarNameCache,
this, _1, _2));
if (mAvatarNameCacheConnection.connected())
{
mAvatarNameCacheConnection.disconnect();
}
mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentName::onAvatarNameCache, this, _1, _2));
addObserver(agent_id_string, url, cb);
return LLTrans::getString("LoadingData");
}
@@ -597,7 +611,7 @@ LLUrlEntryAgentDisplayName::LLUrlEntryAgentDisplayName()
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)
{
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)
{
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

View File

@@ -32,6 +32,7 @@
#include "lluicolor.h"
#include "llstyle.h"
#include "llavatarname.h"
#include "llhost.h" // for resolving parcel name by parcel id
#include <boost/signals2.hpp>
@@ -93,7 +94,7 @@ public:
virtual std::string getLocation(const std::string &url) const { return ""; }
/// 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; }
@@ -171,6 +172,13 @@ class LLUrlEntryAgent : public LLUrlEntryBase
{
public:
LLUrlEntryAgent();
~LLUrlEntryAgent()
{
if (mAvatarNameCacheConnection.connected())
{
mAvatarNameCacheConnection.disconnect();
}
}
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
/*virtual*/ std::string getIcon(const std::string &url);
/*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);
private:
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:
LLUrlEntryAgentName();
~LLUrlEntryAgentName()
{
if (mAvatarNameCacheConnection.connected())
{
mAvatarNameCacheConnection.disconnect();
}
}
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
//*virtual*/ LLStyle::Params getStyle() const;
protected:
@@ -199,6 +215,7 @@ protected:
virtual std::string getName(const LLAvatarName& avatar_name) = 0;
private:
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>
<integer>0</integer>
</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>
<map>
<key>Comment</key>
@@ -16785,6 +16774,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>0</integer>
</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>
<map>
<key>Comment</key>

View File

@@ -219,9 +219,7 @@ struct ProfCtrlListAccum : public LLControlGroup::ApplyFunctor
#endif //PROF_CTRL_CALLS
void spew_key_to_name(const LLUUID& targetKey, const LLAvatarName& av_name)
{
std::string object_name;
LLAvatarNameCache::getPNSName(av_name, object_name);
cmdline_printchat(llformat("%s: %s", targetKey.asString().c_str(), object_name.c_str()));
cmdline_printchat(llformat("%s: %s", targetKey.asString().c_str(), av_name.getNSName().c_str()));
}
bool cmd_line_chat(std::string revised_text, EChatType type)
{

View File

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

View File

@@ -38,35 +38,29 @@
#include "llcallingcard.h"
#include <vector>
#include <algorithm>
//#include <iterator>
#include "indra_constants.h"
#include "llcachename.h"
//#include "llcachename.h"
#include "llstl.h"
#include "lltimer.h"
#include "lluuid.h"
#include "message.h"
#include "llagent.h"
#include "llbutton.h"
//#include "llinventory.h"
#include "llinventorymodel.h"
#include "llavatarnamecache.h"
#include "llinventoryobserver.h"
#include "llinventorymodel.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "llresmgr.h"
#include "llimview.h"
#include "lltrans.h"
#include "llviewercontrol.h"
#include "llviewernetwork.h"
#include "llviewerobjectlist.h"
#include "llviewerwindow.h"
#include "llvoavatar.h"
#include "llavataractions.h"
#include "llimview.h"
#include "llimpanel.h"
#include "llavatarname.h"
#include "llavatarnamecache.h"
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
@@ -111,8 +105,6 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id,
LLAvatarTracker::LLAvatarTracker() :
mTrackingData(NULL),
mTrackedAgentValid(false),
//mInventory(NULL),
//mInventoryObserver(NULL),
mModifyMask(0x0)
{
}
@@ -121,7 +113,9 @@ LLAvatarTracker::~LLAvatarTracker()
{
deleteTrackingData();
std::for_each(mObservers.begin(), mObservers.end(), DeletePointer());
mObservers.clear();
std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
mBuddyInfo.clear();
}
void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name)
@@ -184,13 +178,13 @@ LLVector3d LLAvatarTracker::getGlobalPos()
if(!mTrackedAgentValid || !mTrackingData) return LLVector3d();
LLVector3d global_pos;
LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID);
if(avatarp && !avatarp->isDead())
LLVOAvatar* av = gObjectList.findAvatar(mTrackingData->mAvatarID);
if(av && !av->isDead())
{
global_pos = avatarp->getPositionGlobal();
global_pos = av->getPositionGlobal();
// HACK - for making the tracker point above the avatar's head
// 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;
}
@@ -210,10 +204,10 @@ void LLAvatarTracker::getDegreesAndDist(F32& rot,
LLVector3d global_pos;
LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID);
if(avatarp && !avatarp->isDead())
LLViewerObject* object = gObjectList.findObject(mTrackingData->mAvatarID);
if(object && !object->isDead())
{
global_pos = avatarp->getPositionGlobal();
global_pos = object->getPositionGlobal();
mTrackingData->mGlobalPositionEstimate = global_pos;
}
else
@@ -272,7 +266,7 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds)
<< ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline")
<< ", TO: " << mBuddyInfo[agent_id]->getRightsGrantedTo()
<< ", FROM: " << mBuddyInfo[agent_id]->getRightsGrantedFrom()
<< llendl;
<< LL_ENDL;
}
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->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo()
<< ", " << e_r->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo()
<< "]" << llendl;
<< "]" << LL_ENDL;
}
}
notifyObservers();
@@ -315,6 +309,7 @@ void LLAvatarTracker::terminateBuddy(const LLUUID& id)
msg->nextBlock("ExBlock");
msg->addUUID("OtherID", id);
gAgent.sendReliableMessage();
addChangedMask(LLFriendObserver::REMOVE, id);
delete buddy;
}
@@ -345,7 +340,7 @@ void LLAvatarTracker::setBuddyOnline(const LLUUID& id, bool is_online)
else
{
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->addUUIDFast(_PREHASH_Hunter, gAgentID);
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);
const F64 NO_LOCATION = 0.0;
msg->addF64Fast(_PREHASH_GlobalX, NO_LOCATION);
@@ -640,20 +635,40 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg)
{
std::string fullname;
LLSD args;
if (LLAvatarNameCache::getPNSName(agent_id, fullname))
if (LLAvatarNameCache::getNSName(agent_id, fullname))
args["NAME"] = fullname;
LLSD payload;
payload["from_id"] = agent_id;
if(LLRelationship::GRANT_MODIFY_OBJECTS & new_rights)
{
LLNotificationsUtil::add("GrantedModifyRights",args, payload);
LLNotifications::instance().add("GrantedModifyRights",args, payload);
}
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);
}
}
@@ -697,7 +712,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
else
{
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)
@@ -711,9 +726,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
if(chat_notify)
{
// Look up the name of this agent for the notification
LLAvatarNameCache::get(agent_id,
boost::bind(&on_avatar_name_cache_notify,
_1, _2, online, payload));
LLAvatarNameCache::get(agent_id,boost::bind(&on_avatar_name_cache_notify,_1, _2, online, payload));
}
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
// Use display name only because this user is your friend
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
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
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.
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id);
if (floater)
if (LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(session_id))
{
std::string notifyMsg = notification->getMessage();
if (!notifyMsg.empty())
floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor"));
std::string notify_msg = notification->getMessage();
if (!notify_msg.empty())
floater->addHistoryLine(notify_msg, gSavedSettings.getColor4("SystemChatColor"));
}
}
@@ -812,7 +836,7 @@ void LLTrackingData::agentFound(const LLUUID& prey,
if(prey != mAvatarID)
{
llwarns << "LLTrackingData::agentFound() - found " << prey
<< " but looking for " << mAvatarID << llendl;
<< " but looking for " << mAvatarID << LL_ENDL;
}
mHaveInfo = true;
mAgentGone.setTimerExpirySec(OFFLINE_SECONDS);
@@ -821,8 +845,8 @@ void LLTrackingData::agentFound(const LLUUID& prey,
bool LLTrackingData::haveTrackingInfo()
{
LLVOAvatar* avatarp = gObjectList.findAvatar(mAvatarID);
if(avatarp && !avatarp->isDead())
LLViewerObject* object = gObjectList.findObject(mAvatarID);
if(object && !object->isDead())
{
mCoarseLocationTimer.checkExpirationAndReset(COARSE_FREQUENCY);
mUpdateTimer.setTimerExpirySec(FIND_FREQUENCY);
@@ -876,7 +900,7 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship
{
LLAvatarName 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))
{
mMappable.insert(value);
@@ -898,7 +922,9 @@ bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship*
const S32& friend_name_system();
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);
if(buddy->isOnline())
{
@@ -910,5 +936,3 @@ bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* bud
}
return true;
}

View File

@@ -546,7 +546,7 @@ void LLFloaterAvatarList::updateAvatarList()
const LLUUID& avid = avatar_ids[i];
std::string name;
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];

View File

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

View File

@@ -40,53 +40,12 @@
#include "llagent.h"
LLFloaterDisplayName* LLFloaterDisplayName::sInstance = NULL;
LLFloaterDisplayName::LLFloaterDisplayName()
LLFloaterDisplayName::LLFloaterDisplayName(const LLSD&)
: 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()
{
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 minute = next_update_local.asString().substr(14,2);
std::string second = next_update_local.asString().substr(17,2);
std::string next_update_string_date =
llformat("%s/%s/%s",year.c_str(),month.c_str(),
day.c_str());
std::string 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);
std::string next_update_string_date = llformat("%s/%s/%s",year.c_str(),month.c_str(), day.c_str());
std::string 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>("save_btn")->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,
const std::string& reason,
@@ -151,10 +114,6 @@ void LLFloaterDisplayName::onCacheSetName(bool success,
LLSD args;
args["DISPLAY_NAME"] = content["display_name"];
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;
}
@@ -167,7 +126,7 @@ void LLFloaterDisplayName::onCacheSetName(bool success,
if (!error_tag.empty()
&& LLNotificationTemplates::getInstance()->templateExists(error_tag))
{
LLNotifications::instance().add(error_tag);
LLNotificationsUtil::add(error_tag);
return;
}
@@ -186,34 +145,30 @@ void LLFloaterDisplayName::onCacheSetName(bool success,
LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
}
void LLFloaterDisplayName::onCancel(void* data)
void LLFloaterDisplayName::onCancel()
{
LLFloaterDisplayName* self = (LLFloaterDisplayName*)data;
self->setVisible(false);
setVisible(false);
}
void LLFloaterDisplayName::onReset(void* data)
void LLFloaterDisplayName::onReset()
{
LLFloaterDisplayName* self = (LLFloaterDisplayName*)data;
if (LLAvatarNameCache::useDisplayNames())
if (LLAvatarNameCache::hasNameLookupURL())
{
LLViewerDisplayName::set("",
boost::bind(&LLFloaterDisplayName::onCacheSetName, self, _1, _2, _3));
LLViewerDisplayName::set("", boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3));
}
else
{
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 = self->getChild<LLUICtrl>("display_name_editor")->getValue().asString();
std::string display_name_confirm = self->getChild<LLUICtrl>("display_name_confirm")->getValue().asString();
std::string display_name_utf8 = getChild<LLUICtrl>("display_name_editor")->getValue().asString();
std::string display_name_confirm = getChild<LLUICtrl>("display_name_confirm")->getValue().asString();
if (display_name_utf8.compare(display_name_confirm))
{
@@ -231,17 +186,16 @@ void LLFloaterDisplayName::onSave(void* data)
return;
}
if (LLAvatarNameCache::useDisplayNames())
if (LLAvatarNameCache::hasNameLookupURL())
{
LLViewerDisplayName::set(display_name_utf8,
boost::bind(&LLFloaterDisplayName::onCacheSetName, self, _1, _2, _3));
LLViewerDisplayName::set(display_name_utf8, boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3));
}
else
{
LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
}
self->setVisible(false);
setVisible(false);
}

View File

@@ -28,24 +28,21 @@
class LLFloaterDisplayName : public LLFloater
, public LLFloaterSingleton<LLFloaterDisplayName>
{
public:
LLFloaterDisplayName();
virtual ~LLFloaterDisplayName();
LLFloaterDisplayName(const LLSD&);
virtual ~LLFloaterDisplayName() { }
/*virtual*/ BOOL postBuild();
static void onSave(void* data);
static void onReset(void* data);
static void onCancel(void* data);
static void show();
void onSave();
void onReset();
void onCancel();
/*virtual*/ void onOpen();
private:
void onCacheSetName(bool success,
const std::string& reason,
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)
{
std::string name;
LLAvatarNameCache::getPNSName(avname, name, friend_name_system());
item->getColumn(1)->setValue(name);
item->getColumn(1)->setValue(avname.getNSName(friend_name_system()));
}
void LLPanelFriends::addFriend(const LLUUID& agent_id)
@@ -343,7 +341,7 @@ void LLPanelFriends::addFriend(const LLUUID& agent_id)
bool isOnline = relation_info->isOnline();
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);
LLScrollListItem::Params element;
@@ -417,7 +415,7 @@ void LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh
bool isOnline = info->isOnline();
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());
}
@@ -847,7 +845,7 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke comm
{
LLSD args;
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;
LLNotificationsUtil::add(command == GRANT ? "GrantModifyRights" : "RevokeModifyRights",

View File

@@ -1303,7 +1303,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
if(texture_ctrl)
{
lldebugs << "Detail Texture " << i << ": "
<< compp->getDetailTextureID(i) << llendl;
<< compp->getDetailTextureID(i) << LL_ENDL;
LLUUID tmp_id(compp->getDetailTextureID(i));
texture_ctrl->setImageAssetID(tmp_id);
}
@@ -2260,7 +2260,7 @@ void LLPanelEstateInfo::refreshFromEstate()
const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
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>("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));
}
void LLPanelEstateInfo::setOwnerPNSName(const LLUUID& agent_id, const LLAvatarName& av_name)
{
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
setOwnerName(name);
}
void LLPanelEstateInfo::clearAccessLists()
{
LLNameListCtrl* name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list");

View File

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

View File

@@ -52,7 +52,6 @@
// viewer project includes
#include "llagent.h"
#include "llagentui.h"
#include "llbutton.h"
#include "lltexturectrl.h"
#include "llscrolllistctrl.h"
@@ -80,14 +79,12 @@
#include "llviewernetwork.h"
#include "llassetuploadresponders.h"
#include "llagentui.h"
#include "lltrans.h"
const U32 INCLUDE_SCREENSHOT = 0x01 << 0;
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy userReportResponder_timeout;
//-----------------------------------------------------------------------------
// Globals
//-----------------------------------------------------------------------------
@@ -106,7 +103,8 @@ LLFloaterReporter::LLFloaterReporter()
mPicking( FALSE),
mPosition(),
mCopyrightWarningSeen( FALSE ),
mResourceDatap(new LLResourceData())
mResourceDatap(new LLResourceData()),
mAvatarNameCacheConnection()
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml");
}
@@ -174,6 +172,7 @@ BOOL LLFloaterReporter::postBuild()
pick_btn->setImages(std::string("UIImgFaceUUID"),
std::string("UIImgFaceSelectedUUID") );
childSetAction("pick_btn", onClickObjPicker, this);
childSetAction("select_abuser", boost::bind(&LLFloaterReporter::onClickSelectAbuser, this));
childSetAction("send_btn", onClickSend, this);
@@ -190,6 +189,11 @@ BOOL LLFloaterReporter::postBuild()
// virtual
LLFloaterReporter::~LLFloaterReporter()
{
if (mAvatarNameCacheConnection.connected())
{
mAvatarNameCacheConnection.disconnect();
}
// child views automatically deleted
mObjectID = LLUUID::null;
@@ -254,14 +258,6 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
if (regionp)
{
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;
global_pos.setVec(objectp->getPositionRegion());
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)
{
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);
getChild<LLUICtrl>("object_name")->setValue(avatar_link);
getChild<LLUICtrl>("abuser_name_edit")->setValue(avatar_link);
return;
mAvatarNameCacheConnection.disconnect();
}
LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterReporter::onAvatarNameCache, this, _1, _2));
mAvatarNameCacheConnection = LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterReporter::onAvatarNameCache, this, _1, _2));
}
void LLFloaterReporter::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name)
{
std::string avatar_link;
LLAvatarNameCache::getPNSName(av_name, avatar_link);
getChild<LLUICtrl>("owner_name")->setValue(avatar_link);
getChild<LLUICtrl>("object_name")->setValue(avatar_link);
getChild<LLUICtrl>("abuser_name_edit")->setValue(avatar_link);
mAvatarNameCacheConnection.disconnect();
if (mObjectID == avatar_id)
{
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
void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name)
{
@@ -598,6 +592,7 @@ LLSD LLFloaterReporter::gatherReport()
const char* platform = "Lnx";
#elif LL_SOLARIS
const char* platform = "Sol";
const char* short_platform = "O:S";
#else
const char* platform = "???";
#endif
@@ -718,23 +713,24 @@ public:
/*virtual*/ char const* getName(void) const { return "LLUserReportScreenshotResponder"; }
};
class LLUserReportResponder : public LLHTTPClient::ResponderWithResult
class LLUserReportResponder : public LLHTTPClient::ResponderWithCompleted
{
LOG_CLASS(LLUserReportResponder);
public:
LLUserReportResponder() { }
/*virtual*/ void httpFailure(void)
{
// *TODO do some user messaging here
LLUploadDialog::modalUploadFinished();
}
/*virtual*/ void httpSuccess(void)
private:
void httpCompleted()
{
if (!isGoodStatus(mStatus))
{
// *TODO do some user messaging here
LL_WARNS("UserReport") << dumpResponse() << LL_ENDL;
}
// we don't care about what the server returns
LLUploadDialog::modalUploadFinished();
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return userReportResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLUserReportResponder"; }
char const* getName() const { return "LLUserReportResponder"; }
};
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::string mDefaultSummary;
LLResourceData* mResourceDatap;
boost::signals2::connection mAvatarNameCacheConnection;
};
#endif

View File

@@ -184,27 +184,33 @@ void LLPanelScriptLimitsInfo::updateChild(LLUICtrl* child_ctr)
// 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)
#ifdef DUMP_REPLIES_TO_LLINFOS
LLSDNotationStreamer notation_streamer(mContent);
LLSDNotationStreamer notation_streamer(content);
std::ostringstream nice_llsd;
nice_llsd << notation_streamer;
OSMessageBox(nice_llsd.str(), "main cap response:", 0);
llinfos << "main cap response:" << mContent << llendl;
llinfos << "main cap response:" << content << LL_ENDL;
#endif
// 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:
if(mContent.has("ScriptResourceDetails"))
if(content.has("ScriptResourceDetails"))
{
LLHTTPClient::get(mContent["ScriptResourceDetails"], new fetchScriptLimitsRegionDetailsResponder(mInfo));
LLHTTPClient::get(content["ScriptResourceDetails"], new fetchScriptLimitsRegionDetailsResponder(mInfo));
}
else
{
@@ -216,19 +222,20 @@ void fetchScriptLimitsRegionInfoResponder::httpSuccess(void)
}
// 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
LLSD fake_content;
@@ -265,10 +272,16 @@ void fetchScriptLimitsRegionSummaryResponder::httpSuccess(void)
#else
const LLSD& content = mContent;
const LLSD& content = content_ref;
#endif
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
#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
/*
Updated detail service, ** denotes field added:
@@ -374,10 +388,16 @@ result (map)
#else
const LLSD& content = mContent;
const LLSD& content = content_ref;
#endif
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
#ifdef DUMP_REPLIES_TO_LLINFOS
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
@@ -456,16 +477,22 @@ void fetchScriptLimitsAttachmentInfoResponder::httpSuccess(void)
summary["used"] = used;
fake_content["summary"] = summary;
fake_content["attachments"] = mContent["attachments"];
fake_content["attachments"] = content_ref["attachments"];
const LLSD& content = fake_content;
#else
const LLSD& content = mContent;
const LLSD& content = content_ref;
#endif
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
#ifdef DUMP_REPLIES_TO_LLINFOS
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;
LLAvatarNameCache::getPNSName(id, name);
LLAvatarNameCache::getNSName(id, name);
std::vector<LLSD>::iterator id_itor;
for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor)
@@ -706,7 +733,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
}
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)
{
@@ -720,30 +747,39 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
}
}
LLSD item_params;
item_params["id"] = task_id;
LLScrollListItem::Params item_params;
item_params.value = task_id;
item_params["columns"][0]["column"] = "size";
item_params["columns"][0]["value"] = size;
LLScrollListCell::Params cell_params;
//cell_params.font = LLFontGL::getFontSansSerif();
item_params["columns"][1]["column"] = "urls";
item_params["columns"][1]["value"] = urls;
cell_params.column = "size";
cell_params.value = size;
item_params.columns.add(cell_params);
item_params["columns"][2]["column"] = "name";
item_params["columns"][2]["value"] = name_buf;
cell_params.column = "urls";
cell_params.value = urls;
item_params.columns.add(cell_params);
item_params["columns"][3]["column"] = "owner";
item_params["columns"][3]["value"] = owner_buf;
cell_params.column = "name";
cell_params.value = name_buf;
item_params.columns.add(cell_params);
item_params["columns"][4]["column"] = "parcel";
item_params["columns"][4]["value"] = parcel_name;
cell_params.column = "owner";
cell_params.value = owner_buf;
item_params.columns.add(cell_params);
item_params["columns"][5]["column"] = "location";
item_params["columns"][5]["value"] = has_locations
cell_params.column = "parcel";
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)
: "";
item_params.columns.add(cell_params);
list->addElement(item_params);
list->addRow(item_params);
LLSD element;
element["owner_id"] = owner_id;
@@ -878,13 +914,17 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain()
}
LLParcel* parcel = instance->getCurrentSelectedParcel();
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();
region = gAgent.getRegion();
}
LLUUID current_region_id = gAgent.getRegion()->getRegionID();
// </alchemy>
if ((region) && (parcel))
{
@@ -921,7 +961,7 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain()
{
llwarns << "Can't get parcel info for script information request" << region_id
<< ". Region: " << region->getName()
<< " does not support RemoteParcelRequest" << llendl;
<< " does not support RemoteParcelRequest" << LL_ENDL;
std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting));

View File

@@ -537,7 +537,7 @@ bool LLGroupMgrGroupData::changeRoleMember(const LLUUID& role_id,
// Already recorded this change? Weird.
llinfos << "Received duplicate change for "
<< " role: " << role_id << " member " << member_id
<< " change " << (rmc == RMC_ADD ? "ADD" : "REMOVE") << llendl;
<< " change " << (rmc == RMC_ADD ? "ADD" : "REMOVE") << LL_ENDL;
}
else
{
@@ -783,9 +783,12 @@ void LLGroupMgrGroupData::sendRoleChanges()
break;
}
case RC_UPDATE_ALL:
// fall through
case RC_UPDATE_POWERS:
need_power_recalc = true;
// fall through
case RC_UPDATE_DATA:
// fall through
default:
{
LLGroupRoleData* group_role_data = (*role_it).second;
@@ -1201,6 +1204,8 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
name = LLTrans::getString("group_role_owners");
}
lldebugs << "Adding role data: " << name << " {" << role_id << "}" << llendl;
LLGroupRoleData* rd = new LLGroupRoleData(role_id,name,title,desc,powers,member_count);
group_datap->mRoles[role_id] = rd;
@@ -1474,7 +1479,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data)
}
else
{
// *TODO:translate
// *TODO: Translate
LLSD args;
args["MESSAGE"] = message;
LLNotificationsUtil::add("UnableToCreateGroup", args);
@@ -1617,6 +1622,7 @@ void LLGroupMgr::sendGroupMembersRequest(const LLUUID& group_id)
}
}
void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id)
{
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?
llinfos << " Pending: " << (group_datap->mPendingRoleMemberRequest ? "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;
return;
}
@@ -1885,8 +1891,6 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
bool start_message = true;
LLMessageSystem* msg = gMessageSystem;
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
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
class GroupBanDataResponder : public LLHTTPClient::ResponderWithResult
{
@@ -1964,8 +1964,7 @@ public:
virtual ~GroupBanDataResponder() {}
virtual void httpSuccess();
virtual void httpFailure();
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return groupBanDataResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "GroupBanDataResponder"; }
virtual char const* getName() const { return "GroupBanDataResponder"; }
private:
LLUUID mGroupID;
BOOL mForceRefresh;
@@ -1984,18 +1983,14 @@ void GroupBanDataResponder::httpFailure()
void GroupBanDataResponder::httpSuccess()
{
if (mContent.size())
if (mContent.has("ban_list"))
{
if (mContent.has("ban_list"))
{
// group ban data received
LLGroupMgr::processGroupBanRequest(mContent);
mForceRefresh = false;
}
// group ban data received
LLGroupMgr::processGroupBanRequest(mContent);
}
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);
}
}
@@ -2097,25 +2092,34 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content)
// Responder class for capability group management
class GroupMemberDataResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(GroupMemberDataResponder);
public:
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:
/* virtual */ void httpSuccess();
/* virtual */ void httpFailure();
/* virtual */ char const* getName() const { return "GroupMemberDataResponder"; }
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;
}
// static
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
// 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)
LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id);
group_datap->mMemberDataComplete = true;
group_datap->mMemberRequestID.setNull();
// Make the role-member data request
@@ -2289,8 +2296,10 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
group_datap->mChanged = TRUE;
LLGroupMgr::getInstance()->notifyObservers(GC_MEMBER_DATA);
}
void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id)
{
lldebugs << "LLGroupMgr::sendGroupRoleChanges" << llendl;

View File

@@ -49,6 +49,8 @@ enum LLGroupChange
GC_ALL
};
const U32 GB_MAX_BANNED_AGENTS = 500;
class LLGroupMgrObserver
{
public:
@@ -262,7 +264,7 @@ public:
const LLUUID& getMemberVersion() const { return mMemberVersion; }
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]; }
void createBanEntry(const LLUUID& ban_id, const LLGroupBanData& ban_data = LLGroupBanData());

View File

@@ -285,7 +285,7 @@ void LLHoverView::updateText()
{
// [/RLVa:KB]
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();
if (title)
@@ -408,7 +408,7 @@ void LLHoverView::updateText()
{
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)
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))

View File

@@ -550,7 +550,7 @@ void LLHUDEffectLookAt::render()
static const LLCachedControl<S32> lookAtNames("LookAtNameSystem");
if (lookAtNames < 0) return;
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"))
text.erase(text.length() - 9);
LLVector3 offset = gAgentCamera.getCameraPositionAgent() - target;

View File

@@ -401,11 +401,9 @@ LLFloaterIMPanel::LLFloaterIMPanel(
void LLFloaterIMPanel::onAvatarNameLookup(const LLAvatarName& avatar_name)
{
std::string title;
LLAvatarNameCache::getPNSName(avatar_name, title);
setTitle(title);
setTitle(avatar_name.getNSName());
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.
{
size_t pos(title.find(" Resident"));
@@ -768,7 +766,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol
static const LLCachedControl<bool> italicize("LiruItalicizeActions");
is_irc = italicize && utf8msg[0] != ':';
if (source.notNull())
LLAvatarNameCache::getPNSName(source, show_name);
LLAvatarNameCache::getNSName(source, show_name);
// Convert the name to a hotlink and add to message.
LLStyleSP source_style = LLStyleMap::instance().lookupAgent(source);
source_style->mItalic = is_irc;
@@ -1434,7 +1432,7 @@ void LLFloaterIMPanel::processIMTyping(const LLIMInfo* im_info, bool typing)
{
// other user started typing
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);
}
else

View File

@@ -1091,7 +1091,7 @@ void LLIMMgr::noteOfflineUsers(
std::string full_name;
if (info
&& !info->isOnline()
&& LLAvatarNameCache::getPNSName(ids.get(i), full_name))
&& LLAvatarNameCache::getNSName(ids.get(i), full_name))
{
LLUIString offline = LLTrans::getString("offline_message");
offline.setArg("[NAME]", full_name);

View File

@@ -182,7 +182,6 @@ struct MenuFloaterDict : public LLSingleton<MenuFloaterDict>
registerFloater("DayCycle", boost::bind(LLFloaterDayCycle::show), boost::bind(LLFloaterDayCycle::isOpen));
registerFloater("debug avatar", boost::bind(handle_debug_avatar_textures, (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("EnvSettings", boost::bind(LLFloaterEnvSettings::show), boost::bind(LLFloaterEnvSettings::isOpen));
registerFloater("fly", boost::bind(LLAgent::toggleFlying));
@@ -229,6 +228,7 @@ struct MenuFloaterDict : public LLSingleton<MenuFloaterDict>
registerFloater<LLFloaterChat> ("chat history");
registerFloater<LLFloaterChatterBox> ("communicate");
registerFloater<LLFloaterDestinations> ("destinations");
registerFloater<LLFloaterDisplayName> ("displayname");
registerFloater<LLFloaterMyFriends> ("friends", 0);
registerFloater<LLFloaterGesture> ("gestures");
registerFloater<LLFloaterMyFriends> ("groups", 1);

View File

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

View File

@@ -952,7 +952,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& tool_tip, LLRect* stick
LLVector3d targetPosition = (*current).second;
std::string fullName;
if (targetUUID.notNull() && LLAvatarNameCache::getPNSName(targetUUID, fullName))
if (targetUUID.notNull() && LLAvatarNameCache::getNSName(targetUUID, fullName))
{
//tool_tip.append(fullName);
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b

File diff suppressed because it is too large Load Diff

View File

@@ -88,12 +88,10 @@ class LLPanelAvatarFirstLife : public LLPanelAvatarTab
public:
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);
static void onClickImage( void *userdata);
void onClickImage();
void enableControls(BOOL own_avatar);
};
@@ -104,30 +102,29 @@ class LLPanelAvatarSecondLife
{
public:
LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar );
~LLPanelAvatarSecondLife();
/*virtual*/ BOOL postBuild(void);
/*virtual*/ BOOL postBuild();
/*virtual*/ void refresh();
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
static void onClickImage( void *userdata);
static void onClickFriends( void *userdata);
static void onDoubleClickGroup(void* userdata);
static void onClickPublishHelp(void *userdata);
static void onClickPartnerHelp(void *userdata);
void onClickImage();
void onClickFriends();
void onDoubleClickGroup();
static bool onClickPartnerHelpLoadURL(const LLSD& notification, const LLSD& response);
static void onClickPartnerInfo(void *userdata);
// Clear out the controls anticipating new network data.
void clearControls();
void enableControls(BOOL own_avatar);
void updateOnlineText(BOOL online, BOOL have_calling_card);
void updatePartnerName();
void updatePartnerName(const LLAvatarName& name);
void setPartnerID(LLUUID id) { mPartnerID = id; }
private:
LLUUID mPartnerID;
boost::signals2::connection mCacheConnection;
};
@@ -139,7 +136,7 @@ class LLPanelAvatarWeb :
public:
LLPanelAvatarWeb(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
/*virtual*/ ~LLPanelAvatarWeb();
/*virtual*/ BOOL postBuild(void);
/*virtual*/ BOOL postBuild();
/*virtual*/ void refresh();
@@ -149,11 +146,8 @@ public:
void setWebURL(std::string url);
void load(std::string url);
void onURLKeystroke(LLLineEditor* editor);
void load(const std::string& url);
void onCommitLoad(const LLSD& value);
void onCommitURL(const LLSD& value);
static void onClickWebProfileHelp(void *);
// inherited from LLViewerMediaObserver
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
@@ -170,7 +164,7 @@ class LLPanelAvatarAdvanced : public LLPanelAvatarTab
public:
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);
@@ -197,7 +191,7 @@ class LLPanelAvatarNotes : public LLPanelAvatarTab
public:
LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
/*virtual*/ BOOL postBuild(void);
/*virtual*/ BOOL postBuild();
/*virtual*/ void refresh();
@@ -212,7 +206,7 @@ class LLPanelAvatarClassified : public LLPanelAvatarTab
public:
LLPanelAvatarClassified(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
/*virtual*/ BOOL postBuild(void);
/*virtual*/ BOOL postBuild();
/*virtual*/ void refresh();
@@ -230,11 +224,13 @@ public:
void deleteClassifiedPanels();
private:
static void onClickNew(void* data);
static void onClickDelete(void* data);
void onClickNew();
void onClickDelete();
bool callbackDelete(const LLSD& notification, const LLSD& response);
bool callbackNew(const LLSD& notification, const LLSD& response);
bool mInDirectory;
};
@@ -253,13 +249,13 @@ public:
void deletePickPanels();
private:
static void onClickNew(void* data);
static void onClickDelete(void* data);
void onClickNew();
void onClickDelete();
//Pick import and export - RK
static void onClickImport(void* data);
void onClickImport();
static void onClickImport_continued(void* self, bool import);
static void onClickExport(void* data);
void onClickExport();
bool callbackDelete(const LLSD& notification, const LLSD& response);
@@ -310,12 +306,12 @@ public:
void selectTab(S32 tabnum);
void selectTabByName(std::string tab_name);
BOOL haveData() { return mHaveProperties && mHaveStatistics; }
BOOL isEditable() const { return mAllowEdit; }
bool haveData() const { return mHaveProperties && mHaveStatistics; }
bool isEditable() const { return mAllowEdit; }
static void onClickGetKey(void *userdata);
static void onClickOK( void *userdata);
static void onClickCancel( void *userdata);
void onClickGetKey();
void onClickOK();
void onClickCancel();
private:
void enableOKIfReady();
@@ -347,15 +343,16 @@ public:
private:
LLUUID mAvatarID; // for which avatar is this window?
BOOL mIsFriend; // Are we friends?
BOOL mHaveProperties;
BOOL mHaveStatistics;
bool mIsFriend; // Are we friends?
bool mHaveProperties;
bool mHaveStatistics;
// only update note if data received from database and
// note is changed from database version
bool mHaveNotes;
std::string mLastNotes;
LLTabContainer* mTab;
BOOL mAllowEdit;
bool mAllowEdit;
boost::signals2::connection mCacheConnection;
typedef std::list<LLPanelAvatar*> panel_list_t;
static panel_list_t sAllPanels;

View File

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

View File

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

View File

@@ -31,6 +31,7 @@
#include "llagent.h"
#include "llavatarnamecache.h"
#include "llavataractions.h"
#include "llfloateravatarpicker.h"
#include "llbutton.h"
#include "llcallingcard.h"
@@ -101,6 +102,9 @@ BOOL LLPanelGroupBulkBan::postBuild()
}
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();
return TRUE;
@@ -108,6 +112,25 @@ BOOL LLPanelGroupBulkBan::postBuild()
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<LLScrollListItem*> agents = mImplementation->mBulkAgentList->getAllData();
std::vector<LLScrollListItem*>::iterator iter = agents.begin();
@@ -117,8 +140,8 @@ void LLPanelGroupBulkBan::submit()
banned_agent_list.push_back(agent->getUUID());
}
const S32 MAX_GROUP_BANS = 100; // Max invites per request. 100 to match server cap.
if (banned_agent_list.size() > MAX_GROUP_BANS)
const S32 MAX_BANS_PER_REQUEST = 100; // Max bans per request. 100 to match server cap.
if (banned_agent_list.size() > MAX_BANS_PER_REQUEST)
{
// Fail!
LLSD msg;
@@ -128,33 +151,100 @@ void LLPanelGroupBulkBan::submit()
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)
{
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;
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!
std::string av_name;
LLAvatarNameCache::getPNSName(group_ban_agent_id, av_name);
LLAvatarName av_name;
LLAvatarNameCache::get(group_ban_agent_id, &av_name);
banned_avatar_names.push_back(av_name);
LLStringUtil::format_map_t string_args;
string_args["[RESIDENT]"] = av_name;
LLSD msg;
msg["MESSAGE"] = getString("already_banned", string_args);
LLNotificationsUtil::add("GenericAlert", msg);
(*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData);
return;
banned_agent_list.erase(conflict);
if (banned_agent_list.size() == 0)
{
break;
}
}
}
// 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);
LLGroupMgr::getInstance()->sendGroupMemberEjects(mImplementation->mGroupID, banned_agent_list);
// sending request and ejecting members
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
(*(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();
//static void callbackClickSubmit(void* userdata);
virtual void submit();
private:
std::string buildResidentsArgument(std::vector<LLAvatarName> avatar_names, const std::string &format);
};
#endif // LL_LLPANELGROUPBULKBAN_H

View File

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

View File

@@ -51,6 +51,8 @@
#include "lluictrlfactory.h"
#include "llviewerwindow.h"
#include <boost/foreach.hpp>
class LLPanelGroupInvite::impl : public boost::signals2::trackable
{
public:
@@ -69,7 +71,7 @@ public:
static void callbackClickAdd(void* userdata);
static void callbackClickRemove(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,
const LLAvatarName& av_name);
@@ -93,6 +95,8 @@ public:
void (*mCloseCallback)(void* data);
void* mCloseCallbackUserData;
std::map<LLUUID, boost::signals2::connection> mAvatarNameCacheConnection;
};
@@ -106,14 +110,20 @@ LLPanelGroupInvite::impl::impl(const LLUUID& group_id):
mGroupName( NULL ),
mConfirmedOwnerInvite( false ),
mCloseCallback( NULL ),
mCloseCallbackUserData( NULL )
mCloseCallbackUserData( NULL ),
mAvatarNameCacheConnection()
{
}
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,
const uuid_vec_t& agent_ids)
{
@@ -191,7 +201,6 @@ void LLPanelGroupInvite::impl::submitInvitations()
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)
{
// Fail!
@@ -381,7 +390,12 @@ void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids)
std::vector<std::string> names;
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));
}
}
@@ -389,6 +403,10 @@ void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids)
void LLPanelGroupInvite::impl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
if (mAvatarNameCacheConnection[agent_id].connected())
{
mAvatarNameCacheConnection[agent_id].disconnect();
}
std::vector<std::string> names;
uuid_vec_t agent_ids;
agent_ids.push_back(agent_id);
@@ -476,9 +494,7 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids)
}
else
{
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
names.push_back(av_name.getNSName());
}
}
}
@@ -491,9 +507,7 @@ void LLPanelGroupInvite::addUserCallback(const LLUUID& id, const LLAvatarName& a
std::vector<std::string> names;
uuid_vec_t agent_ids;
agent_ids.push_back(id);
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
names.push_back(av_name.getNSName());
mImplementation->addUsers(names, agent_ids);
}

View File

@@ -74,7 +74,7 @@ bool agentCanAddToRole(const LLUUID& group_id,
if (!gdatap)
{
llwarns << "agentCanAddToRole "
<< "-- No group data!" << llendl;
<< "-- No group data!" << LL_ENDL;
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
// 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 ||
(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;
std::string av_name;
LLAvatarNameCache::getPNSName(*i, av_name);
LLAvatarNameCache::getNSName(*i, av_name);
args["AVATAR_NAME"] = av_name;
args["GROUP_NAME"] = group_data->mName;
@@ -1699,6 +1699,12 @@ void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data)
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)
{
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
std::string name;
LLAvatarNameCache::getPNSName(av_name, name); // Singu Note: Diverge from LL Viewer and filter by name displayed
if (matchesSearchFilter(name))
// Singu Note: Diverge from LL Viewer and filter by name displayed
if (matchesSearchFilter(av_name.getNSName(group_member_name_system())))
{
addMemberToList(member);
if(!mMembersList->getEnabled())
@@ -1771,11 +1776,11 @@ void LLPanelGroupMembersSubTab::updateMembers()
continue;
// Do filtering on name if it is already in the cache.
// Singu Note: Diverge from LL Viewer and filter by name displayed
std::string fullname;
if (LLAvatarNameCache::getPNSName(mMemberProgress->first, fullname))
LLAvatarName av_name;
if (LLAvatarNameCache::get(mMemberProgress->first, &av_name))
{
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);
}

View File

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

View File

@@ -3524,10 +3524,10 @@ void LLStartUp::initNameCache()
// Start cache in not-running state until we figure out if we have
// capabilities for display name lookup
LLAvatarNameCache::initClass(false);
S32 phoenix_name_system = gSavedSettings.getS32("PhoenixNameSystem");
if(phoenix_name_system <= 0 || phoenix_name_system > 3) LLAvatarNameCache::setUseDisplayNames(false);
else LLAvatarNameCache::setUseDisplayNames(true);
LLAvatarNameCache::initClass(false, gSavedSettings.getBOOL("UsePeopleAPI"));
LLAvatarNameCache::setUseDisplayNames(phoenix_name_system > 0 && phoenix_name_system < 4);
LLAvatarNameCache::setUseUsernames(!phoenix_name_system || phoenix_name_system == 1 || phoenix_name_system == 3);
}
void LLStartUp::cleanupNameCache()

View File

@@ -40,9 +40,6 @@
#include "llnotificationsutil.h"
#include "llui.h" // getLanguage()
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy setDisplayNameResponder_timeout;
namespace LLViewerDisplayName
{
// Fired when viewer receives server response to display name change
@@ -56,19 +53,21 @@ namespace LLViewerDisplayName
sNameChangedSignal.connect(cb);
}
void doNothing() { }
}
class LLSetDisplayNameResponder : public LLHTTPClient::ResponderIgnoreBody
{
public:
LOG_CLASS(LLSetDisplayNameResponder);
private:
// only care about errors
/*virtual*/ void httpFailure(void)
/*virtual*/ void httpFailure()
{
llwarns << dumpResponse() << LL_ENDL;
LLViewerDisplayName::sSetDisplayNameSignal(false, "", LLSD());
LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots();
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return setDisplayNameResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLSetDisplayNameResponder"; }
};
@@ -102,7 +101,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl
// People API expects array of [ "old value", "new value" ]
LLSD change_array = LLSD::emptyArray();
change_array.append(av_name.mDisplayName);
change_array.append(av_name.getDisplayName());
change_array.append(display_name);
llinfos << "Set name POST to " << cap_url << llendl;
@@ -130,7 +129,7 @@ public:
LLSD body = input["body"];
S32 status = body["status"].asInteger();
bool success = (status == 200);
bool success = (status == HTTP_OK);
std::string reason = body["reason"].asString();
LLSD content = body["content"];
@@ -139,14 +138,14 @@ public:
// If viewer's concept of display name is out-of-date, the set request
// will fail with 409 Conflict. If that happens, fetch up-to-date
// name information.
if (status == 409)
if (status == HTTP_CONFLICT)
{
LLUUID agent_id = gAgent.getID();
// Flush stale data
LLAvatarNameCache::erase( agent_id );
// Queue request for new data
LLAvatarName ignored;
LLAvatarNameCache::get( agent_id, &ignored );
// Queue request for new data: nothing to do on callback though...
// Note: no need to disconnect the callback as it never gets out of scope
LLAvatarNameCache::get(agent_id, boost::bind(&LLViewerDisplayName::doNothing));
// Kill name tag, as it is wrong
LLVOAvatar::invalidateNameTag( agent_id );
}
@@ -160,7 +159,6 @@ public:
class LLDisplayNameUpdate : public LLHTTPNode
{
/*virtual*/ void post(
LLHTTPNode::ResponsePtr response,
const LLSD& context,
@@ -178,14 +176,15 @@ class LLDisplayNameUpdate : public LLHTTPNode
llinfos << "name-update now " << LLDate::now()
<< " next_update " << LLDate(av_name.mNextUpdate)
<< llendl;
<< LL_ENDL;
// Name expiration time may be provided in headers, or we may use a
// default value
// *TODO: get actual headers out of ResponsePtr
//LLSD headers = response->mHeaders;
AIHTTPReceivedHeaders headers;
av_name.mExpires =
LLAvatarNameCache::nameExpirationFromHeaders(AIHTTPReceivedHeaders());
LLAvatarNameCache::nameExpirationFromHeaders(headers);
LLAvatarNameCache::insert(agent_id, av_name);
@@ -196,8 +195,8 @@ class LLDisplayNameUpdate : public LLHTTPNode
{
LLSD args;
args["OLD_NAME"] = old_display_name;
args["SLID"] = av_name.mUsername;
args["NEW_NAME"] = av_name.mDisplayName;
args["SLID"] = av_name.getUserName();
args["NEW_NAME"] = av_name.getDisplayName();
LLNotificationsUtil::add("DisplayNameUpdate", args);
}
if (agent_id == gAgent.getID())
@@ -214,4 +213,3 @@ LLHTTPRegistration<LLSetDisplayNameReply>
LLHTTPRegistration<LLDisplayNameUpdate>
gHTTPRegistrationMessageDisplayNameUpdate(
"/message/DisplayNameUpdate");

View File

@@ -3811,12 +3811,11 @@ class LLEditEnableCustomizeAvatar : public view_listener_t
class LLEditEnableChangeDisplayname : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
bool new_value = LLAvatarNameCache::useDisplayNames();
gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
return true;
}
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
gMenuHolder->findControl(userdata["control"].asString())->setValue(LLAvatarName::useDisplayNames());
return true;
}
};
bool is_object_sittable()

View File

@@ -2096,7 +2096,7 @@ static std::string clean_name_from_task_im(const std::string& msg,
// Don't try to clean up group names
if (!from_group)
{
if (LLAvatarNameCache::useDisplayNames())
if (LLAvatarName::useDisplayNames())
{
// ...just convert to username
final += LLCacheName::buildUsername(name);
@@ -2119,22 +2119,20 @@ void notification_display_name_callback(const LLUUID& id,
LLSD& substitutions,
const LLSD& payload)
{
substitutions["NAME"] = av_name.mDisplayName;
substitutions["NAME"] = av_name.getDisplayName();
LLNotificationsUtil::add(name, substitutions, payload);
}
// Callback for name resolution of a god/estate message
void god_message_name_cb(const LLAvatarName& av_name, LLChat chat, std::string message)
{
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
LLSD args;
args["NAME"] = name;
args["NAME"] = av_name.getNSName();
args["MESSAGE"] = message;
LLNotificationsUtil::add("GodMessage", args);
// Treat like a system message and put in chat history.
chat.mText = name + ": " + message;
chat.mText = av_name.getNSName() + ": " + message;
// Claim to be from a local agent so it doesn't go into console.
LLFloaterChat::addChat(chat, false, true);
@@ -2155,7 +2153,7 @@ std::string replace_wildcards(std::string autoresponse, const LLUUID& id, const
// Add in their display name
LLAvatarName av_name;
boost::algorithm::replace_all(autoresponse, "#d", LLAvatarNameCache::get(id, &av_name) ? av_name.mDisplayName : name);
boost::algorithm::replace_all(autoresponse, "#d", LLAvatarNameCache::get(id, &av_name) ? av_name.getDisplayName() : name);
if (!isAgentAvatarValid()) return autoresponse;
// Add in idle time
@@ -2453,11 +2451,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
session_id);
gAgent.sendReliableMessage();
std::string pns_name;
if (!LLAvatarNameCache::getPNSName(from_id, pns_name)) pns_name = name;
LLAvatarName av_name;
std::string ns_name = LLAvatarNameCache::get(from_id, &av_name) ? av_name.getNSName() : name;
if (show_autoresponded)
{
gIMMgr->addMessage(session_id, from_id, name, LLTrans::getString("IM_autoresponded_to") + " " + pns_name);
gIMMgr->addMessage(session_id, from_id, name, LLTrans::getString("IM_autoresponded_to") + " " + ns_name);
}
if (LLViewerInventoryItem* item = gInventory.getItem(itemid))
{
@@ -2465,7 +2463,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
if (show_autoresponded)
{
gIMMgr->addMessage(computed_session_id, from_id, name,
llformat("%s %s \"%s\"", pns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str()));
llformat("%s %s \"%s\"", ns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str()));
}
}
}
@@ -2584,14 +2582,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
// Don't announce that someone has started messaging, if they're muted or when in busy mode
if (!is_muted && (!accept_im_from_only_friend || is_friend) && !is_do_not_disturb && !gIMMgr->hasSession(computed_session_id) && gSavedSettings.getBOOL("AscentInstantMessageAnnounceIncoming"))
{
std::string pns_name;
if (!LLAvatarNameCache::getPNSName(from_id, pns_name)) pns_name = name;
LLAvatarName av_name;
std::string ns_name = LLAvatarNameCache::get(from_id, &av_name) ? av_name.getNSName() : name;
gIMMgr->addMessage(
computed_session_id,
from_id,
name,
llformat("%s ", pns_name.c_str()) + LLTrans::getString("IM_announce_incoming"),
llformat("%s ", ns_name.c_str()) + LLTrans::getString("IM_announce_incoming"),
name,
IM_NOTHING_SPECIAL,
parent_estate_id,
@@ -2628,7 +2626,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
if (show_autoresponded)
{
gIMMgr->addMessage(session_id, from_id, name, LLTrans::getString("IM_autoresponded_to") + " " + pns_name);
gIMMgr->addMessage(session_id, from_id, name, LLTrans::getString("IM_autoresponded_to") + " " + ns_name);
}
if (LLViewerInventoryItem* item = gInventory.getItem(itemid))
{
@@ -2636,7 +2634,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
if (show_autoresponded)
{
gIMMgr->addMessage(computed_session_id, from_id, name,
llformat("%s %s \"%s\"", pns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str()));
llformat("%s %s \"%s\"", ns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str()));
}
}
}
@@ -3486,11 +3484,11 @@ void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, c
IM_ONLINE,
IM_BUSY_AUTO_RESPONSE);
gAgent.sendReliableMessage();
std::string pns_name;
if (!LLAvatarNameCache::getPNSName(from_id, pns_name)) pns_name = from_name;
LLAvatarName av_name;
std::string ns_name = LLAvatarNameCache::get(from_id, &av_name) ? av_name.getNSName() : from_name;
LLUUID session_id;
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, session_id);
if (gSavedPerAccountSettings.getBOOL("BusyModeResponseShow")) gIMMgr->addMessage(session_id, from_id, from_name, LLTrans::getString("IM_autoresponded_to") + " " + pns_name);
if (gSavedPerAccountSettings.getBOOL("BusyModeResponseShow")) gIMMgr->addMessage(session_id, from_id, from_name, LLTrans::getString("IM_autoresponded_to") + " " + ns_name);
if (!gSavedPerAccountSettings.getBOOL("BusyModeResponseItem")) return; // Not sending an item, finished
if (LLViewerInventoryItem* item = gInventory.getItem(static_cast<LLUUID>(gSavedPerAccountSettings.getString("BusyModeResponseItemID"))))
{
@@ -3499,7 +3497,7 @@ void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, c
LLUUID computed_session_id = LLIMMgr::computeSessionID(static_cast<EInstantMessage>(d), from_id);
LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id);
if (gSavedPerAccountSettings.getBOOL("BusyModeResponseShow"))
gIMMgr->addMessage(computed_session_id, from_id, from_name, llformat("%s %s \"%s\"", pns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str()));
gIMMgr->addMessage(computed_session_id, from_id, from_name, llformat("%s %s \"%s\"", ns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str()));
}
}
}
@@ -3794,7 +3792,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
LLAvatarName av_name;
if (LLAvatarNameCache::get(from_id, &av_name))
{
chat.mFromName = av_name.mDisplayName;
chat.mFromName = av_name.getDisplayName();
}
else
{
@@ -3997,7 +3995,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
if (chatter && chatter->isAvatar())
{
if (LLAvatarNameCache::getPNSName(from_id, from_name))
if (LLAvatarNameCache::getNSName(from_id, from_name))
chat.mFromName = from_name;
}
@@ -6275,15 +6273,14 @@ static void money_balance_avatar_notify(const LLUUID& agent_id,
{
bool no_transaction_clutter = gSavedSettings.getBOOL("LiruNoTransactionClutter");
std::string notification = no_transaction_clutter ? "Payment" : "SystemMessage";
std::string name;
LLAvatarNameCache::getPNSName(av_name,name);
args["NAME"] = name;
args["NAME"] = av_name.getNSName();
LLSD msg_args;
msg_args["MESSAGE"] = LLTrans::getString(message,args);
LLNotificationsUtil::add(notification,msg_args,payload);
if (!no_transaction_clutter) LLFloaterChat::addChat(msg_args["MESSAGE"].asString()); // Alerts won't automatically log to chat.
}
static void process_money_balance_reply_extended(LLMessageSystem* msg)
{
// Added in server 1.40 and viewer 2.1, support for localization
@@ -6500,83 +6497,101 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
}
// some of the server notifications need special handling. This is where we do that.
bool handle_teleport_access_blocked(LLSD& llsdBlock)
bool handle_teleport_access_blocked(LLSD& llsdBlock, const std::string & notificationID, const std::string & defaultMessage)
{
std::string notificationID("TeleportEntryAccessBlocked");
U8 regionAccess = static_cast<U8>(llsdBlock["_region_access"].asInteger());
std::string regionMaturity = LLViewerRegion::accessToString(regionAccess);
LLStringUtil::toLower(regionMaturity);
llsdBlock["REGIONMATURITY"] = regionMaturity;
bool returnValue = false;
LLNotificationPtr maturityLevelNotification;
std::string notifySuffix = "_Notify";
if (regionAccess == SIM_ACCESS_MATURE)
{
if (gAgent.isTeen())
{
gAgent.clearTeleportRequest();
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
returnValue = true;
LLNotificationPtr tp_failure_notification;
std::string notifySuffix;
notifySuffix = "_NotifyAdultsOnly";
}
else if (gAgent.prefersPG())
if (notificationID == std::string("TeleportEntryAccessBlocked"))
{
notifySuffix = "_Notify";
if (regionAccess == SIM_ACCESS_MATURE)
{
if (gAgent.hasRestartableFailedTeleportRequest())
if (gAgent.isTeen())
{
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
gAgent.clearTeleportRequest();
tp_failure_notification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
returnValue = true;
notifySuffix = "_NotifyAdultsOnly";
}
else if (gAgent.prefersPG())
{
if (gAgent.hasRestartableFailedTeleportRequest())
{
tp_failure_notification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
returnValue = true;
}
else
{
gAgent.clearTeleportRequest();
tp_failure_notification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
returnValue = true;
}
}
else
{
gAgent.clearTeleportRequest();
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
tp_failure_notification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
returnValue = true;
}
}
else
else if (regionAccess == SIM_ACCESS_ADULT)
{
gAgent.clearTeleportRequest();
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
returnValue = true;
}
}
else if (regionAccess == SIM_ACCESS_ADULT)
{
if (!gAgent.isAdult())
{
gAgent.clearTeleportRequest();
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
returnValue = true;
notifySuffix = "_NotifyAdultsOnly";
}
else if (gAgent.prefersPG() || gAgent.prefersMature())
{
if (gAgent.hasRestartableFailedTeleportRequest())
if (!gAgent.isAdult())
{
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
gAgent.clearTeleportRequest();
tp_failure_notification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
returnValue = true;
notifySuffix = "_NotifyAdultsOnly";
}
else if (gAgent.prefersPG() || gAgent.prefersMature())
{
if (gAgent.hasRestartableFailedTeleportRequest())
{
tp_failure_notification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
returnValue = true;
}
else
{
gAgent.clearTeleportRequest();
tp_failure_notification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
returnValue = true;
}
}
else
{
gAgent.clearTeleportRequest();
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
tp_failure_notification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
returnValue = true;
}
}
} // End of special handling for "TeleportEntryAccessBlocked"
else
{ // Normal case, no message munging
gAgent.clearTeleportRequest();
if (LLNotificationTemplates::getInstance()->templateExists(notificationID))
{
tp_failure_notification = LLNotificationsUtil::add(notificationID, llsdBlock, llsdBlock);
}
else
{
gAgent.clearTeleportRequest();
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
returnValue = true;
llsdBlock["MESSAGE"] = defaultMessage;
tp_failure_notification = LLNotificationsUtil::add("GenericAlertOK", llsdBlock);
}
returnValue = true;
}
if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored())
if ((tp_failure_notification == NULL) || tp_failure_notification->isIgnored())
{
// Given a simple notification if no maturityLevelNotification is set or it is ignore
// Given a simple notification if no tp_failure_notification is set or it is ignore
LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock);
}
@@ -6942,8 +6957,7 @@ void chat_mean_collision(const LLUUID& id, const LLAvatarName& avname, const EMe
args["ACT"] = LLTrans::getString("physical_object_collide");
else
return; // How did we get here? I used to know you so well.
std::string name;
LLAvatarNameCache::getPNSName(avname, name);
const std::string name(avname.getNSName());
args["NAME"] = name;
args["MAG"] = llformat("%f", mag);
LLChat chat(LLTrans::getString("BumpedYou", args));
@@ -7237,6 +7251,7 @@ bool script_question_cb(const LLSD& notification, const LLSD& response)
return false;
}
static LLNotificationFunctorRegistration script_question_cb_reg_1("ScriptQuestion", script_question_cb);
static LLNotificationFunctorRegistration script_question_cb_reg_2("ScriptQuestionCaution", script_question_cb);
@@ -7384,7 +7399,6 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
// fall back to default behavior if cautions are entirely disabled
LLNotificationsUtil::add("ScriptQuestion", args, payload);
}
}
}
@@ -7516,8 +7530,8 @@ std::string formatted_time(const time_t& the_time)
void process_teleport_failed(LLMessageSystem *msg, void**)
{
std::string reason;
std::string big_reason;
std::string message_id; // Tag from server, like "RegionEntryAccessBlocked"
std::string big_reason; // Actual message to display
LLSD args;
// Let the interested parties know that teleport failed.
@@ -7527,16 +7541,16 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
if (msg->has(_PREHASH_AlertInfo) && msg->getSizeFast(_PREHASH_AlertInfo, _PREHASH_Message) > 0)
{
// Get the message ID
msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, reason);
big_reason = LLAgent::sTeleportErrorMessages[reason];
msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, message_id);
big_reason = LLAgent::sTeleportErrorMessages[message_id];
if ( big_reason.size() > 0 )
{ // Substitute verbose reason from the local map
args["REASON"] = big_reason;
}
else
{ // Nothing found in the map - use what the server returned in the original message block
msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, reason);
args["REASON"] = reason;
msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, big_reason);
args["REASON"] = big_reason;
}
LLSD llsd_block;
@@ -7552,7 +7566,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
else
{
// change notification name in this special case
if (handle_teleport_access_blocked(llsd_block))
if (handle_teleport_access_blocked(llsd_block, message_id, args["REASON"]))
{
if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE )
{
@@ -7565,17 +7579,17 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
}
else
{
msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, reason);
{ // Extra message payload not found - use what the simulator sent
msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, message_id);
big_reason = LLAgent::sTeleportErrorMessages[reason];
big_reason = LLAgent::sTeleportErrorMessages[message_id];
if ( big_reason.size() > 0 )
{ // Substitute verbose reason from the local map
args["REASON"] = big_reason;
}
else
{ // Nothing found in the map - use what the server returned
args["REASON"] = reason;
args["REASON"] = message_id;
}
}
@@ -7621,9 +7635,8 @@ void process_teleport_local(LLMessageSystem *msg,void**)
}
}
static LLCachedControl<bool> fly_after_tp(gSavedSettings, "LiruFlyAfterTeleport");
// Sim tells us whether the new position is off the ground
if (fly_after_tp || (teleport_flags & TELEPORT_FLAGS_IS_FLYING))
if (teleport_flags & TELEPORT_FLAGS_IS_FLYING || gSavedSettings.getBOOL("LiruFlyAfterTeleport"))
{
gAgent.setFlying(TRUE);
}
@@ -7759,6 +7772,7 @@ void send_lures(const LLSD& notification, const LLSD& response)
msg->nextBlockFast(_PREHASH_TargetData);
msg->addUUIDFast(_PREHASH_TargetID, target_id);
// Record the offer.
if (notification["payload"]["ids"].size() < 10) // Singu Note: Do NOT spam chat!
{
@@ -7767,14 +7781,13 @@ void send_lures(const LLSD& notification, const LLSD& response)
// [/RLVa:KB]
std::string target_name;
gCacheName->getFullName(target_id, target_name); // for im log filenames
LLSD args;
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
if (fRlvHideName)
target_name = RlvStrings::getAnonym(target_name);
else
// [/RLVa:KB]
LLAvatarNameCache::getPNSName(target_id, target_name);
LLAvatarNameCache::getNSName(target_id, target_name);
args["TO_NAME"] = target_name;
LLSD payload;
@@ -8411,9 +8424,7 @@ void process_covenant_reply(LLMessageSystem* msg, void**)
void callbackCacheEstateOwnerName(const LLUUID& id, const LLAvatarName& av_name)
{
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
const std::string name(av_name.getNSName());
LLPanelEstateCovenant::updateEstateOwnerName(name);
LLPanelLandCovenant::updateEstateOwnerName(name);
LLPanelEstateInfo::updateEstateOwnerName(name);

View File

@@ -3363,10 +3363,10 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
// LLFontGL::getFontSansSerifSmall());
}
// On SecondLife we can take a shortcut through getPNSName, which will strip out Resident
// On SecondLife we can take a shortcut through getNSName, which will strip out Resident
if (gHippoGridManager->getConnectedGrid()->isSecondLife())
{
if (!LLAvatarNameCache::getPNSName(getID(), firstnameText))
if (!LLAvatarNameCache::getNSName(getID(), firstnameText))
{
// ...call this function back when the name arrives and force a rebuild
LLAvatarNameCache::get(getID(), boost::bind(&LLVOAvatar::clearNameTag, this));
@@ -3387,7 +3387,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
bool show_display_names = phoenix_name_system > 0 || phoenix_name_system < 4;
bool show_usernames = phoenix_name_system != 2;
if (show_display_names && LLAvatarNameCache::useDisplayNames())
if (show_display_names && LLAvatarName::useDisplayNames())
{
LLAvatarName av_name;
if (!LLAvatarNameCache::get(getID(), &av_name))
@@ -3405,22 +3405,21 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
// Might be blank if name not available yet, that's OK
if (show_display_names)
{
firstnameText = phoenix_name_system == 3 ? av_name.mUsername : av_name.mDisplayName; //Defer for later formatting
//addNameTagLine(av_name.mDisplayName, name_tag_color, LLFontGL::NORMAL,
firstnameText = phoenix_name_system == 3 ? av_name.getUserName() : av_name.getDisplayName(); //Defer for later formatting
//addNameTagLine(av_name.getDisplayName(), name_tag_color, LLFontGL::NORMAL,
// LLFontGL::getFontSansSerif());
}
// Suppress SLID display if display name matches exactly (ugh)
if (show_usernames && !av_name.mIsDisplayNameDefault && !av_name.mUsername.empty())
if (show_usernames && !av_name.isDisplayNameDefault())
{
firstnameText.push_back(' ');
firstnameText.push_back('(');
firstnameText.append(phoenix_name_system == 3 ? av_name.mDisplayName : av_name.mUsername); //Defer for later formatting
firstnameText.append(phoenix_name_system == 3 ? av_name.getDisplayName() : av_name.getAccountName()); //Defer for later formatting
firstnameText.push_back(')');
// *HACK: Desaturate the color
//LLColor4 username_color = name_tag_color * 0.83f;
//nameText=av_name.mUsername;
//addNameTagLine(av_name.mUsername, username_color, LLFontGL::NORMAL,
//LLFontGL::getFontSansSerifSmall());
//addNameTagLine(av_name.getUserName(), username_color, LLFontGL::NORMAL,
// LLFontGL::getFontSansSerifSmall());
}
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
}
@@ -3707,11 +3706,11 @@ LLColor4 LLVOAvatar::getNameTagColor(bool is_friend)
static const LLCachedControl<LLColor4> avatar_name_color(gColors,"AvatarNameColor",LLColor4(LLColor4U(251, 175, 93, 255)) );
return avatar_name_color;
}
/*else if (LLAvatarNameCache::useDisplayNames())
/*else if (LLAvatarName::useDisplayNames())
{
// ...color based on whether username "matches" a computed display name
LLAvatarName av_name;
if (LLAvatarNameCache::get(getID(), &av_name) && av_name.mIsDisplayNameDefault)
if (LLAvatarNameCache::get(getID(), &av_name) && av_name.isDisplayNameDefault())
{
color_name = "NameTagMatch";
}
@@ -5637,7 +5636,7 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL
if (announce_snapshots)
{
std::string name;
LLAvatarNameCache::getPNSName(mID, name);
LLAvatarNameCache::getNSName(mID, name);
LLChat chat;
chat.mFromName = name;
chat.mText = name + " " + LLTrans::getString("took_a_snapshot") + ".";
@@ -6404,19 +6403,32 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
if (!attachment)
{
llwarns << "Object attachment point invalid: " << attachmentID << llendl;
llwarns << "Object attachment point invalid: " << attachmentID
<< " trying to use 1 (chest)"
<< LL_ENDL;
if (isSelf() && attachmentID == 127 && gSavedSettings.getBOOL("SGDetachBridge"))
{
llinfos << "Bridge detected! detaching" << llendl;
sDetachBridgeConnection = gAgentAvatarp->setAttachmentCallback(boost::bind(detach_bridge, _1, viewer_object));
}
// attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
// [SL:KB] - Patch: Appearance-LegacyMultiAttachment | Checked: 2010-08-28 (Catznip-2.2.0a) | Added: Catznip2.1.2a
S32 idxAttachPt = 1;
if ( (!isSelf()) && (gSavedSettings.getBOOL("LegacyMultiAttachmentSupport")) && (attachmentID > 38) && (attachmentID <= 68) )
idxAttachPt = attachmentID - 38;
attachment = get_if_there(mAttachmentPoints, idxAttachPt, (LLViewerJointAttachment*)NULL);
// [/SL:KB]
attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
if (attachment)
{
llwarns << "Object attachment point invalid: " << attachmentID
<< " on object " << viewer_object->getID()
<< " attachment item " << viewer_object->getAttachmentItemID()
<< " falling back to 1 (chest)"
<< LL_ENDL;
}
else
{
llwarns << "Object attachment point invalid: " << attachmentID
<< " on object " << viewer_object->getID()
<< " attachment item " << viewer_object->getAttachmentItemID()
<< "Unable to use fallback attachment point 1 (chest)"
<< LL_ENDL;
}
}
return attachment;
@@ -6500,7 +6512,7 @@ void LLVOAvatar::lazyAttach()
llwarns << "attachObject() failed for "
<< cur_attachment->getID()
<< " item " << cur_attachment->getAttachmentItemID()
<< llendl;
<< LL_ENDL;
// MAINT-3312 backout
//still_pending.push_back(cur_attachment);
}
@@ -6805,9 +6817,6 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const
break; // Do nothing
}
/* switch(type)
case LLWearableType::WT_SHIRT:
indicator_te = TEX_UPPER_SHIRT; */
for (LLAvatarAppearanceDictionary::Textures::const_iterator tex_iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin();
tex_iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end();
++tex_iter)
@@ -7256,9 +7265,7 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
{
{
mesh->setColor(color);
}
mesh->setColor(color);
}
}
}

View File

@@ -61,9 +61,6 @@
// for base64 decoding
#include "apr_base64.h"
extern AIHTTPTimeoutPolicy vivoxVoiceAccountProvisionResponder_timeout;
extern AIHTTPTimeoutPolicy vivoxVoiceClientCapResponder_timeout;
#define USE_SESSION_GROUPS 0
const F32 VOLUME_SCALE_VIVOX = 0.01f;
@@ -116,17 +113,19 @@ static int scale_speaker_volume(float volume)
class LLVivoxVoiceAccountProvisionResponder :
public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(LLVivoxVoiceAccountProvisionResponder);
public:
LLVivoxVoiceAccountProvisionResponder(int retries)
{
mRetries = retries;
}
/*virtual*/ void httpFailure(void)
private:
/* virtual */ void httpFailure()
{
LL_WARNS("Voice") << "ProvisionVoiceAccountRequest returned an error, "
<< ( (mRetries > 0) ? "retrying" : "too many retries (giving up)" )
<< mStatus << "]: " << mReason << LL_ENDL;
<< " " << dumpResponse() << LL_ENDL;
if ( mRetries > 0 )
{
@@ -138,30 +137,33 @@ public:
}
}
/*virtual*/ void httpSuccess(void)
/* virtual */ void httpSuccess()
{
std::string voice_sip_uri_hostname;
std::string voice_account_server_uri;
LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response:" << ll_pretty_print_sd(mContent) << LL_ENDL;
LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response:" << dumpResponse() << LL_ENDL;
if(mContent.has("voice_sip_uri_hostname"))
voice_sip_uri_hostname = mContent["voice_sip_uri_hostname"].asString();
const LLSD& content = getContent();
if (!content.isMap())
{
failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
return;
}
if(content.has("voice_sip_uri_hostname"))
voice_sip_uri_hostname = content["voice_sip_uri_hostname"].asString();
// this key is actually misnamed -- it will be an entire URI, not just a hostname.
if(mContent.has("voice_account_server_name"))
voice_account_server_uri = mContent["voice_account_server_name"].asString();
if(content.has("voice_account_server_name"))
voice_account_server_uri = content["voice_account_server_name"].asString();
LLVivoxVoiceClient::getInstance()->login(
mContent["username"].asString(),
mContent["password"].asString(),
content["username"].asString(),
content["password"].asString(),
voice_sip_uri_hostname,
voice_account_server_uri);
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return vivoxVoiceAccountProvisionResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLVivoxVoiceAccountProvisionResponder"; }
private:
@@ -185,37 +187,38 @@ static bool sMuteListListener_listening = false;
class LLVivoxVoiceClientCapResponder : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(LLVivoxVoiceClientCapResponder);
public:
LLVivoxVoiceClientCapResponder(LLVivoxVoiceClient::state requesting_state) : mRequestingState(requesting_state) {};
/*virtual*/ void httpFailure(void);
/*virtual*/ void httpSuccess(void);
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return vivoxVoiceClientCapResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLVivoxVoiceClientCapResponder"; }
private:
// called with bad status codes
/*virtual*/ void httpFailure();
/*virtual*/ void httpSuccess();
/*virtual*/ char const* getName() const { return "LLVivoxVoiceClientCapResponder"; }
LLVivoxVoiceClient::state mRequestingState; // state
};
void LLVivoxVoiceClientCapResponder::httpFailure(void)
void LLVivoxVoiceClientCapResponder::httpFailure()
{
LL_WARNS("Voice") << "LLVivoxVoiceClientCapResponder error [status:"
<< mStatus << "]: " << mReason << LL_ENDL;
LL_WARNS("Voice") << dumpResponse() << LL_ENDL;
LLVivoxVoiceClient::getInstance()->sessionTerminate();
}
void LLVivoxVoiceClientCapResponder::httpSuccess(void)
void LLVivoxVoiceClientCapResponder::httpSuccess()
{
LLSD::map_const_iterator iter;
LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest response:" << ll_pretty_print_sd(mContent) << LL_ENDL;
LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest response:" << dumpResponse() << LL_ENDL;
std::string uri;
std::string credentials;
if ( mContent.has("voice_credentials") )
const LLSD& content = getContent();
if ( content.has("voice_credentials") )
{
LLSD voice_credentials = mContent["voice_credentials"];
LLSD voice_credentials = content["voice_credentials"];
if ( voice_credentials.has("channel_uri") )
{
uri = voice_credentials["channel_uri"].asString();
@@ -819,12 +822,13 @@ void LLVivoxVoiceClient::stateMachine()
// using glib first.
char *voice_path = g_find_program_in_path ("SLVoice");
std::string exe_path;
if (voice_path) {
if (voice_path)
{
exe_path = llformat("%s", voice_path);
free(voice_path);
} else {
exe_path = gDirUtilp->getExecutableDir() + gDirUtilp->getDirDelimiter() + "SLVoice";
}
else
exe_path = gDirUtilp->getExecutableDir() + gDirUtilp->getDirDelimiter() + "SLVoice";
#else
// *FIX:Mani - Using the executable dir instead
// of mAppRODataDir, the working directory from which the app
@@ -2817,7 +2821,7 @@ void LLVivoxVoiceClient::loginResponse(int statusCode, std::string &statusString
// Status code of 20200 means "bad password". We may want to special-case that at some point.
if ( statusCode == 401 )
if ( statusCode == HTTP_UNAUTHORIZED )
{
// Login failure which is probably caused by the delay after a user's password being updated.
LL_INFOS("Voice") << "Account.Login response failure (" << statusCode << "): " << statusString << LL_ENDL;
@@ -3319,7 +3323,7 @@ void LLVivoxVoiceClient::mediaStreamUpdatedEvent(
switch(statusCode)
{
case 0:
case 200:
case HTTP_OK:
// generic success
// Don't change the saved error code (it may have been set elsewhere)
break;
@@ -5565,9 +5569,10 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
{
switch(mAudioSession->mErrorStatusCode)
{
case 404: // NOT_FOUND
case HTTP_NOT_FOUND: // NOT_FOUND
// *TODO: Should this be 503?
case 480: // TEMPORARILY_UNAVAILABLE
case 408: // REQUEST_TIMEOUT
case HTTP_REQUEST_TIME_OUT: // REQUEST_TIMEOUT
// call failed because other user was not available
// treat this as an error case
status = LLVoiceClientStatusObserver::ERROR_NOT_AVAILABLE;
@@ -5646,7 +5651,7 @@ void LLVivoxVoiceClient::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
mAvatarNameCacheConnection.disconnect();
std::string display_name = av_name.mDisplayName;
std::string display_name = av_name.getDisplayName();
avatarNameResolved(agent_id, display_name);
}

View File

@@ -398,7 +398,7 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy)
LLAvatarName avName;
if (LLAvatarNameCache::get(idAgents[idxAgent], &avName))
{
const std::string& strDisplayName = escape_for_regex(avName.mDisplayName);
const std::string& strDisplayName = escape_for_regex(avName.getDisplayName());
bool fFilterDisplay = (strDisplayName.length() > 2);
const std::string& strLegacyName = avName.getLegacyName();
fFilterLegacy &= (strLegacyName.length() > 2);

View File

@@ -296,7 +296,7 @@ template<typename T> struct RlvPredValuesEqual
// Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
inline const std::string& RlvStrings::getAnonym(const LLAvatarName& avName)
{
return getAnonym(avName.mDisplayName);
return getAnonym(avName.getDisplayName());
}
// Checked: 2010-03-26 (RLVa-1.2.0b) | Modified: RLVa-1.0.2a

View File

@@ -243,7 +243,7 @@ void RlvFloaterBehaviours::onBtnCopyToClipboard()
if (gObjectList.findObject(idOption))
strOption = rlvGetItemNameFromObjID(idOption, true);
else if (LLAvatarNameCache::get(idOption, &avName))
strOption = (!avName.mUsername.empty()) ? avName.mUsername : avName.mDisplayName;
strOption = (!avName.getAccountName().empty()) ? avName.getAccountName() : avName.getDisplayName();
else if (!gCacheName->getGroupName(idOption, strOption))
strOption = itCmd->getOption();
}
@@ -321,7 +321,7 @@ void RlvFloaterBehaviours::refreshAll()
}
else if (LLAvatarNameCache::get(idOption, &avName))
{
strOption = (!avName.mUsername.empty()) ? avName.mUsername : avName.mDisplayName;
strOption = (!avName.getAccountName().empty()) ? avName.getAccountName() : avName.getDisplayName();
}
else if (!gCacheName->getGroupName(idOption, strOption))
{

View File

@@ -48,9 +48,7 @@ namespace
{
void countedScriptsOnAvatar(LLStringUtil::format_map_t args, const LLAvatarName& av_name)
{
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
args["NAME"] = name;
args["NAME"] = av_name.getNSName();
cmdline_printchat(LLTrans::getString("ScriptCountAvatar", args));
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -17,17 +17,43 @@
Group bans not sent: too many Residents selected. Group bans are limited to 100 per request.
</panel.string>
<panel.string
name="already_banned">
Group Invitations not sent: resident '[RESIDENT]' already banned.
name="ban_not_permitted">
Group ban not sent: you do not have 'Manage ban list' ability.
</panel.string>
<panel.string
name="ban_limit_fail">
Group ban not sent: your group have reached limit of allowed ban records.
</panel.string>
<panel.string
name="partial_ban">
Some group bans were not sent:
[REASONS]
</panel.string>
<panel.string
name="ban_failed">
Group bans were not sent:
[REASONS]
</panel.string>
<panel.string
name="residents_already_banned">
- The following resident(s) are already banned: [RESIDENTS].
</panel.string>
<panel.string
name="ban_limit_reached">
- Ban limit reached, following agents not banned: [RESIDENTS].
</panel.string>
<panel.string
name="cant_ban_yourself">
- You cannot ban yourself from a group.
</panel.string>
<text
type="string"
length="1"
height="54"
bottom="-28"
layout="topleft"
left="7"
name="help_text"
bottom="-28"
word_wrap="true"
width="200">
You can select multiple Residents to
@@ -51,7 +77,7 @@ Resident Chooser&apos; to start.
multi_select="true"
name="banned_agent_list"
tool_tip="Hold the Ctrl key and click Resident names to multi-select"
menu_num="0"
menu_num="0"
bottom_delta="-178"
width="200" />
<button

View File

@@ -3411,6 +3411,13 @@ The
<!-- panel contents -->
<string name="PanelContentsNewScript">New Script</string>
<!-- Mute -->
<string name="MuteByName">(By name)</string>
<string name="MuteAgent">(Resident)</string>
<string name="MuteObject">(Object)</string>
<string name="MuteGroup">(Group)</string>
<string name="MuteExternal">(External)</string>
<!-- Region/Estate Covenant -->
<string name="RegionNoCovenant">There is no Covenant provided for this Estate.</string>
<string name="RegionNoCovenantOtherOwner">There is no Covenant provided for this Estate. The land on this estate is being sold by the Estate owner, not Linden Lab. Please contact the Estate Owner for sales details.</string>
@@ -4161,6 +4168,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="RightClick">Right click</string>
<string name="PowerUser4">Destroy objects - Permanently deletes an object immediately, when you don't feel like waiting for the server to respond.</string>
<string name="PowerUser5">Explode objects - Turns an object physical, temporary, and delinks it.</string>
<string name="OnlineStatus">Online</string>
<string name="OfflineStatus">Offline</string>
<!-- voice calls -->