diff -r 4a7158d7714c indra/newview/llnotificationofferhandler.cpp --- a/indra/newview/llnotificationofferhandler.cpp Mon Apr 25 09:28:36 2011 -0400 +++ b/indra/newview/llnotificationofferhandler.cpp Tue Apr 26 20:38:57 2011 +0300 @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" // must be first include +#include "llmutelist.h" #include "llnotificationhandler.h" #include "lltoastnotifypanel.h" #include "llviewercontrol.h" @@ -92,6 +93,12 @@ if( notification->getPayload().has("give_inventory_notification") && !notification->getPayload()["give_inventory_notification"] ) { + const LLUUID object_id = notification->getPayload()["object_id"].asUUID(); + + // should not show offers from blocked objects + if (LLMuteList::getInstance()->isMuted(object_id)) + return false; + // This is an original inventory offer, so add a script floater LLScriptFloaterManager::instance().onAddNotification(notification->getID()); } diff -r 4a7158d7714c indra/newview/llviewermessage.cpp --- a/indra/newview/llviewermessage.cpp Mon Apr 25 09:28:36 2011 -0400 +++ b/indra/newview/llviewermessage.cpp Tue Apr 26 20:38:57 2011 +0300 @@ -1248,8 +1248,8 @@ } else if(offer && offer->mFromObject) { - //we have to block object by name because blocked_id is an id of owner - type = LLMute::BY_NAME; + //we have to block object by its id because object can easily change its name via a lsl call and muted-by-name entry will be useless + type = LLMute::OBJECT; } else { @@ -1579,7 +1579,17 @@ llassert(notification_ptr != NULL); if (notification_ptr != NULL) { - gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,notification_ptr->getResponderPtr())); + if(mFromObject) + {//offer came from object, so should block object itself by its id to avoid self-blocking. STORM-951. + + const LLUUID& object_id = notification_ptr->getPayload()["object_id"].asUUID(); + + inventory_offer_mute_callback(object_id, mFromName, mFromGroup, notification_ptr->getResponderPtr()); + } + else + {//offer came from avatar, so after its name will be cached, mute this avatar + gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,notification_ptr->getResponderPtr())); + } } }