summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llavatarpropertiesprocessor.cpp25
-rwxr-xr-xindra/newview/llfloaterpreference.cpp31
-rw-r--r--indra/newview/llfloaterpreference.h1
-rw-r--r--indra/newview/llpanelme.cpp24
-rw-r--r--indra/newview/llpanelme.h1
-rw-r--r--indra/newview/skins/default/xui/en/panel_profile.xml17
6 files changed, 42 insertions, 57 deletions
diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp
index 99aeb4cbad..b1cd83a1fb 100644
--- a/indra/newview/llavatarpropertiesprocessor.cpp
+++ b/indra/newview/llavatarpropertiesprocessor.cpp
@@ -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();
}
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 724096b443..1dc1aa49ea 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -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 );
+ }
}
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 46014804ec..5d5e066ec5 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -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.
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp
index d3c9c3e131..1347a02a52 100644
--- a/indra/newview/llpanelme.cpp
+++ b/indra/newview/llpanelme.cpp
@@ -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
diff --git a/indra/newview/llpanelme.h b/indra/newview/llpanelme.h
index d5b2fee869..f27f5a268e 100644
--- a/indra/newview/llpanelme.h
+++ b/indra/newview/llpanelme.h
@@ -58,7 +58,6 @@ private:
void buildEditPanel();
void onEditProfileClicked();
- void onSaveChangesClicked();
void onCancelClicked();
LLPanelMyProfileEdit * mEditPanel;
diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml
index d36220385d..cb701e03da 100644
--- a/indra/newview/skins/default/xui/en/panel_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile.xml
@@ -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>