mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 10:32:07 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
17
odoo-bringout-oca-ocb-mail/mail/controllers/websocket.py
Normal file
17
odoo-bringout-oca-ocb-mail/mail/controllers/websocket.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.addons.bus.controllers.websocket import WebsocketController
|
||||
from odoo.http import request, route, SessionExpiredException
|
||||
|
||||
|
||||
class WebsocketControllerPresence(WebsocketController):
|
||||
"""Override of websocket controller to add mail features (presence in particular)."""
|
||||
|
||||
@route("/websocket/update_bus_presence", type="jsonrpc", auth="public", cors="*")
|
||||
def update_bus_presence(self, inactivity_period):
|
||||
"""Manually update presence of current user, useful when implementing custom websocket code.
|
||||
This is mainly used by Odoo.sh."""
|
||||
if "is_websocket_session" not in request.session:
|
||||
raise SessionExpiredException()
|
||||
request.env["ir.websocket"]._update_mail_presence(int(inactivity_period))
|
||||
return {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue