diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/weechat.c | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc.c | 29 |
2 files changed, 23 insertions, 10 deletions
diff --git a/src/core/weechat.c b/src/core/weechat.c index 3e4c8bd13..9d35b02b1 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -521,8 +521,10 @@ weechat_dump (int crash) plugin_print_log (); + hook_event_exec ("dump_data", NULL); + log_printf (""); - log_printf ("****** End of dump ******"); + log_printf ("****** End of WeeChat dump ******"); log_printf (""); } diff --git a/src/plugins/irc/irc.c b/src/plugins/irc/irc.c index cf7a298c0..89f5e0c75 100644 --- a/src/plugins/irc/irc.c +++ b/src/plugins/irc/irc.c @@ -34,6 +34,9 @@ #include "irc-completion.h" #include "irc-config.h" #include "irc-server.h" +#include "irc-channel.h" +#include "irc-nick.h" +#include "irc-dcc.h" char plugin_name[] = "irc"; @@ -51,42 +54,49 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */ /* - * irc_dump: dump IRC data in WeeChat log file + * irc_dump_data_cb: dump IRC data in WeeChat log file */ -/*int -irc_dump () +int +irc_dump_data_cb (void *data, char *event, void *pointer) { struct t_irc_server *ptr_server; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; + /* make C compiler happy */ + (void) data; + (void) event; + (void) pointer; + + weechat_log_printf (""); + weechat_log_printf ("***** IRC plugin dump *****"); + for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server) { - weechat_log_printf (""); irc_server_print_log (ptr_server); for (ptr_channel = ptr_server->channels; ptr_channel; - ptr_channel = ptr_channel->next_channel) + ptr_channel = ptr_channel->next_channel) { - weechat_log_printf (""); irc_channel_print_log (ptr_channel); for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick) { - weechat_log_printf (""); irc_nick_print_log (ptr_nick); } } } - irc_dcc_print_log (); + //irc_dcc_print_log (); + + weechat_log_printf (""); + weechat_log_printf ("***** End of IRC plugin dump *****"); return WEECHAT_RC_OK; } -*/ /* * irc_create_directories: create directories for IRC plugin @@ -165,6 +175,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) irc_command_init (); /* hook events */ + weechat_hook_event ("dump_data", &irc_dump_data_cb, NULL); weechat_hook_event ("config_reload", &irc_config_reload_cb, NULL); weechat_hook_event ("quit", &irc_quit_cb, NULL); |