SV-2093: Add Block option to ScriptDialogs.
Thanks to routergray for helping me test this.
This commit is contained in:
@@ -390,9 +390,9 @@ LLButton* LLNotifyBox::addButton(const std::string& name, const std::string& lab
|
|||||||
|
|
||||||
if (layout_script_dialog)
|
if (layout_script_dialog)
|
||||||
{
|
{
|
||||||
// Add two "blank" option spaces, before the "Ignore" button
|
// Add one "blank" option space, before the "Block" and "Ignore" buttons
|
||||||
index = button_index + 2;
|
index = button_index + 1;
|
||||||
if (button_index == 0)
|
if (button_index == 0 || button_index == 1)
|
||||||
{
|
{
|
||||||
// Ignore button is smaller, less wide
|
// Ignore button is smaller, less wide
|
||||||
btn_height = BTN_HEIGHT_SMALL;
|
btn_height = BTN_HEIGHT_SMALL;
|
||||||
@@ -625,9 +625,9 @@ LLRect LLNotifyBox::getNotifyRect(S32 num_options, bool layout_script_dialog, bo
|
|||||||
if (num_options < 1)
|
if (num_options < 1)
|
||||||
num_options = 1;
|
num_options = 1;
|
||||||
|
|
||||||
// Add two "blank" option spaces.
|
// Add one "blank" option space.
|
||||||
if (layout_script_dialog)
|
if (layout_script_dialog)
|
||||||
num_options += 2;
|
num_options += 1;
|
||||||
|
|
||||||
S32 additional_lines = (num_options-1) / 3;
|
S32 additional_lines = (num_options-1) / 3;
|
||||||
|
|
||||||
|
|||||||
@@ -8090,8 +8090,8 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response)
|
|||||||
|
|
||||||
std::string button = LLNotification::getSelectedOptionName(response);
|
std::string button = LLNotification::getSelectedOptionName(response);
|
||||||
S32 button_idx = LLNotification::getSelectedOption(notification, response);
|
S32 button_idx = LLNotification::getSelectedOption(notification, response);
|
||||||
// Didn't click "Ignore"
|
// Didn't click "Ignore" or "Block"
|
||||||
if (button_idx != -1)
|
if (button_idx > -1)
|
||||||
{
|
{
|
||||||
if (notification["payload"].has("textbox"))
|
if (notification["payload"].has("textbox"))
|
||||||
{
|
{
|
||||||
@@ -8109,6 +8109,10 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response)
|
|||||||
msg->addString("ButtonLabel", button);
|
msg->addString("ButtonLabel", button);
|
||||||
msg->sendReliable(LLHost(notification["payload"]["sender"].asString()));
|
msg->sendReliable(LLHost(notification["payload"]["sender"].asString()));
|
||||||
}
|
}
|
||||||
|
else if (button_idx == -2) // Block
|
||||||
|
{
|
||||||
|
LLMuteList::getInstance()->add(LLMute(notification["payload"]["object_id"].asUUID(), notification["substitutions"]["TITLE"].asString(), LLMute::OBJECT));
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7537,6 +7537,10 @@ Grant this request?
|
|||||||
[NAME]'s '[TITLE]' (ch[CHANNEL])
|
[NAME]'s '[TITLE]' (ch[CHANNEL])
|
||||||
[MESSAGE]
|
[MESSAGE]
|
||||||
<form name="form">
|
<form name="form">
|
||||||
|
<button
|
||||||
|
index="-2"
|
||||||
|
name="Block"
|
||||||
|
text="Block"/>
|
||||||
<button
|
<button
|
||||||
index="-1"
|
index="-1"
|
||||||
name="Ignore"
|
name="Ignore"
|
||||||
@@ -7551,6 +7555,10 @@ Grant this request?
|
|||||||
[GROUPNAME]'s '[TITLE]'
|
[GROUPNAME]'s '[TITLE]'
|
||||||
[MESSAGE]
|
[MESSAGE]
|
||||||
<form name="form">
|
<form name="form">
|
||||||
|
<button
|
||||||
|
index="-2"
|
||||||
|
name="Block"
|
||||||
|
text="Block"/>
|
||||||
<button
|
<button
|
||||||
index="-1"
|
index="-1"
|
||||||
name="Ignore"
|
name="Ignore"
|
||||||
@@ -7567,6 +7575,10 @@ Grant this request?
|
|||||||
<form name="form">
|
<form name="form">
|
||||||
<input name="message">
|
<input name="message">
|
||||||
</input>
|
</input>
|
||||||
|
<button
|
||||||
|
index="-2"
|
||||||
|
name="Block"
|
||||||
|
text="Block"/>
|
||||||
<button
|
<button
|
||||||
index="-1"
|
index="-1"
|
||||||
name="Ignore"
|
name="Ignore"
|
||||||
|
|||||||
Reference in New Issue
Block a user