diff options
author | James Cook <james@lindenlab.com> | 2010-03-02 14:06:23 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-03-02 14:06:23 -0800 |
commit | fe8d015851f74d375776791aa1adec204799037b (patch) | |
tree | 644a0dfbd4cd750d69ccbf1a82fe1fc277842d2d /indra/newview/llpanelgroupinvite.cpp | |
parent | 822d042e0c04dba2cdaced8c81b50840972a7286 (diff) | |
parent | 96da7000e34585d24b4b6946a30a3fb77d668f76 (diff) |
Merge
Diffstat (limited to 'indra/newview/llpanelgroupinvite.cpp')
-rw-r--r-- | indra/newview/llpanelgroupinvite.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 0e677ee2bf..e1ebf7550f 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -36,6 +36,7 @@ #include "llagent.h" #include "llfloateravatarpicker.h" #include "llbutton.h" +#include "llcallingcard.h" #include "llcombobox.h" #include "llgroupactions.h" #include "llgroupmgr.h" @@ -426,10 +427,44 @@ void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids) names.push_back("(Unknown)"); } } + else + { + //looks like user try to invite offline friend + //for offline avatar_id gObjectList.findObject() will return null + //so we need to do this additional search in avatar tracker, see EXT-4732 + if (LLAvatarTracker::instance().isBuddy(agent_id)) + { + if (!gCacheName->getFullName(agent_id, fullname)) + { + // actually it should happen, just in case + gCacheName->get(LLUUID(agent_id), false, boost::bind( + &LLPanelGroupInvite::addUserCallback, this, _1, _2, + _3)); + // for this special case! + //when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence + // removed id will be added in callback + agent_ids.erase(agent_ids.begin() + i); + } + else + { + names.push_back(fullname); + } + } + } } mImplementation->addUsers(names, agent_ids); } +void LLPanelGroupInvite::addUserCallback(const LLUUID& id, const std::string& first_name, const std::string& last_name) +{ + std::vector<std::string> names; + std::vector<LLUUID> agent_ids; + std::string full_name = first_name + " " + last_name; + agent_ids.push_back(id); + names.push_back(first_name + " " + last_name); + + mImplementation->addUsers(names, agent_ids); +} void LLPanelGroupInvite::draw() { LLPanel::draw(); |