From a036f4b00cb0c2a7e6c070667ac562f0e585c7e4 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 21 Aug 2022 10:17:09 +0200 Subject: Implement correct recipient for send_message() --- data.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'data.c') diff --git a/data.c b/data.c index afa4616..7645679 100644 --- a/data.c +++ b/data.c @@ -22,6 +22,8 @@ void data_add_roster_item(const char* jid, const char* subscription, // initialize chat chat->messages = NULL; + chat->jid = malloc(sizeof(char)*strlen(jid)); + strcpy(chat->jid, jid); gui_add_chat_widget(chat); // initialize roster item @@ -63,6 +65,7 @@ void data_add_roster_item(const char* jid, const char* subscription, void data_add_incoming_message(const char* sender_jid, const char* content) { + // TODO rework based on chat->jid // find correct chat chat_t* chat = NULL; roster_item_t* i; @@ -95,4 +98,7 @@ void data_add_incoming_message(const char* sender_jid, const char* content) { // append message to chat m = msg; + // TODO could be more correct to update chat->jid to full JID of just + // received message so that future responses go to this ressource + } -- cgit v1.2.3-70-g09d2