Skip to content

Commit

Permalink
Fix group names on certain group profiles sometimes never Loading in
Browse files Browse the repository at this point in the history
  • Loading branch information
LiruMouse committed Nov 16, 2019
1 parent 78fbc21 commit 89abfe6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
4 changes: 3 additions & 1 deletion indra/newview/llnamebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ void LLNameBox::initFromXML(LLXMLNodePtr node, LLView* parent)
node->getAttributeString("initial_value", mInitialValue);
setText(mInitialValue);
node->getAttribute_bool("rlv_sensitive", mRLVSensitive);
node->getAttribute_bool("is_group", mIsGroup);
bool is_group;
node->getAttribute_bool("is_group", is_group);
setIsGroup(is_group);
}

// static
Expand Down
22 changes: 13 additions & 9 deletions indra/newview/llnameui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,29 @@
std::set<LLNameUI*> LLNameUI::sInstances;

LLNameUI::LLNameUI(const std::string& loading, bool rlv_sensitive, const LLUUID& id, bool is_group)
: mNameID(id), mRLVSensitive(rlv_sensitive), mIsGroup(is_group), mAllowInteract(false)
: mNameID(id), mRLVSensitive(rlv_sensitive), mIsGroup(!is_group), mAllowInteract(false)
, mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData"))
{
if (mIsGroup) sInstances.insert(this);
setIsGroup(is_group);
}

void LLNameUI::setNameID(const LLUUID& name_id, bool is_group)
void LLNameUI::setIsGroup(bool is_group)
{
mNameID = name_id;
mConnection.disconnect();

if (mIsGroup != is_group)
{
if (is_group)
if (mIsGroup = is_group)
sInstances.insert(this);
else
sInstances.erase(this);
}
mIsGroup = is_group;
}

void LLNameUI::setNameID(const LLUUID& name_id, bool is_group)
{
mNameID = name_id;
mConnection.disconnect();

setIsGroup(is_group);

if (mAllowInteract = mNameID.notNull())
{
Expand Down Expand Up @@ -139,4 +143,4 @@ void LLNameUI::showProfile()
LLGroupActions::show(mNameID);
else
LLAvatarActions::showProfile(mNameID);
}
}
3 changes: 2 additions & 1 deletion indra/newview/llnameui.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct LLNameUI : public LFIDBearer
uuid_vec_t getSelectedIDs() const override final { return { mNameID }; }
S32 getNumSelected() const override final { return 1; }

void setIsGroup(bool is_group);
void setNameID(const LLUUID& name_id, bool is_group);
void setNameText(); // Sets the name to whatever the name cache has at the moment
void refresh(const LLUUID& id, const std::string& full_name, bool is_group);
Expand Down Expand Up @@ -84,4 +85,4 @@ struct LLNameUI : public LFIDBearer
bool mIsGroup;
bool mAllowInteract;
std::string mInitialValue;
};
};

0 comments on commit 89abfe6

Please sign in to comment.