diff --git a/app/DataBase/msg.py b/app/DataBase/msg.py index 8876d4f..44530aa 100644 --- a/app/DataBase/msg.py +++ b/app/DataBase/msg.py @@ -110,7 +110,7 @@ class Msg: from MSG where StrTalker = ? and localId < ? order by CreateTime desc - limit 10 + limit 20 ''' result = None if not self.open_flag: diff --git a/app/DataBase/output_pc.py b/app/DataBase/output_pc.py index 2934e38..30090bb 100644 --- a/app/DataBase/output_pc.py +++ b/app/DataBase/output_pc.py @@ -903,15 +903,6 @@ const chatMessages = [ f'''{{ type:{type_}, text: '{str_content}',is_send:{is_send},avatar_path:'{avatar}'}},''' ) elif type_ == 3: - import re - pattern1 = r'' - pattern2 = r'' - match = re.search(pattern1, str_content) - if match: - continue - match = re.search(pattern2, str_content) - if match: - continue image_path = hard_link_db.get_image(content=str_content, thumb=False) image_path = path.get_relative_path(image_path, base_path=f'/data/聊天记录/{self.contact.remark}/image') image_path = image_path.replace('\\', '/') @@ -923,6 +914,11 @@ const chatMessages = [ f.write( f'''{{ type:{type_}, text: '{image_path}',is_send:{is_send},avatar_path:'{avatar}'}},''' ) + elif type_ == 10000: + str_content = escape_js_and_html(str_content.lstrip('').rstrip('')) + f.write( + f'''{{ type:0, text: '{str_content}',is_send:{is_send},avatar_path:''}},''' + ) html_end = ''' ]; function renderMessages(messages) { diff --git a/app/ui_pc/chat/chat_info.py b/app/ui_pc/chat/chat_info.py index 5464be6..5642bdd 100644 --- a/app/ui_pc/chat/chat_info.py +++ b/app/ui_pc/chat/chat_info.py @@ -129,6 +129,10 @@ class ChatInfo(QWidget): is_send ) self.chat_window.add_message_item(bubble_message, 0) + elif type_ == 10000: + str_content = str_content.lstrip('').rstrip('') + message = Notice(str_content ) + self.chat_window.add_message_item(message, 0) except: print(message) traceback.print_exc()