diff options
author | Callum Prentice <callum@lindenlab.com> | 2010-02-12 15:24:53 -0800 |
---|---|---|
committer | Callum Prentice <callum@lindenlab.com> | 2010-02-12 15:24:53 -0800 |
commit | c0f2f151b226417152adecb507e6b1b7f2a1f8ce (patch) | |
tree | 14961f3dddba16e27486aac834e4dece95c2f268 | |
parent | 6e0ebfe18c431465f6d1bc52e079c7a745419de5 (diff) |
"Fix for EXT-4968 - Media DnD cannot navigate prims owned by other people"
Reviewed by Rick via CodeCollab (http://10.1.19.90:8080/go?page=ReviewDisplay&reviewid=110)
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 81 |
1 files changed, 48 insertions, 33 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b76a2e150f..1dcc7389cb 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -852,56 +852,71 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject())); - if (obj && obj->permModify() && !obj->getRegion()->getCapability("ObjectMedia").empty()) + if (obj && !obj->getRegion()->getCapability("ObjectMedia").empty()) { LLTextureEntry *te = obj->getTE(object_face); if (te) { if (drop) { - if (! te->hasMedia()) + // object does NOT have media already + if ( ! te->hasMedia() ) { - // Create new media entry - LLSD media_data; - // XXX Should we really do Home URL too? - media_data[LLMediaEntry::HOME_URL_KEY] = url; - media_data[LLMediaEntry::CURRENT_URL_KEY] = url; - media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; - obj->syncMediaData(object_face, media_data, true, true); - // XXX This shouldn't be necessary, should it ?!? - if (obj->getMediaImpl(object_face)) - obj->getMediaImpl(object_face)->navigateReload(); - obj->sendMediaDataUpdate(); - - result = LLWindowCallbacks::DND_COPY; - } - else { - // Check the whitelist - if (te->getMediaData()->checkCandidateUrl(url)) + // we are allowed to modify the object + if ( obj->permModify() ) { - // just navigate to the URL + // Create new media entry + LLSD media_data; + // XXX Should we really do Home URL too? + media_data[LLMediaEntry::HOME_URL_KEY] = url; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; + obj->syncMediaData(object_face, media_data, true, true); + // XXX This shouldn't be necessary, should it ?!? if (obj->getMediaImpl(object_face)) + obj->getMediaImpl(object_face)->navigateReload(); + obj->sendMediaDataUpdate(); + + result = LLWindowCallbacks::DND_COPY; + } + } + else + // object HAS media already + { + // URL passes the whitelist + if (te->getMediaData()->checkCandidateUrl( url ) ) + { + // we are allowed to modify the object or we have navigate permissions + // NOTE: Design states you you can change the URL if you have media + // navigate permissions even if you do not have prim modify rights + if ( obj->permModify() || obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT ) ) { - obj->getMediaImpl(object_face)->navigateTo(url); + // just navigate to the URL + if (obj->getMediaImpl(object_face)) + { + obj->getMediaImpl(object_face)->navigateTo(url); + } + else + { + // This is very strange. Navigation should + // happen via the Impl, but we don't have one. + // This sends it to the server, which /should/ + // trigger us getting it. Hopefully. + LLSD media_data; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + obj->syncMediaData(object_face, media_data, true, true); + obj->sendMediaDataUpdate(); + } + result = LLWindowCallbacks::DND_LINK; } - else { - // This is very strange. Navigation should - // happen via the Impl, but we don't have one. - // This sends it to the server, which /should/ - // trigger us getting it. Hopefully. - LLSD media_data; - media_data[LLMediaEntry::CURRENT_URL_KEY] = url; - obj->syncMediaData(object_face, media_data, true, true); - obj->sendMediaDataUpdate(); - } - result = LLWindowCallbacks::DND_LINK; } } LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); mDragHoveredObject = NULL; } - else { + else + { // Check the whitelist, if there's media (otherwise just show it) if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url)) { |