summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrew Dyukov <adyukov@productengine.com>2010-03-12 16:18:56 +0200
committerAndrew Dyukov <adyukov@productengine.com>2010-03-12 16:18:56 +0200
commitda3d0b104ac48ba0d5bcc0bc7b5b2561bae911b3 (patch)
tree844852d0cc86f6a0640785e0987a8aec46d7ac21 /indra/newview
parente7027a57e17b565f98f401f3f2cd1af8c91f2af7 (diff)
Fixed reopened normal sub-task EXT-5950 (Do not spawn IM chiclet for "drop on avatar" inventory offers).
- Added logging of "Inventory item offered" message when dnd'ing item on avatar via new LLToolDragAndDrop::logInventoryOffer() method. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lltooldraganddrop.cpp38
-rw-r--r--indra/newview/lltooldraganddrop.h4
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml1
3 files changed, 33 insertions, 10 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 125c62474e..08f874d1d2 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -1503,15 +1503,38 @@ void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent,
LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY);
+ logInventoryOffer(to_agent, im_session_id);
+
+ // add buddy to recent people list
+ LLRecentPeople::instance().add(to_agent);
+}
+
+//static
+void LLToolDragAndDrop::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im_session_id)
+{
+ // compute id of possible IM session with agent that has "to_agent" id
+ LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, to_agent);
// If this item was given by drag-and-drop into an IM panel, log this action in the IM panel chat.
- if (im_session_id != LLUUID::null)
+ if (im_session_id.notNull())
{
LLSD args;
gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args);
}
-
- // add buddy to recent people list
- LLRecentPeople::instance().add(to_agent);
+ // If this item was given by drag-and-drop on avatar while IM panel was open, log this action in the IM panel chat.
+ else if (LLIMModel::getInstance()->findIMSession(session_id))
+ {
+ LLSD args;
+ gIMMgr->addSystemMessage(session_id, "inventory_item_offered", args);
+ }
+ // If this item was given by drag-and-drop on avatar while IM panel wasn't open, log this action to IM history.
+ else
+ {
+ std::string full_name;
+ if (gCacheName->getFullName(to_agent, full_name))
+ {
+ LLIMModel::instance().logToFile(full_name, LLTrans::getString("SECOND_LIFE"), im_session_id, LLTrans::getString("inventory_item_offered"));
+ }
+ }
}
void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent,
@@ -1723,12 +1746,7 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent,
LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY);
- // If this item was given by drag-and-drop into an IM panel, log this action in the IM panel chat.
- if (im_session_id != LLUUID::null)
- {
- LLSD args;
- gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args);
- }
+ logInventoryOffer(to_agent, im_session_id);
}
}
diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h
index 79b2bc32a3..0da13dac8b 100644
--- a/indra/newview/lltooldraganddrop.h
+++ b/indra/newview/lltooldraganddrop.h
@@ -227,6 +227,10 @@ protected:
LLInventoryCategory* cat,
const LLUUID &im_session_id = LLUUID::null);
+ // log "Inventory item offered" to IM
+ static void logInventoryOffer(const LLUUID& to_agent,
+ const LLUUID &im_session_id = LLUUID::null);
+
public:
// helper functions
static BOOL isInventoryDropAcceptable(LLViewerObject* obj, LLInventoryItem* item) { return (ACCEPT_YES_COPY_SINGLE <= willObjectAcceptInventory(obj, item)); }
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 59c54f0cad..e1f5dd93d4 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2902,6 +2902,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="IM_default_text_label">Click here to instant message.</string>
<string name="IM_to_label">To</string>
<string name="IM_moderator_label">(Moderator)</string>
+ <string name="inventory_item_offered">Inventory item offered</string>
<!-- voice calls -->
<string name="started_call">Started a voice call</string>