summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llbrowsernotification.cpp9
-rw-r--r--indra/newview/llmediactrl.cpp5
-rw-r--r--indra/newview/llmediactrl.h3
3 files changed, 13 insertions, 4 deletions
diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp
index ee19701773..d6a813d608 100644
--- a/indra/newview/llbrowsernotification.cpp
+++ b/indra/newview/llbrowsernotification.cpp
@@ -30,12 +30,19 @@
#include "llnotificationhandler.h"
#include "llnotifications.h"
#include "llfloaterreg.h"
+#include "llmediactrl.h"
using namespace LLNotificationsUI;
bool LLBrowserNotification::processNotification(const LLSD& notify)
{
+ LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
+ if (!notification) return false;
- // browser notifications are currently handled directly by the LLMediaCtrl instance that spawned them
+ LLMediaCtrl* media_instance = LLMediaCtrl::getInstance(notification->getPayload()["media_id"].asUUID());
+ if (media_instance)
+ {
+ media_instance->showNotification(notification);
+ }
return false;
}
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 9d172b7301..33e46e70f7 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -77,6 +77,7 @@ LLMediaCtrl::Params::Params()
LLMediaCtrl::LLMediaCtrl( const Params& p) :
LLPanel( p ),
+ LLInstanceTracker(LLUUID::generateNewID()),
mTextureDepthBytes( 4 ),
mBorder(NULL),
mFrequentUpdates( true ),
@@ -1032,7 +1033,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
LLNotification::Params notify_params;
notify_params.name = "PopupAttempt";
- notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid);
+ notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid).with("media_id", getKey());
notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2);
if (mTrusted)
@@ -1041,7 +1042,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
}
else
{
- showNotification(LLNotifications::instance().add(notify_params));
+ LLNotifications::instance().add(notify_params);
}
break;
};
diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h
index f010e5f4c8..65dfbbff78 100644
--- a/indra/newview/llmediactrl.h
+++ b/indra/newview/llmediactrl.h
@@ -40,7 +40,8 @@ class LLUICtrlFactory;
class LLMediaCtrl :
public LLPanel,
public LLViewerMediaObserver,
- public LLViewerMediaEventEmitter
+ public LLViewerMediaEventEmitter,
+ public LLInstanceTracker<LLMediaCtrl, LLUUID>
{
LOG_CLASS(LLMediaCtrl);
public: