diff options
Diffstat (limited to 'src/fe-common/irc/dcc')
-rw-r--r-- | src/fe-common/irc/dcc/Makefile.am | 1 | ||||
-rw-r--r-- | src/fe-common/irc/dcc/fe-dcc.c | 5 | ||||
-rw-r--r-- | src/fe-common/irc/dcc/module-formats.c | 71 | ||||
-rw-r--r-- | src/fe-common/irc/dcc/module-formats.h | 3 | ||||
-rw-r--r-- | src/fe-common/irc/dcc/module.h | 3 |
5 files changed, 45 insertions, 38 deletions
diff --git a/src/fe-common/irc/dcc/Makefile.am b/src/fe-common/irc/dcc/Makefile.am index 0424c7b2..54647bc9 100644 --- a/src/fe-common/irc/dcc/Makefile.am +++ b/src/fe-common/irc/dcc/Makefile.am @@ -14,4 +14,5 @@ libfe_common_irc_dcc_la_SOURCES = \ module-formats.c noinst_HEADERS = \ + module.h \ module-formats.h diff --git a/src/fe-common/irc/dcc/fe-dcc.c b/src/fe-common/irc/dcc/fe-dcc.c index b89e44b9..5cdcd28d 100644 --- a/src/fe-common/irc/dcc/fe-dcc.c +++ b/src/fe-common/irc/dcc/fe-dcc.c @@ -30,6 +30,7 @@ #include "irc/dcc/dcc.h" +#include "themes.h" #include "windows.h" static void dcc_connected(DCC_REC *dcc) @@ -427,10 +428,14 @@ void fe_dcc_init(void) command_bind("dcc ", NULL, (SIGNAL_FUNC) cmd_dcc_list); command_bind("dcc list", NULL, (SIGNAL_FUNC) cmd_dcc_list); signal_add("window item remove", (SIGNAL_FUNC) dcc_chat_closed); + + theme_register(fecommon_irc_dcc_formats); } void fe_dcc_deinit(void) { + theme_unregister(); + signal_remove("dcc connected", (SIGNAL_FUNC) dcc_connected); signal_remove("dcc rejected", (SIGNAL_FUNC) dcc_rejected); signal_remove("dcc closed", (SIGNAL_FUNC) dcc_closed); diff --git a/src/fe-common/irc/dcc/module-formats.c b/src/fe-common/irc/dcc/module-formats.c index 40313010..4dee15f7 100644 --- a/src/fe-common/irc/dcc/module-formats.c +++ b/src/fe-common/irc/dcc/module-formats.c @@ -21,39 +21,40 @@ #include "module.h" #include "printtext.h" -FORMAT_REC fecommon_irc_dcc_formats[] = -{ - { MODULE_NAME, "IRC", 0 }, - - /* ---- */ - { NULL, "DCC", 0 }, - - { "own_dcc", "%K[%rdcc%K(%R$0%K)]%n $1", 2, { 0, 0 } }, - { "own_dcc_me", "%W * $0%n $1", 2, { 0, 0 } }, - { "own_dcc_ctcp", "%K[%rctcp%K(%R$0%K)]%n $1 $2", 3, { 0, 0, 0 } }, - { "dcc_msg", "%K[%G$0%K(%gdcc%K)]%n $1", 2, { 0, 0 } }, - { "action_dcc", "%W (*dcc*) $0%n $1", 2, { 0, 0 } }, - { "dcc_ctcp", "%g>>> DCC CTCP received from %_$0%_%K: %g$1", 2, { 0, 0 } }, - { "dcc_chat", "%gDCC CHAT from %_$0%_ %K[%g$1 port $2%K]", 3, { 0, 0, 1 } }, - { "dcc_chat_not_found", "%gNo DCC CHAT connection open to %_$0", 1, { 0 } }, - { "dcc_chat_connected", "%gDCC %_CHAT%_ connection with %_$0%_ %K%K[%g$1 port $2%K]%g established", 3, { 0, 0, 1 } }, - { "dcc_chat_disconnected", "%gDCC lost chat to %_$0", 1, { 0 } }, - { "dcc_send", "%gDCC SEND from %_$0%_ %K[%g$1 port $2%K]: %g$3 %K[%g$4 bytes%K]", 5, { 0, 0, 1, 0, 2 } }, - { "dcc_send_exists", "%gDCC already sending file %G$0%g for %_$1%_", 2, { 0, 0 } }, - { "dcc_send_not_found", "%gDCC not sending file %G$1%g to %_$0", 2, { 0, 0 } }, - { "dcc_send_file_not_found", "%gDCC file not found: %G$0%g", 1, { 0 } }, - { "dcc_send_connected", "%gDCC sending file %G$0%g for %_$1%_ %K[%g$2 port $3%K]", 4, { 0, 0, 0, 1 } }, - { "dcc_send_complete", "%gDCC sent file $0 %K[%g%_$1%_kb%K]%g for %_$2%_ in %_$3%_ secs %K[%g%_$4kb/s%_%K]", 5, { 0, 2, 0, 2, 3 } }, - { "dcc_send_aborted", "%gDCC aborted sending file $0 for %_$1%_", 2, { 0, 0 } }, - { "dcc_get_not_found", "%gDCC no file offered by %_$0", 1, { 0 } }, - { "dcc_get_connected", "%gDCC receiving file %G$0%g from %_$1%_ %K[%g$2 port $3%K]", 4, { 0, 0, 0, 1 } }, - { "dcc_get_complete", "%gDCC received file %G$0%g %K[%g$1kb%K]%g from %_$2%_ in %_$3%_ secs %K[%g$4kb/s%K]", 5, { 0, 2, 0, 2, 3 } }, - { "dcc_get_aborted", "%gDCC aborted receiving file $0 from %_$1%_", 2, { 0, 0 } }, - { "dcc_unknown_ctcp", "%gDCC unknown ctcp %G$0%g from %_$1%_ %K[%g$2%K]", 3, { 0, 0, 0 } }, - { "dcc_unknown_reply", "%gDCC unknown reply %G$0%g from %_$1%_ %K[%g$2%K]", 3, { 0, 0, 0 } }, - { "dcc_unknown_type", "%gDCC unknown type %_$0", 1, { 0 } }, - { "dcc_connect_error", "%gDCC can't connect to %_$0%_ port %_$1", 2, { 0, 1 } }, - { "dcc_cant_create", "%gDCC can't create file %G$0%g", 1, { 0 } }, - { "dcc_rejected", "%gDCC %G$0%g was rejected by %_$1%_ %K[%G$2%K]", 3, { 0, 0, 0 } }, - { "dcc_close", "%gDCC %G$0%g close for %_$1%_ %K[%G$2%K]", 3, { 0, 0, 0 } } +FORMAT_REC fecommon_irc_dcc_formats[] = { + { MODULE_NAME, "IRC", 0 }, + + /* ---- */ + { NULL, "DCC", 0 }, + + { "own_dcc", "%K[%rdcc%K(%R$0%K)]%n $1", 2, { 0, 0 } }, + { "own_dcc_me", "%W * $0%n $1", 2, { 0, 0 } }, + { "own_dcc_ctcp", "%K[%rctcp%K(%R$0%K)]%n $1 $2", 3, { 0, 0, 0 } }, + { "dcc_msg", "%K[%G$0%K(%gdcc%K)]%n $1", 2, { 0, 0 } }, + { "action_dcc", "%W (*dcc*) $0%n $1", 2, { 0, 0 } }, + { "dcc_ctcp", "%g>>> DCC CTCP received from %_$0%_%K: %g$1", 2, { 0, 0 } }, + { "dcc_chat", "%gDCC CHAT from %_$0%_ %K[%g$1 port $2%K]", 3, { 0, 0, 1 } }, + { "dcc_chat_not_found", "%gNo DCC CHAT connection open to %_$0", 1, { 0 } }, + { "dcc_chat_connected", "%gDCC %_CHAT%_ connection with %_$0%_ %K%K[%g$1 port $2%K]%g established", 3, { 0, 0, 1 } }, + { "dcc_chat_disconnected", "%gDCC lost chat to %_$0", 1, { 0 } }, + { "dcc_send", "%gDCC SEND from %_$0%_ %K[%g$1 port $2%K]: %g$3 %K[%g$4 bytes%K]", 5, { 0, 0, 1, 0, 2 } }, + { "dcc_send_exists", "%gDCC already sending file %G$0%g for %_$1%_", 2, { 0, 0 } }, + { "dcc_send_not_found", "%gDCC not sending file %G$1%g to %_$0", 2, { 0, 0 } }, + { "dcc_send_file_not_found", "%gDCC file not found: %G$0%g", 1, { 0 } }, + { "dcc_send_connected", "%gDCC sending file %G$0%g for %_$1%_ %K[%g$2 port $3%K]", 4, { 0, 0, 0, 1 } }, + { "dcc_send_complete", "%gDCC sent file $0 %K[%g%_$1%_kb%K]%g for %_$2%_ in %_$3%_ secs %K[%g%_$4kb/s%_%K]", 5, { 0, 2, 0, 2, 3 } }, + { "dcc_send_aborted", "%gDCC aborted sending file $0 for %_$1%_", 2, { 0, 0 } }, + { "dcc_get_not_found", "%gDCC no file offered by %_$0", 1, { 0 } }, + { "dcc_get_connected", "%gDCC receiving file %G$0%g from %_$1%_ %K[%g$2 port $3%K]", 4, { 0, 0, 0, 1 } }, + { "dcc_get_complete", "%gDCC received file %G$0%g %K[%g$1kb%K]%g from %_$2%_ in %_$3%_ secs %K[%g$4kb/s%K]", 5, { 0, 2, 0, 2, 3 } }, + { "dcc_get_aborted", "%gDCC aborted receiving file $0 from %_$1%_", 2, { 0, 0 } }, + { "dcc_unknown_ctcp", "%gDCC unknown ctcp %G$0%g from %_$1%_ %K[%g$2%K]", 3, { 0, 0, 0 } }, + { "dcc_unknown_reply", "%gDCC unknown reply %G$0%g from %_$1%_ %K[%g$2%K]", 3, { 0, 0, 0 } }, + { "dcc_unknown_type", "%gDCC unknown type %_$0", 1, { 0 } }, + { "dcc_connect_error", "%gDCC can't connect to %_$0%_ port %_$1", 2, { 0, 1 } }, + { "dcc_cant_create", "%gDCC can't create file %G$0%g", 1, { 0 } }, + { "dcc_rejected", "%gDCC %G$0%g was rejected by %_$1%_ %K[%G$2%K]", 3, { 0, 0, 0 } }, + { "dcc_close", "%gDCC %G$0%g close for %_$1%_ %K[%G$2%K]", 3, { 0, 0, 0 } }, + + { NULL, NULL, 0 } }; diff --git a/src/fe-common/irc/dcc/module-formats.h b/src/fe-common/irc/dcc/module-formats.h index de01511f..d7fe8eff 100644 --- a/src/fe-common/irc/dcc/module-formats.h +++ b/src/fe-common/irc/dcc/module-formats.h @@ -36,6 +36,3 @@ enum { }; extern FORMAT_REC fecommon_irc_dcc_formats[]; -#define MODULE_FORMATS fecommon_irc_dcc_formats - -#include "printformat.h" diff --git a/src/fe-common/irc/dcc/module.h b/src/fe-common/irc/dcc/module.h new file mode 100644 index 00000000..966a37cb --- /dev/null +++ b/src/fe-common/irc/dcc/module.h @@ -0,0 +1,3 @@ +#include "common.h" + +#define MODULE_NAME "fe-common/irc/dcc" |