comparison main.c @ 426:c2e4d7b4e0ae

Fix server-side commands.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 24 May 2012 11:38:54 +0300
parents 143fd51048a9
children 341ac6f99439
comparison
equal deleted inserted replaced
425:143fd51048a9 426:c2e4d7b4e0ae
1191 1191
1192 1192
1193 for (i = 0; i < nuserCmds; i++) 1193 for (i = 0; i < nuserCmds; i++)
1194 { 1194 {
1195 nn_usercmd_t *cmd = &userCmds[i]; 1195 nn_usercmd_t *cmd = &userCmds[i];
1196 if (!th_strncasecmp(buf, cmd->cmd, cmd->len)) 1196 if (!th_strncasecmp(buf + 1, cmd->cmd, cmd->len))
1197 { 1197 {
1198 char *nbuf = str_trim_left(buf + cmd->len); 1198 char *nbuf = str_trim_left(buf + 1 + cmd->len);
1199 1199
1200 switch (cmd->flags) 1200 switch (cmd->flags)
1201 { 1201 {
1202 case CMDARG_NICK: 1202 case CMDARG_NICK:
1203 case CMDARG_STRING: 1203 case CMDARG_STRING:
1261 // Decode completed usernames 1261 // Decode completed usernames
1262 nn_username_decode(buf); 1262 nn_username_decode(buf);
1263 1263
1264 // Check for commands 1264 // Check for commands
1265 if (buf[0] == '/') 1265 if (buf[0] == '/')
1266 return nn_handle_command(conn, buf + 1); 1266 return nn_handle_command(conn, buf);
1267 1267
1268 // If current window is not the main room window, send private 1268 // If current window is not the main room window, send private
1269 if (currWin != chatWindows[0]) 1269 if (currWin != chatWindows[0])
1270 { 1270 {
1271 if (currWin->id != NULL) 1271 if (currWin->id != NULL)