EXT-7097 FIXED

Replaced usage usage of "ObjectGiveItemUnknownUser" notification with functionality provided by LLPostponedNotification class;
reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/345/

--HG--
branch : product-engine
meow-7.2.2
Alexei Arabadji 2010-05-06 10:09:24 +03:00
parent 140c576c37
commit 00360bb1cd
3 changed files with 4 additions and 54 deletions

View File

@ -114,8 +114,7 @@ void LLSysHandler::removeExclusiveNotifications(const LLNotificationPtr& notif)
const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"),
REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), OBJECT_GIVE_ITEM(
"ObjectGiveItem"), OBJECT_GIVE_ITEM_UNKNOWN_USER(
"ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"),
"ObjectGiveItem"), PAYMENT_RECIVED("PaymentRecived"),
ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"),
USER_GIVE_ITEM("UserGiveItem"),
INVENTORY_ACCEPTED("InventoryAccepted"),
@ -327,8 +326,7 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
"SESSION_NAME") ? notification->getPayload()["SESSION_NAME"].asString() : name;
// don't create IM p2p session with objects, it's necessary condition to log
if (notification->getName() != OBJECT_GIVE_ITEM && notification->getName()
!= OBJECT_GIVE_ITEM_UNKNOWN_USER)
if (notification->getName() != OBJECT_GIVE_ITEM)
{
LLUUID from_id = notification->getPayload()["from_id"];

View File

@ -1237,7 +1237,6 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id,
bool matches(const LLNotificationPtr notification) const
{
if(notification->getName() == "ObjectGiveItem"
|| notification->getName() == "ObjectGiveItemUnknownUser"
|| notification->getName() == "UserGiveItem")
{
return (notification->getPayload()["from_id"].asUUID() == blocked_id);
@ -1700,7 +1699,6 @@ void LLOfferInfo::initRespondFunctionMap()
if(mRespondFunctions.empty())
{
mRespondFunctions["ObjectGiveItem"] = boost::bind(&LLOfferInfo::inventory_task_offer_callback, this, _1, _2);
mRespondFunctions["ObjectGiveItemUnknownUser"] = boost::bind(&LLOfferInfo::inventory_task_offer_callback, this, _1, _2);
mRespondFunctions["UserGiveItem"] = boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2);
}
}
@ -1771,30 +1769,6 @@ void inventory_offer_handler(LLOfferInfo* info)
return;
}
// Name cache callbacks don't store userdata, so can't save
// off the LLOfferInfo. Argh.
BOOL name_found = FALSE;
if (info->mFromGroup)
{
std::string group_name;
if (gCacheName->getGroupName(info->mFromID, group_name))
{
args["FIRST"] = group_name;
args["LAST"] = "";
name_found = TRUE;
}
}
else
{
std::string first_name, last_name;
if (gCacheName->getName(info->mFromID, first_name, last_name))
{
args["FIRST"] = first_name;
args["LAST"] = last_name;
name_found = TRUE;
}
}
// If mObjectID is null then generate the object_id based on msg to prevent
// multiple creation of chiclets for same object.
LLUUID object_id = info->mObjectID;
@ -1823,9 +1797,9 @@ void inventory_offer_handler(LLOfferInfo* info)
// Note: sets inventory_task_offer_callback as the callback
p.substitutions(args).payload(payload).functor.responder(LLNotificationResponderPtr(info));
info->mPersist = true;
p.name = name_found ? "ObjectGiveItem" : "ObjectGiveItemUnknownUser";
p.name = "ObjectGiveItem";
// Pop up inv offer chiclet and let the user accept (keep), or reject (and silently delete) the inventory.
LLNotifications::instance().add(p);
LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, info->mFromGroup == TRUE);
}
else // Agent -> Agent Inventory Offer
{

View File

@ -5086,28 +5086,6 @@ An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you this [OBJEC
</form>
</notification>
<notification
icon="notify.tga"
name="ObjectGiveItemUnknownUser"
type="offer">
An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you this [OBJECTTYPE]:
[ITEM_SLURL]
<form name="form">
<button
index="0"
name="Keep"
text="Keep"/>
<button
index="1"
name="Discard"
text="Discard"/>
<button
index="2"
name="Mute"
text="Block"/>
</form>
</notification>
<notification
icon="notify.tga"
name="UserGiveItem"