summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfriendcard.cpp11
-rw-r--r--indra/newview/llpanelpeople.cpp32
-rw-r--r--indra/newview/llstartup.cpp7
3 files changed, 38 insertions, 12 deletions
diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp
index 7f28e09933..2f4dae0af8 100644
--- a/indra/newview/llfriendcard.cpp
+++ b/indra/newview/llfriendcard.cpp
@@ -299,6 +299,17 @@ void LLFriendCardsManager::collectFriendsLists(folderid_buddies_map_t& folderBud
{
folderBuddiesMap.clear();
+ static bool syncronize_friends_folders = true;
+ if (syncronize_friends_folders)
+ {
+ // Checks whether "Friends" and "Friends/All" folders exist in "Calling Cards" folder,
+ // fetches their contents if needed and synchronizes it with buddies list.
+ // If the folders are not found they are created.
+ LLFriendCardsManager::instance().syncFriendCardsFolders();
+ syncronize_friends_folders = false;
+ }
+
+
LLInventoryModel::cat_array_t* listFolders;
LLInventoryModel::item_array_t* items;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 6dd800c0c6..3140fe8de1 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -272,6 +272,7 @@ public:
friend class LLInventoryFriendCardObserver;
LLFriendListUpdater(callback_t cb)
: LLAvatarListUpdater(cb, FRIEND_LIST_UPDATE_TIMEOUT)
+ , mIsActive(false)
{
LLAvatarTracker::instance().addObserver(this);
@@ -290,9 +291,12 @@ public:
/*virtual*/ void changed(U32 mask)
{
- // events can arrive quickly in bulk - we need not process EVERY one of them -
- // so we wait a short while to let others pile-in, and process them in aggregate.
- mEventTimer.start();
+ if (mIsActive)
+ {
+ // events can arrive quickly in bulk - we need not process EVERY one of them -
+ // so we wait a short while to let others pile-in, and process them in aggregate.
+ mEventTimer.start();
+ }
// save-up all the mask-bits which have come-in
mMask |= mask;
@@ -301,8 +305,12 @@ public:
/*virtual*/ BOOL tick()
{
+ if (!mIsActive) return FALSE;
+
if (mMask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE))
+ {
updateList();
+ }
// Stop updates.
mEventTimer.stop();
@@ -311,9 +319,20 @@ public:
return FALSE;
}
+ // virtual
+ void setActive(bool active)
+ {
+ mIsActive = active;
+ if (active)
+ {
+ tick();
+ }
+ }
+
private:
U32 mMask;
LLInventoryFriendCardObserver* mInvObserver;
+ bool mIsActive;
/**
* This class is intended for updating Friend List when Inventory Friend Card is added/removed.
@@ -504,8 +523,11 @@ BOOL LLPanelPeople::postBuild()
mTabContainer = getChild<LLTabContainer>("tabs");
mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2));
- mOnlineFriendList = getChild<LLPanel>(FRIENDS_TAB_NAME)->getChild<LLAvatarList>("avatars_online");
- mAllFriendList = getChild<LLPanel>(FRIENDS_TAB_NAME)->getChild<LLAvatarList>("avatars_all");
+ LLPanel* friends_tab = getChild<LLPanel>(FRIENDS_TAB_NAME);
+ // updater is active only if panel is visible to user.
+ friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2));
+ mOnlineFriendList = friends_tab->getChild<LLAvatarList>("avatars_online");
+ mAllFriendList = friends_tab->getChild<LLAvatarList>("avatars_all");
mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online"));
mOnlineFriendList->setShowIcons("FriendsListShowIcons");
mAllFriendList->setNoItemsCommentText(getString("no_friends"));
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 1ee73034f6..2475870b17 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -118,7 +118,6 @@
#include "llinventorybridge.h"
#include "llinventorymodel.h"
#include "llinventorymodelbackgroundfetch.h"
-#include "llfriendcard.h"
#include "llkeyboard.h"
#include "llloginhandler.h" // gLoginHandler, SLURL support
#include "lllogininstance.h" // Host the login module.
@@ -1645,12 +1644,6 @@ bool idle_startup()
//all categories loaded. lets create "My Favorites" category
gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true);
- // Checks whether "Friends" and "Friends/All" folders exist in "Calling Cards" folder,
- // fetches their contents if needed and synchronizes it with buddies list.
- // If the folders are not found they are created.
- LLFriendCardsManager::instance().syncFriendCardsFolders();
-
-
// set up callbacks
llinfos << "Registering Callbacks" << llendl;
LLMessageSystem* msg = gMessageSystem;