Now that Kokua yoinked Contact Sets, we can clean up some ugly dependencies... :P
parent
d05ffe1693
commit
6104c3aafc
|
|
@ -19,6 +19,7 @@ include(Python)
|
|||
include(Tut)
|
||||
include(Python)
|
||||
include(JsonCpp)
|
||||
include(LLXML) #<FS:Ansariel> For accessing settings
|
||||
|
||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
|
|
@ -26,6 +27,7 @@ include_directories(
|
|||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLCOREHTTP_INCLUDE_DIRS}
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLXML_INCLUDE_DIRS} #<FS:Ansariel> For accessing settings
|
||||
${LLMESSAGE_INCLUDE_DIRS}
|
||||
${LLFILESYSTEM_INCLUDE_DIRS}
|
||||
${JSONCPP_INCLUDE_DIR}
|
||||
|
|
@ -217,6 +219,7 @@ target_link_libraries(
|
|||
${LLCOMMON_LIBRARIES}
|
||||
${LLFILESYSTEM_LIBRARIES}
|
||||
${LLMATH_LIBRARIES}
|
||||
${LLXML_LIBRARIES} #<FS:Ansariel> For accessing settings
|
||||
${JSONCPP_LIBRARIES}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${CRYPTO_LIBRARIES}
|
||||
|
|
@ -235,6 +238,7 @@ target_link_libraries(
|
|||
${LLCOMMON_LIBRARIES}
|
||||
${LLFILESYSTEM_LIBRARIES}
|
||||
${LLMATH_LIBRARIES}
|
||||
${LLXML_LIBRARIES} #<FS:Ansariel> For accessing settings
|
||||
${JSONCPP_LIBRARIES}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${CRYPTO_LIBRARIES}
|
||||
|
|
@ -265,6 +269,7 @@ if (LINUX)
|
|||
${WINDOWS_LIBRARIES}
|
||||
${LLFILESYSTEM_LIBRARIES}
|
||||
${LLMATH_LIBRARIES}
|
||||
${LLXML_LIBRARIES} #<FS:Ansariel> For accessing settings
|
||||
${CURL_LIBRARIES}
|
||||
${NGHTTP2_LIBRARIES}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
|
|
@ -281,6 +286,7 @@ else (LINUX)
|
|||
${WINDOWS_LIBRARIES}
|
||||
${LLFILESYSTEM_LIBRARIES}
|
||||
${LLMATH_LIBRARIES}
|
||||
${LLXML_LIBRARIES} #<FS:Ansariel> For accessing settings
|
||||
${CURL_LIBRARIES}
|
||||
${NGHTTP2_LIBRARIES}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
|
|
|
|||
|
|
@ -48,8 +48,9 @@
|
|||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include "../newview/lggcontactsets.h"
|
||||
#include "../llxml/llcontrol.h"
|
||||
|
||||
#include "llcontrol.h" // <FS:Ansariel> Optional legacy name cache expiration
|
||||
|
||||
// Time-to-live for a temp cache entry.
|
||||
const F64 TEMP_CACHE_ENTRY_LIFETIME = 60.0;
|
||||
// Maximum time an unrefreshed cache entry is allowed.
|
||||
|
|
@ -213,13 +214,15 @@ void LLAvatarNameCache::handleAvNameCacheSuccess(const LLSD &data, const LLSD &h
|
|||
|
||||
LLAvatarName av_name;
|
||||
// <FS> Contact sets alias
|
||||
if (LGGContactSets::getInstance()->hasPseudonym(agent_id))
|
||||
bool dn_removed;
|
||||
std::string pseudonym;
|
||||
if (mCustomNameCheckCallback && mCustomNameCheckCallback(agent_id, dn_removed, pseudonym))
|
||||
{
|
||||
LLSD info(row);
|
||||
info["is_display_name_default"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id);
|
||||
info["display_name"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id)
|
||||
info["is_display_name_default"] = dn_removed;
|
||||
info["display_name"] = dn_removed
|
||||
? (info["legacy_first_name"].asString() + " " + info["legacy_last_name"].asString())
|
||||
: LGGContactSets::getInstance()->getPseudonym(agent_id);
|
||||
: pseudonym;
|
||||
av_name.fromLLSD(info);
|
||||
}
|
||||
else
|
||||
|
|
@ -647,13 +650,15 @@ bool LLAvatarNameCache::getName(const LLUUID& agent_id, LLAvatarName *av_name)
|
|||
{
|
||||
*av_name = it->second;
|
||||
// <FS> Contact sets alias
|
||||
if (LGGContactSets::getInstance()->hasPseudonym(agent_id))
|
||||
bool dn_removed;
|
||||
std::string pseudonym;
|
||||
if (mCustomNameCheckCallback && mCustomNameCheckCallback(agent_id, dn_removed, pseudonym))
|
||||
{
|
||||
LLSD info = av_name->asLLSD();
|
||||
info["is_display_name_default"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id);
|
||||
info["display_name"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id)
|
||||
info["is_display_name_default"] = dn_removed;
|
||||
info["display_name"] = dn_removed
|
||||
? (info["legacy_first_name"].asString() + " " + info["legacy_last_name"].asString())
|
||||
: LGGContactSets::getInstance()->getPseudonym(agent_id);
|
||||
: pseudonym;
|
||||
av_name->fromLLSD(info);
|
||||
}
|
||||
// <FS/> Contact sets alias
|
||||
|
|
@ -711,14 +716,15 @@ LLAvatarNameCache::callback_connection_t LLAvatarNameCache::getNameCallback(cons
|
|||
LLSD test = av_name.asLLSD();
|
||||
|
||||
// <FS> Contact sets alias
|
||||
if (LGGContactSets::getInstance()->hasPseudonym(agent_id))
|
||||
bool dn_removed;
|
||||
std::string pseudonym;
|
||||
if (mCustomNameCheckCallback && mCustomNameCheckCallback(agent_id, dn_removed, pseudonym))
|
||||
{
|
||||
LL_DEBUGS("AvNameCache") << "DN cache hit via alias " << agent_id << LL_ENDL;
|
||||
LLSD info = av_name.asLLSD();
|
||||
info["is_display_name_default"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id);
|
||||
info["display_name"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id)
|
||||
info["is_display_name_default"] = dn_removed;
|
||||
info["display_name"] = dn_removed
|
||||
? (info["legacy_first_name"].asString() + " " + info["legacy_last_name"].asString())
|
||||
: LGGContactSets::getInstance()->getPseudonym(agent_id);
|
||||
: pseudonym;
|
||||
av_name.fromLLSD(info);
|
||||
}
|
||||
// </FS> Contact sets alias
|
||||
|
|
|
|||
|
|
@ -44,6 +44,14 @@ public:
|
|||
typedef boost::signals2::signal<void (void)> use_display_name_signal_t;
|
||||
typedef boost::function<void (const LLUUID id, const LLAvatarName& av_name)> account_name_changed_callback_t;
|
||||
|
||||
// <FS:Ansariel> Contact sets
|
||||
typedef boost::function<bool(const LLUUID& id, bool& dn_removed, std::string& custom_name)> custom_name_check_callback_t;
|
||||
void setCustomNameCheckCallback(custom_name_check_callback_t cb)
|
||||
{
|
||||
mCustomNameCheckCallback = cb;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
// Import/export the name cache to file.
|
||||
bool importFile(std::istream& istr);
|
||||
void exportFile(std::ostream& ostr);
|
||||
|
|
@ -200,6 +208,9 @@ private:
|
|||
|
||||
// Time when unrefreshed cached names were checked last.
|
||||
F64 mLastExpireCheck;
|
||||
|
||||
// <FS:Ansariel> Contact sets
|
||||
custom_name_check_callback_t mCustomNameCheckCallback;
|
||||
};
|
||||
|
||||
// Parse a cache-control header to get the max-age delta-seconds.
|
||||
|
|
|
|||
|
|
@ -1048,6 +1048,13 @@ LGGContactSets::ContactSet* LGGContactSets::getContactSet(const std::string& set
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bool LGGContactSets::checkCustomName(const LLUUID& id, bool& dn_removed, std::string& pseudonym)
|
||||
{
|
||||
dn_removed = hasDisplayNameRemoved(id);
|
||||
pseudonym = getPseudonym(id);
|
||||
return hasPseudonym(id);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LGGContactSets::handleAddContactSetCallback(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@ public:
|
|||
bool hasDisplayNameRemoved(const LLUUID& friend_id);
|
||||
bool hasDisplayNameRemoved(uuid_vec_t ids);
|
||||
|
||||
bool checkCustomName(const LLUUID& id, bool& dn_removed, std::string& pseudonym);
|
||||
|
||||
string_vec_t getFriendSets(const LLUUID& friend_id);
|
||||
string_vec_t getAllContactSets();
|
||||
|
||||
|
|
|
|||
|
|
@ -6197,6 +6197,7 @@ void LLAppViewer::disconnectViewer()
|
|||
gInventory.getLibraryOwnerID());
|
||||
}
|
||||
|
||||
LLAvatarNameCache::instance().setCustomNameCheckCallback(LLAvatarNameCache::custom_name_check_callback_t()); // <FS:Ansariel> Contact sets
|
||||
saveNameCache();
|
||||
if (LLExperienceCache::instanceExists())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2504,8 +2504,12 @@ bool idle_startup()
|
|||
LLAvatarTracker::instance().addBuddyList(list);
|
||||
display_startup();
|
||||
}
|
||||
|
||||
LGGContactSets::getInstance()->loadFromDisk(); // [FS:CR] Load contact sets
|
||||
|
||||
// <FS:Ansariel> Contact sets
|
||||
LGGContactSets* cs_instance = LGGContactSets::getInstance();
|
||||
cs_instance->loadFromDisk();
|
||||
LLAvatarNameCache::instance().setCustomNameCheckCallback(boost::bind(&LGGContactSets::checkCustomName, cs_instance, _1, _2, _3));
|
||||
// </FS:Ansariel>
|
||||
|
||||
bool show_hud = false;
|
||||
LLSD tutorial_setting = response["tutorial_setting"];
|
||||
|
|
|
|||
Loading…
Reference in New Issue