diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d1840993a..57510b4ac 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -7046,40 +7046,35 @@ void process_script_dialog(LLMessageSystem* msg, void**) } else { - for (i = 1; i < button_count; i++) - { - std::string tdesc; - msg->getString("Buttons", "ButtonLabel", tdesc, i); - form.addElement("button", std::string(tdesc)); - } + for (i = 1; i < button_count; i++) + { + std::string tdesc; + msg->getString("Buttons", "ButtonLabel", tdesc, i); + form.addElement("button", std::string(tdesc)); + } } LLSD args; args["TITLE"] = object_name; args["MESSAGE"] = message; - // args["CHANNEL"] = chat_channel; - // 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( LLNotification::Params("ScriptDialog").substitutions(args).payload(payload).form_elements(form.asLLSD())); } - } else { - args["GROUPNAME"] = last_name; notification = LLNotifications::instance().add( LLNotification::Params("ScriptDialogGroup").substitutions(args).payload(payload).form_elements(form.asLLSD())); }