mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
prepare #I6SC9C 处理azure私聊群聊,app_chatgpt优化,指定用户时增加使用情况
This commit is contained in:
@@ -7,12 +7,14 @@ from .lib.WordsSearch import WordsSearch
|
||||
class MailThread(models.AbstractModel):
|
||||
_inherit = "mail.thread"
|
||||
|
||||
@api.returns('mail.message', lambda value: value.id)
|
||||
def message_post(self, **kwargs):
|
||||
self.ensure_one()
|
||||
search = WordsSearch()
|
||||
search.SetKeywords([])
|
||||
body = kwargs.get('body', False)
|
||||
body = search.Replace(text=body)
|
||||
kwargs.update({'body': body})
|
||||
return super(MailThread, self).message_post(**kwargs)
|
||||
# todo: 不是说在此屏蔽,而是当用户发出敏感词时,提示下,同时不发送到 ai
|
||||
# @api.returns('mail.message', lambda value: value.id)
|
||||
# def message_post(self, **kwargs):
|
||||
|
||||
# self.ensure_one()
|
||||
# search = WordsSearch()
|
||||
# search.SetKeywords([])
|
||||
# body = kwargs.get('body', False)
|
||||
# body = search.Replace(text=body)
|
||||
# kwargs.update({'body': body})
|
||||
# return super(MailThread, self).message_post(**kwargs)
|
||||
|
||||
Reference in New Issue
Block a user