summaryrefslogtreecommitdiffstats
path: root/src/fe-common/irc/dcc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/fe-common/irc/dcc/Makefile.am24
-rw-r--r--src/fe-common/irc/dcc/Makefile.in750
-rw-r--r--src/fe-common/irc/dcc/fe-dcc-chat-messages.c164
-rw-r--r--src/fe-common/irc/dcc/fe-dcc-chat.c385
-rw-r--r--src/fe-common/irc/dcc/fe-dcc-get.c150
-rw-r--r--src/fe-common/irc/dcc/fe-dcc-send.c186
-rw-r--r--src/fe-common/irc/dcc/fe-dcc-server.c83
-rw-r--r--src/fe-common/irc/dcc/fe-dcc.c195
-rw-r--r--src/fe-common/irc/dcc/fe-dcc.h7
-rw-r--r--src/fe-common/irc/dcc/meson.build27
-rw-r--r--src/fe-common/irc/dcc/module-formats.c79
-rw-r--r--src/fe-common/irc/dcc/module-formats.h57
-rw-r--r--src/fe-common/irc/dcc/module.h4
13 files changed, 2111 insertions, 0 deletions
diff --git a/src/fe-common/irc/dcc/Makefile.am b/src/fe-common/irc/dcc/Makefile.am
new file mode 100644
index 0000000..feee349
--- /dev/null
+++ b/src/fe-common/irc/dcc/Makefile.am
@@ -0,0 +1,24 @@
+noinst_LIBRARIES = libfe_irc_dcc.a
+
+AM_CPPFLAGS = \
+ -I$(top_builddir) \
+ $(GLIB_CFLAGS) \
+ -DHELPDIR=\""$(datadir)/irssi/help"\" \
+ -DSYSCONFDIR=\""$(sysconfdir)"\"
+
+libfe_irc_dcc_a_SOURCES = \
+ fe-dcc.c \
+ fe-dcc-chat.c \
+ fe-dcc-chat-messages.c \
+ fe-dcc-get.c \
+ fe-dcc-send.c \
+ module-formats.c \
+ fe-dcc-server.c
+
+pkginc_fe_common_irc_dccdir=$(pkgincludedir)/src/fe-common/irc/dcc
+pkginc_fe_common_irc_dcc_HEADERS = \
+ module.h \
+ module-formats.h \
+ fe-dcc.h
+
+EXTRA_DIST = meson.build
diff --git a/src/fe-common/irc/dcc/Makefile.in b/src/fe-common/irc/dcc/Makefile.in
new file mode 100644
index 0000000..f73bf3b
--- /dev/null
+++ b/src/fe-common/irc/dcc/Makefile.in
@@ -0,0 +1,750 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/fe-common/irc/dcc
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/glib-2.0.m4 \
+ $(top_srcdir)/m4/glibtests.m4 $(top_srcdir)/m4/libgcrypt.m4 \
+ $(top_srcdir)/m4/libotr.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am \
+ $(pkginc_fe_common_irc_dcc_HEADERS) $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/irssi-config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libfe_irc_dcc_a_AR = $(AR) $(ARFLAGS)
+libfe_irc_dcc_a_LIBADD =
+am_libfe_irc_dcc_a_OBJECTS = fe-dcc.$(OBJEXT) fe-dcc-chat.$(OBJEXT) \
+ fe-dcc-chat-messages.$(OBJEXT) fe-dcc-get.$(OBJEXT) \
+ fe-dcc-send.$(OBJEXT) module-formats.$(OBJEXT) \
+ fe-dcc-server.$(OBJEXT)
+libfe_irc_dcc_a_OBJECTS = $(am_libfe_irc_dcc_a_OBJECTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES =
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/fe-dcc-chat-messages.Po \
+ ./$(DEPDIR)/fe-dcc-chat.Po ./$(DEPDIR)/fe-dcc-get.Po \
+ ./$(DEPDIR)/fe-dcc-send.Po ./$(DEPDIR)/fe-dcc-server.Po \
+ ./$(DEPDIR)/fe-dcc.Po ./$(DEPDIR)/module-formats.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libfe_irc_dcc_a_SOURCES)
+DIST_SOURCES = $(libfe_irc_dcc_a_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(pkginc_fe_common_irc_dccdir)"
+HEADERS = $(pkginc_fe_common_irc_dcc_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHAT_MODULES = @CHAT_MODULES@
+COMMON_LIBS = @COMMON_LIBS@
+COMMON_NOUI_LIBS = @COMMON_NOUI_LIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FILECMD = @FILECMD@
+FUZZER_LIBS = @FUZZER_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
+LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
+LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBOTR_CFLAGS = @LIBOTR_CFLAGS@
+LIBOTR_LIBS = @LIBOTR_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+OTR_CFLAGS = @OTR_CFLAGS@
+OTR_LDFLAGS = @OTR_LDFLAGS@
+OTR_LINK_FLAGS = @OTR_LINK_FLAGS@
+OTR_LINK_LIBS = @OTR_LINK_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL_CFLAGS = @PERL_CFLAGS@
+PERL_EXTRA_OPTS = @PERL_EXTRA_OPTS@
+PERL_FE_LINK_LIBS = @PERL_FE_LINK_LIBS@
+PERL_LDFLAGS = @PERL_LDFLAGS@
+PERL_LINK_FLAGS = @PERL_LINK_FLAGS@
+PERL_LINK_LIBS = @PERL_LINK_LIBS@
+PERL_MM_OPT = @PERL_MM_OPT@
+PERL_MM_PARAMS = @PERL_MM_PARAMS@
+PERL_STATIC_LIBS = @PERL_STATIC_LIBS@
+PERL_USE_LIB = @PERL_USE_LIB@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PROG_LIBS = @PROG_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TEXTUI_LIBS = @TEXTUI_LIBS@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+installed_test_metadir = @installed_test_metadir@
+installed_testdir = @installed_testdir@
+irc_MODULES = @irc_MODULES@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+otr_module_lib = @otr_module_lib@
+otr_static_lib = @otr_static_lib@
+pdfdir = @pdfdir@
+perl_module_fe_lib = @perl_module_fe_lib@
+perl_module_lib = @perl_module_lib@
+perl_static_fe_lib = @perl_static_fe_lib@
+perl_static_lib = @perl_static_lib@
+perlpath = @perlpath@
+pkgconfigdir = @pkgconfigdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sedpath = @sedpath@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+noinst_LIBRARIES = libfe_irc_dcc.a
+AM_CPPFLAGS = \
+ -I$(top_builddir) \
+ $(GLIB_CFLAGS) \
+ -DHELPDIR=\""$(datadir)/irssi/help"\" \
+ -DSYSCONFDIR=\""$(sysconfdir)"\"
+
+libfe_irc_dcc_a_SOURCES = \
+ fe-dcc.c \
+ fe-dcc-chat.c \
+ fe-dcc-chat-messages.c \
+ fe-dcc-get.c \
+ fe-dcc-send.c \
+ module-formats.c \
+ fe-dcc-server.c
+
+pkginc_fe_common_irc_dccdir = $(pkgincludedir)/src/fe-common/irc/dcc
+pkginc_fe_common_irc_dcc_HEADERS = \
+ module.h \
+ module-formats.h \
+ fe-dcc.h
+
+EXTRA_DIST = meson.build
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/fe-common/irc/dcc/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/fe-common/irc/dcc/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+libfe_irc_dcc.a: $(libfe_irc_dcc_a_OBJECTS) $(libfe_irc_dcc_a_DEPENDENCIES) $(EXTRA_libfe_irc_dcc_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libfe_irc_dcc.a
+ $(AM_V_AR)$(libfe_irc_dcc_a_AR) libfe_irc_dcc.a $(libfe_irc_dcc_a_OBJECTS) $(libfe_irc_dcc_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libfe_irc_dcc.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fe-dcc-chat-messages.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fe-dcc-chat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fe-dcc-get.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fe-dcc-send.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fe-dcc-server.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fe-dcc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module-formats.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-pkginc_fe_common_irc_dccHEADERS: $(pkginc_fe_common_irc_dcc_HEADERS)
+ @$(NORMAL_INSTALL)
+ @list='$(pkginc_fe_common_irc_dcc_HEADERS)'; test -n "$(pkginc_fe_common_irc_dccdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkginc_fe_common_irc_dccdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkginc_fe_common_irc_dccdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkginc_fe_common_irc_dccdir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkginc_fe_common_irc_dccdir)" || exit $$?; \
+ done
+
+uninstall-pkginc_fe_common_irc_dccHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkginc_fe_common_irc_dcc_HEADERS)'; test -n "$(pkginc_fe_common_irc_dccdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(pkginc_fe_common_irc_dccdir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(pkginc_fe_common_irc_dccdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/fe-dcc-chat-messages.Po
+ -rm -f ./$(DEPDIR)/fe-dcc-chat.Po
+ -rm -f ./$(DEPDIR)/fe-dcc-get.Po
+ -rm -f ./$(DEPDIR)/fe-dcc-send.Po
+ -rm -f ./$(DEPDIR)/fe-dcc-server.Po
+ -rm -f ./$(DEPDIR)/fe-dcc.Po
+ -rm -f ./$(DEPDIR)/module-formats.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pkginc_fe_common_irc_dccHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ./$(DEPDIR)/fe-dcc-chat-messages.Po
+ -rm -f ./$(DEPDIR)/fe-dcc-chat.Po
+ -rm -f ./$(DEPDIR)/fe-dcc-get.Po
+ -rm -f ./$(DEPDIR)/fe-dcc-send.Po
+ -rm -f ./$(DEPDIR)/fe-dcc-server.Po
+ -rm -f ./$(DEPDIR)/fe-dcc.Po
+ -rm -f ./$(DEPDIR)/module-formats.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkginc_fe_common_irc_dccHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-noinstLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-pkginc_fe_common_irc_dccHEADERS \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am \
+ uninstall-pkginc_fe_common_irc_dccHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/fe-common/irc/dcc/fe-dcc-chat-messages.c b/src/fe-common/irc/dcc/fe-dcc-chat-messages.c
new file mode 100644
index 0000000..8dd67f7
--- /dev/null
+++ b/src/fe-common/irc/dcc/fe-dcc-chat-messages.c
@@ -0,0 +1,164 @@
+/*
+ fe-dcc-chat-messages.c : irssi
+
+ Copyright (C) 2002 Timo Sirainen
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "module.h"
+#include <irssi/src/core/signals.h>
+#include <irssi/src/core/levels.h>
+
+#include <irssi/src/irc/core/irc-servers.h>
+#include <irssi/src/irc/core/irc-queries.h>
+#include <irssi/src/irc/dcc/dcc-chat.h>
+#include <irssi/src/core/ignore.h>
+
+#include <irssi/src/fe-common/irc/dcc/module-formats.h>
+#include <irssi/src/fe-common/core/printtext.h>
+
+static void sig_message_dcc_own(CHAT_DCC_REC *dcc, const char *msg)
+{
+ TEXT_DEST_REC dest;
+ QUERY_REC *query;
+ char *tag;
+
+ tag = g_strconcat("=", dcc->id, NULL);
+ query = query_find(NULL, tag);
+
+ format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
+ MSGLEVEL_DCCMSGS | MSGLEVEL_NOHILIGHT |
+ MSGLEVEL_NO_ACT, NULL);
+
+ printformat_dest(&dest, query != NULL ? IRCTXT_OWN_DCC_QUERY :
+ IRCTXT_OWN_DCC, dcc->mynick, dcc->id, msg);
+ g_free(tag);
+}
+
+static void sig_message_dcc_own_action(CHAT_DCC_REC *dcc, const char *msg)
+{
+ TEXT_DEST_REC dest;
+ QUERY_REC *query;
+ char *tag;
+
+ tag = g_strconcat("=", dcc->id, NULL);
+ query = query_find(NULL, tag);
+
+ format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
+ MSGLEVEL_DCCMSGS | MSGLEVEL_ACTIONS |
+ MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, NULL);
+
+ printformat_dest(&dest, query != NULL ? IRCTXT_OWN_DCC_ACTION_QUERY :
+ IRCTXT_OWN_DCC_ACTION, dcc->mynick, dcc->id, msg);
+ g_free(tag);
+}
+
+static void sig_message_dcc_own_ctcp(CHAT_DCC_REC *dcc, const char *cmd,
+ const char *data)
+{
+ TEXT_DEST_REC dest;
+ char *tag;
+
+ tag = g_strconcat("=", dcc->id, NULL);
+
+ format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
+ MSGLEVEL_DCC | MSGLEVEL_CTCPS |
+ MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, NULL);
+
+ printformat_dest(&dest, IRCTXT_OWN_DCC_CTCP, dcc->id, cmd, data);
+ g_free(tag);
+}
+
+static void sig_message_dcc(CHAT_DCC_REC *dcc, const char *msg)
+{
+ TEXT_DEST_REC dest;
+ QUERY_REC *query;
+ char *tag;
+ int level = MSGLEVEL_DCCMSGS;
+
+ tag = g_strconcat("=", dcc->id, NULL);
+ query = query_find(NULL, tag);
+
+ ignore_check_plus(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
+ &level, FALSE);
+
+ format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
+ level, NULL);
+
+ printformat_dest(&dest, query != NULL ? IRCTXT_DCC_MSG_QUERY :
+ IRCTXT_DCC_MSG, dcc->id, msg);
+ g_free(tag);
+}
+
+static void sig_message_dcc_action(CHAT_DCC_REC *dcc, const char *msg)
+{
+ TEXT_DEST_REC dest;
+ QUERY_REC *query;
+ char *tag;
+ int level = MSGLEVEL_DCCMSGS | MSGLEVEL_ACTIONS;
+
+ tag = g_strconcat("=", dcc->id, NULL);
+ query = query_find(NULL, tag);
+
+ ignore_check_plus(SERVER(dcc->server), tag, dcc->addrstr, NULL, msg,
+ &level, FALSE);
+
+ format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
+ level, NULL);
+
+ printformat_dest(&dest, query != NULL ? IRCTXT_ACTION_DCC_QUERY :
+ IRCTXT_ACTION_DCC, dcc->id, msg);
+ g_free(tag);
+}
+
+static void sig_message_dcc_ctcp(CHAT_DCC_REC *dcc, const char *cmd,
+ const char *data)
+{
+ TEXT_DEST_REC dest;
+ char *tag;
+ int level = MSGLEVEL_DCCMSGS | MSGLEVEL_CTCPS;
+
+ tag = g_strconcat("=", dcc->id, NULL);
+
+ ignore_check_plus(SERVER(dcc->server), tag, dcc->addrstr, NULL, cmd,
+ &level, FALSE);
+
+ format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag,
+ level, NULL);
+
+ printformat_dest(&dest, IRCTXT_DCC_CTCP, dcc->id, cmd, data);
+ g_free(tag);
+}
+
+void fe_dcc_chat_messages_init(void)
+{
+ signal_add("message dcc own", (SIGNAL_FUNC) sig_message_dcc_own);
+ signal_add("message dcc own_action", (SIGNAL_FUNC) sig_message_dcc_own_action);
+ signal_add("message dcc own_ctcp", (SIGNAL_FUNC) sig_message_dcc_own_ctcp);
+ signal_add("message dcc", (SIGNAL_FUNC) sig_message_dcc);
+ signal_add("message dcc action", (SIGNAL_FUNC) sig_message_dcc_action);
+ signal_add("message dcc ctcp", (SIGNAL_FUNC) sig_message_dcc_ctcp);
+}
+
+void fe_dcc_chat_messages_deinit(void)
+{
+ signal_remove("message dcc own", (SIGNAL_FUNC) sig_message_dcc_own);
+ signal_remove("message dcc own_action", (SIGNAL_FUNC) sig_message_dcc_own_action);
+ signal_remove("message dcc own_ctcp", (SIGNAL_FUNC) sig_message_dcc_own_ctcp);
+ signal_remove("message dcc", (SIGNAL_FUNC) sig_message_dcc);
+ signal_remove("message dcc action", (SIGNAL_FUNC) sig_message_dcc_action);
+ signal_remove("message dcc ctcp", (SIGNAL_FUNC) sig_message_dcc_ctcp);
+}
diff --git a/src/fe-common/irc/dcc/fe-dcc-chat.c b/src/fe-common/irc/dcc/fe-dcc-chat.c
new file mode 100644
index 0000000..4099e2f
--- /dev/null
+++ b/src/fe-common/irc/dcc/fe-dcc-chat.c
@@ -0,0 +1,385 @@
+/*
+ fe-dcc-chat.c : irssi
+
+ Copyright (C) 1999-2002 Timo Sirainen
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "module.h"
+#include <irssi/src/core/signals.h>
+#include <irssi/src/core/commands.h>
+#include <irssi/src/core/levels.h>
+#include <irssi/src/core/settings.h>
+#include <irssi/src/core/misc.h>
+
+#include <irssi/src/irc/core/irc.h>
+#include <irssi/src/irc/core/irc-servers.h>
+#include <irssi/src/irc/core/irc-queries.h>
+#include <irssi/src/irc/dcc/dcc-chat.h>
+
+#include <irssi/src/fe-common/irc/dcc/module-formats.h>
+#include <irssi/src/fe-common/core/printtext.h>
+#include <irssi/src/fe-common/core/fe-messages.h>
+
+#include <irssi/src/fe-common/core/chat-completion.h>
+
+void fe_dcc_chat_messages_init(void);
+void fe_dcc_chat_messages_deinit(void);
+
+static void dcc_request(CHAT_DCC_REC *dcc)
+{
+ if (!IS_DCC_CHAT(dcc)) return;
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ server_ischannel(SERVER(dcc->server), dcc->target) ? IRCTXT_DCC_CHAT_CHANNEL :
+ IRCTXT_DCC_CHAT, dcc->id, dcc->addrstr,
+ dcc->port, dcc->target);
+}
+
+static void dcc_connected(CHAT_DCC_REC *dcc)
+{
+ char *sender;
+
+ if (!IS_DCC_CHAT(dcc)) return;
+
+ sender = g_strconcat("=", dcc->id, NULL);
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_CHAT_CONNECTED,
+ dcc->id, dcc->addrstr, dcc->port);
+
+ if (query_find(NULL, sender) == NULL) {
+ int level = settings_get_level("autocreate_query_level");
+ int autocreate_dccquery = (level & MSGLEVEL_DCCMSGS) != 0;
+
+ if (!autocreate_dccquery)
+ completion_last_message_add(sender);
+ else
+ irc_query_create(dcc->servertag, sender, TRUE);
+ }
+ g_free(sender);
+}
+
+static void dcc_closed(CHAT_DCC_REC *dcc)
+{
+ char *sender;
+
+ if (!IS_DCC_CHAT(dcc)) return;
+
+ sender = g_strconcat("=", dcc->id, NULL);
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_CHAT_DISCONNECTED, dcc->id);
+ g_free(sender);
+}
+
+static void dcc_chat_msg(CHAT_DCC_REC *dcc, const char *msg)
+{
+ QUERY_REC *query;
+ char *sender, *freemsg;
+
+ g_return_if_fail(IS_DCC_CHAT(dcc));
+ g_return_if_fail(msg != NULL);
+
+ sender = g_strconcat("=", dcc->id, NULL);
+ query = query_find(NULL, sender);
+
+ if (settings_get_bool("emphasis"))
+ msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, msg);
+ else
+ freemsg = NULL;
+
+ if (query == NULL)
+ completion_last_message_add(sender);
+ signal_emit("message dcc", 2, dcc, msg);
+
+ g_free_not_null(freemsg);
+ g_free(sender);
+}
+
+static void dcc_chat_action(CHAT_DCC_REC *dcc, const char *msg)
+{
+ char *sender;
+
+ g_return_if_fail(IS_DCC_CHAT(dcc));
+ g_return_if_fail(msg != NULL);
+
+ sender = g_strconcat("=", dcc->id, NULL);
+ if (query_find(NULL, sender) == NULL)
+ completion_last_message_add(sender);
+
+ signal_emit("message dcc action", 2, dcc, msg);
+ g_free(sender);
+}
+
+static void dcc_chat_ctcp(CHAT_DCC_REC *dcc, const char *cmd, const char *data)
+{
+ g_return_if_fail(IS_DCC_CHAT(dcc));
+
+ signal_emit("message dcc ctcp", 3, dcc, cmd, data);
+}
+
+static void dcc_error_ctcp(const char *type, const char *data,
+ const char *nick, const char *addr,
+ const char *target)
+{
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_INVALID_CTCP, type, nick, addr, target);
+}
+
+static void dcc_unknown_ctcp(IRC_SERVER_REC *server, const char *data,
+ const char *nick, const char *addr,
+ const char *target, CHAT_DCC_REC *chat)
+{
+ char *type, *args;
+ void *free_arg;
+
+ g_return_if_fail(data != NULL);
+
+ if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST,
+ &type, &args))
+ return;
+
+ printformat(NULL, NULL, MSGLEVEL_DCC, IRCTXT_DCC_UNKNOWN_CTCP,
+ type, nick, args);
+ cmd_params_free(free_arg);
+}
+
+static void dcc_unknown_reply(IRC_SERVER_REC *server, const char *data,
+ const char *nick)
+{
+ char *type, *args;
+ void *free_arg;
+
+ g_return_if_fail(data != NULL);
+
+ if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST,
+ &type, &args))
+ return;
+
+ printformat(NULL, NULL, MSGLEVEL_DCC, IRCTXT_DCC_UNKNOWN_REPLY,
+ type, nick, args);
+ cmd_params_free(free_arg);
+}
+
+static void sig_dcc_destroyed(CHAT_DCC_REC *dcc)
+{
+ QUERY_REC *query;
+ char *nick;
+
+ if (!IS_DCC_CHAT(dcc)) return;
+
+ nick = g_strconcat("=", dcc->id, NULL);
+ query = query_find(NULL, nick);
+ if (query != NULL) {
+ /* DCC chat closed, close the query with it. */
+ if (dcc->connection_lost) query->unwanted = TRUE;
+ query_destroy(query);
+ } else {
+ /* remove nick from msg completion
+ since it won't work anymore */
+ completion_last_message_remove(nick);
+ }
+
+ g_free(nick);
+}
+
+static void sig_query_destroyed(QUERY_REC *query)
+{
+ CHAT_DCC_REC *dcc;
+
+ if (*query->name != '=')
+ return;
+
+ dcc = dcc_chat_find_id(query->name+1);
+ if (dcc != NULL && !dcc->destroyed) {
+ /* DCC query window closed, close the dcc chat too. */
+ dcc_close(DCC(dcc));
+ }
+}
+
+static void dcc_error_close_not_found(const char *type, const char *nick,
+ const char *fname)
+{
+ g_return_if_fail(type != NULL);
+ g_return_if_fail(nick != NULL);
+ if (g_ascii_strcasecmp(type, "CHAT") != 0) return;
+
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_CHAT_NOT_FOUND, nick);
+}
+
+static void sig_dcc_list_print(CHAT_DCC_REC *dcc)
+{
+ if (!IS_DCC_CHAT(dcc)) return;
+
+ printformat(NULL, NULL, MSGLEVEL_DCC, IRCTXT_DCC_LIST_LINE_CHAT,
+ dcc->id, "CHAT");
+}
+
+static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
+{
+ CHAT_DCC_REC *dcc;
+ GHashTable *optlist;
+ char *text, *target;
+ void *free_arg;
+
+ g_return_if_fail(data != NULL);
+
+ if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_UNKNOWN_OPTIONS |
+ PARAM_FLAG_OPTIONS | PARAM_FLAG_GETREST, "msg",
+ &optlist, &target, &text))
+ return;
+
+ /* handle only DCC messages */
+ if (g_strcmp0(target, "*") == 0)
+ dcc = item_get_dcc(item);
+ else if (*target == '=')
+ dcc = dcc_chat_find_id(target+1);
+ else
+ dcc = NULL;
+
+ if (dcc == NULL && *target == '=') {
+ printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
+ IRCTXT_DCC_CHAT_NOT_FOUND, target+1);
+ } else if (dcc != NULL) {
+ if (query_find(NULL, target) == NULL)
+ completion_last_message_add(target);
+
+ signal_emit("message dcc own", 2, dcc, text);
+ }
+
+ cmd_params_free(free_arg);
+}
+
+static void cmd_me(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
+{
+ CHAT_DCC_REC *dcc;
+
+ dcc = item_get_dcc(item);
+ if (dcc != NULL)
+ signal_emit("message dcc own_action", 2, dcc, data);
+}
+
+static void cmd_action(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
+{
+ CHAT_DCC_REC *dcc;
+ char *target, *text;
+ void *free_arg;
+
+ g_return_if_fail(data != NULL);
+
+ if (*data != '=') {
+ /* handle only DCC actions */
+ return;
+ }
+
+ if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST,
+ &target, &text))
+ return;
+ if (*target == '\0' || *text == '\0')
+ cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
+
+ dcc = dcc_chat_find_id(target+1);
+ if (dcc == NULL || dcc->sendbuf == NULL) {
+ printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
+ IRCTXT_DCC_CHAT_NOT_FOUND, target+1);
+ } else {
+ if (query_find(NULL, target) == NULL)
+ completion_last_message_add(target);
+
+ signal_emit("message dcc own_action", 2, dcc, text);
+ }
+ cmd_params_free(free_arg);
+}
+
+static void cmd_ctcp(const char *data, SERVER_REC *server)
+{
+ CHAT_DCC_REC *dcc;
+ char *target, *ctcpcmd, *ctcpdata;
+ void *free_arg;
+
+ g_return_if_fail(data != NULL);
+ if (server == NULL || !server->connected)
+ cmd_return_error(CMDERR_NOT_CONNECTED);
+
+ if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST,
+ &target, &ctcpcmd, &ctcpdata))
+ return;
+ if (*target == '\0' || *ctcpcmd == '\0')
+ cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
+
+ if (*target != '=') {
+ /* handle only DCC CTCPs */
+ cmd_params_free(free_arg);
+ return;
+ }
+
+ dcc = dcc_chat_find_id(target+1);
+ if (dcc == NULL || dcc->sendbuf == NULL) {
+ printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
+ IRCTXT_DCC_CHAT_NOT_FOUND, target+1);
+ } else {
+ ascii_strup(ctcpcmd);
+ signal_emit("message dcc own_ctcp", 3, dcc, ctcpcmd, ctcpdata);
+ }
+
+ cmd_params_free(free_arg);
+}
+
+void fe_dcc_chat_init(void)
+{
+ fe_dcc_chat_messages_init();
+
+ signal_add("dcc request", (SIGNAL_FUNC) dcc_request);
+ signal_add("dcc connected", (SIGNAL_FUNC) dcc_connected);
+ signal_add("dcc closed", (SIGNAL_FUNC) dcc_closed);
+ signal_add("dcc chat message", (SIGNAL_FUNC) dcc_chat_msg);
+ signal_add("dcc ctcp action", (SIGNAL_FUNC) dcc_chat_action);
+ signal_add("default dcc ctcp", (SIGNAL_FUNC) dcc_chat_ctcp);
+ signal_add("dcc error ctcp", (SIGNAL_FUNC) dcc_error_ctcp);
+ signal_add("default ctcp msg dcc", (SIGNAL_FUNC) dcc_unknown_ctcp);
+ signal_add("default ctcp reply dcc", (SIGNAL_FUNC) dcc_unknown_reply);
+ signal_add("dcc destroyed", (SIGNAL_FUNC) sig_dcc_destroyed);
+ signal_add("query destroyed", (SIGNAL_FUNC) sig_query_destroyed);
+ signal_add("dcc list print", (SIGNAL_FUNC) sig_dcc_list_print);
+ command_bind("msg", NULL, (SIGNAL_FUNC) cmd_msg);
+ command_bind("me", NULL, (SIGNAL_FUNC) cmd_me);
+ command_bind("action", NULL, (SIGNAL_FUNC) cmd_action);
+ command_bind("ctcp", NULL, (SIGNAL_FUNC) cmd_ctcp);
+ signal_add("dcc error close not found", (SIGNAL_FUNC) dcc_error_close_not_found);
+}
+
+void fe_dcc_chat_deinit(void)
+{
+ fe_dcc_chat_messages_deinit();
+
+ signal_remove("dcc request", (SIGNAL_FUNC) dcc_request);
+ signal_remove("dcc connected", (SIGNAL_FUNC) dcc_connected);
+ signal_remove("dcc closed", (SIGNAL_FUNC) dcc_closed);
+ signal_remove("dcc chat message", (SIGNAL_FUNC) dcc_chat_msg);
+ signal_remove("dcc ctcp action", (SIGNAL_FUNC) dcc_chat_action);
+ signal_remove("default dcc ctcp", (SIGNAL_FUNC) dcc_chat_ctcp);
+ signal_remove("dcc error ctcp", (SIGNAL_FUNC) dcc_error_ctcp);
+ signal_remove("default ctcp msg dcc", (SIGNAL_FUNC) dcc_unknown_ctcp);
+ signal_remove("default ctcp reply dcc", (SIGNAL_FUNC) dcc_unknown_reply);
+ signal_remove("dcc destroyed", (SIGNAL_FUNC) sig_dcc_destroyed);
+ signal_remove("query destroyed", (SIGNAL_FUNC) sig_query_destroyed);
+ signal_remove("dcc list print", (SIGNAL_FUNC) sig_dcc_list_print);
+ command_unbind("msg", (SIGNAL_FUNC) cmd_msg);
+ command_unbind("me", (SIGNAL_FUNC) cmd_me);
+ command_unbind("action", (SIGNAL_FUNC) cmd_action);
+ command_unbind("ctcp", (SIGNAL_FUNC) cmd_ctcp);
+ signal_remove("dcc error close not found", (SIGNAL_FUNC) dcc_error_close_not_found);
+}
diff --git a/src/fe-common/irc/dcc/fe-dcc-get.c b/src/fe-common/irc/dcc/fe-dcc-get.c
new file mode 100644
index 0000000..e75640b
--- /dev/null
+++ b/src/fe-common/irc/dcc/fe-dcc-get.c
@@ -0,0 +1,150 @@
+/*
+ fe-dcc-get.c : irssi
+
+ Copyright (C) 1999-2001 Timo Sirainen
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "module.h"
+#include <irssi/src/core/signals.h>
+#include <irssi/src/core/levels.h>
+#include <irssi/src/core/servers.h>
+
+#include <irssi/src/irc/core/irc.h>
+#include <irssi/src/irc/dcc/dcc-file.h>
+#include <irssi/src/irc/dcc/dcc-get.h>
+
+#include <irssi/src/fe-common/irc/dcc/module-formats.h>
+#include <irssi/src/fe-common/core/printtext.h>
+
+#include <irssi/src/fe-common/irc/dcc/fe-dcc.h>
+
+static void dcc_request(GET_DCC_REC *dcc)
+{
+ char *sizestr;
+
+ if (!IS_DCC_GET(dcc)) return;
+
+ sizestr = dcc_get_size_str(dcc->size);
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ server_ischannel(SERVER(dcc->server), dcc->target) ? IRCTXT_DCC_SEND_CHANNEL :
+ IRCTXT_DCC_SEND, dcc->nick, dcc->addrstr,
+ dcc->port, dcc->arg, sizestr, dcc->target);
+
+ g_free(sizestr);
+}
+
+static void dcc_connected(GET_DCC_REC *dcc)
+{
+ if (!IS_DCC_GET(dcc)) return;
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC, IRCTXT_DCC_GET_CONNECTED,
+ dcc->arg, dcc->nick, dcc->addrstr, dcc->port);
+}
+
+static void dcc_closed(GET_DCC_REC *dcc)
+{
+ char *sizestr, timestr[20];
+ double kbs;
+ time_t secs;
+
+ if (!IS_DCC_GET(dcc)) return;
+
+ secs = dcc->starttime == 0 ? -1 : time(NULL)-dcc->starttime;
+ kbs = (double) (dcc->transfd-dcc->skipped) /
+ (secs == 0 ? 1 : secs) / 1024.0;
+
+ sizestr = dcc_get_size_str(dcc->transfd);
+ g_snprintf(timestr, sizeof(timestr), "%02d:%02d:%02d",
+ (int)(secs/3600), (int)((secs/60)%60), (int)(secs%60));
+
+ if (secs == -1) {
+ /* aborted */
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_GET_ABORTED, dcc->arg, dcc->nick);
+ } else {
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_GET_COMPLETE, dcc->arg, sizestr,
+ dcc->nick, timestr, kbs);
+ }
+
+ g_free(sizestr);
+}
+
+static void dcc_error_file_create(GET_DCC_REC *dcc, const char *fname,
+ const char *error)
+{
+ printformat(NULL, NULL, MSGLEVEL_DCC, IRCTXT_DCC_CANT_CREATE,
+ fname, error);
+}
+
+
+static void dcc_error_get_not_found(const char *nick)
+{
+ g_return_if_fail(nick != NULL);
+
+ printformat(NULL, NULL, MSGLEVEL_DCC, IRCTXT_DCC_GET_NOT_FOUND, nick);
+}
+
+static void dcc_error_close_not_found(const char *type, const char *nick,
+ const char *fname)
+{
+ g_return_if_fail(type != NULL);
+ g_return_if_fail(nick != NULL);
+ g_return_if_fail(fname != NULL);
+ if (g_ascii_strcasecmp(type, "GET") != 0) return;
+
+ if (fname == NULL || *fname == '\0') fname = "(ANY)";
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_GET_NOT_FOUND, nick, fname);
+}
+
+static void dcc_error_write(GET_DCC_REC *dcc, const char *error)
+{
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_GET_WRITE_ERROR, dcc->file, error);
+}
+
+static void sig_dcc_list_print(GET_DCC_REC *dcc)
+{
+ if (IS_DCC_GET(dcc))
+ dcc_list_print_file((FILE_DCC_REC *) dcc);
+}
+
+void fe_dcc_get_init(void)
+{
+ signal_add("dcc request", (SIGNAL_FUNC) dcc_request);
+ signal_add("dcc connected", (SIGNAL_FUNC) dcc_connected);
+ signal_add("dcc closed", (SIGNAL_FUNC) dcc_closed);
+ signal_add("dcc error file create", (SIGNAL_FUNC) dcc_error_file_create);
+ signal_add("dcc error get not found", (SIGNAL_FUNC) dcc_error_get_not_found);
+ signal_add("dcc error close not found", (SIGNAL_FUNC) dcc_error_close_not_found);
+ signal_add("dcc error write", (SIGNAL_FUNC) dcc_error_write);
+ signal_add("dcc list print", (SIGNAL_FUNC) sig_dcc_list_print);
+}
+
+void fe_dcc_get_deinit(void)
+{
+ signal_remove("dcc request", (SIGNAL_FUNC) dcc_request);
+ signal_remove("dcc connected", (SIGNAL_FUNC) dcc_connected);
+ signal_remove("dcc closed", (SIGNAL_FUNC) dcc_closed);
+ signal_remove("dcc error file create", (SIGNAL_FUNC) dcc_error_file_create);
+ signal_remove("dcc error get not found", (SIGNAL_FUNC) dcc_error_get_not_found);
+ signal_remove("dcc error close not found", (SIGNAL_FUNC) dcc_error_close_not_found);
+ signal_remove("dcc error write", (SIGNAL_FUNC) dcc_error_write);
+ signal_remove("dcc list print", (SIGNAL_FUNC) sig_dcc_list_print);
+}
diff --git a/src/fe-common/irc/dcc/fe-dcc-send.c b/src/fe-common/irc/dcc/fe-dcc-send.c
new file mode 100644
index 0000000..cf9b634
--- /dev/null
+++ b/src/fe-common/irc/dcc/fe-dcc-send.c
@@ -0,0 +1,186 @@
+/*
+ fe-dcc-send.c : irssi
+
+ Copyright (C) 1999-2001 Timo Sirainen
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "module.h"
+#include <irssi/src/core/signals.h>
+#include <irssi/src/core/levels.h>
+#include <irssi/src/core/misc.h>
+#include <irssi/src/core/settings.h>
+
+#include <irssi/src/irc/dcc/dcc-file.h>
+#include <irssi/src/irc/dcc/dcc-send.h>
+#include <irssi/src/irc/dcc/dcc-queue.h>
+
+#include <irssi/src/fe-common/irc/dcc/module-formats.h>
+#include <irssi/src/fe-common/core/printtext.h>
+#include <irssi/src/fe-common/core/completion.h>
+
+#include <irssi/src/fe-common/irc/dcc/fe-dcc.h>
+
+static void dcc_connected(SEND_DCC_REC *dcc)
+{
+ if (!IS_DCC_SEND(dcc)) return;
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_SEND_CONNECTED,
+ dcc->arg, dcc->nick, dcc->addrstr, dcc->port);
+}
+
+static void dcc_closed(SEND_DCC_REC *dcc)
+{
+ char *sizestr, timestr[20];
+ double kbs;
+ time_t secs;
+
+ if (!IS_DCC_SEND(dcc)) return;
+
+ secs = dcc->starttime == 0 ? -1 : time(NULL)-dcc->starttime;
+ kbs = (double) (dcc->transfd-dcc->skipped) /
+ (secs == 0 ? 1 : secs) / 1024.0;
+
+ if (secs == -1) {
+ /* aborted */
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_SEND_ABORTED,
+ dcc->arg, dcc->nick);
+ } else {
+ sizestr = dcc_get_size_str(dcc->transfd);
+ g_snprintf(timestr, sizeof(timestr), "%02d:%02d:%02d",
+ (int)(secs/3600), (int)((secs/60)%60),
+ (int)(secs%60));
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_SEND_COMPLETE,
+ dcc->arg, sizestr, dcc->nick, timestr, kbs);
+
+ g_free(sizestr);
+ }
+}
+
+static void dcc_error_file_open(const char *nick, const char *fname,
+ void *error)
+{
+ g_return_if_fail(nick != NULL);
+ g_return_if_fail(fname != NULL);
+
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_SEND_FILE_OPEN_ERROR, fname,
+ g_strerror(GPOINTER_TO_INT(error)));
+}
+
+static void dcc_error_send_exists(const char *nick, const char *fname)
+{
+ g_return_if_fail(nick != NULL);
+ g_return_if_fail(fname != NULL);
+
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_SEND_EXISTS, fname, nick);
+}
+
+static void dcc_error_send_no_route(const char *nick, const char *fname)
+{
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_SEND_NO_ROUTE, nick, fname);
+}
+
+static void dcc_error_close_not_found(const char *type, const char *nick,
+ const char *fname)
+{
+ g_return_if_fail(type != NULL);
+ g_return_if_fail(nick != NULL);
+ g_return_if_fail(fname != NULL);
+ if (g_ascii_strcasecmp(type, "SEND") != 0) return;
+
+ if (fname == NULL || *fname == '\0') fname = "(ANY)";
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_SEND_NOT_FOUND, nick, fname);
+}
+
+static void sig_dcc_send_complete(GList **list, WINDOW_REC *window,
+ const char *word, const char *line,
+ int *want_space)
+{
+ char *path;
+
+ g_return_if_fail(list != NULL);
+ g_return_if_fail(word != NULL);
+ g_return_if_fail(line != NULL);
+
+ if (*line == '\0' || strchr(line, ' ') != NULL)
+ return;
+
+ /* completing filename parameter for /DCC SEND */
+ path = convert_home(settings_get_str("dcc_upload_path"));
+ if (*path == '\0') {
+ /* use the default path */
+ g_free_and_null(path);
+ }
+
+ *list = filename_complete(word, path);
+
+ if (*list != NULL) {
+ *want_space = FALSE;
+ signal_stop();
+ }
+}
+
+static void sig_dcc_list_print(SEND_DCC_REC *dcc)
+{
+ GSList *queue;
+
+ if (!IS_DCC_SEND(dcc))
+ return;
+
+ dcc_list_print_file((FILE_DCC_REC *) dcc);
+
+ queue = dcc_queue_get_queue(dcc->queue);
+ for (; queue != NULL; queue = queue->next) {
+ DCC_QUEUE_REC *rec = queue->data;
+
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_LIST_LINE_QUEUED_SEND, rec->nick,
+ rec->servertag == NULL ? "" : rec->servertag,
+ rec->file);
+ }
+}
+
+void fe_dcc_send_init(void)
+{
+ signal_add("dcc connected", (SIGNAL_FUNC) dcc_connected);
+ signal_add("dcc closed", (SIGNAL_FUNC) dcc_closed);
+ signal_add("dcc error file open", (SIGNAL_FUNC) dcc_error_file_open);
+ signal_add("dcc error send exists", (SIGNAL_FUNC) dcc_error_send_exists);
+ signal_add("dcc error send no route", (SIGNAL_FUNC) dcc_error_send_no_route);
+ signal_add("dcc error close not found", (SIGNAL_FUNC) dcc_error_close_not_found);
+ signal_add("complete command dcc send", (SIGNAL_FUNC) sig_dcc_send_complete);
+ signal_add("dcc list print", (SIGNAL_FUNC) sig_dcc_list_print);
+}
+
+void fe_dcc_send_deinit(void)
+{
+ signal_remove("dcc connected", (SIGNAL_FUNC) dcc_connected);
+ signal_remove("dcc closed", (SIGNAL_FUNC) dcc_closed);
+ signal_remove("dcc error file open", (SIGNAL_FUNC) dcc_error_file_open);
+ signal_remove("dcc error send exists", (SIGNAL_FUNC) dcc_error_send_exists);
+ signal_remove("dcc error send no route", (SIGNAL_FUNC) dcc_error_send_no_route);
+ signal_remove("dcc error close not found", (SIGNAL_FUNC) dcc_error_close_not_found);
+ signal_remove("complete command dcc send", (SIGNAL_FUNC) sig_dcc_send_complete);
+ signal_remove("dcc list print", (SIGNAL_FUNC) sig_dcc_list_print);
+}
diff --git a/src/fe-common/irc/dcc/fe-dcc-server.c b/src/fe-common/irc/dcc/fe-dcc-server.c
new file mode 100644
index 0000000..eaab963
--- /dev/null
+++ b/src/fe-common/irc/dcc/fe-dcc-server.c
@@ -0,0 +1,83 @@
+/*
+ fe-dcc-server.c : irssi
+
+ Copyright (C) 2003 Mark Trumbull
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "module.h"
+#include <irssi/src/core/signals.h>
+#include <irssi/src/core/commands.h>
+#include <irssi/src/core/network.h>
+#include <irssi/src/core/levels.h>
+
+#include <irssi/src/irc/dcc/dcc-server.h>
+
+#include <irssi/src/fe-common/irc/dcc/module-formats.h>
+#include <irssi/src/fe-common/core/printtext.h>
+#include <irssi/src/fe-common/core/themes.h>
+
+static void dcc_server_started(SERVER_DCC_REC *dcc)
+{
+ if (!IS_DCC_SERVER(dcc)) {
+ return;
+ }
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_SERVER_STARTED, dcc->port);
+}
+
+static void dcc_closed(SERVER_DCC_REC *dcc)
+{
+ /* We don't want to print a msg if its just starting a chat/get */
+ /* and getting rid of the leftover SERVER_DCC_REC */
+ if (!IS_DCC_SERVER(dcc) || dcc->connection_established) {
+ return;
+ }
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_SERVER_CLOSED, dcc->port);
+}
+
+static void sig_dcc_list_print(SERVER_DCC_REC *dcc)
+{
+ /* We don't want to print a msg if its just starting a chat/get */
+ /* and getting rid of the leftover SERVER_DCC_REC */
+ if (!IS_DCC_SERVER(dcc) || dcc->connection_established) {
+ return;
+ }
+
+ /* SERVER: Port(59) - Send(on) - Chat(on) - Fserve(on) */
+ printformat(NULL, NULL, MSGLEVEL_DCC, IRCTXT_DCC_LIST_LINE_SERVER,
+ "SERVER", dcc->port, dcc->accept_send ? "on" : "off",
+ dcc->accept_chat ? "on" : "off",
+ dcc->accept_fserve ? "on" : "off");
+}
+
+void fe_dcc_server_init(void)
+{
+ signal_add("dcc server started", (SIGNAL_FUNC) dcc_server_started);
+ signal_add("dcc closed", (SIGNAL_FUNC) dcc_closed);
+ signal_add("dcc list print", (SIGNAL_FUNC) sig_dcc_list_print);
+}
+
+void fe_dcc_server_deinit(void)
+{
+ signal_remove("dcc server started", (SIGNAL_FUNC) dcc_server_started);
+ signal_remove("dcc closed", (SIGNAL_FUNC) dcc_closed);
+ signal_remove("dcc list print", (SIGNAL_FUNC) sig_dcc_list_print);
+}
+
diff --git a/src/fe-common/irc/dcc/fe-dcc.c b/src/fe-common/irc/dcc/fe-dcc.c
new file mode 100644
index 0000000..f5fb3b2
--- /dev/null
+++ b/src/fe-common/irc/dcc/fe-dcc.c
@@ -0,0 +1,195 @@
+/*
+ fe-dcc.c : irssi
+
+ Copyright (C) 1999-2001 Timo Sirainen
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "module.h"
+#include <irssi/src/core/signals.h>
+#include <irssi/src/core/commands.h>
+#include <irssi/src/core/network.h>
+#include <irssi/src/core/levels.h>
+#include <irssi/src/core/settings.h>
+
+#include <irssi/src/irc/dcc/dcc-chat.h>
+#include <irssi/src/irc/dcc/dcc-file.h>
+#include <irssi/src/irc/dcc/dcc-get.h>
+#include <irssi/src/irc/dcc/dcc-send.h>
+
+#include <irssi/src/fe-common/irc/dcc/module-formats.h>
+#include <irssi/src/fe-common/core/printtext.h>
+#include <irssi/src/fe-common/core/themes.h>
+
+void fe_dcc_chat_init(void);
+void fe_dcc_chat_deinit(void);
+
+void fe_dcc_get_init(void);
+void fe_dcc_get_deinit(void);
+
+void fe_dcc_send_init(void);
+void fe_dcc_send_deinit(void);
+
+void fe_dcc_server_init(void);
+void fe_dcc_server_deinit(void);
+
+char *dcc_get_size_str(uoff_t size)
+{
+ if (size < 1024)
+ return g_strdup_printf("%"PRIuUOFF_T"B", size);
+ if (size < 1024*1024)
+ return g_strdup_printf("%"PRIuUOFF_T"kB", (size+1023) / 1024);
+ return g_strdup_printf("%"PRIuUOFF_T"MB", size / (1024*1024));
+}
+
+static void dcc_request(DCC_REC *dcc)
+{
+ char *service;
+
+ g_return_if_fail(dcc != NULL);
+
+ if (dcc->port < 1024) {
+ /* warn about connecting to lowports */
+ service = net_getservbyport(dcc->port);
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_LOWPORT, dcc->port,
+ service != NULL ? service : "unknown");
+ }
+}
+
+static void dcc_rejected(DCC_REC *dcc)
+{
+ g_return_if_fail(dcc != NULL);
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC, IRCTXT_DCC_CLOSE,
+ dcc_type2str(dcc->type), dcc->nick, dcc->arg);
+}
+
+static void dcc_request_send(DCC_REC *dcc)
+{
+ g_return_if_fail(dcc != NULL);
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC, IRCTXT_DCC_REQUEST_SEND,
+ dcc_type2str(dcc->type), dcc->nick, dcc->arg);
+}
+
+static void dcc_error_connect(DCC_REC *dcc)
+{
+ g_return_if_fail(dcc != NULL);
+
+ printformat(dcc->server, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_CONNECT_ERROR, dcc->addrstr, dcc->port);
+}
+
+static void dcc_error_unknown_type(const char *type)
+{
+ g_return_if_fail(type != NULL);
+
+ printformat(NULL, NULL, MSGLEVEL_DCC, IRCTXT_DCC_UNKNOWN_TYPE, type);
+}
+
+void dcc_list_print_file(FILE_DCC_REC *dcc)
+{
+ time_t going, eta;
+ char *transfd_str, *size_str, etastr[20];
+ uoff_t bps;
+
+ going = time(NULL) - dcc->starttime;
+ if (going <= 0) going = 1;
+
+ transfd_str = dcc_get_size_str(dcc->transfd);
+ size_str = dcc_get_size_str(dcc->size);
+
+ bps = (dcc->transfd-dcc->skipped) / going;
+ if (bps == 0) {
+ strcpy(etastr, "(stalled)");
+ } else {
+ eta = (dcc->size - dcc->transfd) / bps;
+ g_snprintf(etastr, sizeof(etastr), "%02d:%02d:%02d",
+ (int)(eta/3600), (int)((eta/60)%60), (int)(eta%60));
+ }
+
+ printformat(NULL, NULL, MSGLEVEL_DCC,
+ IRCTXT_DCC_LIST_LINE_FILE,
+ dcc->nick, dcc_type2str(dcc->type),
+ transfd_str, size_str,
+ dcc->size == 0 ? 0 : (int)((double)dcc->transfd/(double)dcc->size*100.0),
+ (double)bps/1024.0, dcc->arg, etastr);
+
+ g_free(transfd_str);
+ g_free(size_str);
+}
+
+static void cmd_dcc_list(const char *data)
+{
+ GSList *tmp;
+
+ g_return_if_fail(data != NULL);
+
+ printformat(NULL, NULL, MSGLEVEL_DCC, IRCTXT_DCC_LIST_HEADER);
+ for (tmp = dcc_conns; tmp != NULL; tmp = tmp->next)
+ signal_emit("dcc list print", 1, tmp->data);
+ printformat(NULL, NULL, MSGLEVEL_DCC, IRCTXT_DCC_LIST_FOOTER);
+}
+
+static void cmd_dcc(const char *data)
+{
+ if (*data == '\0') {
+ cmd_dcc_list(data);
+ signal_stop();
+ }
+}
+
+void fe_irc_dcc_init(void)
+{
+ fe_dcc_chat_init();
+ fe_dcc_get_init();
+ fe_dcc_send_init();
+ fe_dcc_server_init();
+
+ signal_add("dcc request", (SIGNAL_FUNC) dcc_request);
+ signal_add("dcc rejected", (SIGNAL_FUNC) dcc_rejected);
+ signal_add("dcc request send", (SIGNAL_FUNC) dcc_request_send);
+ signal_add("dcc error connect", (SIGNAL_FUNC) dcc_error_connect);
+ signal_add("dcc error unknown type", (SIGNAL_FUNC) dcc_error_unknown_type);
+ command_bind("dcc", NULL, (SIGNAL_FUNC) cmd_dcc);
+ command_bind("dcc list", NULL, (SIGNAL_FUNC) cmd_dcc_list);
+
+ theme_register(fecommon_irc_dcc_formats);
+ settings_check();
+ module_register("dcc", "fe-irc");
+}
+
+void fe_irc_dcc_deinit(void)
+{
+ fe_dcc_chat_deinit();
+ fe_dcc_get_deinit();
+ fe_dcc_send_deinit();
+ fe_dcc_server_deinit();
+
+ theme_unregister();
+
+ signal_remove("dcc request", (SIGNAL_FUNC) dcc_request);
+ signal_remove("dcc rejected", (SIGNAL_FUNC) dcc_rejected);
+ signal_remove("dcc request send", (SIGNAL_FUNC) dcc_request_send);
+ signal_remove("dcc error connect", (SIGNAL_FUNC) dcc_error_connect);
+ signal_remove("dcc error unknown type", (SIGNAL_FUNC) dcc_error_unknown_type);
+ command_unbind("dcc", (SIGNAL_FUNC) cmd_dcc);
+ command_unbind("dcc list", (SIGNAL_FUNC) cmd_dcc_list);
+}
+
+MODULE_ABICHECK(fe_irc_dcc)
diff --git a/src/fe-common/irc/dcc/fe-dcc.h b/src/fe-common/irc/dcc/fe-dcc.h
new file mode 100644
index 0000000..4d79296
--- /dev/null
+++ b/src/fe-common/irc/dcc/fe-dcc.h
@@ -0,0 +1,7 @@
+#ifndef IRSSI_FE_COMMON_IRC_DCC_FE_DCC_H
+#define IRSSI_FE_COMMON_IRC_DCC_FE_DCC_H
+
+char *dcc_get_size_str(uoff_t size);
+void dcc_list_print_file(FILE_DCC_REC *dcc);
+
+#endif
diff --git a/src/fe-common/irc/dcc/meson.build b/src/fe-common/irc/dcc/meson.build
new file mode 100644
index 0000000..296b1d6
--- /dev/null
+++ b/src/fe-common/irc/dcc/meson.build
@@ -0,0 +1,27 @@
+# this file is part of irssi
+
+libfe_irc_dcc_a = static_library('fe_irc_dcc',
+ files(
+ 'fe-dcc-chat-messages.c',
+ 'fe-dcc-chat.c',
+ 'fe-dcc-get.c',
+ 'fe-dcc-send.c',
+ 'fe-dcc-server.c',
+ 'fe-dcc.c',
+ 'module-formats.c',
+ ),
+ include_directories : rootinc,
+ implicit_include_directories : false,
+ c_args : [
+ def_helpdir,
+ def_sysconfdir,
+ ],
+ dependencies : dep)
+
+install_headers(
+ files(
+ 'fe-dcc.h',
+ 'module-formats.h',
+ 'module.h',
+ ),
+ subdir : incdir / 'src' / 'fe-common' / 'irc' / 'dcc')
diff --git a/src/fe-common/irc/dcc/module-formats.c b/src/fe-common/irc/dcc/module-formats.c
new file mode 100644
index 0000000..f973cd9
--- /dev/null
+++ b/src/fe-common/irc/dcc/module-formats.c
@@ -0,0 +1,79 @@
+/*
+ module-formats.c : irssi
+
+ Copyright (C) 2000 Timo Sirainen
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "module.h"
+#include <irssi/src/fe-common/core/formats.h>
+
+FORMAT_REC fecommon_irc_dcc_formats[] = {
+ { MODULE_NAME, "IRC", 0 },
+
+ /* ---- */
+ { NULL, "DCC", 0 },
+
+ { "own_dcc", "{dccownmsg dcc {dccownnick $1}}$2", 3, { 0, 0, 0 } },
+ { "own_dcc_action", "{dccownaction_target $0 $1}$2", 3, { 0, 0, 0 } },
+ { "own_dcc_action_query", "{dccownaction $0}$2", 3, { 0, 0, 0 } },
+ { "own_dcc_ctcp", "{ownctcp ctcp $0}$1 $2", 3, { 0, 0, 0 } },
+ { "dcc_msg", "{dccmsg dcc $0}$1", 2, { 0, 0 } },
+ { "action_dcc", "{dccaction $0}$1", 2, { 0, 0 } },
+ { "action_dcc_query", "{dccaction $0}$1", 2, { 0, 0 } },
+ { "own_dcc_query", "{ownmsgnick {dccownquerynick $0}}$2", 3, { 0, 0, 0 } },
+ { "dcc_msg_query", "{privmsgnick $0}$1", 2, { 0, 0 } },
+ { "dcc_ctcp", "{dcc >>> DCC CTCP {hilight $1} received from {hilight $0}: $2}", 3, { 0, 0, 0 } },
+ { "dcc_chat", "{dcc DCC CHAT from {nick $0} [$1 port $2]}", 3, { 0, 0, 1 } },
+ { "dcc_chat_channel", "{dcc DCC CHAT from {nick $0} [$1 port $2] requested in channel {channel $3}}", 4, { 0, 0, 1, 0 } },
+ { "dcc_chat_not_found", "{dcc No DCC CHAT connection open to {nick $0}}", 1, { 0 } },
+ { "dcc_chat_connected", "{dcc DCC CHAT connection with {nick $0} [$1 port $2] established}", 3, { 0, 0, 1 } },
+ { "dcc_chat_disconnected", "{dcc DCC lost chat to {nick $0}}", 1, { 0 } },
+ { "dcc_send", "{dcc DCC SEND from {nick $0} [$1 port $2]: $3 [$4]}", 5, { 0, 0, 1, 0, 0 } },
+ { "dcc_send_channel", "{dcc DCC SEND from {nick $0} [$1 port $2]: $3 [$4 bytes] requested in channel {channel $5}}", 6, { 0, 0, 1, 0, 0, 0 } },
+ { "dcc_send_exists", "{dcc DCC already sending file {dccfile $0} for {nick $1}}", 2, { 0, 0 } },
+ { "dcc_send_no_route", "{dcc DCC route lost to nick {nick $0} when trying to send file {dccfile $1}}", 2, { 0, 0 } },
+ { "dcc_send_not_found", "{dcc DCC not sending file {dccfile $1} to {nick $0}}", 2, { 0, 0 } },
+ { "dcc_send_file_open_error", "{dcc DCC can't open file {dccfile $0}: $1}", 2, { 0, 0 } },
+ { "dcc_send_connected", "{dcc DCC sending file {dccfile $0} for {nick $1} [$2 port $3]}", 4, { 0, 0, 0, 1 } },
+ { "dcc_send_complete", "{dcc DCC sent file {dccfile $0} [{hilight $1}] for {nick $2} in {hilight $3} [{hilight $4kB/s}]}", 5, { 0, 0, 0, 0, 3 } },
+ { "dcc_send_aborted", "{dcc DCC aborted sending file {dccfile $0} for {nick $1}}", 2, { 0, 0 } },
+ { "dcc_get_not_found", "{dcc DCC no file offered by {nick $0}}", 1, { 0 } },
+ { "dcc_get_connected", "{dcc DCC receiving file {dccfile $0} from {nick $1} [$2 port $3]}", 4, { 0, 0, 0, 1 } },
+ { "dcc_get_complete", "{dcc DCC received file {dccfile $0} [$1] from {nick $2} in {hilight $3} [$4kB/s]}", 5, { 0, 0, 0, 0, 3 } },
+ { "dcc_get_aborted", "{dcc DCC aborted receiving file {dccfile $0} from {nick $1}}", 2, { 0, 0 } },
+ { "dcc_get_write_error", "{dcc DCC error writing to file {dccfile $0}: {comment $1}", 2, { 0, 0 } },
+ { "dcc_unknown_ctcp", "{dcc DCC unknown ctcp {hilight $0} from {nick $1} [$2]}", 3, { 0, 0, 0 } },
+ { "dcc_unknown_reply", "{dcc DCC unknown reply {hilight $0} from {nick $1} [$2]}", 3, { 0, 0, 0 } },
+ { "dcc_unknown_type", "{dcc DCC unknown type {hilight $0}}", 1, { 0 } },
+ { "dcc_invalid_ctcp", "{dcc DCC received CTCP {hilight $0} with invalid parameters from {nick $1}}", 4, { 0, 0, 0, 0 } },
+ { "dcc_connect_error", "{dcc DCC can't connect to {hilight $0} port {hilight $1}}", 2, { 0, 1 } },
+ { "dcc_cant_create", "{dcc DCC can't create file {dccfile $0}: $1}", 2, { 0, 0 } },
+ { "dcc_rejected", "{dcc DCC $0 was rejected by {nick $1} [{hilight $2}]}", 3, { 0, 0, 0 } },
+ { "dcc_request_send", "{dcc DCC $0 request sent to {nick $1}: $2", 3, { 0, 0, 0 } },
+ { "dcc_close", "{dcc DCC $0 close for {nick $1} [{hilight $2}]}", 3, { 0, 0, 0 } },
+ { "dcc_lowport", "{dcc Warning: Port sent with DCC request is a lowport ({hilight $0, $1}) - this isn't normal. It is possible the address/port is faked (or maybe someone is just trying to bypass firewall)}", 2, { 1, 0 } },
+ { "dcc_list_header", "{dcc DCC connections}", 0 },
+ { "dcc_list_line_chat", "{dcc $0 $1}", 2, { 0, 0 } },
+ { "dcc_list_line_file", "{dcc $0 $1: %|$2 of $3 ($4%%) - $5kB/s - ETA $7 - $6}", 8, { 0, 0, 0, 0, 1, 3, 0, 0 } },
+ { "dcc_list_line_queued_send", "{dcc - $0 $2 (queued)}", 3, { 0, 0, 0 } },
+ { "dcc_list_footer", "", 0 },
+ { "dcc_list_line_server", "{dcc $0: Port($1) - Send($2) - Chat($3) - Fserve($4)}", 5, { 0, 1, 0, 0, 0 } },
+ { "dcc_server_started", "{dcc DCC SERVER started on port {hilight $0}}", 1, { 1 } },
+ { "dcc_server_closed", "{dcc DCC SERVER on port {hilight $0} closed}", 1, { 1 } },
+
+ { NULL, NULL, 0 }
+};
diff --git a/src/fe-common/irc/dcc/module-formats.h b/src/fe-common/irc/dcc/module-formats.h
new file mode 100644
index 0000000..204c7dd
--- /dev/null
+++ b/src/fe-common/irc/dcc/module-formats.h
@@ -0,0 +1,57 @@
+#include <irssi/src/fe-common/core/formats.h>
+
+enum {
+ IRCTXT_MODULE_NAME,
+
+ IRCTXT_FILL_1,
+
+ IRCTXT_OWN_DCC,
+ IRCTXT_OWN_DCC_ACTION,
+ IRCTXT_OWN_DCC_ACTION_QUERY,
+ IRCTXT_OWN_DCC_CTCP,
+ IRCTXT_DCC_MSG,
+ IRCTXT_ACTION_DCC,
+ IRCTXT_ACTION_DCC_QUERY,
+ IRCTXT_OWN_DCC_QUERY,
+ IRCTXT_DCC_MSG_QUERY,
+ IRCTXT_DCC_CTCP,
+ IRCTXT_DCC_CHAT,
+ IRCTXT_DCC_CHAT_CHANNEL,
+ IRCTXT_DCC_CHAT_NOT_FOUND,
+ IRCTXT_DCC_CHAT_CONNECTED,
+ IRCTXT_DCC_CHAT_DISCONNECTED,
+ IRCTXT_DCC_SEND,
+ IRCTXT_DCC_SEND_CHANNEL,
+ IRCTXT_DCC_SEND_EXISTS,
+ IRCTXT_DCC_SEND_NO_ROUTE,
+ IRCTXT_DCC_SEND_NOT_FOUND,
+ IRCTXT_DCC_SEND_FILE_OPEN_ERROR,
+ IRCTXT_DCC_SEND_CONNECTED,
+ IRCTXT_DCC_SEND_COMPLETE,
+ IRCTXT_DCC_SEND_ABORTED,
+ IRCTXT_DCC_GET_NOT_FOUND,
+ IRCTXT_DCC_GET_CONNECTED,
+ IRCTXT_DCC_GET_COMPLETE,
+ IRCTXT_DCC_GET_ABORTED,
+ IRCTXT_DCC_GET_WRITE_ERROR,
+ IRCTXT_DCC_UNKNOWN_CTCP,
+ IRCTXT_DCC_UNKNOWN_REPLY,
+ IRCTXT_DCC_UNKNOWN_TYPE,
+ IRCTXT_DCC_INVALID_CTCP,
+ IRCTXT_DCC_CONNECT_ERROR,
+ IRCTXT_DCC_CANT_CREATE,
+ IRCTXT_DCC_REJECTED,
+ IRCTXT_DCC_REQUEST_SEND,
+ IRCTXT_DCC_CLOSE,
+ IRCTXT_DCC_LOWPORT,
+ IRCTXT_DCC_LIST_HEADER,
+ IRCTXT_DCC_LIST_LINE_CHAT,
+ IRCTXT_DCC_LIST_LINE_FILE,
+ IRCTXT_DCC_LIST_LINE_QUEUED_SEND,
+ IRCTXT_DCC_LIST_FOOTER,
+ IRCTXT_DCC_LIST_LINE_SERVER,
+ IRCTXT_DCC_SERVER_STARTED,
+ IRCTXT_DCC_SERVER_CLOSED
+};
+
+extern FORMAT_REC fecommon_irc_dcc_formats[];
diff --git a/src/fe-common/irc/dcc/module.h b/src/fe-common/irc/dcc/module.h
new file mode 100644
index 0000000..5493446
--- /dev/null
+++ b/src/fe-common/irc/dcc/module.h
@@ -0,0 +1,4 @@
+#include <irssi/src/common.h>
+#include <irssi/src/irc/core/irc.h>
+
+#define MODULE_NAME "fe-common/irc/dcc"