summaryrefslogtreecommitdiff
path: root/vchat-commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'vchat-commands.c')
-rwxr-xr-xvchat-commands.c29
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,
48COMMAND_KEYS, 48COMMAND_KEYS,
49COMMAND_QUIT, 49COMMAND_QUIT,
50COMMAND_USER, 50COMMAND_USER,
51COMMAND_DICT,
51COMMAND_FLT, 52COMMAND_FLT,
52COMMAND_PM, 53COMMAND_PM,
53COMMAND_ACTION, 54COMMAND_ACTION,
@@ -73,6 +74,7 @@ static void command_rmflt ( char *tail);
73static void command_none ( char *line); 74static void command_none ( char *line);
74static void command_query ( char *tail); 75static void command_query ( char *tail);
75static void command_reconnect ( char *tail); 76static void command_reconnect ( char *tail);
77static void command_dict ( char *tail);
76 78
77static void output_default ( char *tail); 79static 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
140dothink( char *tail, char nice ) 143dothink( 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 */
281static void 284static void
282command_user(char *tail) 285command_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 */
377static void 380static void
378command_flt(char *tail){ 381command_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 */
389static void 392static 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 */
396static void 399static void
397command_rmflt (char *tail) { 400command_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 */
403static void 406static void
404command_lsflt (char *tail) { 407command_lsflt (char *tail) {
405 listfilters(); 408 listfilters();
406} 409}
407 410
408/* handle a "/me " action */ 411/* handle a "/me " action */
409static void 412static void
410command_action(char *tail) 413command_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
476void
477command_dict(char *tail)
478{
479 ul_add_to_dict(tail);
480}