diff options
-rw-r--r-- | testing/toxic/friendlist.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/testing/toxic/friendlist.c b/testing/toxic/friendlist.c index 647f563d..a1f9851e 100644 --- a/testing/toxic/friendlist.c +++ b/testing/toxic/friendlist.c | |||
@@ -58,11 +58,11 @@ void friendlist_onMessage(ToxWindow* self, int num, uint8_t* str, uint16_t len) | |||
58 | for (i = N_DEFAULT_WINS; i < MAX_WINDOW_SLOTS; i++) { | 58 | for (i = N_DEFAULT_WINS; i < MAX_WINDOW_SLOTS; i++) { |
59 | if (WINDOW_STATUS[i] == -1) { | 59 | if (WINDOW_STATUS[i] == -1) { |
60 | WINDOW_STATUS[i] = num; | 60 | WINDOW_STATUS[i] = num; |
61 | add_window(new_chat(num_selected), i); | 61 | add_window(new_chat(num), i); |
62 | w_active = i; | 62 | w_active = i; |
63 | break; | 63 | break; |
64 | } | ||
65 | } | 64 | } |
65 | } | ||
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
@@ -101,8 +101,9 @@ int friendlist_onFriendAdded(int num) { | |||
101 | 101 | ||
102 | static void friendlist_onKey(ToxWindow* self, int key) { | 102 | static void friendlist_onKey(ToxWindow* self, int key) { |
103 | if(key == KEY_UP) { | 103 | if(key == KEY_UP) { |
104 | if(num_selected != 0) | 104 | num_selected--; |
105 | num_selected--; | 105 | if (num_selected < 0) |
106 | num_selected = num_friends-1; | ||
106 | } | 107 | } |
107 | else if(key == KEY_DOWN) { | 108 | else if(key == KEY_DOWN) { |
108 | if(num_friends != 0) | 109 | if(num_friends != 0) |