diff options
Diffstat (limited to 'indra/newview/llcallingcard.cpp')
-rw-r--r-- | indra/newview/llcallingcard.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 8e9ab8f87f..829b6380cd 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -42,6 +42,7 @@ #include "llinventorymodel.h" #include "llnotifications.h" #include "llslurl.h" +#include "llstartup.h" #include "llimview.h" #include "lltrans.h" #include "llviewercontrol.h" @@ -271,6 +272,22 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds) << "]" << LL_ENDL; } } + + // It's possible that the buddy list getting propagated from the inventory may have happened after we actually got the buddy list. + // Any buddies that we got prior will reside in a special queue that we must process and update statuses accordingly with. + // Do that here. + // -Geenz 2025-03-12 + while (!mBuddyStatusQueue.empty()) + { + auto buddyStatus = mBuddyStatusQueue.front(); + mBuddyStatusQueue.pop(); + + if (mBuddyInfo.find(buddyStatus.first) != mBuddyInfo.end()) + { + setBuddyOnline(buddyStatus.first, buddyStatus.second); + } + } + // do not notify observers here - list can be large so let it be done on idle. return new_buddy_count; @@ -335,6 +352,8 @@ void LLAvatarTracker::setBuddyOnline(const LLUUID& id, bool is_online) { LL_WARNS() << "!! No buddy info found for " << id << ", setting to " << (is_online ? "Online" : "Offline") << LL_ENDL; + LL_WARNS() << "Did we receive a buddy status update before the buddy info?" << LL_ENDL; + mBuddyStatusQueue.push(std::make_pair(id, is_online)); } } @@ -706,6 +725,8 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) { LL_WARNS() << "Received online notification for unknown buddy: " << agent_id << " is " << (online ? "ONLINE" : "OFFLINE") << LL_ENDL; + LL_WARNS() << "Adding buddy to buddy queue." << LL_ENDL; + mBuddyStatusQueue.push(std::make_pair(agent_id, true)); } if(tracking_id == agent_id) @@ -723,7 +744,11 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) mModifyMask |= LLFriendObserver::ONLINE; instance().notifyObservers(); - gInventory.notifyObservers(); + // Skip if we had received the friends list before the inventory callbacks were properly initialized + if (LLStartUp::getStartupState() > STATE_INVENTORY_CALLBACKS) + { + gInventory.notifyObservers(); + } } } |