From 064c9be9aedf238530ccdc941861fd057580e5b1 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 16 Dec 2009 18:56:01 -0800 Subject: Don't allow drag if the cap URL is empty or if the whitelist does not pass --- indra/newview/llviewerwindow.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 5d2ca331d6..e3de2891a1 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -827,9 +827,9 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, LLWindowCallbacks::DragNDropAction action, std::string data) { LLWindowCallbacks::DragNDropResult result = LLWindowCallbacks::DND_NONE; + if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) { - switch(action) { // Much of the handling for these two cases is the same. @@ -854,11 +854,11 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi S32 object_face = pick_info.mObjectFace; std::string url = data; - llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; + lldebugs << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); - if (obj && obj->permModify()) + if (obj && obj->permModify() && !obj->getRegion()->getCapability("ObjectMedia").empty()) { LLTextureEntry *te = obj->getTE(object_face); if (te) @@ -881,10 +881,14 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi result = LLWindowCallbacks::DND_COPY; } else { - // just navigate to the URL - obj->getMediaImpl(object_face)->navigateTo(url); + // Check the whitelist + if (te->getMediaData()->checkCandidateUrl(url)) + { + // just navigate to the URL + obj->getMediaImpl(object_face)->navigateTo(url); - result = LLWindowCallbacks::DND_LINK; + result = LLWindowCallbacks::DND_LINK; + } } LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); mDragHoveredObject = NULL; -- cgit v1.2.3