MAINT-7254, MAINT-7255: Use cap to get and set UserInfo on simhost. Check new is_verified flag and disable IM2Email if value is false.

meow-7.2.2
Rider Linden 2017-06-06 10:21:34 -07:00
parent 746848bee9
commit dde727aa0f
4 changed files with 13 additions and 9 deletions

View File

@ -4383,16 +4383,18 @@ void LLAgent::requestAgentUserInfoCoro(std::string capurl)
}
bool im_via_email;
bool is_verified_email;
std::string email;
std::string dir_visibility;
im_via_email = result["im_via_email"].asBoolean();
is_verified_email = result["is_verified"].asBoolean();
email = result["email"].asString();
dir_visibility = result["directory_visibility"].asString();
// TODO: This should probably be changed. I'm not entirely comfortable
// having LLAgent interact directly with the UI in this way.
LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email);
LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, is_verified_email);
LLFloaterSnapshot::setAgentEmail(email);
}

View File

@ -1016,12 +1016,12 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata)
}
// static
void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email)
void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email, bool is_verified_email)
{
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
if (instance)
{
instance->setPersonalInfo(visibility, im_via_email);
instance->setPersonalInfo(visibility, im_via_email, is_verified_email);
}
}
@ -1830,7 +1830,7 @@ bool LLFloaterPreference::moveTranscriptsAndLog()
return true;
}
void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email)
void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, bool is_verified_email)
{
mGotPersonalInfo = true;
mOriginalIMViaEmail = im_via_email;
@ -1855,8 +1855,9 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im
getChildView("friends_online_notify_checkbox")->setEnabled(TRUE);
getChild<LLUICtrl>("online_visibility")->setValue(mOriginalHideOnlineStatus);
getChild<LLUICtrl>("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility);
getChildView("send_im_to_email")->setEnabled(TRUE);
getChild<LLUICtrl>("send_im_to_email")->setValue(im_via_email);
getChildView("send_im_to_email")->setEnabled(is_verified_email);
// *TODO: Show or hide verify email text here based on is_verified_email
getChild<LLUICtrl>("send_im_to_email")->setValue(im_via_email);
getChildView("favorites_on_login_check")->setEnabled(TRUE);
getChildView("log_path_button")->setEnabled(TRUE);
getChildView("chat_font_size")->setEnabled(TRUE);

View File

@ -75,7 +75,7 @@ public:
/*virtual*/ void changed(const LLUUID& session_id, U32 mask) {};
// static data update, called from message handler
static void updateUserInfo(const std::string& visibility, bool im_via_email);
static void updateUserInfo(const std::string& visibility, bool im_via_email, bool is_verified_email);
// refresh all the graphics preferences menus
static void refreshEnabledGraphics();
@ -147,7 +147,7 @@ public:
void onClickLogPath();
bool moveTranscriptsAndLog();
void enableHistory();
void setPersonalInfo(const std::string& visibility, bool im_via_email);
void setPersonalInfo(const std::string& visibility, bool im_via_email, bool is_verified_email);
void refreshEnabledState();
void onCommitWindowedMode();
void refresh(); // Refresh enable/disable

View File

@ -7277,7 +7277,8 @@ void process_user_info_reply(LLMessageSystem* msg, void**)
std::string dir_visibility;
msg->getString( "UserData", "DirectoryVisibility", dir_visibility);
LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email);
// For Message based user info information the is_verified is assumed to be false.
LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, false);
LLFloaterSnapshot::setAgentEmail(email);
}