| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * @package VikBooking |
| 4 | 4 | * @subpackage core |
| 5 | 5 | * @author E4J s.r.l. |
| 6 | - * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. | |
| 6 | + * @copyright Copyright (C) 2026 E4J s.r.l. All Rights Reserved. | |
| 7 | 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | 8 | * @link https://vikwp.com |
| 9 | 9 | */ |
| 10 | 10 | |
| @@ -47,21 +47,24 @@ | ||
| 47 | 47 | $summary = JText::sprintf('VBO_CHAT_MESSAGE_WEBPUSH_NOTIFICATION_SUMMARY', $message->getSenderName(), $summary); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | try { |
| 51 | + /** @var VBOChatContext */ | |
| 52 | + $context = $message->getContext(); | |
| 53 | + | |
| 51 | 54 | // store the notification record |
| 52 | 55 | VBOFactory::getNotificationCenter()->store([ |
| 53 | 56 | [ |
| 54 | - 'sender' => 'operators', | |
| 57 | + 'sender' => $context->getAlias() === 'session' ? 'website' : 'operators', | |
| 55 | 58 | 'type' => 'chat.newmessage', |
| 56 | - 'title' => JText::sprintf('VBO_CHAT_MESSAGE_WEBPUSH_NOTIFICATION_TITLE', $message->getContext()->getSubject()), | |
| 59 | + 'title' => JText::sprintf('VBO_CHAT_MESSAGE_WEBPUSH_NOTIFICATION_TITLE', $context->getSubject()), | |
| 57 | 60 | 'summary' => $summary, |
| 58 | 61 | 'label' => JText::translate('VBO_REPLY'), |
| 59 | 62 | 'avatar' => $user->getAvatar(), |
| 60 | - 'widget' => 'operators_chat', | |
| 63 | + 'widget' => $context->getAlias() === 'session' ? 'inquiries_chat' : 'operators_chat', | |
| 61 | 64 | 'widget_options' => [ |
| 62 | - 'context_alias' => $message->getContext()->getAlias(), | |
| 63 | - 'context_id' => $message->getContext()->getID(), | |
| 65 | + 'context_alias' => $context->getAlias(), | |
| 66 | + 'context_id' => $context->getID(), | |
| 64 | 67 | ], |
| 65 | 68 | // always skip signature check, so that we can allow a duplicate insert |
| 66 | 69 | '_signature' => md5(time()), |
| 67 | 70 | ], |