PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/helpers/src/chat/notification/webpush.php +9 -6 1.8.6 → 1.8.16 View file →
@@ -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 ],