From 2714ca65776db58f941b6301859cfbef75b4f435 Mon Sep 17 00:00:00 2001
From: shuaikangzhou <863909694@qq.com>
Date: Sat, 18 Nov 2023 20:13:56 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=B6=E9=97=B4=E6=8F=92?=
=?UTF-8?q?=E5=85=A5=E4=BD=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/workspace.xml | 53 ++++++++++++++++++-------------------
app/ui_pc/chat/chat_info.py | 7 +++--
2 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index df4ef8f..d1636c2 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,9 @@
-
+
-
-
+
@@ -273,27 +272,6 @@
1672848140146
-
- 1684726034556
-
-
-
- 1684726034556
-
-
- 1684726338618
-
-
-
- 1684726338618
-
-
- 1692427491271
-
-
-
- 1692427491271
-
1698248435600
@@ -616,7 +594,28 @@
1700289701718
-
+
+ 1700290543397
+
+
+
+ 1700290543397
+
+
+ 1700290549743
+
+
+
+ 1700290549743
+
+
+ 1700290555508
+
+
+
+ 1700290555508
+
+
@@ -668,7 +667,6 @@
-
@@ -677,7 +675,8 @@
-
+
+
diff --git a/app/ui_pc/chat/chat_info.py b/app/ui_pc/chat/chat_info.py
index 67a82e8..66e40b8 100644
--- a/app/ui_pc/chat/chat_info.py
+++ b/app/ui_pc/chat/chat_info.py
@@ -10,9 +10,9 @@ class ChatInfo(QWidget):
def __init__(self, contact, parent=None):
super().__init__(parent)
self.last_timestamp = 0
+ self.last_str_time = ''
self.last_pos = 0
self.contact = contact
-
self.init_ui()
self.show_chats()
@@ -71,6 +71,7 @@ class ChatInfo(QWidget):
def is_5_min(self, timestamp):
if abs(timestamp - self.last_timestamp) > 300:
self.last_timestamp = timestamp
+
return True
return False
@@ -85,7 +86,8 @@ class ChatInfo(QWidget):
timestamp = message[5]
if type_ == 1:
if self.is_5_min(timestamp):
- time_message = Notice(str_time)
+ time_message = Notice(self.last_str_time)
+ self.last_str_time = str_time
self.chat_window.add_message_item(time_message, 0)
bubble_message = BubbleMessage(
str_content,
@@ -96,6 +98,7 @@ class ChatInfo(QWidget):
# print(str_content)
# self.scroolAreaLayout.addWidget(bubble_message)
self.chat_window.add_message_item(bubble_message, 0)
+
except:
print(message)