diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-08-06 17:12:32 -0700 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-08-06 17:12:32 -0700 |
commit | 3e08ccf6abb6f6ca7f1fa2fc6e80fd6589203f28 (patch) | |
tree | f889dd65bf519eced51fc59a7c50a0e23e04d1ef /indra/newview | |
parent | b269fcb7c8b4988cdb9d18164011320d12389355 (diff) |
ACME-801: Adding a suggested friend as a friend does not remove them from the suggested friend list
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfacebookconnect.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llfacebookconnect.h | 2 | ||||
-rwxr-xr-x | indra/newview/llpanelpeople.cpp | 42 | ||||
-rwxr-xr-x | indra/newview/llpanelpeople.h | 1 |
4 files changed, 19 insertions, 31 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index ad776b2d1a..bdc17773d7 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -320,8 +320,7 @@ LLFacebookConnect::LLFacebookConnect() : mConnectionState(FB_NOT_CONNECTED), mConnected(false), mInfo(), - mContent(), - mGeneration(0) + mContent() { } @@ -506,7 +505,6 @@ const LLSD& LLFacebookConnect::getInfo() const void LLFacebookConnect::storeContent(const LLSD& content) { - mGeneration++; mContent = content; sContentWatcher->post(content); @@ -519,7 +517,6 @@ const LLSD& LLFacebookConnect::getContent() const void LLFacebookConnect::clearContent() { - mGeneration++; mContent = LLSD(); } diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index b9afd181e9..0f005cbe24 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -78,7 +78,6 @@ public: bool isConnected() { return mConnected; } bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_DISCONNECTING)); } EConnectionState getConnectionState() { return mConnectionState; } - S32 generation() { return mGeneration; } void openFacebookWeb(std::string url); @@ -93,7 +92,6 @@ private: BOOL mConnected; LLSD mInfo; LLSD mContent; - S32 mGeneration; static boost::scoped_ptr<LLEventPump> sStateWatcher; static boost::scoped_ptr<LLEventPump> sInfoWatcher; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f1ee76f733..1786f73a8b 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -510,8 +510,7 @@ LLPanelPeople::LLPanelPeople() mNearbyList(NULL), mRecentList(NULL), mGroupList(NULL), - mMiniMap(NULL), - mFacebookListGeneration(0) + mMiniMap(NULL) { mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this)); mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); @@ -783,36 +782,31 @@ void LLPanelPeople::updateFriendList() bool LLPanelPeople::updateSuggestedFriendList() { - if (LLFacebookConnect::instance().generation() != mFacebookListGeneration) - { - mFacebookListGeneration = LLFacebookConnect::instance().generation(); + const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); + suggested_friends.clear(); - const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); - uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); - suggested_friends.clear(); + //Add suggested friends + LLSD friends = LLFacebookConnect::instance().getContent(); + for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + { + LLUUID agent_id = (*i).asUUID(); + bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; - //Add suggested friends - LLSD friends = LLFacebookConnect::instance().getContent(); - for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + if(!second_life_buddy) { - LLUUID agent_id = (*i).asUUID(); - bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; - - if(!second_life_buddy) + //FB+SL but not SL friend + if (agent_id.notNull()) { - //FB+SL but not SL friend - if (agent_id.notNull()) - { - suggested_friends.push_back(agent_id); - } + suggested_friends.push_back(agent_id); } } - - //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) - mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); - showFriendsAccordionsIfNeeded(); } + //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) + mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); + showFriendsAccordionsIfNeeded(); + return false; } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index b746835dfb..c7141f36ee 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -140,7 +140,6 @@ private: LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; - S32 mFacebookListGeneration; LLNetMap* mMiniMap; std::vector<std::string> mSavedOriginalFilters; |