From 1ae67f66d1d0203069cec62421d1d71d67a3334f Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Thu, 7 Oct 2010 15:44:35 -0700
Subject: [PATCH] Fixed a problem that prevented notification tags from being
 parsed.

Added some lldebugs to the LLNotificationTemplate constructor and LLNotifications::isVisibleByRules() that may be useful in debugging notification issues in the future.
---
 indra/llui/llnotifications.cpp      | 17 +++++++++++++----
 indra/llui/llnotificationtemplate.h |  3 ++-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index c41c19216ca..916ca24d136 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -419,12 +419,15 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
 	{
 		mUniqueContext.push_back(it->key);
 	}
-
+	
+	lldebugs << "notification \"" << mName << "\": tag count is " << p.tags.size() << llendl;
+	
 	for(LLInitParam::ParamIterator<LLNotificationTemplate::Tag>::const_iterator it = p.tags.begin(),
 			end_it = p.tags.end();
 		it != end_it;
 		++it)
 	{
+		lldebugs << "    tag \"" << std::string(it->value) << "\"" << llendl;
 		mTags.push_back(it->value);
 	}
 
@@ -1667,7 +1670,15 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
 	
 	for(it = mVisibilityRules.begin(); it != mVisibilityRules.end(); it++)
 	{
-		// An empty type or tag string will match any notification, so only do the comparison when the string is non-empty in the rule.
+		// An empty type/tag/name string will match any notification, so only do the comparison when the string is non-empty in the rule.
+
+		lldebugs 
+			<< "notification \"" << n->getName() << "\" " 
+			<< "testing against " << ((*it)->mVisible?"show":"hide") << " rule, "
+			<< "name = \"" << (*it)->mName << "\" "
+			<< "tag = \"" << (*it)->mTag << "\" "
+			<< "type = \"" << (*it)->mType << "\" "
+			<< llendl;
 
 		if(!(*it)->mType.empty())
 		{
@@ -1690,8 +1701,6 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
 
 		if(!(*it)->mName.empty())
 		{
-			lldebugs << "rule name = " << (*it)->mName << ", notification name = " << n->getName() << llendl;
-
 			// check this notification's name against the notification's name and continue if no match is found.
 			if((*it)->mName != n->getName())
 			{
diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h
index dfc2b10eb57..5a6ab40a2e4 100644
--- a/indra/llui/llnotificationtemplate.h
+++ b/indra/llui/llnotificationtemplate.h
@@ -199,7 +199,8 @@ struct LLNotificationTemplate
 			expire_option("expireOption", -1),
 			url("url"),
 			unique("unique"),
-			form_ref("")
+			form_ref(""),
+			tags("tag")
 		{}
 
 	};
-- 
GitLab