Wednesday, January 31, 2024
1 change · master
Resolved issues and error corrections
This fixes live chat startup so only current, active chat sessions are shown to users. When a visitor leaves a live chat, its chat window is now closed properly, preventing outdated conversations from reappearing and reducing confusion for operators.
Original PR description
Since [1], only active live chat channels are returned by the init_messaging rpc since the inactive ones are not required. This is done by passing the `is_for_livechat` key in the context. Since [2], the context is not propagated anymore thus inactive channels are returned as well. Actually, we shouldn't have to override the `_get_init_channels` method: the mail one only returns channels that have an opened chat window. Closing the live chat session should close the existing chat window as well. This PR ensures the chat windows will be closed when the visitor leaves the session so that those outdated channels are not returned by the initialization of messaging and provides a way to restrict channels by channel type when initializing messaging instead of relying on the context. [1]: https://github.com/odoo/odoo/pull/146098 [2]: https://github.com/odoo/odoo/pull/150367 enterprise: https://github.com/odoo/enterprise/pull/55490