diff --git a/indra/newview/fscontactsfloater.cpp b/indra/newview/fscontactsfloater.cpp index e41b83f256..c5533d85bd 100644 --- a/indra/newview/fscontactsfloater.cpp +++ b/indra/newview/fscontactsfloater.cpp @@ -110,8 +110,8 @@ BOOL FSFloaterContacts::postBuild() mFriendList->setShowIcons("FriendsListShowIcons"); mFriendList->showPermissions(TRUE); mFriendList->setComparator(&STATUS_COMPARATOR); - mFriendList->sort(); + mFriendList->setRefreshCompleteCallback(boost::bind(&FSFloaterContacts::onFriendListRefreshComplete, this)); mFriendList->setItemDoubleClickCallback(boost::bind(&FSFloaterContacts::onAvatarListDoubleClicked, this, _1)); mFriendList->setReturnCallback(boost::bind(&FSFloaterContacts::onImButtonClicked, this)); @@ -165,6 +165,11 @@ void FSFloaterContacts::onOpen(const LLSD& key) } } +// as soon as the avatar list widget tells us all names are loaded, do another sort on the list -Zi +void FSFloaterContacts::onFriendListRefreshComplete() +{ + mFriendList->sort(); +} // // Friend actions diff --git a/indra/newview/fscontactsfloater.h b/indra/newview/fscontactsfloater.h index 0fa0a01335..14584ae0a7 100644 --- a/indra/newview/fscontactsfloater.h +++ b/indra/newview/fscontactsfloater.h @@ -67,6 +67,7 @@ private: bool isItemsFreeOfFriends(const uuid_vec_t& uuids); // misc callbacks + void onFriendListRefreshComplete(); static void onAvatarPicked(const uuid_vec_t& ids, const std::vector names); // friend buttons