summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationofferhandler.cpp
diff options
context:
space:
mode:
authorPepper <3782201+rohvani@users.noreply.github.com>2026-09-01 19:00:25 -0400
committerGitHub <noreply@github.com>2026-09-01 19:00:25 -0400
commit56b34b332727299f2d54d4d6e8dbe5a7cb54cb11 (patch)
treef9ea9e683dc3951a49a0773084d84ffa0dd9383e /indra/newview/llnotificationofferhandler.cpp
parent66ff4c75bc2d594a41dfe22d85139311567b8e97 (diff)
parentcfbbdcb6e874d73ef9429293d3afff58e1d6c216 (diff)
Merge pull request #6208 from secondlife/pepper/chat-fixes
various fixes for chat modernization project viewer
Diffstat (limited to 'indra/newview/llnotificationofferhandler.cpp')
-rw-r--r--indra/newview/llnotificationofferhandler.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp
index 27ef28f32a..dfca370b46 100644
--- a/indra/newview/llnotificationofferhandler.cpp
+++ b/indra/newview/llnotificationofferhandler.cpp
@@ -171,22 +171,29 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification,
/*virtual*/ void LLOfferHandler::onChange(LLNotificationPtr p)
{
- auto panelp = LLToastNotifyPanel::getInstance(p->getID());
- if (panelp)
+ bool has_toast_panel = false;
+
+ // Deferred panel deletion can briefly overlap old and replacement views.
+ // Prefer the live IM projection for this notification; otherwise close its toast.
+ for (LLToastNotifyPanel& panel : LLToastNotifyPanel::instance_snapshot())
{
- //
- // HACK: if we're dealing with a notification embedded in IM, update it
- // otherwise remove its toast
- //
- if (dynamic_cast<LLIMToastNotifyPanel*>(panelp.get()))
+ if (panel.isDead() || panel.getID() != p->getID())
{
- panelp->updateNotification();
+ continue;
}
- else
+
+ if (LLIMToastNotifyPanel* im_panel = dynamic_cast<LLIMToastNotifyPanel*>(&panel))
{
- // if notification has changed, hide it
- mChannel.get()->removeToastByNotificationID(p->getID());
+ im_panel->updateNotification();
+ return;
}
+
+ has_toast_panel = true;
+ }
+
+ if (has_toast_panel)
+ {
+ mChannel.get()->removeToastByNotificationID(p->getID());
}
}