diff options
Diffstat (limited to 'vchat-commands.c')
-rwxr-xr-x | vchat-commands.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/vchat-commands.c b/vchat-commands.c index e4f1d99..2c3d68b 100755 --- a/vchat-commands.c +++ b/vchat-commands.c | |||
@@ -48,6 +48,7 @@ COMMAND_FORMAT, | |||
48 | COMMAND_KEYS, | 48 | COMMAND_KEYS, |
49 | COMMAND_QUIT, | 49 | COMMAND_QUIT, |
50 | COMMAND_USER, | 50 | COMMAND_USER, |
51 | COMMAND_DICT, | ||
51 | COMMAND_FLT, | 52 | COMMAND_FLT, |
52 | COMMAND_PM, | 53 | COMMAND_PM, |
53 | COMMAND_ACTION, | 54 | COMMAND_ACTION, |
@@ -73,6 +74,7 @@ static void command_rmflt ( char *tail); | |||
73 | static void command_none ( char *line); | 74 | static void command_none ( char *line); |
74 | static void command_query ( char *tail); | 75 | static void command_query ( char *tail); |
75 | static void command_reconnect ( char *tail); | 76 | static void command_reconnect ( char *tail); |
77 | static void command_dict ( char *tail); | ||
76 | 78 | ||
77 | static void output_default ( char *tail); | 79 | static void output_default ( char *tail); |
78 | 80 | ||
@@ -92,6 +94,7 @@ commandtable[] = { | |||
92 | { COMMAND_QUERY, "QUERY", 5, command_query, NULL, NULL }, | 94 | { COMMAND_QUERY, "QUERY", 5, command_query, NULL, NULL }, |
93 | { COMMAND_QUIT, "QUIT", 4, command_quit, SHORT_HELPTEXT_QUIT, LONG_HELPTEXT_QUIT }, | 95 | { COMMAND_QUIT, "QUIT", 4, command_quit, SHORT_HELPTEXT_QUIT, LONG_HELPTEXT_QUIT }, |
94 | { COMMAND_USER, "USER", 4, command_user, SHORT_HELPTEXT_USER, LONG_HELPTEXT_USER }, | 96 | { COMMAND_USER, "USER", 4, command_user, SHORT_HELPTEXT_USER, LONG_HELPTEXT_USER }, |
97 | { COMMAND_DICT, "DICT", 4, command_dict, SHORT_HELPTEXT_DICT, LONG_HELPTEXT_DICT }, | ||
95 | { COMMAND_FLT, "FLT", 3, command_flt, NULL, LONG_HELPTEXT_FLT }, | 98 | { COMMAND_FLT, "FLT", 3, command_flt, NULL, LONG_HELPTEXT_FLT }, |
96 | { COMMAND_PM, "MSG", 3, command_pm, SHORT_HELPTEXT_MSG, LONG_HELPTEXT_MSG }, | 99 | { COMMAND_PM, "MSG", 3, command_pm, SHORT_HELPTEXT_MSG, LONG_HELPTEXT_MSG }, |
97 | { COMMAND_ACTION, "ME", 2, command_action, SHORT_HELPTEXT_ME, LONG_HELPTEXT_ME }, | 100 | { COMMAND_ACTION, "ME", 2, command_action, SHORT_HELPTEXT_ME, LONG_HELPTEXT_ME }, |
@@ -131,7 +134,7 @@ translatecommand( char **cmd) | |||
131 | /* ... whose start may be affected by abbrevation */ | 134 | /* ... whose start may be affected by abbrevation */ |
132 | if( commandtable[result].number != COMMAND_NONE ) | 135 | if( commandtable[result].number != COMMAND_NONE ) |
133 | (*cmd) -= cut; | 136 | (*cmd) -= cut; |
134 | 137 | ||
135 | return result; | 138 | return result; |
136 | } | 139 | } |
137 | 140 | ||
@@ -140,11 +143,11 @@ static void | |||
140 | dothink( char *tail, char nice ) | 143 | dothink( char *tail, char nice ) |
141 | { | 144 | { |
142 | while( *tail == ' ' ) tail++; | 145 | while( *tail == ' ' ) tail++; |
143 | 146 | ||
144 | /* send users message to server */ | 147 | /* send users message to server */ |
145 | snprintf (tmpstr, TMPSTRSIZE, ".%c %s", nice, tail); | 148 | snprintf (tmpstr, TMPSTRSIZE, ".%c %s", nice, tail); |
146 | networkoutput (tmpstr); | 149 | networkoutput (tmpstr); |
147 | 150 | ||
148 | /* show action in channel window */ | 151 | /* show action in channel window */ |
149 | snprintf (tmpstr, TMPSTRSIZE, nice == 'O' ? getformatstr(FS_TXPUBNTHOUGHT) : getformatstr(FS_TXPUBTHOUGHT), tail); | 152 | snprintf (tmpstr, TMPSTRSIZE, nice == 'O' ? getformatstr(FS_TXPUBNTHOUGHT) : getformatstr(FS_TXPUBTHOUGHT), tail); |
150 | writechan (tmpstr); | 153 | writechan (tmpstr); |
@@ -261,7 +264,7 @@ handleline (char *line) | |||
261 | break; | 264 | break; |
262 | default: | 265 | default: |
263 | output_default( line ); | 266 | output_default( line ); |
264 | break; | 267 | break; |
265 | } | 268 | } |
266 | } | 269 | } |
267 | 270 | ||
@@ -276,7 +279,7 @@ output_default(char *line ) { | |||
276 | /* output message to channel window */ | 279 | /* output message to channel window */ |
277 | writechan (tmpstr); | 280 | writechan (tmpstr); |
278 | } | 281 | } |
279 | 282 | ||
280 | /* handle a "/user " request */ | 283 | /* handle a "/user " request */ |
281 | static void | 284 | static void |
282 | command_user(char *tail) | 285 | command_user(char *tail) |
@@ -372,7 +375,7 @@ command_none(char *line) { | |||
372 | snprintf(tmpstr, TMPSTRSIZE, " Unknown client command: %s ", line); | 375 | snprintf(tmpstr, TMPSTRSIZE, " Unknown client command: %s ", line); |
373 | msgout(tmpstr); | 376 | msgout(tmpstr); |
374 | } | 377 | } |
375 | 378 | ||
376 | /* handle a "/flt " request */ | 379 | /* handle a "/flt " request */ |
377 | static void | 380 | static void |
378 | command_flt(char *tail){ | 381 | command_flt(char *tail){ |
@@ -383,7 +386,7 @@ command_flt(char *tail){ | |||
383 | if( colour && *tail) { | 386 | if( colour && *tail) { |
384 | addfilter( colour, tail); | 387 | addfilter( colour, tail); |
385 | } | 388 | } |
386 | } | 389 | } |
387 | 390 | ||
388 | /* handle a "/clflt " request */ | 391 | /* handle a "/clflt " request */ |
389 | static void | 392 | static void |
@@ -391,20 +394,20 @@ command_clflt (char *tail) { | |||
391 | while( *tail == ' ') tail++; | 394 | while( *tail == ' ') tail++; |
392 | clearfilters( *tail ); | 395 | clearfilters( *tail ); |
393 | } | 396 | } |
394 | 397 | ||
395 | /* handle a "/rmflt " request */ | 398 | /* handle a "/rmflt " request */ |
396 | static void | 399 | static void |
397 | command_rmflt (char *tail) { | 400 | command_rmflt (char *tail) { |
398 | while( *tail == ' ') tail++; | 401 | while( *tail == ' ') tail++; |
399 | removefilter( tail ); | 402 | removefilter( tail ); |
400 | } | 403 | } |
401 | 404 | ||
402 | /* list filters */ | 405 | /* list filters */ |
403 | static void | 406 | static void |
404 | command_lsflt (char *tail) { | 407 | command_lsflt (char *tail) { |
405 | listfilters(); | 408 | listfilters(); |
406 | } | 409 | } |
407 | 410 | ||
408 | /* handle a "/me " action */ | 411 | /* handle a "/me " action */ |
409 | static void | 412 | static void |
410 | command_action(char *tail) | 413 | command_action(char *tail) |
@@ -469,3 +472,9 @@ command_query(char *tail) | |||
469 | // Do the ui stuff for query | 472 | // Do the ui stuff for query |
470 | handlequery( tail ); | 473 | handlequery( tail ); |
471 | } | 474 | } |
475 | |||
476 | void | ||
477 | command_dict(char *tail) | ||
478 | { | ||
479 | ul_add_to_dict(tail); | ||
480 | } | ||