mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-22 09:22:02 +02:00
19.0 vanilla
This commit is contained in:
parent
5df8c07b59
commit
daa394e8b0
2114 changed files with 564841 additions and 299642 deletions
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue