summaryrefslogtreecommitdiff
path: root/indra/newview/lltooldraganddrop.cpp
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2010-03-19 15:54:01 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2010-03-19 15:54:01 +0200
commit5fa1c1531bbeb23aa76ba605fb7bd30b3f51c6dd (patch)
treea9a354c260d649fd2ebc862b1703666b688c0461 /indra/newview/lltooldraganddrop.cpp
parent37812054480843bca8e9016e3f816e9fdee6e7d3 (diff)
parent97a35b487545572ce9409e06bd54ad29f0da7114 (diff)
Automated merge with https://hg.productengine.com/secondlife/viewer-2-0/
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/lltooldraganddrop.cpp')
-rw-r--r--indra/newview/lltooldraganddrop.cpp38
1 files changed, 28 insertions, 10 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 125c62474e..47e60a966e 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-im"));
+ }
+ }
}
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);
}
}