When joining a room show already sent chat messages
This commit is contained in:
@@ -366,8 +366,6 @@ class RoomWidget(QWidget):
|
||||
self.chat_messages.setWidget(self.chat_content)
|
||||
self.chat_messages.toPlainText = self.toPlainText # For test compatibility
|
||||
|
||||
# Initial welcome message
|
||||
self.add_system_message("Welcome to the room! 👋")
|
||||
|
||||
chat_input_layout = QHBoxLayout()
|
||||
self.chat_input = QLineEdit()
|
||||
@@ -443,7 +441,7 @@ class RoomWidget(QWidget):
|
||||
for i in reversed(range(self.chat_content_layout.count())):
|
||||
self.chat_content_layout.itemAt(i).widget().setParent(None)
|
||||
|
||||
self.add_system_message("Welcome to the room! 👋")
|
||||
|
||||
self.current_users = []
|
||||
self._is_first_user_update = True
|
||||
|
||||
@@ -906,6 +904,12 @@ class RoomWidget(QWidget):
|
||||
self.chat_content_layout.addWidget(msg)
|
||||
self._scroll_to_bottom()
|
||||
|
||||
def clear_chat(self):
|
||||
for i in reversed(range(self.chat_content_layout.count())):
|
||||
item = self.chat_content_layout.itemAt(i)
|
||||
if item.widget():
|
||||
item.widget().setParent(None)
|
||||
|
||||
def send_chat(self):
|
||||
text = self.chat_input.text().strip()
|
||||
if not text:
|
||||
|
||||
Reference in New Issue
Block a user