[IMP] mail, im_livechat: remove public check for anonymous sending

task-2841797

closes odoo/odoo#90424

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Zelong Lin
2022-05-03 17:54:09 +02:00
parent 68aa10fc24
commit 97ef347724
2 changed files with 2 additions and 5 deletions
+2 -2
View File
@@ -41,8 +41,8 @@ class MailChannel(models.Model):
"""
notifications = super()._channel_message_notifications(message=message, message_format=message_format)
for channel in self:
# add uuid for private livechat channels to allow anonymous to listen
if channel.channel_type == 'livechat' and channel.public == 'private':
# add uuid to allow anonymous to listen
if channel.channel_type == 'livechat':
notifications.append([channel.uuid, 'mail.channel/new_message', notifications[0][2]])
if not message.author_id:
unpinned_channel_partner = self.channel_last_seen_partner_ids.filtered(lambda cp: not cp.is_pinned)
-3
View File
@@ -767,9 +767,6 @@ class Channel(models.Model):
'message': dict(message_format),
}
notifications.append((channel, 'mail.channel/new_message', payload))
# add uuid to allow anonymous to listen
if channel.public == 'public':
notifications.append((channel.uuid, 'mail.channel/new_message', payload))
return notifications
# ------------------------------------------------------------