diff options
author | Sean Qureshi <stqism@risingstormgames.com> | 2013-08-08 03:07:41 -0700 |
---|---|---|
committer | Sean Qureshi <stqism@risingstormgames.com> | 2013-08-08 03:07:41 -0700 |
commit | 4d0cce2f69b4a4f99b694e65d6c5ccaf38ef57b8 (patch) | |
tree | e300f13a4a0b86e9d1670c0ebc75bbeebc09fa02 /testing/toxic | |
parent | 1bbdd9d2dbbb0a0a7ae056699c487df00c55579e (diff) | |
parent | 225f74e844299c405b744a9d03f4fcc0430b430a (diff) |
Merge https://github.com/irungentoo/ProjectTox-Core
Diffstat (limited to 'testing/toxic')
-rw-r--r-- | testing/toxic/chat.c | 2 | ||||
-rw-r--r-- | testing/toxic/friendlist.c | 4 | ||||
-rw-r--r-- | testing/toxic/prompt.c | 20 |
3 files changed, 11 insertions, 15 deletions
diff --git a/testing/toxic/chat.c b/testing/toxic/chat.c index b870e9c2..28c5de6c 100644 --- a/testing/toxic/chat.c +++ b/testing/toxic/chat.c | |||
@@ -161,7 +161,7 @@ void execute(ToxWindow *self, ChatContext *ctx, char *cmd) | |||
161 | return; | 161 | return; |
162 | } | 162 | } |
163 | msg++; | 163 | msg++; |
164 | m_set_userstatus(USERSTATUS_KIND_RETAIN, (uint8_t*) msg, strlen(msg)+1); | 164 | m_set_statusmessage((uint8_t*) msg, strlen(msg)+1); |
165 | wprintw(ctx->history, "Status set to: %s\n", msg); | 165 | wprintw(ctx->history, "Status set to: %s\n", msg); |
166 | } | 166 | } |
167 | 167 | ||
diff --git a/testing/toxic/friendlist.c b/testing/toxic/friendlist.c index f03914e6..159217b1 100644 --- a/testing/toxic/friendlist.c +++ b/testing/toxic/friendlist.c | |||
@@ -20,7 +20,7 @@ extern int active_window; | |||
20 | 20 | ||
21 | typedef struct { | 21 | typedef struct { |
22 | uint8_t name[MAX_NAME_LENGTH]; | 22 | uint8_t name[MAX_NAME_LENGTH]; |
23 | uint8_t status[MAX_USERSTATUS_LENGTH]; | 23 | uint8_t status[MAX_STATUSMESSAGE_LENGTH]; |
24 | int num; | 24 | int num; |
25 | int chatwin; | 25 | int chatwin; |
26 | } friend_t; | 26 | } friend_t; |
@@ -74,7 +74,7 @@ void friendlist_onNickChange(ToxWindow *self, int num, uint8_t *str, uint16_t le | |||
74 | 74 | ||
75 | void friendlist_onStatusChange(ToxWindow *self, int num, uint8_t *str, uint16_t len) | 75 | void friendlist_onStatusChange(ToxWindow *self, int num, uint8_t *str, uint16_t len) |
76 | { | 76 | { |
77 | if (len >= MAX_USERSTATUS_LENGTH || num >= num_friends) | 77 | if (len >= MAX_STATUSMESSAGE_LENGTH || num >= num_friends) |
78 | return; | 78 | return; |
79 | 79 | ||
80 | memcpy((char*) &friends[num].status, (char*) str, len); | 80 | memcpy((char*) &friends[num].status, (char*) str, len); |
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 | ||