EXT-8172 FIX notification of missing media plugins causes an infinite loop

reviewed by Nyx
meow-7.2.2
Richard Linden 2010-06-30 13:15:33 -07:00
parent b6c0444ea0
commit 5d743c3c58
3 changed files with 18 additions and 20 deletions

View File

@ -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;
}

View File

@ -400,8 +400,6 @@ private:
void cancel();
bool payloadContainsAll(const std::vector<std::string>& required_fields) const;
public:
// constructor from a saved notification

View File

@ -4886,6 +4886,10 @@ If you want to view streaming media on parcels that support it you should go to
persist="true"
type="notify">
No Media Plugin was found to handle the "[MIME_TYPE]" mime type. Media of this type will be unavailable.
<unique>
<context key="[MIME_TYPE]"/>
</unique>
</notification>
<notification
icon="alertmodal.tga"