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/newview/llpanelpeople.cpp | |
parent | b72c3f3d08326870e1a3d6444d2dcccb57ec4e3d (diff) |
fixed normal bug EXT-2148 [BSI] Teleport button clickable although friend is offline
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 8 |
1 files changed, 7 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 |