summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llnotifications.cpp34
-rw-r--r--indra/llui/llnotifications.h2
-rw-r--r--indra/llui/llnotificationtemplate.h12
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml29
4 files changed, 76 insertions, 1 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index dd56f03237..289020fa3f 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -437,6 +437,14 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
mUniqueContext.push_back(it->key);
}
+ for(LLInitParam::ParamIterator<LLNotificationTemplate::Tag>::const_iterator it = p.tags.begin(),
+ end_it = p.tags.end();
+ it != end_it;
+ ++it)
+ {
+ mTags.push_back(it->value);
+ }
+
mForm = LLNotificationFormPtr(new LLNotificationForm(p.name, p.form_ref.form));
}
@@ -716,6 +724,25 @@ bool LLNotification::hasUniquenessConstraints() const
return (mTemplatep ? mTemplatep->mUnique : false);
}
+bool LLNotification::matchesTag(const std::string& tag)
+{
+ bool result = false;
+
+ if(mTemplatep)
+ {
+ std::list<std::string>::iterator it;
+ for(it = mTemplatep->mTags.begin(); it != mTemplatep->mTags.end(); it++)
+ {
+ if((*it) == tag)
+ {
+ result = true;
+ break;
+ }
+ }
+ }
+
+ return result;
+}
void LLNotification::setIgnored(bool ignore)
{
@@ -1653,7 +1680,12 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
if(!(*it)->mTag.empty())
{
- // TODO: check this notification's tag(s) against it->mTag and continue if no match is found.
+ // check this notification's tag(s) against it->mTag and continue if no match is found.
+ if(!n->matchesTag((*it)->mTag))
+ {
+ // This rule's non-empty tag didn't match one of the notification's tags. Skip this rule.
+ continue;
+ }
}
// If we got here, the rule matches. Don't evaluate subsequent rules.
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 75c67151ca..98ff035170 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -580,6 +580,8 @@ public:
std::string summarize() const;
bool hasUniquenessConstraints() const;
+
+ bool matchesTag(const std::string& tag);
virtual ~LLNotification() {}
};
diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h
index 6bc0d2aaff..dfc2b10eb5 100644
--- a/indra/llui/llnotificationtemplate.h
+++ b/indra/llui/llnotificationtemplate.h
@@ -156,6 +156,15 @@ struct LLNotificationTemplate
{}
};
+ struct Tag : public LLInitParam::Block<Tag>
+ {
+ Mandatory<std::string> value;
+
+ Tag()
+ : value("value")
+ {}
+ };
+
struct Params : public LLInitParam::Block<Params>
{
Mandatory<std::string> name;
@@ -173,6 +182,7 @@ struct LLNotificationTemplate
Optional<FormRef> form_ref;
Optional<ENotificationPriority,
NotificationPriorityValues> priority;
+ Multiple<Tag> tags;
Params()
@@ -276,6 +286,8 @@ struct LLNotificationTemplate
// this is loaded as a name, but looked up to get the UUID upon template load.
// If null, it wasn't specified.
LLUUID mSoundEffect;
+ // List of tags that rules can match against.
+ std::list<std::string> mTags;
};
#endif //LL_LLNOTIFICATION_TEMPLATE_H
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 5966db9d51..7dd7cefa5d 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3118,6 +3118,7 @@ You have reached your maximum number of groups. Please leave some group before j
icon="alert.tga"
name="KickUser"
type="alert">
+ <tag>win</tag>
Kick this Resident with what message?
<form name="form">
<input name="message" type="text">
@@ -3139,6 +3140,7 @@ An administrator has logged you off.
icon="alert.tga"
name="KickAllUsers"
type="alert">
+ <tag>win</tag>
Kick everyone currently on the grid with what message?
<form name="form">
<input name="message" type="text">
@@ -3160,6 +3162,7 @@ An administrator has logged you off.
icon="alert.tga"
name="FreezeUser"
type="alert">
+ <tag>win</tag>
Freeze this Resident with what message?
<form name="form">
<input name="message" type="text">
@@ -3181,6 +3184,7 @@ You have been frozen. You cannot move or chat. An administrator will contact you
icon="alert.tga"
name="UnFreezeUser"
type="alert">
+ <tag>win</tag>
Unfreeze this Resident with what message?
<form name="form">
<input name="message" type="text">
@@ -5046,6 +5050,7 @@ You can only claim public land in the Region you&apos;re in.
name="RegionTPAccessBlocked"
persist="true"
type="notify">
+ <tag>fail</tag>
You aren&apos;t allowed in that Region due to your maturity Rating. You may need to validate your age and/or install the latest Viewer.
Please go to the Knowledge Base for details on accessing areas with this maturity Rating.
@@ -5056,6 +5061,7 @@ Please go to the Knowledge Base for details on accessing areas with this maturit
name="URBannedFromRegion"
persist="true"
type="notify">
+ <tag>fail</tag>
You are banned from the region.
</notification>
@@ -5064,6 +5070,7 @@ You are banned from the region.
name="NoTeenGridAccess"
persist="true"
type="notify">
+ <tag>fail</tag>
Your account cannot connect to this teen grid region.
</notification>
@@ -5072,6 +5079,7 @@ Your account cannot connect to this teen grid region.
name="ImproperPaymentStatus"
persist="true"
type="notify">
+ <tag>fail</tag>
You do not have proper payment status to enter this region.
</notification>
@@ -5080,6 +5088,7 @@ You do not have proper payment status to enter this region.
name="MustGetAgeRgion"
persist="true"
type="notify">
+ <tag>fail</tag>
You must be age-verified to enter this region.
</notification>
@@ -5088,6 +5097,7 @@ You must be age-verified to enter this region.
name="MustGetAgeParcel"
persist="true"
type="notify">
+ <tag>fail</tag>
You must be age-verified to enter this parcel.
</notification>
@@ -5096,6 +5106,7 @@ You must be age-verified to enter this parcel.
name="NoDestRegion"
persist="true"
type="notify">
+ <tag>fail</tag>
No destination region found.
</notification>
@@ -5104,6 +5115,7 @@ No destination region found.
name="NotAllowedInDest"
persist="true"
type="notify">
+ <tag>fail</tag>
You are not allowed into the destination.
</notification>
@@ -5112,6 +5124,7 @@ You are not allowed into the destination.
name="RegionParcelBan"
persist="true"
type="notify">
+ <tag>fail</tag>
Cannot region cross into banned parcel. Try another way.
</notification>
@@ -5128,6 +5141,7 @@ You have been redirected to a telehub.
name="CouldntTPCloser"
persist="true"
type="notify">
+ <tag>fail</tag>
Could not teleport closer to destination.
</notification>
@@ -5144,6 +5158,7 @@ Teleport cancelled.
name="FullRegionTryAgain"
persist="true"
type="notify">
+ <tag>fail</tag>
The region you are attempting to enter is currently full.
Please try again in a few moments.
</notification>
@@ -5153,6 +5168,7 @@ Please try again in a few moments.
name="GeneralFailure"
persist="true"
type="notify">
+ <tag>fail</tag>
General failure.
</notification>
@@ -5161,6 +5177,7 @@ General failure.
name="RoutedWrongRegion"
persist="true"
type="notify">
+ <tag>fail</tag>
Routed to wrong region. Please try again.
</notification>
@@ -5169,6 +5186,7 @@ Routed to wrong region. Please try again.
name="NoValidAgentID"
persist="true"
type="notify">
+ <tag>fail</tag>
No valid agent id.
</notification>
@@ -5177,6 +5195,7 @@ No valid agent id.
name="NoValidSession"
persist="true"
type="notify">
+ <tag>fail</tag>
No valid session id.
</notification>
@@ -5185,6 +5204,7 @@ No valid session id.
name="NoValidCircuit"
persist="true"
type="notify">
+ <tag>fail</tag>
No valid circuit code.
</notification>
@@ -5193,6 +5213,7 @@ No valid circuit code.
name="NoValidTimestamp"
persist="true"
type="notify">
+ <tag>fail</tag>
No valid timestamp.
</notification>
@@ -5201,6 +5222,7 @@ No valid timestamp.
name="NoPendingConnection"
persist="true"
type="notify">
+ <tag>fail</tag>
Unable to create pending connection.
</notification>
@@ -5209,6 +5231,7 @@ Unable to create pending connection.
name="InternalUsherError"
persist="true"
type="notify">
+ <tag>fail</tag>
Internal error attempting to connect agent usher.
</notification>
@@ -5217,6 +5240,7 @@ Internal error attempting to connect agent usher.
name="NoGoodTPDestination"
persist="true"
type="notify">
+ <tag>fail</tag>
Unable to find a good teleport destination in this region.
</notification>
@@ -5225,6 +5249,7 @@ Unable to find a good teleport destination in this region.
name="InternalErrorRegionResolver"
persist="true"
type="notify">
+ <tag>fail</tag>
Internal error attempting to activate region resolver.
</notification>
@@ -5233,6 +5258,7 @@ Internal error attempting to activate region resolver.
name="NoValidLanding"
persist="true"
type="notify">
+ <tag>fail</tag>
A valid landing point could not be found.
</notification>
@@ -5241,6 +5267,7 @@ A valid landing point could not be found.
name="NoValidParcel"
persist="true"
type="notify">
+ <tag>fail</tag>
No valid parcel could be found.
</notification>
@@ -5617,6 +5644,7 @@ Grant this request?
name="FirstBalanceIncrease"
persist="true"
type="notify">
+ <tag>win</tag>
You just received L$[AMOUNT].
Your L$ balance is shown in the upper-right.
</notification>
@@ -6095,6 +6123,7 @@ The SLurl you clicked on is not supported.
name="BlockedSLURL"
priority="high"
type="notifytip">
+ <tag>win</tag>
A SLurl was received from an untrusted browser and has been blocked for your security.
</notification>