diff options
-rwxr-xr-x | vchat-commands.c | 32 | ||||
-rwxr-xr-x | vchat.h | 1 |
2 files changed, 32 insertions, 1 deletions
diff --git a/vchat-commands.c b/vchat-commands.c index 0c8ca26..5499948 100755 --- a/vchat-commands.c +++ b/vchat-commands.c | |||
@@ -59,6 +59,7 @@ static void command_user ( char *tail); | |||
59 | static void command_pm ( char *tail); | 59 | static void command_pm ( char *tail); |
60 | static void command_action ( char *tail); | 60 | static void command_action ( char *tail); |
61 | static void command_help ( char *tail); | 61 | static void command_help ( char *tail); |
62 | static void command_format ( char *tail); | ||
62 | static void command_flt ( char *tail); | 63 | static void command_flt ( char *tail); |
63 | static void command_lsflt ( char *tail); | 64 | static void command_lsflt ( char *tail); |
64 | static void command_clflt ( char *tail); | 65 | static void command_clflt ( char *tail); |
@@ -80,6 +81,7 @@ commandtable[] = { | |||
80 | { COMMAND_CLFLT, "CLFLT", 5, command_clflt, NULL, LONG_HELPTEXT_CLFLT }, | 81 | { COMMAND_CLFLT, "CLFLT", 5, command_clflt, NULL, LONG_HELPTEXT_CLFLT }, |
81 | { COMMAND_HELP, "HELP", 4, command_help, SHORT_HELPTEXT_HELP, LONG_HELPTEXT_HELP }, | 82 | { COMMAND_HELP, "HELP", 4, command_help, SHORT_HELPTEXT_HELP, LONG_HELPTEXT_HELP }, |
82 | { COMMAND_FILTERS, "FILTERS", 7, command_help, SHORT_HELPTEXT_FILTERS, LONG_HELPTEXT_FILTERS }, | 83 | { COMMAND_FILTERS, "FILTERS", 7, command_help, SHORT_HELPTEXT_FILTERS, LONG_HELPTEXT_FILTERS }, |
84 | { COMMAND_FORMAT, "FORMAT", 6, command_format, NULL, NULL }, | ||
83 | { COMMAND_RECONNECT, "RECONNECT", 9, command_reconnect, SHORT_HELPTEXT_RECONNECT, LONG_HELPTEXT_RECONNECT }, | 85 | { COMMAND_RECONNECT, "RECONNECT", 9, command_reconnect, SHORT_HELPTEXT_RECONNECT, LONG_HELPTEXT_RECONNECT }, |
84 | { COMMAND_KEYS, "KEYS", 4, command_help, SHORT_HELPTEXT_KEYS, LONG_HELPTEXT_KEYS }, | 86 | { COMMAND_KEYS, "KEYS", 4, command_help, SHORT_HELPTEXT_KEYS, LONG_HELPTEXT_KEYS }, |
85 | { COMMAND_QUERY, "QUERY", 5, command_query, NULL, NULL }, | 87 | { COMMAND_QUERY, "QUERY", 5, command_query, NULL, NULL }, |
@@ -294,7 +296,35 @@ command_pm (char *tail) | |||
294 | { | 296 | { |
295 | privatemessagetx( tail ); | 297 | privatemessagetx( tail ); |
296 | } | 298 | } |
297 | 299 | ||
300 | static void | ||
301 | command_format(char *line) { | ||
302 | struct stat testexist; | ||
303 | char * tildex = NULL; | ||
304 | |||
305 | flushout(); | ||
306 | while( *line==' ') line++; | ||
307 | if(file) { | ||
308 | tildex = tilde_expand( file ); | ||
309 | if(tildex && !stat(file, &testexist )) | ||
310 | loadformats(file); | ||
311 | else { | ||
312 | #define BUFSIZE 4096 | ||
313 | char buf[BUFSIZE]; | ||
314 | snprintf( buf, BUFSIZE, "~/.vchat/sample-%s.fmt", file ); | ||
315 | free(tildex); | ||
316 | tildex = tilde_expand( file ); | ||
317 | if(tildex && !stat(file, &testexist )) | ||
318 | loadformats(file); | ||
319 | } | ||
320 | |||
321 | } else { | ||
322 | writeout(" Forgot to specify format file. "); | ||
323 | } | ||
324 | free(tildex); | ||
325 | showout(); | ||
326 | } | ||
327 | |||
298 | /* handle a help request */ | 328 | /* handle a help request */ |
299 | static void | 329 | static void |
300 | command_help (char *line) { | 330 | command_help (char *line) { |
@@ -90,6 +90,7 @@ extern unsigned int loggedin; | |||
90 | extern char errstr[]; | 90 | extern char errstr[]; |
91 | extern char *vchat_cl_version; | 91 | extern char *vchat_cl_version; |
92 | void loadcfg (char *file,void (*lineparser) (char *)); | 92 | void loadcfg (char *file,void (*lineparser) (char *)); |
93 | void loadformats (char *file); | ||
93 | void cleanup(int signal); | 94 | void cleanup(int signal); |
94 | 95 | ||
95 | /* configuration helper funktions from vchat-client.c */ | 96 | /* configuration helper funktions from vchat-client.c */ |