[FIX] bus,mail: user presence
Before this rev., no notification was sent on the bus when the user presence changed. Thus, the bullets displayed in Discuss were never updated and stayed as they were on the initialilization of the chat_manager (on webclient launch). This rev. makes the bus.presence notifications work, and handles them client side. Moreover, the disconnections detection is now performed at each poll (with a maximum of 1 per minute), instead of randomly (1/100 chance) at each poll, as it scales better than the former solution. We also added a cron that performs this check every 5 minutes. It is needed to detect that the last connected user just disconnected (useful for visitors in the website, trying to talk with a livechat operator). Also, the 'away' status is now handled client side, as it makes more sense that way (being away at each poll, e.g. every 50seconds, during 10 minutes doesn't mean that we didn't come back between two polls). Finaly, in bus.js, CrossTabBus, we moved the code writing in/reading the local storage after the tab registration as this code depends on the fact that the tab is the master tab or not (and this is known only once the tab is registered). This rev. was necessary in stable because the livechat uses the user status to detect if there is an operator available, and this was often inaccurate. Moreover, it improves the user experience of the chat in the backend.
Showing
- addons/bus/__openerp__.py 1 addition, 0 deletionsaddons/bus/__openerp__.py
- addons/bus/bus_presence_cron.xml 13 additions, 0 deletionsaddons/bus/bus_presence_cron.xml
- addons/bus/controllers/main.py 1 addition, 0 deletionsaddons/bus/controllers/main.py
- addons/bus/models/bus_presence.py 19 additions, 24 deletionsaddons/bus/models/bus_presence.py
- addons/bus/static/src/js/bus.js 18 additions, 9 deletionsaddons/bus/static/src/js/bus.js
- addons/mail/static/src/js/chat_manager.js 12 additions, 0 deletionsaddons/mail/static/src/js/chat_manager.js
- addons/mail/static/src/js/client_action.js 6 additions, 4 deletionsaddons/mail/static/src/js/client_action.js
- addons/mail/static/src/xml/client_action.xml 1 addition, 1 deletionaddons/mail/static/src/xml/client_action.xml
Loading
Please register or sign in to comment