summaryrefslogtreecommitdiff
path: root/gtk.c
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-08-21 10:51:25 +0200
committerxengineering <me@xengineering.eu>2022-08-21 10:51:25 +0200
commitbd516ecdb218f4122acf077bef5a4dbde91653e5 (patch)
treec7698470ea9c945eb252e7abfeb46a021e852e8c /gtk.c
parenteffdc7d687caf331217b6fc20ba51cabf3c56f20 (diff)
downloadlimox-bd516ecdb218f4122acf077bef5a4dbde91653e5.tar
limox-bd516ecdb218f4122acf077bef5a4dbde91653e5.tar.zst
limox-bd516ecdb218f4122acf077bef5a4dbde91653e5.zip
Implement GUI part of message sending
Diffstat (limited to 'gtk.c')
-rw-r--r--gtk.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gtk.c b/gtk.c
index 477bd71..1a13bfa 100644
--- a/gtk.c
+++ b/gtk.c
@@ -68,17 +68,15 @@ static void disconnect_cb(void) {
void send_message(chat_t* chat) {
+ // cast void* to GUI-specific chat_widget_t*
chat_widget_t* chat_widget = (chat_widget_t*)chat->widget;
+ // get text of message and own JID
const char* text = gtk_editable_get_text(GTK_EDITABLE(chat_widget->entry));
const char* self = gtk_editable_get_text(GTK_EDITABLE(connector_jid_entry));
- // execute dummy XMPP send TODO
- printf("Sending from %s to %s:\n> %s\n", self, chat->jid, text);
-
- //// add message content to the chat
- //GtkWidget* message = gtk_label_new(text);
- //gtk_box_append(GTK_BOX(chat->chat_content_box), message);
+ // add message to datastructure
+ data_add_outgoing_message(self, text, chat);
// clear text input
GtkEntryBuffer* buffer;