diff options
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llnamelistctrl.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llnamelistctrl.h | 2 |
3 files changed, 50 insertions, 9 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 9f7fa82529..4f1c26d793 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3835,16 +3835,19 @@ bool LLPanelEstateAccess::accessCoreConfirm(const LLSD& notification, const LLSD sendEstateAccessDelta(flags, id); - // fill the name list for confirmation - LLAvatarName av_name; - if (LLAvatarNameCache::get(id, &av_name)) + if ((flags & (ESTATE_ACCESS_ALLOWED_GROUP_ADD | ESTATE_ACCESS_ALLOWED_GROUP_REMOVE)) == 0) { - if (!names.empty()) + // fill the name list for confirmation + LLAvatarName av_name; + if (LLAvatarNameCache::get(id, &av_name)) { - names += ", "; - single = false; + if (!names.empty()) + { + names += ", "; + single = false; + } + names += av_name.getCompleteName(); } - names += av_name.getCompleteName(); } } LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess(); diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 949f70d8dc..60b4c62e8f 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -313,8 +313,19 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( switch(name_item.target) { case GROUP: - gCacheName->getGroupName(id, fullname); - // fullname will be "nobody" if group not found + if (!gCacheName->getGroupName(id, fullname)) + { + avatar_name_cache_connection_map_t::iterator it = mGroupNameCacheConnections.find(id); + if (it != mGroupNameCacheConnections.end()) + { + if (it->second.connected()) + { + it->second.disconnect(); + } + mGroupNameCacheConnections.erase(it); + } + mGroupNameCacheConnections[id] = gCacheName->getGroup(id, boost::bind(&LLNameListCtrl::onGroupNameCache, this, _1, _2, item->getHandle())); + } break; case SPECIAL: // just use supplied name @@ -493,6 +504,31 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, dirtyColumns(); } +void LLNameListCtrl::onGroupNameCache(const LLUUID& group_id, const std::string name, LLHandle<LLNameListItem> item) +{ + avatar_name_cache_connection_map_t::iterator it = mGroupNameCacheConnections.find(group_id); + if (it != mGroupNameCacheConnections.end()) + { + if (it->second.connected()) + { + it->second.disconnect(); + } + mGroupNameCacheConnections.erase(it); + } + + LLNameListItem* list_item = item.get(); + if (list_item && list_item->getUUID() == group_id) + { + LLScrollListCell* cell = list_item->getColumn(mNameColumnIndex); + if (cell) + { + cell->setValue(name); + setNeedsSort(); + } + } + + dirtyColumns(); +} void LLNameListCtrl::updateColumns(bool force_update) { diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 50b4d80302..ef0be135e6 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -173,6 +173,7 @@ public: private: void showInspector(const LLUUID& avatar_id, bool is_group, bool is_experience = false); void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, std::string suffix, std::string prefix, LLHandle<LLNameListItem> item); + void onGroupNameCache(const LLUUID& group_id, const std::string name, LLHandle<LLNameListItem> item); private: S32 mNameColumnIndex; @@ -181,6 +182,7 @@ private: bool mShortNames; // display name only, no SLID typedef std::map<LLUUID, boost::signals2::connection> avatar_name_cache_connection_map_t; avatar_name_cache_connection_map_t mAvatarNameCacheConnections; + avatar_name_cache_connection_map_t mGroupNameCacheConnections; S32 mPendingLookupsRemaining; namelist_complete_signal_t mNameListCompleteSignal; |