diff options
Diffstat (limited to 'testing/toxic/prompt.c')
-rw-r--r-- | testing/toxic/prompt.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c index 486273d3..661d881f 100644 --- a/testing/toxic/prompt.c +++ b/testing/toxic/prompt.c | |||
@@ -193,27 +193,22 @@ static void execute(ToxWindow *self, char *u_cmd) | |||
193 | return; | 193 | return; |
194 | } | 194 | } |
195 | status++; | 195 | status++; |
196 | USERSTATUS_KIND status_kind; | 196 | USERSTATUS status_kind; |
197 | if (!strncmp(status, "online", strlen("online"))) { | 197 | if (!strncmp(status, "online", strlen("online"))) { |
198 | status_kind = USERSTATUS_KIND_ONLINE; | 198 | status_kind = USERSTATUS_NONE; |
199 | status_text = "ONLINE"; | 199 | status_text = "ONLINE"; |
200 | } | 200 | } |
201 | 201 | ||
202 | else if (!strncmp(status, "away", strlen("away"))) { | 202 | else if (!strncmp(status, "away", strlen("away"))) { |
203 | status_kind = USERSTATUS_KIND_AWAY; | 203 | status_kind = USERSTATUS_AWAY; |
204 | status_text = "AWAY"; | 204 | status_text = "AWAY"; |
205 | } | 205 | } |
206 | 206 | ||
207 | else if (!strncmp(status, "busy", strlen("busy"))) { | 207 | else if (!strncmp(status, "busy", strlen("busy"))) { |
208 | status_kind = USERSTATUS_KIND_BUSY; | 208 | status_kind = USERSTATUS_BUSY; |
209 | status_text = "BUSY"; | 209 | status_text = "BUSY"; |
210 | } | 210 | } |
211 | 211 | ||
212 | else if (!strncmp(status, "offline", strlen("offline"))) { | ||
213 | status_kind = USERSTATUS_KIND_OFFLINE; | ||
214 | status_text = "OFFLINE"; | ||
215 | } | ||
216 | |||
217 | else | 212 | else |
218 | { | 213 | { |
219 | wprintw(self->window, "Invalid status.\n"); | 214 | wprintw(self->window, "Invalid status.\n"); |
@@ -222,12 +217,13 @@ static void execute(ToxWindow *self, char *u_cmd) | |||
222 | 217 | ||
223 | msg = strchr(status, ' '); | 218 | msg = strchr(status, ' '); |
224 | if (msg == NULL) { | 219 | if (msg == NULL) { |
225 | m_set_userstatus_kind(status_kind); | 220 | m_set_userstatus(status_kind); |
226 | wprintw(self->window, "Status set to: %s\n", status_text); | 221 | wprintw(self->window, "Status set to: %s\n", status_text); |
227 | } | 222 | } |
228 | else { | 223 | else { |
229 | msg++; | 224 | msg++; |
230 | m_set_userstatus(status_kind, (uint8_t*) msg, strlen(msg)+1); | 225 | m_set_userstatus(status_kind); |
226 | m_set_statusmessage((uint8_t*) msg, strlen(msg)+1); | ||
231 | wprintw(self->window, "Status set to: %s, %s\n", status_text, msg); | 227 | wprintw(self->window, "Status set to: %s, %s\n", status_text, msg); |
232 | } | 228 | } |
233 | } | 229 | } |
@@ -239,7 +235,7 @@ static void execute(ToxWindow *self, char *u_cmd) | |||
239 | return; | 235 | return; |
240 | } | 236 | } |
241 | msg++; | 237 | msg++; |
242 | m_set_userstatus(USERSTATUS_KIND_RETAIN, (uint8_t*) msg, strlen(msg)+1); | 238 | m_set_statusmessage((uint8_t*) msg, strlen(msg)+1); |
243 | wprintw(self->window, "Status set to: %s\n", msg); | 239 | wprintw(self->window, "Status set to: %s\n", msg); |
244 | } | 240 | } |
245 | 241 | ||