1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-18 17:14:47 +02:00

Compare commits

...

44 Commits

Author SHA1 Message Date
Sebastien Helleu b738f4c8aa Version 0.1.3 2005-07-02 17:21:50 +00:00
Sebastien Helleu 6f3b6d9e50 Version 0.1.3 2005-07-02 17:03:23 +00:00
Sebastien Helleu def35c5a66 Updated doc 2005-07-02 16:07:52 +00:00
Sebastien Helleu da4ee1a6ee Added tests after getaddrinfo function 2005-07-02 16:01:02 +00:00
Sebastien Helleu 7c31dd9189 gnutls lib now optional, configure goes on if lib is not found 2005-07-02 15:59:44 +00:00
Sebastien Helleu dbad2a0206 Translated some messages and added calls to freeaddrinfo() function 2005-06-30 20:16:07 +00:00
Emmanuel Bouthenot ec1d57063c - proxy support (http, socks4, socks5) with authentification for http, socks5 2005-06-30 19:22:01 +00:00
Sebastien Helleu 5bd56f86c6 * commands from users outside channel now authorized (if special user or channel without "n" flag)
* completion added for config option (with /set command)
2005-06-30 12:55:36 +00:00
Sebastien Helleu 2fab4da03d Updated TODO with SSL and IPv6 2005-06-28 08:33:13 +00:00
Sebastien Helleu c69c77507c Added IPv6 and SSL options for command line IRC url 2005-06-28 08:24:43 +00:00
Sebastien Helleu b330ec3dae Added IPv6 support 2005-06-27 16:27:31 +00:00
Sebastien Helleu ae8f8a5700 gnutls code compiled according to pre-processor var HAVE_GNUTLS 2005-06-22 21:08:21 +00:00
Julien Louis 5e8b47f187 * Add --disable-gnutls option to turn off gnutls support
* Remove wxwidgets checks when --enable-wxwidgets arg is not given
2005-06-22 18:50:24 +00:00
Sebastien Helleu f4abd0bf59 Added certificate management in SSL (connection now ok with SSL server) 2005-06-21 08:05:58 +00:00
Sebastien Helleu abe7e08147 kill command now received and displayed 2005-06-20 14:04:17 +00:00
Sebastien Helleu 4e9193a943 Added SSL support with gnutls lib 2005-06-19 20:55:10 +00:00
Julien Louis bbd373c44d Update debian/changelog 2005-06-19 19:44:01 +00:00
Sebastien Helleu 6b011234cf Added kolter and ptitlouis 2005-06-19 15:51:22 +00:00
Sebastien Helleu 71a76ada48 Channel notify levels are saved in config file 2005-06-19 14:22:11 +00:00
Sebastien Helleu a7ddb89076 Updated README 2005-06-18 20:27:05 +00:00
Sebastien Helleu 6fe262c131 File automatically updated 2005-06-18 11:44:37 +00:00
Julien Louis 0a32bc5326 Fix wrong debhelper version dependency. 2005-06-18 09:38:59 +00:00
Sebastien Helleu 70fe8e9472 part message now accepts %v (replaced by WeeChat version), like quit message 2005-06-18 09:28:16 +00:00
Julien Louis b0310b6e78 Set debhelper compatibility to avoid warnings during package build 2005-06-18 09:25:30 +00:00
Julien Louis 8218316502 Sync with official debian package 2005-06-18 08:42:08 +00:00
Emmanuel Bouthenot d00c99f292 errors while loading perl scripts are now displayed in server buffer (instead of current buffer) 2005-06-16 17:02:37 +00:00
Emmanuel Bouthenot f72e5952f2 in python scripts, all messages written in stdin and stderr are redirect in server window 2005-06-16 16:52:17 +00:00
Emmanuel Bouthenot ebf5f9e66d in python scripts, all messages written in stdin and stderr are redirect in server window 2005-06-16 16:41:41 +00:00
Emmanuel Bouthenot 7330dc862a fix a filename error while loading a python script manually 2005-06-16 16:38:36 +00:00
Sebastien Helleu 9eb1422bb7 Fixed plugins "print" and "prnt" functions: now ok for writing on server buffers 2005-06-16 11:02:19 +00:00
Sebastien Helleu d86a783b6a Fixed color problem with new libcurses version 2005-06-15 17:17:45 +00:00
Sebastien Helleu 5b3f96dace Display message content when nick is not found for an incoming "PRIVMSG" message 2005-06-15 17:16:35 +00:00
Emmanuel Bouthenot 821c2e87c8 update examples in python API 2005-06-05 12:54:31 +00:00
Sebastien Helleu 1de7b52aa2 Fixed crash when using alt-S or alt-X keys on DCC buffer (alt-D) 2005-05-31 15:09:54 +00:00
Sebastien Helleu 4d4a667094 Fixed crash when using alt-S or alt-X keys on DCC buffer (alt-D) 2005-05-31 07:55:17 +00:00
Emmanuel Bouthenot 0eb3d45582 Fix python library detection on FreeBSD 2005-05-29 15:15:12 +00:00
Sebastien Helleu 7c63a73999 Added cast to prevent problems with AMD64 where size_t is not int 2005-05-29 07:20:15 +00:00
Sebastien Helleu 2ab3467c05 Added cast for away time display (to prevent problems with *BSD, where time_t is int and not long int) 2005-05-29 06:46:01 +00:00
Emmanuel Bouthenot 37d74c4941 Fix perl headers and library detection on various systems 2005-05-24 15:14:54 +00:00
Sebastien Helleu 01186c6c8b Fixed startup crash when weechat config file is not found 2005-05-24 14:10:56 +00:00
Emmanuel Bouthenot 29ffe7e0d8 Remove unused $PERL_LIB var due to an impoved libperl detection 2005-05-23 21:52:53 +00:00
Emmanuel Bouthenot a8619181b7 Fix libperl and libpython detection 2005-05-23 21:45:50 +00:00
Julien Louis 5a90270a79 Fix configure args handling 2005-05-22 17:40:25 +00:00
Sebastien Helleu 3900a0f5ae Version 0.1.3-cvs 2005-05-22 16:12:24 +00:00
82 changed files with 9556 additions and 4558 deletions
+556 -546
View File
File diff suppressed because it is too large Load Diff
+27 -9
View File
@@ -1,16 +1,34 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
Developer:
---------
Developers:
----------
* General code
FlashCode <flashcode@flashtux.org>
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
* Python plugin
Kolter <kolter@free.fr>
Web : http://kolter.free.fr
IRC : nick is "kolter" @ irc.freenode.net
Jabber: kolter@jabber.org
Debian packager:
---------------
Julien Louis <ptitlouis@sysif.net>
IRC : nicks are "ptitlouis" or "tioui" @ irc.freenode.net
Jabber: ptitlouis@amessage.info
FlashCode <flashcode@flashtux.org>
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
Testers:
-------
+25 -1
View File
@@ -1,9 +1,33 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-05-21
ChangeLog - 2005-06-30
Version 0.1.3 (2005-07-02):
* proxy support (http, socks4, socks5) with authentification (http, socks5)
and ipv6 support (client to proxy)
* completion added for config option (with /set command)
* commands from users outside channel now authorized (if special user or
channel without "n" flag)
* added IPv6 support
* kill command now received and displayed
* added SSL support
* channel notify levels are saved in config file (new option
"server_notify_levels" for server sections)
* part message now accepts %v (replaced by WeeChat version), like quit message
* errors while loading perl scripts are now displayed in server buffer
(instead of current buffer)
* in python scripts, all messages written in stdin and stderr are redirected
in server buffer
* fix a filename error while loading a python script manually
* fixed plugins "print" and "prnt" functions: now ok for writing on server
buffers
* fixed color problem with new libcurses version
* fixed crash when using Alt-S or Alt-X on DCC buffer (Alt-D)
* fixed startup crash when config file (~/.weechat/weechat.rc) is not found
* improved Perl/Python libs detection for ./configure script
Version 0.1.2 (2005-05-21):
* added Python plugin support, improved Perl interface (and now Perl/Python
libraries are checked by configure script)
+4
View File
@@ -1,6 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-07-02
WeeChat 0.1.3 released.
* FlashCode, 2005-05-21
WeeChat 0.1.2 released.
+3 -3
View File
@@ -14,7 +14,7 @@ Features
* small, fast and very light
* customizable and extensible with scripts (Perl, Python, Ruby) (2)
* compliant with RFC 1459,2810,2811,2812,2813
* developed from scratch (not based on any other IRC client, except for look ;)
* developed from scratch
* multi-platform (GNU/Linux, *BSD, Windows & other) (3)
* 100% GPL & free
@@ -44,5 +44,5 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
---
(1) only Curses interface is available today
(2) only Perl interface is available today
(3) only GNU/Linux version is available today
(2) only Perl and Python interfaces are available today
(3) only GNU/Linux and *BSD versions are available today
+11 -23
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2005-05-21
TODO - 2005-07-02
Legend:
# done
@@ -10,38 +10,32 @@ Legend:
? is this really necessary?
v0.1.2:
v0.1.3:
------
* General:
+ Windows version
+ Solaris version
# *BSD version
# Mac OS X version
* IRC protocol:
- customizable CTCP version reply
* Interface:
# nicklist scroll keys
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* TCP/IP communication:
- SSL support
# SSL support
# IPv6 protocol implementation
# proxy support (http, socks4, socks5) with authentification
(http, socks5) and ipv6 support (client to proxy)
* Configuration:
- add key bindings to config file
* Plugins:
# Python plugin
# "/python load" and "/python unload" commands to (un)load Python scripts
# save buffer notify levels
Future versions:
---------------
* IRC protocol:
- customizable CTCP version reply
- complete "/list" command: add regexp search, display only channels that
match regexp
- "/ignore" and "/unignore" commands: hide all that is write by a given
@@ -52,15 +46,10 @@ Future versions:
nick/host connect to the given irc network
* WeeChat commands:
- "/reload" command: reload the WeeChat's config file
- "/highlight" command: highlight a given word when it appears on
channels/privates
- "/completion" command: do shortcuts (for example when we type "u"
in the text bar it send it to the server as "you")
- "/exec" command: execute a command as if we was in shell
and show us the output on the current window. An option to exec
like -o could send the output to the server, on the current
channel/private
- "/last": command to look for text in previous messages
* Interface:
@@ -69,10 +58,9 @@ Future versions:
- understand incomplete commands if unambigous (for example: /he for /help is ok)
? Qt GUI
* TCP/IP communication:
- proxy support
- IPv6 protocol implementation
* Plugins:
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
* Configuration:
- add key bindings to config file
+59 -26
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.1.2, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.3, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.2])
AM_INIT_AUTOMAKE([weechat], [0.1.3])
# Checks for programs.
AC_PROG_CC
@@ -36,9 +36,6 @@ AM_GNU_GETTEXT
# Checks for libraries.
AC_CHECK_LIB([ncurses], [initscr], LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.3.4, wxWin=1)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h])
@@ -69,15 +66,17 @@ AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa mem
AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets,[ --enable-wxwidgets Turn on WxWidgets interface (default=no)],enable_wxwidgets=yes,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python plugins (default=no)],enable_python=yes,enable_python=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],enable_ncurses=$enableval,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets,[ --enable-wxwidgets Turn on WxWidgets interface (default=no)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=$enableval,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=$enableval,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python plugins (default=no)],enable_python=$enableval,enable_python=no)
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=auto)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
enable_plugins="no"
enable_ruby="no"
@@ -90,6 +89,7 @@ AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
# AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
@@ -102,6 +102,9 @@ if test "x$enable_ncurses" = "xyes" ; then
fi
if test "x$enable_wxwidgets" = "xyes" ; then
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.3.4, wxWin=1)
if test "$wxWin" != 1; then
AC_MSG_ERROR([
*** wxWindows must be installed on your system
@@ -138,7 +141,7 @@ PLUGINS_LIBS=
if test "x$enable_perl" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROG(PERL, perl)
AC_PATH_PROG(PERL, perl perl5)
if test -z $PERL ; then
AC_MSG_ERROR([
*** Perl must be installed on your system
@@ -148,19 +151,32 @@ Please check that perl is in path, or install
it with your software package manager.])
fi
AC_MSG_CHECKING(for Perl library)
PERL_LIB=`$PERL -e 'use Config; print "$Config{installprefix}/lib/$Config{libperl}"'`
AC_MSG_CHECKING(for Perl headers files)
if test -r "$PERL_LIB"; then
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `perl -MExtUtils::Embed -e ldopts`"
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
else
AC_MSG_ERROR([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `$PERL -MExtUtils::Embed -e ldopts`"
else
AC_MSG_ERROR([
*** Perl library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
AC_SUBST(PERL_CFLAGS)
AC_DEFINE(PLUGIN_PERL)
fi
@@ -168,7 +184,7 @@ fi
if test "x$enable_python" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROG(PYTHON, python)
AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2)
if test -z $PYTHON ; then
AC_MSG_ERROR([
*** Python must be installed on your system
@@ -178,11 +194,13 @@ if test "x$enable_python" = "xyes" ; then
*** it with your software package manager.])
fi
PYTHON_INCLUDE=`$PYTHON -c 'import sys ; print "%s/include/python%s" % (sys.prefix, sys.version[[:3]])'`
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE="$PYTHON_SYSPREFIX/include/python$PYTHON_VERSION"
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print ' -I' + distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
PYTHON_CFLAGS=-I`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
else
AC_MSG_ERROR([
*** Python header files couldn't be found in your system.
@@ -190,12 +208,11 @@ if test "x$enable_python" = "xyes" ; then
fi
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c 'import sys; print "%s/lib/python%s/config" % (sys.prefix, sys.version[[:3]])'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[0:3]]'`
PYTHON_LIB="$PYTHON_SYSPREFIX/lib/python$PYTHON_VERSION/config"
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so" -a -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print string.join(distutils.sysconfig.get_config_vars('LINKFORSHARED', 'BLDLIBRARY', 'SHLIBS'))"`
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so" -o -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-lpython$PYTHON_VERSION -lpthread -lutil"
else
AC_MSG_ERROR([
*** Python library couldn't be found in your system.
@@ -214,6 +231,21 @@ fi
AC_SUBST(PLUGINS_LIBS)
if test "x$enable_gnutls" = "xyes" ; then
found_gnutls="no"
AM_PATH_LIBGNUTLS( 1.0.0, found_gnutls=yes, AC_MSG_WARN([[
*** libgnutls was not found. You may want to get it from
*** ftp://ftp.gnutls.org/pub/gnutls/
*** WeeChat will be built without GnuTLS support.]]))
if test "x$found_gnutls" = "xyes" ; then
GNUTLS_LIBS="-lgnutls"
AC_SUBST(GNUTLS_LIBS)
AC_DEFINE(HAVE_GNUTLS)
else
enable_gnutls="no"
fi
fi
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
CFLAGS="-O2"
@@ -286,6 +318,7 @@ echo Build with Plugin support..... : $enable_plugins
echo Build with Perl support....... : $enable_perl
echo Build with Python support..... : $enable_python
echo Build with Ruby support....... : $enable_ruby
echo Build with GNUtls support..... : $enable_gnutls
echo
echo Compile with debug info....... : $msg_debug_compiler
echo Print debugging messages...... : $msg_debug_verbose
+7
View File
@@ -1,3 +1,10 @@
weechat (0.1.2-2) unstable; urgency=low
* Patch src/gui/curse/gui-display.c to fix segfault
when config file does not exists (Closes: #310589).
-- Julien Louis <ptitlouis@sysif.net> Tue, 24 May 2005 20:55:02 +0200
weechat (0.1.2-1) unstable; urgency=low
* WeeChat version 0.1.2, see ChangeLog for detail.
+1
View File
@@ -0,0 +1 @@
4
+1 -1
View File
@@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev, python2.3 (>= 2.3), python-dev
Build-Depends: debhelper (>> 4.0.4), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev
Standards-Version: 3.6.1
Package: weechat
+157 -143
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.2 - May, 21 2005
@subtitle Documentation for WeeChat v0.1.3 - July, 03 2005
@image{weechat_image}
@@ -84,27 +84,27 @@ version 2 or higher.
@node Description, Pre-requisites, Introduction, Introduction
@section Description
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
designed for many operating systems.@*
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
designed for many operating systems.@*
@*
Main features are:
Main features are:
@itemize @minus
@item
multi-servers connection
@item
many GUI (Graphical User Interface): Curses, Gtk and Qt
@item
small, fast and light
@item
customizable and extensible with scripts
@item
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
@item
multi-platform (Gnu/Linux, *BSD, Windows and other)
@item
@item
multi-servers connection (with SSL, IPv6, proxy)
@item
many GUI: Curses, wxWidgets, Gtk and Qt
@item
small, fast and light
@item
customizable and extensible with scripts
@item
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
@item
multi-platform (Gnu/Linux, *BSD, MacOS X, Windows and other)
@item
100% GPL, free software
@end itemize
@end itemize
@*
WeeChat homepage is here:@*
@uref{http://weechat.flashtux.org}@*
@@ -116,20 +116,20 @@ In order to install WeeChat, you @b{need}:@*
@itemize @bullet
@item
A running Gnu/Linux system (with compiler tools for source package)
A running Gnu/Linux system (with compiler tools for source package)
@item
"root" privileges (to install WeeChat)
@item
According to GUI, one of the following libraries:
@itemize @minus
@item
Curses: ncurses library,
@item
Gtk: *** GUI not developed ***,
@item
Qt: *** GUI not developed ***,
According to GUI, one of the following libraries:
@itemize @minus
@item
Curses: ncurses library,
@item
Gtk: *** GUI not developed ***,
@item
Qt: *** GUI not developed ***,
@end itemize
@end itemize
@end itemize
@c ******************************* Installation *******************************
@@ -139,31 +139,31 @@ Qt: *** GUI not developed ***,
@menu
* Binary package::
* Source package::
* Source package::
* CVS sources::
@end menu
@node Binary package, Source package, Installation, Installation
@section Binary package
Binary packages are available for these distributions:
@itemize @bullet
@item
Debian (or any Debian compatible distribution)@*
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (or any RPM compatible distribution)@*
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
To install: @kbd{emerge weechat}
@item
*BSD (not available!)
@item
Slackware (not available!)
@item
Windows (not available!)
@end itemize
Binary packages are available for these distributions:
@itemize @bullet
@item
Debian (or any Debian compatible distribution)@*
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
@item
Mandriva/Redhat (or any RPM compatible distribution)@*
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
To install: @kbd{emerge weechat}
@item
*BSD (not available!)
@item
Slackware (not available!)
@item
Windows (not available!)
@end itemize
where x.y.z is the version (for example 0.0.1)
@*
@@ -176,27 +176,27 @@ All you have to do is to run in a console or a terminal:@*
@kbd{make}@*
Nota: to build only some interfaces, you can give parameters
to ./configure, type @kbd{./configure --help} for help about options.@*
Then get root privileges and install WeeChat:@*
@kbd{su}@*
(enter root password)@*
@kbd{make install}@*
Then get root privileges and install WeeChat:@*
@kbd{su}@*
(enter root password)@*
@kbd{make install}@*
@node CVS sources, , Source package, Installation
@section CVS sources
Warning: CVS sources are for advanced users: it may not compile or not be stable.
You're warned!@*
To get CVS sources, issue these commands:@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(when prompted for a password, just press Enter key)@*
Warning: CVS sources are for advanced users: it may not compile or not be stable.
You're warned!@*
To get CVS sources, issue these commands:@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(when prompted for a password, just press Enter key)@*
Execute this script:@*
@kbd{./autogen.sh}@*
Then follow instructions for source package - @xref{Source package}.
Then follow instructions for source package - @xref{Source package}.
@c ********************************** Usage ***********************************
@@ -206,40 +206,45 @@ Then follow instructions for source package - @xref{Source package}.
@menu
* Run WeeChat::
* Config file::
* Key bindings::
* Config file::
* Key bindings::
* WeeChat commands::
* FIFO pipe::
@end menu
@node Run WeeChat, Config file, Usage, Usage
@section Run WeeChat
@subsection Command line parameters
@subsection Command line parameters
@table @code
@item -c, --config
Display config file help (list of options)@*
@item -h, --help
Display help screen@*
@item -i, --irc-commands
Display IRC commands list@*
@item -l, --license
Display WeeChat license@*
@item -v, --version
@item -v, --version
Display WeeChat version@*
@end table
@subsection Run WeeChat
Just issue this command to run WeeChat:@*
@item -w, --weechat-commands
Display WeeChat commands list@*
@end table
@subsection Run WeeChat
Just issue this command to run WeeChat:@*
@kbd{weechat-curses} (for Curses front-end)@*
or @kbd{weechat-wxwidgets} (for wxWidgets front-end)@*
or @kbd{weechat-gtk} (for Gtk front-end)@*
or @kbd{weechat-qt} (for Qt front-end)@*
When you run WeeChat for the first time, a default configuration file is
created, with default options.@*
The default configuration file is: ~/.weechat/weechat.rc@*
You can edit this file at your convenience to configure WeeChat, or you can
or @kbd{weechat-qt} (for Qt front-end)@*
When you run WeeChat for the first time, a default configuration file is
created, with default options.@*
The default configuration file is: ~/.weechat/weechat.rc@*
You can edit this file at your convenience to configure WeeChat, or you can
set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
@node Config file, Key bindings, Run WeeChat, Usage
@@ -248,7 +253,6 @@ set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
List of options for config file:@*
@table @kbd
@item look_set_title
Set title for window (terminal for Curses GUI) with name & version@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -488,7 +492,7 @@ Default message when away@*
Type: string (any string), default value: 'away'@*
@item irc_default_msg_part
Default part message (leaving channel)@*
Type: string (any string), default value: ''@*
Type: string (any string), default value: 'WeeChat %v'@*
@item irc_default_msg_quit
Default quit message ('%v' will be replaced by WeeChat version in string)@*
Type: string (any string), default value: 'WeeChat %v'@*
@@ -537,12 +541,21 @@ Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item proxy_use
Use a proxy server to connect to irc server@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item proxy_type
Proxy type (http (default), socks4, socks5)@*
Type: string (values: 'http', 'socks4', 'socks5'), default value: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item proxy_address
Proxy server address (IP or hostname)@*
Type: string (any string), default value: ''@*
@item proxy_port
Port for connecting to proxy server@*
Type: integer (values: between 0 and 65535), default value: 1080@*
Type: integer (values: between 0 and 65535), default value: 3128@*
@item proxy_username
Username for proxy server@*
Type: string (any string), default value: ''@*
@item proxy_password
Password for proxy server@*
Type: string (any string), default value: ''@*
@@ -564,6 +577,12 @@ Type: string (any string), default value: ''@*
@item server_port
Port for connecting to server@*
Type: integer (values: between 0 and 65535), default value: 6667@*
@item server_ipv6
Use IPv6 protocol for server communication@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item server_ssl
Use SSL for server communication@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item server_password
Password for IRC server@*
Type: string (any string), default value: ''@*
@@ -594,7 +613,9 @@ Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item server_notify_levels
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
Type: string (any string), default value: ''@*
@end table
Colors for Curses GUI are:@*
@@ -633,11 +654,11 @@ Colors for Curses GUI are:@*
@node Key bindings, WeeChat commands, Config file, Usage
@section Key bindings
@table @kbd
@item Left arrow / Right arrow
Go to previous / next char in command line@*
@*
@*
@item Ctrl + left arrow / Ctrl + right arrow
Go to previous / next word in command line@*
@*
@@ -647,28 +668,28 @@ Go to the beginning of command line@*
@item End / Ctrl + E
Go to the end of command line@*
@*
@item Backspace / Delete
@item Backspace / Delete
Erase previous / next char of command line@*
@*
@item Ctrl + Backspace / Ctrl + W
@*
@item Ctrl + Backspace / Ctrl + W
Erase previous word of command line@*
@*
@item Tab
@*
@item Tab
Complete command or nick (@kbd{Tab} again: find next completion)@*
@*
@item Any char
Insert char to cursor position in the command line@*
@*
@item Enter
@*
@item Any char
Insert char to cursor position in the command line@*
@*
@item Enter
Execute command or send message@*
@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item PageUp / PageDown
@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item PageUp / PageDown
Show buffer history@*
@*
@item F5 / F6
@item F5 / F6
Switch to previous / next buffer@*
@*
@item F7 / F8
@@ -682,8 +703,8 @@ Scroll nicklist@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@item Alt + left arrow / Alt + right arrow
@*
@item Alt + left arrow / Alt + right arrow
Same as F5 / F6@*
@*
@item Alt + A
@@ -715,7 +736,6 @@ Scroll nicklist@*
WeeChat internal commands:@*
@table @kbd
@item alias [alias_name [command [arguments]]
@*
create an alias for a command@*
@@ -779,13 +799,15 @@ list/load/unload Python scripts@*
filename: Python script (file) to load@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@item server [servername] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@*
list, add or remove servers@*
@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
ipv6: use IPv6 protocol@*
ssl: use SSL protocol@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
@@ -821,13 +843,11 @@ splith: split current window horizontally@*
splitv: split current window vertically@*
merge: merge window with another@*
@*
@end table
IRC commands:@*
@table @kbd
@item admin [target]
@*
find information about the administrator of the server@*
@@ -1194,7 +1214,6 @@ nickname: nickname to search@*
count: number of replies to return (full search if negative number)@*
target: reply should match this mask@*
@*
@end table
@node FIFO pipe, , WeeChat commands, Usage
@@ -1443,7 +1462,7 @@ List all Python scripts: @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( name, version, shutdown_function, description );}@*
@command{weechat.register ( name, version, shutdown_function, description )}@*
@*
This is first function to call in Python script.@*
All Python scripts for WeeChat should call this function.@*
@@ -1459,11 +1478,11 @@ unloaded (optional parameter, empty string means nothing is called at the end)
@end itemize
@*
@emph{Example:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@*
@*
@item
@command{weechat.prnt ( message, [channel, [server]] );}@*
@command{weechat.prnt ( message, [channel, [server]] )}@*
@*
Print message in a channel.@*
@@ -1475,13 +1494,13 @@ Print message in a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( delay, message );}@*
@command{weechat.print_infobar ( delay, message )}@*
@*
Print message in infobar.@*
@@ -1493,11 +1512,11 @@ Print message in infobar.@*
@end itemize
@*
@emph{Example:}@*
@code{weechat.print_infobar (5, "message");}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( name, function );}@*
@command{weechat.add_message_handler ( name, function )}@*
@*
Attach a Python function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@@ -1512,18 +1531,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ weechat.print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", my_function)}@*
@code{def my_function(server, args):}@*
@code{@ @ @ @ weechat.prnt("server="+server)}@*
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("host="+hostmask+", channel="+channel+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( name, function );}@*
@command{weechat.add_command_handler ( name, function )}@*
@*
Create new WeeChat command, linked with Python function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -1538,16 +1555,13 @@ available until your Python script will be unloaded.
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("command", my_command)}@*
@code{def my_command(server, args):}@*
@code{@ @ @ @ weechat.prnt("server:"+server+" arguments:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@@ -1559,14 +1573,14 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( name, [server] );}@*
@command{weechat.get_info ( name, [server] )}@*
@*
Get various info about WeeChat, server or user.@*
@@ -1585,8 +1599,8 @@ Get various info about WeeChat, server or user.@*
@end itemize
@*
@emph{Examples:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
@@ -1665,7 +1679,7 @@ Look for WeeChat support page for detail:@*
@node Copyright, , Get support, Authors / Support
@section Copyright
This manual documents WeeChat IRC client, it is part of WeeChat.@*
This manual documents WeeChat IRC client, it is part of WeeChat.@*
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
+69 -56
View File
@@ -35,7 +35,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.2 - 21 de mayo de 2005
@subtitle Documentaci@'on para WeeChat v0.1.3 - 03 de Julio de 2005
@image{weechat_image}
@@ -90,9 +90,9 @@ dise@~nado para diferentes sistemas operativos.@*
Las caracter@'isticas principales son las siguientes:
@itemize @minus
@item
conexi@'on multi-servidores
conexi@'on multi-servidores (con SSL, IPv6, proxy)
@item
m@'ultiples interfaces: Curses, Gtk y Qt
m@'ultiples interfaces: Curses, wxWidgets, Gtk y Qt
@item
peque@~no, r@'apido y ligero.
@item
@@ -100,7 +100,7 @@ parametrizable y extensible mediante guiones (scripts)
@item
conforme a las RFCs 1459, 2810, 2811, 2812, y 2813
@item
multi-plataforma (Gnu/Linux, *BSD, Windows y otros sistemas operativos)
multi-plataforma (Gnu/Linux, *BSD, MacOS X, Windows y otros sistemas operativos)
@item
100% GPL, con Licencia Libre
@end itemize
@@ -223,16 +223,21 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
Obtener la ayuda del fichero de configuraci@'on (lista de opciones)@*
@item -h, --help
Obtener la ayuda@*
@item -i, --irc-commands
Display IRC commands list@*
@item -l, --license
Obtener la licencia de WeeChat@*
@item -v, --version
Obtener la versi@'on de WeeChat@*
@item -w, --weechat-commands
Display WeeChat commands list@*
@end table
@subsection Lanzar WeeChat
Para ejecutar WeeChat, basta escribir la l@'inea siguiente:@*
@kbd{weechat-curses} (para el interfaz con Curses)@*
o @kbd{weechat-wxwidgets} (para el interfaz con wxWidgets)@*
o @kbd{weechat-gtk} (para el interfaz con Gtk)@*
o @kbd{weechat-qt} (para el interfaz con Qt)@*
@@ -247,7 +252,6 @@ Puedes editarlo para configurar WeeChat con las opciones deseadas, o tambi@'en p
Enumeraci@'on de las opciones del fichero de configuraci@'on:@*
@table @kbd
@item look_set_title
Define el t@'itulo de la ventana (el terminal para la interfaz Curses) con el nombre y la versi@'on@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@@ -487,7 +491,7 @@ Mensaje por defecto para el estado ausente@*
Typo: cadena (cualquier cadena), valor por defecto: 'away'@*
@item irc_default_msg_part
Mensaje por defecto de salida (saliendo de un canal)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
@item irc_default_msg_quit
Mensaje de fin por defecto ('%v' ser@'a reemplazado por la versi@'on de WeeChat en la cadena)@*
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
@@ -536,12 +540,21 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item proxy_use
Utilizar un proxy para conectarse al servidor irc@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item proxy_type
Proxy type (http (default), socks4, socks5)@*
Typo: cadena (valores: 'http', 'socks4', 'socks5'), valor por defecto: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item proxy_address
Direcci@'on del servidor proxy (IP o nombre de m@'aquina)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_port
Puerto para conectarse al servidor proxy@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 1080@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 3128@*
@item proxy_username
Username for proxy server@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_password
Contrase@~na para el servidor proxy@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@@ -563,6 +576,12 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item server_port
Puerto para conectarse al servidor@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 6667@*
@item server_ipv6
Use IPv6 protocol for server communication@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_ssl
Use SSL for server communication@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_password
Contrase@~na para el servidor IRC@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@@ -593,7 +612,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item server_autorejoin
Unirse de nuevo autom@'aticamente a los canales cuando sea expulsado@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item server_notify_levels
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@end table
Los colores para el interfaz Curses son:@*
@@ -630,7 +651,6 @@ Los colores para el interfaz Curses son:@*
@kbd{white}: blanco
@end itemize
@node Atajos de teclado, Comandos WeeChat, Ficheros de configuracion, Uso
@section Atajos de teclado
@@ -715,7 +735,6 @@ Scroll nicklist@*
Comandos internos WeeChat:@*
@table @kbd
@item alias [nombre_alias [comando [argumentos]]
@*
crear un alias para un comando@*
@@ -779,19 +798,21 @@ lista/carga/descarga de los Python scripts@*
fichero: Python script (archivo) a cargar@*
Sin argumentos, el comando /python lista todos los Python scripts cargados.@*
@*
@item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-ipv6] [-ssl] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@*
lista, a@~nade o elimina servidores@*
@*
nombre_de_servidor: nombre del servidor, para uso interno y para mostrar@*
nombre/IP: nombre o direcci@'on IP del servidor@*
puerto: puerto para el servidor (nĂşmero entero)@*
contrase@~na: contrase@~na para el servidor@*
alias1: primer alias para el servidor@*
alias2: alias alternativo para el servidor@*
alias3: segundo alias alternativo para el servidor@*
nombre_de_usuario: nombre de usuario@*
nombre_real: nombre real del usuario@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
ipv6: use IPv6 protocol@*
ssl: use SSL protocol@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
nick3: second alternate nick for server@*
username: user name@*
realname: real name of user@*
@*
@item save [archivo]
@*
@@ -821,13 +842,11 @@ splith: dividir la ventana actual horizontalmente@*
splitv: dividir la ventana actual verticalmente@*
merge: fusionar una ventana con otra@*
@*
@end table
Comandos IRC:@*
@table @kbd
@item admin [target]
@*
encontrar informaci@'on sobre el administrador del servidor@*
@@ -1194,7 +1213,6 @@ usuario: nombre de usuario a buscar@*
nĂşmero: nĂşmero de respuestas a devolver (bĂşsqueda completa si el nĂşmero es negativo)@*
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
@*
@end table
@node Canal FIFO, , Comandos WeeChat, Uso
@@ -1445,7 +1463,7 @@ Listar los programas Python cargados: @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on )}@*
@*
Es la primera funci@'on a la que llamar en el programa Python.@*
Todos los programas en Python para WeeChat deben llamar esta funci@'on.@*
@@ -1461,11 +1479,11 @@ tener un nombre distinto)
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...")}@*
@*
@item
@command{weechat.prnt ( mensaje, [canal, [servidor]] );}@*
@command{weechat.prnt ( mensaje, [canal, [servidor]] )}@*
@*
Escribe un mensaje en un canal.@*
@@ -1477,29 +1495,29 @@ Escribe un mensaje en un canal.@*
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.prnt ("mensaje");}@*
@code{weechat.prnt ("mensaje", "#weechat");}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode");}@*
@code{weechat.prnt ("mensaje")}@*
@code{weechat.prnt ("mensaje", "#weechat")}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( retraso, mensaje );}@*
@command{weechat.print_infobar ( retraso, mensaje )}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{plazo}: periodo en segundo durante el cual se mostrar@'a el mensaje
@item @option{retraso}: periodo en segundo durante el cual se mostrar@'a el mensaje
(si es 0, el mensaje no se borrar@'a).
@item @option{message}: mensaje que se escribir@'a en la barra de informaciones.
@item @option{mensaje}: mensaje que se escribir@'a en la barra de informaciones.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.print_infobar (5, "mensaje");}@*
@code{weechat.print_infobar (5, "mensaje")}@*
@*
@item
@command{weechat.add_message_handler ( nombre, funci@'on );}@*
@command{weechat.add_message_handler ( nombre, funci@'on )}@*
@*
Adjunta una funci@'on Python a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@@ -1515,18 +1533,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", mi_funcion)}@*
@code{def mi_funcion(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("servidor="+servidor)}@*
@code{@ @ @ @ null, canal, mensaje = string.split(args, ":", 2)}@*
@code{@ @ @ @ mascara, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("mascara="+mascara+", canal="+canal+", mensaje="+mensaje)}@*
@*
@item
@command{weechat.add_command_handler ( nombre, funci@'on );}@*
@command{weechat.add_command_handler ( nombre, funci@'on )}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Python.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@@ -1541,16 +1557,13 @@ al antiguo comando si el script Python est@'a cargado.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("comando", mi_comando)}@*
@code{def mi_comando(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("Servidor:"+servidor+" Par@'ametros:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@@ -1562,13 +1575,13 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nombre, [servidor] );}@*
@command{weechat.get_info ( nombre, [servidor] )}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@@ -1587,8 +1600,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
+156 -142
View File
@@ -35,7 +35,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.2 - 21 Mai 2005
@subtitle Documentation pour WeeChat v0.1.3 - 03 Juillet 2005
@image{weechat_image}
@@ -83,27 +83,27 @@ License version 2 ou plus.
@node Description, Pre-requis, Introduction, Introduction
@section Description
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
concu pour diff@'erents syst@`emes d'exploitation.@*
@*
Ses principales caract@'eristiques sont les suivantes :
@*
Ses principales caract@'eristiques sont les suivantes :
@itemize @minus
@item
connexion multi-serveurs
@item
plusieurs interfaces : Curses, Gtk et Qt
@item
petit, rapide et l@'eger
@item
param@'etrable et extensible avec des scripts
@item
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
@item
multi-plateformes (Gnu/Linux, *BSD, Windows et d'autres syst@`emes)
@item
@item
connexion multi-serveurs (avec SSL, IPv6, proxy)
@item
plusieurs interfaces : Curses, wxWidgets, Gtk et Qt
@item
petit, rapide et l@'eger
@item
param@'etrable et extensible avec des scripts
@item
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
@item
multi-plateformes (Gnu/Linux, *BSD, MacOS X, Windows et d'autres syst@`emes)
@item
100% GPL, logiciel libre
@end itemize
@end itemize
@*
La page d'accueil de WeeChat est ici :@*
@uref{http://weechat.flashtux.org}@*
@@ -115,20 +115,20 @@ Pour installer WeeChat, vous @b{devez} avoir :@*
@itemize @bullet
@item
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
@item
Droits "root" (pour installer WeeChat)
@item
Selon l'interface, une des biblioth@`eques suivantes :
@itemize @minus
@item
Curses: la librairie ncurses,
@item
Gtk: *** interface non d@'evelopp@'ee ***,
@item
Qt: *** interface non d@'evelopp@'ee ***,
Selon l'interface, une des biblioth@`eques suivantes :
@itemize @minus
@item
Curses: la librairie ncurses,
@item
Gtk: *** interface non d@'evelopp@'ee ***,
@item
Qt: *** interface non d@'evelopp@'ee ***,
@end itemize
@end itemize
@end itemize
@c ******************************* Installation *******************************
@@ -138,31 +138,31 @@ Qt: *** interface non d@'evelopp@'ee ***,
@menu
* Paquet binaire::
* Paquet source::
* Paquet source::
* Sources CVS::
@end menu
@node Paquet binaire, Paquet source, Installation, Installation
@section Paquet binaire
Les paquets binaires sont disponibles pour les distributions suivantes :
@itemize @bullet
@item
Debian (ou toute distribution compatible Debian)@*
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
Pour installer : @kbd{emerge weechat}
@item
*BSD (non disponible !)
@item
Slackware (non disponible !)
@item
Windows (non disponible !)
@end itemize
Les paquets binaires sont disponibles pour les distributions suivantes :
@itemize @bullet
@item
Debian (ou toute distribution compatible Debian)@*
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
Pour installer : @kbd{emerge weechat}
@item
*BSD (non disponible !)
@item
Slackware (non disponible !)
@item
Windows (non disponible !)
@end itemize
o@`u x.y.z est la version (par exemple 0.0.1)
@*
@@ -175,28 +175,28 @@ Tapez simplement dans une console ou un terminal :@*
@kbd{make}@*
Note: pour ne construire que certaines interfaces, vous pouvez passer des param@`etres
@`a ./configure, tapez @kbd{./configure --help} pour de l'aide sur ces options.@*
Obtenez les droits root et installez WeeChat :@*
@kbd{su}@*
(entrez le mot de passe de root)@*
@kbd{make install}@*
Obtenez les droits root et installez WeeChat :@*
@kbd{su}@*
(entrez le mot de passe de root)@*
@kbd{make install}@*
@node Sources CVS, , Paquet source, Installation
@section Sources CVS
@section Sources CVS
Attention: les sources CVS sont r@'eserv@'es aux utilisateurs avanc@'es : il se peut
que WeeChat ne compile pas et qu'il soit tr@`s instable.
Vous @^etes pr@'evenus !@*
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
que WeeChat ne compile pas et qu'il soit tr@`s instable.
Vous @^etes pr@'evenus !@*
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
Ex@'ecutez ce script :@*
@kbd{./autogen.sh}@*
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
@c ******************************* Utilisation ********************************
@@ -206,40 +206,45 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
@menu
* Lancer WeeChat::
* Fichier de configuration::
* Raccourcis clavier::
* Fichier de configuration::
* Raccourcis clavier::
* Commandes WeeChat::
* Tube FIFO::
@end menu
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
@section Lancer WeeChat
@subsection Param@`etres de ligne de commande
@subsection Param@`etres de ligne de commande
@table @code
@item -c, --config
Afficher l'aide sur le fichier de config (liste des options)@*
@item -h, --help
Afficher l'aide@*
@item -i, --irc-commands
Afficher la liste des commandes IRC@*
@item -l, --license
Afficher la licence de WeeChat@*
@item -v, --version
@item -v, --version
Afficher la version de WeeChat@*
@end table
@subsection Lancer WeeChat
Tapez simplement cette commande pour lancer WeeChat :@*
@item -w, --weechat-commands
Afficher la liste des commandes WeeChat@*
@end table
@subsection Lancer WeeChat
Tapez simplement cette commande pour lancer WeeChat :@*
@kbd{weechat-curses} (pour l'interface Curses)@*
ou @kbd{weechat-wxwidgets} (pour l'interface wxWidgets)@*
ou @kbd{weechat-gtk} (pour l'interface Gtk)@*
ou @kbd{weechat-qt} (pour l'interface Qt)@*
ou @kbd{weechat-qt} (pour l'interface Qt)@*
Lorsque vous lancez WeeChat pour la premi@`ere fois, un fichier de configuration
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} - @xref{Commandes WeeChat}.
@node Fichier de configuration, Raccourcis clavier, Lancer WeeChat, Utilisation
@@ -248,7 +253,6 @@ vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} -
Liste des options du fichier de configuration :@*
@table @kbd
@item look_set_title
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -418,7 +422,7 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
Couleur pour le symbole voix@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Couleur pour les '+' lors du scroll sur les pseudos@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_sep
Couleur pour le s@'eparateur de pseudo@*
@@ -488,7 +492,7 @@ Message par d@'efaut pour l'absence@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'away'@*
@item irc_default_msg_part
Message par d@'efaut pour le part (quitte un canal)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@item irc_default_msg_quit
Message de fin par d@'efaut ('%v' sera remplac@'e par la version de WeeChat dans la cha@^ine)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@@ -537,12 +541,21 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item proxy_use
Utiliser un proxy pour se connecter au serveur irc@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item proxy_type
Type de proxy (http (d@'efaut), socks4, socks5)@*
Type: cha@^ine (valeurs: 'http', 'socks4', 'socks5'), valeur par d@'efaut: 'http'@*
@item proxy_ipv6
Se connecter au proxy en ipv6@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item proxy_address
Adresse du serveur proxy (IP ou nom)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item proxy_port
Port pour se connecter au serveur proxy@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 1080@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 3128@*
@item proxy_username
Nom d'utilisateur pour le serveur proxy@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item proxy_password
Mot de passe pour le serveur proxy@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -564,6 +577,12 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_port
Port pour se connecter au serveur@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 6667@*
@item server_ipv6
Utiliser le protocole IPv6 pour la communication avec le serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item server_ssl
Utiliser SSL pour la communication avec le serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item server_password
Mot de passe pour le serveur IRC@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -594,7 +613,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_autorejoin
Rejoindre automatiquement les canaux quand mis dehors@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item server_notify_levels
Liste des niveaux de notifications (s@'epar@'es par des virgules) pour les canaux de ce serveur (format: #canal:1,..)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@end table
Les couleurs pour l'interface Curses sont :@*
@@ -633,11 +654,11 @@ Les couleurs pour l'interface Curses sont :@*
@node Raccourcis clavier, Commandes WeeChat, Fichier de configuration, Utilisation
@section Raccourcis clavier
@table @kbd
@item Fl@`eche gauche / Fl@`eche droite
Aller au caract@`ere pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@*
@item Ctrl + fl@`eche gauche / Ctrl + fl@`eche droite
Aller au mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@@ -647,28 +668,28 @@ Aller au d@'ebut de la ligne de commande@*
@item End / Ctrl + E
Aller @`a la fin de la ligne de commande@*
@*
@item Backspace / Delete
@item Backspace / Delete
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@item Ctrl + Backspace / Ctrl + W
@*
@item Ctrl + Backspace / Ctrl + W
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
@*
@item Tab
@*
@item Tab
Compl@'eter la commande ou le pseudo (@kbd{Tab} @`a nouveau : trouver la compl@'etion suivante)@*
@*
@item Tout caract@`ere
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
@*
@item Entr@'ee
@*
@item Tout caract@`ere
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
@*
@item Entr@'ee
Ex@'ecuter la commande ou envoyer le message@*
@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item PageUp / PageDown
@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item PageUp / PageDown
Afficher l'historique du tampon@*
@*
@item F5 / F6
@*
@item F5 / F6
Aller au tampon pr@'ec@'edent / suivant@*
@*
@item F7 / F8
@@ -683,7 +704,7 @@ Faire d@'efiler la liste des pseudos@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
Identique @`a F5 / F6@*
@*
@item Alt + A
@@ -715,7 +736,6 @@ Faire d@'efiler la liste des pseudos@*
Commandes internes WeeChat :@*
@table @kbd
@item alias [nom_alias [commande [param@`etres]]
@*
cr@'eer un alias pour une commande@*
@@ -779,13 +799,15 @@ liste/charge/d@'echarge des scripts Python@*
fichier: script Python (fichier) @`a charger@*
Sans param@`etre, la commande /python liste tous les scripts Python charg@'es.@*
@*
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-ipv6] [-ssl] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@*
liste, ajoute ou retire des serveurs@*
@*
nom_serveur: nom du serveur, pour usage interne et affichage@*
nom/IP: nom ou adresse IP du serveur@*
port: port pour le serveur (nombre entier)@*
ipv6: utiliser le protocole IPv6@*
ssl: utiliser le protocole SSL@*
mot_de_passe: mot de passe pour le serveur@*
pseudo1: premier pseudo pour le serveur@*
pseudo2: pseudo alternatif pour le serveur@*
@@ -821,13 +843,11 @@ splith: @'eclate la fen@^etre en deux horizontalement@*
splitv: @'eclate la fen@^etre en deux verticalement@*
merge: fusionne la fen@^etre avec une autre@*
@*
@end table
Commandes IRC :@*
@table @kbd
@item admin [cible]
@*
trouver les informations sur l'administrateur du serveur@*
@@ -1194,7 +1214,6 @@ pseudo: pseudo @`a chercher@*
nombre: nombre de r@'eponses @`a retourner (recherche compl@`ete si nombre n@'egatif)@*
cible: la r@'eponse doit correspondre @`a ce masque@*
@*
@end table
@node Tube FIFO, , Commandes WeeChat, Utilisation
@@ -1444,7 +1463,7 @@ Lister les scripts Python charg@'es : @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( nom, version, fonction_de_fin, description );}@*
@command{weechat.register ( nom, version, fonction_de_fin, description )}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Python.@*
Tout script Python pour WeeChat doit appeler cette fonction.@*
@@ -1461,11 +1480,11 @@ de fonction @`a appeler)
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !")}@*
@*
@item
@command{weechat.prnt ( message, [canal, [serveur]] );}@*
@command{weechat.prnt ( message, [canal, [serveur]] )}@*
@*
Affiche un message dans un canal.@*
@@ -1477,13 +1496,13 @@ Affiche un message dans un canal.@*
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( d@'elai, message );}@*
@command{weechat.print_infobar ( d@'elai, message )}@*
@*
Affiche un message dans la barre d'infos.@*
@@ -1495,11 +1514,11 @@ Affiche un message dans la barre d'infos.@*
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.print_infobar (5, "message");}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( nom, fonction );}@*
@command{weechat.add_message_handler ( nom, fonction )}@*
@*
Attache une fonction Python @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@@ -1515,18 +1534,16 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", ma_fonction)}@*
@code{def ma_fonction(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur="+serveur)}@*
@code{@ @ @ @ null, canal, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ masque, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("masque="+masque+", canal="+canal+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( nom, fonction );}@*
@command{weechat.add_command_handler ( nom, fonction )}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Python.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@@ -1541,16 +1558,13 @@ ne seront plus accessibles tant que le script Python sera charg@'e.
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("commande", ma_commande)}@*
@code{def ma_commande(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur:"+serveur+" param@`etres:"+args)}@*
@*
@item
@command{weechat.command ( commande, [canal, [serveur]] );}@*
@command{weechat.command ( commande, [canal, [serveur]] )}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@@ -1562,13 +1576,13 @@ Ex@'ecute une commande ou envoie un message @'a un canal.@*
@end itemize
@*
@emph{Exemples :}@*
@code{weechat.command ("bonjour tout le monde !");}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("bonjour tout le monde !")}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nom, [serveur] );}@*
@command{weechat.get_info ( nom, [serveur] )}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@@ -1587,8 +1601,8 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@end itemize
@*
@emph{Exemples :}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
+924 -36
View File
File diff suppressed because it is too large Load Diff
+460 -341
View File
File diff suppressed because it is too large Load Diff
+466 -340
View File
File diff suppressed because it is too large Load Diff
+479 -358
View File
File diff suppressed because it is too large Load Diff
+30 -10
View File
@@ -84,13 +84,15 @@ t_weechat_command weechat_commands[] =
0, 2, weechat_cmd_python, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 "
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
"[nick2 [nick3]]] [-username username] [-realname realname] "
"[-command command] [-autojoin channel[,channel]] ] | "
"[del servername]"),
N_("servername: server name, for internal & display use\n"
"hostname: name or IP address of server\n"
"port: port for server (integer)\n"
"ipv6: use IPv6 protocol\n"
"ssl: use SSL protocol\n"
"password: password for server\n"
"nick1: first nick for server\n"
"nick2: alternate nick for server\n"
@@ -706,7 +708,7 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
ptr_nick = nick_search (CHANNEL(buffer), server->nick);
if (ptr_nick)
{
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick,
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_color (CHANNEL(buffer)->buffer,
COLOR_WIN_CHAT, "%s\n", command);
@@ -995,7 +997,8 @@ weechat_cmd_buffer (int argc, char **argv)
(ptr_buffer->dcc) ? "DCC" :
((BUFFER_IS_SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
CHANNEL(ptr_buffer)->name));
if (ptr_buffer->dcc)
if ((!BUFFER_IS_CHANNEL(ptr_buffer))
&& (!BUFFER_IS_PRIVATE(ptr_buffer)))
gui_printf (NULL, "-");
else
gui_printf (NULL, "%d", ptr_buffer->notify_level);
@@ -1010,22 +1013,34 @@ weechat_cmd_buffer (int argc, char **argv)
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0'))
{
if ((number < 0) || (number > 3))
if ((number < NOTIFY_LEVEL_MIN) || (number > NOTIFY_LEVEL_MAX))
{
/* invalid highlight level */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
return -1;
}
if ((!BUFFER_IS_CHANNEL(gui_current_window->buffer))
&& (!BUFFER_IS_PRIVATE(gui_current_window->buffer)))
{
/* invalid buffer type (only ok on channel or private) */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect buffer for notify (must be channel or private)\n"),
WEECHAT_ERROR);
return -1;
}
gui_current_window->buffer->notify_level = number;
channel_set_notify_level (SERVER(gui_current_window->buffer),
CHANNEL(gui_current_window->buffer),
number);
}
else
{
/* invalid number */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
WEECHAT_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
return -1;
}
}
@@ -1554,7 +1569,7 @@ weechat_cmd_python (int argc, char **argv)
path_script = NULL;
else
{
path_length = strlen (weechat_home) + strlen (argv[1]) + 7;
path_length = strlen (weechat_home) + strlen (argv[1]) + 9;
path_script = (char *) malloc (path_length * sizeof (char));
snprintf (path_script, path_length, "%s%s%s%s%s",
weechat_home, DIR_SEPARATOR, "python",
@@ -1751,6 +1766,10 @@ weechat_cmd_server (int argc, char **argv)
server.autoconnect = 1;
if (strcasecmp (argv[i], "-noauto") == 0)
server.autoconnect = 0;
if (strcasecmp (argv[i], "-ipv6") == 0)
server.ipv6 = 1;
if (strcasecmp (argv[i], "-ssl") == 0)
server.ssl = 1;
if (strcasecmp (argv[i], "-pwd") == 0)
{
if (i == (argc - 1))
@@ -1838,10 +1857,11 @@ weechat_cmd_server (int argc, char **argv)
new_server = server_new (server.name, server.autoconnect,
server.autoreconnect,
server.autoreconnect_delay,
0, server.address, server.port, server.password,
0, server.address, server.port, server.ipv6,
server.ssl, server.password,
server.nick1, server.nick2, server.nick3,
server.username, server.realname,
server.command, 1, server.autojoin, 1);
server.command, 1, server.autojoin, 1, NULL);
if (new_server)
{
irc_display_prefix (NULL, PREFIX_INFO);
+86 -16
View File
@@ -47,6 +47,7 @@ completion_init (t_completion *completion)
completion->base_command_arg = 0;
completion->position = -1;
completion->base_word = NULL;
completion->args = NULL;
completion->completion_list = NULL;
completion->last_completion = NULL;
@@ -67,6 +68,10 @@ completion_free (t_completion *completion)
free (completion->base_word);
completion->base_word = NULL;
if (completion->args)
free (completion->args);
completion->args = NULL;
while (completion->completion_list)
weelist_remove (&completion->completion_list,
&completion->last_completion,
@@ -97,8 +102,11 @@ completion_build_list (t_completion *completion, void *channel)
int i, j;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
char option_name[256];
char *pos, option_name[256];
t_weechat_alias *ptr_alias;
t_config_option *option;
void *option_value;
char option_string[2048];
/* WeeChat internal commands */
@@ -211,32 +219,92 @@ completion_build_list (t_completion *completion, void *channel)
"unload");
return;
}
if ((strcasecmp (completion->base_command, "set") == 0)
&& (completion->base_command_arg == 1))
if (strcasecmp (completion->base_command, "set") == 0)
{
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
if (completion->base_command_arg == 1)
{
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
for (j = 0; weechat_options[i][j].option_name; j++)
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
}
}
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
option_name);
}
}
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
else if (completion->base_command_arg == 3)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
if (completion->args)
{
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_name);
pos = strchr (completion->args, ' ');
if (pos)
pos[0] = '\0';
option = NULL;
option_value = NULL;
config_option_search_option_value (completion->args, &option, &option_value);
if (option && option_value)
{
switch (option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (option_value && (*((int *)(option_value))))
weelist_add (&completion->completion_list,
&completion->last_completion,
"on");
else
weelist_add (&completion->completion_list,
&completion->last_completion,
"off");
break;
case OPTION_TYPE_INT:
snprintf (option_string, sizeof (option_string) - 1,
"%d", (option_value) ? *((int *)(option_value)) : option->default_int);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_string);
break;
case OPTION_TYPE_INT_WITH_STRING:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
option->array_values[*((int *)(option_value))] :
option->array_values[option->default_int]);
break;
case OPTION_TYPE_COLOR:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
gui_get_color_by_value (*((int *)(option_value))) :
option->default_string);
break;
case OPTION_TYPE_STRING:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
*((char **)(option_value)) :
option->default_string);
break;
}
}
if (pos)
pos[0] = ' ';
}
}
return;
@@ -471,6 +539,8 @@ completion_find_context (t_completion *completion, void *channel, char *buffer,
command_arg++;
i++;
while ((i < pos) && (buffer[i] == ' ')) i++;
if (!completion->args)
completion->args = strdup (buffer + i);
}
else
i++;
+1
View File
@@ -39,6 +39,7 @@ struct t_completion
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
char *args; /* command line args (including base word) */
/* for command argument completion */
t_weelist *completion_list; /* data list for completion */
+26 -4
View File
@@ -48,6 +48,10 @@
#include <time.h>
#include <signal.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
@@ -70,9 +74,13 @@ int sigsegv = 0; /* SIGSEGV received?
char *weechat_home = NULL; /* WeeChat home dir. (example: /home/toto/.weechat) */
FILE *weechat_log_file = NULL; /* WeeChat log file (~/.weechat/weechat.log) */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1 */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1 */
int server_cmd_line; /* at least one server on WeeChat command line */
int server_cmd_line; /* at least one server on WeeChat command line */
#ifdef HAVE_GNUTLS
gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
#endif
/*
@@ -356,7 +364,7 @@ wee_parse_args (int argc, char *argv[])
wee_display_commands (1, 0);
wee_shutdown (EXIT_SUCCESS);
}
else if ((strncasecmp (argv[i], "irc://", 6) == 0))
else if ((strncasecmp (argv[i], "irc", 3) == 0))
{
if (server_init_with_url (argv[i], &server_tmp) < 0)
{
@@ -369,9 +377,10 @@ wee_parse_args (int argc, char *argv[])
server_tmp.autoreconnect,
server_tmp.autoreconnect_delay,
1, server_tmp.address, server_tmp.port,
server_tmp.ipv6, server_tmp.ssl,
server_tmp.password, server_tmp.nick1,
server_tmp.nick2, server_tmp.nick3,
NULL, NULL, NULL, 0, server_tmp.autojoin, 1))
NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL))
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
WEECHAT_WARNING, argv[i]);
server_destroy (&server_tmp);
@@ -516,6 +525,13 @@ wee_init_vars ()
/* init received messages queue */
recv_msgq = NULL;
msgq_last_msg = NULL;
/* init gnutls */
#ifdef HAVE_GNUTLS
gnutls_global_init ();
gnutls_certificate_allocate_credentials (&gnutls_xcred);
gnutls_certificate_set_x509_trust_file (gnutls_xcred, "ca.pem", GNUTLS_X509_FMT_PEM);
#endif
}
/*
@@ -609,6 +625,12 @@ wee_shutdown (int return_code)
if (local_charset)
free (local_charset);
alias_free_all ();
#ifdef HAVE_GNUTLS
gnutls_certificate_free_credentials (gnutls_xcred);
gnutls_global_deinit();
#endif
exit (return_code);
}
+9 -1
View File
@@ -28,6 +28,10 @@
#include <stdio.h>
#include <sys/time.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#if defined(ENABLE_NLS) && !defined(_)
#include <locale.h>
#ifdef HAVE_LIBINTL_H
@@ -82,7 +86,7 @@
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
"Usage: %s [options ...]\n" \
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
" or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]\n\n"
#define WEE_USAGE2 \
" -c, --config display config file options\n" \
@@ -108,6 +112,10 @@ extern int quit_weechat;
extern char *weechat_home;
extern char *local_charset;
#ifdef HAVE_GNUTLS
extern gnutls_certificate_credentials gnutls_xcred;
#endif
extern void wee_log_printf (char *, ...);
extern void wee_dump (int);
extern char *weechat_convert_encoding (char *, char *, char *);
+137 -16
View File
@@ -514,7 +514,7 @@ t_config_option weechat_options_irc[] =
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
{ "irc_default_msg_quit", N_("default quit message"),
N_("default quit message ('%v' will be replaced by WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -597,8 +597,13 @@ t_config_option weechat_options_dcc[] =
/* config, proxy section */
int cfg_proxy_use;
int cfg_proxy_type;
int cfg_proxy_ipv6;
char *cfg_proxy_type_values[] =
{ "http", "socks4", "socks5", NULL };
char *cfg_proxy_address;
int cfg_proxy_port;
char *cfg_proxy_username;
char *cfg_proxy_password;
t_config_option weechat_options_proxy[] =
@@ -606,14 +611,26 @@ t_config_option weechat_options_proxy[] =
N_("use a proxy server to connect to irc server"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_proxy_use, NULL, config_change_noop },
{ "proxy_type", N_("proxy type"),
N_("proxy type (http (default), socks4, socks5)"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"http", cfg_proxy_type_values, &cfg_proxy_type, NULL, config_change_noop },
{ "proxy_ipv6", N_("use ipv6 proxy"),
N_("connect to proxy in ipv6"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_proxy_ipv6, NULL, config_change_noop },
{ "proxy_address", N_("proxy address"),
N_("proxy server address (IP or hostname)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_address, config_change_noop },
{ "proxy_port", N_("port for proxy"),
N_("port for connecting to proxy server"),
OPTION_TYPE_INT, 0, 65535, 1080,
OPTION_TYPE_INT, 0, 65535, 3128,
NULL, NULL, &cfg_proxy_port, NULL, config_change_noop },
{ "proxy_username", N_("proxy username"),
N_("username for proxy server"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_username, config_change_noop },
{ "proxy_password", N_("proxy password"),
N_("password for proxy server"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -650,6 +667,14 @@ t_config_option weechat_options_server[] =
N_("port for connecting to server"),
OPTION_TYPE_INT, 0, 65535, 6667,
NULL, NULL, &(cfg_server.port), NULL, NULL },
{ "server_ipv6", N_("use IPv6 protocol for server communication"),
N_("use IPv6 protocol for server communication"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &(cfg_server.ipv6), NULL, NULL },
{ "server_ssl", N_("use SSL for server communication"),
N_("use SSL for server communication"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &(cfg_server.ssl), NULL, NULL },
{ "server_password", N_("server password"),
N_("password for IRC server"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -690,6 +715,10 @@ t_config_option weechat_options_server[] =
N_("automatically rejoin channels when kicked"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &(cfg_server.autorejoin), NULL, NULL },
{ "server_notify_levels", N_("notify levels for channels of this server"),
N_("comma separated list of notify levels for channels of this server (format: #channel:1,..)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.notify_levels), config_change_notify_levels },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -834,6 +863,23 @@ config_change_fifo_pipe ()
}
}
/*
* config_change_notify_levels: called when notify levels is changed for a server
*/
void
config_change_notify_levels ()
{
t_gui_buffer *ptr_buffer;
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (BUFFER_IS_CHANNEL(ptr_buffer) || BUFFER_IS_PRIVATE(ptr_buffer))
ptr_buffer->notify_level =
channel_get_notify_level (SERVER(ptr_buffer), CHANNEL(ptr_buffer));
}
}
/*
* config_option_set_value: set new value for an option
* return: 0 if success
@@ -899,6 +945,10 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
return (void *)(&server->address);
if (strcasecmp (option_name, "server_port") == 0)
return (void *)(&server->port);
if (strcasecmp (option_name, "server_ipv6") == 0)
return (void *)(&server->ipv6);
if (strcasecmp (option_name, "server_ssl") == 0)
return (void *)(&server->ssl);
if (strcasecmp (option_name, "server_password") == 0)
return (void *)(&server->password);
if (strcasecmp (option_name, "server_nick1") == 0)
@@ -919,6 +969,8 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
return (void *)(&server->autojoin);
if (strcasecmp (option_name, "server_autorejoin") == 0)
return (void *)(&server->autorejoin);
if (strcasecmp (option_name, "server_notify_levels") == 0)
return (void *)(&server->notify_levels);
/* option not found */
return NULL;
}
@@ -988,6 +1040,8 @@ config_set_server_value (t_irc_server *server, char *option_name,
*((char **)ptr_data) = strdup (value);
break;
}
if (ptr_option->handler_change != NULL)
(void) (ptr_option->handler_change());
return 0;
}
@@ -1017,6 +1071,72 @@ config_option_search (char *option_name)
return NULL;
}
/*
* config_option_search_option_value: look for type and value of an option
* (including server options)
* if option is not found, NULL is returned
*/
void
config_option_search_option_value (char *option_name, t_config_option **option,
void **option_value)
{
t_config_option *ptr_option;
t_irc_server *ptr_server;
int i;
void *ptr_value;
char *pos;
ptr_option = NULL;
ptr_value = NULL;
ptr_option = config_option_search (option_name);
if (!ptr_option)
{
pos = strchr (option_name, '.');
if (pos)
{
pos[0] = '\0';
ptr_server = server_search (option_name);
if (ptr_server)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
if (strcmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name,
pos + 1) == 0)
{
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
ptr_value = config_get_server_option_ptr (ptr_server, pos + 1);
break;
}
}
}
pos[0] = '.';
}
}
else
{
switch (ptr_option->option_type)
{
case OPTION_TYPE_BOOLEAN:
case OPTION_TYPE_INT:
case OPTION_TYPE_INT_WITH_STRING:
case OPTION_TYPE_COLOR:
ptr_value = (void *)(ptr_option->ptr_int);
break;
case OPTION_TYPE_STRING:
ptr_value = (void *)(ptr_option->ptr_string);
break;
}
}
if (ptr_option)
{
*option = ptr_option;
*option_value = ptr_value;
}
}
/*
* config_set_value: set new value for an option (found by name)
* return: 0 if success
@@ -1068,12 +1188,13 @@ config_allocate_server (char *filename, int line_number)
return 0;
}
if (!server_new (cfg_server.name,
cfg_server.autoconnect, cfg_server.autoreconnect,
cfg_server.autoreconnect_delay, 0, cfg_server.address, cfg_server.port,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin))
cfg_server.autoconnect, cfg_server.autoreconnect,
cfg_server.autoreconnect_delay, 0, cfg_server.address,
cfg_server.port, cfg_server.ipv6, cfg_server.ssl,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin, cfg_server.notify_levels))
{
server_free_all ();
gui_printf (NULL,
@@ -1402,10 +1523,6 @@ config_create_default ()
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
{
switch (weechat_options[i][j].option_type)
@@ -1471,6 +1588,8 @@ config_create_default ()
fprintf (file, "server_autoreconnect_delay=30\n");
fprintf (file, "server_address=irc.freenode.net\n");
fprintf (file, "server_port=6667\n");
fprintf (file, "server_ipv6=off\n");
fprintf (file, "server_ssl=off\n");
fprintf (file, "server_password=\n");
/* Get the user's name from /etc/passwd */
@@ -1574,10 +1693,6 @@ config_write (char *config_name)
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
{
switch (weechat_options[i][j].option_type)
@@ -1647,6 +1762,10 @@ config_write (char *config_name)
ptr_server->autoreconnect_delay);
fprintf (file, "server_address=%s\n", ptr_server->address);
fprintf (file, "server_port=%d\n", ptr_server->port);
fprintf (file, "server_ipv6=%s\n",
(ptr_server->ipv6) ? "on" : "off");
fprintf (file, "server_ssl=%s\n",
(ptr_server->ssl) ? "on" : "off");
fprintf (file, "server_password=%s\n",
(ptr_server->password) ? ptr_server->password : "");
fprintf (file, "server_nick1=%s\n", ptr_server->nick1);
@@ -1661,6 +1780,8 @@ config_write (char *config_name)
(ptr_server->autojoin) ? ptr_server->autojoin : "");
fprintf (file, "server_autorejoin=%s\n",
(ptr_server->autorejoin) ? "on" : "off");
fprintf (file, "server_notify_levels=%s\n",
(ptr_server->notify_levels) ? ptr_server->notify_levels : "");
}
}
+6
View File
@@ -178,8 +178,12 @@ extern int cfg_dcc_auto_rename;
extern int cfg_dcc_auto_resume;
extern int cfg_proxy_use;
extern int cfg_proxy_type;
extern char *cfg_proxy_type_values[];
extern int cfg_proxy_ipv6;
extern char *cfg_proxy_address;
extern int cfg_proxy_port;
extern char *cfg_proxy_username;
extern char *cfg_proxy_password;
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
@@ -193,8 +197,10 @@ extern void config_change_buffer_content ();
extern void config_change_color ();
extern void config_change_away_check ();
extern void config_change_fifo_pipe ();
extern void config_change_notify_levels ();
extern int config_option_set_value (t_config_option *, char *);
extern t_config_option *config_option_search (char *);
extern void config_option_search_option_value (char *, t_config_option **, void **);
extern int config_set_value (char *, char *);
extern void *config_get_server_option_ptr (t_irc_server *, char *);
extern int config_set_server_value (t_irc_server *, char *, char *);
+2 -1
View File
@@ -23,7 +23,8 @@ weechat_curses_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(NCURSES_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS) \
$(GNUTLS_LIBS)
weechat_curses_SOURCES = gui-display.c \
gui-input.c
+48 -48
View File
@@ -1328,7 +1328,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
mvwprintw (ptr_win->win_status, 0, x, "%s", string);
else
{
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", strlen (string));
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", (int)(strlen (string)));
mvwprintw (ptr_win->win_status, 0, x, format_more, " ");
}
if (gui_buffer_has_nicklist (ptr_win->buffer))
@@ -2271,93 +2271,93 @@ gui_init_colors ()
use_default_colors ();
init_pair (COLOR_WIN_TITLE,
cfg_col_title & A_CHARTEXT, cfg_col_title_bg);
cfg_col_title, cfg_col_title_bg);
init_pair (COLOR_WIN_CHAT,
cfg_col_chat & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_TIME,
cfg_col_chat_time & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_time, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_TIME_SEP,
cfg_col_chat_time_sep & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_time_sep, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX1,
cfg_col_chat_prefix1 & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_prefix1, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX2,
cfg_col_chat_prefix2 & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_prefix2, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_NICK,
cfg_col_chat_nick & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_nick, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HOST,
cfg_col_chat_host & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_host, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_CHANNEL,
cfg_col_chat_channel & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_channel, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_DARK,
cfg_col_chat_dark & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_dark, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HIGHLIGHT,
cfg_col_chat_highlight & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_highlight, cfg_col_chat_bg);
init_pair (COLOR_WIN_STATUS,
cfg_col_status & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DELIMITERS,
cfg_col_status_delimiters & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_delimiters, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_MSG,
cfg_col_status_data_msg & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_msg, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_HIGHLIGHT,
cfg_col_status_data_highlight & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_highlight, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_OTHER,
cfg_col_status_data_other & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_other, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_MORE,
cfg_col_status_more & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_more, cfg_col_status_bg);
init_pair (COLOR_WIN_INFOBAR,
cfg_col_infobar & A_CHARTEXT, cfg_col_infobar_bg);
cfg_col_infobar, cfg_col_infobar_bg);
init_pair (COLOR_WIN_INFOBAR_HIGHLIGHT,
cfg_col_infobar_highlight & A_CHARTEXT, cfg_col_infobar_bg);
cfg_col_infobar_highlight, cfg_col_infobar_bg);
init_pair (COLOR_WIN_INPUT,
cfg_col_input & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input, cfg_col_input_bg);
init_pair (COLOR_WIN_INPUT_CHANNEL,
cfg_col_input_channel & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input_channel, cfg_col_input_bg);
init_pair (COLOR_WIN_INPUT_NICK,
cfg_col_input_nick & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input_nick, cfg_col_input_bg);
init_pair (COLOR_WIN_NICK,
cfg_col_nick & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_AWAY,
cfg_col_nick_away & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_away, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_CHANOWNER,
cfg_col_nick_chanowner & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_chanowner, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_CHANADMIN,
cfg_col_nick_chanadmin & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_chanadmin, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_OP,
cfg_col_nick_op & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_op, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_HALFOP,
cfg_col_nick_halfop & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_halfop, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_VOICE,
cfg_col_nick_voice & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_voice, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_MORE,
cfg_col_nick_more & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_more, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SEP,
cfg_col_nick_sep & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_sep, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SELF,
cfg_col_nick_self & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_self, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_PRIVATE,
cfg_col_nick_private & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_private, cfg_col_nick_bg);
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
{
gui_assign_color (&color, nicks_colors[i]);
init_pair (COLOR_WIN_NICK_FIRST + i, color & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_WIN_NICK_FIRST + i, color, cfg_col_chat_bg);
color_attr[COLOR_WIN_NICK_FIRST + i - 1] = (color >= 0) ? color & A_BOLD : 0;
}
init_pair (COLOR_DCC_SELECTED,
cfg_col_dcc_selected & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_selected, cfg_col_chat_bg);
init_pair (COLOR_DCC_WAITING,
cfg_col_dcc_waiting & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_waiting, cfg_col_chat_bg);
init_pair (COLOR_DCC_CONNECTING,
cfg_col_dcc_connecting & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_connecting, cfg_col_chat_bg);
init_pair (COLOR_DCC_ACTIVE,
cfg_col_dcc_active & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_active, cfg_col_chat_bg);
init_pair (COLOR_DCC_DONE,
cfg_col_dcc_done & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_done, cfg_col_chat_bg);
init_pair (COLOR_DCC_FAILED,
cfg_col_dcc_failed & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_failed, cfg_col_chat_bg);
init_pair (COLOR_DCC_ABORTED,
cfg_col_dcc_aborted & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_aborted, cfg_col_chat_bg);
color_attr[COLOR_WIN_TITLE - 1] = (cfg_col_title >= 0) ? cfg_col_title & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT - 1] = (cfg_col_chat >= 0) ? cfg_col_chat & A_BOLD : 0;
@@ -2600,14 +2600,14 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
wee_log_printf ("gui_printf without buffer! this is a bug, please send to developers - thanks\n");
return;
}
if (buffer->dcc)
buffer = gui_buffers;
if (buffer->dcc)
return;
}
if (buffer->dcc)
buffer = gui_buffers;
if (buffer->dcc)
return;
va_start (argptr, message);
vsnprintf (buf, sizeof (buf) - 1, message, argptr);
va_end (argptr);
+26 -20
View File
@@ -519,33 +519,39 @@ gui_read_keyb ()
/* Alt-S: jump to server buffer */
case 's':
case 'S':
if (SERVER(gui_current_window->buffer)->buffer !=
gui_current_window->buffer)
if (!gui_current_window->buffer->dcc)
{
gui_switch_to_buffer (gui_current_window,
SERVER(gui_current_window->buffer)->buffer);
gui_redraw_buffer (gui_current_window->buffer);
if (SERVER(gui_current_window->buffer)->buffer !=
gui_current_window->buffer)
{
gui_switch_to_buffer (gui_current_window,
SERVER(gui_current_window->buffer)->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
break;
/* Alt-X: jump to first channel/private of next server */
case 'x':
case 'X':
ptr_server = SERVER(gui_current_window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
while (ptr_server != SERVER(gui_current_window->buffer))
if (!gui_current_window->buffer->dcc)
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
if (ptr_server != SERVER(gui_current_window->buffer))
{
ptr_buffer = (ptr_server->channels) ?
ptr_server->channels->buffer : ptr_server->buffer;
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (gui_current_window->buffer);
ptr_server = SERVER(gui_current_window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
while (ptr_server != SERVER(gui_current_window->buffer))
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
if (ptr_server != SERVER(gui_current_window->buffer))
{
ptr_buffer = (ptr_server->channels) ?
ptr_server->channels->buffer : ptr_server->buffer;
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
break;
}
+1 -1
View File
@@ -186,7 +186,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
new_buffer->line_complete = 1;
/* notify level */
new_buffer->notify_level = 3;
new_buffer->notify_level = channel_get_notify_level (server, channel);
/* create/append to log file */
new_buffer->log_filename = NULL;
+4
View File
@@ -98,6 +98,10 @@
#define gui_printf_nolog(buffer, fmt, argz...) \
gui_printf_type_color(buffer, MSG_TYPE_INFO | MSG_TYPE_NOLOG, -1, fmt, ##argz)
#define NOTIFY_LEVEL_MIN 0
#define NOTIFY_LEVEL_MAX 3
#define NOTIFY_LEVEL_DEFAULT NOTIFY_LEVEL_MAX
typedef struct t_gui_message t_gui_message;
struct t_gui_message
+131
View File
@@ -30,6 +30,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../gui/gui.h"
char *channel_modes = "iklmnst";
@@ -262,6 +263,136 @@ channel_remove_dcc (t_irc_dcc *ptr_dcc)
}
}
/*
* channel_get_notify_level: get channel notify level
*/
int
channel_get_notify_level (t_irc_server *server, t_irc_channel *channel)
{
char *name, *pos, *pos2, notify;
if ((!server) || (!channel))
return NOTIFY_LEVEL_DEFAULT;
if ((!server->notify_levels) || (!server->notify_levels[0]))
return NOTIFY_LEVEL_DEFAULT;
name = (char *) malloc (strlen (channel->name) + 2);
strcpy (name, channel->name);
strcat (name, ":");
pos = strstr (server->notify_levels, name);
free (name);
if (!pos)
return NOTIFY_LEVEL_DEFAULT;
pos2 = pos + strlen (channel->name);
if (pos2[0] != ':')
return NOTIFY_LEVEL_DEFAULT;
pos2++;
if (!pos2[0])
return NOTIFY_LEVEL_DEFAULT;
notify = (int)(pos2[0] - '0');
if ((notify < NOTIFY_LEVEL_MIN) || (notify > NOTIFY_LEVEL_MAX))
return NOTIFY_LEVEL_DEFAULT;
else
return notify;
}
/*
* server_remove_notify_level: remove channel notify from list
*/
void
channel_remove_notify_level (t_irc_server *server, t_irc_channel *channel)
{
char *name, *pos, *pos2;
if ((!server) || (!channel))
return;
name = (char *) malloc (strlen (channel->name) + 2);
strcpy (name, channel->name);
strcat (name, ":");
pos = strstr (server->notify_levels, name);
free (name);
if (pos)
{
pos2 = pos + strlen (channel->name);
if (pos2[0] == ':')
{
pos2++;
if (pos2[0])
{
pos2++;
if (pos2[0] == ',')
pos2++;
if (!pos2[0] && (pos != server->notify_levels))
pos--;
strcpy (pos, pos2);
server->notify_levels = (char *) realloc (server->notify_levels,
strlen (server->notify_levels) + 1);
}
}
}
}
/*
* server_set_notify_level: set channel notify level
*/
void
channel_set_notify_level (t_irc_server *server, t_irc_channel *channel, int notify)
{
char *name, *pos, *pos2, level_string[2];
if ((!server) || (!channel))
return;
if (notify == NOTIFY_LEVEL_DEFAULT)
{
channel_remove_notify_level (server, channel);
return;
}
if (!server->notify_levels)
{
server->notify_levels = (char *) malloc (strlen (channel->name) + 3);
server->notify_levels[0] = '\0';
}
else
{
name = (char *) malloc (strlen (channel->name) + 2);
strcpy (name, channel->name);
strcat (name, ":");
pos = strstr (server->notify_levels, name);
free (name);
if (pos)
{
pos2 = pos + strlen (channel->name) + 1;
if (pos2[0])
{
pos2[0] = '0' + notify;
return;
}
}
/* realloc notify list to add channel */
server->notify_levels = (char *) realloc (server->notify_levels,
strlen (server->notify_levels) + 1 +
strlen (channel->name) + 2 + 1);
}
/* channel not in notify list => add it */
if (server->notify_levels[0])
strcat (server->notify_levels, ",");
strcat (server->notify_levels, channel->name);
strcat (server->notify_levels, ":");
level_string[0] = notify + '0';
level_string[1] = '\0';
strcat (server->notify_levels, level_string);
}
/*
* channel_print_log: print channel infos in log (usually for crash dump)
*/
+1 -1
View File
@@ -97,7 +97,7 @@ t_irc_command irc_commands[] =
{ "kill", N_("close client-server connection"),
N_("nickname comment"),
N_("nickname: nickname\ncomment: comment for kill"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, NULL },
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
{ "links", N_("list all servernames which are known by the server answering the query"),
N_("[[server] server_mask]"),
N_("server: this server should answer the query\n"
+20 -8
View File
@@ -66,13 +66,14 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
*/
void
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
int display_around, int color_nick, int no_nickmode)
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
int message_type, int display_around, int color_nick, int no_nickmode)
{
if (display_around)
gui_printf_type_color (buffer,
message_type, COLOR_WIN_CHAT_DARK, "<");
if (cfg_look_nickmode)
message_type, COLOR_WIN_CHAT_DARK,
(nick) ? "<" : ">");
if (nick && cfg_look_nickmode)
{
if (nick->is_chanowner)
gui_printf_type_color (buffer,
@@ -104,19 +105,20 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_CHAT_HIGHLIGHT,
"%s", nick->nick);
"%s", (nick) ? nick->nick : nickname);
else
gui_printf_type_color (buffer,
message_type,
(color_nick) ?
(nick && color_nick) ?
((cfg_look_color_nicks) ?
nick->color : COLOR_WIN_CHAT) :
COLOR_WIN_CHAT,
"%s", nick->nick);
"%s", (nick) ? nick->nick : nickname);
if (display_around)
gui_printf_type_color (buffer,
message_type, COLOR_WIN_CHAT_DARK, "> ");
message_type, COLOR_WIN_CHAT_DARK,
(nick) ? "> " : "< ");
}
/*
@@ -175,6 +177,12 @@ irc_display_server (t_irc_server *server)
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_port . . . . . . .: %d\n",
server->port);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_ipv6 . . . . . . .: %s\n",
(server->ipv6) ? _("yes") : _("no"));
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_ssl . . . . . . . .: %s\n",
(server->ssl) ? _("yes") : _("no"));
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_password . . . . .: %s\n",
(server->password && server->password[0]) ?
@@ -202,4 +210,8 @@ irc_display_server (t_irc_server *server)
" server_autojoin . . . . .: %s\n",
(server->autojoin && server->autojoin[0]) ?
server->autojoin : "");
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_notify_levels . . .: %s\n",
(server->notify_levels && server->notify_levels[0]) ?
server->notify_levels : "");
}
+90 -29
View File
@@ -345,6 +345,76 @@ irc_cmd_recv_kick (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_kill: 'kill' message received
*/
int
irc_cmd_recv_kill (t_irc_server *server, char *host, char *arguments)
{
char *pos, *pos_host2, *pos_comment;
t_irc_channel *ptr_channel;
pos = strchr (host, '!');
if (pos)
pos[0] = '\0';
pos_host2 = strchr (arguments, ' ');
if (pos_host2)
{
pos_host2[0] = '\0';
pos_host2++;
while (pos_host2[0] == ' ')
pos_host2++;
pos_comment = strchr (pos_host2, ' ');
if (pos_comment)
{
pos_comment[0] = '\0';
pos_comment++;
while (pos_comment[0] == ' ')
pos_comment++;
if (pos_comment[0] == ':')
pos_comment++;
}
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
irc_display_prefix (ptr_channel->buffer, PREFIX_PART);
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK,
"%s", host);
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
_(" has killed "));
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK,
"%s", arguments);
if (pos_comment)
{
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
_(" from server"));
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK,
" (");
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
"%s", pos_comment);
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK,
")\n");
}
else
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
_(" from server\n"));
}
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s host \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, "", "kill");
return -1;
}
return 0;
}
/*
* irc_get_channel_modes: get channel modes
*/
@@ -1176,37 +1246,28 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
else
{
ptr_nick = nick_search (ptr_channel, host);
if (ptr_nick)
if (strstr (pos, server->nick))
{
if (strstr (pos, server->nick))
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
1, -1, 0);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("On %s: %s> %s"),
ptr_channel->name,
host, pos);
}
else
irc_display_nick (ptr_channel->buffer, ptr_nick,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
COLOR_WIN_CHAT, "%s\n", pos);
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : host,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
1, -1, 0);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("On %s: %s> %s"),
ptr_channel->name,
host, pos);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s nick \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, host, "privmsg");
return -1;
}
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : host,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
COLOR_WIN_CHAT, "%s\n", pos);
}
}
else
@@ -3266,7 +3327,7 @@ irc_cmd_recv_366 (t_irc_server *server, char *host, char *arguments)
for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_MSG, 0, 0, 1);
if (ptr_nick != ptr_channel->last_nick)
gui_printf (ptr_channel->buffer, " ");
+28 -16
View File
@@ -120,9 +120,9 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
{
snprintf (buffer, sizeof (buffer),
"is back (gone %.2ld:%.2ld:%.2ld)",
elapsed / 3600,
(elapsed / 60) % 60,
elapsed % 60);
(long int)(elapsed / 3600),
(long int)((elapsed / 60) % 60),
(long int)(elapsed % 60));
irc_send_me_all_channels (ptr_server, buffer);
}
}
@@ -160,9 +160,9 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
{
snprintf (buffer, sizeof (buffer),
"is back (gone %.2ld:%.2ld:%.2ld)",
elapsed / 3600,
(elapsed / 60) % 60,
elapsed % 60);
(long int)(elapsed / 3600),
(long int)((elapsed / 60) % 60),
(long int)(elapsed % 60));
irc_send_me_all_channels (server, buffer);
}
}
@@ -876,7 +876,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
ptr_nick = nick_search (ptr_channel, server->nick);
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
@@ -901,7 +901,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
ptr_nick = nick_search (ptr_channel, server->nick);
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
@@ -1138,7 +1138,7 @@ irc_cmd_send_oper (t_irc_server *server, char *arguments)
int
irc_cmd_send_part (t_irc_server *server, char *arguments)
{
char *channel_name, *pos_args;
char *channel_name, *pos_args, *ptr_arg, *pos, buffer[4096];
t_irc_channel *ptr_channel;
if (arguments)
@@ -1192,16 +1192,28 @@ irc_cmd_send_part (t_irc_server *server, char *arguments)
pos_args = NULL;
}
if (pos_args)
server_sendf (server, "PART %s :%s\r\n", channel_name, pos_args);
else
ptr_arg = (pos_args) ? pos_args :
(cfg_irc_default_msg_part && cfg_irc_default_msg_part[0]) ?
cfg_irc_default_msg_part : NULL;
if (ptr_arg)
{
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
server_sendf (server, "PART %s :%s\r\n",
channel_name, cfg_irc_default_msg_part);
pos = strstr (ptr_arg, "%v");
if (pos)
{
pos[0] = '\0';
snprintf (buffer, sizeof (buffer), "%s%s%s",
ptr_arg, PACKAGE_VERSION, pos + 2);
pos[0] = '%';
}
else
server_sendf (server, "PART %s\r\n", channel_name);
snprintf (buffer, sizeof (buffer), "%s",
ptr_arg);
server_sendf (server, "PART %s :%s\r\n",
channel_name, buffer);
}
else
server_sendf (server, "PART %s\r\n", channel_name);
return 0;
}
+636 -65
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-server.c: (dis)connection and communication with irc server */
/* irc-server.c: connection and communication with IRC server */
#ifdef HAVE_CONFIG_H
@@ -39,6 +39,10 @@
#include <arpa/inet.h>
#include <netdb.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include "../common/weechat.h"
#include "irc.h"
#include "../common/weeconfig.h"
@@ -67,6 +71,8 @@ server_init (t_irc_server *server)
server->command_line = 0;
server->address = NULL;
server->port = -1;
server->ipv6 = 0;
server->ssl = 0;
server->password = NULL;
server->nick1 = NULL;
server->nick2 = NULL;
@@ -77,6 +83,7 @@ server_init (t_irc_server *server)
server->command_delay = 1;
server->autojoin = NULL;
server->autorejoin = 0;
server->notify_levels = NULL;
/* internal vars */
server->child_pid = 0;
@@ -84,6 +91,9 @@ server_init (t_irc_server *server)
server->child_write = -1;
server->sock = -1;
server->is_connected = 0;
#ifdef HAVE_GNUTLS
server->ssl_connected = 0;
#endif
server->unterminated_message = NULL;
server->nick = NULL;
server->reconnect_start = 0;
@@ -110,18 +120,42 @@ int
server_init_with_url (char *irc_url, t_irc_server *server)
{
char *url, *pos_server, *pos_channel, *pos, *pos2;
int ipv6, ssl;
struct passwd *my_passwd;
server_init (server);
if (strncasecmp (irc_url, "irc://", 6) != 0)
ipv6 = 0;
ssl = 0;
if (strncasecmp (irc_url, "irc6://", 7) == 0)
{
pos = irc_url + 7;
ipv6 = 1;
}
else if (strncasecmp (irc_url, "ircs://", 7) == 0)
{
pos = irc_url + 7;
ssl = 1;
}
else if ((strncasecmp (irc_url, "irc6s://", 8) == 0)
|| (strncasecmp (irc_url, "ircs6://", 8) == 0))
{
pos = irc_url + 8;
ipv6 = 1;
ssl = 1;
}
else if (strncasecmp (irc_url, "irc://", 6) == 0)
{
pos = irc_url + 6;
}
else
return -1;
url = strdup (irc_url);
pos_server = strchr (url, '@');
if (pos_server)
{
pos_server[0] = '\0';
pos_server++;
pos = url + 6;
if (!pos[0])
{
free (url);
@@ -183,6 +217,9 @@ server_init_with_url (char *irc_url, t_irc_server *server)
free (url);
server->ipv6 = ipv6;
server->ssl = ssl;
/* some default values */
if (server->port < 0)
server->port = DEFAULT_IRC_PORT;
@@ -256,6 +293,10 @@ server_destroy (t_irc_server *server)
free (server->command);
if (server->autojoin)
free (server->autojoin);
if (server->notify_levels)
free (server->notify_levels);
if (server->unterminated_message)
free (server->unterminated_message);
if (server->nick)
free (server->nick);
if (server->channels)
@@ -312,26 +353,26 @@ server_free_all ()
t_irc_server *
server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_delay,
int command_line, char *address, int port, char *password,
int command_line, char *address, int port, int ipv6, int ssl, char *password,
char *nick1, char *nick2, char *nick3, char *username,
char *realname, char *command, int command_delay, char *autojoin,
int autorejoin)
int autorejoin, char *notify_levels)
{
t_irc_server *new_server;
if (!name || !address || (port < 0))
return NULL;
#ifdef DEBUG
#ifdef DEBUG
wee_log_printf ("Creating new server (name:%s, address:%s, port:%d, pwd:%s, "
"nick1:%s, nick2:%s, nick3:%s, username:%s, realname:%s, "
"command:%s, autojoin:%s, autorejoin:%s)\n",
"command:%s, autojoin:%s, autorejoin:%s, notify_levels:%s)\n",
name, address, port, (password) ? password : "",
(nick1) ? nick1 : "", (nick2) ? nick2 : "", (nick3) ? nick3 : "",
(username) ? username : "", (realname) ? realname : "",
(command) ? command : "", (autojoin) ? autojoin : "",
(autorejoin) ? "on" : "off");
#endif
(autorejoin) ? "on" : "off", (notify_levels) ? notify_levels : "");
#endif
if ((new_server = server_alloc ()))
{
@@ -342,6 +383,8 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
new_server->command_line = command_line;
new_server->address = strdup (address);
new_server->port = port;
new_server->ipv6 = ipv6;
new_server->ssl = ssl;
new_server->password = (password) ? strdup (password) : strdup ("");
new_server->nick1 = (nick1) ? strdup (nick1) : strdup ("weechat_user");
new_server->nick2 = (nick2) ? strdup (nick2) : strdup ("weechat2");
@@ -357,6 +400,8 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
(autojoin) ? strdup (autojoin) : NULL;
new_server->autorejoin = autorejoin;
new_server->nick = strdup (new_server->nick1);
new_server->notify_levels =
(notify_levels) ? strdup (notify_levels) : NULL;
}
else
return NULL;
@@ -364,7 +409,7 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
}
/*
* server_send: send data to irc server
* server_send: send data to IRC server
*/
int
@@ -373,11 +418,16 @@ server_send (t_irc_server *server, char *buffer, int size_buf)
if (!server)
return -1;
return send (server->sock, buffer, size_buf, 0);
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
return gnutls_record_send (server->gnutls_sess, buffer, size_buf);
else
#endif
return send (server->sock, buffer, size_buf, 0);
}
/*
* server_sendf: send formatted data to irc server
* server_sendf: send formatted data to IRC server
*/
void
@@ -401,11 +451,11 @@ server_sendf (t_irc_server *server, char *fmt, ...)
buffer[sizeof (buffer) - 1] = '\0';
if ((size_buf < 0) || (size_buf > (int) (sizeof (buffer) - 1)))
size_buf = strlen (buffer);
#ifdef DEBUG
#ifdef DEBUG
buffer[size_buf - 2] = '\0';
gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer);
buffer[size_buf - 2] = '\r';
#endif
#endif
buf2 = weechat_convert_encoding ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
cfg_look_charset_encode,
@@ -551,9 +601,9 @@ server_msgq_flush ()
{
if (recv_msgq->data)
{
#ifdef DEBUG
#ifdef DEBUG
gui_printf (gui_current_window->buffer, "[DEBUG] %s\n", recv_msgq->data);
#endif
#endif
ptr_data = recv_msgq->data;
entire_line = strdup (ptr_data);
@@ -563,9 +613,9 @@ server_msgq_flush ()
if (ptr_data)
{
#ifdef DEBUG
#ifdef DEBUG
gui_printf (NULL, "[DEBUG] data received from server: %s\n", ptr_data);
#endif
#endif
host = NULL;
command = NULL;
@@ -644,7 +694,16 @@ server_recv (t_irc_server *server)
static char buffer[4096 + 2];
int num_read;
num_read = recv (server->sock, buffer, sizeof (buffer) - 2, 0);
if (!server)
return;
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
num_read = gnutls_record_recv (server->gnutls_sess, buffer, sizeof (buffer) - 2);
else
#endif
num_read = recv (server->sock, buffer, sizeof (buffer) - 2, 0);
if (num_read > 0)
{
buffer[num_read] = '\0';
@@ -701,8 +760,16 @@ server_close_connection (t_irc_server *server)
/* close network socket */
if (server->sock != -1)
{
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
gnutls_bye (server->gnutls_sess, GNUTLS_SHUT_RDWR);
#endif
close (server->sock);
server->sock = -1;
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
gnutls_deinit (server->gnutls_sess);
#endif
}
/* free any pending message */
@@ -714,6 +781,9 @@ server_close_connection (t_irc_server *server)
/* server is now disconnected */
server->is_connected = 0;
#ifdef HAVE_GNUTLS
server->ssl_connected = 0;
#endif
}
/*
@@ -751,31 +821,70 @@ server_child_read (t_irc_server *server)
{
/* connection OK */
case '0':
/* enable SSL if asked */
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
{
gnutls_transport_set_ptr (server->gnutls_sess, (gnutls_transport_ptr) server->sock);
if (gnutls_handshake (server->gnutls_sess) < 0)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s gnutls handshake failed\n"),
WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
return;
}
}
#endif
/* kill child and login to server */
server_kill_child (server);
irc_login (server);
break;
/* adress not found */
case '1':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
else
gui_printf (server->buffer,
_("%s address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* IP address not found */
case '2':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s IP address not found\n"), WEECHAT_ERROR);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy IP address not found\n"), WEECHAT_ERROR);
else
gui_printf (server->buffer,
_("%s IP address not found\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* connection refused */
/* connection refused */
case '3':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s connection refused\n"), WEECHAT_ERROR);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy connection refused\n"), WEECHAT_ERROR);
else
gui_printf (server->buffer,
_("%s connection refused\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* proxy fails to connect to server */
case '4':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s proxy fails to establish connection to server (check username/password if used)\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
@@ -783,6 +892,359 @@ server_child_read (t_irc_server *server)
}
}
/*
* convbase64_8x3_to_6x4 : convert 3 bytes of 8 bits in 4 bytes of 6 bits
*/
void
convbase64_8x3_to_6x4(char *from, char* to)
{
unsigned char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
to[0] = base64_table [ (from[0] & 0xfc) >> 2 ];
to[1] = base64_table [ ((from[0] & 0x03) << 4) + ((from[1] & 0xf0) >> 4) ];
to[2] = base64_table [ ((from[1] & 0x0f) << 2) + ((from[2] & 0xc0) >> 6) ];
to[3] = base64_table [ from[2] & 0x3f ];
}
/*
* base64encode: encode a string in base64
*/
void
base64encode(char *from, char *to)
{
char *f, *t;
int from_len;
from_len = strlen(from);
f = from;
t = to;
while(from_len >= 3)
{
convbase64_8x3_to_6x4(f, t);
f += 3 * sizeof(*f);
t += 4 * sizeof(*t);
from_len -= 3;
}
if (from_len > 0)
{
char rest[3] = { 0, 0, 0 };
switch(from_len)
{
case 1 :
rest[0] = f[0];
convbase64_8x3_to_6x4(rest, t);
t[2] = t[3] = '=';
break;
case 2 :
rest[0] = f[0];
rest[1] = f[1];
convbase64_8x3_to_6x4(rest, t);
t[3] = '=';
break;
}
t[4] = 0;
}
}
/*
* pass_httpproxy: establish connection/authentification to an http proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_httpproxy(t_irc_server *server)
{
char buffer[256];
char authbuf[128]; // seems to be enougth to store username + password
char authbuf_base64[196]; // enougth to store base64 encoded authbuf
int n, m;
if (strlen(cfg_proxy_username) > 0)
{
// authentification
snprintf(authbuf, sizeof(authbuf), "%s:%s", cfg_proxy_username, cfg_proxy_password);
base64encode(authbuf, authbuf_base64);
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\nProxy-Authorization: Basic %s\r\n\r\n", server->address, server->port, authbuf_base64);
}
else
{
// no authentification
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\n\r\n", server->address, server->port);
}
m = send (server->sock, buffer, n, 0);
if (n != m)
return 1;
n = recv(server->sock, buffer, sizeof(buffer), 0);
/* success result must be like : "HTTP/1.0 200 OK" */
if (n < 12)
return 1;
if (memcmp (buffer, "HTTP/", 5) || memcmp (buffer + 9, "200", 3))
return 1;
return 0;
}
/*
* resolve: resolve hostname on its IP address
* (works with ipv4 and ipv6)
* return :
* - 0 if resolution was successful
* - 1 if resolution fails
*/
int
resolve (char *hostname, char *ip, int *version)
{
char ipbuffer[NI_MAXHOST];
struct addrinfo *res;
if (version != NULL)
*version = 0;
res = NULL;
if (getaddrinfo (hostname, NULL, NULL, &res) != 0)
return 1;
if (!res)
return 1;
if (getnameinfo (res->ai_addr, res->ai_addrlen, ipbuffer, sizeof(ipbuffer), NULL, 0, NI_NUMERICHOST) != 0)
{
freeaddrinfo (res);
return 1;
}
if ((res->ai_family == AF_INET) && (version != NULL))
*version = 4;
if ((res->ai_family == AF_INET6) && (version != NULL))
*version = 6;
strcpy (ip, ipbuffer);
freeaddrinfo (res);
return 0;
}
/*
* pass_socks4proxy: establish connection/authentification throw a socks4 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks4proxy(t_irc_server *server)
{
/*
* socks4 protocol is explain here:
* http://archive.socks.permeo.com/protocol/socks4.protocol
*
*/
struct s_socks4
{
char version; /* 1 byte */ /* socks version : 4 or 5 */
char method; /* 1 byte */ /* socks method : connect (1) or bind (2) */
unsigned short port; /* 2 bytes */ /* destination port */
unsigned long address; /* 4 bytes */ /* destination address */
char user[64]; /* username (64 characters seems to be enought) */
} socks4;
unsigned char buffer[24];
char ip_addr[NI_MAXHOST];
socks4.version = 4;
socks4.method = 1;
socks4.port = htons (server->port);
resolve(server->address, ip_addr, NULL);
socks4.address = inet_addr (ip_addr);
strncpy (socks4.user, server->username, sizeof(socks4.user) - 1);
send (server->sock, (char *) &socks4, 8 + strlen(socks4.user) + 1, 0);
recv (server->sock, buffer, sizeof(buffer), 0);
if (buffer[0] == 0 && buffer[1] == 90)
return 0;
return 1;
}
/*
* pass_socks5proxy: establish connection/authentification throw a socks5 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks5proxy(t_irc_server *server)
{
/*
* socks5 protocol is explained in RFC 1928
* socks5 authentication with username/pass is explained in RFC 1929
*/
struct s_sock5
{
char version; /* 1 byte */ /* socks version : 4 or 5 */
char nmethods; /* 1 byte */ /* size in byte(s) of field 'method', here 1 byte */
char method; /* 1-255 bytes */ /* socks method : noauth (0), auth(user/pass) (2), ... */
} socks5;
unsigned char buffer[288];
int username_len, password_len, addr_len, addr_buffer_len;
unsigned char *addr_buffer;
socks5.version = 5;
socks5.nmethods = 1;
if (strlen(cfg_proxy_username) > 0)
/* with authentication */
socks5.method = 2;
else
/* without authentication */
socks5.method = 0;
send (server->sock, (char *) &socks5, sizeof(socks5), 0);
/* server socks5 must respond with 2 bytes */
if (recv (server->sock, buffer, 2, 0) != 2)
return 1;
if (strlen(cfg_proxy_username) > 0)
{
/* with authentication */
/* -> socks server must respond with :
* - socks version (buffer[0]) = 5 => socks5
* - socks method (buffer[1]) = 2 => authentication
*/
//if (!(buffer[0] == 5 && buffer[1] == 2))
if (buffer[0] != 5 || buffer[1] != 2)
return 1;
/* authentication as in RFC 1929 */
username_len = strlen(cfg_proxy_username);
password_len = strlen(cfg_proxy_password);
/* make username/password buffer */
buffer[0] = 1;
buffer[1] = (unsigned char) username_len;
memcpy(buffer + 2, cfg_proxy_username, username_len);
buffer[2 + username_len] = (unsigned char) password_len;
memcpy(buffer + 3 + username_len, cfg_proxy_password, password_len);
send (server->sock, buffer, 3 + username_len + password_len, 0);
/* server socks5 must respond with 2 bytes */
if (recv (server->sock, buffer, 2, 0) != 2)
return 1;
/* buffer[1] = auth state, must be 0 for success */
if (buffer[1] != 0)
return 1;
}
else
{
/* without authentication */
/* -> socks server must respond with :
* - socks version (buffer[0]) = 5 => socks5
* - socks method (buffer[1]) = 0 => no authentication
*/
if (!(buffer[0] == 5 && buffer[1] == 0))
return 1;
}
/* authentication successful then giving address/port to connect */
addr_len = strlen(server->address);
addr_buffer_len = 4 + 1 + addr_len + 2;
addr_buffer = (unsigned char *) malloc ( addr_buffer_len * sizeof(*addr_buffer));
if (!addr_buffer)
return 1;
addr_buffer[0] = 5; /* version 5 */
addr_buffer[1] = 1; /* command: 1 for connect */
addr_buffer[2] = 0; /* reserved */
addr_buffer[3] = 3; /* address type : ipv4 (1), domainname (3), ipv6 (4) */
addr_buffer[4] = (unsigned char) addr_len;
memcpy (addr_buffer + 5, server->address, addr_len); /* server address */
*((unsigned short *) (addr_buffer + 5 + addr_len)) = htons (server->port); /* server port */
send (server->sock, addr_buffer, addr_buffer_len, 0);
free(addr_buffer);
/* dialog with proxy server */
if (recv (server->sock, buffer, 4, 0) != 4)
return 1;
if (!(buffer[0] == 5 && buffer[1] == 0))
return 1;
switch(buffer[3]) {
/* buffer[3] = address type */
case 1 :
/* ipv4
* server socks return server bound address and port
* address of 4 bytes and port of 2 bytes (= 6 bytes)
*/
if (recv (server->sock, buffer, 6, 0) != 6)
return 1;
break;
case 3:
/* domainname
* server socks return server bound address and port
*/
/* reading address length */
if (recv (server->sock, buffer, 1, 0) != 1)
return 1;
addr_len = buffer[0];
/* reading address + port = addr_len + 2 */
if (recv (server->sock, buffer, addr_len + 2, 0) != (addr_len + 2))
return 1;
break;
case 4 :
/* ipv6
* server socks return server bound address and port
* address of 16 bytes and port of 2 bytes (= 18 bytes)
*/
if (recv (server->sock, buffer, 18, 0) != 18)
return 1;
break;
default:
return 1;
}
return 0;
}
/*
* pass_proxy: establish connection/authentification to a proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_proxy(t_irc_server *server)
{
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "http") == 0)
return pass_httpproxy(server);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks4") == 0)
return pass_socks4proxy(server);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks5") == 0)
return pass_socks5proxy(server);
return 1;
}
/*
* server_child: child process trying to connect to server
*/
@@ -790,42 +1252,90 @@ server_child_read (t_irc_server *server)
int
server_child (t_irc_server *server)
{
struct hostent *ip4_hostent;
struct sockaddr_in addr;
char *ip_address;
int error;
struct addrinfo hints, *res;
/* bind to hostname */
ip4_hostent = gethostbyname (server->address);
if (!ip4_hostent)
res = NULL;
if (cfg_proxy_use)
{
write (server->child_write, "1", 1);
return 0;
memset (&hints, 0, sizeof (hints));
hints.ai_family = (cfg_proxy_ipv6) ? AF_INET6 : AF_INET;
hints.ai_socktype = SOCK_STREAM;
if (getaddrinfo (cfg_proxy_address, NULL, &hints, &res) !=0)
{
write(server->child_write, "1", 1);
return 0;
}
if (!res)
{
write(server->child_write, "1", 1);
return 0;
}
if ((cfg_proxy_ipv6 && (res->ai_family != AF_INET6))
|| ((!cfg_proxy_ipv6 && (res->ai_family != AF_INET))))
{
write (server->child_write, "2", 1);
freeaddrinfo (res);
return 0;
}
if (cfg_proxy_ipv6)
((struct sockaddr_in6 *)(res->ai_addr))->sin6_port = htons (cfg_proxy_port);
else
((struct sockaddr_in *)(res->ai_addr))->sin_port = htons (cfg_proxy_port);
if (connect (server->sock, res->ai_addr, res->ai_addrlen) != 0)
{
write(server->child_write, "3", 1);
freeaddrinfo (res);
return 0;
}
if (pass_proxy(server))
{
write(server->child_write, "4", 1);
freeaddrinfo (res);
return 0;
}
}
memset (&addr, 0, sizeof (addr));
memcpy (&addr.sin_addr, ip4_hostent->h_addr, ip4_hostent->h_length);
addr.sin_port = htons (server->port);
addr.sin_family = AF_INET;
/* find IP address */
ip_address = inet_ntoa (addr.sin_addr);
if (!ip_address)
else
{
write (server->child_write, "2", 1);
return 0;
memset (&hints, 0, sizeof(hints));
hints.ai_family = (server->ipv6) ? AF_INET6 : AF_INET;
hints.ai_socktype = SOCK_STREAM;
if (getaddrinfo (server->address, NULL, &hints, &res) !=0)
{
write(server->child_write, "1", 1);
return 0;
}
if (!res)
{
write(server->child_write, "1", 1);
return 0;
}
if ((server->ipv6 && (res->ai_family != AF_INET6))
|| ((!server->ipv6 && (res->ai_family != AF_INET))))
{
write(server->child_write, "2", 1);
freeaddrinfo (res);
return 0;
}
if (server->ipv6)
((struct sockaddr_in6 *)(res->ai_addr))->sin6_port = htons (server->port);
else
((struct sockaddr_in *)(res->ai_addr))->sin_port = htons (server->port);
if (connect (server->sock, res->ai_addr, res->ai_addrlen) != 0)
{
write(server->child_write, "3", 1);
freeaddrinfo (res);
return 0;
}
}
/* connect to server */
error = connect (server->sock, (struct sockaddr *) &addr, sizeof (addr));
if (error != 0)
{
write (server->child_write, "3", 1);
return 0;
}
/* connection OK */
write (server->child_write, "0", 1);
freeaddrinfo (res);
return 0;
}
@@ -838,17 +1348,72 @@ server_connect (t_irc_server *server)
{
int child_pipe[2], set;
pid_t pid;
#ifdef HAVE_GNUTLS
const int cert_type_prio[] = { GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 };
#endif
#ifndef HAVE_GNUTLS
if (server->ssl)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot connect with SSL since WeeChat was not built "
"with GNUtls support\n"), WEECHAT_ERROR);
return 0;
}
#endif
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer,
_("%s: connecting to %s:%d...\n"),
PACKAGE_NAME, server->address, server->port);
wee_log_printf (_("Connecting to server %s:%d...\n"),
server->address, server->port);
if (cfg_proxy_use)
{
gui_printf (server->buffer,
_("%s: connecting to server %s:%d%s%s via %s proxy %s:%d%s...\n"),
PACKAGE_NAME, server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "",
cfg_proxy_type_values[cfg_proxy_type], cfg_proxy_address, cfg_proxy_port,
(cfg_proxy_ipv6) ? " (IPv6)" : "");
wee_log_printf (_("Connecting to server %s:%d%s%s via %s proxy %s:%d%s...\n"),
server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "",
cfg_proxy_type_values[cfg_proxy_type], cfg_proxy_address, cfg_proxy_port,
(cfg_proxy_ipv6) ? " (IPv6)" : "");
}
else
{
gui_printf (server->buffer,
_("%s: connecting to server %s:%d%s%s...\n"),
PACKAGE_NAME, server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "");
wee_log_printf (_("Connecting to server %s:%d%s%s...\n"),
server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "");
}
/* close any opened connection and kill child process if running */
server_close_connection (server);
/* init SSL if asked */
#ifdef HAVE_GNUTLS
server->ssl_connected = 0;
if (server->ssl)
{
if (gnutls_init (&server->gnutls_sess, GNUTLS_CLIENT) != 0)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s gnutls init error\n"), WEECHAT_ERROR);
return 0;
}
gnutls_set_default_priority (server->gnutls_sess);
gnutls_certificate_type_set_priority (server->gnutls_sess, cert_type_prio);
gnutls_credentials_set (server->gnutls_sess, GNUTLS_CRD_CERTIFICATE, gnutls_xcred);
server->ssl_connected = 1;
}
#endif
/* create pipe for child process */
if (pipe (child_pipe) < 0)
{
@@ -861,13 +1426,12 @@ server_connect (t_irc_server *server)
server->child_write = child_pipe[1];
/* create socket and set options */
server->sock = socket (AF_INET, SOCK_STREAM, 0);
server->sock = socket ((server->ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
if (server->sock == -1)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot create socket\n"), WEECHAT_ERROR);
server_close_connection (server);
return 0;
}
@@ -947,7 +1511,8 @@ server_auto_connect (int command_line)
{
(void) gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1);
gui_redraw_buffer (gui_current_window->buffer);
server_connect (ptr_server);
if (!server_connect (ptr_server))
server_reconnect_schedule (ptr_server);
}
}
}
@@ -1143,6 +1708,8 @@ server_print_log (t_irc_server *server)
wee_log_printf (" command_line. . . . : %d\n", server->command_line);
wee_log_printf (" address . . . . . . : '%s'\n", server->address);
wee_log_printf (" port. . . . . . . . : %d\n", server->port);
wee_log_printf (" ipv6. . . . . . . . : %d\n", server->ipv6);
wee_log_printf (" ssl . . . . . . . . : %d\n", server->ssl);
wee_log_printf (" password. . . . . . : '%s'\n",
(server->password && server->password[0]) ? "(hidden)" : server->password);
wee_log_printf (" nick1 . . . . . . . : '%s'\n", server->nick1);
@@ -1155,11 +1722,15 @@ server_print_log (t_irc_server *server)
wee_log_printf (" command_delay . . . : %d\n", server->command_delay);
wee_log_printf (" autojoin. . . . . . : '%s'\n", server->autojoin);
wee_log_printf (" autorejoin. . . . . : %d\n", server->autorejoin);
wee_log_printf (" notify_levels . . . : %s\n", server->notify_levels);
wee_log_printf (" child_pid . . . . . : %d\n", server->child_pid);
wee_log_printf (" child_read . . . . : %d\n", server->child_read);
wee_log_printf (" child_write . . . . : %d\n", server->child_write);
wee_log_printf (" sock. . . . . . . . : %d\n", server->sock);
wee_log_printf (" is_connected. . . . : %d\n", server->is_connected);
#ifdef HAVE_GNUTLS
wee_log_printf(" ssl_connected . . . : %d\n", server->ssl_connected);
#endif
wee_log_printf (" unterminated_message: '%s'\n", server->unterminated_message);
wee_log_printf (" nick. . . . . . . . : '%s'\n", server->nick);
wee_log_printf (" reconnect_start . . : %ld\n", server->reconnect_start);
+36 -6
View File
@@ -21,9 +21,18 @@
#ifndef __WEECHAT_IRC_H
#define __WEECHAT_IRC_H 1
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include "../gui/gui.h"
/* prefixes for chat window */
@@ -137,23 +146,31 @@ struct t_irc_server
int command_line; /* server was given on command line */
char *address; /* address of server (IP or name) */
int port; /* port for server (6667 by default) */
int ipv6; /* use IPv6 protocol */
int ssl; /* SSL protocol */
char *password; /* password for server */
char *nick1; /* first nickname for the server */
char *nick2; /* alternate nickname */
char *nick3; /* 2nd alternate nickname */
char *username; /* user name */
char *realname; /* real name */
char *command; /* command to run once connected */
char *command; /* command to run once connected */
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
char *notify_levels; /* channels notify levels */
/* internal vars */
pid_t child_pid; /* pid of child process (connecting) */
int child_read; /* to read into child pipe */
int child_write; /* to write into child pipe */
int sock; /* socket for server */
int sock; /* socket for server (IPv4 or IPv6) */
int is_connected; /* 1 if WeeChat is connected to server */
#ifdef HAVE_GNUTLS
int ssl_connected; /* = 1 if connected with SSL */
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
#endif
char *unterminated_message; /* beginning of a message in input buf */
char *nick; /* current nickname */
time_t reconnect_start; /* this time + delay = reconnect time */
@@ -248,9 +265,9 @@ extern t_irc_server *server_alloc ();
extern void server_destroy (t_irc_server *);
extern void server_free (t_irc_server *);
extern void server_free_all ();
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, char *,
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, int, int,
char *, char *, char *, char *, char *, char *,
int, char *, int);
char *, int, char *, int, char *);
extern int server_send (t_irc_server *, char *, int);
extern void server_sendf (t_irc_server *, char *, ...);
extern void server_recv (t_irc_server *);
@@ -268,6 +285,15 @@ extern void server_check_away ();
extern void server_set_away (t_irc_server *, char *, int);
extern void server_print_log (t_irc_server *);
/* proxy functions (irc-server.c) */
extern void convbase64_8x3_to_6x4(char *from, char* to);
extern void base64encode(char *from, char *to);
extern int pass_httpproxy(t_irc_server *server);
extern int resolve(char *hostname, char *ip, int *version);
extern int pass_socks4proxy(t_irc_server *server);
extern int pass_socks5proxy(t_irc_server *server);
extern int pass_proxy(t_irc_server *server);
/* channel functions (irc-channel.c) */
extern t_irc_channel *channel_new (t_irc_server *, int, char *, int);
@@ -280,6 +306,9 @@ extern void channel_check_away (t_irc_server *, t_irc_channel *);
extern void channel_set_away (t_irc_channel *, char *, int);
extern int channel_create_dcc (t_irc_dcc *);
extern void channel_remove_dcc (t_irc_dcc *);
extern int channel_get_notify_level (t_irc_server *, t_irc_channel *);
extern void channel_remove_notify_level (t_irc_server *, t_irc_channel *);
extern void channel_set_notify_level (t_irc_server *, t_irc_channel *, int);
extern void channel_print_log (t_irc_channel *);
/* nick functions (irc-nick.c) */
@@ -311,7 +340,7 @@ extern void dcc_end ();
/* IRC display (irc-diplay.c) */
extern void irc_display_prefix (/*@null@*/ t_gui_buffer *, char *);
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, int, int, int, int);
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, char *, int, int, int, int);
extern void irc_display_mode (t_gui_buffer *, char *, char, char *, char *,
char *, char *);
extern void irc_display_server (t_irc_server *ptr_server);
@@ -383,6 +412,7 @@ extern int irc_cmd_recv_error (t_irc_server *, char *, char *);
extern int irc_cmd_recv_invite (t_irc_server *, char *, char *);
extern int irc_cmd_recv_join (t_irc_server *, char *, char *);
extern int irc_cmd_recv_kick (t_irc_server *, char *, char *);
extern int irc_cmd_recv_kill (t_irc_server *, char *, char *);
extern int irc_cmd_recv_mode (t_irc_server *, char *, char *);
extern int irc_cmd_recv_nick (t_irc_server *, char *, char *);
extern int irc_cmd_recv_notice (t_irc_server *, char *, char *);
+3 -3
View File
@@ -832,19 +832,19 @@ wee_perl_init ()
" my $content = wee_perl_load_file ($filename);"
" if ($content eq \"__WEECHAT_ERROR__\")"
" {"
" weechat::print \"WeeChat Error: Perl script '$filename' not found.\\n\";"
" weechat::print \"WeeChat Error: Perl script '$filename' not found.\\n\", \"\";"
" return 1;"
" }"
" eval $content;"
" if ($@)"
" {"
" weechat::print \"WeeChat error: unable to load Perl script '$filename':\\n\";"
" weechat::print \"WeeChat error: unable to load Perl script '$filename':\\n\", \"\";"
" weechat::print \"$@\\n\";"
" return 2;"
" }"
" return 0;"
"}"
"$SIG{__WARN__} = sub { weechat::print \"$_[0]\n\"; };"
"$SIG{__WARN__} = sub { weechat::print \"$_[0]\n\", \"\"; };"
};
wee_log_printf (_("Loading %s module \"weechat\"\n"), "Perl");
+11 -3
View File
@@ -424,9 +424,17 @@ plugin_find_buffer (char *server, char *channel)
}
else
{
ptr_buffer = gui_current_window->buffer;
if (ptr_buffer->dcc)
ptr_buffer = gui_buffers;
if (!channel)
{
ptr_buffer = gui_current_window->buffer;
if (ptr_buffer->dcc)
ptr_buffer = gui_buffers;
}
else
{
if (ptr_server)
ptr_buffer = ptr_server->buffer;
}
}
if (!ptr_buffer)
+27 -2
View File
@@ -58,7 +58,7 @@ wee_python_register (PyObject *self, PyObject *args)
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "print_with_channel");
"Python", "register");
return NULL;
}
@@ -140,7 +140,7 @@ wee_python_print (PyObject *self, PyObject *args)
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "print");
"Python", "prnt");
return NULL;
}
@@ -407,6 +407,31 @@ wee_python_init ()
{
wee_log_printf (_("Loading %s module \"weechat\"\n"), "Python");
Py_InitModule ("weechat", weechat_funcs);
if (PyRun_SimpleString (
"import weechat, sys, string\n"
"class weechatStdout:\n"
"\tdef write(self, str):\n"
"\t\tstr = string.strip(str)\n"
"\t\tif str != \"\":\n"
"\t\t\tweechat.prnt(\"Python stdout : \" + str, \"\")\n"
"class weechatStderr:\n"
"\tdef write(self, str):\n"
"\t\tstr = string.strip(str)\n"
"\t\tif str != \"\":\n"
"\t\t\tweechat.prnt(\"Python stderr : \" + str, \"\")\n"
"sys.stdout = weechatStdout()\n"
"sys.stderr = weechatStderr()\n"
) != 0)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL,
_("%s error: error while redirecting stdout and stderr\n"),
"Python");
}
}
}
+10 -2
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "May 2005" "FlashCode"
.TH WEECHAT 1 "July 2005" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
@@ -27,6 +27,10 @@ display config file help (list of options)
.br
display summary of options
.TP
.B \-i, \-\-irc\-commands
.br
display IRC commands
.TP
.B \-l, \-\-license
.br
display program license
@@ -34,12 +38,16 @@ display program license
.B \-v, \-\-version
.br
display WeeChat version
.TP
.B \-w, \-\-weechat\-commands
.br
display WeeChat commands
.SH URL
WeeChat can use an URL (Uniform Resource Locator) to automatically connect
to an IRC server. These are in the following form:
.TP
.B irc://[[nickname][:password]@]server[:port][/[#&+!]channel]
.B irc[6][s]://[[nickname][:password]@]server[:port][/[#&+!]channel[,channel...]]
.TP
Exemple to join WeeChat channel support with nick "FlashCode":
irc://FlashCode@irc.freenode.net/weechat
+4 -2
View File
@@ -1,5 +1,5 @@
%define name weechat
%define version 0.1.2
%define version 0.1.3
%define release 1
Name: %{name}
@@ -10,7 +10,7 @@ Source: http://weechat.flashtux.org/download/%{name}-%{version}.tar.gz
URL: http://weechat.flashtux.org
Group: Networking/IRC
BuildRoot: %{_tmppath}/%{name}-buildroot
Requires: perl, python
Requires: perl, python, libgnutls
License: GPL
%description
@@ -41,6 +41,8 @@ rm -rf $RPM_BUILD_ROOT
/usr/local/bin/weechat-curses
%changelog
* Sat Jul 02 2005 FlashCode <flashcode@flashtux.org> 0.1.3-1
- Released version 0.1.3
* Sat May 21 2005 FlashCode <flashcode@flashtux.org> 0.1.2-1
- Released version 0.1.2
* Sat Mar 20 2005 FlashCode <flashcode@flashtux.org> 0.1.1-1
+556 -546
View File
File diff suppressed because it is too large Load Diff
+27 -9
View File
@@ -1,16 +1,34 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
Developer:
---------
Developers:
----------
* General code
FlashCode <flashcode@flashtux.org>
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
* Python plugin
Kolter <kolter@free.fr>
Web : http://kolter.free.fr
IRC : nick is "kolter" @ irc.freenode.net
Jabber: kolter@jabber.org
Debian packager:
---------------
Julien Louis <ptitlouis@sysif.net>
IRC : nicks are "ptitlouis" or "tioui" @ irc.freenode.net
Jabber: ptitlouis@amessage.info
FlashCode <flashcode@flashtux.org>
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
Testers:
-------
+25 -1
View File
@@ -1,9 +1,33 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-05-21
ChangeLog - 2005-06-30
Version 0.1.3 (2005-07-02):
* proxy support (http, socks4, socks5) with authentification (http, socks5)
and ipv6 support (client to proxy)
* completion added for config option (with /set command)
* commands from users outside channel now authorized (if special user or
channel without "n" flag)
* added IPv6 support
* kill command now received and displayed
* added SSL support
* channel notify levels are saved in config file (new option
"server_notify_levels" for server sections)
* part message now accepts %v (replaced by WeeChat version), like quit message
* errors while loading perl scripts are now displayed in server buffer
(instead of current buffer)
* in python scripts, all messages written in stdin and stderr are redirected
in server buffer
* fix a filename error while loading a python script manually
* fixed plugins "print" and "prnt" functions: now ok for writing on server
buffers
* fixed color problem with new libcurses version
* fixed crash when using Alt-S or Alt-X on DCC buffer (Alt-D)
* fixed startup crash when config file (~/.weechat/weechat.rc) is not found
* improved Perl/Python libs detection for ./configure script
Version 0.1.2 (2005-05-21):
* added Python plugin support, improved Perl interface (and now Perl/Python
libraries are checked by configure script)
+4
View File
@@ -1,6 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-07-02
WeeChat 0.1.3 released.
* FlashCode, 2005-05-21
WeeChat 0.1.2 released.
+3 -3
View File
@@ -14,7 +14,7 @@ Features
* small, fast and very light
* customizable and extensible with scripts (Perl, Python, Ruby) (2)
* compliant with RFC 1459,2810,2811,2812,2813
* developed from scratch (not based on any other IRC client, except for look ;)
* developed from scratch
* multi-platform (GNU/Linux, *BSD, Windows & other) (3)
* 100% GPL & free
@@ -44,5 +44,5 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
---
(1) only Curses interface is available today
(2) only Perl interface is available today
(3) only GNU/Linux version is available today
(2) only Perl and Python interfaces are available today
(3) only GNU/Linux and *BSD versions are available today
+11 -23
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2005-05-21
TODO - 2005-07-02
Legend:
# done
@@ -10,38 +10,32 @@ Legend:
? is this really necessary?
v0.1.2:
v0.1.3:
------
* General:
+ Windows version
+ Solaris version
# *BSD version
# Mac OS X version
* IRC protocol:
- customizable CTCP version reply
* Interface:
# nicklist scroll keys
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* TCP/IP communication:
- SSL support
# SSL support
# IPv6 protocol implementation
# proxy support (http, socks4, socks5) with authentification
(http, socks5) and ipv6 support (client to proxy)
* Configuration:
- add key bindings to config file
* Plugins:
# Python plugin
# "/python load" and "/python unload" commands to (un)load Python scripts
# save buffer notify levels
Future versions:
---------------
* IRC protocol:
- customizable CTCP version reply
- complete "/list" command: add regexp search, display only channels that
match regexp
- "/ignore" and "/unignore" commands: hide all that is write by a given
@@ -52,15 +46,10 @@ Future versions:
nick/host connect to the given irc network
* WeeChat commands:
- "/reload" command: reload the WeeChat's config file
- "/highlight" command: highlight a given word when it appears on
channels/privates
- "/completion" command: do shortcuts (for example when we type "u"
in the text bar it send it to the server as "you")
- "/exec" command: execute a command as if we was in shell
and show us the output on the current window. An option to exec
like -o could send the output to the server, on the current
channel/private
- "/last": command to look for text in previous messages
* Interface:
@@ -69,10 +58,9 @@ Future versions:
- understand incomplete commands if unambigous (for example: /he for /help is ok)
? Qt GUI
* TCP/IP communication:
- proxy support
- IPv6 protocol implementation
* Plugins:
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
* Configuration:
- add key bindings to config file
+59 -26
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.1.2, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.3, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.2])
AM_INIT_AUTOMAKE([weechat], [0.1.3])
# Checks for programs.
AC_PROG_CC
@@ -36,9 +36,6 @@ AM_GNU_GETTEXT
# Checks for libraries.
AC_CHECK_LIB([ncurses], [initscr], LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.3.4, wxWin=1)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h])
@@ -69,15 +66,17 @@ AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa mem
AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets,[ --enable-wxwidgets Turn on WxWidgets interface (default=no)],enable_wxwidgets=yes,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python plugins (default=no)],enable_python=yes,enable_python=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],enable_ncurses=$enableval,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets,[ --enable-wxwidgets Turn on WxWidgets interface (default=no)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=$enableval,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=$enableval,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python plugins (default=no)],enable_python=$enableval,enable_python=no)
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=auto)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
enable_plugins="no"
enable_ruby="no"
@@ -90,6 +89,7 @@ AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
# AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
@@ -102,6 +102,9 @@ if test "x$enable_ncurses" = "xyes" ; then
fi
if test "x$enable_wxwidgets" = "xyes" ; then
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.3.4, wxWin=1)
if test "$wxWin" != 1; then
AC_MSG_ERROR([
*** wxWindows must be installed on your system
@@ -138,7 +141,7 @@ PLUGINS_LIBS=
if test "x$enable_perl" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROG(PERL, perl)
AC_PATH_PROG(PERL, perl perl5)
if test -z $PERL ; then
AC_MSG_ERROR([
*** Perl must be installed on your system
@@ -148,19 +151,32 @@ Please check that perl is in path, or install
it with your software package manager.])
fi
AC_MSG_CHECKING(for Perl library)
PERL_LIB=`$PERL -e 'use Config; print "$Config{installprefix}/lib/$Config{libperl}"'`
AC_MSG_CHECKING(for Perl headers files)
if test -r "$PERL_LIB"; then
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `perl -MExtUtils::Embed -e ldopts`"
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
else
AC_MSG_ERROR([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `$PERL -MExtUtils::Embed -e ldopts`"
else
AC_MSG_ERROR([
*** Perl library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
AC_SUBST(PERL_CFLAGS)
AC_DEFINE(PLUGIN_PERL)
fi
@@ -168,7 +184,7 @@ fi
if test "x$enable_python" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROG(PYTHON, python)
AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2)
if test -z $PYTHON ; then
AC_MSG_ERROR([
*** Python must be installed on your system
@@ -178,11 +194,13 @@ if test "x$enable_python" = "xyes" ; then
*** it with your software package manager.])
fi
PYTHON_INCLUDE=`$PYTHON -c 'import sys ; print "%s/include/python%s" % (sys.prefix, sys.version[[:3]])'`
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE="$PYTHON_SYSPREFIX/include/python$PYTHON_VERSION"
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print ' -I' + distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
PYTHON_CFLAGS=-I`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
else
AC_MSG_ERROR([
*** Python header files couldn't be found in your system.
@@ -190,12 +208,11 @@ if test "x$enable_python" = "xyes" ; then
fi
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c 'import sys; print "%s/lib/python%s/config" % (sys.prefix, sys.version[[:3]])'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[0:3]]'`
PYTHON_LIB="$PYTHON_SYSPREFIX/lib/python$PYTHON_VERSION/config"
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so" -a -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS=`$PYTHON -c "import distutils.sysconfig,string; print string.join(distutils.sysconfig.get_config_vars('LINKFORSHARED', 'BLDLIBRARY', 'SHLIBS'))"`
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so" -o -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-lpython$PYTHON_VERSION -lpthread -lutil"
else
AC_MSG_ERROR([
*** Python library couldn't be found in your system.
@@ -214,6 +231,21 @@ fi
AC_SUBST(PLUGINS_LIBS)
if test "x$enable_gnutls" = "xyes" ; then
found_gnutls="no"
AM_PATH_LIBGNUTLS( 1.0.0, found_gnutls=yes, AC_MSG_WARN([[
*** libgnutls was not found. You may want to get it from
*** ftp://ftp.gnutls.org/pub/gnutls/
*** WeeChat will be built without GnuTLS support.]]))
if test "x$found_gnutls" = "xyes" ; then
GNUTLS_LIBS="-lgnutls"
AC_SUBST(GNUTLS_LIBS)
AC_DEFINE(HAVE_GNUTLS)
else
enable_gnutls="no"
fi
fi
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
CFLAGS="-O2"
@@ -286,6 +318,7 @@ echo Build with Plugin support..... : $enable_plugins
echo Build with Perl support....... : $enable_perl
echo Build with Python support..... : $enable_python
echo Build with Ruby support....... : $enable_ruby
echo Build with GNUtls support..... : $enable_gnutls
echo
echo Compile with debug info....... : $msg_debug_compiler
echo Print debugging messages...... : $msg_debug_verbose
+7
View File
@@ -1,3 +1,10 @@
weechat (0.1.2-2) unstable; urgency=low
* Patch src/gui/curse/gui-display.c to fix segfault
when config file does not exists (Closes: #310589).
-- Julien Louis <ptitlouis@sysif.net> Tue, 24 May 2005 20:55:02 +0200
weechat (0.1.2-1) unstable; urgency=low
* WeeChat version 0.1.2, see ChangeLog for detail.
+1
View File
@@ -0,0 +1 @@
4
+1 -1
View File
@@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev, python2.3 (>= 2.3), python-dev
Build-Depends: debhelper (>> 4.0.4), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev
Standards-Version: 3.6.1
Package: weechat
+157 -143
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.2 - May, 21 2005
@subtitle Documentation for WeeChat v0.1.3 - July, 03 2005
@image{weechat_image}
@@ -84,27 +84,27 @@ version 2 or higher.
@node Description, Pre-requisites, Introduction, Introduction
@section Description
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
designed for many operating systems.@*
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
designed for many operating systems.@*
@*
Main features are:
Main features are:
@itemize @minus
@item
multi-servers connection
@item
many GUI (Graphical User Interface): Curses, Gtk and Qt
@item
small, fast and light
@item
customizable and extensible with scripts
@item
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
@item
multi-platform (Gnu/Linux, *BSD, Windows and other)
@item
@item
multi-servers connection (with SSL, IPv6, proxy)
@item
many GUI: Curses, wxWidgets, Gtk and Qt
@item
small, fast and light
@item
customizable and extensible with scripts
@item
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
@item
multi-platform (Gnu/Linux, *BSD, MacOS X, Windows and other)
@item
100% GPL, free software
@end itemize
@end itemize
@*
WeeChat homepage is here:@*
@uref{http://weechat.flashtux.org}@*
@@ -116,20 +116,20 @@ In order to install WeeChat, you @b{need}:@*
@itemize @bullet
@item
A running Gnu/Linux system (with compiler tools for source package)
A running Gnu/Linux system (with compiler tools for source package)
@item
"root" privileges (to install WeeChat)
@item
According to GUI, one of the following libraries:
@itemize @minus
@item
Curses: ncurses library,
@item
Gtk: *** GUI not developed ***,
@item
Qt: *** GUI not developed ***,
According to GUI, one of the following libraries:
@itemize @minus
@item
Curses: ncurses library,
@item
Gtk: *** GUI not developed ***,
@item
Qt: *** GUI not developed ***,
@end itemize
@end itemize
@end itemize
@c ******************************* Installation *******************************
@@ -139,31 +139,31 @@ Qt: *** GUI not developed ***,
@menu
* Binary package::
* Source package::
* Source package::
* CVS sources::
@end menu
@node Binary package, Source package, Installation, Installation
@section Binary package
Binary packages are available for these distributions:
@itemize @bullet
@item
Debian (or any Debian compatible distribution)@*
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (or any RPM compatible distribution)@*
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
To install: @kbd{emerge weechat}
@item
*BSD (not available!)
@item
Slackware (not available!)
@item
Windows (not available!)
@end itemize
Binary packages are available for these distributions:
@itemize @bullet
@item
Debian (or any Debian compatible distribution)@*
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
@item
Mandriva/Redhat (or any RPM compatible distribution)@*
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
To install: @kbd{emerge weechat}
@item
*BSD (not available!)
@item
Slackware (not available!)
@item
Windows (not available!)
@end itemize
where x.y.z is the version (for example 0.0.1)
@*
@@ -176,27 +176,27 @@ All you have to do is to run in a console or a terminal:@*
@kbd{make}@*
Nota: to build only some interfaces, you can give parameters
to ./configure, type @kbd{./configure --help} for help about options.@*
Then get root privileges and install WeeChat:@*
@kbd{su}@*
(enter root password)@*
@kbd{make install}@*
Then get root privileges and install WeeChat:@*
@kbd{su}@*
(enter root password)@*
@kbd{make install}@*
@node CVS sources, , Source package, Installation
@section CVS sources
Warning: CVS sources are for advanced users: it may not compile or not be stable.
You're warned!@*
To get CVS sources, issue these commands:@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(when prompted for a password, just press Enter key)@*
Warning: CVS sources are for advanced users: it may not compile or not be stable.
You're warned!@*
To get CVS sources, issue these commands:@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(when prompted for a password, just press Enter key)@*
Execute this script:@*
@kbd{./autogen.sh}@*
Then follow instructions for source package - @xref{Source package}.
Then follow instructions for source package - @xref{Source package}.
@c ********************************** Usage ***********************************
@@ -206,40 +206,45 @@ Then follow instructions for source package - @xref{Source package}.
@menu
* Run WeeChat::
* Config file::
* Key bindings::
* Config file::
* Key bindings::
* WeeChat commands::
* FIFO pipe::
@end menu
@node Run WeeChat, Config file, Usage, Usage
@section Run WeeChat
@subsection Command line parameters
@subsection Command line parameters
@table @code
@item -c, --config
Display config file help (list of options)@*
@item -h, --help
Display help screen@*
@item -i, --irc-commands
Display IRC commands list@*
@item -l, --license
Display WeeChat license@*
@item -v, --version
@item -v, --version
Display WeeChat version@*
@end table
@subsection Run WeeChat
Just issue this command to run WeeChat:@*
@item -w, --weechat-commands
Display WeeChat commands list@*
@end table
@subsection Run WeeChat
Just issue this command to run WeeChat:@*
@kbd{weechat-curses} (for Curses front-end)@*
or @kbd{weechat-wxwidgets} (for wxWidgets front-end)@*
or @kbd{weechat-gtk} (for Gtk front-end)@*
or @kbd{weechat-qt} (for Qt front-end)@*
When you run WeeChat for the first time, a default configuration file is
created, with default options.@*
The default configuration file is: ~/.weechat/weechat.rc@*
You can edit this file at your convenience to configure WeeChat, or you can
or @kbd{weechat-qt} (for Qt front-end)@*
When you run WeeChat for the first time, a default configuration file is
created, with default options.@*
The default configuration file is: ~/.weechat/weechat.rc@*
You can edit this file at your convenience to configure WeeChat, or you can
set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
@node Config file, Key bindings, Run WeeChat, Usage
@@ -248,7 +253,6 @@ set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
List of options for config file:@*
@table @kbd
@item look_set_title
Set title for window (terminal for Curses GUI) with name & version@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -488,7 +492,7 @@ Default message when away@*
Type: string (any string), default value: 'away'@*
@item irc_default_msg_part
Default part message (leaving channel)@*
Type: string (any string), default value: ''@*
Type: string (any string), default value: 'WeeChat %v'@*
@item irc_default_msg_quit
Default quit message ('%v' will be replaced by WeeChat version in string)@*
Type: string (any string), default value: 'WeeChat %v'@*
@@ -537,12 +541,21 @@ Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item proxy_use
Use a proxy server to connect to irc server@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item proxy_type
Proxy type (http (default), socks4, socks5)@*
Type: string (values: 'http', 'socks4', 'socks5'), default value: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item proxy_address
Proxy server address (IP or hostname)@*
Type: string (any string), default value: ''@*
@item proxy_port
Port for connecting to proxy server@*
Type: integer (values: between 0 and 65535), default value: 1080@*
Type: integer (values: between 0 and 65535), default value: 3128@*
@item proxy_username
Username for proxy server@*
Type: string (any string), default value: ''@*
@item proxy_password
Password for proxy server@*
Type: string (any string), default value: ''@*
@@ -564,6 +577,12 @@ Type: string (any string), default value: ''@*
@item server_port
Port for connecting to server@*
Type: integer (values: between 0 and 65535), default value: 6667@*
@item server_ipv6
Use IPv6 protocol for server communication@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item server_ssl
Use SSL for server communication@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item server_password
Password for IRC server@*
Type: string (any string), default value: ''@*
@@ -594,7 +613,9 @@ Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item server_notify_levels
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
Type: string (any string), default value: ''@*
@end table
Colors for Curses GUI are:@*
@@ -633,11 +654,11 @@ Colors for Curses GUI are:@*
@node Key bindings, WeeChat commands, Config file, Usage
@section Key bindings
@table @kbd
@item Left arrow / Right arrow
Go to previous / next char in command line@*
@*
@*
@item Ctrl + left arrow / Ctrl + right arrow
Go to previous / next word in command line@*
@*
@@ -647,28 +668,28 @@ Go to the beginning of command line@*
@item End / Ctrl + E
Go to the end of command line@*
@*
@item Backspace / Delete
@item Backspace / Delete
Erase previous / next char of command line@*
@*
@item Ctrl + Backspace / Ctrl + W
@*
@item Ctrl + Backspace / Ctrl + W
Erase previous word of command line@*
@*
@item Tab
@*
@item Tab
Complete command or nick (@kbd{Tab} again: find next completion)@*
@*
@item Any char
Insert char to cursor position in the command line@*
@*
@item Enter
@*
@item Any char
Insert char to cursor position in the command line@*
@*
@item Enter
Execute command or send message@*
@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item PageUp / PageDown
@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item PageUp / PageDown
Show buffer history@*
@*
@item F5 / F6
@item F5 / F6
Switch to previous / next buffer@*
@*
@item F7 / F8
@@ -682,8 +703,8 @@ Scroll nicklist@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@item Alt + left arrow / Alt + right arrow
@*
@item Alt + left arrow / Alt + right arrow
Same as F5 / F6@*
@*
@item Alt + A
@@ -715,7 +736,6 @@ Scroll nicklist@*
WeeChat internal commands:@*
@table @kbd
@item alias [alias_name [command [arguments]]
@*
create an alias for a command@*
@@ -779,13 +799,15 @@ list/load/unload Python scripts@*
filename: Python script (file) to load@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@item server [servername] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@*
list, add or remove servers@*
@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
ipv6: use IPv6 protocol@*
ssl: use SSL protocol@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
@@ -821,13 +843,11 @@ splith: split current window horizontally@*
splitv: split current window vertically@*
merge: merge window with another@*
@*
@end table
IRC commands:@*
@table @kbd
@item admin [target]
@*
find information about the administrator of the server@*
@@ -1194,7 +1214,6 @@ nickname: nickname to search@*
count: number of replies to return (full search if negative number)@*
target: reply should match this mask@*
@*
@end table
@node FIFO pipe, , WeeChat commands, Usage
@@ -1443,7 +1462,7 @@ List all Python scripts: @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( name, version, shutdown_function, description );}@*
@command{weechat.register ( name, version, shutdown_function, description )}@*
@*
This is first function to call in Python script.@*
All Python scripts for WeeChat should call this function.@*
@@ -1459,11 +1478,11 @@ unloaded (optional parameter, empty string means nothing is called at the end)
@end itemize
@*
@emph{Example:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@*
@*
@item
@command{weechat.prnt ( message, [channel, [server]] );}@*
@command{weechat.prnt ( message, [channel, [server]] )}@*
@*
Print message in a channel.@*
@@ -1475,13 +1494,13 @@ Print message in a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( delay, message );}@*
@command{weechat.print_infobar ( delay, message )}@*
@*
Print message in infobar.@*
@@ -1493,11 +1512,11 @@ Print message in infobar.@*
@end itemize
@*
@emph{Example:}@*
@code{weechat.print_infobar (5, "message");}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( name, function );}@*
@command{weechat.add_message_handler ( name, function )}@*
@*
Attach a Python function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@@ -1512,18 +1531,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ weechat.print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", my_function)}@*
@code{def my_function(server, args):}@*
@code{@ @ @ @ weechat.prnt("server="+server)}@*
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("host="+hostmask+", channel="+channel+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( name, function );}@*
@command{weechat.add_command_handler ( name, function )}@*
@*
Create new WeeChat command, linked with Python function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -1538,16 +1555,13 @@ available until your Python script will be unloaded.
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("command", my_command)}@*
@code{def my_command(server, args):}@*
@code{@ @ @ @ weechat.prnt("server:"+server+" arguments:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@@ -1559,14 +1573,14 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( name, [server] );}@*
@command{weechat.get_info ( name, [server] )}@*
@*
Get various info about WeeChat, server or user.@*
@@ -1585,8 +1599,8 @@ Get various info about WeeChat, server or user.@*
@end itemize
@*
@emph{Examples:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
@@ -1665,7 +1679,7 @@ Look for WeeChat support page for detail:@*
@node Copyright, , Get support, Authors / Support
@section Copyright
This manual documents WeeChat IRC client, it is part of WeeChat.@*
This manual documents WeeChat IRC client, it is part of WeeChat.@*
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
+69 -56
View File
@@ -35,7 +35,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.2 - 21 de mayo de 2005
@subtitle Documentaci@'on para WeeChat v0.1.3 - 03 de Julio de 2005
@image{weechat_image}
@@ -90,9 +90,9 @@ dise@~nado para diferentes sistemas operativos.@*
Las caracter@'isticas principales son las siguientes:
@itemize @minus
@item
conexi@'on multi-servidores
conexi@'on multi-servidores (con SSL, IPv6, proxy)
@item
m@'ultiples interfaces: Curses, Gtk y Qt
m@'ultiples interfaces: Curses, wxWidgets, Gtk y Qt
@item
peque@~no, r@'apido y ligero.
@item
@@ -100,7 +100,7 @@ parametrizable y extensible mediante guiones (scripts)
@item
conforme a las RFCs 1459, 2810, 2811, 2812, y 2813
@item
multi-plataforma (Gnu/Linux, *BSD, Windows y otros sistemas operativos)
multi-plataforma (Gnu/Linux, *BSD, MacOS X, Windows y otros sistemas operativos)
@item
100% GPL, con Licencia Libre
@end itemize
@@ -223,16 +223,21 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
Obtener la ayuda del fichero de configuraci@'on (lista de opciones)@*
@item -h, --help
Obtener la ayuda@*
@item -i, --irc-commands
Display IRC commands list@*
@item -l, --license
Obtener la licencia de WeeChat@*
@item -v, --version
Obtener la versi@'on de WeeChat@*
@item -w, --weechat-commands
Display WeeChat commands list@*
@end table
@subsection Lanzar WeeChat
Para ejecutar WeeChat, basta escribir la l@'inea siguiente:@*
@kbd{weechat-curses} (para el interfaz con Curses)@*
o @kbd{weechat-wxwidgets} (para el interfaz con wxWidgets)@*
o @kbd{weechat-gtk} (para el interfaz con Gtk)@*
o @kbd{weechat-qt} (para el interfaz con Qt)@*
@@ -247,7 +252,6 @@ Puedes editarlo para configurar WeeChat con las opciones deseadas, o tambi@'en p
Enumeraci@'on de las opciones del fichero de configuraci@'on:@*
@table @kbd
@item look_set_title
Define el t@'itulo de la ventana (el terminal para la interfaz Curses) con el nombre y la versi@'on@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@@ -487,7 +491,7 @@ Mensaje por defecto para el estado ausente@*
Typo: cadena (cualquier cadena), valor por defecto: 'away'@*
@item irc_default_msg_part
Mensaje por defecto de salida (saliendo de un canal)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
@item irc_default_msg_quit
Mensaje de fin por defecto ('%v' ser@'a reemplazado por la versi@'on de WeeChat en la cadena)@*
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
@@ -536,12 +540,21 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item proxy_use
Utilizar un proxy para conectarse al servidor irc@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item proxy_type
Proxy type (http (default), socks4, socks5)@*
Typo: cadena (valores: 'http', 'socks4', 'socks5'), valor por defecto: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item proxy_address
Direcci@'on del servidor proxy (IP o nombre de m@'aquina)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_port
Puerto para conectarse al servidor proxy@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 1080@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 3128@*
@item proxy_username
Username for proxy server@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_password
Contrase@~na para el servidor proxy@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@@ -563,6 +576,12 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item server_port
Puerto para conectarse al servidor@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 6667@*
@item server_ipv6
Use IPv6 protocol for server communication@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_ssl
Use SSL for server communication@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_password
Contrase@~na para el servidor IRC@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@@ -593,7 +612,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item server_autorejoin
Unirse de nuevo autom@'aticamente a los canales cuando sea expulsado@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item server_notify_levels
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@end table
Los colores para el interfaz Curses son:@*
@@ -630,7 +651,6 @@ Los colores para el interfaz Curses son:@*
@kbd{white}: blanco
@end itemize
@node Atajos de teclado, Comandos WeeChat, Ficheros de configuracion, Uso
@section Atajos de teclado
@@ -715,7 +735,6 @@ Scroll nicklist@*
Comandos internos WeeChat:@*
@table @kbd
@item alias [nombre_alias [comando [argumentos]]
@*
crear un alias para un comando@*
@@ -779,19 +798,21 @@ lista/carga/descarga de los Python scripts@*
fichero: Python script (archivo) a cargar@*
Sin argumentos, el comando /python lista todos los Python scripts cargados.@*
@*
@item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-ipv6] [-ssl] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@*
lista, a@~nade o elimina servidores@*
@*
nombre_de_servidor: nombre del servidor, para uso interno y para mostrar@*
nombre/IP: nombre o direcci@'on IP del servidor@*
puerto: puerto para el servidor (nĂşmero entero)@*
contrase@~na: contrase@~na para el servidor@*
alias1: primer alias para el servidor@*
alias2: alias alternativo para el servidor@*
alias3: segundo alias alternativo para el servidor@*
nombre_de_usuario: nombre de usuario@*
nombre_real: nombre real del usuario@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
ipv6: use IPv6 protocol@*
ssl: use SSL protocol@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
nick3: second alternate nick for server@*
username: user name@*
realname: real name of user@*
@*
@item save [archivo]
@*
@@ -821,13 +842,11 @@ splith: dividir la ventana actual horizontalmente@*
splitv: dividir la ventana actual verticalmente@*
merge: fusionar una ventana con otra@*
@*
@end table
Comandos IRC:@*
@table @kbd
@item admin [target]
@*
encontrar informaci@'on sobre el administrador del servidor@*
@@ -1194,7 +1213,6 @@ usuario: nombre de usuario a buscar@*
nĂşmero: nĂşmero de respuestas a devolver (bĂşsqueda completa si el nĂşmero es negativo)@*
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
@*
@end table
@node Canal FIFO, , Comandos WeeChat, Uso
@@ -1445,7 +1463,7 @@ Listar los programas Python cargados: @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on )}@*
@*
Es la primera funci@'on a la que llamar en el programa Python.@*
Todos los programas en Python para WeeChat deben llamar esta funci@'on.@*
@@ -1461,11 +1479,11 @@ tener un nombre distinto)
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...")}@*
@*
@item
@command{weechat.prnt ( mensaje, [canal, [servidor]] );}@*
@command{weechat.prnt ( mensaje, [canal, [servidor]] )}@*
@*
Escribe un mensaje en un canal.@*
@@ -1477,29 +1495,29 @@ Escribe un mensaje en un canal.@*
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.prnt ("mensaje");}@*
@code{weechat.prnt ("mensaje", "#weechat");}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode");}@*
@code{weechat.prnt ("mensaje")}@*
@code{weechat.prnt ("mensaje", "#weechat")}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( retraso, mensaje );}@*
@command{weechat.print_infobar ( retraso, mensaje )}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{plazo}: periodo en segundo durante el cual se mostrar@'a el mensaje
@item @option{retraso}: periodo en segundo durante el cual se mostrar@'a el mensaje
(si es 0, el mensaje no se borrar@'a).
@item @option{message}: mensaje que se escribir@'a en la barra de informaciones.
@item @option{mensaje}: mensaje que se escribir@'a en la barra de informaciones.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.print_infobar (5, "mensaje");}@*
@code{weechat.print_infobar (5, "mensaje")}@*
@*
@item
@command{weechat.add_message_handler ( nombre, funci@'on );}@*
@command{weechat.add_message_handler ( nombre, funci@'on )}@*
@*
Adjunta una funci@'on Python a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@@ -1515,18 +1533,16 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", mi_funcion)}@*
@code{def mi_funcion(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("servidor="+servidor)}@*
@code{@ @ @ @ null, canal, mensaje = string.split(args, ":", 2)}@*
@code{@ @ @ @ mascara, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("mascara="+mascara+", canal="+canal+", mensaje="+mensaje)}@*
@*
@item
@command{weechat.add_command_handler ( nombre, funci@'on );}@*
@command{weechat.add_command_handler ( nombre, funci@'on )}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Python.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@@ -1541,16 +1557,13 @@ al antiguo comando si el script Python est@'a cargado.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("comando", mi_comando)}@*
@code{def mi_comando(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("Servidor:"+servidor+" Par@'ametros:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] );}@*
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@@ -1562,13 +1575,13 @@ Execute a command or send a message to a channel.@*
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!");}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nombre, [servidor] );}@*
@command{weechat.get_info ( nombre, [servidor] )}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@@ -1587,8 +1600,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
+156 -142
View File
@@ -35,7 +35,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.2 - 21 Mai 2005
@subtitle Documentation pour WeeChat v0.1.3 - 03 Juillet 2005
@image{weechat_image}
@@ -83,27 +83,27 @@ License version 2 ou plus.
@node Description, Pre-requis, Introduction, Introduction
@section Description
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
concu pour diff@'erents syst@`emes d'exploitation.@*
@*
Ses principales caract@'eristiques sont les suivantes :
@*
Ses principales caract@'eristiques sont les suivantes :
@itemize @minus
@item
connexion multi-serveurs
@item
plusieurs interfaces : Curses, Gtk et Qt
@item
petit, rapide et l@'eger
@item
param@'etrable et extensible avec des scripts
@item
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
@item
multi-plateformes (Gnu/Linux, *BSD, Windows et d'autres syst@`emes)
@item
@item
connexion multi-serveurs (avec SSL, IPv6, proxy)
@item
plusieurs interfaces : Curses, wxWidgets, Gtk et Qt
@item
petit, rapide et l@'eger
@item
param@'etrable et extensible avec des scripts
@item
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
@item
multi-plateformes (Gnu/Linux, *BSD, MacOS X, Windows et d'autres syst@`emes)
@item
100% GPL, logiciel libre
@end itemize
@end itemize
@*
La page d'accueil de WeeChat est ici :@*
@uref{http://weechat.flashtux.org}@*
@@ -115,20 +115,20 @@ Pour installer WeeChat, vous @b{devez} avoir :@*
@itemize @bullet
@item
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
@item
Droits "root" (pour installer WeeChat)
@item
Selon l'interface, une des biblioth@`eques suivantes :
@itemize @minus
@item
Curses: la librairie ncurses,
@item
Gtk: *** interface non d@'evelopp@'ee ***,
@item
Qt: *** interface non d@'evelopp@'ee ***,
Selon l'interface, une des biblioth@`eques suivantes :
@itemize @minus
@item
Curses: la librairie ncurses,
@item
Gtk: *** interface non d@'evelopp@'ee ***,
@item
Qt: *** interface non d@'evelopp@'ee ***,
@end itemize
@end itemize
@end itemize
@c ******************************* Installation *******************************
@@ -138,31 +138,31 @@ Qt: *** interface non d@'evelopp@'ee ***,
@menu
* Paquet binaire::
* Paquet source::
* Paquet source::
* Sources CVS::
@end menu
@node Paquet binaire, Paquet source, Installation, Installation
@section Paquet binaire
Les paquets binaires sont disponibles pour les distributions suivantes :
@itemize @bullet
@item
Debian (ou toute distribution compatible Debian)@*
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
Pour installer : @kbd{emerge weechat}
@item
*BSD (non disponible !)
@item
Slackware (non disponible !)
@item
Windows (non disponible !)
@end itemize
Les paquets binaires sont disponibles pour les distributions suivantes :
@itemize @bullet
@item
Debian (ou toute distribution compatible Debian)@*
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
Pour installer : @kbd{emerge weechat}
@item
*BSD (non disponible !)
@item
Slackware (non disponible !)
@item
Windows (non disponible !)
@end itemize
o@`u x.y.z est la version (par exemple 0.0.1)
@*
@@ -175,28 +175,28 @@ Tapez simplement dans une console ou un terminal :@*
@kbd{make}@*
Note: pour ne construire que certaines interfaces, vous pouvez passer des param@`etres
@`a ./configure, tapez @kbd{./configure --help} pour de l'aide sur ces options.@*
Obtenez les droits root et installez WeeChat :@*
@kbd{su}@*
(entrez le mot de passe de root)@*
@kbd{make install}@*
Obtenez les droits root et installez WeeChat :@*
@kbd{su}@*
(entrez le mot de passe de root)@*
@kbd{make install}@*
@node Sources CVS, , Paquet source, Installation
@section Sources CVS
@section Sources CVS
Attention: les sources CVS sont r@'eserv@'es aux utilisateurs avanc@'es : il se peut
que WeeChat ne compile pas et qu'il soit tr@`s instable.
Vous @^etes pr@'evenus !@*
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
que WeeChat ne compile pas et qu'il soit tr@`s instable.
Vous @^etes pr@'evenus !@*
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
Ex@'ecutez ce script :@*
@kbd{./autogen.sh}@*
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
@c ******************************* Utilisation ********************************
@@ -206,40 +206,45 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
@menu
* Lancer WeeChat::
* Fichier de configuration::
* Raccourcis clavier::
* Fichier de configuration::
* Raccourcis clavier::
* Commandes WeeChat::
* Tube FIFO::
@end menu
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
@section Lancer WeeChat
@subsection Param@`etres de ligne de commande
@subsection Param@`etres de ligne de commande
@table @code
@item -c, --config
Afficher l'aide sur le fichier de config (liste des options)@*
@item -h, --help
Afficher l'aide@*
@item -i, --irc-commands
Afficher la liste des commandes IRC@*
@item -l, --license
Afficher la licence de WeeChat@*
@item -v, --version
@item -v, --version
Afficher la version de WeeChat@*
@end table
@subsection Lancer WeeChat
Tapez simplement cette commande pour lancer WeeChat :@*
@item -w, --weechat-commands
Afficher la liste des commandes WeeChat@*
@end table
@subsection Lancer WeeChat
Tapez simplement cette commande pour lancer WeeChat :@*
@kbd{weechat-curses} (pour l'interface Curses)@*
ou @kbd{weechat-wxwidgets} (pour l'interface wxWidgets)@*
ou @kbd{weechat-gtk} (pour l'interface Gtk)@*
ou @kbd{weechat-qt} (pour l'interface Qt)@*
ou @kbd{weechat-qt} (pour l'interface Qt)@*
Lorsque vous lancez WeeChat pour la premi@`ere fois, un fichier de configuration
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} - @xref{Commandes WeeChat}.
@node Fichier de configuration, Raccourcis clavier, Lancer WeeChat, Utilisation
@@ -248,7 +253,6 @@ vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} -
Liste des options du fichier de configuration :@*
@table @kbd
@item look_set_title
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -418,7 +422,7 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
Couleur pour le symbole voix@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Couleur pour les '+' lors du scroll sur les pseudos@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_sep
Couleur pour le s@'eparateur de pseudo@*
@@ -488,7 +492,7 @@ Message par d@'efaut pour l'absence@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'away'@*
@item irc_default_msg_part
Message par d@'efaut pour le part (quitte un canal)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@item irc_default_msg_quit
Message de fin par d@'efaut ('%v' sera remplac@'e par la version de WeeChat dans la cha@^ine)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@@ -537,12 +541,21 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item proxy_use
Utiliser un proxy pour se connecter au serveur irc@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item proxy_type
Type de proxy (http (d@'efaut), socks4, socks5)@*
Type: cha@^ine (valeurs: 'http', 'socks4', 'socks5'), valeur par d@'efaut: 'http'@*
@item proxy_ipv6
Se connecter au proxy en ipv6@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item proxy_address
Adresse du serveur proxy (IP ou nom)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item proxy_port
Port pour se connecter au serveur proxy@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 1080@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 3128@*
@item proxy_username
Nom d'utilisateur pour le serveur proxy@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item proxy_password
Mot de passe pour le serveur proxy@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -564,6 +577,12 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_port
Port pour se connecter au serveur@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 6667@*
@item server_ipv6
Utiliser le protocole IPv6 pour la communication avec le serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item server_ssl
Utiliser SSL pour la communication avec le serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item server_password
Mot de passe pour le serveur IRC@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -594,7 +613,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_autorejoin
Rejoindre automatiquement les canaux quand mis dehors@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item server_notify_levels
Liste des niveaux de notifications (s@'epar@'es par des virgules) pour les canaux de ce serveur (format: #canal:1,..)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@end table
Les couleurs pour l'interface Curses sont :@*
@@ -633,11 +654,11 @@ Les couleurs pour l'interface Curses sont :@*
@node Raccourcis clavier, Commandes WeeChat, Fichier de configuration, Utilisation
@section Raccourcis clavier
@table @kbd
@item Fl@`eche gauche / Fl@`eche droite
Aller au caract@`ere pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@*
@item Ctrl + fl@`eche gauche / Ctrl + fl@`eche droite
Aller au mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@@ -647,28 +668,28 @@ Aller au d@'ebut de la ligne de commande@*
@item End / Ctrl + E
Aller @`a la fin de la ligne de commande@*
@*
@item Backspace / Delete
@item Backspace / Delete
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@item Ctrl + Backspace / Ctrl + W
@*
@item Ctrl + Backspace / Ctrl + W
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
@*
@item Tab
@*
@item Tab
Compl@'eter la commande ou le pseudo (@kbd{Tab} @`a nouveau : trouver la compl@'etion suivante)@*
@*
@item Tout caract@`ere
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
@*
@item Entr@'ee
@*
@item Tout caract@`ere
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
@*
@item Entr@'ee
Ex@'ecuter la commande ou envoyer le message@*
@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item PageUp / PageDown
@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item PageUp / PageDown
Afficher l'historique du tampon@*
@*
@item F5 / F6
@*
@item F5 / F6
Aller au tampon pr@'ec@'edent / suivant@*
@*
@item F7 / F8
@@ -683,7 +704,7 @@ Faire d@'efiler la liste des pseudos@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
Identique @`a F5 / F6@*
@*
@item Alt + A
@@ -715,7 +736,6 @@ Faire d@'efiler la liste des pseudos@*
Commandes internes WeeChat :@*
@table @kbd
@item alias [nom_alias [commande [param@`etres]]
@*
cr@'eer un alias pour une commande@*
@@ -779,13 +799,15 @@ liste/charge/d@'echarge des scripts Python@*
fichier: script Python (fichier) @`a charger@*
Sans param@`etre, la commande /python liste tous les scripts Python charg@'es.@*
@*
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-ipv6] [-ssl] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@*
liste, ajoute ou retire des serveurs@*
@*
nom_serveur: nom du serveur, pour usage interne et affichage@*
nom/IP: nom ou adresse IP du serveur@*
port: port pour le serveur (nombre entier)@*
ipv6: utiliser le protocole IPv6@*
ssl: utiliser le protocole SSL@*
mot_de_passe: mot de passe pour le serveur@*
pseudo1: premier pseudo pour le serveur@*
pseudo2: pseudo alternatif pour le serveur@*
@@ -821,13 +843,11 @@ splith: @'eclate la fen@^etre en deux horizontalement@*
splitv: @'eclate la fen@^etre en deux verticalement@*
merge: fusionne la fen@^etre avec une autre@*
@*
@end table
Commandes IRC :@*
@table @kbd
@item admin [cible]
@*
trouver les informations sur l'administrateur du serveur@*
@@ -1194,7 +1214,6 @@ pseudo: pseudo @`a chercher@*
nombre: nombre de r@'eponses @`a retourner (recherche compl@`ete si nombre n@'egatif)@*
cible: la r@'eponse doit correspondre @`a ce masque@*
@*
@end table
@node Tube FIFO, , Commandes WeeChat, Utilisation
@@ -1444,7 +1463,7 @@ Lister les scripts Python charg@'es : @kbd{/python}@*
@itemize @bullet
@item
@command{weechat.register ( nom, version, fonction_de_fin, description );}@*
@command{weechat.register ( nom, version, fonction_de_fin, description )}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Python.@*
Tout script Python pour WeeChat doit appeler cette fonction.@*
@@ -1461,11 +1480,11 @@ de fonction @`a appeler)
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !")}@*
@*
@item
@command{weechat.prnt ( message, [canal, [serveur]] );}@*
@command{weechat.prnt ( message, [canal, [serveur]] )}@*
@*
Affiche un message dans un canal.@*
@@ -1477,13 +1496,13 @@ Affiche un message dans un canal.@*
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.prnt ("message");}@*
@code{weechat.prnt ("message", "#weechat");}@*
@code{weechat.prnt ("message", "#weechat", "freenode");}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( d@'elai, message );}@*
@command{weechat.print_infobar ( d@'elai, message )}@*
@*
Affiche un message dans la barre d'infos.@*
@@ -1495,11 +1514,11 @@ Affiche un message dans la barre d'infos.@*
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.print_infobar (5, "message");}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( nom, fonction );}@*
@command{weechat.add_message_handler ( nom, fonction )}@*
@*
Attache une fonction Python @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@@ -1515,18 +1534,16 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ weechat.prnt ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@code{weechat.add_message_handler ("privmsg", ma_fonction)}@*
@code{def ma_fonction(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur="+serveur)}@*
@code{@ @ @ @ null, canal, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ masque, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("masque="+masque+", canal="+canal+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( nom, fonction );}@*
@command{weechat.add_command_handler ( nom, fonction )}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Python.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@@ -1541,16 +1558,13 @@ ne seront plus accessibles tant que le script Python sera charg@'e.
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ weechat.prnt("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@code{weechat.add_command_handler ("commande", ma_commande)}@*
@code{def ma_commande(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur:"+serveur+" param@`etres:"+args)}@*
@*
@item
@command{weechat.command ( commande, [canal, [serveur]] );}@*
@command{weechat.command ( commande, [canal, [serveur]] )}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@@ -1562,13 +1576,13 @@ Ex@'ecute une commande ou envoie un message @'a un canal.@*
@end itemize
@*
@emph{Exemples :}@*
@code{weechat.command ("bonjour tout le monde !");}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat.command ("/nick newnick", "", "freenode");}@*
@code{weechat.command ("bonjour tout le monde !")}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nom, [serveur] );}@*
@command{weechat.get_info ( nom, [serveur] )}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@@ -1587,8 +1601,8 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@end itemize
@*
@emph{Exemples :}@*
@code{$version = weechat.get_info("version");}@*
@code{$nick = weechat.get_info("nick", "freenode");}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
File diff suppressed because it is too large Load Diff
+460 -341
View File
File diff suppressed because it is too large Load Diff
+466 -340
View File
File diff suppressed because it is too large Load Diff
+479 -358
View File
File diff suppressed because it is too large Load Diff
+30 -10
View File
@@ -84,13 +84,15 @@ t_weechat_command weechat_commands[] =
0, 2, weechat_cmd_python, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 "
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
"[nick2 [nick3]]] [-username username] [-realname realname] "
"[-command command] [-autojoin channel[,channel]] ] | "
"[del servername]"),
N_("servername: server name, for internal & display use\n"
"hostname: name or IP address of server\n"
"port: port for server (integer)\n"
"ipv6: use IPv6 protocol\n"
"ssl: use SSL protocol\n"
"password: password for server\n"
"nick1: first nick for server\n"
"nick2: alternate nick for server\n"
@@ -706,7 +708,7 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
ptr_nick = nick_search (CHANNEL(buffer), server->nick);
if (ptr_nick)
{
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick,
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_color (CHANNEL(buffer)->buffer,
COLOR_WIN_CHAT, "%s\n", command);
@@ -995,7 +997,8 @@ weechat_cmd_buffer (int argc, char **argv)
(ptr_buffer->dcc) ? "DCC" :
((BUFFER_IS_SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
CHANNEL(ptr_buffer)->name));
if (ptr_buffer->dcc)
if ((!BUFFER_IS_CHANNEL(ptr_buffer))
&& (!BUFFER_IS_PRIVATE(ptr_buffer)))
gui_printf (NULL, "-");
else
gui_printf (NULL, "%d", ptr_buffer->notify_level);
@@ -1010,22 +1013,34 @@ weechat_cmd_buffer (int argc, char **argv)
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0'))
{
if ((number < 0) || (number > 3))
if ((number < NOTIFY_LEVEL_MIN) || (number > NOTIFY_LEVEL_MAX))
{
/* invalid highlight level */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
return -1;
}
if ((!BUFFER_IS_CHANNEL(gui_current_window->buffer))
&& (!BUFFER_IS_PRIVATE(gui_current_window->buffer)))
{
/* invalid buffer type (only ok on channel or private) */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect buffer for notify (must be channel or private)\n"),
WEECHAT_ERROR);
return -1;
}
gui_current_window->buffer->notify_level = number;
channel_set_notify_level (SERVER(gui_current_window->buffer),
CHANNEL(gui_current_window->buffer),
number);
}
else
{
/* invalid number */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
WEECHAT_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
return -1;
}
}
@@ -1554,7 +1569,7 @@ weechat_cmd_python (int argc, char **argv)
path_script = NULL;
else
{
path_length = strlen (weechat_home) + strlen (argv[1]) + 7;
path_length = strlen (weechat_home) + strlen (argv[1]) + 9;
path_script = (char *) malloc (path_length * sizeof (char));
snprintf (path_script, path_length, "%s%s%s%s%s",
weechat_home, DIR_SEPARATOR, "python",
@@ -1751,6 +1766,10 @@ weechat_cmd_server (int argc, char **argv)
server.autoconnect = 1;
if (strcasecmp (argv[i], "-noauto") == 0)
server.autoconnect = 0;
if (strcasecmp (argv[i], "-ipv6") == 0)
server.ipv6 = 1;
if (strcasecmp (argv[i], "-ssl") == 0)
server.ssl = 1;
if (strcasecmp (argv[i], "-pwd") == 0)
{
if (i == (argc - 1))
@@ -1838,10 +1857,11 @@ weechat_cmd_server (int argc, char **argv)
new_server = server_new (server.name, server.autoconnect,
server.autoreconnect,
server.autoreconnect_delay,
0, server.address, server.port, server.password,
0, server.address, server.port, server.ipv6,
server.ssl, server.password,
server.nick1, server.nick2, server.nick3,
server.username, server.realname,
server.command, 1, server.autojoin, 1);
server.command, 1, server.autojoin, 1, NULL);
if (new_server)
{
irc_display_prefix (NULL, PREFIX_INFO);
+86 -16
View File
@@ -47,6 +47,7 @@ completion_init (t_completion *completion)
completion->base_command_arg = 0;
completion->position = -1;
completion->base_word = NULL;
completion->args = NULL;
completion->completion_list = NULL;
completion->last_completion = NULL;
@@ -67,6 +68,10 @@ completion_free (t_completion *completion)
free (completion->base_word);
completion->base_word = NULL;
if (completion->args)
free (completion->args);
completion->args = NULL;
while (completion->completion_list)
weelist_remove (&completion->completion_list,
&completion->last_completion,
@@ -97,8 +102,11 @@ completion_build_list (t_completion *completion, void *channel)
int i, j;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
char option_name[256];
char *pos, option_name[256];
t_weechat_alias *ptr_alias;
t_config_option *option;
void *option_value;
char option_string[2048];
/* WeeChat internal commands */
@@ -211,32 +219,92 @@ completion_build_list (t_completion *completion, void *channel)
"unload");
return;
}
if ((strcasecmp (completion->base_command, "set") == 0)
&& (completion->base_command_arg == 1))
if (strcasecmp (completion->base_command, "set") == 0)
{
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
if (completion->base_command_arg == 1)
{
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
for (j = 0; weechat_options[i][j].option_name; j++)
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
}
}
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
option_name);
}
}
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
else if (completion->base_command_arg == 3)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
if (completion->args)
{
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_name);
pos = strchr (completion->args, ' ');
if (pos)
pos[0] = '\0';
option = NULL;
option_value = NULL;
config_option_search_option_value (completion->args, &option, &option_value);
if (option && option_value)
{
switch (option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (option_value && (*((int *)(option_value))))
weelist_add (&completion->completion_list,
&completion->last_completion,
"on");
else
weelist_add (&completion->completion_list,
&completion->last_completion,
"off");
break;
case OPTION_TYPE_INT:
snprintf (option_string, sizeof (option_string) - 1,
"%d", (option_value) ? *((int *)(option_value)) : option->default_int);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_string);
break;
case OPTION_TYPE_INT_WITH_STRING:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
option->array_values[*((int *)(option_value))] :
option->array_values[option->default_int]);
break;
case OPTION_TYPE_COLOR:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
gui_get_color_by_value (*((int *)(option_value))) :
option->default_string);
break;
case OPTION_TYPE_STRING:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
*((char **)(option_value)) :
option->default_string);
break;
}
}
if (pos)
pos[0] = ' ';
}
}
return;
@@ -471,6 +539,8 @@ completion_find_context (t_completion *completion, void *channel, char *buffer,
command_arg++;
i++;
while ((i < pos) && (buffer[i] == ' ')) i++;
if (!completion->args)
completion->args = strdup (buffer + i);
}
else
i++;
+1
View File
@@ -39,6 +39,7 @@ struct t_completion
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
char *args; /* command line args (including base word) */
/* for command argument completion */
t_weelist *completion_list; /* data list for completion */
+26 -4
View File
@@ -48,6 +48,10 @@
#include <time.h>
#include <signal.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
@@ -70,9 +74,13 @@ int sigsegv = 0; /* SIGSEGV received?
char *weechat_home = NULL; /* WeeChat home dir. (example: /home/toto/.weechat) */
FILE *weechat_log_file = NULL; /* WeeChat log file (~/.weechat/weechat.log) */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1 */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1 */
int server_cmd_line; /* at least one server on WeeChat command line */
int server_cmd_line; /* at least one server on WeeChat command line */
#ifdef HAVE_GNUTLS
gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
#endif
/*
@@ -356,7 +364,7 @@ wee_parse_args (int argc, char *argv[])
wee_display_commands (1, 0);
wee_shutdown (EXIT_SUCCESS);
}
else if ((strncasecmp (argv[i], "irc://", 6) == 0))
else if ((strncasecmp (argv[i], "irc", 3) == 0))
{
if (server_init_with_url (argv[i], &server_tmp) < 0)
{
@@ -369,9 +377,10 @@ wee_parse_args (int argc, char *argv[])
server_tmp.autoreconnect,
server_tmp.autoreconnect_delay,
1, server_tmp.address, server_tmp.port,
server_tmp.ipv6, server_tmp.ssl,
server_tmp.password, server_tmp.nick1,
server_tmp.nick2, server_tmp.nick3,
NULL, NULL, NULL, 0, server_tmp.autojoin, 1))
NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL))
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
WEECHAT_WARNING, argv[i]);
server_destroy (&server_tmp);
@@ -516,6 +525,13 @@ wee_init_vars ()
/* init received messages queue */
recv_msgq = NULL;
msgq_last_msg = NULL;
/* init gnutls */
#ifdef HAVE_GNUTLS
gnutls_global_init ();
gnutls_certificate_allocate_credentials (&gnutls_xcred);
gnutls_certificate_set_x509_trust_file (gnutls_xcred, "ca.pem", GNUTLS_X509_FMT_PEM);
#endif
}
/*
@@ -609,6 +625,12 @@ wee_shutdown (int return_code)
if (local_charset)
free (local_charset);
alias_free_all ();
#ifdef HAVE_GNUTLS
gnutls_certificate_free_credentials (gnutls_xcred);
gnutls_global_deinit();
#endif
exit (return_code);
}
+9 -1
View File
@@ -28,6 +28,10 @@
#include <stdio.h>
#include <sys/time.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#if defined(ENABLE_NLS) && !defined(_)
#include <locale.h>
#ifdef HAVE_LIBINTL_H
@@ -82,7 +86,7 @@
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
"Usage: %s [options ...]\n" \
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
" or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]\n\n"
#define WEE_USAGE2 \
" -c, --config display config file options\n" \
@@ -108,6 +112,10 @@ extern int quit_weechat;
extern char *weechat_home;
extern char *local_charset;
#ifdef HAVE_GNUTLS
extern gnutls_certificate_credentials gnutls_xcred;
#endif
extern void wee_log_printf (char *, ...);
extern void wee_dump (int);
extern char *weechat_convert_encoding (char *, char *, char *);
+137 -16
View File
@@ -514,7 +514,7 @@ t_config_option weechat_options_irc[] =
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
{ "irc_default_msg_quit", N_("default quit message"),
N_("default quit message ('%v' will be replaced by WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -597,8 +597,13 @@ t_config_option weechat_options_dcc[] =
/* config, proxy section */
int cfg_proxy_use;
int cfg_proxy_type;
int cfg_proxy_ipv6;
char *cfg_proxy_type_values[] =
{ "http", "socks4", "socks5", NULL };
char *cfg_proxy_address;
int cfg_proxy_port;
char *cfg_proxy_username;
char *cfg_proxy_password;
t_config_option weechat_options_proxy[] =
@@ -606,14 +611,26 @@ t_config_option weechat_options_proxy[] =
N_("use a proxy server to connect to irc server"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_proxy_use, NULL, config_change_noop },
{ "proxy_type", N_("proxy type"),
N_("proxy type (http (default), socks4, socks5)"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"http", cfg_proxy_type_values, &cfg_proxy_type, NULL, config_change_noop },
{ "proxy_ipv6", N_("use ipv6 proxy"),
N_("connect to proxy in ipv6"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_proxy_ipv6, NULL, config_change_noop },
{ "proxy_address", N_("proxy address"),
N_("proxy server address (IP or hostname)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_address, config_change_noop },
{ "proxy_port", N_("port for proxy"),
N_("port for connecting to proxy server"),
OPTION_TYPE_INT, 0, 65535, 1080,
OPTION_TYPE_INT, 0, 65535, 3128,
NULL, NULL, &cfg_proxy_port, NULL, config_change_noop },
{ "proxy_username", N_("proxy username"),
N_("username for proxy server"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_username, config_change_noop },
{ "proxy_password", N_("proxy password"),
N_("password for proxy server"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -650,6 +667,14 @@ t_config_option weechat_options_server[] =
N_("port for connecting to server"),
OPTION_TYPE_INT, 0, 65535, 6667,
NULL, NULL, &(cfg_server.port), NULL, NULL },
{ "server_ipv6", N_("use IPv6 protocol for server communication"),
N_("use IPv6 protocol for server communication"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &(cfg_server.ipv6), NULL, NULL },
{ "server_ssl", N_("use SSL for server communication"),
N_("use SSL for server communication"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &(cfg_server.ssl), NULL, NULL },
{ "server_password", N_("server password"),
N_("password for IRC server"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -690,6 +715,10 @@ t_config_option weechat_options_server[] =
N_("automatically rejoin channels when kicked"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &(cfg_server.autorejoin), NULL, NULL },
{ "server_notify_levels", N_("notify levels for channels of this server"),
N_("comma separated list of notify levels for channels of this server (format: #channel:1,..)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.notify_levels), config_change_notify_levels },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -834,6 +863,23 @@ config_change_fifo_pipe ()
}
}
/*
* config_change_notify_levels: called when notify levels is changed for a server
*/
void
config_change_notify_levels ()
{
t_gui_buffer *ptr_buffer;
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (BUFFER_IS_CHANNEL(ptr_buffer) || BUFFER_IS_PRIVATE(ptr_buffer))
ptr_buffer->notify_level =
channel_get_notify_level (SERVER(ptr_buffer), CHANNEL(ptr_buffer));
}
}
/*
* config_option_set_value: set new value for an option
* return: 0 if success
@@ -899,6 +945,10 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
return (void *)(&server->address);
if (strcasecmp (option_name, "server_port") == 0)
return (void *)(&server->port);
if (strcasecmp (option_name, "server_ipv6") == 0)
return (void *)(&server->ipv6);
if (strcasecmp (option_name, "server_ssl") == 0)
return (void *)(&server->ssl);
if (strcasecmp (option_name, "server_password") == 0)
return (void *)(&server->password);
if (strcasecmp (option_name, "server_nick1") == 0)
@@ -919,6 +969,8 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
return (void *)(&server->autojoin);
if (strcasecmp (option_name, "server_autorejoin") == 0)
return (void *)(&server->autorejoin);
if (strcasecmp (option_name, "server_notify_levels") == 0)
return (void *)(&server->notify_levels);
/* option not found */
return NULL;
}
@@ -988,6 +1040,8 @@ config_set_server_value (t_irc_server *server, char *option_name,
*((char **)ptr_data) = strdup (value);
break;
}
if (ptr_option->handler_change != NULL)
(void) (ptr_option->handler_change());
return 0;
}
@@ -1017,6 +1071,72 @@ config_option_search (char *option_name)
return NULL;
}
/*
* config_option_search_option_value: look for type and value of an option
* (including server options)
* if option is not found, NULL is returned
*/
void
config_option_search_option_value (char *option_name, t_config_option **option,
void **option_value)
{
t_config_option *ptr_option;
t_irc_server *ptr_server;
int i;
void *ptr_value;
char *pos;
ptr_option = NULL;
ptr_value = NULL;
ptr_option = config_option_search (option_name);
if (!ptr_option)
{
pos = strchr (option_name, '.');
if (pos)
{
pos[0] = '\0';
ptr_server = server_search (option_name);
if (ptr_server)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
if (strcmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name,
pos + 1) == 0)
{
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
ptr_value = config_get_server_option_ptr (ptr_server, pos + 1);
break;
}
}
}
pos[0] = '.';
}
}
else
{
switch (ptr_option->option_type)
{
case OPTION_TYPE_BOOLEAN:
case OPTION_TYPE_INT:
case OPTION_TYPE_INT_WITH_STRING:
case OPTION_TYPE_COLOR:
ptr_value = (void *)(ptr_option->ptr_int);
break;
case OPTION_TYPE_STRING:
ptr_value = (void *)(ptr_option->ptr_string);
break;
}
}
if (ptr_option)
{
*option = ptr_option;
*option_value = ptr_value;
}
}
/*
* config_set_value: set new value for an option (found by name)
* return: 0 if success
@@ -1068,12 +1188,13 @@ config_allocate_server (char *filename, int line_number)
return 0;
}
if (!server_new (cfg_server.name,
cfg_server.autoconnect, cfg_server.autoreconnect,
cfg_server.autoreconnect_delay, 0, cfg_server.address, cfg_server.port,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin))
cfg_server.autoconnect, cfg_server.autoreconnect,
cfg_server.autoreconnect_delay, 0, cfg_server.address,
cfg_server.port, cfg_server.ipv6, cfg_server.ssl,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin, cfg_server.notify_levels))
{
server_free_all ();
gui_printf (NULL,
@@ -1402,10 +1523,6 @@ config_create_default ()
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
{
switch (weechat_options[i][j].option_type)
@@ -1471,6 +1588,8 @@ config_create_default ()
fprintf (file, "server_autoreconnect_delay=30\n");
fprintf (file, "server_address=irc.freenode.net\n");
fprintf (file, "server_port=6667\n");
fprintf (file, "server_ipv6=off\n");
fprintf (file, "server_ssl=off\n");
fprintf (file, "server_password=\n");
/* Get the user's name from /etc/passwd */
@@ -1574,10 +1693,6 @@ config_write (char *config_name)
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
{
switch (weechat_options[i][j].option_type)
@@ -1647,6 +1762,10 @@ config_write (char *config_name)
ptr_server->autoreconnect_delay);
fprintf (file, "server_address=%s\n", ptr_server->address);
fprintf (file, "server_port=%d\n", ptr_server->port);
fprintf (file, "server_ipv6=%s\n",
(ptr_server->ipv6) ? "on" : "off");
fprintf (file, "server_ssl=%s\n",
(ptr_server->ssl) ? "on" : "off");
fprintf (file, "server_password=%s\n",
(ptr_server->password) ? ptr_server->password : "");
fprintf (file, "server_nick1=%s\n", ptr_server->nick1);
@@ -1661,6 +1780,8 @@ config_write (char *config_name)
(ptr_server->autojoin) ? ptr_server->autojoin : "");
fprintf (file, "server_autorejoin=%s\n",
(ptr_server->autorejoin) ? "on" : "off");
fprintf (file, "server_notify_levels=%s\n",
(ptr_server->notify_levels) ? ptr_server->notify_levels : "");
}
}
+6
View File
@@ -178,8 +178,12 @@ extern int cfg_dcc_auto_rename;
extern int cfg_dcc_auto_resume;
extern int cfg_proxy_use;
extern int cfg_proxy_type;
extern char *cfg_proxy_type_values[];
extern int cfg_proxy_ipv6;
extern char *cfg_proxy_address;
extern int cfg_proxy_port;
extern char *cfg_proxy_username;
extern char *cfg_proxy_password;
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
@@ -193,8 +197,10 @@ extern void config_change_buffer_content ();
extern void config_change_color ();
extern void config_change_away_check ();
extern void config_change_fifo_pipe ();
extern void config_change_notify_levels ();
extern int config_option_set_value (t_config_option *, char *);
extern t_config_option *config_option_search (char *);
extern void config_option_search_option_value (char *, t_config_option **, void **);
extern int config_set_value (char *, char *);
extern void *config_get_server_option_ptr (t_irc_server *, char *);
extern int config_set_server_value (t_irc_server *, char *, char *);
+2 -1
View File
@@ -23,7 +23,8 @@ weechat_curses_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(NCURSES_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS) \
$(GNUTLS_LIBS)
weechat_curses_SOURCES = gui-display.c \
gui-input.c
+48 -48
View File
@@ -1328,7 +1328,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
mvwprintw (ptr_win->win_status, 0, x, "%s", string);
else
{
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", strlen (string));
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", (int)(strlen (string)));
mvwprintw (ptr_win->win_status, 0, x, format_more, " ");
}
if (gui_buffer_has_nicklist (ptr_win->buffer))
@@ -2271,93 +2271,93 @@ gui_init_colors ()
use_default_colors ();
init_pair (COLOR_WIN_TITLE,
cfg_col_title & A_CHARTEXT, cfg_col_title_bg);
cfg_col_title, cfg_col_title_bg);
init_pair (COLOR_WIN_CHAT,
cfg_col_chat & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_TIME,
cfg_col_chat_time & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_time, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_TIME_SEP,
cfg_col_chat_time_sep & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_time_sep, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX1,
cfg_col_chat_prefix1 & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_prefix1, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX2,
cfg_col_chat_prefix2 & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_prefix2, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_NICK,
cfg_col_chat_nick & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_nick, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HOST,
cfg_col_chat_host & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_host, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_CHANNEL,
cfg_col_chat_channel & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_channel, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_DARK,
cfg_col_chat_dark & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_dark, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HIGHLIGHT,
cfg_col_chat_highlight & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_highlight, cfg_col_chat_bg);
init_pair (COLOR_WIN_STATUS,
cfg_col_status & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DELIMITERS,
cfg_col_status_delimiters & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_delimiters, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_MSG,
cfg_col_status_data_msg & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_msg, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_HIGHLIGHT,
cfg_col_status_data_highlight & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_highlight, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_OTHER,
cfg_col_status_data_other & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_other, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_MORE,
cfg_col_status_more & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_more, cfg_col_status_bg);
init_pair (COLOR_WIN_INFOBAR,
cfg_col_infobar & A_CHARTEXT, cfg_col_infobar_bg);
cfg_col_infobar, cfg_col_infobar_bg);
init_pair (COLOR_WIN_INFOBAR_HIGHLIGHT,
cfg_col_infobar_highlight & A_CHARTEXT, cfg_col_infobar_bg);
cfg_col_infobar_highlight, cfg_col_infobar_bg);
init_pair (COLOR_WIN_INPUT,
cfg_col_input & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input, cfg_col_input_bg);
init_pair (COLOR_WIN_INPUT_CHANNEL,
cfg_col_input_channel & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input_channel, cfg_col_input_bg);
init_pair (COLOR_WIN_INPUT_NICK,
cfg_col_input_nick & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input_nick, cfg_col_input_bg);
init_pair (COLOR_WIN_NICK,
cfg_col_nick & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_AWAY,
cfg_col_nick_away & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_away, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_CHANOWNER,
cfg_col_nick_chanowner & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_chanowner, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_CHANADMIN,
cfg_col_nick_chanadmin & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_chanadmin, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_OP,
cfg_col_nick_op & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_op, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_HALFOP,
cfg_col_nick_halfop & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_halfop, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_VOICE,
cfg_col_nick_voice & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_voice, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_MORE,
cfg_col_nick_more & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_more, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SEP,
cfg_col_nick_sep & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_sep, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SELF,
cfg_col_nick_self & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_self, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_PRIVATE,
cfg_col_nick_private & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_private, cfg_col_nick_bg);
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
{
gui_assign_color (&color, nicks_colors[i]);
init_pair (COLOR_WIN_NICK_FIRST + i, color & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_WIN_NICK_FIRST + i, color, cfg_col_chat_bg);
color_attr[COLOR_WIN_NICK_FIRST + i - 1] = (color >= 0) ? color & A_BOLD : 0;
}
init_pair (COLOR_DCC_SELECTED,
cfg_col_dcc_selected & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_selected, cfg_col_chat_bg);
init_pair (COLOR_DCC_WAITING,
cfg_col_dcc_waiting & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_waiting, cfg_col_chat_bg);
init_pair (COLOR_DCC_CONNECTING,
cfg_col_dcc_connecting & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_connecting, cfg_col_chat_bg);
init_pair (COLOR_DCC_ACTIVE,
cfg_col_dcc_active & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_active, cfg_col_chat_bg);
init_pair (COLOR_DCC_DONE,
cfg_col_dcc_done & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_done, cfg_col_chat_bg);
init_pair (COLOR_DCC_FAILED,
cfg_col_dcc_failed & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_failed, cfg_col_chat_bg);
init_pair (COLOR_DCC_ABORTED,
cfg_col_dcc_aborted & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_aborted, cfg_col_chat_bg);
color_attr[COLOR_WIN_TITLE - 1] = (cfg_col_title >= 0) ? cfg_col_title & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT - 1] = (cfg_col_chat >= 0) ? cfg_col_chat & A_BOLD : 0;
@@ -2600,14 +2600,14 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
wee_log_printf ("gui_printf without buffer! this is a bug, please send to developers - thanks\n");
return;
}
if (buffer->dcc)
buffer = gui_buffers;
if (buffer->dcc)
return;
}
if (buffer->dcc)
buffer = gui_buffers;
if (buffer->dcc)
return;
va_start (argptr, message);
vsnprintf (buf, sizeof (buf) - 1, message, argptr);
va_end (argptr);
+26 -20
View File
@@ -519,33 +519,39 @@ gui_read_keyb ()
/* Alt-S: jump to server buffer */
case 's':
case 'S':
if (SERVER(gui_current_window->buffer)->buffer !=
gui_current_window->buffer)
if (!gui_current_window->buffer->dcc)
{
gui_switch_to_buffer (gui_current_window,
SERVER(gui_current_window->buffer)->buffer);
gui_redraw_buffer (gui_current_window->buffer);
if (SERVER(gui_current_window->buffer)->buffer !=
gui_current_window->buffer)
{
gui_switch_to_buffer (gui_current_window,
SERVER(gui_current_window->buffer)->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
break;
/* Alt-X: jump to first channel/private of next server */
case 'x':
case 'X':
ptr_server = SERVER(gui_current_window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
while (ptr_server != SERVER(gui_current_window->buffer))
if (!gui_current_window->buffer->dcc)
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
if (ptr_server != SERVER(gui_current_window->buffer))
{
ptr_buffer = (ptr_server->channels) ?
ptr_server->channels->buffer : ptr_server->buffer;
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (gui_current_window->buffer);
ptr_server = SERVER(gui_current_window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
while (ptr_server != SERVER(gui_current_window->buffer))
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
if (ptr_server != SERVER(gui_current_window->buffer))
{
ptr_buffer = (ptr_server->channels) ?
ptr_server->channels->buffer : ptr_server->buffer;
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
break;
}
+1 -1
View File
@@ -186,7 +186,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
new_buffer->line_complete = 1;
/* notify level */
new_buffer->notify_level = 3;
new_buffer->notify_level = channel_get_notify_level (server, channel);
/* create/append to log file */
new_buffer->log_filename = NULL;
+4
View File
@@ -98,6 +98,10 @@
#define gui_printf_nolog(buffer, fmt, argz...) \
gui_printf_type_color(buffer, MSG_TYPE_INFO | MSG_TYPE_NOLOG, -1, fmt, ##argz)
#define NOTIFY_LEVEL_MIN 0
#define NOTIFY_LEVEL_MAX 3
#define NOTIFY_LEVEL_DEFAULT NOTIFY_LEVEL_MAX
typedef struct t_gui_message t_gui_message;
struct t_gui_message
+131
View File
@@ -30,6 +30,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../gui/gui.h"
char *channel_modes = "iklmnst";
@@ -262,6 +263,136 @@ channel_remove_dcc (t_irc_dcc *ptr_dcc)
}
}
/*
* channel_get_notify_level: get channel notify level
*/
int
channel_get_notify_level (t_irc_server *server, t_irc_channel *channel)
{
char *name, *pos, *pos2, notify;
if ((!server) || (!channel))
return NOTIFY_LEVEL_DEFAULT;
if ((!server->notify_levels) || (!server->notify_levels[0]))
return NOTIFY_LEVEL_DEFAULT;
name = (char *) malloc (strlen (channel->name) + 2);
strcpy (name, channel->name);
strcat (name, ":");
pos = strstr (server->notify_levels, name);
free (name);
if (!pos)
return NOTIFY_LEVEL_DEFAULT;
pos2 = pos + strlen (channel->name);
if (pos2[0] != ':')
return NOTIFY_LEVEL_DEFAULT;
pos2++;
if (!pos2[0])
return NOTIFY_LEVEL_DEFAULT;
notify = (int)(pos2[0] - '0');
if ((notify < NOTIFY_LEVEL_MIN) || (notify > NOTIFY_LEVEL_MAX))
return NOTIFY_LEVEL_DEFAULT;
else
return notify;
}
/*
* server_remove_notify_level: remove channel notify from list
*/
void
channel_remove_notify_level (t_irc_server *server, t_irc_channel *channel)
{
char *name, *pos, *pos2;
if ((!server) || (!channel))
return;
name = (char *) malloc (strlen (channel->name) + 2);
strcpy (name, channel->name);
strcat (name, ":");
pos = strstr (server->notify_levels, name);
free (name);
if (pos)
{
pos2 = pos + strlen (channel->name);
if (pos2[0] == ':')
{
pos2++;
if (pos2[0])
{
pos2++;
if (pos2[0] == ',')
pos2++;
if (!pos2[0] && (pos != server->notify_levels))
pos--;
strcpy (pos, pos2);
server->notify_levels = (char *) realloc (server->notify_levels,
strlen (server->notify_levels) + 1);
}
}
}
}
/*
* server_set_notify_level: set channel notify level
*/
void
channel_set_notify_level (t_irc_server *server, t_irc_channel *channel, int notify)
{
char *name, *pos, *pos2, level_string[2];
if ((!server) || (!channel))
return;
if (notify == NOTIFY_LEVEL_DEFAULT)
{
channel_remove_notify_level (server, channel);
return;
}
if (!server->notify_levels)
{
server->notify_levels = (char *) malloc (strlen (channel->name) + 3);
server->notify_levels[0] = '\0';
}
else
{
name = (char *) malloc (strlen (channel->name) + 2);
strcpy (name, channel->name);
strcat (name, ":");
pos = strstr (server->notify_levels, name);
free (name);
if (pos)
{
pos2 = pos + strlen (channel->name) + 1;
if (pos2[0])
{
pos2[0] = '0' + notify;
return;
}
}
/* realloc notify list to add channel */
server->notify_levels = (char *) realloc (server->notify_levels,
strlen (server->notify_levels) + 1 +
strlen (channel->name) + 2 + 1);
}
/* channel not in notify list => add it */
if (server->notify_levels[0])
strcat (server->notify_levels, ",");
strcat (server->notify_levels, channel->name);
strcat (server->notify_levels, ":");
level_string[0] = notify + '0';
level_string[1] = '\0';
strcat (server->notify_levels, level_string);
}
/*
* channel_print_log: print channel infos in log (usually for crash dump)
*/
+1 -1
View File
@@ -97,7 +97,7 @@ t_irc_command irc_commands[] =
{ "kill", N_("close client-server connection"),
N_("nickname comment"),
N_("nickname: nickname\ncomment: comment for kill"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, NULL },
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
{ "links", N_("list all servernames which are known by the server answering the query"),
N_("[[server] server_mask]"),
N_("server: this server should answer the query\n"
+20 -8
View File
@@ -66,13 +66,14 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
*/
void
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
int display_around, int color_nick, int no_nickmode)
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
int message_type, int display_around, int color_nick, int no_nickmode)
{
if (display_around)
gui_printf_type_color (buffer,
message_type, COLOR_WIN_CHAT_DARK, "<");
if (cfg_look_nickmode)
message_type, COLOR_WIN_CHAT_DARK,
(nick) ? "<" : ">");
if (nick && cfg_look_nickmode)
{
if (nick->is_chanowner)
gui_printf_type_color (buffer,
@@ -104,19 +105,20 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_CHAT_HIGHLIGHT,
"%s", nick->nick);
"%s", (nick) ? nick->nick : nickname);
else
gui_printf_type_color (buffer,
message_type,
(color_nick) ?
(nick && color_nick) ?
((cfg_look_color_nicks) ?
nick->color : COLOR_WIN_CHAT) :
COLOR_WIN_CHAT,
"%s", nick->nick);
"%s", (nick) ? nick->nick : nickname);
if (display_around)
gui_printf_type_color (buffer,
message_type, COLOR_WIN_CHAT_DARK, "> ");
message_type, COLOR_WIN_CHAT_DARK,
(nick) ? "> " : "< ");
}
/*
@@ -175,6 +177,12 @@ irc_display_server (t_irc_server *server)
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_port . . . . . . .: %d\n",
server->port);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_ipv6 . . . . . . .: %s\n",
(server->ipv6) ? _("yes") : _("no"));
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_ssl . . . . . . . .: %s\n",
(server->ssl) ? _("yes") : _("no"));
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_password . . . . .: %s\n",
(server->password && server->password[0]) ?
@@ -202,4 +210,8 @@ irc_display_server (t_irc_server *server)
" server_autojoin . . . . .: %s\n",
(server->autojoin && server->autojoin[0]) ?
server->autojoin : "");
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_notify_levels . . .: %s\n",
(server->notify_levels && server->notify_levels[0]) ?
server->notify_levels : "");
}
+90 -29
View File
@@ -345,6 +345,76 @@ irc_cmd_recv_kick (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_kill: 'kill' message received
*/
int
irc_cmd_recv_kill (t_irc_server *server, char *host, char *arguments)
{
char *pos, *pos_host2, *pos_comment;
t_irc_channel *ptr_channel;
pos = strchr (host, '!');
if (pos)
pos[0] = '\0';
pos_host2 = strchr (arguments, ' ');
if (pos_host2)
{
pos_host2[0] = '\0';
pos_host2++;
while (pos_host2[0] == ' ')
pos_host2++;
pos_comment = strchr (pos_host2, ' ');
if (pos_comment)
{
pos_comment[0] = '\0';
pos_comment++;
while (pos_comment[0] == ' ')
pos_comment++;
if (pos_comment[0] == ':')
pos_comment++;
}
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
irc_display_prefix (ptr_channel->buffer, PREFIX_PART);
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK,
"%s", host);
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
_(" has killed "));
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK,
"%s", arguments);
if (pos_comment)
{
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
_(" from server"));
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK,
" (");
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
"%s", pos_comment);
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK,
")\n");
}
else
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
_(" from server\n"));
}
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s host \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, "", "kill");
return -1;
}
return 0;
}
/*
* irc_get_channel_modes: get channel modes
*/
@@ -1176,37 +1246,28 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
else
{
ptr_nick = nick_search (ptr_channel, host);
if (ptr_nick)
if (strstr (pos, server->nick))
{
if (strstr (pos, server->nick))
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
1, -1, 0);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("On %s: %s> %s"),
ptr_channel->name,
host, pos);
}
else
irc_display_nick (ptr_channel->buffer, ptr_nick,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
COLOR_WIN_CHAT, "%s\n", pos);
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : host,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
1, -1, 0);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("On %s: %s> %s"),
ptr_channel->name,
host, pos);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s nick \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, host, "privmsg");
return -1;
}
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : host,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
COLOR_WIN_CHAT, "%s\n", pos);
}
}
else
@@ -3266,7 +3327,7 @@ irc_cmd_recv_366 (t_irc_server *server, char *host, char *arguments)
for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_MSG, 0, 0, 1);
if (ptr_nick != ptr_channel->last_nick)
gui_printf (ptr_channel->buffer, " ");
+28 -16
View File
@@ -120,9 +120,9 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
{
snprintf (buffer, sizeof (buffer),
"is back (gone %.2ld:%.2ld:%.2ld)",
elapsed / 3600,
(elapsed / 60) % 60,
elapsed % 60);
(long int)(elapsed / 3600),
(long int)((elapsed / 60) % 60),
(long int)(elapsed % 60));
irc_send_me_all_channels (ptr_server, buffer);
}
}
@@ -160,9 +160,9 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
{
snprintf (buffer, sizeof (buffer),
"is back (gone %.2ld:%.2ld:%.2ld)",
elapsed / 3600,
(elapsed / 60) % 60,
elapsed % 60);
(long int)(elapsed / 3600),
(long int)((elapsed / 60) % 60),
(long int)(elapsed % 60));
irc_send_me_all_channels (server, buffer);
}
}
@@ -876,7 +876,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
ptr_nick = nick_search (ptr_channel, server->nick);
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
@@ -901,7 +901,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
ptr_nick = nick_search (ptr_channel, server->nick);
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
@@ -1138,7 +1138,7 @@ irc_cmd_send_oper (t_irc_server *server, char *arguments)
int
irc_cmd_send_part (t_irc_server *server, char *arguments)
{
char *channel_name, *pos_args;
char *channel_name, *pos_args, *ptr_arg, *pos, buffer[4096];
t_irc_channel *ptr_channel;
if (arguments)
@@ -1192,16 +1192,28 @@ irc_cmd_send_part (t_irc_server *server, char *arguments)
pos_args = NULL;
}
if (pos_args)
server_sendf (server, "PART %s :%s\r\n", channel_name, pos_args);
else
ptr_arg = (pos_args) ? pos_args :
(cfg_irc_default_msg_part && cfg_irc_default_msg_part[0]) ?
cfg_irc_default_msg_part : NULL;
if (ptr_arg)
{
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
server_sendf (server, "PART %s :%s\r\n",
channel_name, cfg_irc_default_msg_part);
pos = strstr (ptr_arg, "%v");
if (pos)
{
pos[0] = '\0';
snprintf (buffer, sizeof (buffer), "%s%s%s",
ptr_arg, PACKAGE_VERSION, pos + 2);
pos[0] = '%';
}
else
server_sendf (server, "PART %s\r\n", channel_name);
snprintf (buffer, sizeof (buffer), "%s",
ptr_arg);
server_sendf (server, "PART %s :%s\r\n",
channel_name, buffer);
}
else
server_sendf (server, "PART %s\r\n", channel_name);
return 0;
}
+636 -65
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-server.c: (dis)connection and communication with irc server */
/* irc-server.c: connection and communication with IRC server */
#ifdef HAVE_CONFIG_H
@@ -39,6 +39,10 @@
#include <arpa/inet.h>
#include <netdb.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include "../common/weechat.h"
#include "irc.h"
#include "../common/weeconfig.h"
@@ -67,6 +71,8 @@ server_init (t_irc_server *server)
server->command_line = 0;
server->address = NULL;
server->port = -1;
server->ipv6 = 0;
server->ssl = 0;
server->password = NULL;
server->nick1 = NULL;
server->nick2 = NULL;
@@ -77,6 +83,7 @@ server_init (t_irc_server *server)
server->command_delay = 1;
server->autojoin = NULL;
server->autorejoin = 0;
server->notify_levels = NULL;
/* internal vars */
server->child_pid = 0;
@@ -84,6 +91,9 @@ server_init (t_irc_server *server)
server->child_write = -1;
server->sock = -1;
server->is_connected = 0;
#ifdef HAVE_GNUTLS
server->ssl_connected = 0;
#endif
server->unterminated_message = NULL;
server->nick = NULL;
server->reconnect_start = 0;
@@ -110,18 +120,42 @@ int
server_init_with_url (char *irc_url, t_irc_server *server)
{
char *url, *pos_server, *pos_channel, *pos, *pos2;
int ipv6, ssl;
struct passwd *my_passwd;
server_init (server);
if (strncasecmp (irc_url, "irc://", 6) != 0)
ipv6 = 0;
ssl = 0;
if (strncasecmp (irc_url, "irc6://", 7) == 0)
{
pos = irc_url + 7;
ipv6 = 1;
}
else if (strncasecmp (irc_url, "ircs://", 7) == 0)
{
pos = irc_url + 7;
ssl = 1;
}
else if ((strncasecmp (irc_url, "irc6s://", 8) == 0)
|| (strncasecmp (irc_url, "ircs6://", 8) == 0))
{
pos = irc_url + 8;
ipv6 = 1;
ssl = 1;
}
else if (strncasecmp (irc_url, "irc://", 6) == 0)
{
pos = irc_url + 6;
}
else
return -1;
url = strdup (irc_url);
pos_server = strchr (url, '@');
if (pos_server)
{
pos_server[0] = '\0';
pos_server++;
pos = url + 6;
if (!pos[0])
{
free (url);
@@ -183,6 +217,9 @@ server_init_with_url (char *irc_url, t_irc_server *server)
free (url);
server->ipv6 = ipv6;
server->ssl = ssl;
/* some default values */
if (server->port < 0)
server->port = DEFAULT_IRC_PORT;
@@ -256,6 +293,10 @@ server_destroy (t_irc_server *server)
free (server->command);
if (server->autojoin)
free (server->autojoin);
if (server->notify_levels)
free (server->notify_levels);
if (server->unterminated_message)
free (server->unterminated_message);
if (server->nick)
free (server->nick);
if (server->channels)
@@ -312,26 +353,26 @@ server_free_all ()
t_irc_server *
server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_delay,
int command_line, char *address, int port, char *password,
int command_line, char *address, int port, int ipv6, int ssl, char *password,
char *nick1, char *nick2, char *nick3, char *username,
char *realname, char *command, int command_delay, char *autojoin,
int autorejoin)
int autorejoin, char *notify_levels)
{
t_irc_server *new_server;
if (!name || !address || (port < 0))
return NULL;
#ifdef DEBUG
#ifdef DEBUG
wee_log_printf ("Creating new server (name:%s, address:%s, port:%d, pwd:%s, "
"nick1:%s, nick2:%s, nick3:%s, username:%s, realname:%s, "
"command:%s, autojoin:%s, autorejoin:%s)\n",
"command:%s, autojoin:%s, autorejoin:%s, notify_levels:%s)\n",
name, address, port, (password) ? password : "",
(nick1) ? nick1 : "", (nick2) ? nick2 : "", (nick3) ? nick3 : "",
(username) ? username : "", (realname) ? realname : "",
(command) ? command : "", (autojoin) ? autojoin : "",
(autorejoin) ? "on" : "off");
#endif
(autorejoin) ? "on" : "off", (notify_levels) ? notify_levels : "");
#endif
if ((new_server = server_alloc ()))
{
@@ -342,6 +383,8 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
new_server->command_line = command_line;
new_server->address = strdup (address);
new_server->port = port;
new_server->ipv6 = ipv6;
new_server->ssl = ssl;
new_server->password = (password) ? strdup (password) : strdup ("");
new_server->nick1 = (nick1) ? strdup (nick1) : strdup ("weechat_user");
new_server->nick2 = (nick2) ? strdup (nick2) : strdup ("weechat2");
@@ -357,6 +400,8 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
(autojoin) ? strdup (autojoin) : NULL;
new_server->autorejoin = autorejoin;
new_server->nick = strdup (new_server->nick1);
new_server->notify_levels =
(notify_levels) ? strdup (notify_levels) : NULL;
}
else
return NULL;
@@ -364,7 +409,7 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
}
/*
* server_send: send data to irc server
* server_send: send data to IRC server
*/
int
@@ -373,11 +418,16 @@ server_send (t_irc_server *server, char *buffer, int size_buf)
if (!server)
return -1;
return send (server->sock, buffer, size_buf, 0);
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
return gnutls_record_send (server->gnutls_sess, buffer, size_buf);
else
#endif
return send (server->sock, buffer, size_buf, 0);
}
/*
* server_sendf: send formatted data to irc server
* server_sendf: send formatted data to IRC server
*/
void
@@ -401,11 +451,11 @@ server_sendf (t_irc_server *server, char *fmt, ...)
buffer[sizeof (buffer) - 1] = '\0';
if ((size_buf < 0) || (size_buf > (int) (sizeof (buffer) - 1)))
size_buf = strlen (buffer);
#ifdef DEBUG
#ifdef DEBUG
buffer[size_buf - 2] = '\0';
gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer);
buffer[size_buf - 2] = '\r';
#endif
#endif
buf2 = weechat_convert_encoding ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
cfg_look_charset_encode,
@@ -551,9 +601,9 @@ server_msgq_flush ()
{
if (recv_msgq->data)
{
#ifdef DEBUG
#ifdef DEBUG
gui_printf (gui_current_window->buffer, "[DEBUG] %s\n", recv_msgq->data);
#endif
#endif
ptr_data = recv_msgq->data;
entire_line = strdup (ptr_data);
@@ -563,9 +613,9 @@ server_msgq_flush ()
if (ptr_data)
{
#ifdef DEBUG
#ifdef DEBUG
gui_printf (NULL, "[DEBUG] data received from server: %s\n", ptr_data);
#endif
#endif
host = NULL;
command = NULL;
@@ -644,7 +694,16 @@ server_recv (t_irc_server *server)
static char buffer[4096 + 2];
int num_read;
num_read = recv (server->sock, buffer, sizeof (buffer) - 2, 0);
if (!server)
return;
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
num_read = gnutls_record_recv (server->gnutls_sess, buffer, sizeof (buffer) - 2);
else
#endif
num_read = recv (server->sock, buffer, sizeof (buffer) - 2, 0);
if (num_read > 0)
{
buffer[num_read] = '\0';
@@ -701,8 +760,16 @@ server_close_connection (t_irc_server *server)
/* close network socket */
if (server->sock != -1)
{
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
gnutls_bye (server->gnutls_sess, GNUTLS_SHUT_RDWR);
#endif
close (server->sock);
server->sock = -1;
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
gnutls_deinit (server->gnutls_sess);
#endif
}
/* free any pending message */
@@ -714,6 +781,9 @@ server_close_connection (t_irc_server *server)
/* server is now disconnected */
server->is_connected = 0;
#ifdef HAVE_GNUTLS
server->ssl_connected = 0;
#endif
}
/*
@@ -751,31 +821,70 @@ server_child_read (t_irc_server *server)
{
/* connection OK */
case '0':
/* enable SSL if asked */
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
{
gnutls_transport_set_ptr (server->gnutls_sess, (gnutls_transport_ptr) server->sock);
if (gnutls_handshake (server->gnutls_sess) < 0)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s gnutls handshake failed\n"),
WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
return;
}
}
#endif
/* kill child and login to server */
server_kill_child (server);
irc_login (server);
break;
/* adress not found */
case '1':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
else
gui_printf (server->buffer,
_("%s address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* IP address not found */
case '2':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s IP address not found\n"), WEECHAT_ERROR);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy IP address not found\n"), WEECHAT_ERROR);
else
gui_printf (server->buffer,
_("%s IP address not found\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* connection refused */
/* connection refused */
case '3':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s connection refused\n"), WEECHAT_ERROR);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy connection refused\n"), WEECHAT_ERROR);
else
gui_printf (server->buffer,
_("%s connection refused\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* proxy fails to connect to server */
case '4':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s proxy fails to establish connection to server (check username/password if used)\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
@@ -783,6 +892,359 @@ server_child_read (t_irc_server *server)
}
}
/*
* convbase64_8x3_to_6x4 : convert 3 bytes of 8 bits in 4 bytes of 6 bits
*/
void
convbase64_8x3_to_6x4(char *from, char* to)
{
unsigned char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
to[0] = base64_table [ (from[0] & 0xfc) >> 2 ];
to[1] = base64_table [ ((from[0] & 0x03) << 4) + ((from[1] & 0xf0) >> 4) ];
to[2] = base64_table [ ((from[1] & 0x0f) << 2) + ((from[2] & 0xc0) >> 6) ];
to[3] = base64_table [ from[2] & 0x3f ];
}
/*
* base64encode: encode a string in base64
*/
void
base64encode(char *from, char *to)
{
char *f, *t;
int from_len;
from_len = strlen(from);
f = from;
t = to;
while(from_len >= 3)
{
convbase64_8x3_to_6x4(f, t);
f += 3 * sizeof(*f);
t += 4 * sizeof(*t);
from_len -= 3;
}
if (from_len > 0)
{
char rest[3] = { 0, 0, 0 };
switch(from_len)
{
case 1 :
rest[0] = f[0];
convbase64_8x3_to_6x4(rest, t);
t[2] = t[3] = '=';
break;
case 2 :
rest[0] = f[0];
rest[1] = f[1];
convbase64_8x3_to_6x4(rest, t);
t[3] = '=';
break;
}
t[4] = 0;
}
}
/*
* pass_httpproxy: establish connection/authentification to an http proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_httpproxy(t_irc_server *server)
{
char buffer[256];
char authbuf[128]; // seems to be enougth to store username + password
char authbuf_base64[196]; // enougth to store base64 encoded authbuf
int n, m;
if (strlen(cfg_proxy_username) > 0)
{
// authentification
snprintf(authbuf, sizeof(authbuf), "%s:%s", cfg_proxy_username, cfg_proxy_password);
base64encode(authbuf, authbuf_base64);
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\nProxy-Authorization: Basic %s\r\n\r\n", server->address, server->port, authbuf_base64);
}
else
{
// no authentification
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\n\r\n", server->address, server->port);
}
m = send (server->sock, buffer, n, 0);
if (n != m)
return 1;
n = recv(server->sock, buffer, sizeof(buffer), 0);
/* success result must be like : "HTTP/1.0 200 OK" */
if (n < 12)
return 1;
if (memcmp (buffer, "HTTP/", 5) || memcmp (buffer + 9, "200", 3))
return 1;
return 0;
}
/*
* resolve: resolve hostname on its IP address
* (works with ipv4 and ipv6)
* return :
* - 0 if resolution was successful
* - 1 if resolution fails
*/
int
resolve (char *hostname, char *ip, int *version)
{
char ipbuffer[NI_MAXHOST];
struct addrinfo *res;
if (version != NULL)
*version = 0;
res = NULL;
if (getaddrinfo (hostname, NULL, NULL, &res) != 0)
return 1;
if (!res)
return 1;
if (getnameinfo (res->ai_addr, res->ai_addrlen, ipbuffer, sizeof(ipbuffer), NULL, 0, NI_NUMERICHOST) != 0)
{
freeaddrinfo (res);
return 1;
}
if ((res->ai_family == AF_INET) && (version != NULL))
*version = 4;
if ((res->ai_family == AF_INET6) && (version != NULL))
*version = 6;
strcpy (ip, ipbuffer);
freeaddrinfo (res);
return 0;
}
/*
* pass_socks4proxy: establish connection/authentification throw a socks4 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks4proxy(t_irc_server *server)
{
/*
* socks4 protocol is explain here:
* http://archive.socks.permeo.com/protocol/socks4.protocol
*
*/
struct s_socks4
{
char version; /* 1 byte */ /* socks version : 4 or 5 */
char method; /* 1 byte */ /* socks method : connect (1) or bind (2) */
unsigned short port; /* 2 bytes */ /* destination port */
unsigned long address; /* 4 bytes */ /* destination address */
char user[64]; /* username (64 characters seems to be enought) */
} socks4;
unsigned char buffer[24];
char ip_addr[NI_MAXHOST];
socks4.version = 4;
socks4.method = 1;
socks4.port = htons (server->port);
resolve(server->address, ip_addr, NULL);
socks4.address = inet_addr (ip_addr);
strncpy (socks4.user, server->username, sizeof(socks4.user) - 1);
send (server->sock, (char *) &socks4, 8 + strlen(socks4.user) + 1, 0);
recv (server->sock, buffer, sizeof(buffer), 0);
if (buffer[0] == 0 && buffer[1] == 90)
return 0;
return 1;
}
/*
* pass_socks5proxy: establish connection/authentification throw a socks5 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks5proxy(t_irc_server *server)
{
/*
* socks5 protocol is explained in RFC 1928
* socks5 authentication with username/pass is explained in RFC 1929
*/
struct s_sock5
{
char version; /* 1 byte */ /* socks version : 4 or 5 */
char nmethods; /* 1 byte */ /* size in byte(s) of field 'method', here 1 byte */
char method; /* 1-255 bytes */ /* socks method : noauth (0), auth(user/pass) (2), ... */
} socks5;
unsigned char buffer[288];
int username_len, password_len, addr_len, addr_buffer_len;
unsigned char *addr_buffer;
socks5.version = 5;
socks5.nmethods = 1;
if (strlen(cfg_proxy_username) > 0)
/* with authentication */
socks5.method = 2;
else
/* without authentication */
socks5.method = 0;
send (server->sock, (char *) &socks5, sizeof(socks5), 0);
/* server socks5 must respond with 2 bytes */
if (recv (server->sock, buffer, 2, 0) != 2)
return 1;
if (strlen(cfg_proxy_username) > 0)
{
/* with authentication */
/* -> socks server must respond with :
* - socks version (buffer[0]) = 5 => socks5
* - socks method (buffer[1]) = 2 => authentication
*/
//if (!(buffer[0] == 5 && buffer[1] == 2))
if (buffer[0] != 5 || buffer[1] != 2)
return 1;
/* authentication as in RFC 1929 */
username_len = strlen(cfg_proxy_username);
password_len = strlen(cfg_proxy_password);
/* make username/password buffer */
buffer[0] = 1;
buffer[1] = (unsigned char) username_len;
memcpy(buffer + 2, cfg_proxy_username, username_len);
buffer[2 + username_len] = (unsigned char) password_len;
memcpy(buffer + 3 + username_len, cfg_proxy_password, password_len);
send (server->sock, buffer, 3 + username_len + password_len, 0);
/* server socks5 must respond with 2 bytes */
if (recv (server->sock, buffer, 2, 0) != 2)
return 1;
/* buffer[1] = auth state, must be 0 for success */
if (buffer[1] != 0)
return 1;
}
else
{
/* without authentication */
/* -> socks server must respond with :
* - socks version (buffer[0]) = 5 => socks5
* - socks method (buffer[1]) = 0 => no authentication
*/
if (!(buffer[0] == 5 && buffer[1] == 0))
return 1;
}
/* authentication successful then giving address/port to connect */
addr_len = strlen(server->address);
addr_buffer_len = 4 + 1 + addr_len + 2;
addr_buffer = (unsigned char *) malloc ( addr_buffer_len * sizeof(*addr_buffer));
if (!addr_buffer)
return 1;
addr_buffer[0] = 5; /* version 5 */
addr_buffer[1] = 1; /* command: 1 for connect */
addr_buffer[2] = 0; /* reserved */
addr_buffer[3] = 3; /* address type : ipv4 (1), domainname (3), ipv6 (4) */
addr_buffer[4] = (unsigned char) addr_len;
memcpy (addr_buffer + 5, server->address, addr_len); /* server address */
*((unsigned short *) (addr_buffer + 5 + addr_len)) = htons (server->port); /* server port */
send (server->sock, addr_buffer, addr_buffer_len, 0);
free(addr_buffer);
/* dialog with proxy server */
if (recv (server->sock, buffer, 4, 0) != 4)
return 1;
if (!(buffer[0] == 5 && buffer[1] == 0))
return 1;
switch(buffer[3]) {
/* buffer[3] = address type */
case 1 :
/* ipv4
* server socks return server bound address and port
* address of 4 bytes and port of 2 bytes (= 6 bytes)
*/
if (recv (server->sock, buffer, 6, 0) != 6)
return 1;
break;
case 3:
/* domainname
* server socks return server bound address and port
*/
/* reading address length */
if (recv (server->sock, buffer, 1, 0) != 1)
return 1;
addr_len = buffer[0];
/* reading address + port = addr_len + 2 */
if (recv (server->sock, buffer, addr_len + 2, 0) != (addr_len + 2))
return 1;
break;
case 4 :
/* ipv6
* server socks return server bound address and port
* address of 16 bytes and port of 2 bytes (= 18 bytes)
*/
if (recv (server->sock, buffer, 18, 0) != 18)
return 1;
break;
default:
return 1;
}
return 0;
}
/*
* pass_proxy: establish connection/authentification to a proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_proxy(t_irc_server *server)
{
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "http") == 0)
return pass_httpproxy(server);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks4") == 0)
return pass_socks4proxy(server);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks5") == 0)
return pass_socks5proxy(server);
return 1;
}
/*
* server_child: child process trying to connect to server
*/
@@ -790,42 +1252,90 @@ server_child_read (t_irc_server *server)
int
server_child (t_irc_server *server)
{
struct hostent *ip4_hostent;
struct sockaddr_in addr;
char *ip_address;
int error;
struct addrinfo hints, *res;
/* bind to hostname */
ip4_hostent = gethostbyname (server->address);
if (!ip4_hostent)
res = NULL;
if (cfg_proxy_use)
{
write (server->child_write, "1", 1);
return 0;
memset (&hints, 0, sizeof (hints));
hints.ai_family = (cfg_proxy_ipv6) ? AF_INET6 : AF_INET;
hints.ai_socktype = SOCK_STREAM;
if (getaddrinfo (cfg_proxy_address, NULL, &hints, &res) !=0)
{
write(server->child_write, "1", 1);
return 0;
}
if (!res)
{
write(server->child_write, "1", 1);
return 0;
}
if ((cfg_proxy_ipv6 && (res->ai_family != AF_INET6))
|| ((!cfg_proxy_ipv6 && (res->ai_family != AF_INET))))
{
write (server->child_write, "2", 1);
freeaddrinfo (res);
return 0;
}
if (cfg_proxy_ipv6)
((struct sockaddr_in6 *)(res->ai_addr))->sin6_port = htons (cfg_proxy_port);
else
((struct sockaddr_in *)(res->ai_addr))->sin_port = htons (cfg_proxy_port);
if (connect (server->sock, res->ai_addr, res->ai_addrlen) != 0)
{
write(server->child_write, "3", 1);
freeaddrinfo (res);
return 0;
}
if (pass_proxy(server))
{
write(server->child_write, "4", 1);
freeaddrinfo (res);
return 0;
}
}
memset (&addr, 0, sizeof (addr));
memcpy (&addr.sin_addr, ip4_hostent->h_addr, ip4_hostent->h_length);
addr.sin_port = htons (server->port);
addr.sin_family = AF_INET;
/* find IP address */
ip_address = inet_ntoa (addr.sin_addr);
if (!ip_address)
else
{
write (server->child_write, "2", 1);
return 0;
memset (&hints, 0, sizeof(hints));
hints.ai_family = (server->ipv6) ? AF_INET6 : AF_INET;
hints.ai_socktype = SOCK_STREAM;
if (getaddrinfo (server->address, NULL, &hints, &res) !=0)
{
write(server->child_write, "1", 1);
return 0;
}
if (!res)
{
write(server->child_write, "1", 1);
return 0;
}
if ((server->ipv6 && (res->ai_family != AF_INET6))
|| ((!server->ipv6 && (res->ai_family != AF_INET))))
{
write(server->child_write, "2", 1);
freeaddrinfo (res);
return 0;
}
if (server->ipv6)
((struct sockaddr_in6 *)(res->ai_addr))->sin6_port = htons (server->port);
else
((struct sockaddr_in *)(res->ai_addr))->sin_port = htons (server->port);
if (connect (server->sock, res->ai_addr, res->ai_addrlen) != 0)
{
write(server->child_write, "3", 1);
freeaddrinfo (res);
return 0;
}
}
/* connect to server */
error = connect (server->sock, (struct sockaddr *) &addr, sizeof (addr));
if (error != 0)
{
write (server->child_write, "3", 1);
return 0;
}
/* connection OK */
write (server->child_write, "0", 1);
freeaddrinfo (res);
return 0;
}
@@ -838,17 +1348,72 @@ server_connect (t_irc_server *server)
{
int child_pipe[2], set;
pid_t pid;
#ifdef HAVE_GNUTLS
const int cert_type_prio[] = { GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 };
#endif
#ifndef HAVE_GNUTLS
if (server->ssl)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot connect with SSL since WeeChat was not built "
"with GNUtls support\n"), WEECHAT_ERROR);
return 0;
}
#endif
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer,
_("%s: connecting to %s:%d...\n"),
PACKAGE_NAME, server->address, server->port);
wee_log_printf (_("Connecting to server %s:%d...\n"),
server->address, server->port);
if (cfg_proxy_use)
{
gui_printf (server->buffer,
_("%s: connecting to server %s:%d%s%s via %s proxy %s:%d%s...\n"),
PACKAGE_NAME, server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "",
cfg_proxy_type_values[cfg_proxy_type], cfg_proxy_address, cfg_proxy_port,
(cfg_proxy_ipv6) ? " (IPv6)" : "");
wee_log_printf (_("Connecting to server %s:%d%s%s via %s proxy %s:%d%s...\n"),
server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "",
cfg_proxy_type_values[cfg_proxy_type], cfg_proxy_address, cfg_proxy_port,
(cfg_proxy_ipv6) ? " (IPv6)" : "");
}
else
{
gui_printf (server->buffer,
_("%s: connecting to server %s:%d%s%s...\n"),
PACKAGE_NAME, server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "");
wee_log_printf (_("Connecting to server %s:%d%s%s...\n"),
server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "");
}
/* close any opened connection and kill child process if running */
server_close_connection (server);
/* init SSL if asked */
#ifdef HAVE_GNUTLS
server->ssl_connected = 0;
if (server->ssl)
{
if (gnutls_init (&server->gnutls_sess, GNUTLS_CLIENT) != 0)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s gnutls init error\n"), WEECHAT_ERROR);
return 0;
}
gnutls_set_default_priority (server->gnutls_sess);
gnutls_certificate_type_set_priority (server->gnutls_sess, cert_type_prio);
gnutls_credentials_set (server->gnutls_sess, GNUTLS_CRD_CERTIFICATE, gnutls_xcred);
server->ssl_connected = 1;
}
#endif
/* create pipe for child process */
if (pipe (child_pipe) < 0)
{
@@ -861,13 +1426,12 @@ server_connect (t_irc_server *server)
server->child_write = child_pipe[1];
/* create socket and set options */
server->sock = socket (AF_INET, SOCK_STREAM, 0);
server->sock = socket ((server->ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
if (server->sock == -1)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot create socket\n"), WEECHAT_ERROR);
server_close_connection (server);
return 0;
}
@@ -947,7 +1511,8 @@ server_auto_connect (int command_line)
{
(void) gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1);
gui_redraw_buffer (gui_current_window->buffer);
server_connect (ptr_server);
if (!server_connect (ptr_server))
server_reconnect_schedule (ptr_server);
}
}
}
@@ -1143,6 +1708,8 @@ server_print_log (t_irc_server *server)
wee_log_printf (" command_line. . . . : %d\n", server->command_line);
wee_log_printf (" address . . . . . . : '%s'\n", server->address);
wee_log_printf (" port. . . . . . . . : %d\n", server->port);
wee_log_printf (" ipv6. . . . . . . . : %d\n", server->ipv6);
wee_log_printf (" ssl . . . . . . . . : %d\n", server->ssl);
wee_log_printf (" password. . . . . . : '%s'\n",
(server->password && server->password[0]) ? "(hidden)" : server->password);
wee_log_printf (" nick1 . . . . . . . : '%s'\n", server->nick1);
@@ -1155,11 +1722,15 @@ server_print_log (t_irc_server *server)
wee_log_printf (" command_delay . . . : %d\n", server->command_delay);
wee_log_printf (" autojoin. . . . . . : '%s'\n", server->autojoin);
wee_log_printf (" autorejoin. . . . . : %d\n", server->autorejoin);
wee_log_printf (" notify_levels . . . : %s\n", server->notify_levels);
wee_log_printf (" child_pid . . . . . : %d\n", server->child_pid);
wee_log_printf (" child_read . . . . : %d\n", server->child_read);
wee_log_printf (" child_write . . . . : %d\n", server->child_write);
wee_log_printf (" sock. . . . . . . . : %d\n", server->sock);
wee_log_printf (" is_connected. . . . : %d\n", server->is_connected);
#ifdef HAVE_GNUTLS
wee_log_printf(" ssl_connected . . . : %d\n", server->ssl_connected);
#endif
wee_log_printf (" unterminated_message: '%s'\n", server->unterminated_message);
wee_log_printf (" nick. . . . . . . . : '%s'\n", server->nick);
wee_log_printf (" reconnect_start . . : %ld\n", server->reconnect_start);
+36 -6
View File
@@ -21,9 +21,18 @@
#ifndef __WEECHAT_IRC_H
#define __WEECHAT_IRC_H 1
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include "../gui/gui.h"
/* prefixes for chat window */
@@ -137,23 +146,31 @@ struct t_irc_server
int command_line; /* server was given on command line */
char *address; /* address of server (IP or name) */
int port; /* port for server (6667 by default) */
int ipv6; /* use IPv6 protocol */
int ssl; /* SSL protocol */
char *password; /* password for server */
char *nick1; /* first nickname for the server */
char *nick2; /* alternate nickname */
char *nick3; /* 2nd alternate nickname */
char *username; /* user name */
char *realname; /* real name */
char *command; /* command to run once connected */
char *command; /* command to run once connected */
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
char *notify_levels; /* channels notify levels */
/* internal vars */
pid_t child_pid; /* pid of child process (connecting) */
int child_read; /* to read into child pipe */
int child_write; /* to write into child pipe */
int sock; /* socket for server */
int sock; /* socket for server (IPv4 or IPv6) */
int is_connected; /* 1 if WeeChat is connected to server */
#ifdef HAVE_GNUTLS
int ssl_connected; /* = 1 if connected with SSL */
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
#endif
char *unterminated_message; /* beginning of a message in input buf */
char *nick; /* current nickname */
time_t reconnect_start; /* this time + delay = reconnect time */
@@ -248,9 +265,9 @@ extern t_irc_server *server_alloc ();
extern void server_destroy (t_irc_server *);
extern void server_free (t_irc_server *);
extern void server_free_all ();
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, char *,
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, int, int,
char *, char *, char *, char *, char *, char *,
int, char *, int);
char *, int, char *, int, char *);
extern int server_send (t_irc_server *, char *, int);
extern void server_sendf (t_irc_server *, char *, ...);
extern void server_recv (t_irc_server *);
@@ -268,6 +285,15 @@ extern void server_check_away ();
extern void server_set_away (t_irc_server *, char *, int);
extern void server_print_log (t_irc_server *);
/* proxy functions (irc-server.c) */
extern void convbase64_8x3_to_6x4(char *from, char* to);
extern void base64encode(char *from, char *to);
extern int pass_httpproxy(t_irc_server *server);
extern int resolve(char *hostname, char *ip, int *version);
extern int pass_socks4proxy(t_irc_server *server);
extern int pass_socks5proxy(t_irc_server *server);
extern int pass_proxy(t_irc_server *server);
/* channel functions (irc-channel.c) */
extern t_irc_channel *channel_new (t_irc_server *, int, char *, int);
@@ -280,6 +306,9 @@ extern void channel_check_away (t_irc_server *, t_irc_channel *);
extern void channel_set_away (t_irc_channel *, char *, int);
extern int channel_create_dcc (t_irc_dcc *);
extern void channel_remove_dcc (t_irc_dcc *);
extern int channel_get_notify_level (t_irc_server *, t_irc_channel *);
extern void channel_remove_notify_level (t_irc_server *, t_irc_channel *);
extern void channel_set_notify_level (t_irc_server *, t_irc_channel *, int);
extern void channel_print_log (t_irc_channel *);
/* nick functions (irc-nick.c) */
@@ -311,7 +340,7 @@ extern void dcc_end ();
/* IRC display (irc-diplay.c) */
extern void irc_display_prefix (/*@null@*/ t_gui_buffer *, char *);
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, int, int, int, int);
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, char *, int, int, int, int);
extern void irc_display_mode (t_gui_buffer *, char *, char, char *, char *,
char *, char *);
extern void irc_display_server (t_irc_server *ptr_server);
@@ -383,6 +412,7 @@ extern int irc_cmd_recv_error (t_irc_server *, char *, char *);
extern int irc_cmd_recv_invite (t_irc_server *, char *, char *);
extern int irc_cmd_recv_join (t_irc_server *, char *, char *);
extern int irc_cmd_recv_kick (t_irc_server *, char *, char *);
extern int irc_cmd_recv_kill (t_irc_server *, char *, char *);
extern int irc_cmd_recv_mode (t_irc_server *, char *, char *);
extern int irc_cmd_recv_nick (t_irc_server *, char *, char *);
extern int irc_cmd_recv_notice (t_irc_server *, char *, char *);
+3 -3
View File
@@ -832,19 +832,19 @@ wee_perl_init ()
" my $content = wee_perl_load_file ($filename);"
" if ($content eq \"__WEECHAT_ERROR__\")"
" {"
" weechat::print \"WeeChat Error: Perl script '$filename' not found.\\n\";"
" weechat::print \"WeeChat Error: Perl script '$filename' not found.\\n\", \"\";"
" return 1;"
" }"
" eval $content;"
" if ($@)"
" {"
" weechat::print \"WeeChat error: unable to load Perl script '$filename':\\n\";"
" weechat::print \"WeeChat error: unable to load Perl script '$filename':\\n\", \"\";"
" weechat::print \"$@\\n\";"
" return 2;"
" }"
" return 0;"
"}"
"$SIG{__WARN__} = sub { weechat::print \"$_[0]\n\"; };"
"$SIG{__WARN__} = sub { weechat::print \"$_[0]\n\", \"\"; };"
};
wee_log_printf (_("Loading %s module \"weechat\"\n"), "Perl");
+11 -3
View File
@@ -424,9 +424,17 @@ plugin_find_buffer (char *server, char *channel)
}
else
{
ptr_buffer = gui_current_window->buffer;
if (ptr_buffer->dcc)
ptr_buffer = gui_buffers;
if (!channel)
{
ptr_buffer = gui_current_window->buffer;
if (ptr_buffer->dcc)
ptr_buffer = gui_buffers;
}
else
{
if (ptr_server)
ptr_buffer = ptr_server->buffer;
}
}
if (!ptr_buffer)
+27 -2
View File
@@ -58,7 +58,7 @@ wee_python_register (PyObject *self, PyObject *args)
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "print_with_channel");
"Python", "register");
return NULL;
}
@@ -140,7 +140,7 @@ wee_python_print (PyObject *self, PyObject *args)
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "print");
"Python", "prnt");
return NULL;
}
@@ -407,6 +407,31 @@ wee_python_init ()
{
wee_log_printf (_("Loading %s module \"weechat\"\n"), "Python");
Py_InitModule ("weechat", weechat_funcs);
if (PyRun_SimpleString (
"import weechat, sys, string\n"
"class weechatStdout:\n"
"\tdef write(self, str):\n"
"\t\tstr = string.strip(str)\n"
"\t\tif str != \"\":\n"
"\t\t\tweechat.prnt(\"Python stdout : \" + str, \"\")\n"
"class weechatStderr:\n"
"\tdef write(self, str):\n"
"\t\tstr = string.strip(str)\n"
"\t\tif str != \"\":\n"
"\t\t\tweechat.prnt(\"Python stderr : \" + str, \"\")\n"
"sys.stdout = weechatStdout()\n"
"sys.stderr = weechatStderr()\n"
) != 0)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL,
_("%s error: error while redirecting stdout and stderr\n"),
"Python");
}
}
}
+10 -2
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "May 2005" "FlashCode"
.TH WEECHAT 1 "July 2005" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
@@ -27,6 +27,10 @@ display config file help (list of options)
.br
display summary of options
.TP
.B \-i, \-\-irc\-commands
.br
display IRC commands
.TP
.B \-l, \-\-license
.br
display program license
@@ -34,12 +38,16 @@ display program license
.B \-v, \-\-version
.br
display WeeChat version
.TP
.B \-w, \-\-weechat\-commands
.br
display WeeChat commands
.SH URL
WeeChat can use an URL (Uniform Resource Locator) to automatically connect
to an IRC server. These are in the following form:
.TP
.B irc://[[nickname][:password]@]server[:port][/[#&+!]channel]
.B irc[6][s]://[[nickname][:password]@]server[:port][/[#&+!]channel[,channel...]]
.TP
Exemple to join WeeChat channel support with nick "FlashCode":
irc://FlashCode@irc.freenode.net/weechat
+4 -2
View File
@@ -1,5 +1,5 @@
%define name weechat
%define version 0.1.2
%define version 0.1.3
%define release 1
Name: %{name}
@@ -10,7 +10,7 @@ Source: http://weechat.flashtux.org/download/%{name}-%{version}.tar.gz
URL: http://weechat.flashtux.org
Group: Networking/IRC
BuildRoot: %{_tmppath}/%{name}-buildroot
Requires: perl, python
Requires: perl, python, libgnutls
License: GPL
%description
@@ -41,6 +41,8 @@ rm -rf $RPM_BUILD_ROOT
/usr/local/bin/weechat-curses
%changelog
* Sat Jul 02 2005 FlashCode <flashcode@flashtux.org> 0.1.3-1
- Released version 0.1.3
* Sat May 21 2005 FlashCode <flashcode@flashtux.org> 0.1.2-1
- Released version 0.1.2
* Sat Mar 20 2005 FlashCode <flashcode@flashtux.org> 0.1.1-1