Now About Social Code
aboutsummaryrefslogtreecommitdiff
path: root/src/chat.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/chat.py')
-rw-r--r--src/chat.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/chat.py b/src/chat.py
index b659395..3ee0438 100644
--- a/src/chat.py
+++ b/src/chat.py
@@ -166,9 +166,7 @@ class WeegtkChat(Adw.Bin):
last = self.model.get_string(count - 1)
last_data = json.loads(last)
if last_data["username"] == user:
- last_data["text"].append(msg)
- self.model.splice(count - 1, 1, [json.dumps(last_data)])
- return
+ msg_type = "message_append"
data = {
"username": user,
@@ -177,6 +175,10 @@ class WeegtkChat(Adw.Bin):
}
self.model.append(json.dumps(data))
+ def clear(self):
+ # TODO clear chat buffer
+ pass
+
@Gtk.Template.Callback()
def entry_activate(self, *args):
entry_buffer = self.text_entry.get_buffer()