diff options
| author | maxim_productengine <mnikolenko@productengine.com> | 2018-07-05 18:00:00 +0300 |
|---|---|---|
| committer | maxim_productengine <mnikolenko@productengine.com> | 2018-07-05 18:00:00 +0300 |
| commit | a1466bcdaf8f085b62855ee05d943b20a9c7dfc8 (patch) | |
| tree | 4bc1ae29e335e6eaa682ccc2a82e6ff9f7e5a578 /indra/newview/llnamelistctrl.cpp | |
| parent | 7ee5ee3dfdda7809c1ff3c40d6de2f01e5e207aa (diff) | |
MAINT-8587 FIXED "(waiting)" instead of a group name in the Allowed Groups list.
Diffstat (limited to 'indra/newview/llnamelistctrl.cpp')
| -rw-r--r-- | indra/newview/llnamelistctrl.cpp | 40 |
1 files changed, 38 insertions, 2 deletions
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) { |
