aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-08-19 00:35:09 +0200
committerTheJackiMonster <thejackimonster@gmail.com>2022-08-19 00:35:09 +0200
commit04b106bf09b8ef90418811ed583d1c4ebd5fdaf5 (patch)
treed18214ee7b787a78818a0119480ddcbc28bcec5d
parent4db85b1a2178004a5f54ae798b6776a723145974 (diff)
downloadmessenger-cli-04b106bf09b8ef90418811ed583d1c4ebd5fdaf5.tar.gz
messenger-cli-04b106bf09b8ef90418811ed583d1c4ebd5fdaf5.zip
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.c18
-rw-r--r--src/ui/members.h6
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,
50 app->chat.show_members = FALSE; 50 app->chat.show_members = FALSE;
51 break; 51 break;
52 case '\n': 52 case '\n':
53 case KEY_ENTER: 53 case KEY_ENTER: {
54 if (members->selected) 54 struct GNUNET_CHAT_Context *context;
55 {
56 // TODO
57 }
58 55
56 if (!(members->selected))
57 break;
58
59 context = GNUNET_CHAT_contact_get_context(members->selected);
60 GNUNET_CHAT_context_request(context);
61
62 app->chat.show_members = FALSE;
63 app->chat.context = context;
59 break; 64 break;
65 }
60 default: 66 default:
61 break; 67 break;
62 } 68 }
@@ -128,7 +134,7 @@ members_clear(UI_MEMBERS_Handle *members)
128 134
129bool 135bool
130members_add(UI_MEMBERS_Handle *members, 136members_add(UI_MEMBERS_Handle *members,
131 const struct GNUNET_CHAT_Contact *contact) 137 struct GNUNET_CHAT_Contact *contact)
132{ 138{
133 UI_MEMBERS_List *element = members->head; 139 UI_MEMBERS_List *element = members->head;
134 while (element) 140 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;
37 37
38typedef struct UI_MEMBERS_List 38typedef struct UI_MEMBERS_List
39{ 39{
40 const struct GNUNET_CHAT_Contact *contact; 40 struct GNUNET_CHAT_Contact *contact;
41 41
42 struct UI_MEMBERS_List *prev; 42 struct UI_MEMBERS_List *prev;
43 struct UI_MEMBERS_List *next; 43 struct UI_MEMBERS_List *next;
@@ -54,7 +54,7 @@ typedef struct UI_MEMBERS_Handle
54 int line_offset; 54 int line_offset;
55 int line_selected; 55 int line_selected;
56 56
57 const struct GNUNET_CHAT_Contact *selected; 57 struct GNUNET_CHAT_Contact *selected;
58} UI_MEMBERS_Handle; 58} UI_MEMBERS_Handle;
59 59
60#define UI_MEMBERS_COLS_MIN 30 60#define UI_MEMBERS_COLS_MIN 30
@@ -72,7 +72,7 @@ members_clear(UI_MEMBERS_Handle *members);
72 72
73bool 73bool
74members_add(UI_MEMBERS_Handle *members, 74members_add(UI_MEMBERS_Handle *members,
75 const struct GNUNET_CHAT_Contact *contact); 75 struct GNUNET_CHAT_Contact *contact);
76 76
77void 77void
78members_remove(UI_MEMBERS_Handle *members, 78members_remove(UI_MEMBERS_Handle *members,