Working version
bzr revid: nicolas.vanhoren@openerp.com-20130128160457-f0yfekuxsjeo00t6
This commit is contained in:
parent
4670851b85
commit
f5221f96bf
|
@ -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))
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue