From f5221f96bf1d4a618d4236dbc0197105c915bdae Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 28 Jan 2013 17:04:57 +0100 Subject: [PATCH] Working version bzr revid: nicolas.vanhoren@openerp.com-20130128160457-f0yfekuxsjeo00t6 --- addons/live_support/static/ext/static/js/livesupport.js | 3 +++ addons/web_im/im.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/live_support/static/ext/static/js/livesupport.js b/addons/live_support/static/ext/static/js/livesupport.js index 640ca9adf72..c606316c495 100644 --- a/addons/live_support/static/ext/static/js/livesupport.js +++ b/addons/live_support/static/ext/static/js/livesupport.js @@ -133,6 +133,9 @@ define(["nova", "jquery", "underscore", "oeclient", "require"], function(nova, $ connection.connector.call("/longpolling/im/poll", { last: this.last, users_watch: user_ids, + db: connection.database, + uid: connection.userId, + password: connection.password, }).then(function(result) { _.each(result.users_status, function(el) { if (self.get_user(el.id)) diff --git a/addons/web_im/im.py b/addons/web_im/im.py index c080e522315..d85b1287380 100644 --- a/addons/web_im/im.py +++ b/addons/web_im/im.py @@ -125,9 +125,13 @@ class ImportController(openerp.addons.web.http.Controller): _cp_path = '/longpolling/im' @openerp.addons.web.http.jsonrequest - def poll(self, req, last=None, users_watch=None): + def poll(self, req, last=None, users_watch=None, db=None, uid=None, password=None): if not openerp.tools.config.options["gevent"]: raise Exception("Not usable in a server not running gevent") + if db is not None: + req.session._db = db + req.session._uid = uid + req.session._password = password req.session.model('im.user').im_connect(context=req.context) num = 0 while True: