summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp56
1 files changed, 29 insertions, 27 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index a68e941c0c..3fda51f856 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1671,7 +1671,7 @@ void LLOfferInfo::fromLLSD(const LLSD& params)
*this = params;
}
-void LLOfferInfo::sendReceiveResponse(const LLUUID &destination_folder_id)
+void LLOfferInfo::sendReceiveResponse(bool accept, const LLUUID &destination_folder_id)
{
if(IM_INVENTORY_OFFERED == mIM)
{
@@ -1719,9 +1719,17 @@ void LLOfferInfo::sendReceiveResponse(const LLUUID &destination_folder_id)
im = IM_GROUP_NOTICE;
}
- msg->addU8Fast(_PREHASH_Dialog, (U8)(im + 1));
- msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(destination_folder_id.mData),
- sizeof(destination_folder_id.mData));
+ if (accept)
+ {
+ msg->addU8Fast(_PREHASH_Dialog, (U8)(im + 1));
+ msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(destination_folder_id.mData),
+ sizeof(destination_folder_id.mData));
+ }
+ else
+ {
+ msg->addU8Fast(_PREHASH_Dialog, (U8)(im + 2));
+ msg->addBinaryDataFast(_PREHASH_BinaryBucket, EMPTY_BINARY_BUCKET, EMPTY_BINARY_BUCKET_SIZE);
+ }
// send the message
msg->sendReliable(mHost);
@@ -1790,7 +1798,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
// TODO: when task inventory offers can also be handled the new way, migrate the code that sets these strings here:
from_string = chatHistory_string = mFromName;
-
+
+ // accept goes to proper folder, decline gets accepted to trash, muted gets declined
+ bool accept_to_trash = true;
+
LLNotificationFormPtr modified_form(notification_ptr ? new LLNotificationForm(*notification_ptr->getForm()) : new LLNotificationForm());
switch(button)
@@ -1824,7 +1835,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
case IM_GROUP_NOTICE:
case IM_GROUP_NOTICE_REQUESTED:
opener = new LLOpenTaskGroupOffer;
- sendReceiveResponse(mFolderID);
+ sendReceiveResponse(true, mFolderID);
break;
case IM_TASK_INVENTORY_OFFERED:
// This is an offer from a task or group.
@@ -1861,6 +1872,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
{
modified_form->setElementEnabled("Mute", false);
}
+ accept_to_trash = false; // for notices, but IOR_MUTE normally doesn't happen for notices
// MUTE falls through to decline
case IOR_DECLINE:
{
@@ -1874,6 +1886,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
if( LLMuteList::getInstance()->isMuted(mFromID ) && ! LLMuteList::getInstance()->isLinden(mFromName) ) // muting for SL-42269
{
chat.mMuted = TRUE;
+ accept_to_trash = false; // will send decline message
}
// *NOTE dzaporozhan
@@ -1896,8 +1909,9 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
else if (mIM == IM_GROUP_NOTICE)
{
// group notice needs to request object to trash so that user will see it later
+ // Note: muted agent offers go to trash, not sure if we should do same for notices
LLUUID trash = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
- sendReceiveResponse(trash);
+ sendReceiveResponse(accept_to_trash, trash);
}
if (modified_form != NULL)
@@ -1916,7 +1930,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
if (mIM == IM_GROUP_NOTICE)
{
LLUUID trash = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
- sendReceiveResponse(trash);
+ sendReceiveResponse(true, trash);
}
break;
}
@@ -2009,8 +2023,8 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
from_string = chatHistory_string = mFromName;
}
- bool is_do_not_disturb = gAgent.isDoNotDisturb();
LLUUID destination;
+ bool accept = true;
// If user accepted, accept to proper folder, if user discarded, accept to trash.
switch(button)
@@ -2028,33 +2042,21 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
break;
case IOR_MUTE:
// MUTE falls through to decline
+ accept = false;
case IOR_DECLINE:
default:
// close button probably (or any of the fall-throughs from above)
destination = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
-
- if (is_do_not_disturb && (!mFromGroup && !mFromObject))
+ if (accept && LLMuteList::getInstance()->isMuted(mFromID, mFromName))
{
- LLMessageSystem* msg = gMessageSystem;
- send_do_not_disturb_message(msg,mFromID);
+ // Note: muted offers are usually declined automatically,
+ // but user can mute object after receiving message
+ accept = false;
}
break;
}
- sendReceiveResponse(destination);
-
- // Purely for logging purposes.
- switch (mIM)
- {
- case IM_INVENTORY_OFFERED:
- case IM_GROUP_NOTICE:
- case IM_TASK_INVENTORY_OFFERED:
- case IM_GROUP_NOTICE_REQUESTED:
- break;
- default:
- LL_WARNS("Messaging") << "inventory_task_offer_callback: unknown offer type" << LL_ENDL;
- break;
- }
+ sendReceiveResponse(accept, destination);
if(!mPersist)
{