diff options
| author | Sagar Ahirrao <sah@odoo.com> | 2016-12-07 18:18:44 +0530 |
|---|---|---|
| committer | Jérome Maes <jem@openerp.com> | 2017-01-30 13:45:03 +0100 |
| commit | bb03449bc8114c9da94ad99e5aad96cc9c90e23a (patch) | |
| tree | 7f433b946336caf1fb47ebdb06e9d7fb74ba0f37 /addons/im_livechat/controllers | |
| parent | be697f74253050e5fcf3b4192f4500b31bbd9c1b (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.py | 7 |
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 |
