diff options
author | Patrick Griffis <tingping@tingping.se> | 2016-11-08 22:34:31 -0500 |
---|---|---|
committer | tomek <eustachy.kapusta@gmail.com> | 2016-11-09 17:29:23 +0100 |
commit | 85bdb06cad4e8a58509f7421610ef9c82bbabc02 (patch) | |
tree | 49520316d27cb45e4a0f9d8dc2fe9705dfdb4c7f /plugins/doat/doat.c | |
parent | a0e80ebda2bc9270beb4818a2438d7555593b6fd (diff) |
Convert doat to an internal command
- Trivial plugin - Useful for many users - Was under a dumb license
Diffstat (limited to 'plugins/doat/doat.c')
-rw-r--r-- | plugins/doat/doat.c | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/plugins/doat/doat.c b/plugins/doat/doat.c deleted file mode 100644 index 1d1bfcdf..00000000 --- a/plugins/doat/doat.c +++ /dev/null @@ -1,92 +0,0 @@ -/* This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING or http://lwsitu.com/xchat/COPYING - * for more details. */ - -#include "config.h" - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <glib.h> -#include "hexchat-plugin.h" - -static hexchat_plugin *ph; - -static int -parse_command( char *word[], char *word_eol[], void *userdata ) { - char *channel = NULL, *server = NULL, *token = NULL; -/* char *save_ptr1 = NULL;*/ - char *str1 = NULL; - char *delimiter = NULL; - - hexchat_context *ctx = NULL; - - if( word[2] != NULL && word[3] != NULL ) { - for( str1 = word[2]; ; str1 = NULL ) { -/* token = strtok_r( str1, ",", &save_ptr1 );*/ - token = strtok( str1, "," ); -/* printf( "token: %s\n", token );*/ - - if( token == NULL ) { - break; - } - - channel = g_strdup( token ); - - delimiter = strchr( channel, '/' ); - - server = NULL; - if( delimiter != NULL ) { - *delimiter = '\0'; - - if( strlen( delimiter + 1 ) > 0 ) { - server = g_strdup( delimiter + 1 ); - } - } - - /* /Network form */ - if( strlen( channel ) == 0 ) { - g_free( channel ); - channel = NULL; - } - -/* printf( "channel[%s] server[%s]\n", channel, server );*/ - - if( (ctx = hexchat_find_context( ph, server, channel ) ) != NULL ) { - if( hexchat_set_context( ph, ctx ) ) { - hexchat_command( ph, word_eol[3] ); - } - } - - g_free( channel ); - g_free( server ); - } - } - return HEXCHAT_EAT_HEXCHAT; -} - -int -hexchat_plugin_init( hexchat_plugin * plugin_handle, char **plugin_name, - char **plugin_desc, char **plugin_version, char *arg ) { - - ph = plugin_handle; - *plugin_name = "Do At"; - *plugin_version = "1.0001"; - *plugin_desc = "Perform an arbitrary command on multiple channels"; - - hexchat_hook_command( ph, "doat", HEXCHAT_PRI_NORM, parse_command, "DOAT [channel,list,/network] [command], perform a command on multiple contexts", NULL ); - - hexchat_print (ph, "Do At plugin loaded\n"); - - return 1; -} - -int -hexchat_plugin_deinit (void) -{ - hexchat_print (ph, "Do At plugin unloaded\n"); - return 1; -} |