diff options
| author | Andrew A. de Laix <alain@lindenlab.com> | 2010-07-02 08:56:49 -0700 |
|---|---|---|
| committer | Andrew A. de Laix <alain@lindenlab.com> | 2010-07-02 08:56:49 -0700 |
| commit | 6098fd2ebcd1bd78a8f8c638f707e8a14033df9b (patch) | |
| tree | 9e296f4096ee670237e9545ee0e9c083c6ad5dbd /indra/llui/llnotifications.cpp | |
| parent | f1a1f613cf035d9c8e15c03bac7b00972eb3bb66 (diff) | |
| parent | 5fd6887477b61e10ffd29086b9330a54b3a571d2 (diff) | |
Automated merge with ssh://hg.lindenlab.com/brad/viewer-dev
Diffstat (limited to 'indra/llui/llnotifications.cpp')
| -rw-r--r-- | indra/llui/llnotifications.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7b8f51ae3c..621e72ce38 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -560,21 +560,6 @@ void LLNotification::setResponseFunctor(const LLNotificationResponderPtr& respon mResponder = responder; } -bool LLNotification::payloadContainsAll(const std::vector<std::string>& required_fields) const -{ - for(std::vector<std::string>::const_iterator required_fields_it = required_fields.begin(); - required_fields_it != required_fields.end(); - required_fields_it++) - { - std::string required_field_name = *required_fields_it; - if( ! getPayload().has(required_field_name)) - { - return false; // a required field was not found - } - } - return true; // all required fields were found -} - bool LLNotification::isEquivalentTo(LLNotificationPtr that) const { if (this->mTemplatep->mName != that->mTemplatep->mName) @@ -583,11 +568,22 @@ bool LLNotification::isEquivalentTo(LLNotificationPtr that) const } if (this->mTemplatep->mUnique) { + const LLSD& these_substitutions = this->getSubstitutions(); + const LLSD& those_substitutions = that->getSubstitutions(); + // highlander bit sez there can only be one of these - return - this->payloadContainsAll(that->mTemplatep->mUniqueContext) && - that->payloadContainsAll(this->mTemplatep->mUniqueContext); + for (std::vector<std::string>::const_iterator it = mTemplatep->mUniqueContext.begin(), end_it = mTemplatep->mUniqueContext.end(); + it != end_it; + ++it) + { + if (these_substitutions.get(*it).asString() != those_substitutions.get(*it).asString()) + { + return false; + } + } + return true; } + return false; } |
