diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-29 17:20:16 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-29 17:20:16 +0100 |
commit | 578ee535644931ede7dd74741d905d04d8da7fd6 (patch) | |
tree | 3240e639994c15056e63651fdd9fd7231eff5351 | |
parent | 42ed8e8ffadd6bd7d8784084e9a29badf5d75c5c (diff) |
work on response integrity.
-rw-r--r-- | indra/newview/lltoastscripttextbox.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 6 |
2 files changed, 14 insertions, 9 deletions
diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp index 2a0d971a44..91a4831a9c 100644 --- a/indra/newview/lltoastscripttextbox.cpp +++ b/indra/newview/lltoastscripttextbox.cpp @@ -164,12 +164,17 @@ void LLToastScriptTextbox::close() #include "lllslconstants.h" void LLToastScriptTextbox::onClickOk() { - LLSD response = mNotification->getResponseTemplate(); - //response["OH MY GOD WHAT A HACK"] = "woot"; - response[TEXTBOX_MAGIC_TOKEN] = "ffffffffuuuuu"; - mNotification->respond(response); - close(); - llwarns << response << llendl; + LLViewerTextEditor* pMessageText = getChild<LLViewerTextEditor>("message"); + + if (pMessageText) + { + LLSD response = mNotification->getResponseTemplate(); + //response["OH MY GOD WHAT A HACK"] = "woot"; + response[TEXTBOX_MAGIC_TOKEN] = pMessageText->getText(); + mNotification->respond(response); + close(); + llwarns << response << llendl; + } } /* void LLToastScriptTextbox::onClickAttachment() diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b78c7b3d66..f897f5e733 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6176,9 +6176,9 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response) { LLNotificationForm form(notification["form"]); //std::string button = "booya";//LLNotification::getSelectedOptionName(response); - std::string button = response[TEXTBOX_MAGIC_TOKEN].asString().empty() ? - LLNotification::getSelectedOptionName(response) : - response[TEXTBOX_MAGIC_TOKEN].asString(); + std::string button = response.has(TEXTBOX_MAGIC_TOKEN) ? + response[TEXTBOX_MAGIC_TOKEN].asString() : + LLNotification::getSelectedOptionName(response); S32 button_idx = LLNotification::getSelectedOption(notification, response); // Didn't click "Ignore" if (button_idx != -1) |