diff --git a/doc/MODULES b/doc/MODULES index 9e6aeba418..ef8f2c0190 100644 --- a/doc/MODULES +++ b/doc/MODULES @@ -1,4 +1,4 @@ -Eggdrop Module Information Last revised: Jul 25, 2016 +Eggdrop Module Information Last revised: Nov 10, 2022 Eggdrop Module Information @@ -60,9 +60,9 @@ MODULES INCLUDED WITH EGGDROP compress - This module provides support for file compression. This allows the - bot to transfer compressed user files and, therefore, save a - significant amount of bandwidth. + This module provides support for file compression. With share module + loaded this allows the bot to transfer compressed user files and, + therefore, save a significant amount of bandwidth. console diff --git a/doc/modules/MODULES b/doc/modules/MODULES index 05b2a8fef3..48e47a4983 100644 --- a/doc/modules/MODULES +++ b/doc/modules/MODULES @@ -25,8 +25,8 @@ channels compress - This module provides support for file compression. This allows the - bot to transfer compressed user files and, therefore, save a + This module provides support for file compression. With share module loaded + this allows the bot to transfer compressed user files and, therefore, save a significant amount of bandwidth. console diff --git a/doc/sphinx_source/modules/included.rst b/doc/sphinx_source/modules/included.rst index 95f4599420..625ad896e7 100644 --- a/doc/sphinx_source/modules/included.rst +++ b/doc/sphinx_source/modules/included.rst @@ -40,9 +40,9 @@ Modules included with Eggdrop or save channel specific userfile information. :ref:`compress` - This module provides support for file compression. This - allows the bot to transfer compressed user files and, therefore, - save a significant amount of bandwidth. + This module provides support for file compression. With share module loaded + this allows the bot to transfer compressed user files and, therefore, save a + significant amount of bandwidth. :ref:`console` This module provides storage of console settings when you exit diff --git a/doc/sphinx_source/modules/mod/compress.rst b/doc/sphinx_source/modules/mod/compress.rst index ceb76c8714..dc60d3d129 100644 --- a/doc/sphinx_source/modules/mod/compress.rst +++ b/doc/sphinx_source/modules/mod/compress.rst @@ -1,4 +1,4 @@ -Last revised: May 27, 2004 +Last revised: Nov 10, 2022 .. _compress: @@ -6,11 +6,9 @@ Last revised: May 27, 2004 Compress Module =============== -This module provides support for file compression. It can be used -to compress files via Tcl or to transfer the userfile compressed during the -share process, saving bandwidth. - -This module requires: share +This module provides support for file compression. It can be used to compress +files via Tcl or, with share module loaded, to transfer the userfile compressed +during the share process, saving bandwidth. Put this line into your Eggdrop configuration file to load the compress module:: diff --git a/eggdrop.conf b/eggdrop.conf index 81e35bfe99..8b57163ae3 100755 --- a/eggdrop.conf +++ b/eggdrop.conf @@ -1510,10 +1510,10 @@ set xfer-timeout 30 #### COMPRESS MODULE #### -# This module provides support for file compression. This allows the -# bot to transfer compressed user files and therefore save a significant amount -# of bandwidth. The share module must be loaded to load this module. Un-comment -# the following line to the compress module. +# This module provides support for file compression. With share module loaded +# this allows the bot to transfer compressed user files and therefore save a +# significant amount of bandwidth. Un-comment the following line to the compress +# module. #loadmodule compress # Allow compressed sending of user files? The user files are compressed with diff --git a/src/mod/compress.mod/compress.c b/src/mod/compress.mod/compress.c index d4cd731549..99685806b4 100644 --- a/src/mod/compress.mod/compress.c +++ b/src/mod/compress.mod/compress.c @@ -412,7 +412,8 @@ static char *compress_close() rem_help_reference("compress.help"); rem_tcl_commands(my_tcl_cmds); rem_tcl_ints(my_tcl_ints); - uff_deltable(compress_uff_table); + if (share_funcs) + uff_deltable(compress_uff_table); module_undepend(MODULE_NAME); return NULL; @@ -437,6 +438,7 @@ static Function compress_table[] = { char *compress_start(Function *global_funcs) { + module_entry *me; global = global_funcs; compressed_files = 0; @@ -450,13 +452,12 @@ char *compress_start(Function *global_funcs) return "This module requires Eggdrop 1.8.0 or later."; } - share_funcs = module_depend(MODULE_NAME, "share", 2, 3); - if (!share_funcs) { - module_undepend(MODULE_NAME); - return "This module requires share module 2.3 or later."; + me = module_find("share", 2, 3); + if (me) { + share_funcs = me->funcs; + uff_addtable(compress_uff_table); } - uff_addtable(compress_uff_table); add_tcl_ints(my_tcl_ints); add_tcl_commands(my_tcl_cmds); add_help_reference("compress.help"); diff --git a/src/mod/compress.mod/help/compress.help b/src/mod/compress.mod/help/compress.help index 87683c56c9..733ad44646 100644 --- a/src/mod/compress.mod/help/compress.help +++ b/src/mod/compress.mod/help/compress.help @@ -1,8 +1,8 @@ %{help=compress module}%{+n} ### %bcompress module%b This module provides support for file compression. It can be used - to compress files via Tcl or to transfer the userfile compressed during the - share process, saving bandwidth. + to compress files via Tcl or, with share module loaded, to transfer the + userfile compressed during the share process, saving bandwidth. Config file variables for configuring the compress module: %bcompress-level share-compressed%b diff --git a/src/mod/compress.mod/modinfo b/src/mod/compress.mod/modinfo index 454de6694f..52c5217950 100644 --- a/src/mod/compress.mod/modinfo +++ b/src/mod/compress.mod/modinfo @@ -1,7 +1,7 @@ -DESC:The compress module provides support for file compression. This -DESC:allows the bot to transfer compressed user files and therefore -DESC:saves a significant amount of bandwidth, especially on very active -DESC:hubs. The module depends on the zlib library. +DESC:The compress module provides support for file compression. With share +DESC:module loaded this allows the bot to transfer compressed user files and +DESC:therefore saves a significant amount of bandwidth, especially on very +DESC:active hubs. The module depends on the zlib library. DESC: DESC:You will want to ENABLE this module if you have enough CPU time DESC:to spare.