summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-09-29 18:39:47 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-09-29 18:39:47 +0100
commitf7f3df3a2c0b7a87828c4a2c777d9a94502f3d4e (patch)
treea3236a30890536e31c9f14db68c9246e99043c73 /indra/newview/llviewermessage.cpp
parent578ee535644931ede7dd74741d905d04d8da7fd6 (diff)
make empty textboxes return an empty string instead of doing nothing. I hope.
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index f897f5e733..321100e140 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6176,10 +6176,20 @@ 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.has(TEXTBOX_MAGIC_TOKEN) ?
- response[TEXTBOX_MAGIC_TOKEN].asString() :
- LLNotification::getSelectedOptionName(response);
- S32 button_idx = LLNotification::getSelectedOption(notification, response);
+ llwarns << "ok: " << response << llendl;
+ std::string rtn_text;
+ S32 button_idx;
+ if (response[TEXTBOX_MAGIC_TOKEN].isDefined())
+ {
+ rtn_text = response[TEXTBOX_MAGIC_TOKEN].asString();
+ button_idx = 0;
+ }
+ else
+ {
+ rtn_text = LLNotification::getSelectedOptionName(response);
+ button_idx = LLNotification::getSelectedOption(notification, response);
+ }
+ llwarns << "rtn: " << rtn_text << " btnidx: " << button_idx << llendl;
// Didn't click "Ignore"
if (button_idx != -1)
{
@@ -6192,7 +6202,7 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response)
msg->addUUID("ObjectID", notification["payload"]["object_id"].asUUID());
msg->addS32("ChatChannel", notification["payload"]["chat_channel"].asInteger());
msg->addS32("ButtonIndex", button_idx);
- msg->addString("ButtonLabel", button);
+ msg->addString("ButtonLabel", rtn_text);
msg->sendReliable(LLHost(notification["payload"]["sender"].asString()));
}