From bbccec78ba1f339f265f3bcd3378075c88278a14 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 4 Feb 2016 11:03:14 +0100 Subject: [PATCH] FIRE-17158: Remove "block" button for script dialog of own objects --- indra/newview/lltoastnotifypanel.cpp | 7 ++++--- indra/newview/llviewermessage.cpp | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 8a836e8b0b..ddc01d9a27 100755 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -190,10 +190,11 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectoraddChild(ignore_btn, -1); mute_btn_pad = 4 * HPAD; //only use a 4 * HPAD padding if an ignore button exists } - // FIRE-3948: Commenting all out as mute button is disabled (FS:MS) - // Undo the removal and make it optional after I was looking for the mute button on spammy dialogs! + // FIRE-3948: Option to remove the mute button; FIRE-17158: Remove "block" button for script dialog of own objects //if (mIsScriptDialog && mute_btn != NULL) - if (mIsScriptDialog && mute_btn != NULL && !gSavedSettings.getBOOL("FSRemoveScriptBlockButton")) + if (mIsScriptDialog && mute_btn != NULL && !gSavedSettings.getBOOL("FSRemoveScriptBlockButton") && + (!mNotification->getPayload().has("own_object") || !mNotification->getPayload()["own_object"].asBoolean())) + // { LLRect mute_btn_rect(mute_btn->getRect()); // Place mute (Block) button to the left of the ignore button. diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d8666ec6a4..e242b758ab 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -9342,6 +9342,17 @@ void process_script_dialog(LLMessageSystem* msg, void**) payload["chat_channel"] = chat_channel; payload["object_name"] = object_name; + // FIRE-17158: Remove "block" button for script dialog of own objects + bool own_object = false; + std::string self_name; + LLAgentUI::buildFullname(self_name); + if (LLCacheName::buildFullName(first_name, last_name) == self_name) + { + own_object = true; + } + payload["own_object"] = own_object; + // + // build up custom form S32 button_count = msg->getNumberOfBlocks("Buttons"); if (button_count > SCRIPT_DIALOG_MAX_BUTTONS)