From 7f53c0934af677d26b2e584155b77930a2c7a666 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Tue, 22 Feb 2011 18:46:00 +0200 Subject: STORM-28 FIXED Added the ability to send agent's own calling card to others. - Added creating own calling card for the user to be able to share it with other residents. - Moved calling cards synchronization with friends list to the viewer start up. Previously synchronized upon opening the Friends tab in People side panel. - Calling cards for non-friends are not removed upon calling cards synchronization with friends list. - Enabled "Share" menu item for calling cards in inventory. --- indra/newview/llpanelpeople.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanelpeople.cpp') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b07a46a222..b52f33ec3b 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -384,6 +384,16 @@ private: { lldebugs << "Inventory changed: " << mask << llendl; + static bool synchronize_friends_folders = true; + if (synchronize_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(); + synchronize_friends_folders = false; + } + // *NOTE: deleting of InventoryItem is performed via moving to Trash. // That means LLInventoryObserver::STRUCTURE is present in MASK instead of LLInventoryObserver::REMOVE if ((CALLINGCARD_ADDED & mask) == CALLINGCARD_ADDED) @@ -750,18 +760,23 @@ void LLPanelPeople::updateFriendList() all_friendsp.clear(); online_friendsp.clear(); - LLFriendCardsManager::folderid_buddies_map_t listMap; + uuid_vec_t buddies_uuids; + LLAvatarTracker::buddy_map_t::const_iterator buddies_iter; + + // Fill the avatar list with friends UUIDs + for (buddies_iter = all_buddies.begin(); buddies_iter != all_buddies.end(); ++buddies_iter) + { + buddies_uuids.push_back(buddies_iter->first); + } - // *NOTE: For now collectFriendsLists returns data only for Friends/All folder. EXT-694. - LLFriendCardsManager::instance().collectFriendsLists(listMap); - if (listMap.size() > 0) + if (buddies_uuids.size() > 0) { - lldebugs << "Friends Cards were found, count: " << listMap.begin()->second.size() << llendl; - all_friendsp = listMap.begin()->second; + lldebugs << "Friends added to the list: " << buddies_uuids.size() << llendl; + all_friendsp = buddies_uuids; } else { - lldebugs << "Friends Cards were not found" << llendl; + lldebugs << "No friends found" << llendl; } LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin(); -- cgit v1.2.3