diff options
author | Andrew Polunin <apolunin@productengine.com> | 2009-11-09 16:48:00 +0200 |
---|---|---|
committer | Andrew Polunin <apolunin@productengine.com> | 2009-11-09 16:48:00 +0200 |
commit | 60389a85e545575d6ca0abbaa4b5fcadd449793f (patch) | |
tree | 00183c106d974d6a19314167b18ae99ea6e9e102 /indra | |
parent | b72c3f3d08326870e1a3d6444d2dcccb57ec4e3d (diff) |
fixed normal bug EXT-2148 [BSI] Teleport button clickable although friend is offline
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llpanelpeople.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b08eb27b9f..f20ffa7559 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -696,6 +696,12 @@ void LLPanelPeople::buttonSetAction(const std::string& btn_name, const commit_si button->setClickedCallback(cb); } +bool LLPanelPeople::isFriendOnline(const LLUUID& id) +{ + LLAvatarList::uuid_vector_t ids = mOnlineFriendList->getIDs(); + return std::find(ids.begin(), ids.end(), id) != ids.end(); +} + void LLPanelPeople::updateButtons() { std::string cur_tab = getActiveTabName(); @@ -746,7 +752,7 @@ void LLPanelPeople::updateButtons() childSetEnabled("add_friend_btn", !is_friend); } - buttonSetEnabled("teleport_btn", friends_tab_active && item_selected); + buttonSetEnabled("teleport_btn", friends_tab_active && item_selected && isFriendOnline(selected_uuids.front())); buttonSetEnabled("view_profile_btn", item_selected); buttonSetEnabled("im_btn", (selected_uuids.size() >= 1)); // allow starting the friends conference for multiple selection buttonSetEnabled("call_btn", item_selected && false); // not implemented yet diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index faed573eca..a369bcd3e2 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -71,6 +71,8 @@ private: void updateNearbyList(); void updateRecentList(); + bool isFriendOnline(const LLUUID& id); + void updateButtons(); std::string getActiveTabName() const; LLUUID getCurrentItemID() const; |