diff options
Diffstat (limited to 'testing/toxic/prompt.c')
-rw-r--r-- | testing/toxic/prompt.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c index a3cf2d94..b0f83811 100644 --- a/testing/toxic/prompt.c +++ b/testing/toxic/prompt.c | |||
@@ -134,10 +134,28 @@ static void execute(ToxWindow* self, char* cmd) { | |||
134 | } | 134 | } |
135 | 135 | ||
136 | num = m_addfriend(id_bin, (uint8_t*) msg, strlen(msg)+1); | 136 | num = m_addfriend(id_bin, (uint8_t*) msg, strlen(msg)+1); |
137 | 137 | switch (num) { | |
138 | wprintw(self->window, "Friend added as %d.\n", num); | 138 | case -1: |
139 | on_friendadded(num); | 139 | wprintw(self->window, "Message is too long.\n"); |
140 | break; | ||
141 | case -2: | ||
142 | wprintw(self->window, "Please add a message to your request.\n"); | ||
143 | case -3: | ||
144 | wprintw(self->window, "That appears to be your own ID.\n"); | ||
145 | break; | ||
146 | case -4: | ||
147 | wprintw(self->window, "Friend request already sent.\n"); | ||
148 | break; | ||
149 | case -5: | ||
150 | wprintw(self->window, "[i] Undefined error when adding friend.\n"); | ||
151 | break; | ||
152 | default: | ||
153 | wprintw(self->window, "Friend added as %d.\n", num); | ||
154 | on_friendadded(num); | ||
155 | break; | ||
156 | } | ||
140 | } | 157 | } |
158 | |||
141 | else if(!strcmp(cmd, "help")) { | 159 | else if(!strcmp(cmd, "help")) { |
142 | print_usage(self); | 160 | print_usage(self); |
143 | } | 161 | } |