diff --git a/addons/im_livechat/models/chatbot_script_step.py b/addons/im_livechat/models/chatbot_script_step.py index 3392f0c2091..ffb45ffe059 100644 --- a/addons/im_livechat/models/chatbot_script_step.py +++ b/addons/im_livechat/models/chatbot_script_step.py @@ -342,6 +342,12 @@ class ChatbotScriptStep(models.Model): open_chat_window=True, post_joined_message=False) + # rename the channel to include the operator's name + discuss_channel.sudo().name = ' '.join([ + self.env.user.display_name if not self.env.user._is_public() else discuss_channel.anonymous_name, + human_operator.livechat_username if human_operator.livechat_username else human_operator.name + ]) + if self.message: # first post the message of the step (if we have one) posted_message = discuss_channel._chatbot_post_message(self.chatbot_script_id, plaintext2html(self.message))