Fix of TEXTBOX of group owned object.

Fixes http://code.google.com/p/singularity-viewer/issues/detail?id=548
This commit is contained in:
Aleric Inglewood
2012-12-08 20:30:00 +01:00
parent d6b486524c
commit 8394a96fa8

View File

@@ -7044,40 +7044,35 @@ void process_script_dialog(LLMessageSystem* msg, void**)
} }
else else
{ {
for (i = 1; i < button_count; i++) for (i = 1; i < button_count; i++)
{ {
std::string tdesc; std::string tdesc;
msg->getString("Buttons", "ButtonLabel", tdesc, i); msg->getString("Buttons", "ButtonLabel", tdesc, i);
form.addElement("button", std::string(tdesc)); form.addElement("button", std::string(tdesc));
} }
} }
LLSD args; LLSD args;
args["TITLE"] = object_name; args["TITLE"] = object_name;
args["MESSAGE"] = message; args["MESSAGE"] = message;
// <edit>
args["CHANNEL"] = chat_channel; args["CHANNEL"] = chat_channel;
// </edit>
LLNotificationPtr notification; LLNotificationPtr notification;
if (!first_name.empty()) bool const is_group = first_name.empty();
char const* name = (is_group && !is_text_box) ? "GROUPNAME" : "NAME";
args[name] = is_group ? last_name : LLCacheName::buildFullName(first_name, last_name);
if (is_text_box)
{
args["DEFAULT"] = default_text;
payload["textbox"] = "true";
LLNotificationsUtil::add("ScriptTextBoxDialog", args, payload, callback_script_dialog);
}
else if (!first_name.empty())
{ {
args["NAME"] = LLCacheName::buildFullName(first_name, last_name);
if (is_text_box)
{
args["DEFAULT"] = default_text;
payload["textbox"] = "true";
LLNotificationsUtil::add("ScriptTextBoxDialog", args, payload, callback_script_dialog);
}
else
{
notification = LLNotifications::instance().add( notification = LLNotifications::instance().add(
LLNotification::Params("ScriptDialog").substitutions(args).payload(payload).form_elements(form.asLLSD())); LLNotification::Params("ScriptDialog").substitutions(args).payload(payload).form_elements(form.asLLSD()));
} }
}
else else
{ {
args["GROUPNAME"] = last_name;
notification = LLNotifications::instance().add( notification = LLNotifications::instance().add(
LLNotification::Params("ScriptDialogGroup").substitutions(args).payload(payload).form_elements(form.asLLSD())); LLNotification::Params("ScriptDialogGroup").substitutions(args).payload(payload).form_elements(form.asLLSD()));
} }