WEB-3750 FIX - Gone profile
* Added agent validation around calls to update avatar data * Removed references to profile panel save options Reviewed by Richardmaster
parent
81ae3c5fc9
commit
4dd471d055
|
|
@ -160,6 +160,12 @@ void LLAvatarPropertiesProcessor::sendAvatarClassifiedsRequest(const LLUUID& ava
|
|||
|
||||
void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props)
|
||||
{
|
||||
if (!gAgent.isInitialized() || (gAgent.getID() == LLUUID::null))
|
||||
{
|
||||
llwarns << "Sending avatarinfo update DENIED - invalid agent" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
llinfos << "Sending avatarinfo update" << llendl;
|
||||
|
||||
// This value is required by sendAvatarPropertiesUpdate method.
|
||||
|
|
@ -168,20 +174,21 @@ void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData*
|
|||
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
|
||||
msg->newMessageFast(_PREHASH_AvatarPropertiesUpdate);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast( _PREHASH_AgentID, gAgent.getID() );
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() );
|
||||
msg->nextBlockFast(_PREHASH_PropertiesData);
|
||||
msg->newMessageFast (_PREHASH_AvatarPropertiesUpdate);
|
||||
msg->nextBlockFast (_PREHASH_AgentData);
|
||||
msg->addUUIDFast (_PREHASH_AgentID, gAgent.getID() );
|
||||
msg->addUUIDFast (_PREHASH_SessionID, gAgent.getSessionID() );
|
||||
msg->nextBlockFast (_PREHASH_PropertiesData);
|
||||
|
||||
msg->addUUIDFast( _PREHASH_ImageID, avatar_props->image_id);
|
||||
msg->addUUIDFast( _PREHASH_FLImageID, avatar_props->fl_image_id);
|
||||
msg->addStringFast( _PREHASH_AboutText, avatar_props->about_text);
|
||||
msg->addStringFast( _PREHASH_FLAboutText, avatar_props->fl_about_text);
|
||||
msg->addUUIDFast (_PREHASH_ImageID, avatar_props->image_id);
|
||||
msg->addUUIDFast (_PREHASH_FLImageID, avatar_props->fl_image_id);
|
||||
msg->addStringFast (_PREHASH_AboutText, avatar_props->about_text);
|
||||
msg->addStringFast (_PREHASH_FLAboutText, avatar_props->fl_about_text);
|
||||
|
||||
msg->addBOOL(_PREHASH_AllowPublish, avatar_props->allow_publish);
|
||||
msg->addBOOL(_PREHASH_MaturePublish, mature);
|
||||
msg->addString(_PREHASH_ProfileURL, avatar_props->profile_url);
|
||||
|
||||
gAgent.sendReliableMessage();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
|
|||
mGotPersonalInfo(false),
|
||||
mOriginalIMViaEmail(false),
|
||||
mLanguageChanged(false),
|
||||
mAvatarDataInitialized(false),
|
||||
mDoubleClickActionDirty(false),
|
||||
mFavoritesRecordMayExist(false)
|
||||
{
|
||||
|
|
@ -353,14 +354,19 @@ void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType t
|
|||
|
||||
void LLFloaterPreference::storeAvatarProperties( const LLAvatarData* pAvatarData )
|
||||
{
|
||||
mAvatarProperties.avatar_id = gAgent.getID();
|
||||
mAvatarProperties.image_id = pAvatarData->image_id;
|
||||
mAvatarProperties.fl_image_id = pAvatarData->fl_image_id;
|
||||
mAvatarProperties.about_text = pAvatarData->about_text;
|
||||
mAvatarProperties.fl_about_text = pAvatarData->fl_about_text;
|
||||
mAvatarProperties.profile_url = pAvatarData->profile_url;
|
||||
mAvatarProperties.flags = pAvatarData->flags;
|
||||
mAvatarProperties.allow_publish = pAvatarData->flags & AVATAR_ALLOW_PUBLISH;
|
||||
if (gAgent.isInitialized() && (gAgent.getID() != LLUUID::null))
|
||||
{
|
||||
mAvatarProperties.avatar_id = gAgent.getID();
|
||||
mAvatarProperties.image_id = pAvatarData->image_id;
|
||||
mAvatarProperties.fl_image_id = pAvatarData->fl_image_id;
|
||||
mAvatarProperties.about_text = pAvatarData->about_text;
|
||||
mAvatarProperties.fl_about_text = pAvatarData->fl_about_text;
|
||||
mAvatarProperties.profile_url = pAvatarData->profile_url;
|
||||
mAvatarProperties.flags = pAvatarData->flags;
|
||||
mAvatarProperties.allow_publish = pAvatarData->flags & AVATAR_ALLOW_PUBLISH;
|
||||
|
||||
mAvatarDataInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterPreference::processProfileProperties(const LLAvatarData* pAvatarData )
|
||||
|
|
@ -371,12 +377,15 @@ void LLFloaterPreference::processProfileProperties(const LLAvatarData* pAvatarDa
|
|||
void LLFloaterPreference::saveAvatarProperties( void )
|
||||
{
|
||||
mAvatarProperties.allow_publish = getChild<LLUICtrl>("online_searchresults")->getValue();
|
||||
if ( mAvatarProperties.allow_publish )
|
||||
if (mAvatarProperties.allow_publish)
|
||||
{
|
||||
mAvatarProperties.flags |= AVATAR_ALLOW_PUBLISH;
|
||||
}
|
||||
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate( &mAvatarProperties );
|
||||
|
||||
if (mAvatarDataInitialized)
|
||||
{
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate( &mAvatarProperties );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ private:
|
|||
bool mGotPersonalInfo;
|
||||
bool mOriginalIMViaEmail;
|
||||
bool mLanguageChanged;
|
||||
bool mAvatarDataInitialized;
|
||||
|
||||
bool mOriginalHideOnlineStatus;
|
||||
// Record of current user's favorites may be stored in file on disk.
|
||||
|
|
|
|||
|
|
@ -67,8 +67,6 @@ BOOL LLPanelMe::postBuild()
|
|||
{
|
||||
LLPanelProfile::postBuild();
|
||||
|
||||
getTabContainer()[PANEL_PROFILE]->childSetAction("edit_profile_btn", boost::bind(&LLPanelMe::onEditProfileClicked, this), this);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +133,11 @@ void LLPanelMe::buildEditPanel()
|
|||
if (NULL == mEditPanel)
|
||||
{
|
||||
mEditPanel = new LLPanelMyProfileEdit();
|
||||
mEditPanel->childSetAction("save_btn", boost::bind(&LLPanelMe::onSaveChangesClicked, this), this);
|
||||
|
||||
// Note: Remove support for editing profile through this method.
|
||||
// All profile editing should go through the web.
|
||||
//mEditPanel->childSetAction("save_btn", boost::bind(&LLPanelMe::onSaveChangesClicked, this), this);
|
||||
|
||||
mEditPanel->childSetAction("cancel_btn", boost::bind(&LLPanelMe::onCancelClicked, this), this);
|
||||
}
|
||||
}
|
||||
|
|
@ -147,22 +149,6 @@ void LLPanelMe::onEditProfileClicked()
|
|||
togglePanel(mEditPanel, getAvatarId()); // open
|
||||
}
|
||||
|
||||
void LLPanelMe::onSaveChangesClicked()
|
||||
{
|
||||
LLAvatarData data = LLAvatarData();
|
||||
data.avatar_id = gAgent.getID();
|
||||
data.image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_SECOND_LIFE)->getImageAssetID();
|
||||
data.fl_image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_FIRST_LIFE)->getImageAssetID();
|
||||
data.about_text = mEditPanel->getChild<LLUICtrl>("sl_description_edit")->getValue().asString();
|
||||
data.fl_about_text = mEditPanel->getChild<LLUICtrl>("fl_description_edit")->getValue().asString();
|
||||
data.profile_url = mEditPanel->getChild<LLUICtrl>("homepage_edit")->getValue().asString();
|
||||
data.allow_publish = mEditPanel->getChild<LLUICtrl>("show_in_search_checkbox")->getValue();
|
||||
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate(&data);
|
||||
togglePanel(mEditPanel); // close
|
||||
onOpen(getAvatarId());
|
||||
}
|
||||
|
||||
void LLPanelMe::onCancelClicked()
|
||||
{
|
||||
togglePanel(mEditPanel); // close
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ private:
|
|||
void buildEditPanel();
|
||||
|
||||
void onEditProfileClicked();
|
||||
void onSaveChangesClicked();
|
||||
void onCancelClicked();
|
||||
|
||||
LLPanelMyProfileEdit * mEditPanel;
|
||||
|
|
|
|||
|
|
@ -453,23 +453,6 @@
|
|||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
<layout_panel
|
||||
follows="bottom|left"
|
||||
height="30"
|
||||
layout="topleft"
|
||||
name="profile_me_buttons_panel"
|
||||
visible="false"
|
||||
width="313">
|
||||
<button
|
||||
follows="bottom|right"
|
||||
height="23"
|
||||
left="20"
|
||||
top="0"
|
||||
label="Edit Profile"
|
||||
name="edit_profile_btn"
|
||||
tool_tip="Edit your personal information"
|
||||
width="130" />
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
|
||||
</panel>
|
||||
|
|
|
|||
Loading…
Reference in New Issue