summaryrefslogtreecommitdiff
path: root/indra/llui/llnotifications.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-09-03 17:41:39 +0100
committerAimee Linden <aimee@lindenlab.com>2010-09-03 17:41:39 +0100
commitffae589843c2977ae7f70de78d84c936e2a91291 (patch)
tree497660a88fe55382639dea1b2f3499241127470d /indra/llui/llnotifications.cpp
parent63f2ddf377fa0fc6a666cdc1001289335d86258b (diff)
parent25c29d59cf658acec5901c6f06775add10cf0bfd (diff)
Post-convert merge by convert_monolith.py from /Users/Aimee/Documents/Work/Linden-Lab/Development/viewer/convert/viewer-identity-evolution
Diffstat (limited to 'indra/llui/llnotifications.cpp')
-rw-r--r--indra/llui/llnotifications.cpp49
1 files changed, 42 insertions, 7 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 99d540a9de..4f179f112e 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -28,7 +28,9 @@
#include "llnotifications.h"
+#include "llavatarnamecache.h"
#include "llinstantmessage.h"
+#include "llcachename.h"
#include "llxmlnode.h"
#include "lluictrl.h"
#include "lluictrlfactory.h"
@@ -1481,17 +1483,50 @@ std::ostream& operator<<(std::ostream& s, const LLNotification& notification)
return s;
}
-void LLPostponedNotification::onCachedNameReceived(const LLUUID& id, const std::string& first,
- const std::string& last, bool is_group)
+//static
+void LLPostponedNotification::lookupName(LLPostponedNotification* thiz,
+ const LLUUID& id,
+ bool is_group)
+{
+ if (is_group)
+ {
+ gCacheName->getGroup(id,
+ boost::bind(&LLPostponedNotification::onGroupNameCache,
+ thiz, _1, _2, _3));
+ }
+ else
+ {
+ LLAvatarNameCache::get(id,
+ boost::bind(&LLPostponedNotification::onAvatarNameCache,
+ thiz, _1, _2));
+ }
+}
+
+void LLPostponedNotification::onGroupNameCache(const LLUUID& id,
+ const std::string& full_name,
+ bool is_group)
+{
+ finalizeName(full_name);
+}
+
+void LLPostponedNotification::onAvatarNameCache(const LLUUID& agent_id,
+ const LLAvatarName& av_name)
{
- mName = first + " " + last;
+ std::string name = av_name.getCompleteName();
- LLStringUtil::trim(mName);
- if (mName.empty())
+ // from PE merge - we should figure out if this is the right thing to do
+ if (name.empty())
{
- llwarns << "Empty name received for Id: " << id << llendl;
- mName = SYSTEM_FROM;
+ llwarns << "Empty name received for Id: " << agent_id << llendl;
+ name = SYSTEM_FROM;
}
+
+ finalizeName(name);
+}
+
+void LLPostponedNotification::finalizeName(const std::string& name)
+{
+ mName = name;
modifyNotificationParams();
LLNotifications::instance().add(mParams);
cleanup();