summaryrefslogtreecommitdiff
path: root/addons/im_livechat/controllers
diff options
context:
space:
mode:
authorSagar Ahirrao <sah@odoo.com>2016-12-07 18:18:44 +0530
committerJérome Maes <jem@openerp.com>2017-01-30 13:45:03 +0100
commitbb03449bc8114c9da94ad99e5aad96cc9c90e23a (patch)
tree7f433b946336caf1fb47ebdb06e9d7fb74ba0f37 /addons/im_livechat/controllers
parentbe697f74253050e5fcf3b4192f4500b31bbd9c1b (diff)
[IMP] im_livechat: visitor history command
this commit introduces the '/history' command for an operator during a livechat session. When the visitor load a page, its url is added in a cookie (kept only 1 day) in order to track his visited web pages. The '/history' command will ask the cookie content and send it to the operator as a transient message in the livechat channel.
Diffstat (limited to 'addons/im_livechat/controllers')
-rw-r--r--addons/im_livechat/controllers/main.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/im_livechat/controllers/main.py b/addons/im_livechat/controllers/main.py
index fb968d728c1..f033fc72cc7 100644
--- a/addons/im_livechat/controllers/main.py
+++ b/addons/im_livechat/controllers/main.py
@@ -105,3 +105,10 @@ class LivechatController(http.Controller):
rating.write(values)
return rating.id
return False
+
+ @http.route('/im_livechat/history', type="json", auth="public")
+ def history_pages(self, pid, channel_uuid, page_history=None):
+ channel = request.env['mail.channel'].search([('uuid', '=', channel_uuid)])
+ if channel:
+ channel._send_history_message(pid, page_history)
+ return True