19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:39 +01:00
parent 5df8c07b59
commit daa394e8b0
2114 changed files with 564841 additions and 299642 deletions

View file

@ -0,0 +1,21 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug.exceptions import NotFound
from odoo.http import route, request
from odoo.addons.mail.controllers.discuss.rtc import RtcController
from odoo.addons.mail.tools.discuss import add_guest_to_context
class LivechatRtcController(RtcController):
@route()
@add_guest_to_context
def channel_call_join(self, channel_id, check_rtc_session_ids=None, camera=False):
# sudo: discuss.channel - visitor can check if there is an ongoing call
if not request.env.user._is_internal() and request.env["discuss.channel"].sudo().search([
("id", "=", channel_id),
("channel_type", "=", "livechat"),
("rtc_session_ids", "=", False),
]):
raise NotFound()
return super().channel_call_join(channel_id, check_rtc_session_ids, camera)