[FIX/WIP] Add delegated host to data

This commit is contained in:
lda 2024-02-06 22:25:04 +01:00
parent c028d8ccca
commit dad4a844a6

View file

@ -7,7 +7,7 @@
#include <justui/jpainted.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <easters.h>
#include <matrix.h>
@ -114,7 +114,7 @@ void ui_login_event(ui_screen_t *that, jevent e)
if (!strcmp(focus_to, "server"))
{
jinput *server = utils_hashmap_get(that->data, "server");
char *delegated;
char *delegated = NULL;
char *serv_name = (char *) jinput_value(server);
m_delegation_t status;
@ -163,7 +163,15 @@ void ui_login_event(ui_screen_t *that, jevent e)
C_BLACK
);
break;
}
if (delegated)
{
char *copy = utils_hashmap_get(that->data, "delegated");
if (copy)
{
free(copy);
}
utils_hashmap_add(that->data, "delegated", delegated);
}
return;