diff --git a/ChangeLog b/ChangeLog index 872f551..37ad4ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Version 0.4 (2009/11/12): + * fixed Readme for Windows (again -.-') + * added an option to offset wrong times (for some friends :) I know it isn't really the plugins job) + * the plugin now blocks unloading to avoid orphan options in account settings + * new timestamp handler to avoid displaying the date on every message + Version 0.3 (2009/11/10): * fixed issue with daylight saving time * fixed Readme files diff --git a/Makefile.in b/Makefile.in index 5967bd7..5e0ba1b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -173,11 +173,11 @@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pidgin_CFLAGS = @pidgin_CFLAGS@ +pidgin_LIBS = @pidgin_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -purple_CFLAGS = @purple_CFLAGS@ -purple_LIBS = @purple_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ diff --git a/VERSION b/VERSION index be58634..bd73f47 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3 +0.4 diff --git a/config.h.in b/config.h.in index 06a06fe..d6794ec 100644 --- a/config.h.in +++ b/config.h.in @@ -75,6 +75,9 @@ /* Define the plugin website to be used */ #undef PLUGIN_ID +/* Define the plugin author to be used */ +#undef PLUGIN_PREFS_PREFIX + /* Define the plugin website to be used */ #undef PLUGIN_STATIC_NAME diff --git a/config.h.mingw b/config.h.mingw index 2911d44..aefcefa 100644 --- a/config.h.mingw +++ b/config.h.mingw @@ -62,25 +62,28 @@ #define PACKAGE_NAME "znchelper" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "znchelper 0.3" +#define PACKAGE_STRING "znchelper 0.4" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "znchelper" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.3" +#define PACKAGE_VERSION "0.4" /* Define the plugin author to be used */ #define PLUGIN_AUTHOR "Konrad Gräfe " /* Define the plugin website to be used */ -#define PLUGIN_ID "core-freakazoid-znchelper" +#define PLUGIN_ID "gtk-freakazoid-znchelper" + +/* Define the plugin author to be used */ +#define PLUGIN_PREFS_PREFIX "/plugins/gtk/znchelper" /* Define the plugin website to be used */ #define PLUGIN_STATIC_NAME "znchelper" /* Define the plugin version to be used */ -#define PLUGIN_VERSION "0.3" +#define PLUGIN_VERSION "0.4" /* Define the plugin website to be used */ #define PLUGIN_WEBSITE "http://freakazoid.teamblind.de/" @@ -89,4 +92,4 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "0.3" +#define VERSION "0.4" diff --git a/configure b/configure index d34cab0..dc1f8c9 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for znchelper 0.3. +# Generated by GNU Autoconf 2.61 for znchelper 0.4. # # Report bugs to . # @@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='znchelper' PACKAGE_TARNAME='znchelper' -PACKAGE_VERSION='0.3' -PACKAGE_STRING='znchelper 0.3' +PACKAGE_VERSION='0.4' +PACKAGE_STRING='znchelper 0.4' PACKAGE_BUGREPORT='freakazoid@teamblind.de' ac_unique_file="src/znchelper.c" @@ -912,8 +912,8 @@ POFILES POSUB MKINSTALLDIRS PKG_CONFIG -purple_CFLAGS -purple_LIBS +pidgin_CFLAGS +pidgin_LIBS LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -933,8 +933,8 @@ CXXCPP F77 FFLAGS PKG_CONFIG -purple_CFLAGS -purple_LIBS' +pidgin_CFLAGS +pidgin_LIBS' # Initialize some variables set by options. @@ -1437,7 +1437,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures znchelper 0.3 to adapt to many kinds of systems. +\`configure' configures znchelper 0.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1507,7 +1507,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of znchelper 0.3:";; + short | recursive ) echo "Configuration of znchelper 0.4:";; esac cat <<\_ACEOF @@ -1545,9 +1545,9 @@ Some influential environment variables: F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags PKG_CONFIG path to pkg-config utility - purple_CFLAGS - C compiler flags for purple, overriding pkg-config - purple_LIBS linker flags for purple, overriding pkg-config + pidgin_CFLAGS + C compiler flags for pidgin, overriding pkg-config + pidgin_LIBS linker flags for pidgin, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1613,7 +1613,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -znchelper configure 0.3 +znchelper configure 0.4 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1627,7 +1627,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by znchelper $as_me 0.3, which was +It was created by znchelper $as_me 0.4, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2265,7 +2265,7 @@ fi # Define the identity of the package. PACKAGE='znchelper' - VERSION='0.3' + VERSION='0.4' cat >>confdefs.h <<_ACEOF @@ -2413,7 +2413,7 @@ ac_config_headers="$ac_config_headers config.h" cat >>confdefs.h <<_ACEOF -#define PLUGIN_VERSION "0.3" +#define PLUGIN_VERSION "0.4" _ACEOF @@ -2425,7 +2425,7 @@ _ACEOF cat >>confdefs.h <<_ACEOF -#define PLUGIN_ID "core-freakazoid-znchelper" +#define PLUGIN_ID "gtk-freakazoid-znchelper" _ACEOF @@ -2442,6 +2442,12 @@ _ACEOF +cat >>confdefs.h <<_ACEOF +#define PLUGIN_PREFS_PREFIX "/plugins/gtk/znchelper" +_ACEOF + + + # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4337,7 +4343,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4340 "configure"' > conftest.$ac_ext + echo '#line 4346 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7388,11 +7394,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7391: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7397: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7395: \$? = $ac_status" >&5 + echo "$as_me:7401: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7678,11 +7684,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7681: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7687: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7685: \$? = $ac_status" >&5 + echo "$as_me:7691: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7782,11 +7788,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7785: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7791: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7789: \$? = $ac_status" >&5 + echo "$as_me:7795: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10159,7 +10165,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12669: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12667: \$? = $ac_status" >&5 + echo "$as_me:12673: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12764,11 +12770,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12767: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12773: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12771: \$? = $ac_status" >&5 + echo "$as_me:12777: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14362,11 +14368,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14365: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14371: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14369: \$? = $ac_status" >&5 + echo "$as_me:14375: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14466,11 +14472,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14469: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14475: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14473: \$? = $ac_status" >&5 + echo "$as_me:14479: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16686,11 +16692,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16689: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16695: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16693: \$? = $ac_status" >&5 + echo "$as_me:16699: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16976,11 +16982,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16979: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16985: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16983: \$? = $ac_status" >&5 + echo "$as_me:16989: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17080,11 +17086,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17083: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17089: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17087: \$? = $ac_status" >&5 + echo "$as_me:17093: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21968,20 +21974,20 @@ echo "${ECHO_T}no" >&6; } fi pkg_failed=no -{ echo "$as_me:$LINENO: checking for purple" >&5 -echo $ECHO_N "checking for purple... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking for pidgin" >&5 +echo $ECHO_N "checking for pidgin... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then - if test -n "$purple_CFLAGS"; then - pkg_cv_purple_CFLAGS="$purple_CFLAGS" + if test -n "$pidgin_CFLAGS"; then + pkg_cv_pidgin_CFLAGS="$pidgin_CFLAGS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"purple >= 2.6.0\"") >&5 - ($PKG_CONFIG --exists --print-errors "purple >= 2.6.0") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pidgin >= 2.6.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "pidgin >= 2.6.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_purple_CFLAGS=`$PKG_CONFIG --cflags "purple >= 2.6.0" 2>/dev/null` + pkg_cv_pidgin_CFLAGS=`$PKG_CONFIG --cflags "pidgin >= 2.6.0" 2>/dev/null` else pkg_failed=yes fi @@ -21990,16 +21996,16 @@ else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then - if test -n "$purple_LIBS"; then - pkg_cv_purple_LIBS="$purple_LIBS" + if test -n "$pidgin_LIBS"; then + pkg_cv_pidgin_LIBS="$pidgin_LIBS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"purple >= 2.6.0\"") >&5 - ($PKG_CONFIG --exists --print-errors "purple >= 2.6.0") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pidgin >= 2.6.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "pidgin >= 2.6.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_purple_LIBS=`$PKG_CONFIG --libs "purple >= 2.6.0" 2>/dev/null` + pkg_cv_pidgin_LIBS=`$PKG_CONFIG --libs "pidgin >= 2.6.0" 2>/dev/null` else pkg_failed=yes fi @@ -22018,31 +22024,31 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - purple_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "purple >= 2.6.0"` + pidgin_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "pidgin >= 2.6.0"` else - purple_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "purple >= 2.6.0"` + pidgin_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pidgin >= 2.6.0"` fi # Put the nasty error message in config.log where it belongs - echo "$purple_PKG_ERRORS" >&5 + echo "$pidgin_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } - { { echo "$as_me:$LINENO: error: purple >= 2.6.0 required!" >&5 -echo "$as_me: error: purple >= 2.6.0 required!" >&2;} + { { echo "$as_me:$LINENO: error: pidgin >= 2.6.0 required!" >&5 +echo "$as_me: error: pidgin >= 2.6.0 required!" >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then - { { echo "$as_me:$LINENO: error: purple >= 2.6.0 required!" >&5 -echo "$as_me: error: purple >= 2.6.0 required!" >&2;} + { { echo "$as_me:$LINENO: error: pidgin >= 2.6.0 required!" >&5 +echo "$as_me: error: pidgin >= 2.6.0 required!" >&2;} { (exit 1); exit 1; }; } else - purple_CFLAGS=$pkg_cv_purple_CFLAGS - purple_LIBS=$pkg_cv_purple_LIBS + pidgin_CFLAGS=$pkg_cv_pidgin_CFLAGS + pidgin_LIBS=$pkg_cv_pidgin_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : fi -LIBS="$LIBS $purple_LIBS" -CFLAGS="$CFLAGS $purple_CFLAGS -Wall" +LIBS="$LIBS $pidgin_LIBS" +CFLAGS="$CFLAGS $pidgin_CFLAGS -Wall" # Checks for header files. @@ -22474,7 +22480,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by znchelper $as_me 0.3, which was +This file was extended by znchelper $as_me 0.4, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22527,7 +22533,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -znchelper config.status 0.3 +znchelper config.status 0.4 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -22894,8 +22900,8 @@ POFILES!$POFILES$ac_delim POSUB!$POSUB$ac_delim MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim -purple_CFLAGS!$purple_CFLAGS$ac_delim -purple_LIBS!$purple_LIBS$ac_delim +pidgin_CFLAGS!$pidgin_CFLAGS$ac_delim +pidgin_LIBS!$pidgin_LIBS$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF diff --git a/configure.in b/configure.in index 60592d9..2aaa90e 100644 --- a/configure.in +++ b/configure.in @@ -2,21 +2,23 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT(znchelper, 0.3, freakazoid@teamblind.de) +AC_INIT(znchelper, 0.4, freakazoid@teamblind.de) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/znchelper.c]) AC_CONFIG_HEADER([config.h]) -AC_DEFINE_UNQUOTED(PLUGIN_VERSION, ["0.3"], [Define the plugin version to be used]) +AC_DEFINE_UNQUOTED(PLUGIN_VERSION, ["0.4"], [Define the plugin version to be used]) AC_DEFINE_UNQUOTED(PLUGIN_WEBSITE, ["http://freakazoid.teamblind.de/"], [Define the plugin website to be used]) -AC_DEFINE_UNQUOTED(PLUGIN_ID, ["core-freakazoid-znchelper"], [Define the plugin website to be used]) +AC_DEFINE_UNQUOTED(PLUGIN_ID, ["gtk-freakazoid-znchelper"], [Define the plugin website to be used]) AC_DEFINE_UNQUOTED(PLUGIN_STATIC_NAME, ["znchelper"], [Define the plugin website to be used]) AC_DEFINE_UNQUOTED(PLUGIN_AUTHOR, ["Konrad Gräfe "], [Define the plugin author to be used]) +AC_DEFINE_UNQUOTED(PLUGIN_PREFS_PREFIX, ["/plugins/gtk/znchelper"], [Define the plugin author to be used]) + # Checks for programs. AC_PROG_CC @@ -29,9 +31,9 @@ ALL_LINGUAS="de" AM_GLIB_GNU_GETTEXT # Checks for libraries. -PKG_CHECK_MODULES(purple, [purple >= 2.6.0], , [AC_MSG_ERROR(purple >= 2.6.0 required!)]) -LIBS="$LIBS $purple_LIBS" -CFLAGS="$CFLAGS $purple_CFLAGS -Wall" +PKG_CHECK_MODULES(pidgin, [pidgin >= 2.6.0], , [AC_MSG_ERROR(pidgin >= 2.6.0 required!)]) +LIBS="$LIBS $pidgin_LIBS" +CFLAGS="$CFLAGS $pidgin_CFLAGS -Wall" # Checks for header files. diff --git a/libtool b/libtool index b434ae5..efab3ed 100755 --- a/libtool +++ b/libtool @@ -1,7 +1,7 @@ #! /bin/sh # libtoolT - Provide generalized library-building support services. -# Generated automatically by (GNU znchelper 0.3) +# Generated automatically by (GNU znchelper 0.4) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 diff --git a/po/Makefile.in b/po/Makefile.in index 780b302..f180ff2 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -19,7 +19,7 @@ GETTEXT_PACKAGE = znchelper PACKAGE = znchelper -VERSION = 0.3 +VERSION = 0.4 SHELL = /bin/sh diff --git a/po/de.gmo b/po/de.gmo index 334394e..662412c 100644 Binary files a/po/de.gmo and b/po/de.gmo differ diff --git a/po/de.po b/po/de.po index 493104a..a169346 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: core-freakazoid-znchelper 0.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-10-05 21:28+0200\n" +"POT-Creation-Date: 2009-11-12 01:52+0100\n" "PO-Revision-Date: 2009-10-05 21:21+0200\n" "Last-Translator: Konrad Gräfe \n" "Language-Team: de_DE \n" @@ -15,19 +15,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../src/messageparser.c:47 -msgid "Uses ZNC Bouncer" -msgstr "Benutzt ZNC Bouncer" - -#: ../src/messageparser.c:76 +#: ../src/messageparser.c:102 msgid "Buffer Playback..." msgstr "Wiedergabe des Zwischenspeichers..." -#: ../src/messageparser.c:84 +#: ../src/messageparser.c:113 msgid "Playback Complete." msgstr "Ende der Wiedergabe." -#: ../src/messageparser.c:104 +#: ../src/messageparser.c:137 #, c-format msgid "" "Timestamp could not be interpreted. Please use \"[%%Y-%%m-%%d %%H:%%M:%%S]\" " @@ -37,11 +33,19 @@ msgstr "" "Zeitstempelformat \"[%%Y-%%m-%%d %%H:%%M:%%S]\" und lassen Sie es nach der " "eigentlichen Nachricht ausgeben (append).\n" -#: ../src/znchelper.c:102 +#: ../src/messageparser.c:160 +msgid "Uses ZNC Bouncer" +msgstr "Benutzt ZNC Bouncer" + +#: ../src/znchelper.c:56 +msgid "Time Offset (hours):" +msgstr "Zeit-Ausgleich (Stunden):" + +#: ../src/znchelper.c:124 msgid "ZNC Helper" msgstr "ZNC Helper" -#: ../src/znchelper.c:103 ../src/znchelper.c:104 +#: ../src/znchelper.c:125 ../src/znchelper.c:126 msgid "" "This plugin removes ugly double-timestamps when replaying messages from ZNC " "bouncers, e.g. \"(13:00:00) [12:00:00] Lunch time!\"." diff --git a/src/Makefile.in b/src/Makefile.in index 4fc5be8..c75fd89 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -173,11 +173,11 @@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pidgin_CFLAGS = @pidgin_CFLAGS@ +pidgin_LIBS = @pidgin_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -purple_CFLAGS = @purple_CFLAGS@ -purple_LIBS = @purple_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ diff --git a/src/messageparser.c b/src/messageparser.c index 409beae..cf0fd50 100644 --- a/src/messageparser.c +++ b/src/messageparser.c @@ -26,44 +26,70 @@ #include #include #include +#include +#include +PurplePlugin *plugin; GHashTable *conversations; -void message_parser_init(PurplePlugin *plugin) { - GList *iter; - PurplePlugin *prpl; - PurplePluginProtocolInfo *prpl_info; - PurpleAccountOption *option; +/* copied from Pidgin */ +static void pidgin_conv_calculate_newday(PidginConversation *gtkconv, time_t mtime) { + struct tm *tm = localtime(&mtime); + + tm->tm_hour = tm->tm_min = tm->tm_sec = 0; + tm->tm_mday++; + + gtkconv->newday = mktime(tm); +} + +static gchar *conversation_timestamp_cb(PurpleConversation *conv, time_t mtime, gboolean _show_date) { + PidginConversation *gtkconv; + gchar *mdate; + struct tm tm_msg, tm_now; + time_t tnow; + const char *tmp; + gboolean show_date; - conversations = g_hash_table_new(NULL, NULL); + gtkconv = PIDGIN_CONVERSATION(conv); - /* Allen IRC-Accounts die ZNC-Option anhängen*/ - for (iter = purple_plugins_get_protocols(); iter; iter = iter->next) { - prpl = iter->data; - - if(prpl && prpl->info) { - prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - if(prpl_info && prpl->info->id && (purple_utf8_strcasecmp(prpl->info->id, "prpl-irc")==0)) { - option = purple_account_option_bool_new(_("Uses ZNC Bouncer"), "uses_znc_bouncer", FALSE); - prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); - } + + time(&tnow); + localtime_r(&tnow, &tm_now); + localtime_r(&mtime, &tm_msg); + + /* First message in playback */ + if (gtkconv->newday == (-1)) { + if((tm_msg.tm_year != tm_now.tm_year) || (tm_msg.tm_mon != tm_now.tm_mon) || (tm_msg.tm_mday != tm_now.tm_mday)) { + show_date = TRUE; + } else { + show_date = FALSE; } + + pidgin_conv_calculate_newday(gtkconv, mtime); + } else { + show_date = (mtime >= gtkconv->newday); } - purple_signal_connect(purple_conversations_get_handle(), "writing-chat-msg", plugin, PURPLE_CALLBACK(writing_chat_msg_cb), NULL); -} - -void message_parser_destroy(void) { - g_hash_table_destroy(conversations); + if (show_date) { + tmp = purple_date_format_long(&tm_msg); + } else { + tmp = purple_time_format(&tm_msg); + } + mdate = g_strdup_printf("(%s)", tmp); + + return mdate; } -gboolean writing_chat_msg_cb(PurpleAccount *account, const char *who, char **message, PurpleConversation *conv, PurpleMessageFlags flags) { +static gboolean writing_chat_msg_cb(PurpleAccount *account, const char *who, char **message, PurpleConversation *conv, PurpleMessageFlags flags) { + PidginConversation *gtkconv; gboolean cancel = FALSE; static gboolean inuse = FALSE; char *pos = NULL; time_t stamp; + gtkconv = PIDGIN_CONVERSATION(conv); + if(inuse) return FALSE; if(!purple_account_get_bool(account, "uses_znc_bouncer", TRUE)) return cancel; if(!(flags & PURPLE_MESSAGE_RECV)) return cancel; @@ -74,6 +100,9 @@ gboolean writing_chat_msg_cb(PurpleAccount *account, const char *who, char **mes inuse = TRUE; purple_conv_chat_write(PURPLE_CONV_CHAT(conv), who, _("Buffer Playback..."), flags|PURPLE_MESSAGE_SYSTEM, time(NULL)); + + gtkconv->newday = (-1); + inuse = FALSE; cancel = TRUE; @@ -95,7 +124,11 @@ gboolean writing_chat_msg_cb(PurpleAccount *account, const char *who, char **mes *pos = '\0'; inuse = TRUE; + + purple_signal_connect(pidgin_conversations_get_handle(), "conversation-timestamp", plugin, PURPLE_CALLBACK(conversation_timestamp_cb), NULL); purple_conv_chat_write(PURPLE_CONV_CHAT(conv), who, *message, flags, stamp); + purple_signal_disconnect(pidgin_conversations_get_handle(), "conversation-timestamp", plugin, PURPLE_CALLBACK(conversation_timestamp_cb)); + inuse = FALSE; cancel = TRUE; @@ -107,3 +140,28 @@ gboolean writing_chat_msg_cb(PurpleAccount *account, const char *who, char **mes return cancel; } + +void message_parser_init(PurplePlugin *_plugin) { + GList *iter; + PurplePlugin *prpl; + PurplePluginProtocolInfo *prpl_info; + PurpleAccountOption *option; + + plugin = _plugin; + conversations = g_hash_table_new(NULL, NULL); + + /* Allen IRC-Accounts die ZNC-Option anhängen*/ + for (iter = purple_plugins_get_protocols(); iter; iter = iter->next) { + prpl = iter->data; + + if(prpl && prpl->info) { + prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); + if(prpl_info && prpl->info->id && (purple_utf8_strcasecmp(prpl->info->id, "prpl-irc")==0)) { + option = purple_account_option_bool_new(_("Uses ZNC Bouncer"), "uses_znc_bouncer", FALSE); + prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); + } + } + } + + purple_signal_connect(purple_conversations_get_handle(), "writing-chat-msg", plugin, PURPLE_CALLBACK(writing_chat_msg_cb), NULL); +} diff --git a/src/messageparser.h b/src/messageparser.h index 809d623..9fd488c 100644 --- a/src/messageparser.h +++ b/src/messageparser.h @@ -22,10 +22,6 @@ #include -gboolean writing_chat_msg_cb(PurpleAccount *account, const char *who, char **message, PurpleConversation *conv, PurpleMessageFlags flags); - void message_parser_init(PurplePlugin *plugin); -void message_parser_destroy(void); - #endif /* PURPLE_ZNC_HELPER_MESSAGE_PARSER_H */ diff --git a/src/timeparser.c b/src/timeparser.c index ac96eef..5a08bdf 100644 --- a/src/timeparser.c +++ b/src/timeparser.c @@ -22,6 +22,8 @@ #include "timeparser.h" +#include + time_t get_time(const char *timestamp) { struct tm t; @@ -32,6 +34,8 @@ time_t get_time(const char *timestamp) { read = sscanf(timestamp, "[%04d-%02d-%02d %02d:%02d:%02d]", &year, &month, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec); t.tm_isdst = (-1); + t.tm_hour += purple_prefs_get_int(PLUGIN_PREFS_PREFIX "/offset"); + if(read != 6 || year <= 1900) return 0; t.tm_year = year - 1900; diff --git a/src/znchelper.c b/src/znchelper.c index df6ea30..3e124a5 100644 --- a/src/znchelper.c +++ b/src/znchelper.c @@ -19,8 +19,6 @@ #include "config.h" -/* #define PLUGIN_PREFS_PREFIX "/plugins/core/znchelper" */ - #ifndef PURPLE_PLUGINS #define PURPLE_PLUGINS #endif @@ -44,11 +42,34 @@ static gboolean plugin_load(PurplePlugin *_plugin) { } static gboolean plugin_unload(PurplePlugin *plugin) { - message_parser_destroy(); + /* unable to remove Account Options :'( */ + return FALSE; +} + +static PurplePluginPrefFrame *get_plugin_pref_frame(PurplePlugin *plugin) { + PurplePluginPrefFrame *frame; + PurplePluginPref *ppref; - return TRUE; + frame = purple_plugin_pref_frame_new(); + + ppref = purple_plugin_pref_new_with_name_and_label(PLUGIN_PREFS_PREFIX "/offset", _("Time Offset (hours):")); + purple_plugin_pref_set_bounds(ppref, -23, 23); + purple_plugin_pref_frame_add(frame, ppref); + + return frame; } +static PurplePluginUiInfo ui_info = { + get_plugin_pref_frame, + 0, /* page_num (Reserved) */ + NULL, /* frame (Reserved) */ + /* Padding */ + NULL, + NULL, + NULL, + NULL +}; + static PurplePluginInfo info = { PURPLE_PLUGIN_MAGIC, PURPLE_MAJOR_VERSION, @@ -74,7 +95,7 @@ static PurplePluginInfo info = { NULL, /**< ui_info */ NULL, /**< extra_info */ - NULL, /**< prefs_info */ + &ui_info, /**< prefs_info */ NULL, /**< actions */ /* padding */ NULL, @@ -99,9 +120,12 @@ static void init_plugin(PurplePlugin *plugin) { g_free(plugins_locale_dir); #endif /* ENABLE_NLS */ - info.name = _("ZNC Helper"); - info.summary = _("This plugin removes ugly double-timestamps when replaying messages from ZNC bouncers, e.g. \"(13:00:00) [12:00:00] Lunch time!\"."); - info.description = _("This plugin removes ugly double-timestamps when replaying messages from ZNC bouncers, e.g. \"(13:00:00) [12:00:00] Lunch time!\"."); + info.name = _("ZNC Helper"); + info.summary = _("This plugin removes ugly double-timestamps when replaying messages from ZNC bouncers, e.g. \"(13:00:00) [12:00:00] Lunch time!\"."); + info.description = _("This plugin removes ugly double-timestamps when replaying messages from ZNC bouncers, e.g. \"(13:00:00) [12:00:00] Lunch time!\"."); + + purple_prefs_add_none(PLUGIN_PREFS_PREFIX); + purple_prefs_add_int(PLUGIN_PREFS_PREFIX "/offset", 0); } -PURPLE_INIT_PLUGIN(plugin, init_plugin, info) +PURPLE_INIT_PLUGIN(PLUGIN_STATIC_NAME, init_plugin, info)