diff options
author | Eugene Mutavchi <emutavchi@productengine.com> | 2009-12-07 13:13:11 +0200 |
---|---|---|
committer | Eugene Mutavchi <emutavchi@productengine.com> | 2009-12-07 13:13:11 +0200 |
commit | a0c82a20e3ef3316d2e2c15eecb5a6c2267eeaad (patch) | |
tree | cc09cf4e5667e16b5020bdb246a43dc312dc94cf /indra/newview/llpanelpeople.cpp | |
parent | c6177836ecbe95f75d79f572303a879bf37b3226 (diff) |
Fixed normal bug EXT-3128 ("Ability to add friend" isn't disabled from "choose resident" ("+" btn) menu when resident is already a friend)
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9c7e3952f5..1e4682701e 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1003,10 +1003,28 @@ void LLPanelPeople::onAddFriendButtonClicked() } } +bool LLPanelPeople::isItemsFreeOfFriends(const std::vector<LLUUID>& uuids) +{ + const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + for ( std::vector<LLUUID>::const_iterator + id = uuids.begin(), + id_end = uuids.end(); + id != id_end; ++id ) + { + if (av_tracker.isBuddy (*id)) + { + return false; + } + } + return true; +} + void LLPanelPeople::onAddFriendWizButtonClicked() { // Show add friend wizard. LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onAvatarPicked, NULL, FALSE, TRUE); + // Need to disable 'ok' button when friend occurs in selection + if (picker) picker->setOkBtnEnableCb(boost::bind(&LLPanelPeople::isItemsFreeOfFriends, this, _1)); LLFloater* root_floater = gFloaterView->getParentFloater(this); if (root_floater) { |