diff options
| author | Pepper <3782201+rohvani@users.noreply.github.com> | 2026-09-01 19:00:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-01 19:00:25 -0400 |
| commit | 56b34b332727299f2d54d4d6e8dbe5a7cb54cb11 (patch) | |
| tree | f9ea9e683dc3951a49a0773084d84ffa0dd9383e /indra/newview/llnotificationofferhandler.cpp | |
| parent | 66ff4c75bc2d594a41dfe22d85139311567b8e97 (diff) | |
| parent | cfbbdcb6e874d73ef9429293d3afff58e1d6c216 (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.cpp | 29 |
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()); } } |
