Files
odoo_source/addons/mail/models/ir_http.py
T
Louis Wicket (wil) 401fc7efe9 [IMP] discuss: add 'Start a meeting' feature
- Add a new stand-alone page "WelcomeView"
    - Redirect people who join using an invitation link to the WelcomeView
    - Add microphone/camera preview
    - Allow guests to choose a name from the WelcomeView
- Add "Start a meeting" button to the discuss sidebar
    - Create a new channel on click on the "Start a meeting" button
    - Display ChannelInvitationForm on click on the "Start a meeting"
button
    - Add a new field to `mail.channel` in order to define the display
mode to use for videos (e.g full screen) when joining a meeting

Task 2494829

closes odoo/odoo#75899

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-06 08:21:38 +00:00

32 lines
1.3 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo
from odoo import models
from odoo.addons.web.controllers.main import HomeStaticTemplateHelpers
from odoo.http import request
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
def session_info(self):
user = request.env.user
result = super(IrHttp, self).session_info()
if self.env.user.has_group('base.group_user'):
result['notification_type'] = user.notification_type
assets_discuss_public_hash = HomeStaticTemplateHelpers.get_qweb_templates_checksum(debug=request.session.debug, bundle='mail.assets_discuss_public')
result['cache_hashes']['assets_discuss_public'] = assets_discuss_public_hash
guest = self.env.context.get('guest')
if self.env.user._is_public() and guest:
user_context = {'lang': guest.lang}
mods = odoo.conf.server_wide_modules or []
lang = user_context.get("lang")
translation_hash = request.env['ir.translation'].sudo().get_web_translations_hash(mods, lang)
result['cache_hashes']['translations'] = translation_hash
result.update({
'name': guest.name,
'user_context': user_context,
})
return result