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