summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llavatarnamecache.cpp12
-rw-r--r--indra/llmessage/llavatarnamecache.h5
2 files changed, 16 insertions, 1 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index 8158c17974..2f2d9099a3 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -41,6 +41,8 @@
namespace LLAvatarNameCache
{
+ use_display_name_signal_t mUseDisplayNamesSignal;
+
// Manual override for display names - can disable even if the region
// supports it.
bool sUseDisplayNames = true;
@@ -691,6 +693,8 @@ void LLAvatarNameCache::setUseDisplayNames(bool use)
sUseDisplayNames = use;
// flush our cache
sCache.clear();
+
+ mUseDisplayNamesSignal();
}
}
@@ -751,6 +755,13 @@ bool LLAvatarNameCache::expirationFromCacheControl(LLSD headers, F64 *expires)
return false;
}
+
+void LLAvatarNameCache::addUseDisplayNamesCallback(const use_display_name_signal_t::slot_type& cb)
+{
+ mUseDisplayNamesSignal.connect(cb);
+}
+
+
static const std::string MAX_AGE("max-age");
static const boost::char_separator<char> EQUALS_SEPARATOR("=");
static const boost::char_separator<char> COMMA_SEPARATOR(",");
@@ -809,4 +820,3 @@ bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age)
return false;
}
-
diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h
index 6d199fd09a..8f21ace96a 100644
--- a/indra/llmessage/llavatarnamecache.h
+++ b/indra/llmessage/llavatarnamecache.h
@@ -37,6 +37,9 @@ 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.
@@ -88,6 +91,8 @@ namespace LLAvatarNameCache
// Compute name expiration time from HTTP Cache-Control header,
// or return default value, in seconds from epoch.
F64 nameExpirationFromHeaders(LLSD headers);
+
+ void addUseDisplayNamesCallback(const use_display_name_signal_t::slot_type& cb);
}
// Parse a cache-control header to get the max-age delta-seconds.