ACME-801: Adding a suggested friend as a friend does not remove them from the suggested friend list

meow-7.2.2
Gilbert Gonzales 2013-08-06 17:12:32 -07:00
parent b269fcb7c8
commit 3e08ccf6ab
4 changed files with 19 additions and 31 deletions

View File

@ -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();
}

View File

@ -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;

View File

@ -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)
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)
{
mFacebookListGeneration = LLFacebookConnect::instance().generation();
LLUUID agent_id = (*i).asUUID();
bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false;
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)
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;
}

View File

@ -140,7 +140,6 @@ private:
LLAvatarList* mNearbyList;
LLAvatarList* mRecentList;
LLGroupList* mGroupList;
S32 mFacebookListGeneration;
LLNetMap* mMiniMap;
std::vector<std::string> mSavedOriginalFilters;