[FIX] mail: Limit emojis quantity

If the user put more than 200 emojis, we didn't replace emoji with
image. But due to a typo in the code, this mechanism broke the
discuss application.

closes odoo/odoo#40734

X-original-commit: 0877cb6c84c768bd9fad46fa6f959635bb2353a5
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
jbm-odoo
2019-11-22 16:46:10 +00:00
committed by fw-bot
parent 5e9a4c39bd
commit 77e4c64fd7
@@ -604,7 +604,7 @@ var Message = AbstractMessage.extend(Mixins.EventDispatcherMixin, ServicesMixin
_.each(emojis, function (emoji) {
var unicode = emoji.unicode;
var regexp = new RegExp("(?:^|\\s|<[a-z]*>)(" + unicode + ")(?=\\s|$|</[a-z]*>)", 'g');
var originalBody = self.body;
var originalBody = self._body;
self._body = self._body.replace(regexp,
' <span class="o_mail_emoji">' + unicode + '</span> ');
// Idiot-proof limit. If the user had the amazing idea of