diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2022-08-19 00:35:09 +0200 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2022-08-19 00:35:09 +0200 |
commit | 04b106bf09b8ef90418811ed583d1c4ebd5fdaf5 (patch) | |
tree | d18214ee7b787a78818a0119480ddcbc28bcec5d | |
parent | 4db85b1a2178004a5f54ae798b6776a723145974 (diff) |
Added ability to switch directly to a contacts chat from member list
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r-- | src/ui/members.c | 18 | ||||
-rw-r--r-- | src/ui/members.h | 6 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/ui/members.c b/src/ui/members.c index b0abb7c..7e3239f 100644 --- a/src/ui/members.c +++ b/src/ui/members.c @@ -50,13 +50,19 @@ members_event(UI_MEMBERS_Handle *members, app->chat.show_members = FALSE; break; case '\n': - case KEY_ENTER: - if (members->selected) - { - // TODO - } + case KEY_ENTER: { + struct GNUNET_CHAT_Context *context; + if (!(members->selected)) + break; + + context = GNUNET_CHAT_contact_get_context(members->selected); + GNUNET_CHAT_context_request(context); + + app->chat.show_members = FALSE; + app->chat.context = context; break; + } default: break; } @@ -128,7 +134,7 @@ members_clear(UI_MEMBERS_Handle *members) bool members_add(UI_MEMBERS_Handle *members, - const struct GNUNET_CHAT_Contact *contact) + struct GNUNET_CHAT_Contact *contact) { UI_MEMBERS_List *element = members->head; while (element) diff --git a/src/ui/members.h b/src/ui/members.h index fc924a2..6e8711b 100644 --- a/src/ui/members.h +++ b/src/ui/members.h @@ -37,7 +37,7 @@ struct MESSENGER_Application; typedef struct UI_MEMBERS_List { - const struct GNUNET_CHAT_Contact *contact; + struct GNUNET_CHAT_Contact *contact; struct UI_MEMBERS_List *prev; struct UI_MEMBERS_List *next; @@ -54,7 +54,7 @@ typedef struct UI_MEMBERS_Handle int line_offset; int line_selected; - const struct GNUNET_CHAT_Contact *selected; + struct GNUNET_CHAT_Contact *selected; } UI_MEMBERS_Handle; #define UI_MEMBERS_COLS_MIN 30 @@ -72,7 +72,7 @@ members_clear(UI_MEMBERS_Handle *members); bool members_add(UI_MEMBERS_Handle *members, - const struct GNUNET_CHAT_Contact *contact); + struct GNUNET_CHAT_Contact *contact); void members_remove(UI_MEMBERS_Handle *members, |