From 561cee12d8d3c456d71efae3b711dbf5115c66f5 Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Thu, 25 May 2017 16:51:45 +0300
Subject: [PATCH] MAINT-2585 Make permission request notifications permanent
 until action taken

---
 indra/llui/llnotifications.cpp                       | 6 ++++++
 indra/llui/llnotifications.h                         | 1 +
 indra/llui/llnotificationtemplate.h                  | 3 +++
 indra/newview/llnotificationofferhandler.cpp         | 1 +
 indra/newview/llnotificationscripthandler.cpp        | 1 +
 indra/newview/skins/default/xui/en/notifications.xml | 3 +++
 6 files changed, 15 insertions(+)

diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 604092d5368..c364c4d5aee 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -426,6 +426,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
 	mLogToChat(p.log_to_chat),
 	mLogToIM(p.log_to_im),
 	mShowToast(p.show_toast),
+	mFadeToast(p.fade_toast),
     mSoundName("")
 {
 	if (p.sound.isProvided()
@@ -942,6 +943,11 @@ bool LLNotification::canShowToast() const
 	return mTemplatep->mShowToast;
 }
 
+bool LLNotification::canFadeToast() const
+{
+	return mTemplatep->mFadeToast;
+}
+
 bool LLNotification::hasFormElements() const
 {
 	return mTemplatep->mForm->getNumElements() != 0;
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 024332ee65c..4a701d0ca7c 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -558,6 +558,7 @@ friend class LLNotifications;
 	bool canLogToChat() const;
 	bool canLogToIM() const;
 	bool canShowToast() const;
+	bool canFadeToast() const;
 	bool hasFormElements() const;
     void playSound();
 
diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h
index bed29254d8f..20cbc89ede6 100644
--- a/indra/llui/llnotificationtemplate.h
+++ b/indra/llui/llnotificationtemplate.h
@@ -177,6 +177,7 @@ struct LLNotificationTemplate
 		Optional<bool>					persist,
 										log_to_im,
 										show_toast,
+										fade_toast,
 										log_to_chat,
 										force_urls_external;
 		Optional<std::string>			functor,
@@ -199,6 +200,7 @@ struct LLNotificationTemplate
 		Params()
 		:	name("name"),
 			persist("persist", false),
+			fade_toast("fade_toast", true),
 			log_to_im("log_to_im", false),
 			show_toast("show_toast", true),
 			log_to_chat("log_to_chat", true),
@@ -316,6 +318,7 @@ struct LLNotificationTemplate
 	bool mLogToChat;
 	bool mLogToIM;
 	bool mShowToast;
+	bool mFadeToast;
 };
 
 #endif //LL_LLNOTIFICATION_TEMPLATE_H
diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp
index 63ab88da425..14d25d81582 100644
--- a/indra/newview/llnotificationofferhandler.cpp
+++ b/indra/newview/llnotificationofferhandler.cpp
@@ -131,6 +131,7 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification)
 			// we not save offer notifications to the syswell floater that should be added to the IM floater
 			p.can_be_stored = !add_notif_to_im;
 			p.force_show = notification->getOfferFromAgent();
+			p.can_fade = notification->canFadeToast();
 
 			LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
 			if(channel)
diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index 7acb2f9e906..fef0631fa6c 100644
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -77,6 +77,7 @@ void LLScriptHandler::addToastWithNotification(const LLNotificationPtr& notifica
 	p.notification = notification;
 	p.panel = notify_box;
 	p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1);
+	p.can_fade = notification->canFadeToast();
 	if(gAgent.isDoNotDisturb())
 	{ 
 		p.force_show = notification->getName() == "SystemMessage" 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 8620c09f9a3..91f3b7456f5 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -7527,6 +7527,7 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th
    name="TeleportOffered"
    log_to_im="true"
    log_to_chat="false"
+   fade_toast="false"
    type="offer"
    sound="UISndNewIncomingIMSession">
 [NAME_SLURL] has offered to teleport you to their location:
@@ -7602,6 +7603,7 @@ However, this region contains content accessible to adults only.
    icon="notify.tga"
    name="TeleportRequest"
    log_to_im="true"
+   fade_toast="false"
    type="offer">
 [NAME_SLURL] is requesting to be teleported to your location.
 [MESSAGE]
@@ -7958,6 +7960,7 @@ Other Key Experiences may be available.
    icon="notify.tga"
    name="ScriptQuestionExperience"
    persist="false"
+   fade_toast="false"
    type="notify">
 &apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos;, an object owned by &apos;[NAME]&apos;, requests your participation in the [GRID_WIDE] experience:
 
-- 
GitLab