diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-14 08:51:52 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-14 08:51:52 -0400 |
commit | 661adacddf40cfa58f3981712701ac20f06697ae (patch) | |
tree | 07d61ccd4e45a0fe6d36543a6134c2eb4bd1bd9e /testing/toxic/friendlist.c | |
parent | b7dd8068ca698194e347cd5f9ad1719a6c0f1752 (diff) | |
parent | 4946c809d75ebec360d3f34b7518fb5f0948c925 (diff) |
Merge branch 'remove_externs' of https://github.com/krisl/ProjectTox-Core into pr
Diffstat (limited to 'testing/toxic/friendlist.c')
-rw-r--r-- | testing/toxic/friendlist.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/testing/toxic/friendlist.c b/testing/toxic/friendlist.c index 56061cf9..e7504fbf 100644 --- a/testing/toxic/friendlist.c +++ b/testing/toxic/friendlist.c | |||
@@ -11,12 +11,9 @@ | |||
11 | #include "../../core/network.h" | 11 | #include "../../core/network.h" |
12 | 12 | ||
13 | #include "windows.h" | 13 | #include "windows.h" |
14 | #include "friendlist.h" | ||
14 | 15 | ||
15 | extern char WINDOW_STATUS[TOXWINDOWS_MAX_NUM]; | 16 | static char * WINDOW_STATUS; |
16 | extern int add_window(ToxWindow w, int n); | ||
17 | extern ToxWindow new_chat(Messenger *m, int friendnum); | ||
18 | |||
19 | extern int active_window; | ||
20 | 17 | ||
21 | typedef struct { | 18 | typedef struct { |
22 | uint8_t name[MAX_NAME_LENGTH]; | 19 | uint8_t name[MAX_NAME_LENGTH]; |
@@ -54,8 +51,7 @@ void friendlist_onMessage(ToxWindow *self, Messenger *m, int num, uint8_t *str, | |||
54 | for (i = N_DEFAULT_WINS; i < MAX_WINDOW_SLOTS; ++i) { | 51 | for (i = N_DEFAULT_WINS; i < MAX_WINDOW_SLOTS; ++i) { |
55 | if (WINDOW_STATUS[i] == -1) { | 52 | if (WINDOW_STATUS[i] == -1) { |
56 | WINDOW_STATUS[i] = num; | 53 | WINDOW_STATUS[i] = num; |
57 | add_window(new_chat(m, num), i); | 54 | add_window(m, new_chat(m, num), i); |
58 | active_window = i; | ||
59 | break; | 55 | break; |
60 | } | 56 | } |
61 | } | 57 | } |
@@ -111,7 +107,7 @@ static void friendlist_onKey(ToxWindow *self, Messenger *m, int key) | |||
111 | int i; | 107 | int i; |
112 | for (i = N_DEFAULT_WINS; i < MAX_WINDOW_SLOTS; ++i) { | 108 | for (i = N_DEFAULT_WINS; i < MAX_WINDOW_SLOTS; ++i) { |
113 | if (WINDOW_STATUS[i] == num_selected) { | 109 | if (WINDOW_STATUS[i] == num_selected) { |
114 | active_window = i; | 110 | set_active_window(i); |
115 | break; | 111 | break; |
116 | } | 112 | } |
117 | } | 113 | } |
@@ -121,8 +117,7 @@ static void friendlist_onKey(ToxWindow *self, Messenger *m, int key) | |||
121 | if (WINDOW_STATUS[i] == -1) { | 117 | if (WINDOW_STATUS[i] == -1) { |
122 | WINDOW_STATUS[i] = num_selected; | 118 | WINDOW_STATUS[i] = num_selected; |
123 | friends[num_selected].chatwin = num_selected; | 119 | friends[num_selected].chatwin = num_selected; |
124 | add_window(new_chat(m, num_selected), i); | 120 | add_window(m, new_chat(m, num_selected), i); |
125 | active_window = i; | ||
126 | break; | 121 | break; |
127 | } | 122 | } |
128 | } | 123 | } |
@@ -169,7 +164,8 @@ static void friendlist_onInit(ToxWindow *self, Messenger *m) | |||
169 | 164 | ||
170 | } | 165 | } |
171 | 166 | ||
172 | ToxWindow new_friendlist() { | 167 | ToxWindow new_friendlist(char * ws) { |
168 | WINDOW_STATUS = ws; | ||
173 | ToxWindow ret; | 169 | ToxWindow ret; |
174 | memset(&ret, 0, sizeof(ret)); | 170 | memset(&ret, 0, sizeof(ret)); |
175 | 171 | ||