Optional V1 legacy inventory accept/decline messages (affects the message itself only, not inventory behavior)

Ansariel 2012-04-01 14:52:03 +02:00
parent 851a97296f
commit 3632b05192
5 changed files with 74 additions and 2 deletions

View File

@ -17151,5 +17151,16 @@ Change of this parameter will affect the layout of buttons in notification toast
<integer>1</integer>
</map>
<!-- </FS:Zi> -->
<key>FSUseLegacyInventoryAcceptMessages</key>
<map>
<key>Comment</key>
<string>If enabled, the viewer will send accept/decline response for inventory offers after the according button has been pressed and not if the item has been received at the receiver's inventory already.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -1484,6 +1484,33 @@ void LLOfferInfo::send_auto_receive_response(void)
}
}
// <FS:Ansariel> Optional V1-like inventory accept messages
void LLOfferInfo::send_decline_response(void)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_MessageBlock);
msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
msg->addUUIDFast(_PREHASH_ToAgentID, mFromID);
msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
msg->addUUIDFast(_PREHASH_ID, mTransactionID);
msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
std::string name;
LLAgentUI::buildFullname(name);
msg->addStringFast(_PREHASH_FromAgentName, name);
msg->addStringFast(_PREHASH_Message, "");
msg->addU32Fast(_PREHASH_ParentEstateID, 0);
msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 2));
msg->addBinaryDataFast(_PREHASH_BinaryBucket, EMPTY_BINARY_BUCKET, EMPTY_BINARY_BUCKET_SIZE);
msg->sendReliable(mHost);
}
// </FS:Ansariel> Optional V1-like inventory accept messages
void LLOfferInfo::handleRespond(const LLSD& notification, const LLSD& response)
{
initRespondFunctionMap();
@ -1577,6 +1604,13 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
opener = open_agent_offer;
}
}
// <FS:Ansariel> Optional V1-like inventory accept messages
if (gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages"))
{
send_auto_receive_response();
}
// </FS:Ansariel> Optional V1-like inventory accept messages
}
break;
case IM_GROUP_NOTICE:
@ -1639,6 +1673,12 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
opener = discard_agent_offer;
}
// <FS:Ansariel> Optional V1-like inventory accept messages
if (gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages"))
{
send_decline_response();
}
// </FS:Ansariel> Optional V1-like inventory accept messages
if (busy && (!mFromGroup && !mFromObject))
{
@ -2088,7 +2128,14 @@ void inventory_offer_handler(LLOfferInfo* info)
}
// In viewer 2 we're now auto receiving inventory offers and messaging as such (not sending reject messages).
info->send_auto_receive_response();
// <FS:Ansariel> Optional V1-like inventory accept messages
//info->send_auto_receive_response();
// Also needs to be send on auto-accept so the item gets into the inventory!
if (bAutoAccept || !gSavedSettings.getBOOL("FSUseLegacyInventoryAcceptMessages"))
{
info->send_auto_receive_response();
}
// </FS:Ansariel> Optional V1-like inventory accept messages
if( !bAutoAccept ) // Nicky D. if we auto accept, do not pester the user with stuff in the chicklet.
// Inform user that there is a script floater via toast system

View File

@ -235,6 +235,8 @@ public:
/*virtual*/ void handleRespond(const LLSD& notification, const LLSD& response);
void send_auto_receive_response(void);
// <FS:Ansariel> Optional V1-like inventory accept messages
void send_decline_response(void);
// TODO - replace all references with handleRespond()
bool inventory_offer_callback(const LLSD& notification, const LLSD& response);

View File

@ -18,6 +18,7 @@
<check_box label="Kamerafokus auch lokal nicht anzeigen" name="privateLocalLookat"/>
<check_box label="Auswahl Ziel nicht anzeigen" name="privatepointat"/>
<check_box label="Automatisches Akzeptieren von Inventar-Angeboten" name="Auto_Accept_New_Inventory"/>
<check_box label="Klassische Annahme/Ablehnungs-Nachrichten für Inventar-Angebote verwenden" name="FSUseLegacyInventoryAcceptMessages" tool_tip="Falls aktiviert, werden Annahme- bzw. Ablehnungs-Nachrichten erst verschickt, wenn der entsprechende Button angeklickt wurde. Falls deaktiviert, wird automatisch eine Annahme-Nachricht verschickt, sobald das angebotene Objekt im Inventar eingetroffen ist. Diese Option hat keinen Effekt, wenn Inventar-Angebote automatisch akzeptiert werden."/>
<check_box label="Automatisch empfangene Objekte im Inventar anzeigen" name="Show_In_Inventory"/>
<check_box label="Automatisch akzeptierte Notizkarten, Landmarken und Texturen anzeigen" name="Show_New_Inventory"/>
<check_box label="Partikeleffekte erzeugen, wenn Objekte an andere Avatare gegeben werden" name="FSCreateGiveInventoryParticleEffect"/>

View File

@ -107,13 +107,24 @@
<check_box
control_name="AutoAcceptNewInventory"
height="16"
label="Auto Accept New Inventory Items"
label="Automatically accept new inventory items"
layout="topleft"
left="30"
name="Auto_Accept_New_Inventory"
top_pad="4"
width="350" />
<check_box
control_name="FSUseLegacyInventoryAcceptMessages"
height="16"
label="Use legacy inventory offer accept/decline messages"
layout="topleft"
left="30"
name="FSUseLegacyInventoryAcceptMessages"
tool_tip="If enabled, the viewer will only send accept and decline messages after pressing the according button. If disabled, the accept response will be sent automatically as soon as the inventory offer has been received. This option has no effect is inventory offers are accepted automatically."
top_pad="4"
width="350" />
<check_box
control_name="ShowInInventory"
height="16"