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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user