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

@@ -7055,29 +7055,24 @@ void process_script_dialog(LLMessageSystem* msg, void**)
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"] = LLCacheName::buildFullName(first_name, last_name); args[name] = is_group ? last_name : LLCacheName::buildFullName(first_name, last_name);
if (is_text_box) if (is_text_box)
{ {
args["DEFAULT"] = default_text; args["DEFAULT"] = default_text;
payload["textbox"] = "true"; payload["textbox"] = "true";
LLNotificationsUtil::add("ScriptTextBoxDialog", args, payload, callback_script_dialog); LLNotificationsUtil::add("ScriptTextBoxDialog", args, payload, callback_script_dialog);
} }
else else if (!first_name.empty())
{ {
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()));
} }