summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrew Polunin <apolunin@productengine.com>2009-11-09 16:48:00 +0200
committerAndrew Polunin <apolunin@productengine.com>2009-11-09 16:48:00 +0200
commit60389a85e545575d6ca0abbaa4b5fcadd449793f (patch)
tree00183c106d974d6a19314167b18ae99ea6e9e102 /indra
parentb72c3f3d08326870e1a3d6444d2dcccb57ec4e3d (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.cpp8
-rw-r--r--indra/newview/llpanelpeople.h2
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;