summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2016-01-15 17:01:16 -0500
committerOz Linden <oz@lindenlab.com>2016-01-15 17:01:16 -0500
commit9848fc42534e48d20cf6d6732aae1c8233580792 (patch)
treecdc30035e2b6ced3cf6d4f9df1844ea7dc4c2836 /indra/llui
parent4b7ff25eba4b285e267ec6f766221ffcde82a808 (diff)
parent5a5c023e291990a463b1a91846ce82c70da8daab (diff)
merge changes for 4.0.1-release
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llkeywords.cpp11
-rwxr-xr-xindra/llui/llnotifications.cpp24
-rwxr-xr-xindra/llui/llnotifications.h1
-rwxr-xr-xindra/llui/llurlentry.cpp5
-rwxr-xr-xindra/llui/llurlregistry.cpp7
-rwxr-xr-xindra/llui/llurlregistry.h1
-rwxr-xr-xindra/llui/tests/llurlentry_test.cpp14
7 files changed, 52 insertions, 11 deletions
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index 6c1333a2af..69e338ddb9 100755
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -296,7 +296,7 @@ void LLKeywords::processTokensGroup(const LLSD& tokens, const std::string& group
}
color_group = getColorGroup(group);
- LL_INFOS("SyntaxLSL") << "Group: '" << group << "', using color: '" << color_group << "'" << LL_ENDL;
+ LL_DEBUGS("SyntaxLSL") << "Group: '" << group << "', using color: '" << color_group << "'" << LL_ENDL;
if (tokens.isMap())
{
@@ -331,7 +331,14 @@ void LLKeywords::processTokensGroup(const LLSD& tokens, const std::string& group
switch (token_type)
{
case LLKeywordToken::TT_CONSTANT:
- color_group = getColorGroup(group + "-" + getAttribute("type"));
+ if (getAttribute("type").length() > 0)
+ {
+ color_group = getColorGroup(group + "-" + getAttribute("type"));
+ }
+ else
+ {
+ color_group = getColorGroup(group);
+ }
tooltip = "Type: " + getAttribute("type") + ", Value: " + getAttribute("value");
break;
case LLKeywordToken::TT_EVENT:
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 7e235997d8..77e7d375c8 100755
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1715,6 +1715,30 @@ void LLNotifications::cancelByName(const std::string& name)
}
}
+void LLNotifications::cancelByOwner(const LLUUID ownerId)
+{
+ std::vector<LLNotificationPtr> notifs_to_cancel;
+ for (LLNotificationSet::iterator it = mItems.begin(), end_it = mItems.end();
+ it != end_it;
+ ++it)
+ {
+ LLNotificationPtr pNotif = *it;
+ if (pNotif && pNotif->getPayload().get("owner_id").asUUID() == ownerId)
+ {
+ notifs_to_cancel.push_back(pNotif);
+ }
+ }
+
+ for (std::vector<LLNotificationPtr>::iterator it = notifs_to_cancel.begin(), end_it = notifs_to_cancel.end();
+ it != end_it;
+ ++it)
+ {
+ LLNotificationPtr pNotif = *it;
+ pNotif->cancel();
+ updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
+ }
+}
+
void LLNotifications::update(const LLNotificationPtr pNotif)
{
LLNotificationSet::iterator it=mItems.find(pNotif);
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 0d673d178b..010e6caba2 100755
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -924,6 +924,7 @@ public:
void add(const LLNotificationPtr pNotif);
void cancel(LLNotificationPtr pNotif);
void cancelByName(const std::string& name);
+ void cancelByOwner(const LLUUID ownerId);
void update(const LLNotificationPtr pNotif);
LLNotificationPtr find(LLUUID uuid);
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 7f6cc22e90..576fff5fb2 100755
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -449,7 +449,10 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
//
LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL()
{
- mPattern = boost::regex("https?://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?\\/\\S*",
+ mPattern = boost::regex("((http://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com)"
+ "|"
+ "(https://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?))"
+ "\\/\\S*",
boost::regex::perl|boost::regex::icase);
mIcon = "Hand";
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 69eefa736c..23c6d5a954 100755
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -41,7 +41,8 @@ LLUrlRegistry::LLUrlRegistry()
mUrlEntry.reserve(20);
// Urls are matched in the order that they were registered
- registerUrl(new LLUrlEntryNoLink());
+ mUrlEntryNoLink = new LLUrlEntryNoLink();
+ registerUrl(mUrlEntryNoLink);
mUrlEntryIcon = new LLUrlEntryIcon();
registerUrl(mUrlEntryIcon);
mLLUrlEntryInvalidSLURL = new LLUrlEntryInvalidSLURL();
@@ -214,7 +215,6 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
// did we find a match? if so, return its details in the match object
if (match_entry)
{
-
// Skip if link is an email with an empty username (starting with @). See MAINT-5371.
if (match_start > 0 && text.substr(match_start - 1, 1) == "@")
return false;
@@ -223,7 +223,8 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
std::string url = text.substr(match_start, match_end - match_start + 1);
LLUrlEntryBase *stripped_entry = NULL;
- if(LLStringUtil::containsNonprintable(url))
+ if((match_entry != mUrlEntryNoLink) && (match_entry != mUrlEntryHTTPLabel) && (match_entry !=mUrlEntrySLLabel)
+ && LLStringUtil::containsNonprintable(url))
{
LLStringUtil::stripNonprintable(url);
diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h
index 5ce4048d5d..24c3a2b513 100755
--- a/indra/llui/llurlregistry.h
+++ b/indra/llui/llurlregistry.h
@@ -98,6 +98,7 @@ private:
LLUrlEntryBase* mLLUrlEntryInvalidSLURL;
LLUrlEntryBase* mUrlEntryHTTPLabel;
LLUrlEntryBase* mUrlEntrySLLabel;
+ LLUrlEntryBase* mUrlEntryNoLink;
};
#endif
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 96e94c0f80..dde54c78c4 100755
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -838,17 +838,21 @@ namespace tut
"search something https://marketplace.secondlife.com/products/search on marketplace and test the https",
"https://marketplace.secondlife.com/products/search");
- testRegex("match urls with port", url,
- "let's specify some port http://secondlife.com:888/status",
- "http://secondlife.com:888/status");
+ testRegex("match HTTPS urls with port", url,
+ "let's specify some port https://secondlife.com:888/status",
+ "https://secondlife.com:888/status");
+
+ testRegex("don't match HTTP urls with port", url,
+ "let's specify some port for HTTP http://secondlife.com:888/status",
+ "");
testRegex("don't match urls w/o protocol", url,
"looks like an url something www.marketplace.secondlife.com/products but no https prefix",
"");
testRegex("but with a protocol www is fine", url,
- "so let's add a protocol http://www.marketplace.secondlife.com:8888/products",
- "http://www.marketplace.secondlife.com:8888/products");
+ "so let's add a protocol https://www.marketplace.secondlife.com:8888/products",
+ "https://www.marketplace.secondlife.com:8888/products");
testRegex("don't match urls w/o protocol", url,
"and even no www something secondlife.com/status",