mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 12:45:42 +02:00
Added IRC::command function for Perl scripts
This commit is contained in:
@@ -5,6 +5,7 @@ ChangeLog - 2004-10-03
|
||||
|
||||
|
||||
Version 0.0.8 (under dev!):
|
||||
* added IRC::command function for Perl scripts
|
||||
* fixed bug when adding alias with same name as other
|
||||
* /buffer command developed (buffers list, move and notify)
|
||||
* logging buffers to disk (server/channel/private according to user prefs)
|
||||
|
||||
@@ -540,7 +540,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
ptr_args = NULL;
|
||||
}
|
||||
|
||||
if (!plugin_exec_command (command + 1, ptr_args))
|
||||
if (!plugin_exec_command (command + 1, server->name, ptr_args))
|
||||
{
|
||||
argv = explode_string (ptr_args, " ", 0, &argc);
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "irc.h"
|
||||
|
||||
|
||||
t_irc_channel *current_channel = NULL;
|
||||
char *channel_modes = "iklmnst";
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ irc_recv_command (t_irc_server *server, char *entire_line,
|
||||
if (irc_commands[i].recv_function != NULL)
|
||||
{
|
||||
return_code = (int) (irc_commands[i].recv_function) (server, host, arguments);
|
||||
plugin_event_msg (irc_commands[i].command_name, entire_line);
|
||||
plugin_event_msg (irc_commands[i].command_name, server->name, entire_line);
|
||||
return return_code;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
|
||||
t_irc_server *irc_servers = NULL;
|
||||
t_irc_server *last_irc_server = NULL;
|
||||
t_irc_server *current_irc_server = NULL;
|
||||
|
||||
t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
|
||||
@@ -686,8 +685,7 @@ server_connect (t_irc_server *server)
|
||||
server->sock4 = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
current_irc_server = server;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -198,9 +198,8 @@ struct t_dcc
|
||||
};
|
||||
|
||||
extern t_irc_command irc_commands[];
|
||||
extern t_irc_server *irc_servers, *current_irc_server;
|
||||
extern t_irc_server *irc_servers;
|
||||
extern t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
extern t_irc_channel *current_channel;
|
||||
extern t_dcc *dcc_list;
|
||||
extern char *dcc_status_string[6];
|
||||
extern char *channel_modes;
|
||||
|
||||
+86
-13
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@
|
||||
|
||||
extern void wee_perl_init ();
|
||||
extern t_plugin_script *wee_perl_search (char *);
|
||||
extern int wee_perl_exec (char *, char *);
|
||||
extern int wee_perl_exec (char *, char *, char *);
|
||||
extern int wee_perl_load (char *);
|
||||
extern void wee_perl_unload (t_plugin_script *);
|
||||
extern void wee_perl_unload_all ();
|
||||
|
||||
@@ -273,7 +273,7 @@ plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
|
||||
*/
|
||||
|
||||
void
|
||||
plugin_event_msg (char *irc_command, char *arguments)
|
||||
plugin_event_msg (char *irc_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -285,7 +285,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
*/
|
||||
|
||||
int
|
||||
plugin_exec_command (char *user_command, char *arguments)
|
||||
plugin_exec_command (char *user_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -313,7 +313,7 @@ plugin_exec_command (char *user_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
|
||||
/* command executed */
|
||||
|
||||
@@ -68,8 +68,8 @@ extern void plugin_handler_add (t_plugin_handler **, t_plugin_handler **,
|
||||
int, char *, char *);
|
||||
extern void plugin_handler_free_all_type (t_plugin_handler **,
|
||||
t_plugin_handler **, int);
|
||||
extern void plugin_event_msg (char *, char *);
|
||||
extern int plugin_exec_command (char *, /*@null@*/ char *);
|
||||
extern void plugin_event_msg (char *, char *, char *);
|
||||
extern int plugin_exec_command (char *, /*@null@*/ char *, char *);
|
||||
extern void plugin_end ();
|
||||
|
||||
#endif /* plugins.h */
|
||||
|
||||
@@ -5,6 +5,7 @@ ChangeLog - 2004-10-03
|
||||
|
||||
|
||||
Version 0.0.8 (under dev!):
|
||||
* added IRC::command function for Perl scripts
|
||||
* fixed bug when adding alias with same name as other
|
||||
* /buffer command developed (buffers list, move and notify)
|
||||
* logging buffers to disk (server/channel/private according to user prefs)
|
||||
|
||||
@@ -540,7 +540,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
ptr_args = NULL;
|
||||
}
|
||||
|
||||
if (!plugin_exec_command (command + 1, ptr_args))
|
||||
if (!plugin_exec_command (command + 1, server->name, ptr_args))
|
||||
{
|
||||
argv = explode_string (ptr_args, " ", 0, &argc);
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "irc.h"
|
||||
|
||||
|
||||
t_irc_channel *current_channel = NULL;
|
||||
char *channel_modes = "iklmnst";
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ irc_recv_command (t_irc_server *server, char *entire_line,
|
||||
if (irc_commands[i].recv_function != NULL)
|
||||
{
|
||||
return_code = (int) (irc_commands[i].recv_function) (server, host, arguments);
|
||||
plugin_event_msg (irc_commands[i].command_name, entire_line);
|
||||
plugin_event_msg (irc_commands[i].command_name, server->name, entire_line);
|
||||
return return_code;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
|
||||
t_irc_server *irc_servers = NULL;
|
||||
t_irc_server *last_irc_server = NULL;
|
||||
t_irc_server *current_irc_server = NULL;
|
||||
|
||||
t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
|
||||
@@ -686,8 +685,7 @@ server_connect (t_irc_server *server)
|
||||
server->sock4 = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
current_irc_server = server;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,9 +198,8 @@ struct t_dcc
|
||||
};
|
||||
|
||||
extern t_irc_command irc_commands[];
|
||||
extern t_irc_server *irc_servers, *current_irc_server;
|
||||
extern t_irc_server *irc_servers;
|
||||
extern t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
extern t_irc_channel *current_channel;
|
||||
extern t_dcc *dcc_list;
|
||||
extern char *dcc_status_string[6];
|
||||
extern char *channel_modes;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@
|
||||
|
||||
extern void wee_perl_init ();
|
||||
extern t_plugin_script *wee_perl_search (char *);
|
||||
extern int wee_perl_exec (char *, char *);
|
||||
extern int wee_perl_exec (char *, char *, char *);
|
||||
extern int wee_perl_load (char *);
|
||||
extern void wee_perl_unload (t_plugin_script *);
|
||||
extern void wee_perl_unload_all ();
|
||||
|
||||
@@ -273,7 +273,7 @@ plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
|
||||
*/
|
||||
|
||||
void
|
||||
plugin_event_msg (char *irc_command, char *arguments)
|
||||
plugin_event_msg (char *irc_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -285,7 +285,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
*/
|
||||
|
||||
int
|
||||
plugin_exec_command (char *user_command, char *arguments)
|
||||
plugin_exec_command (char *user_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -313,7 +313,7 @@ plugin_exec_command (char *user_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
|
||||
/* command executed */
|
||||
|
||||
@@ -68,8 +68,8 @@ extern void plugin_handler_add (t_plugin_handler **, t_plugin_handler **,
|
||||
int, char *, char *);
|
||||
extern void plugin_handler_free_all_type (t_plugin_handler **,
|
||||
t_plugin_handler **, int);
|
||||
extern void plugin_event_msg (char *, char *);
|
||||
extern int plugin_exec_command (char *, /*@null@*/ char *);
|
||||
extern void plugin_event_msg (char *, char *, char *);
|
||||
extern int plugin_exec_command (char *, /*@null@*/ char *, char *);
|
||||
extern void plugin_end ();
|
||||
|
||||
#endif /* plugins.h */
|
||||
|
||||
Reference in New Issue
Block a user