From 946bdc1ee352618f0d333292272aceb48b6d8dd8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 8 Aug 2022 22:38:56 +0300 Subject: SL-14556 Profile floater does not update after a name change --- indra/newview/llfloaterprofile.cpp | 14 ++++++++++++++ indra/newview/llfloaterprofile.h | 1 + indra/newview/llpanelprofile.cpp | 13 +++++++++++++ indra/newview/llpanelprofile.h | 2 ++ indra/newview/llviewerdisplayname.cpp | 8 ++++++++ 5 files changed, 38 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index a4a9fe8410..624075e9fd 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -137,6 +137,20 @@ bool LLFloaterProfile::isPickTabSelected() return mPanelProfile->isPickTabSelected(); } +void LLFloaterProfile::refreshName() +{ + if (!mNameCallbackConnection.connected()) + { + mNameCallbackConnection = LLAvatarNameCache::get(mAvatarId, boost::bind(&LLFloaterProfile::onAvatarNameCache, this, _1, _2)); + } + + LLPanelProfileSecondLife *panel = findChild("panel_profile_secondlife"); + if (panel) + { + panel->refreshName(); + } +} + void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit) { mPanelProfile->showClassified(classified_id, edit); diff --git a/indra/newview/llfloaterprofile.h b/indra/newview/llfloaterprofile.h index 36023077d3..c2b90a1dce 100644 --- a/indra/newview/llfloaterprofile.h +++ b/indra/newview/llfloaterprofile.h @@ -49,6 +49,7 @@ public: void createPick(const LLPickData &data); void showPick(const LLUUID& pick_id = LLUUID::null); bool isPickTabSelected(); + void refreshName(); void showClassified(const LLUUID& classified_id = LLUUID::null, bool edit = false); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 195244ea22..2f4da59cfd 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -973,6 +973,14 @@ void LLPanelProfileSecondLife::updateData() } } +void LLPanelProfileSecondLife::refreshName() +{ + if (!mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCache, this, _1, _2)); + } +} + void LLPanelProfileSecondLife::resetData() { resetLoading(); @@ -2576,6 +2584,11 @@ void LLPanelProfile::updateData() } } +void LLPanelProfile::refreshName() +{ + mPanelSecondlife->refreshName(); +} + void LLPanelProfile::createPick(const LLPickData &data) { mTabContainer->selectTabPanel(mPanelPicks); diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index b363bd3fd2..41533c137f 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -96,6 +96,7 @@ public: * Sends update data request to server. */ void updateData() override; + void refreshName(); void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); @@ -368,6 +369,7 @@ public: BOOL postBuild() override; void updateData() override; + void refreshName(); void onOpen(const LLSD& key) override; diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index d444d47624..cec08c4f15 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -30,6 +30,8 @@ // viewer includes #include "llagent.h" +#include "llfloaterprofile.h" +#include "llfloaterreg.h" #include "llviewerregion.h" #include "llvoavatar.h" @@ -206,6 +208,12 @@ class LLDisplayNameUpdate : public LLHTTPNode { LLViewerDisplayName::sNameChangedSignal(); } + + LLFloaterProfile* profile_floater = dynamic_cast(LLFloaterReg::findInstance("profile", LLSD().with("id", agent_id))); + if (profile_floater) + { + profile_floater->refreshName(); + } } }; -- cgit v1.2.3