summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-08-16 21:27:50 -0400
committerOz Linden <oz@lindenlab.com>2012-08-16 21:27:50 -0400
commita0be18bd2e268f692e781d376be7bef4e71e46fb (patch)
tree6e43af94f76e524c9d0556b1801d870d75231963 /indra/llmessage
parent75a3183ad778cf2b7e2ed343345a82e3c0202ab0 (diff)
parent331a76afaaed8f802cf8c313eed8a287e75e93fc (diff)
merge changes for DRTVWR-197
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llavatarnamecache.cpp14
-rw-r--r--indra/llmessage/llavatarnamecache.h3
2 files changed, 11 insertions, 6 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index 97f2792686..ff31f7665e 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -651,8 +651,10 @@ void LLAvatarNameCache::fireSignal(const LLUUID& agent_id,
signal(agent_id, av_name);
}
-void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
+LLAvatarNameCache::callback_connection_t LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
{
+ callback_connection_t connection;
+
if (sRunning)
{
// ...only do immediate lookups when cache is running
@@ -668,7 +670,7 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
{
// ...name already exists in cache, fire callback now
fireSignal(agent_id, slot, av_name);
- return;
+ return connection;
}
}
}
@@ -681,7 +683,7 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
LLAvatarName av_name;
buildLegacyName(full_name, &av_name);
fireSignal(agent_id, slot, av_name);
- return;
+ return connection;
}
}
}
@@ -698,15 +700,17 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
{
// ...new callback for this id
callback_signal_t* signal = new callback_signal_t();
- signal->connect(slot);
+ connection = signal->connect(slot);
sSignalMap[agent_id] = signal;
}
else
{
// ...existing callback, bind additional slot
callback_signal_t* signal = sig_it->second;
- signal->connect(slot);
+ connection = signal->connect(slot);
}
+
+ return connection;
}
diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h
index 59c1329ffa..064942fe53 100644
--- a/indra/llmessage/llavatarnamecache.h
+++ b/indra/llmessage/llavatarnamecache.h
@@ -71,10 +71,11 @@ namespace LLAvatarNameCache
void (const LLUUID& agent_id, const LLAvatarName& av_name)>
callback_signal_t;
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.
- void get(const LLUUID& agent_id, callback_slot_t slot);
+ callback_connection_t get(const LLUUID& agent_id, callback_slot_t slot);
// Allow display names to be explicitly disabled for testing.
void setUseDisplayNames(bool use);