Revert some of the changes made to prevent calling card duplication, as the method has changed and the viewer is now responsible for creating calling cards after friendship has formed.

master
Zi Ree 2022-07-14 18:47:41 +02:00
parent dac349f2f6
commit d8951ca678
4 changed files with 2 additions and 62 deletions

View File

@ -636,55 +636,4 @@ void LLFriendCardsManager::onFriendListUpdate(U32 changed_mask)
}
}
// <FS:Ansariel> Bypass the calling card sync-crap to create the agent's calling card
void create_agent_calling_card_name_cb(const LLAvatarName& av_name, const LLUUID& calling_cards_folder_id)
{
create_inventory_item(gAgentID,
gAgentSessionID,
calling_cards_folder_id,
LLTransactionID::tnull,
av_name.getUserName(),
gAgentID.asString(),
LLAssetType::AT_CALLINGCARD,
LLInventoryType::IT_CALLINGCARD,
NO_INV_SUBTYPE,
PERM_MOVE | PERM_TRANSFER,
NULL);
}
void calling_card_folder_loaded_cb(const LLUUID& calling_cards_folder_id)
{
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
LLFindAgentCallingCard collector;
gInventory.collectDescendentsIf(calling_cards_folder_id, cats, items, LLInventoryModel::EXCLUDE_TRASH, collector);
// Create own calling card if it was not found in Friends/All folder
if (!collector.isAgentCallingCardFound())
{
LLAvatarNameCache::get(gAgentID, boost::bind(&create_agent_calling_card_name_cb, _2, calling_cards_folder_id));
}
}
// static
void LLFriendCardsManager::createAgentCallingCard()
{
const LLUUID calling_cards_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
// This instance will be deleted in LLInitialFriendCardsFetch::done().
LLInitialFriendCardsFetch* fetch = new LLInitialFriendCardsFetch(calling_cards_folder_id, boost::bind(&calling_card_folder_loaded_cb, calling_cards_folder_id));
fetch->startFetch();
if (fetch->isFinished())
{
// everything is already here - call done.
fetch->done();
}
else
{
// it's all on it's way - add an observer, and the inventory
// will call done for us when everything is here.
gInventory.addObserver(fetch);
}
}
// </FS:Ansariel>
// EOF

View File

@ -95,9 +95,6 @@ public:
*/
void syncFriendCardsFolders();
// <FS:Ansariel> Bypass the calling card sync-crap to create the agent's calling card
static void createAgentCallingCard();
private:
typedef boost::function<void()> callback_t;

View File

@ -359,8 +359,7 @@ public:
// For notification when SIP online status changes.
LLVoiceClient::getInstance()->addObserver(this);
// <FS:Ansariel> Disconnect LLFriendCardsManager
//mInvObserver = new LLInventoryFriendCardObserver(this);
mInvObserver = new LLInventoryFriendCardObserver(this);
}
~LLFriendListUpdater()
@ -413,8 +412,7 @@ public:
private:
U32 mMask;
// <FS:Ansariel> Disconnect LLFriendCardsManager
//LLInventoryFriendCardObserver* mInvObserver;
LLInventoryFriendCardObserver* mInvObserver;
bool mIsActive;
/**

View File

@ -248,7 +248,6 @@
#include "lggcontactsets.h"
#include "llfloatersearch.h"
#include "llfloatersidepanelcontainer.h"
#include "llfriendcard.h"
#include "llnotificationmanager.h"
#include "llpresetsmanager.h"
#include "llprogressview.h"
@ -3059,9 +3058,6 @@ bool idle_startup()
// <FS:Ansariel> Favorite Wearables
FSFloaterWearableFavorites::initCategory();
// <FS:Ansariel> Bypass the calling card sync-crap to create the agent's calling card
LLFriendCardsManager::createAgentCallingCard();
// Let the map know about the inventory.
LLFloaterWorldMap* floater_world_map = LLFloaterWorldMap::getInstance();
if(floater_world_map)