mirror of
https://github.com/weechat/weechat.git
synced 2026-06-20 10:04:48 +02:00
Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 89b955c79e | |||
| 3d724fb634 | |||
| 29d0225e4a | |||
| 8416212077 | |||
| c36f08d7d7 | |||
| 1230735c5f | |||
| 77d7b703de | |||
| 60db73c19a | |||
| a9ca2987bb | |||
| 220308e1fa | |||
| 8166d15235 | |||
| 575525d965 | |||
| 6271304832 | |||
| bdf9eadf43 | |||
| 15ea11b57b | |||
| f3390da5e3 | |||
| eeff957278 | |||
| 1eac6d8fdd | |||
| 23696b44da | |||
| 63ffae72af | |||
| 376c8a29d6 | |||
| 8b1e3b9890 | |||
| 1b2c5571e6 | |||
| 4c6c367557 | |||
| 99ad719ab9 | |||
| a68a1f8192 | |||
| 930c40eae1 | |||
| 9238a37351 | |||
| a7c4c7237c | |||
| a9912cd266 | |||
| 1d07964d17 | |||
| 06bd0f9f0e | |||
| 4b1679900a | |||
| 99f03cd2a3 | |||
| 3d41a3fa2f | |||
| 089b167573 | |||
| fc2d9732e5 | |||
| 94a3b5e1ae | |||
| 6b12f19083 | |||
| 8a6d35cf12 | |||
| d286f3922c | |||
| 505b43d15b | |||
| 07a820ced6 | |||
| df6a41566b | |||
| 263606fffb | |||
| d4d065253e | |||
| 673e7680af | |||
| ad1120c84c | |||
| f2a78ebc16 | |||
| fef0932c1d | |||
| 96bd473887 | |||
| 89d107c1a9 | |||
| 54d4fc12a6 | |||
| 55125beee4 | |||
| a724278215 | |||
| e3799797ef | |||
| b738f4c8aa | |||
| 6f3b6d9e50 | |||
| def35c5a66 | |||
| da4ee1a6ee | |||
| 7c31dd9189 | |||
| dbad2a0206 | |||
| ec1d57063c | |||
| 5bd56f86c6 | |||
| 2fab4da03d | |||
| c69c77507c | |||
| b330ec3dae | |||
| ae8f8a5700 | |||
| 5e8b47f187 | |||
| f4abd0bf59 | |||
| abe7e08147 | |||
| 4e9193a943 | |||
| bbd373c44d | |||
| 6b011234cf | |||
| 71a76ada48 | |||
| a7ddb89076 | |||
| 6fe262c131 | |||
| 0a32bc5326 | |||
| 70fe8e9472 | |||
| b0310b6e78 | |||
| 8218316502 | |||
| d00c99f292 | |||
| f72e5952f2 | |||
| ebf5f9e66d | |||
| 7330dc862a | |||
| 9eb1422bb7 | |||
| d86a783b6a | |||
| 5b3f96dace | |||
| 821c2e87c8 | |||
| 1de7b52aa2 | |||
| 4d4a667094 | |||
| 0eb3d45582 | |||
| 7c63a73999 | |||
| 2ab3467c05 | |||
| 37d74c4941 | |||
| 01186c6c8b | |||
| 29ffe7e0d8 | |||
| a8619181b7 | |||
| 5a90270a79 | |||
| 3900a0f5ae |
@@ -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:
|
||||
-------
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2005-05-21
|
||||
WeeChat known bugs, 2005-07-30
|
||||
|
||||
- ./configure does not check that Gtk 2.0 libraries are installed
|
||||
- when quitting WeeChat term title is not restored (if look_set_title is ON)
|
||||
|
||||
@@ -1,9 +1,55 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-05-21
|
||||
ChangeLog - 2005-07-30
|
||||
|
||||
|
||||
Version 0.1.4 (2005-07-30):
|
||||
* join and part/quit prefixes (arrows) now displayed with different colors
|
||||
* added "irc_highlight" setting, to get highlight with any word
|
||||
* fixed auto-rejoin for channels with key
|
||||
* fixed /ctcp command (now any command/data allowed)
|
||||
* added /amsg command (send text to all channels of all connected servers)
|
||||
* fixed SIGSEGV handler (now write a core file by aborting program)
|
||||
* fixed statusbar & infobar background refresh problem with some systems
|
||||
* added color for private in hotlist (different than color for highlight)
|
||||
* added DCC resume and timeout
|
||||
* added function for Perl/Python to get DCC list
|
||||
* fixed FIFO pipe (command now authorized on a buffer not connected
|
||||
to an IRC server)
|
||||
* topic completion now decodes UTF-8 string
|
||||
* fixed bug with IRC URL on command line (irc://)
|
||||
* new keyboard management: keys are setup in config file, new command
|
||||
/key was added and some new default keys were added, alt-k key is
|
||||
used to grab key (useful for /key command)
|
||||
* added seconds in infobar time (optional thanks to new setting)
|
||||
* fixed some curses refreshs
|
||||
* channels auto-prefixed by "#" (if no prefix found) for /join command
|
||||
|
||||
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)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-05-21
|
||||
WeeChat FAQ, 2005-07-30
|
||||
=======================
|
||||
|
||||
Intended audience:
|
||||
@@ -50,8 +50,12 @@ Q: Why using WeeChat ? X-Chat and Irssi are so good...
|
||||
|
||||
A: Because WeeChat is very light and has new features.
|
||||
Some new features:
|
||||
* many GUI (Curses, Gtk, wxWidgets, Qt),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* many GUI (Curses, Gtk, wxWidgets, Qt)
|
||||
* nicklist available in all GUI
|
||||
* extensible with scripts (Perl, Python, Ruby)
|
||||
* horizontal and vertical window split
|
||||
* infobar highlight
|
||||
* FIFO pipe for remote control
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
@@ -83,7 +87,9 @@ A: You have to setup charset used for decoding, encoding, and internal WeeChat
|
||||
================================================================================
|
||||
Q: How can I customize key bindings?
|
||||
|
||||
A: Today you can't do that. This is planed for a future version.
|
||||
A: Key bindings are customizable with /key command.
|
||||
Default key Meta-k (usually Alt-k) lets you grab key code and insert it
|
||||
in input zone.
|
||||
|
||||
|
||||
2.5
|
||||
@@ -103,7 +109,7 @@ A: You can use /perl command to load scripts (default path is
|
||||
Q: How can I load Python scripts?
|
||||
Are Python scripts compatible with X-chat or/and Irssi ?
|
||||
|
||||
A: You can use /python command to load scripts (default path is
|
||||
A: You can use /python command to load scripts (default path is
|
||||
~/.weechat/python).
|
||||
Note that scripts in ~/.weechat/python/autoload are automatically loaded
|
||||
when WeeChat is starting up.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-05-21
|
||||
WeeChat FAQ, 2005-07-30
|
||||
=======================
|
||||
|
||||
Public concerné :
|
||||
@@ -53,8 +53,12 @@ Q: Pourquoi utiliser WeeChat ? X-Chat et Irssi sont si bien...
|
||||
|
||||
R: Parce que WeeChat est très léger et a de nouvelles fonctionnalités.
|
||||
Quelques nouvelles fonctionnalités :
|
||||
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt),
|
||||
* extensible par des scripts (Perl, Python, Ruby),
|
||||
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt)
|
||||
* liste des pseudos disponible dans toutes les interfaces
|
||||
* extensible par des scripts (Perl, Python, Ruby)
|
||||
* découpage de la fenêtre horizontalement et verticalement
|
||||
* highlight dans la barre d'infos
|
||||
* tube FIFO pour contrôle à distance
|
||||
* développé à partir de zéro (non basé sur un quelconque client IRC)
|
||||
* multi-platformes
|
||||
* 100% GPL et libre
|
||||
@@ -87,8 +91,9 @@ R: Il faut configurer le charset utilis
|
||||
================================================================================
|
||||
Q: Comment puis-je configurer les raccourcis clavier ?
|
||||
|
||||
R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
|
||||
version future.
|
||||
R: Les raccourcis clavier sont modifiables avec la commande /key.
|
||||
La touche par défaut Meta-k (souvent Alt-k) permet de capturer le code
|
||||
d'une touche et de l'inclure dans la zone de saisie.
|
||||
|
||||
|
||||
2.5
|
||||
|
||||
+2
-4
@@ -15,9 +15,9 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
SUBDIRS = po intl src
|
||||
SUBDIRS = po doc intl src
|
||||
|
||||
EXTRA_DIST = config.rpath weechat-curses.1 BUGS FAQ FAQ.fr \
|
||||
EXTRA_DIST = config.rpath BUGS FAQ FAQ.fr \
|
||||
debian/changelog debian/control \
|
||||
debian/copyright \
|
||||
debian/rules debian/weechat-common.docs \
|
||||
@@ -25,6 +25,4 @@ EXTRA_DIST = config.rpath weechat-curses.1 BUGS FAQ FAQ.fr \
|
||||
debian/weechat-curses.install debian/weechat-gtk.dirs \
|
||||
debian/weechat-gtk.install
|
||||
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2005-07-30
|
||||
|
||||
WeeChat 0.1.4 released.
|
||||
|
||||
* FlashCode, 2005-07-02
|
||||
|
||||
WeeChat 0.1.3 released.
|
||||
|
||||
* FlashCode, 2005-05-21
|
||||
|
||||
WeeChat 0.1.2 released.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2005-05-21
|
||||
TODO - 2005-07-20
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -10,38 +10,38 @@ Legend:
|
||||
? is this really necessary?
|
||||
|
||||
|
||||
v0.1.2:
|
||||
v0.1.4:
|
||||
------
|
||||
|
||||
* 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)
|
||||
|
||||
* WeeChat commands
|
||||
- be able to bind a key on more than one command
|
||||
- be able to make an alias running more than one command
|
||||
|
||||
* Configuration:
|
||||
- add key bindings to config file
|
||||
|
||||
* Plugins:
|
||||
# Python plugin
|
||||
# "/python load" and "/python unload" commands to (un)load Python scripts
|
||||
# irc_highlight setting to highlight custom words
|
||||
# save buffer notify levels
|
||||
# add key bindings to config file, and create /key command
|
||||
|
||||
|
||||
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,16 +52,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
|
||||
- completion system for scripts arguments
|
||||
|
||||
* Interface:
|
||||
- color for nicks (except own nick) when nick colors are disabled
|
||||
@@ -69,10 +63,6 @@ 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
|
||||
|
||||
+60
-26
@@ -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.4, 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.4])
|
||||
|
||||
# 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"
|
||||
@@ -233,6 +265,7 @@ LIBS="$LIBS $INTLLIBS"
|
||||
CFLAGS="$CFLAGS $CPPFLAGS"
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
doc/Makefile
|
||||
src/Makefile
|
||||
src/common/Makefile
|
||||
src/irc/Makefile
|
||||
@@ -286,6 +319,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
|
||||
|
||||
Vendored
+26
@@ -1,3 +1,29 @@
|
||||
weechat (0.1.3-2) unstable; urgency=low
|
||||
|
||||
* Update config.{guess,sub} to fix FTBFS on k*BSD (Closes: #316791)
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Fri, 8 Jul 2005 21:30:38 +0200
|
||||
|
||||
weechat (0.1.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sat, 2 Jul 2005 20:06:29 +0200
|
||||
|
||||
weechat (0.1.2-3) unstable; urgency=low
|
||||
|
||||
* Apply patch against gui-display.c to fix curses color bug.
|
||||
* remove dh_install --sourcedir to allow builds on woody.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sun, 19 Jun 2005 22:37:11 +0200
|
||||
|
||||
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.
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
4
|
||||
Vendored
+2
-2
@@ -3,8 +3,8 @@ 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
|
||||
Standards-Version: 3.6.1
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev, libgnutls11-dev
|
||||
Standards-Version: 3.6.2.1
|
||||
|
||||
Package: weechat
|
||||
Architecture: all
|
||||
|
||||
Vendored
+4
-4
@@ -38,9 +38,9 @@ install: build
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/weechat
|
||||
dh_install --sourcedir=debian/weechat
|
||||
install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
|
||||
dh_install
|
||||
# install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
# install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ binary-arch: build install
|
||||
dh_testroot -a
|
||||
# dh_installchangelogs -a
|
||||
# dh_installdocs -a
|
||||
dh_installman weechat-curses.1 -pweechat-curses
|
||||
dh_installman doc/weechat-curses.1 -pweechat-curses
|
||||
dh_link -a usr/share/doc/weechat-common usr/share/doc/weechat-curses
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
version=2
|
||||
http://weechat.flashtux.org/download/weechat-(\d.*)\.tar\.bz2
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
usr/share/locale
|
||||
debian/tmp/usr/share/locale/
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
usr/bin/weechat-curses
|
||||
debian/tmp/usr/bin/weechat-curses
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
all: weechat_doc_fr.texi weechat_doc_en.texi weechat_doc_pt.texi weechat_doc_es.texi
|
||||
export LANG=fr_FR && makeinfo --html --no-split --number-sections weechat_doc_fr.texi
|
||||
export LANG=fr_FR && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_fr.texi >weechat_doc_fr.txt
|
||||
export LANG=en_EN && makeinfo --html --no-split --number-sections weechat_doc_en.texi
|
||||
export LANG=en_EN && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_en.texi >weechat_doc_en.txt
|
||||
export LANG=es_ES && makeinfo --html --no-split --number-sections weechat_doc_es.texi
|
||||
export LANG=es_ES && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_es.texi >weechat_doc_es.txt
|
||||
export LANG=pt_PT && makeinfo --html --no-split --number-sections weechat_doc_pt.texi
|
||||
export LANG=pt_PT && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_pt.texi >weechat_doc_pt.txt
|
||||
export LANG=fr_FR && texi2pdf weechat_doc_fr.texi
|
||||
export LANG=en_EN && texi2pdf weechat_doc_en.texi
|
||||
export LANG=es_ES && texi2pdf weechat_doc_es.texi
|
||||
export LANG=pt_PT && texi2pdf weechat_doc_pt.texi
|
||||
|
||||
clean:
|
||||
rm -rf weechat_doc_*.aux weechat_doc_*.cp weechat_doc_*.fn \
|
||||
weechat_doc_*.html weechat_doc_*.ky weechat_doc_*.log \
|
||||
weechat_doc_*.pdf weechat_doc_*.pg weechat_doc_*.toc \
|
||||
weechat_doc_*.tp weechat_doc_*.txt weechat_doc_*.vr
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
info_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
#weechat_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
# weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
AM_MAKEINFOHTMLFLAGS = --no-split --number-sections
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
@@ -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)
|
||||
@@ -23,10 +23,22 @@ It is compliant with RFCs 1459, 2810, 2811, 2812, and 2813.
|
||||
.br
|
||||
display config file help (list of options)
|
||||
.TP
|
||||
.B \-f, \-\-key\-functions
|
||||
.br
|
||||
display internal functions for keys
|
||||
.TP
|
||||
.B \-h, \-\-help
|
||||
.br
|
||||
display summary of options
|
||||
.TP
|
||||
.B \-i, \-\-irc\-commands
|
||||
.br
|
||||
display IRC commands
|
||||
.TP
|
||||
.B \-k, \-\-keys
|
||||
.br
|
||||
display default keys
|
||||
.TP
|
||||
.B \-l, \-\-license
|
||||
.br
|
||||
display program license
|
||||
@@ -34,12 +46,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
|
||||
+281
-154
@@ -35,9 +35,7 @@
|
||||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.1.2 - May, 21 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentation for WeeChat v0.1.4-cvs - July, 16 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -84,27 +82,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 +114,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 +137,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{apt-get install weechat-curses}
|
||||
@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 +174,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 +204,47 @@ 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 -f, --key-functions
|
||||
Display WeeChat internal functions for keys@*
|
||||
@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'@*
|
||||
@@ -311,7 +315,10 @@ Enable info bar@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Timestamp for time in infobar@*
|
||||
Type: string (any string), default value: '%B, %A %d %Y - %H:%M'@*
|
||||
Type: string (any string), default value: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Display seconds in infobar time@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Delay (in seconds) for highlight messages in infobar (0 = disable highlight notifications in infobar)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 7@*
|
||||
@@ -378,6 +385,9 @@ Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar
|
||||
Color for info bar text@*
|
||||
Type: color (Curses or Gtk color), default value: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Color for infobar delimiters@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Color for info bar highlight notification@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@@ -488,7 +498,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 +547,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 +583,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 +619,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 +660,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 +674,37 @@ Go to the beginning of command line@*
|
||||
@item End / Ctrl + E
|
||||
Go to the end of command line@*
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Erase previous / next char of command line@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
@item Ctrl + K
|
||||
Delete until end of line@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Redraw whole window@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Delete until beginning of line@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Erase previous word of command line@*
|
||||
@*
|
||||
@item Tab
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Erase previous / next char of command line@*
|
||||
@*
|
||||
@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
|
||||
@@ -680,30 +716,48 @@ Remove last infobar message@*
|
||||
@item F11 / F12
|
||||
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
|
||||
Switch to next buffer with activity (with priority: highlight, message, other)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Display current DCC@*
|
||||
@item Alt + B
|
||||
Go to previous word@*
|
||||
@*
|
||||
@item Alt + R
|
||||
@item Alt + D
|
||||
Delete next word@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Go to next word@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Clear hotlist (activity notification on other buffers)@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J then Alt + D
|
||||
Display current DCC@*
|
||||
@*
|
||||
@item Alt + J then Alt + L
|
||||
Switch to last buffer@*
|
||||
@*
|
||||
@item Alt + J then Alt + S
|
||||
Switch to server buffer@*
|
||||
@*
|
||||
@item Alt + X
|
||||
@item Alt + J then Alt + X
|
||||
Switch to first channel of next server (or server buffer if no channel is opened)@*
|
||||
@*
|
||||
@item Alt + digit (1-9)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item Alt + J then number (01-99)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Grab a key
|
||||
@*
|
||||
@item Alt + R
|
||||
Delete entire line@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@@ -715,7 +769,6 @@ Scroll nicklist@*
|
||||
WeeChat internal commands:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item alias [alias_name [command [arguments]]
|
||||
@*
|
||||
create an alias for a command@*
|
||||
@@ -765,6 +818,15 @@ display help about commands@*
|
||||
@*
|
||||
command: name of a WeeChat or IRC command@*
|
||||
@*
|
||||
@item key [key function/command] [unbind key] [functions] [reset -yes]
|
||||
@*
|
||||
bind/unbind keys@*
|
||||
@*
|
||||
key: bind this key to an internal function or a command (beginning by "/")@*
|
||||
unbind: unbind a key (if "all", default bindings are restored)@*
|
||||
functions: list internal functions for key bindings@*
|
||||
reset: restore bindings to the default values and delete ALL personal binding (use carefully!)@*
|
||||
@*
|
||||
@item perl [load filename] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
list/load/unload Perl scripts@*
|
||||
@@ -779,13 +841,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 +885,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 +1256,73 @@ nickname: nickname to search@*
|
||||
count: number of replies to return (full search if negative number)@*
|
||||
target: reply should match this mask@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
Internal functions for keys:@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminate line@*
|
||||
@item tab
|
||||
complete word@*
|
||||
@item backspace
|
||||
delete previous char@*
|
||||
@item delete
|
||||
delete next char@*
|
||||
@item delete_end_line
|
||||
delete until end of line@*
|
||||
@item delete_beginning_line
|
||||
delete until beginning of line@*
|
||||
@item delete_line
|
||||
delete entire line@*
|
||||
@item delete_previous_word
|
||||
delete previous word@*
|
||||
@item delete_next_word
|
||||
delete next word@*
|
||||
@item home
|
||||
go to beginning of line@*
|
||||
@item end
|
||||
go to end of line@*
|
||||
@item left
|
||||
move one char left@*
|
||||
@item previous_word
|
||||
move to previous word@*
|
||||
@item right
|
||||
move one char right@*
|
||||
@item next_word
|
||||
move to next word@*
|
||||
@item up
|
||||
call previous command in history@*
|
||||
@item down
|
||||
call next command in history@*
|
||||
@item page_up
|
||||
scroll one page up@*
|
||||
@item page_down
|
||||
scroll one page down@*
|
||||
@item infobar_clear
|
||||
clear infobar@*
|
||||
@item nick_page_up
|
||||
scroll nicklist one page up@*
|
||||
@item nick_page_down
|
||||
scroll nicklist one page down@*
|
||||
@item nick_beginning
|
||||
display beginning of nicklist@*
|
||||
@item nick_end
|
||||
display end of nicklist@*
|
||||
@item refresh
|
||||
refresh screen@*
|
||||
@item jump_smart
|
||||
jump to buffer with activity@*
|
||||
@item jump_dcc
|
||||
jump to DCC buffer@*
|
||||
@item jump_server
|
||||
jump to server buffer@*
|
||||
@item jump_next_server
|
||||
jump to next server@*
|
||||
@item hotlist_clear
|
||||
clear hotlist@*
|
||||
@item grab_key
|
||||
grab a key@*
|
||||
@end table
|
||||
|
||||
@node FIFO pipe, , WeeChat commands, Usage
|
||||
@@ -1215,15 +1343,19 @@ Some examples:
|
||||
@item @bullet{} change your nick on freenode to "mynick|out":
|
||||
@*
|
||||
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} display text on #weechat channel:
|
||||
@*
|
||||
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
|
||||
@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
|
||||
@*
|
||||
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1443,7 +1575,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 +1591,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 +1607,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 +1625,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 +1644,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 +1668,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 +1686,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 +1712,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 +1792,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}>@*
|
||||
|
||||
+215
-88
@@ -30,14 +30,13 @@
|
||||
@c end tex
|
||||
|
||||
@documentlanguage es
|
||||
@documentencoding ISO-8859-1
|
||||
|
||||
@titlepage
|
||||
|
||||
@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
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.4-cvs - 16 de Julio de 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -90,9 +89,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 +99,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
|
||||
@@ -150,7 +149,7 @@ Los paquetes binarios est@'an disponibles para las siguientes distribuciones:
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (o compatible con Debian)@*
|
||||
Para instalar WeeChat: @kbd{dpkg -i /direccion/weechat_x.y.z-1_i386.deb}
|
||||
Para instalar WeeChat: @kbd{apt-get install weechat-curses}
|
||||
@item
|
||||
Mandrake/Redhat (o cualquier distribuci@'on compatible con los paquetes RPM)@*
|
||||
Para instalar WeeChat: @kbd{rpm -i /direccion/weechat-x.y.z-1.i386.rpm}
|
||||
@@ -187,7 +186,7 @@ Adquiere los derechos de root e instala WeeChat:@*
|
||||
|
||||
Atenci@'on: Las fuentes CVS est@'an reservadas para usuarios con experiencia: Es posible que WeeChat no
|
||||
se instale o que se sea bastante inestable.
|
||||
¡Ya te he avisado!@*
|
||||
@exclamdown{}Ya te he avisado!@*
|
||||
|
||||
Para recuperar las fuentes CVS, escribe las l@'ineas siguientes:@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@@ -221,18 +220,25 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Obtener la ayuda del fichero de configuraci@'on (lista de opciones)@*
|
||||
@item -f, --key-functions
|
||||
Display WeeChat internal functions for keys@*
|
||||
@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 +253,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'@*
|
||||
@@ -270,7 +275,7 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
Juego de caracteres interno de WeeChat, deber@'ia ser ISO-xxxx aunque el locale sea UTF-8 (si no se especifica, se utiliza el juego de caracteres local)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'ISO-8859-1'@*
|
||||
@item look_buffer_timestamp
|
||||
Fecha y hora para las búfers@*
|
||||
Fecha y hora para las b@'ufers@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '[%H:%M:%S]'@*
|
||||
@item look_color_nicks
|
||||
Mostrar nombres de usuario con colores diferentes@*
|
||||
@@ -310,7 +315,10 @@ Activa la barra de informaci@'on@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Fecha y hora para las conversaciones guardadas@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y - %H:%M'@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Display seconds in infobar time@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Retraso (en segundos) para la notificaci@'on de mensajes en la barra de informaci@'on (0 = desactivar las notificaciones en la barra de informaci@'on)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 7@*
|
||||
@@ -377,6 +385,9 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
|
||||
@item col_infobar
|
||||
Color para el texto de la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Color para los delimitadores de la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Color para la notificaci@'on en la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'white'@*
|
||||
@@ -453,10 +464,10 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
|
||||
Color para el estado dcc "abortado"@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
|
||||
@item history_max_lines
|
||||
Número m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
|
||||
N@'umero m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 4096@*
|
||||
@item history_max_commands
|
||||
Número m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
|
||||
N@'umero m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 100@*
|
||||
@item log_auto_server
|
||||
Registrar autom@'aticamente los mensajes de servidor@*
|
||||
@@ -487,7 +498,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'@*
|
||||
@@ -510,7 +521,7 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
Aceptar autom@'aticamente los ficheros dcc entrantes@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_auto_accept_chats
|
||||
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (¡utilizar con precauci@'on!)@*
|
||||
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (@exclamdown{}utilizar con precauci@'on!)@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_timeout
|
||||
Tiempo de espera para la petici@'on dcc (en segundos)@*
|
||||
@@ -536,12 +547,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 +583,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 +619,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 +658,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
|
||||
|
||||
@@ -647,12 +674,21 @@ Ir al inicio de la l@'inea de comandos@*
|
||||
@item Fin / Ctrl + E
|
||||
Ir al final de la l@'inea de comandos@*
|
||||
@*
|
||||
@item Ctrl + K
|
||||
Delete until end of line@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Refrescar toda la ventana@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Delete until beginning of line@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Borrar la palabra anterior en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Backspace / Supr
|
||||
Borrar el caracter anterior / siguiente en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
Borrar la palabra anterior en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Tab
|
||||
Completar el comando o el seud@'onimo (@kbd{Tab} de nuevo: encontrar la pr@'oxima autocompletaci@'on)@*
|
||||
@*
|
||||
@@ -680,30 +716,48 @@ Borrar el @'ultimo mensaje en la barra de informaciones@*
|
||||
@item F11 / F12
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Refrescar toda la ventana@*
|
||||
@*
|
||||
@item Alt + flecha izquierda / Alt + flecha derecha
|
||||
Como F5 / F6@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Ir a la memoria temporal donde hay actividad (con el orden de prioridad siguiente: resaltado, mensaje, otros)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Obtener la lista de DCC actual@*
|
||||
@item Alt + B
|
||||
Go to previous word@*
|
||||
@*
|
||||
@item Alt + R
|
||||
@item Alt + D
|
||||
Delete next word@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Go to next word@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Borrar la 'hotlist' (notificaci@'on de actividad en otras memorias temporales)@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J then Alt + D
|
||||
Obtener la lista de DCC actual@*
|
||||
@*
|
||||
@item Alt + J then Alt + L
|
||||
Switch to last buffer@*
|
||||
@*
|
||||
@item Alt + J then Alt + S
|
||||
Ir a la memoria temporal del servidor@*
|
||||
@*
|
||||
@item Alt + X
|
||||
@item Alt + J then Alt + X
|
||||
Ir al primer canal del servidor siguiente (o a la memoria temporal del servidor si ning@'un canal est@'a abierto)@*
|
||||
@*
|
||||
@item Alt + (1-9)
|
||||
Saltar a la memoria temporal con ese n@'umero@*
|
||||
@*
|
||||
@item Alt + J then number (01-99)
|
||||
Saltar a la memoria temporal con ese n@'umero@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Grab a key
|
||||
@*
|
||||
@item Alt + R
|
||||
Delete entire line@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@@ -715,7 +769,6 @@ Scroll nicklist@*
|
||||
Comandos internos WeeChat:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item alias [nombre_alias [comando [argumentos]]
|
||||
@*
|
||||
crear un alias para un comando@*
|
||||
@@ -724,16 +777,16 @@ nombre_alias: nombre del seud@'onimo@*
|
||||
comando: nombre del comando (comando WeeChat @'o IRC, sin el primer '/')@*
|
||||
argumentos: par@'ametros para el comando@*
|
||||
@*
|
||||
@item buffer [acci@'on | número]
|
||||
@item buffer [acci@'on | n@'umero]
|
||||
@*
|
||||
gestionar los búfers@*
|
||||
gestionar los b@'ufers@*
|
||||
@*
|
||||
acci@'on: acci@'on a efectuar:@*
|
||||
move: desplaza el búfer en la lista (puede ser relativo, por ejemplo, -1)@*
|
||||
close: cierra el búfer (para un canal equivale a /part sin el mensaje de fin)@*
|
||||
list: lista los búfers abiertos (si no hay par@'ametros se supone esta lista)@*
|
||||
move: desplaza el b@'ufer en la lista (puede ser relativo, por ejemplo, -1)@*
|
||||
close: cierra el b@'ufer (para un canal equivale a /part sin el mensaje de fin)@*
|
||||
list: lista los b@'ufers abiertos (si no hay par@'ametros se supone esta lista)@*
|
||||
notify: fija el nivel de notificaci@'on (0=nunca, 1=highlight, 2=1+msg, 3=2+join/part)@*
|
||||
número: saltar al búfer por número@*
|
||||
n@'umero: saltar al b@'ufer por n@'umero@*
|
||||
@*
|
||||
@item clear [-all]
|
||||
@*
|
||||
@@ -765,6 +818,15 @@ mostrar ayuda sobre los comandos@*
|
||||
@*
|
||||
comando: nombre de un comando de Weechat @'o de IRC@*
|
||||
@*
|
||||
@item key [key function/command] [unbind key] [functions] [reset -yes]
|
||||
@*
|
||||
bind/unbind keys@*
|
||||
@*
|
||||
key: bind this key to an internal function or a command (beginning by "/")@*
|
||||
unbind: unbind a key (if "all", default bindings are restored)@*
|
||||
functions: list internal functions for key bindings@*
|
||||
reset: restore bindings to the default values and delete ALL personal binding (use carefully!)@*
|
||||
@*
|
||||
@item perl [load fichero] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
lista/carga/descarga de los Perl scripts@*
|
||||
@@ -779,19 +841,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 +885,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@*
|
||||
@@ -839,7 +901,7 @@ target: servidor objetivo@*
|
||||
revertir el estado ausente@*
|
||||
@*
|
||||
-all: revertir el estado ausente en todos los servidores conectados@*
|
||||
mensaje: mensaje para el estado ausente (si no se da ningún mensaje, se elimina el estado ausente)@*
|
||||
mensaje: mensaje para el estado ausente (si no se da ning@'un mensaje, se elimina el estado ausente)@*
|
||||
@*
|
||||
@item ban [canal] [usariio [usuario ...]]
|
||||
@*
|
||||
@@ -970,7 +1032,7 @@ modos del canal:@*
|
||||
s: indicador de canal secreto@*
|
||||
i: indicador de canal s@'olo con invitaci@'on@*
|
||||
t: indicador de tema s@'olo modificable por operador de canal@*
|
||||
n: ningún mensaje al canal desde el exterior@*
|
||||
n: ning@'un mensaje al canal desde el exterior@*
|
||||
m: canal moderado@*
|
||||
l: fijar el l@'imite de usuarios para el canal@*
|
||||
b: establecer una m@'ascara de baneo para mantener fuera a usuarios@*
|
||||
@@ -1186,15 +1248,81 @@ pedir informaci@'on sobre el/los usuario(s)@*
|
||||
servidor: nombre del servidor@*
|
||||
usuario: nombre de usuario (puede que sea una m@'ascara)@*
|
||||
@*
|
||||
@item whowas usuario [,usuario [,usuario ...]] [número [destinatario]]
|
||||
@item whowas usuario [,usuario [,usuario ...]] [n@'umero [destinatario]]
|
||||
@*
|
||||
pedir informaci@'on sobre un usuario que ya no existe@*
|
||||
@*
|
||||
usuario: nombre de usuario a buscar@*
|
||||
número: número de respuestas a devolver (búsqueda completa si el número es negativo)@*
|
||||
n@'umero: n@'umero de respuestas a devolver (b@'usqueda completa si el n@'umero es negativo)@*
|
||||
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
Internal functions for keys:@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminate line@*
|
||||
@item tab
|
||||
complete word@*
|
||||
@item backspace
|
||||
delete previous char@*
|
||||
@item delete
|
||||
delete next char@*
|
||||
@item delete_end_line
|
||||
delete until end of line@*
|
||||
@item delete_beginning_line
|
||||
delete until beginning of line@*
|
||||
@item delete_line
|
||||
delete entire line@*
|
||||
@item delete_previous_word
|
||||
delete previous word@*
|
||||
@item delete_next_word
|
||||
delete next word@*
|
||||
@item home
|
||||
go to beginning of line@*
|
||||
@item end
|
||||
go to end of line@*
|
||||
@item left
|
||||
move one char left@*
|
||||
@item previous_word
|
||||
move to previous word@*
|
||||
@item right
|
||||
move one char right@*
|
||||
@item next_word
|
||||
move to next word@*
|
||||
@item up
|
||||
call previous command in history@*
|
||||
@item down
|
||||
call next command in history@*
|
||||
@item page_up
|
||||
scroll one page up@*
|
||||
@item page_down
|
||||
scroll one page down@*
|
||||
@item infobar_clear
|
||||
clear infobar@*
|
||||
@item nick_page_up
|
||||
scroll nicklist one page up@*
|
||||
@item nick_page_down
|
||||
scroll nicklist one page down@*
|
||||
@item nick_beginning
|
||||
display beginning of nicklist@*
|
||||
@item nick_end
|
||||
display end of nicklist@*
|
||||
@item refresh
|
||||
refresh screen@*
|
||||
@item jump_smart
|
||||
jump to buffer with activity@*
|
||||
@item jump_dcc
|
||||
jump to DCC buffer@*
|
||||
@item jump_server
|
||||
jump to server buffer@*
|
||||
@item jump_next_server
|
||||
jump to next server@*
|
||||
@item hotlist_clear
|
||||
clear hotlist@*
|
||||
@item grab_key
|
||||
grab a key@*
|
||||
@end table
|
||||
|
||||
@node Canal FIFO, , Comandos WeeChat, Uso
|
||||
@@ -1217,15 +1345,19 @@ Algunos ejemplos:
|
||||
@item @bullet{} cambiar el seud@'onimo en freenode por "mynick|out":
|
||||
@*
|
||||
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} escribir texto en el canal #weechat:
|
||||
@*
|
||||
@command{echo "freenode,#weechat *@exclamdown{}Hola a todos!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} escribir texto en el canal corriente (el que se puede visualizar en WeeChat actualmente)
|
||||
@*
|
||||
@command{echo "*¡Hola!" >~/.weechat/weechat_fifo_12345}@*
|
||||
@command{echo "*@exclamdown{}Hola!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Advertencia:} esto es peligroso y no deber@'ias hacerlo.. salvo si lo que est@'as haciendo.
|
||||
@*
|
||||
@item @bullet{} enviar dos comandos para descargar y recargar los scripts Perl (tienes que separarlos con un \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1352,7 +1484,7 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
|
||||
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
|
||||
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
|
||||
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
|
||||
@code{@ @ @ @ weechat::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
|
||||
@code{@ @ @ @ weechat::print ("masc=$mascara, canal=$canal, msj=$mensaje\n");}@*
|
||||
@code{@} }@*
|
||||
@*
|
||||
|
||||
@@ -1445,7 +1577,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 +1593,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 +1609,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 +1647,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("masc="+mascara+", canal="+canal+", msj="+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 +1671,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 +1689,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 +1714,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
|
||||
@@ -1596,7 +1723,7 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
|
||||
@node Programas Ruby, , Programas Python, Extensiones
|
||||
@section Programas Ruby
|
||||
|
||||
¡No desarrollado!
|
||||
@exclamdown{}No desarrollado!
|
||||
|
||||
@c **************************** Autores / Soporte *****************************
|
||||
|
||||
|
||||
+288
-157
@@ -30,14 +30,13 @@
|
||||
@c end tex
|
||||
|
||||
@documentlanguage fr
|
||||
@documentencoding ISO-8859-1
|
||||
|
||||
@titlepage
|
||||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.1.2 - 21 Mai 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentation pour WeeChat v0.1.4-cvs - 16 Juillet 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -83,27 +82,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 +114,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 +137,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{apt-get install weechat-curses}
|
||||
@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 +174,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 +205,47 @@ 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 -f, --key-functions
|
||||
Afficher la liste des fonctions internes WeeChat pour les touches@*
|
||||
@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 +254,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'@*
|
||||
@@ -311,7 +316,10 @@ Active la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Horodatage pour les conversations sauvegard@'ees@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y - %H:%M'@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Afficher les secondes pour l'heure dans la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
D@'elai (en secondes) pour la notification des messages dans la barre d'infos (0 = d@'esactiver les notifications dans la barre d'infos)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 7@*
|
||||
@@ -378,6 +386,9 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar
|
||||
Couleur pour la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Couleur pour les d@'elimiteurs de la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Couleur pour la notification dans la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@@ -418,7 +429,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 +499,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 +548,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 +584,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 +620,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 +661,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 +675,37 @@ 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
|
||||
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
@item Ctrl + K
|
||||
Efface jusqu'@`a la fin de la ligne@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
R@'eaffiche toute la fen@^etre@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Efface jusqu'au d@'ebut de la ligne@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
|
||||
@*
|
||||
@item Tab
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@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
|
||||
@@ -680,30 +717,48 @@ Effacer le dernier message de la barre d'infos@*
|
||||
@item F11 / F12
|
||||
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
|
||||
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
|
||||
@*
|
||||
@item Alt + B
|
||||
Aller au mot pr@'ec@'edent@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Effacer le mot suivant@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Aller au mot suivant@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Vide la hotlist (notification d'activit@'e sur les autres tampons)@*
|
||||
@*
|
||||
@item Alt + J puis Alt + D
|
||||
Afficher les DCC en cours@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Vide la hotlist (notification d'activité sur les autres tampons)@*
|
||||
@item Alt + J puis Alt + L
|
||||
Sauter au dernier tampon@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J puis Alt + S
|
||||
Sauter au tampon du serveur@*
|
||||
@*
|
||||
@item Alt + X
|
||||
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
|
||||
@*
|
||||
@item Alt + chiffre (1-9)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item Alt + J then Alt + X
|
||||
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Capturer une touche
|
||||
@*
|
||||
@item Alt + J puis nombre (01-99)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Effacer la ligne enti@`ere@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Faire d@'efiler la liste des pseudos@*
|
||||
@*
|
||||
@@ -715,7 +770,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@*
|
||||
@@ -765,6 +819,15 @@ afficher l'aide sur les commandes@*
|
||||
@*
|
||||
commande: nom d'une commande WeeChat ou IRC@*
|
||||
@*
|
||||
@item key [touche fonction/commande] [unbind touche] [functions] [reset -yes]
|
||||
@*
|
||||
associer/lib@'erer des touches@*
|
||||
@*
|
||||
touche: associer cette touche @`a une fonction interne ou une commande (commen@,{c}ant par "/")@*
|
||||
unbind: supprimer l'association @`a une touche (si "all", toutes les associations de touches par d@'efaut sont restaur@'ees)@*
|
||||
functions: lister la liste des fonctions internes pour les associations de touches@*
|
||||
reset: restaur les touches aux valeurs par d@'efaut et supprime TOUTES les touches personnelles (utiliser avec pr@'ecaution !)@*
|
||||
@*
|
||||
@item perl [load fichier] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
liste/charge/d@'echarge des scripts Perl@*
|
||||
@@ -779,13 +842,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 +886,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 +1257,73 @@ 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
|
||||
|
||||
Fonctions internes pour les touches :@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminer la ligne@*
|
||||
@item tab
|
||||
compl@'eter le mot@*
|
||||
@item backspace
|
||||
effacer le caract@`ere pr@'ec@'edent@*
|
||||
@item delete
|
||||
effacer le caract@`ere suivant@*
|
||||
@item delete_end_line
|
||||
effacer jusqu'@`a la fin de la ligne@*
|
||||
@item delete_beginning_line
|
||||
effacer jusqu'au d@'ebut de la ligne@*
|
||||
@item delete_line
|
||||
effacer la ligne enti@`ere@*
|
||||
@item delete_previous_word
|
||||
effacer le mot pr@'ec@'edent@*
|
||||
@item delete_next_word
|
||||
effacer le mot suivant@*
|
||||
@item home
|
||||
aller au d@'ebut de la ligne@*
|
||||
@item end
|
||||
aller @`a la fin de la ligne@*
|
||||
@item left
|
||||
se d@'eplacer d'un caract@`ere @`a gauche@*
|
||||
@item previous_word
|
||||
se d@'eplacer au mot pr@'ec@'edent@*
|
||||
@item right
|
||||
se d@'eplacer d'un caract@`ere @`a droite@*
|
||||
@item next_word
|
||||
se d@'eplacer au mot suivant@*
|
||||
@item up
|
||||
appeler la commande pr@'ec@'edente dans l'historique@*
|
||||
@item down
|
||||
appeler la commande suivante dans l'historique@*
|
||||
@item page_up
|
||||
faire d@'efiler d'une page vers le haut@*
|
||||
@item page_down
|
||||
faire d@'efiler d'une page vers le bas@*
|
||||
@item infobar_clear
|
||||
effacer la barre d'infos@*
|
||||
@item nick_page_up
|
||||
faire d@'efiler la liste des pseudos d'une page vers le haut@*
|
||||
@item nick_page_down
|
||||
faire d@'efiler la liste des pseudos d'une page vers le bas@*
|
||||
@item nick_beginning
|
||||
afficher le d@'ebut de la liste des pseudos@*
|
||||
@item nick_end
|
||||
afficher la fin de la liste des pseudos@*
|
||||
@item refresh
|
||||
rafraichir l'@'ecran@*
|
||||
@item jump_smart
|
||||
sauter au tampon avec de l'activit@'e@*
|
||||
@item jump_dcc
|
||||
sauter au tampon DCC@*
|
||||
@item jump_server
|
||||
sauter au tampon du serveur@*
|
||||
@item jump_next_server
|
||||
sauter au prochain serveur@*
|
||||
@item hotlist_clear
|
||||
effacer la liste d'activit@'e@*
|
||||
@item grab_key
|
||||
capturer une touche@*
|
||||
@end table
|
||||
|
||||
@node Tube FIFO, , Commandes WeeChat, Utilisation
|
||||
@@ -1216,14 +1345,21 @@ serveur doit l'@^etre aussi.@*
|
||||
Quelques exemples :
|
||||
@table @asis
|
||||
@item @bullet{} changement du pseudo sur freenode en "pseudo|absent":
|
||||
@*
|
||||
@command{echo "freenode */nick pseudo|absent" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} affichage de texte sur le canal #weechat :
|
||||
@*
|
||||
@command{echo "freenode,#weechat *bonjour tout le monde !" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} affichage de texte sur le canal courant (le tampon affich@'e par WeeChat):
|
||||
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}@*
|
||||
@*
|
||||
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Attention :} ceci est dangereux et vous ne devriez pas le faire sauf si vous savez ce que vous faites !
|
||||
@item @bullet{} envoyer deux commandes pour décharger/recharger les scripts Perl (vous devez les séparer par \n):
|
||||
@*
|
||||
@item @bullet{} envoyer deux commandes pour d@'echarger/recharger les scripts Perl (vous devez les s@'eparer par \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1351,7 +1487,7 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
|
||||
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
|
||||
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
|
||||
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
|
||||
@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, message=$message\n");}@*
|
||||
@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, msg=$message\n");}@*
|
||||
@code{@} }@*
|
||||
@*
|
||||
|
||||
@@ -1444,7 +1580,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 +1597,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 +1613,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 +1631,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 +1651,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 +1675,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 +1693,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 +1718,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
|
||||
|
||||
+1053
-51
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -18,6 +18,7 @@
|
||||
./src/gui/gtk/gui-display.c
|
||||
./src/gui/gtk/gui-input.c
|
||||
./src/gui/gui-common.c
|
||||
./src/gui/gui-keyboard.c
|
||||
./src/gui/gui.h
|
||||
./src/common/command.c
|
||||
./src/common/command.h
|
||||
|
||||
+1280
-890
File diff suppressed because it is too large
Load Diff
+238
-56
@@ -47,11 +47,11 @@ t_weechat_command weechat_commands[] =
|
||||
{ "buffer", N_("manage buffers"),
|
||||
N_("[action | number]"),
|
||||
N_("action: action to do:\n"
|
||||
" move: move buffer in the list (may be relative, for example -1)\n"
|
||||
" close: close buffer (for channel: same as /part without part message)\n"
|
||||
" list: list opened buffers (no parameter implies this list)\n"
|
||||
" notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
|
||||
"number: jump to buffer by number"),
|
||||
" move: move buffer in the list (may be relative, for example -1)\n"
|
||||
" close: close buffer (for channel: same as /part without part message)\n"
|
||||
" list: list opened buffers (no parameter implies this list)\n"
|
||||
" notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
|
||||
"number: jump to buffer by number"),
|
||||
0, MAX_ARGS, weechat_cmd_buffer, NULL },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
@@ -72,31 +72,40 @@ t_weechat_command weechat_commands[] =
|
||||
{ "help", N_("display help about commands"),
|
||||
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
|
||||
0, 1, weechat_cmd_help, NULL },
|
||||
{ "key", N_("bind/unbind keys"),
|
||||
N_("[key function/command] [unbind key] [functions] [reset -yes]"),
|
||||
N_("key: bind this key to an internal function or a command (beginning by \"/\")\n"
|
||||
"unbind: unbind a key (if \"all\", default bindings are restored)\n"
|
||||
"functions: list internal functions for key bindings\n"
|
||||
"reset: restore bindings to the default values and delete ALL personal binding (use carefully!)"),
|
||||
0, MAX_ARGS, NULL, weechat_cmd_key },
|
||||
{ "perl", N_("list/load/unload Perl scripts"),
|
||||
N_("[load filename] | [autoload] | [reload] | [unload]"),
|
||||
N_("filename: Perl script (file) to load\n"
|
||||
"Without argument, /perl command lists all loaded Perl scripts."),
|
||||
"Without argument, /perl command lists all loaded Perl scripts."),
|
||||
0, 2, weechat_cmd_perl, NULL },
|
||||
{ "python", N_("list/load/unload Python scripts"),
|
||||
N_("[load filename] | [autoload] | [reload] | [unload]"),
|
||||
N_("filename: Python script (file) to load\n"
|
||||
"Without argument, /python command lists all loaded Python scripts."),
|
||||
"Without argument, /python command lists all loaded Python scripts."),
|
||||
0, 2, weechat_cmd_python, NULL },
|
||||
{ "server", N_("list, add or remove servers"),
|
||||
N_("[servername] | "
|
||||
"[servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 "
|
||||
"[nick2 [nick3]]] [-username username] [-realname realname] "
|
||||
"[-command command] [-autojoin channel[,channel]] ] | "
|
||||
"[del 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]"),
|
||||
N_("servername: server name, for internal & display use\n"
|
||||
"hostname: name or IP address of server\n"
|
||||
"port: port for server (integer)\n"
|
||||
"password: password for server\n"
|
||||
"nick1: first nick for server\n"
|
||||
"nick2: alternate nick for server\n"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user"),
|
||||
"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"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user"),
|
||||
0, MAX_ARGS, weechat_cmd_server, NULL },
|
||||
{ "save", N_("save config to disk"),
|
||||
N_("[file]"), N_("file: filename for writing config"),
|
||||
@@ -109,11 +118,10 @@ t_weechat_command weechat_commands[] =
|
||||
1, 1, NULL, weechat_cmd_unalias },
|
||||
{ "window", N_("manage windows"),
|
||||
N_("[list | splith | splitv | [merge [down | up | left | right | all]]]"),
|
||||
N_(
|
||||
"list: list opened windows (no parameter implies this list)\n"
|
||||
"splith: split current window horizontally\n"
|
||||
"splitv: split current window vertically\n"
|
||||
"merge: merge window with another"),
|
||||
N_("list: list opened windows (no parameter implies this list)\n"
|
||||
"splith: split current window horizontally\n"
|
||||
"splitv: split current window vertically\n"
|
||||
"merge: merge window with another"),
|
||||
0, 2, weechat_cmd_window, NULL },
|
||||
{ NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
|
||||
};
|
||||
@@ -706,7 +714,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);
|
||||
@@ -875,6 +883,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
t_irc_channel *ptr_channel;
|
||||
long number;
|
||||
char *error;
|
||||
int target_buffer;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
@@ -962,7 +971,9 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
if (SERVER(gui_current_window->buffer))
|
||||
{
|
||||
if (SERVER(gui_current_window->buffer)->is_connected)
|
||||
if (SERVER(gui_current_window->buffer)->is_connected
|
||||
&& CHANNEL(gui_current_window->buffer)
|
||||
&& CHANNEL(gui_current_window->buffer)->nicks)
|
||||
irc_cmd_send_part (SERVER(gui_current_window->buffer), NULL);
|
||||
else
|
||||
{
|
||||
@@ -995,7 +1006,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 +1022,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;
|
||||
}
|
||||
}
|
||||
@@ -1034,26 +1058,41 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
/* jump to buffer by number */
|
||||
|
||||
error = NULL;
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
if (argv[0][0] == '-')
|
||||
{
|
||||
if (!gui_switch_to_buffer_by_number (gui_current_window, (int) number))
|
||||
/* relative jump '-' */
|
||||
error = NULL;
|
||||
number = strtol (argv[0] + 1, &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s buffer \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[0], "buffer");
|
||||
return -1;
|
||||
target_buffer = gui_current_window->buffer->number - (int) number;
|
||||
if (target_buffer < 1)
|
||||
target_buffer = (last_gui_buffer) ? last_gui_buffer->number + target_buffer : 1;
|
||||
gui_switch_to_buffer_by_number (gui_current_window,
|
||||
target_buffer);
|
||||
}
|
||||
}
|
||||
else if (argv[0][0] == '+')
|
||||
{
|
||||
/* relative jump '+' */
|
||||
error = NULL;
|
||||
number = strtol (argv[0] + 1, &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
target_buffer = gui_current_window->buffer->number + (int) number;
|
||||
if (last_gui_buffer && target_buffer > last_gui_buffer->number)
|
||||
target_buffer -= last_gui_buffer->number;
|
||||
gui_switch_to_buffer_by_number (gui_current_window,
|
||||
target_buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s incorrect buffer number\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
/* absolute jump by number */
|
||||
error = NULL;
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
gui_switch_to_buffer_by_number (gui_current_window, (int) number);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1163,7 +1202,7 @@ weechat_cmd_debug (int argc, char **argv)
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "perl");
|
||||
WEECHAT_ERROR, "debug");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1307,6 +1346,139 @@ weechat_cmd_help (int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_key_display: display a key binding
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_cmd_key_display (t_gui_key *key, int new_key)
|
||||
{
|
||||
char *expanded_name;
|
||||
|
||||
expanded_name = gui_key_get_expanded_name (key->key);
|
||||
if (new_key)
|
||||
{
|
||||
gui_printf (NULL, _("New key binding:\n"));
|
||||
gui_printf (NULL, " %s", (expanded_name) ? expanded_name : key->key);
|
||||
}
|
||||
else
|
||||
gui_printf (NULL, " %20s", (expanded_name) ? expanded_name : key->key);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, " => ");
|
||||
gui_printf (NULL, "%s\n",
|
||||
(key->function) ?
|
||||
gui_key_function_search_by_ptr (key->function) : key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_key: bind/unbind keys
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_key (char *arguments)
|
||||
{
|
||||
char *pos;
|
||||
int i;
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
if (arguments)
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
}
|
||||
|
||||
if (!arguments || (arguments[0] == '\0'))
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("Key bindings:\n"));
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
weechat_cmd_key_display (ptr_key, 0);
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "unbind ", 7) == 0)
|
||||
{
|
||||
arguments += 7;
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (gui_key_unbind (arguments))
|
||||
gui_printf (NULL, _("Key \"%s\" unbinded\n"), arguments);
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to unbind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, arguments);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp (arguments, "functions") == 0)
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("Internal key functions:\n"));
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
gui_printf (NULL, "%25s %s\n",
|
||||
gui_key_functions[i].function_name,
|
||||
_(gui_key_functions[i].description));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "reset", 5) == 0)
|
||||
{
|
||||
arguments += 5;
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (strcasecmp (arguments, "-yes") == 0)
|
||||
{
|
||||
gui_key_free_all ();
|
||||
gui_key_init ();
|
||||
gui_printf (NULL, _("Default key bindings restored\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s \"-yes\" argument is required for keys reset (securuty reason)\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
pos = strchr (arguments, ' ');
|
||||
if (!pos)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s wrong argument count for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "key");
|
||||
return -1;
|
||||
}
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
ptr_key = gui_key_bind (arguments, pos);
|
||||
if (ptr_key)
|
||||
weechat_cmd_key_display (ptr_key, 1);
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to bind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, arguments);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_perl: list/load/unload Perl scripts
|
||||
*/
|
||||
@@ -1554,7 +1726,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 +1923,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 +2014,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);
|
||||
@@ -1872,11 +2049,11 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_set_cmd_display_option: display config option
|
||||
* weechat_cmd_set_display_option: display config option
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_set_cmd_display_option (t_config_option *option, char *prefix, void *value)
|
||||
weechat_cmd_set_display_option (t_config_option *option, char *prefix, void *value)
|
||||
{
|
||||
char *color_name, *pos_nickserv, *pos_pwd, *value2;
|
||||
|
||||
@@ -2019,7 +2196,7 @@ weechat_cmd_set (char *arguments)
|
||||
{
|
||||
ptr_option_value = config_get_server_option_ptr (ptr_server,
|
||||
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
|
||||
weechat_set_cmd_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
weechat_cmd_set_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
ptr_server->name,
|
||||
ptr_option_value);
|
||||
}
|
||||
@@ -2060,7 +2237,7 @@ weechat_cmd_set (char *arguments)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s", config_get_section (ptr_option));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "]\n");
|
||||
weechat_set_cmd_display_option (ptr_option, NULL, NULL);
|
||||
weechat_cmd_set_display_option (ptr_option, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2084,7 +2261,8 @@ weechat_cmd_set (char *arguments)
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
section_displayed = 0;
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -2102,7 +2280,7 @@ weechat_cmd_set (char *arguments)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "]\n");
|
||||
section_displayed = 1;
|
||||
}
|
||||
weechat_set_cmd_display_option (&weechat_options[i][j], NULL, NULL);
|
||||
weechat_cmd_set_display_option (&weechat_options[i][j], NULL, NULL);
|
||||
number_found++;
|
||||
}
|
||||
}
|
||||
@@ -2135,7 +2313,7 @@ weechat_cmd_set (char *arguments)
|
||||
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
|
||||
if (ptr_option_value)
|
||||
{
|
||||
weechat_set_cmd_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
weechat_cmd_set_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
ptr_server->name,
|
||||
ptr_option_value);
|
||||
number_found++;
|
||||
@@ -2268,6 +2446,10 @@ weechat_cmd_window (int argc, char **argv)
|
||||
else
|
||||
gui_window_merge_auto (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "-1") == 0)
|
||||
gui_switch_to_previous_window ();
|
||||
else if (strcasecmp (argv[0], "+1") == 0)
|
||||
gui_switch_to_next_window ();
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
|
||||
@@ -69,6 +69,7 @@ extern int weechat_cmd_connect (int, char **);
|
||||
extern int weechat_cmd_debug (int, char **);
|
||||
extern int weechat_cmd_disconnect (int, char **);
|
||||
extern int weechat_cmd_help (int, char **);
|
||||
extern int weechat_cmd_key (char *);
|
||||
extern int weechat_cmd_perl (int, char **);
|
||||
extern int weechat_cmd_python (int, char **);
|
||||
extern int weechat_cmd_save (int, char **);
|
||||
|
||||
+114
-17
@@ -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], *string;
|
||||
t_weechat_alias *ptr_alias;
|
||||
t_config_option *option;
|
||||
void *option_value;
|
||||
char option_string[2048];
|
||||
|
||||
/* WeeChat internal commands */
|
||||
|
||||
@@ -193,6 +201,20 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "key") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"unbind");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"functions");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"reset");
|
||||
return;
|
||||
}
|
||||
if (((strcasecmp (completion->base_command, "perl") == 0)
|
||||
|| (strcasecmp (completion->base_command, "python") == 0))
|
||||
&& (completion->base_command_arg == 1))
|
||||
@@ -211,34 +233,97 @@ 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_KEYS) && (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] = ' ';
|
||||
}
|
||||
}
|
||||
else
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "unalias") == 0)
|
||||
@@ -339,6 +424,9 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"action");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"ping");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"version");
|
||||
@@ -439,9 +527,16 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
|| !((t_irc_channel *)channel)->topic[0])
|
||||
completion_stop (completion);
|
||||
else
|
||||
{
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
((t_irc_channel *)channel)->topic);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
((t_irc_channel *)channel)->topic);
|
||||
string);
|
||||
free (string);
|
||||
}
|
||||
}
|
||||
else
|
||||
completion_stop (completion);
|
||||
@@ -471,6 +566,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++;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
+3
-19
@@ -112,16 +112,8 @@ fifo_exec (char *text)
|
||||
if (text[0] == '*')
|
||||
{
|
||||
pos_msg = text + 1;
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
ptr_buffer = gui_current_window->buffer;
|
||||
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s invalid buffer for displaying text via FIFO pipe\n"),
|
||||
WEECHAT_WARNING);
|
||||
return;
|
||||
}
|
||||
ptr_buffer = (gui_current_window->buffer->has_input) ? gui_current_window->buffer : gui_buffers;
|
||||
ptr_server = SERVER(ptr_buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -172,20 +164,12 @@ fifo_exec (char *text)
|
||||
}
|
||||
}
|
||||
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s invalid text received on FIFO pipe\n"),
|
||||
WEECHAT_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ptr_buffer)
|
||||
{
|
||||
if (ptr_channel)
|
||||
ptr_buffer = ptr_channel->buffer;
|
||||
else
|
||||
ptr_buffer = ptr_server->buffer;
|
||||
ptr_buffer = gui_buffers;
|
||||
}
|
||||
|
||||
user_command (ptr_server, ptr_buffer, pos_msg);
|
||||
|
||||
@@ -23,12 +23,17 @@
|
||||
|
||||
#include "../irc/irc.h"
|
||||
|
||||
#define HOTLIST_LOW 0
|
||||
#define HOTLIST_MSG 1
|
||||
#define HOTLIST_PRIVATE 2
|
||||
#define HOTLIST_HIGHLIGHT 3
|
||||
|
||||
typedef struct t_weechat_hotlist t_weechat_hotlist;
|
||||
|
||||
struct t_weechat_hotlist
|
||||
{
|
||||
int priority; /* 0=crappy msg (join/part), 1=msg, */
|
||||
/* 2=nick highlight */
|
||||
/* 2=pv, 3=nick highlight */
|
||||
t_gui_buffer *buffer; /* associated buffer */
|
||||
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
|
||||
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
|
||||
|
||||
+100
-31
@@ -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
|
||||
|
||||
|
||||
/*
|
||||
@@ -305,6 +313,48 @@ void wee_display_commands (int weechat_cmd, int irc_cmd)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_key_functions: display WeeChat key functions
|
||||
*/
|
||||
|
||||
void wee_display_key_functions ()
|
||||
{
|
||||
int i;
|
||||
|
||||
printf (_("Internal key functions:\n"));
|
||||
printf ("\n");
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
printf ("* %s: %s\n",
|
||||
gui_key_functions[i].function_name,
|
||||
_(gui_key_functions[i].description));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_keys: display WeeChat default keys
|
||||
*/
|
||||
|
||||
void wee_display_keys ()
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name;
|
||||
|
||||
printf (_("%s default keys:\n"), PACKAGE_NAME);
|
||||
printf ("\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
printf ("* %s => %s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
(ptr_key->function) ? gui_key_function_search_by_ptr (ptr_key->function) : ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_parse_args: parse command line args
|
||||
*/
|
||||
@@ -323,40 +373,52 @@ wee_parse_args (int argc, char *argv[])
|
||||
|| (strcmp (argv[i], "--config") == 0))
|
||||
{
|
||||
wee_display_config_options ();
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-f") == 0)
|
||||
|| (strcmp (argv[i], "--key-functions") == 0))
|
||||
{
|
||||
wee_display_key_functions ();
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-h") == 0)
|
||||
|| (strcmp (argv[i], "--help") == 0))
|
||||
{
|
||||
printf ("\n" WEE_USAGE1, argv[0], argv[0]);
|
||||
printf ("%s", WEE_USAGE2);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
if ((strcmp (argv[i], "-i") == 0)
|
||||
else if ((strcmp (argv[i], "-i") == 0)
|
||||
|| (strcmp (argv[i], "--irc-commands") == 0))
|
||||
{
|
||||
wee_display_commands (0, 1);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-k") == 0)
|
||||
|| (strcmp (argv[i], "--keys") == 0))
|
||||
{
|
||||
wee_display_keys ();
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-l") == 0)
|
||||
|| (strcmp (argv[i], "--license") == 0))
|
||||
{
|
||||
printf ("\n%s%s", WEE_LICENSE);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-v") == 0)
|
||||
|| (strcmp (argv[i], "--version") == 0))
|
||||
{
|
||||
printf (PACKAGE_VERSION "\n");
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
if ((strcmp (argv[i], "-w") == 0)
|
||||
else if ((strcmp (argv[i], "-w") == 0)
|
||||
|| (strcmp (argv[i], "--weechat-commands") == 0))
|
||||
{
|
||||
wee_display_commands (1, 0);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
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 +431,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);
|
||||
@@ -429,7 +492,7 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s unable to get HOME directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
dir_length = strlen (ptr_home) + 10;
|
||||
weechat_home =
|
||||
@@ -438,7 +501,7 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s not enough memory for home directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
DIR_SEPARATOR);
|
||||
@@ -448,7 +511,7 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create ~/.weechat directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
|
||||
dir_length = strlen (weechat_home) + 64;
|
||||
@@ -516,6 +579,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
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -599,7 +669,7 @@ wee_gui_shutdown ()
|
||||
*/
|
||||
|
||||
void
|
||||
wee_shutdown (int return_code)
|
||||
wee_shutdown (int return_code, int crash)
|
||||
{
|
||||
fifo_remove ();
|
||||
if (weechat_home)
|
||||
@@ -609,7 +679,16 @@ wee_shutdown (int return_code)
|
||||
if (local_charset)
|
||||
free (local_charset);
|
||||
alias_free_all ();
|
||||
exit (return_code);
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
gnutls_certificate_free_credentials (gnutls_xcred);
|
||||
gnutls_global_deinit();
|
||||
#endif
|
||||
|
||||
if (crash)
|
||||
abort();
|
||||
else
|
||||
exit (return_code);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -699,17 +778,6 @@ wee_dump (int crash)
|
||||
wee_log_printf ("\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* my_sigint: SIGINT handler, do nothing (just ignore this signal)
|
||||
* Prevents user for exiting with Ctrl-C
|
||||
*/
|
||||
|
||||
void
|
||||
my_sigint ()
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
/*
|
||||
* my_sigsegv: SIGSEGV handler: save crash log to ~/.weechat/weechat.log and exit
|
||||
*/
|
||||
@@ -725,7 +793,7 @@ my_sigsegv ()
|
||||
fprintf (stderr, "*** Please send this file to WeeChat developers.\n");
|
||||
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
|
||||
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -745,10 +813,11 @@ main (int argc, char *argv[])
|
||||
local_charset = strdup (nl_langinfo (CODESET));
|
||||
#endif
|
||||
|
||||
signal (SIGINT, my_sigint); /* ignore SIGINT signal */
|
||||
signal (SIGINT, SIG_IGN); /* ignore SIGINT signal */
|
||||
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */
|
||||
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */
|
||||
wee_init_vars (); /* initialize some variables */
|
||||
gui_key_init (); /* init keyboard (default key bindings) */
|
||||
wee_parse_args (argc, argv); /* parse command line args */
|
||||
wee_create_home_dirs (); /* create WeeChat directories */
|
||||
wee_init_log (); /* init log file */
|
||||
@@ -783,7 +852,7 @@ main (int argc, char *argv[])
|
||||
(void) config_write (NULL); /* save config file */
|
||||
command_index_free (); /* free commands index */
|
||||
wee_gui_shutdown (); /* shut down WeeChat GUI */
|
||||
wee_shutdown (EXIT_SUCCESS); /* quit WeeChat (oh no, why?) */
|
||||
wee_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */
|
||||
|
||||
return EXIT_SUCCESS; /* make gcc happy (never executed) */
|
||||
}
|
||||
|
||||
+13
-3
@@ -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,12 +86,14 @@
|
||||
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" \
|
||||
" -h, --help this help screen\n" \
|
||||
" -f, --key-functions display WeeChat internal functions for keys\n" \
|
||||
" -h, --help this help\n" \
|
||||
" -i, --irc-commands display IRC commands\n" \
|
||||
" -k, --keys display WeeChat default keys\n" \
|
||||
" -l, --license display WeeChat license\n" \
|
||||
" -v, --version display WeeChat version\n" \
|
||||
" -w, --weechat-commands display WeeChat commands\n\n"
|
||||
@@ -108,10 +114,14 @@ 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 *);
|
||||
extern long get_timeval_diff (struct timeval *, struct timeval *);
|
||||
extern void wee_shutdown (int);
|
||||
extern void wee_shutdown (int, int);
|
||||
|
||||
#endif /* weechat.h */
|
||||
|
||||
+246
-29
@@ -53,6 +53,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
|
||||
{ CONFIG_SECTION_IRC, "irc" },
|
||||
{ CONFIG_SECTION_DCC, "dcc" },
|
||||
{ CONFIG_SECTION_PROXY, "proxy" },
|
||||
{ CONFIG_SECTION_KEYS, "keys" },
|
||||
{ CONFIG_SECTION_ALIAS, "alias" },
|
||||
{ CONFIG_SECTION_SERVER, "server" }
|
||||
};
|
||||
@@ -82,6 +83,7 @@ char *cfg_look_no_nickname;
|
||||
char *cfg_look_completor;
|
||||
int cfg_look_infobar;
|
||||
char *cfg_look_infobar_timestamp;
|
||||
int cfg_look_infobar_seconds;
|
||||
int cfg_look_infobar_delay_highlight;
|
||||
|
||||
t_config_option weechat_options_look[] =
|
||||
@@ -170,7 +172,11 @@ t_config_option weechat_options_look[] =
|
||||
{ "look_infobar_timestamp", N_("timestamp for time in infobar"),
|
||||
N_("timestamp for time in infobar"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"%B, %A %d %Y - %H:%M", NULL, NULL, &cfg_look_infobar_timestamp, config_change_buffer_content },
|
||||
"%B, %A %d %Y", NULL, NULL, &cfg_look_infobar_timestamp, config_change_buffer_content },
|
||||
{ "look_infobar_seconds", N_("display seconds in infobar time"),
|
||||
N_("display seconds in infobar time"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_infobar_seconds, NULL, config_change_buffer_content },
|
||||
{ "look_infobar_delay_highlight", N_("delay (in seconds) for highlight messages in infobar"),
|
||||
N_("delay (in seconds) for highlight messages in infobar "
|
||||
"(0 = disable highlight notifications in infobar)"),
|
||||
@@ -188,6 +194,8 @@ int cfg_col_chat_time;
|
||||
int cfg_col_chat_time_sep;
|
||||
int cfg_col_chat_prefix1;
|
||||
int cfg_col_chat_prefix2;
|
||||
int cfg_col_chat_join;
|
||||
int cfg_col_chat_part;
|
||||
int cfg_col_chat_nick;
|
||||
int cfg_col_chat_host;
|
||||
int cfg_col_chat_channel;
|
||||
@@ -197,11 +205,13 @@ int cfg_col_chat_bg;
|
||||
int cfg_col_status;
|
||||
int cfg_col_status_delimiters;
|
||||
int cfg_col_status_data_msg;
|
||||
int cfg_col_status_data_private;
|
||||
int cfg_col_status_data_highlight;
|
||||
int cfg_col_status_data_other;
|
||||
int cfg_col_status_more;
|
||||
int cfg_col_status_bg;
|
||||
int cfg_col_infobar;
|
||||
int cfg_col_infobar_delimiters;
|
||||
int cfg_col_infobar_highlight;
|
||||
int cfg_col_infobar_bg;
|
||||
int cfg_col_input;
|
||||
@@ -260,6 +270,14 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for middle char of prefix"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"white", NULL, &cfg_col_chat_prefix2, NULL, &config_change_color },
|
||||
{ "col_chat_join", N_("color for join arrow (prefix)"),
|
||||
N_("color for join arrow (prefix)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightgreen", NULL, &cfg_col_chat_join, NULL, &config_change_color },
|
||||
{ "col_chat_part", N_("color for part/quit arrow (prefix)"),
|
||||
N_("color for part/quit arrow (prefix)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightred", NULL, &cfg_col_chat_part, NULL, &config_change_color },
|
||||
{ "col_chat_nick", N_("color for nicks in actions"),
|
||||
N_("color for nicks in actions (chat window)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -298,10 +316,14 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for window with new messages (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"yellow", NULL, &cfg_col_status_data_msg, NULL, &config_change_color },
|
||||
{ "col_status_private", N_("color for window with private message"),
|
||||
N_("color for window with private message (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightmagenta", NULL, &cfg_col_status_data_private, NULL, &config_change_color },
|
||||
{ "col_status_highlight", N_("color for window with highlight"),
|
||||
N_("color for window with highlight (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightmagenta", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
|
||||
"lightred", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
|
||||
{ "col_status_data_other", N_("color for window with new data (not messages)"),
|
||||
N_("color for window with new data (not messages) (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -320,6 +342,10 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for info bar text"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"black", NULL, &cfg_col_infobar, NULL, &config_change_color },
|
||||
{ "col_infobar_delimiters", N_("color for infobar delimiters"),
|
||||
N_("color for infobar delimiters"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"blue", NULL, &cfg_col_infobar_delimiters, NULL, &config_change_color },
|
||||
{ "col_infobar_highlight", N_("color for info bar highlight notification"),
|
||||
N_("color for info bar highlight notification"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -501,6 +527,7 @@ int cfg_irc_lag_check;
|
||||
int cfg_irc_lag_min_show;
|
||||
int cfg_irc_lag_disconnect;
|
||||
int cfg_irc_fifo_pipe;
|
||||
char *cfg_irc_highlight;
|
||||
|
||||
t_config_option weechat_options_irc[] =
|
||||
{ { "irc_display_away", N_("display message to all channels when away"),
|
||||
@@ -514,7 +541,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,
|
||||
@@ -539,6 +566,10 @@ t_config_option weechat_options_irc[] =
|
||||
N_("create a FIFO pipe for remote control"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &cfg_irc_fifo_pipe, NULL, config_change_fifo_pipe },
|
||||
{ "irc_highlight", N_("list of words to highlight"),
|
||||
N_("comma separated list of words to highlight (case insensitive comparison)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_irc_highlight, config_change_noop },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -597,8 +628,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 +642,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 +698,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 +746,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 }
|
||||
};
|
||||
|
||||
@@ -698,7 +758,7 @@ t_config_option weechat_options_server[] =
|
||||
t_config_option *weechat_options[CONFIG_NUMBER_SECTIONS] =
|
||||
{ weechat_options_look, weechat_options_colors, weechat_options_history,
|
||||
weechat_options_log, weechat_options_irc, weechat_options_dcc,
|
||||
weechat_options_proxy, NULL, weechat_options_server
|
||||
weechat_options_proxy, NULL, NULL, weechat_options_server
|
||||
};
|
||||
|
||||
|
||||
@@ -734,7 +794,8 @@ config_get_section (t_config_option *ptr_option)
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -834,6 +895,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 +977,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 +1001,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 +1072,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;
|
||||
}
|
||||
|
||||
@@ -1003,7 +1089,8 @@ config_option_search (char *option_name)
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -1017,6 +1104,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 +1221,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,
|
||||
@@ -1099,7 +1253,8 @@ config_default_values ()
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -1254,8 +1409,22 @@ config_read ()
|
||||
if (pos2 != NULL)
|
||||
pos2[0] = '\0';
|
||||
|
||||
if (section == CONFIG_SECTION_ALIAS)
|
||||
if (section == CONFIG_SECTION_KEYS)
|
||||
{
|
||||
if (pos[0])
|
||||
{
|
||||
/* bind key (overwrite any binding with same key) */
|
||||
gui_key_bind (line, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* unbin key if no value given */
|
||||
gui_key_unbind (line);
|
||||
}
|
||||
}
|
||||
else if (section == CONFIG_SECTION_ALIAS)
|
||||
{
|
||||
/* create new alias */
|
||||
if (alias_new (line, pos))
|
||||
weelist_add (&index_commands, &last_index_command, line);
|
||||
}
|
||||
@@ -1372,6 +1541,8 @@ config_create_default ()
|
||||
time_t current_time;
|
||||
struct passwd *my_passwd;
|
||||
char *realname, *pos;
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name, *function_name;
|
||||
|
||||
filename_length = strlen (weechat_home) + 64;
|
||||
filename =
|
||||
@@ -1399,13 +1570,10 @@ config_create_default ()
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (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)
|
||||
@@ -1433,6 +1601,27 @@ config_create_default ()
|
||||
}
|
||||
}
|
||||
|
||||
/* default key bindings */
|
||||
fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
if (ptr_key->function)
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
}
|
||||
else
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/* default aliases */
|
||||
/* TODO: remove comments when missing commands will be ok */
|
||||
fprintf (file, "\n[alias]\n");
|
||||
@@ -1443,20 +1632,20 @@ config_create_default ()
|
||||
fprintf (file, "C=clear\n");
|
||||
fprintf (file, "CL=clear\n");
|
||||
fprintf (file, "CLOSE=buffer close\n");
|
||||
fprintf (file, "# CHAT=dcc chat\n");
|
||||
fprintf (file, "CHAT=dcc chat\n");
|
||||
fprintf (file, "# GET=dcc get\n");
|
||||
fprintf (file, "# IG=ignore\n");
|
||||
fprintf (file, "J=join\n");
|
||||
fprintf (file, "K=kick\n");
|
||||
fprintf (file, "# KB=kickban\n");
|
||||
fprintf (file, "KB=kickban\n");
|
||||
fprintf (file, "# KN=knockout\n");
|
||||
fprintf (file, "LEAVE=part\n");
|
||||
fprintf (file, "M=msg\n");
|
||||
fprintf (file, "# MUB=unban *\n");
|
||||
fprintf (file, "MUB=unban *\n");
|
||||
fprintf (file, "N=names\n");
|
||||
fprintf (file, "Q=query\n");
|
||||
fprintf (file, "T=topic\n");
|
||||
fprintf (file, "# UB=unban\n");
|
||||
fprintf (file, "UB=unban\n");
|
||||
fprintf (file, "# UNIG=unignore\n");
|
||||
fprintf (file, "W=who\n");
|
||||
fprintf (file, "WC=part\n");
|
||||
@@ -1471,6 +1660,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 */
|
||||
@@ -1539,6 +1730,8 @@ config_write (char *config_name)
|
||||
time_t current_time;
|
||||
t_irc_server *ptr_server;
|
||||
t_weechat_alias *ptr_alias;
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name, *function_name;
|
||||
|
||||
if (config_name)
|
||||
filename = strdup (config_name);
|
||||
@@ -1571,13 +1764,10 @@ config_write (char *config_name)
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (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)
|
||||
@@ -1622,6 +1812,27 @@ config_write (char *config_name)
|
||||
}
|
||||
}
|
||||
|
||||
/* keys section */
|
||||
fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
if (ptr_key->function)
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
}
|
||||
else
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/* alias section */
|
||||
fprintf (file, "\n[alias]\n");
|
||||
for (ptr_alias = weechat_alias; ptr_alias;
|
||||
@@ -1647,6 +1858,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 +1876,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 : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-3
@@ -33,9 +33,10 @@
|
||||
#define CONFIG_SECTION_IRC 4
|
||||
#define CONFIG_SECTION_DCC 5
|
||||
#define CONFIG_SECTION_PROXY 6
|
||||
#define CONFIG_SECTION_ALIAS 7
|
||||
#define CONFIG_SECTION_SERVER 8
|
||||
#define CONFIG_NUMBER_SECTIONS 9
|
||||
#define CONFIG_SECTION_KEYS 7
|
||||
#define CONFIG_SECTION_ALIAS 8
|
||||
#define CONFIG_SECTION_SERVER 9
|
||||
#define CONFIG_NUMBER_SECTIONS 10
|
||||
|
||||
#define OPTION_TYPE_BOOLEAN 1 /* values: on/off */
|
||||
#define OPTION_TYPE_INT 2 /* values: from min to max */
|
||||
@@ -97,6 +98,7 @@ extern char *cfg_look_no_nickname;
|
||||
extern char *cfg_look_completor;
|
||||
extern int cfg_look_infobar;
|
||||
extern char *cfg_look_infobar_timestamp;
|
||||
extern int cfg_look_infobar_seconds;
|
||||
extern int cfg_look_infobar_delay_highlight;
|
||||
|
||||
extern int cfg_col_title;
|
||||
@@ -106,6 +108,8 @@ extern int cfg_col_chat_time;
|
||||
extern int cfg_col_chat_time_sep;
|
||||
extern int cfg_col_chat_prefix1;
|
||||
extern int cfg_col_chat_prefix2;
|
||||
extern int cfg_col_chat_join;
|
||||
extern int cfg_col_chat_part;
|
||||
extern int cfg_col_chat_nick;
|
||||
extern int cfg_col_chat_host;
|
||||
extern int cfg_col_chat_channel;
|
||||
@@ -115,11 +119,13 @@ extern int cfg_col_chat_bg;
|
||||
extern int cfg_col_status;
|
||||
extern int cfg_col_status_delimiters;
|
||||
extern int cfg_col_status_data_msg;
|
||||
extern int cfg_col_status_data_private;
|
||||
extern int cfg_col_status_data_highlight;
|
||||
extern int cfg_col_status_data_other;
|
||||
extern int cfg_col_status_more;
|
||||
extern int cfg_col_status_bg;
|
||||
extern int cfg_col_infobar;
|
||||
extern int cfg_col_infobar_delimiters;
|
||||
extern int cfg_col_infobar_highlight;
|
||||
extern int cfg_col_infobar_bg;
|
||||
extern int cfg_col_input;
|
||||
@@ -166,6 +172,7 @@ extern int cfg_irc_lag_check;
|
||||
extern int cfg_irc_lag_min_show;
|
||||
extern int cfg_irc_lag_disconnect;
|
||||
extern int cfg_irc_fifo_pipe;
|
||||
extern char *cfg_irc_highlight;
|
||||
|
||||
extern int cfg_dcc_auto_accept_files;
|
||||
extern int cfg_dcc_auto_accept_chats;
|
||||
@@ -178,8 +185,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 +204,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 *);
|
||||
|
||||
@@ -20,6 +20,7 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
noinst_LIBRARIES = lib_weechat_gui_common.a
|
||||
|
||||
lib_weechat_gui_common_a_SOURCES = gui-common.c \
|
||||
gui-keyboard.c \
|
||||
gui.h
|
||||
|
||||
if GUI_NCURSES
|
||||
|
||||
@@ -19,11 +19,12 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
bin_PROGRAMS = weechat-curses
|
||||
|
||||
weechat_curses_LDADD = ../lib_weechat_gui_common.a \
|
||||
weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
|
||||
../../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
|
||||
gui-input.c
|
||||
|
||||
+298
-306
@@ -318,7 +318,7 @@ gui_draw_window_separator (t_gui_window *window)
|
||||
window->win_x - 1);
|
||||
gui_window_set_color (window->win_separator, COLOR_WIN_TITLE);
|
||||
wborder (window->win_separator, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
|
||||
wrefresh (window->win_separator);
|
||||
wnoutrefresh (window->win_separator);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
@@ -341,15 +341,9 @@ gui_draw_buffer_title (t_gui_buffer *buffer, int erase)
|
||||
if (ptr_win->buffer == buffer)
|
||||
{
|
||||
if (erase)
|
||||
gui_curses_window_clear (ptr_win->win_title);
|
||||
gui_curses_window_clear (ptr_win->win_title);
|
||||
|
||||
if (has_colors ())
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_title, COLOR_WIN_TITLE);
|
||||
wborder (ptr_win->win_title, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
|
||||
wrefresh (ptr_win->win_title);
|
||||
refresh ();
|
||||
}
|
||||
gui_window_set_color (ptr_win->win_title, COLOR_WIN_TITLE);
|
||||
snprintf (format, 32, "%%-%ds", ptr_win->win_width);
|
||||
if (CHANNEL(buffer))
|
||||
{
|
||||
@@ -362,6 +356,8 @@ gui_draw_buffer_title (t_gui_buffer *buffer, int erase)
|
||||
mvwprintw (ptr_win->win_title, 0, 0, format, buf);
|
||||
free (buf);
|
||||
}
|
||||
else
|
||||
mvwprintw (ptr_win->win_title, 0, 0, format, " ");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -372,8 +368,10 @@ gui_draw_buffer_title (t_gui_buffer *buffer, int erase)
|
||||
PACKAGE_STRING " " WEECHAT_COPYRIGHT_DATE " - "
|
||||
WEECHAT_WEBSITE);
|
||||
}
|
||||
else
|
||||
mvwprintw (ptr_win->win_title, 0, 0, format, " ");
|
||||
}
|
||||
wrefresh (ptr_win->win_title);
|
||||
wnoutrefresh (ptr_win->win_title);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
@@ -860,7 +858,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
|
||||
ptr_win->win_chat_cursor_y = ptr_win->win_chat_height - 1;
|
||||
}
|
||||
}
|
||||
wrefresh (ptr_win->win_chat);
|
||||
wnoutrefresh (ptr_win->win_chat);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
@@ -1058,7 +1056,7 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
|
||||
}
|
||||
}
|
||||
}
|
||||
wrefresh (ptr_win->win_nick);
|
||||
wnoutrefresh (ptr_win->win_nick);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
@@ -1084,15 +1082,14 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (has_colors ())
|
||||
wbkgdset(ptr_win->win_status, ' ' | COLOR_PAIR (COLOR_WIN_STATUS));
|
||||
|
||||
if (erase)
|
||||
gui_curses_window_clear (ptr_win->win_status);
|
||||
|
||||
if (has_colors ())
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
wborder (ptr_win->win_status, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
|
||||
wrefresh (ptr_win->win_status);
|
||||
}
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
/* wborder (ptr_win->win_status, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '); */
|
||||
wmove (ptr_win->win_status, 0, 0);
|
||||
|
||||
/* display number of buffers */
|
||||
@@ -1223,18 +1220,21 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
}
|
||||
if (!SERVER(ptr_win->buffer))
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, "%d",
|
||||
ptr_win->buffer->number);
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (ptr_win->win_status, ":");
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
if (ptr_win->buffer->dcc)
|
||||
wprintw (ptr_win->win_status, "%d:<DCC> ",
|
||||
ptr_win->buffer->number);
|
||||
wprintw (ptr_win->win_status, "<DCC> ");
|
||||
else
|
||||
{
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("%d:[not connected] "));
|
||||
wprintw (ptr_win->win_status, string,
|
||||
ptr_win->buffer->number);
|
||||
_("[not connected]"));
|
||||
wprintw (ptr_win->win_status, "%s " , string);
|
||||
free (string);
|
||||
}
|
||||
}
|
||||
@@ -1257,15 +1257,19 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
{
|
||||
switch (ptr_hotlist->priority)
|
||||
{
|
||||
case 0:
|
||||
case HOTLIST_LOW:
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS_DATA_OTHER);
|
||||
break;
|
||||
case 1:
|
||||
case HOTLIST_MSG:
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS_DATA_MSG);
|
||||
break;
|
||||
case 2:
|
||||
case HOTLIST_PRIVATE:
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS_DATA_PRIVATE);
|
||||
break;
|
||||
case HOTLIST_HIGHLIGHT:
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS_DATA_HIGHLIGHT);
|
||||
break;
|
||||
@@ -1328,7 +1332,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))
|
||||
@@ -1344,11 +1348,48 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
}
|
||||
free (string);
|
||||
|
||||
wrefresh (ptr_win->win_status);
|
||||
wnoutrefresh (ptr_win->win_status);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_buffer_infobar_time: draw time in infobar window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_draw_buffer_infobar_time (t_gui_buffer *buffer)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
time_t time_seconds;
|
||||
struct tm *local_time;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) buffer;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
time_seconds = time (NULL);
|
||||
local_time = localtime (&time_seconds);
|
||||
if (local_time)
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
|
||||
mvwprintw (ptr_win->win_infobar,
|
||||
0, 1,
|
||||
"%02d:%02d",
|
||||
local_time->tm_hour, local_time->tm_min);
|
||||
if (cfg_look_infobar_seconds)
|
||||
wprintw (ptr_win->win_infobar,
|
||||
":%02d",
|
||||
local_time->tm_sec);
|
||||
}
|
||||
wnoutrefresh (ptr_win->win_infobar);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_buffer_infobar: draw infobar window for a buffer
|
||||
*/
|
||||
@@ -1369,15 +1410,14 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (has_colors ())
|
||||
wbkgdset(ptr_win->win_infobar, ' ' | COLOR_PAIR (COLOR_WIN_INFOBAR));
|
||||
|
||||
if (erase)
|
||||
gui_curses_window_clear (ptr_win->win_infobar);
|
||||
|
||||
if (has_colors ())
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
|
||||
wborder (ptr_win->win_infobar, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
|
||||
wrefresh (ptr_win->win_infobar);
|
||||
}
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
|
||||
/* wborder (ptr_win->win_infobar, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '); */
|
||||
wmove (ptr_win->win_infobar, 0, 0);
|
||||
|
||||
time_seconds = time (NULL);
|
||||
@@ -1385,16 +1425,31 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
|
||||
if (local_time)
|
||||
{
|
||||
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
|
||||
wprintw (ptr_win->win_infobar, "[");
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
|
||||
wprintw (ptr_win->win_infobar, "%s", text_time);
|
||||
wprintw (ptr_win->win_infobar,
|
||||
"%02d:%02d",
|
||||
local_time->tm_hour, local_time->tm_min);
|
||||
if (cfg_look_infobar_seconds)
|
||||
wprintw (ptr_win->win_infobar,
|
||||
":%02d",
|
||||
local_time->tm_sec);
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
|
||||
wprintw (ptr_win->win_infobar, "]");
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
|
||||
wprintw (ptr_win->win_infobar,
|
||||
" %s", text_time);
|
||||
}
|
||||
if (gui_infobar)
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
|
||||
wprintw (ptr_win->win_infobar, " | ");
|
||||
gui_window_set_color (ptr_win->win_infobar, gui_infobar->color);
|
||||
wprintw (ptr_win->win_infobar, " | %s", gui_infobar->text);
|
||||
wprintw (ptr_win->win_infobar, "%s", gui_infobar->text);
|
||||
}
|
||||
|
||||
wrefresh (ptr_win->win_infobar);
|
||||
wnoutrefresh (ptr_win->win_infobar);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
@@ -1445,87 +1500,89 @@ gui_draw_buffer_input (t_gui_buffer *buffer, int erase)
|
||||
{
|
||||
gui_window_set_color (ptr_win->win_input, COLOR_WIN_INPUT);
|
||||
wborder (ptr_win->win_input, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
|
||||
wrefresh (ptr_win->win_input);
|
||||
wnoutrefresh (ptr_win->win_input);
|
||||
}
|
||||
|
||||
if (buffer->input_buffer_size == 0)
|
||||
buffer->input_buffer[0] = '\0';
|
||||
|
||||
input_width = gui_get_input_width (ptr_win);
|
||||
|
||||
if (buffer->input_buffer_pos - buffer->input_buffer_1st_display + 1 >
|
||||
input_width)
|
||||
buffer->input_buffer_1st_display = buffer->input_buffer_pos -
|
||||
input_width + 1;
|
||||
else
|
||||
if (buffer->dcc)
|
||||
{
|
||||
if (buffer->input_buffer_pos < buffer->input_buffer_1st_display)
|
||||
buffer->input_buffer_1st_display = buffer->input_buffer_pos;
|
||||
else
|
||||
dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : dcc_list;
|
||||
wmove (ptr_win->win_input, 0, 0);
|
||||
if (dcc_selected)
|
||||
{
|
||||
if ((buffer->input_buffer_1st_display > 0) &&
|
||||
(buffer->input_buffer_pos -
|
||||
buffer->input_buffer_1st_display + 1) < input_width)
|
||||
switch (dcc_selected->status)
|
||||
{
|
||||
buffer->input_buffer_1st_display =
|
||||
buffer->input_buffer_pos - input_width + 1;
|
||||
if (buffer->input_buffer_1st_display < 0)
|
||||
buffer->input_buffer_1st_display = 0;
|
||||
case DCC_WAITING:
|
||||
if (DCC_IS_RECV(dcc_selected->type))
|
||||
wprintw (ptr_win->win_input, _(" [A] Accept"));
|
||||
wprintw (ptr_win->win_input, _(" [C] Cancel"));
|
||||
break;
|
||||
case DCC_CONNECTING:
|
||||
case DCC_ACTIVE:
|
||||
wprintw (ptr_win->win_input, _(" [C] Cancel"));
|
||||
break;
|
||||
case DCC_DONE:
|
||||
case DCC_FAILED:
|
||||
case DCC_ABORTED:
|
||||
wprintw (ptr_win->win_input, _(" [R] Remove"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CHANNEL(buffer))
|
||||
{
|
||||
snprintf (format, 32, "%%s %%s> %%-%ds", input_width);
|
||||
if (ptr_win == gui_current_window)
|
||||
mvwprintw (ptr_win->win_input, 0, 0, format,
|
||||
CHANNEL(buffer)->name,
|
||||
SERVER(buffer)->nick,
|
||||
buffer->input_buffer + buffer->input_buffer_1st_display);
|
||||
else
|
||||
mvwprintw (ptr_win->win_input, 0, 0, format,
|
||||
CHANNEL(buffer)->name,
|
||||
SERVER(buffer)->nick,
|
||||
"");
|
||||
wprintw (ptr_win->win_input, _(" [P] Purge old DCC"));
|
||||
wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
|
||||
wclrtoeol (ptr_win->win_input);
|
||||
ptr_win->win_input_x = 0;
|
||||
if (ptr_win == gui_current_window)
|
||||
move (ptr_win->win_y + ptr_win->win_height - 1,
|
||||
ptr_win->win_x + strlen (CHANNEL(buffer)->name) +
|
||||
strlen (SERVER(buffer)->nick) + 3 +
|
||||
(buffer->input_buffer_pos - buffer->input_buffer_1st_display));
|
||||
ptr_win->win_x);
|
||||
}
|
||||
else
|
||||
else if (buffer->has_input)
|
||||
{
|
||||
if (buffer->dcc)
|
||||
if (buffer->input_buffer_size == 0)
|
||||
buffer->input_buffer[0] = '\0';
|
||||
|
||||
input_width = gui_get_input_width (ptr_win);
|
||||
|
||||
if (buffer->input_buffer_pos - buffer->input_buffer_1st_display + 1 >
|
||||
input_width)
|
||||
buffer->input_buffer_1st_display = buffer->input_buffer_pos -
|
||||
input_width + 1;
|
||||
else
|
||||
{
|
||||
dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : dcc_list;
|
||||
wmove (ptr_win->win_input, 0, 0);
|
||||
if (dcc_selected)
|
||||
if (buffer->input_buffer_pos < buffer->input_buffer_1st_display)
|
||||
buffer->input_buffer_1st_display = buffer->input_buffer_pos;
|
||||
else
|
||||
{
|
||||
switch (dcc_selected->status)
|
||||
if ((buffer->input_buffer_1st_display > 0) &&
|
||||
(buffer->input_buffer_pos -
|
||||
buffer->input_buffer_1st_display + 1) < input_width)
|
||||
{
|
||||
case DCC_WAITING:
|
||||
if (DCC_IS_RECV(dcc_selected->type))
|
||||
wprintw (ptr_win->win_input, _(" [A] Accept"));
|
||||
wprintw (ptr_win->win_input, _(" [C] Cancel"));
|
||||
break;
|
||||
case DCC_CONNECTING:
|
||||
case DCC_ACTIVE:
|
||||
wprintw (ptr_win->win_input, _(" [C] Cancel"));
|
||||
break;
|
||||
case DCC_DONE:
|
||||
case DCC_FAILED:
|
||||
case DCC_ABORTED:
|
||||
wprintw (ptr_win->win_input, _(" [R] Remove"));
|
||||
break;
|
||||
buffer->input_buffer_1st_display =
|
||||
buffer->input_buffer_pos - input_width + 1;
|
||||
if (buffer->input_buffer_1st_display < 0)
|
||||
buffer->input_buffer_1st_display = 0;
|
||||
}
|
||||
}
|
||||
wprintw (ptr_win->win_input, _(" [P] Purge old DCC"));
|
||||
wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
|
||||
}
|
||||
if (CHANNEL(buffer))
|
||||
{
|
||||
snprintf (format, 32, "%%s %%s> %%-%ds", input_width);
|
||||
if (ptr_win == gui_current_window)
|
||||
mvwprintw (ptr_win->win_input, 0, 0, format,
|
||||
CHANNEL(buffer)->name,
|
||||
SERVER(buffer)->nick,
|
||||
buffer->input_buffer + buffer->input_buffer_1st_display);
|
||||
else
|
||||
mvwprintw (ptr_win->win_input, 0, 0, format,
|
||||
CHANNEL(buffer)->name,
|
||||
SERVER(buffer)->nick,
|
||||
"");
|
||||
wclrtoeol (ptr_win->win_input);
|
||||
ptr_win->win_input_x = strlen (CHANNEL(buffer)->name) +
|
||||
strlen (SERVER(buffer)->nick) + 3 +
|
||||
(buffer->input_buffer_pos - buffer->input_buffer_1st_display);
|
||||
if (ptr_win == gui_current_window)
|
||||
move (ptr_win->win_y + ptr_win->win_height - 1,
|
||||
ptr_win->win_x);
|
||||
ptr_win->win_x + ptr_win->win_input_x);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1543,14 +1600,15 @@ gui_draw_buffer_input (t_gui_buffer *buffer, int erase)
|
||||
ptr_nickname,
|
||||
"");
|
||||
wclrtoeol (ptr_win->win_input);
|
||||
ptr_win->win_input_x = strlen (ptr_nickname) + 2 +
|
||||
(buffer->input_buffer_pos - buffer->input_buffer_1st_display);
|
||||
if (ptr_win == gui_current_window)
|
||||
move (ptr_win->win_y + ptr_win->win_height - 1,
|
||||
ptr_win->win_x + strlen (ptr_nickname) + 2 +
|
||||
(buffer->input_buffer_pos - buffer->input_buffer_1st_display));
|
||||
ptr_win->win_x + ptr_win->win_input_x);
|
||||
}
|
||||
}
|
||||
|
||||
wrefresh (ptr_win->win_input);
|
||||
wnoutrefresh (ptr_win->win_input);
|
||||
refresh ();
|
||||
}
|
||||
}
|
||||
@@ -1701,242 +1759,143 @@ gui_get_dcc_buffer ()
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_dcc_buffer: switch to dcc buffer (create it if it does not exist)
|
||||
* gui_input_page_up: display previous page on buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_dcc_buffer ()
|
||||
gui_input_page_up ()
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
/* check if dcc buffer exists */
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
if (!gui_current_window->first_line_displayed)
|
||||
{
|
||||
if (ptr_buffer->dcc)
|
||||
break;
|
||||
}
|
||||
if (ptr_buffer)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window, ptr_buffer);
|
||||
gui_redraw_buffer (ptr_buffer);
|
||||
}
|
||||
else
|
||||
gui_buffer_new (gui_current_window, NULL, NULL, 1, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_previous_buffer: switch to previous buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_previous_buffer (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
/* if only one buffer then return */
|
||||
if (gui_buffers == last_gui_buffer)
|
||||
return;
|
||||
|
||||
if (window->buffer->prev_buffer)
|
||||
gui_switch_to_buffer (window, window->buffer->prev_buffer);
|
||||
else
|
||||
gui_switch_to_buffer (window, last_gui_buffer);
|
||||
|
||||
gui_redraw_buffer (window->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_next_buffer: switch to next buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_next_buffer (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
/* if only one buffer then return */
|
||||
if (gui_buffers == last_gui_buffer)
|
||||
return;
|
||||
|
||||
if (window->buffer->next_buffer)
|
||||
gui_switch_to_buffer (window, window->buffer->next_buffer);
|
||||
else
|
||||
gui_switch_to_buffer (window, gui_buffers);
|
||||
|
||||
gui_redraw_buffer (window->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_previous_window: switch to previous window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_previous_window (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
/* if only one window then return */
|
||||
if (gui_windows == last_gui_window)
|
||||
return;
|
||||
|
||||
gui_current_window = (window->prev_window) ? window->prev_window : last_gui_window;
|
||||
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_next_window: switch to next window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_next_window (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
/* if only one window then return */
|
||||
if (gui_windows == last_gui_window)
|
||||
return;
|
||||
|
||||
gui_current_window = (window->next_window) ? window->next_window : gui_windows;
|
||||
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_move_page_up: display previous page on buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_page_up (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (!window->first_line_displayed)
|
||||
{
|
||||
window->sub_lines += window->win_chat_height - 1;
|
||||
gui_draw_buffer_chat (window->buffer, 0);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
gui_current_window->sub_lines +=
|
||||
gui_current_window->win_chat_height - 1;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 0);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_move_page_down: display next page on buffer
|
||||
* gui_input_page_down: display next page on buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_page_down (t_gui_window *window)
|
||||
gui_input_page_down ()
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (window->sub_lines > 0)
|
||||
if (gui_current_window->sub_lines > 0)
|
||||
{
|
||||
window->sub_lines -= window->win_chat_height - 1;
|
||||
if (window->sub_lines < 0)
|
||||
window->sub_lines = 0;
|
||||
gui_draw_buffer_chat (window->buffer, 0);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
gui_current_window->sub_lines -=
|
||||
gui_current_window->win_chat_height - 1;
|
||||
if (gui_current_window->sub_lines < 0)
|
||||
gui_current_window->sub_lines = 0;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 0);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_nick_move_beginning: go to beginning of nicklist
|
||||
* gui_input_nick_beginning: go to beginning of nicklist
|
||||
*/
|
||||
|
||||
void
|
||||
gui_nick_move_beginning (t_gui_window *window)
|
||||
gui_input_nick_beginning ()
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (gui_buffer_has_nicklist (window->buffer))
|
||||
if (gui_buffer_has_nicklist (gui_current_window->buffer))
|
||||
{
|
||||
if (window->win_nick_start > 0)
|
||||
if (gui_current_window->win_nick_start > 0)
|
||||
{
|
||||
window->win_nick_start = 0;
|
||||
gui_draw_buffer_nick (window->buffer, 1);
|
||||
gui_current_window->win_nick_start = 0;
|
||||
gui_draw_buffer_nick (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_nick_move_end: go to the end of nicklist
|
||||
* gui_input_nick_end: go to the end of nicklist
|
||||
*/
|
||||
|
||||
void
|
||||
gui_nick_move_end (t_gui_window *window)
|
||||
gui_input_nick_end ()
|
||||
{
|
||||
int new_start;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (gui_buffer_has_nicklist (window->buffer))
|
||||
if (gui_buffer_has_nicklist (gui_current_window->buffer))
|
||||
{
|
||||
new_start = CHANNEL(window->buffer)->nicks_count - window->win_nick_height;
|
||||
new_start =
|
||||
CHANNEL(gui_current_window->buffer)->nicks_count -
|
||||
gui_current_window->win_nick_height;
|
||||
if (new_start < 0)
|
||||
new_start = 0;
|
||||
else if (new_start >= 1)
|
||||
new_start++;
|
||||
|
||||
if (new_start != window->win_nick_start)
|
||||
if (new_start != gui_current_window->win_nick_start)
|
||||
{
|
||||
window->win_nick_start = new_start;
|
||||
gui_draw_buffer_nick (window->buffer, 1);
|
||||
gui_current_window->win_nick_start = new_start;
|
||||
gui_draw_buffer_nick (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_nick_move_page_up: scroll one page up in nicklist
|
||||
* gui_input_nick_page_up: scroll one page up in nicklist
|
||||
*/
|
||||
|
||||
void
|
||||
gui_nick_move_page_up (t_gui_window *window)
|
||||
gui_input_nick_page_up ()
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (gui_buffer_has_nicklist (window->buffer))
|
||||
if (gui_buffer_has_nicklist (gui_current_window->buffer))
|
||||
{
|
||||
if (window->win_nick_start > 0)
|
||||
if (gui_current_window->win_nick_start > 0)
|
||||
{
|
||||
window->win_nick_start -= (window->win_nick_height - 1);
|
||||
if (window->win_nick_start <= 1)
|
||||
window->win_nick_start = 0;
|
||||
gui_draw_buffer_nick (window->buffer, 1);
|
||||
gui_current_window->win_nick_start -=
|
||||
(gui_current_window->win_nick_height - 1);
|
||||
if (gui_current_window->win_nick_start <= 1)
|
||||
gui_current_window->win_nick_start = 0;
|
||||
gui_draw_buffer_nick (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_nick_move_page_down: scroll one page down in nicklist
|
||||
* gui_input_nick_page_down: scroll one page down in nicklist
|
||||
*/
|
||||
|
||||
void
|
||||
gui_nick_move_page_down (t_gui_window *window)
|
||||
gui_input_nick_page_down ()
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (gui_buffer_has_nicklist (window->buffer))
|
||||
if (gui_buffer_has_nicklist (gui_current_window->buffer))
|
||||
{
|
||||
if ((CHANNEL(window->buffer)->nicks_count > window->win_nick_height)
|
||||
&& (window->win_nick_start + window->win_nick_height - 1 < CHANNEL(window->buffer)->nicks_count))
|
||||
if ((CHANNEL(gui_current_window->buffer)->nicks_count >
|
||||
gui_current_window->win_nick_height)
|
||||
&& (gui_current_window->win_nick_start +
|
||||
gui_current_window->win_nick_height - 1
|
||||
< CHANNEL(gui_current_window->buffer)->nicks_count))
|
||||
{
|
||||
if (window->win_nick_start == 0)
|
||||
window->win_nick_start += (window->win_nick_height - 1);
|
||||
if (gui_current_window->win_nick_start == 0)
|
||||
gui_current_window->win_nick_start +=
|
||||
(gui_current_window->win_nick_height - 1);
|
||||
else
|
||||
window->win_nick_start += (window->win_nick_height - 2);
|
||||
gui_draw_buffer_nick (window->buffer, 1);
|
||||
gui_current_window->win_nick_start +=
|
||||
(gui_current_window->win_nick_height - 2);
|
||||
gui_draw_buffer_nick (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2271,93 +2230,101 @@ 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_JOIN,
|
||||
cfg_col_chat_join, cfg_col_chat_bg);
|
||||
init_pair (COLOR_WIN_CHAT_PART,
|
||||
cfg_col_chat_part, 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_PRIVATE,
|
||||
cfg_col_status_data_private, 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_DELIMITERS,
|
||||
cfg_col_infobar_delimiters, 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;
|
||||
@@ -2366,6 +2333,8 @@ gui_init_colors ()
|
||||
color_attr[COLOR_WIN_CHAT_DARK - 1] = (cfg_col_chat_dark >= 0) ? cfg_col_chat_dark & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_CHAT_PREFIX1 - 1] = (cfg_col_chat_prefix1 >= 0) ? cfg_col_chat_prefix1 & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_CHAT_PREFIX2 - 1] = (cfg_col_chat_prefix2 >= 0) ? cfg_col_chat_prefix2 & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_CHAT_JOIN - 1] = (cfg_col_chat_join >= 0) ? cfg_col_chat_join & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_CHAT_PART - 1] = (cfg_col_chat_part >= 0) ? cfg_col_chat_part & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_CHAT_NICK - 1] = (cfg_col_chat_nick >= 0) ? cfg_col_chat_nick & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_CHAT_HOST - 1] = (cfg_col_chat_host >= 0) ? cfg_col_chat_host & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_CHAT_CHANNEL - 1] = (cfg_col_chat_channel >= 0) ? cfg_col_chat_channel & A_BOLD : 0;
|
||||
@@ -2374,10 +2343,12 @@ gui_init_colors ()
|
||||
color_attr[COLOR_WIN_STATUS - 1] = (cfg_col_status >= 0) ? cfg_col_status & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_STATUS_DELIMITERS - 1] = (cfg_col_status_delimiters >= 0) ? cfg_col_status_delimiters & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_STATUS_DATA_MSG - 1] = (cfg_col_status_data_msg >= 0) ? cfg_col_status_data_msg & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_STATUS_DATA_PRIVATE - 1] = (cfg_col_status_data_private >= 0) ? cfg_col_status_data_private & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_STATUS_DATA_HIGHLIGHT - 1] = (cfg_col_status_data_highlight >= 0) ? cfg_col_status_data_highlight & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_STATUS_DATA_OTHER - 1] = (cfg_col_status_data_other >= 0) ? cfg_col_status_data_other & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_STATUS_MORE - 1] = (cfg_col_status_more >= 0) ? cfg_col_status_more & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_INFOBAR - 1] = (cfg_col_infobar >= 0) ? cfg_col_infobar & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_INFOBAR_DELIMITERS - 1] = (cfg_col_infobar_delimiters >= 0) ? cfg_col_infobar_delimiters & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_INFOBAR_HIGHLIGHT - 1] = (cfg_col_infobar_highlight >= 0) ? cfg_col_infobar_highlight & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_INPUT - 1] = (cfg_col_input >= 0) ? cfg_col_input & A_BOLD : 0;
|
||||
color_attr[COLOR_WIN_INPUT_CHANNEL - 1] = (cfg_col_input_channel >= 0) ? cfg_col_input_channel & A_BOLD : 0;
|
||||
@@ -2427,16 +2398,20 @@ gui_init ()
|
||||
initscr ();
|
||||
|
||||
curs_set (1);
|
||||
keypad (stdscr, TRUE);
|
||||
noecho ();
|
||||
nodelay (stdscr, TRUE);
|
||||
|
||||
gui_init_colors ();
|
||||
|
||||
|
||||
gui_infobar = NULL;
|
||||
|
||||
gui_ok = ((COLS > 5) && (LINES > 5));
|
||||
|
||||
refresh ();
|
||||
|
||||
/* init clipboard buffer */
|
||||
gui_input_clipboard = NULL;
|
||||
|
||||
/* create new window/buffer */
|
||||
if (gui_window_new (0, 0, COLS, LINES))
|
||||
{
|
||||
@@ -2461,6 +2436,10 @@ gui_end ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
/* free clipboard buffer */
|
||||
if (gui_input_clipboard)
|
||||
free(gui_input_clipboard);
|
||||
|
||||
/* delete all windows */
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
@@ -2507,6 +2486,7 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
|
||||
{
|
||||
char *pos;
|
||||
int length;
|
||||
char *ptr_string;
|
||||
|
||||
/* create new line if previous was ending by '\n' (or if 1st line) */
|
||||
if (buffer->line_complete)
|
||||
@@ -2527,6 +2507,13 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
|
||||
buffer->line_complete = 1;
|
||||
}
|
||||
buffer->last_line->last_message->message = strdup (message);
|
||||
ptr_string = buffer->last_line->last_message->message;
|
||||
while (ptr_string[0])
|
||||
{
|
||||
if ((ptr_string[0] > 0) && (ptr_string[0] < 32))
|
||||
ptr_string[0] = 32;
|
||||
ptr_string++;
|
||||
}
|
||||
length = strlen (message);
|
||||
buffer->last_line->length += length;
|
||||
if (type & MSG_TYPE_MSG)
|
||||
@@ -2548,9 +2535,14 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
|
||||
buffer->last_line->line_with_highlight <=
|
||||
buffer->notify_level)
|
||||
{
|
||||
hotlist_add (buffer->last_line->line_with_message +
|
||||
buffer->last_line->line_with_highlight,
|
||||
buffer);
|
||||
if (buffer->last_line->line_with_highlight)
|
||||
hotlist_add (HOTLIST_HIGHLIGHT, buffer);
|
||||
else if (BUFFER_IS_PRIVATE(buffer) && (buffer->last_line->line_with_message))
|
||||
hotlist_add (HOTLIST_PRIVATE, buffer);
|
||||
else if (buffer->last_line->line_with_message)
|
||||
hotlist_add (HOTLIST_MSG, buffer);
|
||||
else
|
||||
hotlist_add (HOTLIST_LOW, buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
@@ -2600,14 +2592,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);
|
||||
|
||||
+184
-628
@@ -41,643 +41,191 @@
|
||||
#include "../../common/fifo.h"
|
||||
#include "../../irc/irc.h"
|
||||
|
||||
#define KEY_ESCAPE 27
|
||||
|
||||
/*
|
||||
* gui_read_keyb: read keyboard line
|
||||
* gui_input_default_key_bindings: create default key bindings
|
||||
*/
|
||||
|
||||
void
|
||||
gui_read_keyb ()
|
||||
gui_input_default_key_bindings ()
|
||||
{
|
||||
int i;
|
||||
char key_str[32], command[32];
|
||||
|
||||
/* keys binded with internal functions */
|
||||
gui_key_bind ( /* RC */ "ctrl-M", "return");
|
||||
gui_key_bind ( /* RC */ "ctrl-J", "return");
|
||||
gui_key_bind ( /* tab */ "ctrl-I", "tab");
|
||||
gui_key_bind ( /* basckp */ "ctrl-H", "backspace");
|
||||
gui_key_bind ( /* basckp */ "ctrl-?", "backspace");
|
||||
gui_key_bind ( /* del */ "meta2-3~", "delete");
|
||||
gui_key_bind ( /* ^K */ "ctrl-K", "delete_end_line");
|
||||
gui_key_bind ( /* ^U */ "ctrl-U", "delete_beginning_line");
|
||||
gui_key_bind ( /* ^W */ "ctrl-W", "delete_previous_word");
|
||||
gui_key_bind ( /* ^Y */ "ctrl-Y", "clipboard_paste");
|
||||
gui_key_bind ( /* ^T */ "ctrl-T", "transpose_chars");
|
||||
gui_key_bind ( /* home */ "meta2-1~", "home");
|
||||
gui_key_bind ( /* home */ "meta2-H", "home");
|
||||
gui_key_bind ( /* home */ "meta2-7~", "home");
|
||||
gui_key_bind ( /* ^A */ "ctrl-A", "home");
|
||||
gui_key_bind ( /* end */ "meta2-4~", "end");
|
||||
gui_key_bind ( /* end */ "meta2-F", "end");
|
||||
gui_key_bind ( /* end */ "meta2-8~", "end");
|
||||
gui_key_bind ( /* ^E */ "ctrl-E", "end");
|
||||
gui_key_bind ( /* left */ "meta2-D", "left");
|
||||
gui_key_bind ( /* right */ "meta2-C", "right");
|
||||
gui_key_bind ( /* up */ "meta2-A", "up");
|
||||
gui_key_bind ( /* down */ "meta2-B", "down");
|
||||
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
|
||||
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
|
||||
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
|
||||
gui_key_bind ( /* F11 */ "meta2-23~", "nick_page_up");
|
||||
gui_key_bind ( /* F12 */ "meta2-24~", "nick_page_down");
|
||||
gui_key_bind ( /* m-F11 */ "meta-meta2-1~", "nick_beginning");
|
||||
gui_key_bind ( /* m-F12 */ "meta-meta2-4~", "nick_end");
|
||||
gui_key_bind ( /* ^L */ "ctrl-L", "refresh");
|
||||
gui_key_bind ( /* m-a */ "meta-a", "jump_smart");
|
||||
gui_key_bind ( /* m-b */ "meta-b", "previous_word");
|
||||
gui_key_bind ( /* ^left */ "meta-Od", "previous_word");
|
||||
gui_key_bind ( /* m-d */ "meta-d", "delete_next_word");
|
||||
gui_key_bind ( /* m-f */ "meta-f", "next_word");
|
||||
gui_key_bind ( /* ^right */ "meta-Oc", "next_word");
|
||||
gui_key_bind ( /* m-h */ "meta-h", "hotlist_clear");
|
||||
gui_key_bind ( /* m-j,m-d */ "meta-jmeta-d", "jump_dcc");
|
||||
gui_key_bind ( /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer");
|
||||
gui_key_bind ( /* m-j,m-s */ "meta-jmeta-s", "jump_server");
|
||||
gui_key_bind ( /* m-j,m-x */ "meta-jmeta-x", "jump_next_server");
|
||||
gui_key_bind ( /* m-k */ "meta-k", "grab_key");
|
||||
gui_key_bind ( /* m-r */ "meta-r", "delete_line");
|
||||
|
||||
/* keys binded with commands */
|
||||
gui_key_bind ( /* m-left */ "meta-meta2-D", "/buffer -1");
|
||||
gui_key_bind ( /* F5 */ "meta2-15~", "/buffer -1");
|
||||
gui_key_bind ( /* m-right */ "meta-meta2-C", "/buffer +1");
|
||||
gui_key_bind ( /* F6 */ "meta2-17~", "/buffer +1");
|
||||
gui_key_bind ( /* F7 */ "meta2-18~", "/window -1");
|
||||
gui_key_bind ( /* F8 */ "meta2-19~", "/window +1");
|
||||
gui_key_bind ( /* m-0 */ "meta-0", "/buffer 10");
|
||||
gui_key_bind ( /* m-1 */ "meta-1", "/buffer 1");
|
||||
gui_key_bind ( /* m-2 */ "meta-2", "/buffer 2");
|
||||
gui_key_bind ( /* m-3 */ "meta-3", "/buffer 3");
|
||||
gui_key_bind ( /* m-4 */ "meta-4", "/buffer 4");
|
||||
gui_key_bind ( /* m-5 */ "meta-5", "/buffer 5");
|
||||
gui_key_bind ( /* m-6 */ "meta-6", "/buffer 6");
|
||||
gui_key_bind ( /* m-7 */ "meta-7", "/buffer 7");
|
||||
gui_key_bind ( /* m-8 */ "meta-8", "/buffer 8");
|
||||
gui_key_bind ( /* m-9 */ "meta-9", "/buffer 9");
|
||||
|
||||
/* bind meta-j + {01..99} to switch to buffers # > 10 */
|
||||
for (i = 1; i < 100; i++)
|
||||
{
|
||||
sprintf (key_str, "meta-j%02d", i);
|
||||
sprintf (command, "/buffer %d", i);
|
||||
gui_key_bind (key_str, command);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_grab_end: insert grabbed key in input buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_input_grab_end ()
|
||||
{
|
||||
char *expanded_key;
|
||||
|
||||
/* get expanded name (for example: ^U => ctrl-u) */
|
||||
expanded_key = gui_key_get_expanded_name (gui_key_buffer);
|
||||
|
||||
if (expanded_key)
|
||||
{
|
||||
if (gui_current_window->buffer->has_input)
|
||||
{
|
||||
gui_input_insert_string (expanded_key, -1);
|
||||
gui_current_window->buffer->input_buffer_pos += strlen (expanded_key);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
free (expanded_key);
|
||||
}
|
||||
|
||||
/* end grab mode */
|
||||
gui_key_grab = 0;
|
||||
gui_key_grab_count = 0;
|
||||
gui_key_buffer[0] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_read: read keyboard chars
|
||||
*/
|
||||
|
||||
void
|
||||
gui_input_read ()
|
||||
{
|
||||
int key, i;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
t_irc_server *ptr_server;
|
||||
t_irc_dcc *ptr_dcc, *ptr_dcc_next;
|
||||
char new_char[3], *decoded_string;
|
||||
t_irc_dcc *dcc_selected;
|
||||
|
||||
key = getch ();
|
||||
if (key != ERR)
|
||||
char key_str[32];
|
||||
|
||||
i = 0;
|
||||
/* do not loop too much here (for example when big paste was made),
|
||||
to read also socket & co */
|
||||
while (i < 8)
|
||||
{
|
||||
switch (key)
|
||||
if (gui_key_grab && (gui_key_grab_count > 10))
|
||||
gui_input_grab_end ();
|
||||
|
||||
key = getch ();
|
||||
|
||||
if (key == ERR)
|
||||
{
|
||||
/* resize event */
|
||||
case KEY_RESIZE:
|
||||
gui_curses_resize_handler ();
|
||||
break;
|
||||
/* inactive function keys */
|
||||
case KEY_F(1):
|
||||
case KEY_F(2):
|
||||
case KEY_F(3):
|
||||
case KEY_F(4):
|
||||
case KEY_F(9):
|
||||
break;
|
||||
/* previous buffer in window */
|
||||
case KEY_F(5):
|
||||
gui_switch_to_previous_buffer (gui_current_window);
|
||||
break;
|
||||
/* next buffer in window */
|
||||
case KEY_F(6):
|
||||
gui_switch_to_next_buffer (gui_current_window);
|
||||
break;
|
||||
/* previous window */
|
||||
case KEY_F(7):
|
||||
gui_switch_to_previous_window (gui_current_window);
|
||||
break;
|
||||
/* next window */
|
||||
case KEY_F(8):
|
||||
gui_switch_to_next_window (gui_current_window);
|
||||
break;
|
||||
/* remove last infobar message */
|
||||
case KEY_F(10):
|
||||
gui_infobar_remove ();
|
||||
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
|
||||
break;
|
||||
case KEY_F(11):
|
||||
gui_nick_move_page_up (gui_current_window);
|
||||
break;
|
||||
case KEY_F(12):
|
||||
gui_nick_move_page_down (gui_current_window);
|
||||
break;
|
||||
/* cursor up */
|
||||
case KEY_UP:
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (dcc_list)
|
||||
{
|
||||
if (gui_current_window->dcc_selected
|
||||
&& ((t_irc_dcc *)(gui_current_window->dcc_selected))->prev_dcc)
|
||||
{
|
||||
if (gui_current_window->dcc_selected ==
|
||||
gui_current_window->dcc_first)
|
||||
gui_current_window->dcc_first =
|
||||
((t_irc_dcc *)(gui_current_window->dcc_first))->prev_dcc;
|
||||
gui_current_window->dcc_selected =
|
||||
((t_irc_dcc *)(gui_current_window->dcc_selected))->prev_dcc;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 1);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->ptr_history->next_history;
|
||||
if (!gui_current_window->buffer->ptr_history)
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->history;
|
||||
}
|
||||
else
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->history;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_size =
|
||||
strlen (gui_current_window->buffer->ptr_history->text);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
strcpy (gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->ptr_history->text);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor down */
|
||||
case KEY_DOWN:
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (dcc_list)
|
||||
{
|
||||
if (!gui_current_window->dcc_selected
|
||||
|| ((t_irc_dcc *)(gui_current_window->dcc_selected))->next_dcc)
|
||||
{
|
||||
if (gui_current_window->dcc_last_displayed
|
||||
&& (gui_current_window->dcc_selected ==
|
||||
gui_current_window->dcc_last_displayed))
|
||||
{
|
||||
if (gui_current_window->dcc_first)
|
||||
gui_current_window->dcc_first =
|
||||
((t_irc_dcc *)(gui_current_window->dcc_first))->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_first =
|
||||
dcc_list->next_dcc;
|
||||
}
|
||||
if (gui_current_window->dcc_selected)
|
||||
gui_current_window->dcc_selected =
|
||||
((t_irc_dcc *)(gui_current_window->dcc_selected))->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_selected =
|
||||
dcc_list->next_dcc;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 1);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->ptr_history->prev_history;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
gui_current_window->buffer->input_buffer_size =
|
||||
strlen (gui_current_window->buffer->ptr_history->text);
|
||||
else
|
||||
gui_current_window->buffer->input_buffer_size = 0;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
strcpy (gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->ptr_history->text);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor left */
|
||||
case KEY_LEFT:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos--;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor right */
|
||||
case KEY_RIGHT:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* home key or Control + A */
|
||||
case KEY_HOME:
|
||||
case 0x01:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos = 0;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* end key or Control + E */
|
||||
case KEY_END:
|
||||
case 0x05:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* page up */
|
||||
case KEY_PPAGE:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_page_up (gui_current_window);
|
||||
break;
|
||||
/* page down */
|
||||
case KEY_NPAGE:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_page_down (gui_current_window);
|
||||
break;
|
||||
/* erase before cursor and move cursor to the left */
|
||||
case 127:
|
||||
case KEY_BACKSPACE:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
i = gui_current_window->buffer->input_buffer_pos-1;
|
||||
while (gui_current_window->buffer->input_buffer[i])
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i+1];
|
||||
i++;
|
||||
}
|
||||
gui_current_window->buffer->input_buffer_size--;
|
||||
gui_current_window->buffer->input_buffer_pos--;
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Control + Backspace or Control + W */
|
||||
case 0x08:
|
||||
case 0x17:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_delete_previous_word (gui_current_window->buffer);
|
||||
break;
|
||||
/* Control + L */
|
||||
case 0x0C:
|
||||
gui_curses_resize_handler ();
|
||||
break;
|
||||
/* erase char under cursor */
|
||||
case KEY_DC:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
i = gui_current_window->buffer->input_buffer_pos;
|
||||
while (gui_current_window->buffer->input_buffer[i])
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i+1];
|
||||
i++;
|
||||
}
|
||||
gui_current_window->buffer->input_buffer_size--;
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Tab : completion */
|
||||
case '\t':
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
completion_search (&(gui_current_window->buffer->completion),
|
||||
CHANNEL(gui_current_window->buffer),
|
||||
gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->input_buffer_size,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
|
||||
if (gui_current_window->buffer->completion.word_found)
|
||||
{
|
||||
/* replace word with new completed word into input buffer */
|
||||
if (gui_current_window->buffer->completion.diff_size > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_size +=
|
||||
gui_current_window->buffer->completion.diff_size;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
for (i = gui_current_window->buffer->input_buffer_size - 1;
|
||||
i >= gui_current_window->buffer->completion.position_replace +
|
||||
(int)strlen (gui_current_window->buffer->completion.word_found); i--)
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i -
|
||||
gui_current_window->buffer->completion.diff_size];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = gui_current_window->buffer->completion.position_replace +
|
||||
strlen (gui_current_window->buffer->completion.word_found);
|
||||
i < gui_current_window->buffer->input_buffer_size; i++)
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i -
|
||||
gui_current_window->buffer->completion.diff_size];
|
||||
gui_current_window->buffer->input_buffer_size +=
|
||||
gui_current_window->buffer->completion.diff_size;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
}
|
||||
|
||||
strncpy (gui_current_window->buffer->input_buffer + gui_current_window->buffer->completion.position_replace,
|
||||
gui_current_window->buffer->completion.word_found,
|
||||
strlen (gui_current_window->buffer->completion.word_found));
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->completion.position_replace +
|
||||
strlen (gui_current_window->buffer->completion.word_found);
|
||||
|
||||
/* position is < 0 this means only one word was found to complete,
|
||||
so reinit to stop completion */
|
||||
if (gui_current_window->buffer->completion.position >= 0)
|
||||
gui_current_window->buffer->completion.position =
|
||||
gui_current_window->buffer->input_buffer_pos;
|
||||
|
||||
/* add space or completor to the end of completion, if needed */
|
||||
if ((gui_current_window->buffer->completion.context == COMPLETION_COMMAND)
|
||||
|| (gui_current_window->buffer->completion.context == COMPLETION_COMMAND_ARG))
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
" ",
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
if (gui_current_window->buffer->completion.position >= 0)
|
||||
gui_current_window->buffer->completion.position++;
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* add nick completor if position 0 and completing nick */
|
||||
if ((gui_current_window->buffer->completion.base_word_pos == 0)
|
||||
&& (gui_current_window->buffer->completion.context == COMPLETION_NICK))
|
||||
{
|
||||
if (strncmp (gui_current_window->buffer->input_buffer + gui_current_window->buffer->input_buffer_pos,
|
||||
cfg_look_completor, strlen (cfg_look_completor)) != 0)
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
cfg_look_completor,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
if (gui_current_window->buffer->completion.position >= 0)
|
||||
gui_current_window->buffer->completion.position += strlen (cfg_look_completor);
|
||||
gui_current_window->buffer->input_buffer_pos += strlen (cfg_look_completor);
|
||||
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
" ",
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
if (gui_current_window->buffer->completion.position >= 0)
|
||||
gui_current_window->buffer->completion.position++;
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
}
|
||||
}
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* escape code (for control-key) */
|
||||
case KEY_ESCAPE:
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
switch (key)
|
||||
{
|
||||
/* Alt + left arrow */
|
||||
case KEY_LEFT:
|
||||
gui_switch_to_previous_buffer (gui_current_window);
|
||||
break;
|
||||
/* Alt + right arrow */
|
||||
case KEY_RIGHT:
|
||||
gui_switch_to_next_buffer (gui_current_window);
|
||||
break;
|
||||
/* Alt + home */
|
||||
case KEY_HOME:
|
||||
gui_nick_move_beginning (gui_current_window);
|
||||
break;
|
||||
/* Alt + end */
|
||||
case KEY_END:
|
||||
gui_nick_move_end (gui_current_window);
|
||||
break;
|
||||
/* Alt + page up */
|
||||
case KEY_PPAGE:
|
||||
gui_nick_move_page_up (gui_current_window);
|
||||
break;
|
||||
/* Alt + page down */
|
||||
case KEY_NPAGE:
|
||||
gui_nick_move_page_down (gui_current_window);
|
||||
break;
|
||||
case 79:
|
||||
/* TODO: replace 79 by constant name! */
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
/* Control + Right */
|
||||
case 99:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_next_word (gui_current_window->buffer);
|
||||
break;
|
||||
/* Control + Left */
|
||||
case 100:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_previous_word (gui_current_window->buffer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-number: jump to window by number */
|
||||
case 48: /* Alt-0 */
|
||||
case 49: /* Alt-1 */
|
||||
case 50: /* Alt-2 */
|
||||
case 51: /* Alt-3 */
|
||||
case 52: /* Alt-4 */
|
||||
case 53: /* Alt-5 */
|
||||
case 54: /* Alt-6 */
|
||||
case 55: /* Alt-7 */
|
||||
case 56: /* Alt-8 */
|
||||
case 57: /* Alt-9 */
|
||||
gui_switch_to_buffer_by_number (gui_current_window, (key == 48) ? 10 : key - 48);
|
||||
break;
|
||||
/* Alt-A: jump to buffer with activity */
|
||||
case 'a':
|
||||
case 'A':
|
||||
if (hotlist)
|
||||
{
|
||||
if (!hotlist_initial_buffer)
|
||||
hotlist_initial_buffer = gui_current_window->buffer;
|
||||
gui_switch_to_buffer (gui_current_window, hotlist->buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hotlist_initial_buffer)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window, hotlist_initial_buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
hotlist_initial_buffer = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-D: jump to DCC buffer */
|
||||
case 'd':
|
||||
case 'D':
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (buffer_before_dcc)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window,
|
||||
buffer_before_dcc);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_before_dcc = gui_current_window->buffer;
|
||||
gui_switch_to_dcc_buffer ();
|
||||
}
|
||||
break;
|
||||
/* Alt-R: clear hotlist */
|
||||
case 'r':
|
||||
case 'R':
|
||||
if (hotlist)
|
||||
{
|
||||
hotlist_free_all ();
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
hotlist_initial_buffer = gui_current_window->buffer;
|
||||
break;
|
||||
/* Alt-S: jump to server buffer */
|
||||
case 's':
|
||||
case 'S':
|
||||
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 (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;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* send command/message */
|
||||
case '\n':
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_size > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
history_add (gui_current_window->buffer, gui_current_window->buffer->input_buffer);
|
||||
gui_current_window->buffer->input_buffer_size = 0;
|
||||
gui_current_window->buffer->input_buffer_pos = 0;
|
||||
gui_current_window->buffer->input_buffer_1st_display = 0;
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
gui_current_window->buffer->ptr_history = NULL;
|
||||
ptr_buffer = gui_current_window->buffer;
|
||||
user_command (SERVER(gui_current_window->buffer),
|
||||
gui_current_window->buffer,
|
||||
gui_current_window->buffer->input_buffer);
|
||||
if (ptr_buffer == gui_current_window->buffer)
|
||||
{
|
||||
ptr_buffer->input_buffer[0] = '\0';
|
||||
gui_draw_buffer_input (ptr_buffer, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* other key => add to input buffer */
|
||||
default:
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
dcc_selected = (gui_current_window->dcc_selected) ?
|
||||
(t_irc_dcc *) gui_current_window->dcc_selected : dcc_list;
|
||||
switch (key)
|
||||
{
|
||||
/* accept DCC */
|
||||
case 'a':
|
||||
case 'A':
|
||||
if (dcc_selected
|
||||
&& (DCC_IS_RECV(dcc_selected->status))
|
||||
&& (dcc_selected->status == DCC_WAITING))
|
||||
{
|
||||
dcc_accept (dcc_selected);
|
||||
}
|
||||
break;
|
||||
/* cancel DCC */
|
||||
case 'c':
|
||||
case 'C':
|
||||
if (dcc_selected
|
||||
&& (!DCC_ENDED(dcc_selected->status)))
|
||||
{
|
||||
dcc_close (dcc_selected, DCC_ABORTED);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
/* purge old DCC */
|
||||
case 'p':
|
||||
case 'P':
|
||||
gui_current_window->dcc_selected = NULL;
|
||||
ptr_dcc = dcc_list;
|
||||
while (ptr_dcc)
|
||||
{
|
||||
ptr_dcc_next = ptr_dcc->next_dcc;
|
||||
if (DCC_ENDED(ptr_dcc->status))
|
||||
dcc_free (ptr_dcc);
|
||||
ptr_dcc = ptr_dcc_next;
|
||||
}
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
break;
|
||||
/* close DCC window */
|
||||
case 'q':
|
||||
case 'Q':
|
||||
if (buffer_before_dcc)
|
||||
{
|
||||
gui_buffer_free (gui_current_window->buffer, 1);
|
||||
gui_switch_to_buffer (gui_current_window,
|
||||
buffer_before_dcc);
|
||||
}
|
||||
else
|
||||
gui_buffer_free (gui_current_window->buffer, 1);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
break;
|
||||
/* remove from DCC list */
|
||||
case 'r':
|
||||
case 'R':
|
||||
if (dcc_selected
|
||||
&& (DCC_ENDED(dcc_selected->status)))
|
||||
{
|
||||
if (dcc_selected->next_dcc)
|
||||
gui_current_window->dcc_selected = dcc_selected->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_selected = NULL;
|
||||
dcc_free (dcc_selected);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
new_char[0] = key;
|
||||
new_char[1] = '\0';
|
||||
decoded_string = NULL;
|
||||
|
||||
/* UTF-8 input */
|
||||
if (key == 0xC3)
|
||||
{
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
new_char[1] = key;
|
||||
new_char[2] = '\0';
|
||||
decoded_string = weechat_convert_encoding (local_charset, cfg_look_charset_internal, new_char);
|
||||
}
|
||||
}
|
||||
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
(decoded_string) ? decoded_string : new_char,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
|
||||
if (decoded_string)
|
||||
free (decoded_string);
|
||||
}
|
||||
break;
|
||||
if (gui_key_grab && (gui_key_grab_count > 0))
|
||||
gui_input_grab_end ();
|
||||
break;
|
||||
}
|
||||
|
||||
if (key == KEY_RESIZE)
|
||||
{
|
||||
gui_curses_resize_handler ();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key < 32)
|
||||
{
|
||||
key_str[0] = '^';
|
||||
key_str[1] = (char) key + '@';
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
else if (key == 127)
|
||||
{
|
||||
key_str[0] = '^';
|
||||
key_str[1] = '?';
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (key > 0xff)
|
||||
{
|
||||
key_str[0] = (char) (key >> 8);
|
||||
key_str[1] = (char) (key & 0xff);
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
key_str[0] = (char) key;
|
||||
key_str[1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp (key_str, "^") == 0)
|
||||
{
|
||||
key_str[1] = '^';
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
|
||||
/*gui_printf (gui_current_window->buffer, "gui_input_read: key = %s (%d)\n", key_str, key);*/
|
||||
|
||||
if (gui_key_pressed (key_str) != 0)
|
||||
gui_input_insert_char (key);
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,6 +265,14 @@ gui_main_loop ()
|
||||
{
|
||||
old_sec = local_time->tm_sec;
|
||||
|
||||
if (cfg_look_infobar_seconds)
|
||||
{
|
||||
gui_draw_buffer_infobar_time (gui_current_window->buffer);
|
||||
wmove (gui_current_window->win_input,
|
||||
0, gui_current_window->win_input_x);
|
||||
wrefresh (gui_current_window->win_input);
|
||||
}
|
||||
|
||||
/* infobar count down */
|
||||
if (gui_infobar && gui_infobar->remaining_time > 0)
|
||||
{
|
||||
@@ -801,7 +357,7 @@ gui_main_loop ()
|
||||
{
|
||||
if (FD_ISSET (STDIN_FILENO, &read_fd))
|
||||
{
|
||||
gui_read_keyb ();
|
||||
gui_input_read ();
|
||||
}
|
||||
if ((weechat_fifo != -1) && (FD_ISSET (weechat_fifo, &read_fd)))
|
||||
{
|
||||
|
||||
+1037
-101
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,559 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* gui-keyboard: keyboard functions (GUI independant) */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "../common/weechat.h"
|
||||
#include "gui.h"
|
||||
#include "../common/command.h"
|
||||
|
||||
|
||||
t_gui_key *gui_keys = NULL;
|
||||
t_gui_key *last_gui_key = NULL;
|
||||
|
||||
char gui_key_buffer[128];
|
||||
int gui_key_grab = 0;
|
||||
int gui_key_grab_count = 0;
|
||||
|
||||
t_gui_key_function gui_key_functions[] =
|
||||
{ { "return", gui_input_return,
|
||||
N_("terminate line") },
|
||||
{ "tab", gui_input_tab,
|
||||
N_("complete word") },
|
||||
{ "backspace", gui_input_backspace,
|
||||
N_("delete previous char") },
|
||||
{ "delete", gui_input_delete,
|
||||
N_("delete next char") },
|
||||
{ "delete_end_line", gui_input_delete_end_of_line,
|
||||
N_("delete until end of line") },
|
||||
{ "delete_beginning_line", gui_input_delete_begin_of_line,
|
||||
N_("delete until beginning of line") },
|
||||
{ "delete_line", gui_input_delete_line,
|
||||
N_("delete entire line") },
|
||||
{ "delete_previous_word", gui_input_delete_previous_word,
|
||||
N_("delete previous word") },
|
||||
{ "delete_next_word", gui_input_delete_next_word,
|
||||
N_("delete next word") },
|
||||
{ "clipboard_paste", gui_input_clipboard_paste,
|
||||
N_("paste current clipboard content") },
|
||||
{ "transpose_chars", gui_input_transpose_chars,
|
||||
N_("transpose chars") },
|
||||
{ "home", gui_input_home,
|
||||
N_("go to beginning of line") },
|
||||
{ "end", gui_input_end,
|
||||
N_("go to end of line") },
|
||||
{ "left", gui_input_left,
|
||||
N_("move one char left") },
|
||||
{ "previous_word", gui_input_previous_word,
|
||||
N_("move to previous word") },
|
||||
{ "right", gui_input_right,
|
||||
N_("move one char right") },
|
||||
{ "next_word", gui_input_next_word,
|
||||
N_("move to next word") },
|
||||
{ "up", gui_input_up,
|
||||
N_("call previous command in history") },
|
||||
{ "down", gui_input_down,
|
||||
N_("call next command in history") },
|
||||
{ "page_up", gui_input_page_up,
|
||||
N_("scroll one page up") },
|
||||
{ "page_down", gui_input_page_down,
|
||||
N_("scroll one page down") },
|
||||
{ "infobar_clear", gui_input_infobar_clear,
|
||||
N_("clear infobar") },
|
||||
{ "nick_page_up", gui_input_nick_page_up,
|
||||
N_("scroll nicklist one page up") },
|
||||
{ "nick_page_down", gui_input_nick_page_down,
|
||||
N_("scroll nicklist one page down") },
|
||||
{ "nick_beginning", gui_input_nick_beginning,
|
||||
N_("display beginning of nicklist") },
|
||||
{ "nick_end", gui_input_nick_end,
|
||||
N_("display end of nicklist") },
|
||||
{ "refresh", gui_curses_resize_handler,
|
||||
N_("refresh screen") },
|
||||
{ "jump_smart", gui_input_jump_smart,
|
||||
N_("jump to buffer with activity") },
|
||||
{ "jump_dcc", gui_input_jump_dcc,
|
||||
N_("jump to DCC buffer") },
|
||||
{ "jump_last_buffer", gui_input_jump_last_buffer,
|
||||
N_("jump to last buffer") },
|
||||
{ "jump_server", gui_input_jump_server,
|
||||
N_("jump to server buffer") },
|
||||
{ "jump_next_server", gui_input_jump_next_server,
|
||||
N_("jump to next server") },
|
||||
{ "hotlist_clear", gui_input_hotlist_clear,
|
||||
N_("clear hotlist") },
|
||||
{ "grab_key", gui_input_grab_key,
|
||||
N_("grab a key") },
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* gui_key_init: init keyboard (create default key bindings)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_init ()
|
||||
{
|
||||
gui_key_buffer[0] = '\0';
|
||||
gui_key_grab = 0;
|
||||
gui_key_grab_count = 0;
|
||||
|
||||
gui_input_default_key_bindings ();
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_init_show: init "show mode"
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_init_grab ()
|
||||
{
|
||||
gui_key_grab = 1;
|
||||
gui_key_grab_count = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_get_internal_code: get internal code from user key name
|
||||
* for example: return "^R" for "ctrl-R"
|
||||
*/
|
||||
|
||||
char *
|
||||
gui_key_get_internal_code (char *key)
|
||||
{
|
||||
char *result;
|
||||
|
||||
if ((result = (char *) malloc (strlen (key) + 1)))
|
||||
{
|
||||
result[0] = '\0';
|
||||
while (key[0])
|
||||
{
|
||||
if (strncasecmp (key, "meta2-", 6) == 0)
|
||||
{
|
||||
strcat (result, "^[[");
|
||||
key += 6;
|
||||
}
|
||||
if (strncasecmp (key, "meta-", 5) == 0)
|
||||
{
|
||||
strcat (result, "^[");
|
||||
key += 5;
|
||||
}
|
||||
else if (strncasecmp (key, "ctrl-", 5) == 0)
|
||||
{
|
||||
strcat (result, "^");
|
||||
key += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncat (result, key, 1);
|
||||
key++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_get_expanded_name: get expanded name from internal key code
|
||||
* for example: return "ctrl-R" for "^R"
|
||||
*/
|
||||
|
||||
char *
|
||||
gui_key_get_expanded_name (char *key)
|
||||
{
|
||||
char *result;
|
||||
|
||||
if ((result = (char *) malloc ((strlen (key) * 5) + 1)))
|
||||
{
|
||||
result[0] = '\0';
|
||||
while (key[0])
|
||||
{
|
||||
if (strncasecmp (key, "^[[", 3) == 0)
|
||||
{
|
||||
strcat (result, "meta2-");
|
||||
key += 3;
|
||||
}
|
||||
if (strncasecmp (key, "^[", 2) == 0)
|
||||
{
|
||||
strcat (result, "meta-");
|
||||
key += 2;
|
||||
}
|
||||
else if ((key[0] == '^') && (key[1]))
|
||||
{
|
||||
strcat (result, "ctrl-");
|
||||
key++;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncat (result, key, 1);
|
||||
key++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_find_pos: find position for a key (for sorting keys list)
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_find_pos (t_gui_key *key)
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (strcasecmp (key->key, ptr_key->key) < 0)
|
||||
return ptr_key;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_insert_sorted: insert key into sorted list
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_insert_sorted (t_gui_key *key)
|
||||
{
|
||||
t_gui_key *pos_key;
|
||||
|
||||
if (gui_keys)
|
||||
{
|
||||
pos_key = gui_key_find_pos (key);
|
||||
|
||||
if (pos_key)
|
||||
{
|
||||
/* insert key into the list (before key found) */
|
||||
key->prev_key = pos_key->prev_key;
|
||||
key->next_key = pos_key;
|
||||
if (pos_key->prev_key)
|
||||
pos_key->prev_key->next_key = key;
|
||||
else
|
||||
gui_keys = key;
|
||||
pos_key->prev_key = key;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* add key to the end */
|
||||
key->prev_key = last_gui_key;
|
||||
key->next_key = NULL;
|
||||
last_gui_key->next_key = key;
|
||||
last_gui_key = key;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
key->prev_key = NULL;
|
||||
key->next_key = NULL;
|
||||
gui_keys = key;
|
||||
last_gui_key = key;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_new: add a new key in keys list
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_new (char *key, char *command, void *function)
|
||||
{
|
||||
t_gui_key *new_key;
|
||||
char *internal_code;
|
||||
|
||||
if ((new_key = (t_gui_key *) malloc (sizeof (t_gui_key))))
|
||||
{
|
||||
internal_code = gui_key_get_internal_code (key);
|
||||
new_key->key = (internal_code) ? strdup (internal_code) : strdup (key);
|
||||
if (internal_code)
|
||||
free (internal_code);
|
||||
new_key->command = (command) ? strdup (command) : NULL;
|
||||
new_key->function = function;
|
||||
gui_key_insert_sorted (new_key);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return new_key;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_search: search a key
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_search (char *key)
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (strcasecmp (ptr_key->key, key) == 0)
|
||||
return ptr_key;
|
||||
}
|
||||
|
||||
/* key not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_cmp: compares 2 keys
|
||||
*/
|
||||
|
||||
int
|
||||
gui_key_cmp (char *key, char *search)
|
||||
{
|
||||
while (search[0])
|
||||
{
|
||||
if (toupper(key[0]) != toupper(search[0]))
|
||||
return search[0] - key[0];
|
||||
key++;
|
||||
search++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_search_part: search a key (maybe part of string)
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_search_part (char *key)
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (gui_key_cmp (ptr_key->key, key) == 0)
|
||||
return ptr_key;
|
||||
}
|
||||
|
||||
/* key not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_function_search_by_name: search a function by name
|
||||
*/
|
||||
|
||||
void *
|
||||
gui_key_function_search_by_name (char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
if (strcasecmp (gui_key_functions[i].function_name, name) == 0)
|
||||
return gui_key_functions[i].function;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* function not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_function_search_by_ptr: search a function by pointer
|
||||
*/
|
||||
|
||||
char *
|
||||
gui_key_function_search_by_ptr (void *function)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
if (gui_key_functions[i].function == function)
|
||||
return gui_key_functions[i].function_name;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* function not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_bind: bind a key to a function (command or special function)
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_bind (char *key, char *command)
|
||||
{
|
||||
t_gui_key_function *ptr_function;
|
||||
t_gui_key *new_key;
|
||||
|
||||
if (!key || !command)
|
||||
{
|
||||
wee_log_printf (_("%s unable to bind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, key);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr_function = NULL;
|
||||
if (command[0] != '/')
|
||||
{
|
||||
ptr_function = gui_key_function_search_by_name (command);
|
||||
if (!ptr_function)
|
||||
{
|
||||
wee_log_printf (_("%s unable to bind key \"%s\" (invalid function name: \"%s\")\n"),
|
||||
WEECHAT_ERROR, key, command);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
gui_key_unbind (key);
|
||||
|
||||
new_key = gui_key_new (key,
|
||||
(ptr_function) ? NULL : command,
|
||||
ptr_function);
|
||||
if (!new_key)
|
||||
{
|
||||
wee_log_printf (_("%s not enough memory for key binding\n"),
|
||||
WEECHAT_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return new_key;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_unbind: remove a key binding
|
||||
*/
|
||||
|
||||
int
|
||||
gui_key_unbind (char *key)
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
char *internal_code;
|
||||
|
||||
internal_code = gui_key_get_internal_code (key);
|
||||
|
||||
ptr_key = gui_key_search ((internal_code) ? internal_code : key);
|
||||
if (ptr_key)
|
||||
gui_key_free (ptr_key);
|
||||
|
||||
if (internal_code)
|
||||
free (internal_code);
|
||||
|
||||
return (ptr_key != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_pressed: treat new key pressed
|
||||
* return: 1 if key should be added to input buffer
|
||||
* 0 otherwise
|
||||
*/
|
||||
|
||||
int
|
||||
gui_key_pressed (char *key_str)
|
||||
{
|
||||
int first_key;
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
/* add key to buffer */
|
||||
first_key = (gui_key_buffer[0] == '\0');
|
||||
strcat (gui_key_buffer, key_str);
|
||||
|
||||
/* if we are in "show mode", increase counter and return */
|
||||
if (gui_key_grab)
|
||||
{
|
||||
gui_key_grab_count++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* look for key combo in key table */
|
||||
ptr_key = gui_key_search_part (gui_key_buffer);
|
||||
if (ptr_key)
|
||||
{
|
||||
if (strcasecmp (ptr_key->key, gui_key_buffer) == 0)
|
||||
{
|
||||
/* exact combo found => execute function or command */
|
||||
gui_key_buffer[0] = '\0';
|
||||
if (ptr_key->command)
|
||||
user_command (SERVER(gui_current_window->buffer),
|
||||
gui_current_window->buffer,
|
||||
ptr_key->command);
|
||||
else
|
||||
(void)(ptr_key->function)();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
gui_key_buffer[0] = '\0';
|
||||
|
||||
/* if this is first key and not found (even partial) => return 1
|
||||
else return 0 (= silently discard sequence of bad keys) */
|
||||
return first_key;
|
||||
}
|
||||
|
||||
/*
|
||||
* key_free: delete a key binding
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_free (t_gui_key *key)
|
||||
{
|
||||
/* free memory */
|
||||
if (key->key)
|
||||
free (key->key);
|
||||
if (key->command)
|
||||
free (key->command);
|
||||
|
||||
/* remove key from keys list */
|
||||
if (key->prev_key)
|
||||
key->prev_key->next_key = key->next_key;
|
||||
if (key->next_key)
|
||||
key->next_key->prev_key = key->prev_key;
|
||||
if (gui_keys == key)
|
||||
gui_keys = key->next_key;
|
||||
if (last_gui_key == key)
|
||||
last_gui_key = key->prev_key;
|
||||
|
||||
free (key);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_free_all: delete all key bindings
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_free_all ()
|
||||
{
|
||||
while (gui_keys)
|
||||
gui_key_free (gui_keys);
|
||||
}
|
||||
+138
-55
@@ -26,50 +26,54 @@
|
||||
|
||||
#define INPUT_BUFFER_BLOCK_SIZE 256
|
||||
|
||||
#define NUM_COLORS 50
|
||||
#define NUM_COLORS 54
|
||||
#define COLOR_WIN_TITLE 1
|
||||
#define COLOR_WIN_CHAT 2
|
||||
#define COLOR_WIN_CHAT_TIME 3
|
||||
#define COLOR_WIN_CHAT_TIME_SEP 4
|
||||
#define COLOR_WIN_CHAT_PREFIX1 5
|
||||
#define COLOR_WIN_CHAT_PREFIX2 6
|
||||
#define COLOR_WIN_CHAT_NICK 7
|
||||
#define COLOR_WIN_CHAT_HOST 8
|
||||
#define COLOR_WIN_CHAT_CHANNEL 9
|
||||
#define COLOR_WIN_CHAT_DARK 10
|
||||
#define COLOR_WIN_CHAT_HIGHLIGHT 11
|
||||
#define COLOR_WIN_STATUS 12
|
||||
#define COLOR_WIN_STATUS_DELIMITERS 13
|
||||
#define COLOR_WIN_STATUS_DATA_MSG 14
|
||||
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 15
|
||||
#define COLOR_WIN_STATUS_DATA_OTHER 16
|
||||
#define COLOR_WIN_STATUS_MORE 17
|
||||
#define COLOR_WIN_INFOBAR 18
|
||||
#define COLOR_WIN_INFOBAR_HIGHLIGHT 19
|
||||
#define COLOR_WIN_INPUT 20
|
||||
#define COLOR_WIN_INPUT_CHANNEL 21
|
||||
#define COLOR_WIN_INPUT_NICK 22
|
||||
#define COLOR_WIN_NICK 23
|
||||
#define COLOR_WIN_NICK_AWAY 24
|
||||
#define COLOR_WIN_NICK_CHANOWNER 25
|
||||
#define COLOR_WIN_NICK_CHANADMIN 26
|
||||
#define COLOR_WIN_NICK_OP 27
|
||||
#define COLOR_WIN_NICK_HALFOP 28
|
||||
#define COLOR_WIN_NICK_VOICE 29
|
||||
#define COLOR_WIN_NICK_MORE 30
|
||||
#define COLOR_WIN_NICK_SEP 31
|
||||
#define COLOR_WIN_NICK_SELF 32
|
||||
#define COLOR_WIN_NICK_PRIVATE 33
|
||||
#define COLOR_WIN_NICK_FIRST 34
|
||||
#define COLOR_WIN_NICK_LAST 43
|
||||
#define COLOR_WIN_CHAT_JOIN 7
|
||||
#define COLOR_WIN_CHAT_PART 8
|
||||
#define COLOR_WIN_CHAT_NICK 9
|
||||
#define COLOR_WIN_CHAT_HOST 10
|
||||
#define COLOR_WIN_CHAT_CHANNEL 11
|
||||
#define COLOR_WIN_CHAT_DARK 12
|
||||
#define COLOR_WIN_CHAT_HIGHLIGHT 13
|
||||
#define COLOR_WIN_STATUS 14
|
||||
#define COLOR_WIN_STATUS_DELIMITERS 15
|
||||
#define COLOR_WIN_STATUS_DATA_MSG 16
|
||||
#define COLOR_WIN_STATUS_DATA_PRIVATE 17
|
||||
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 18
|
||||
#define COLOR_WIN_STATUS_DATA_OTHER 19
|
||||
#define COLOR_WIN_STATUS_MORE 20
|
||||
#define COLOR_WIN_INFOBAR 21
|
||||
#define COLOR_WIN_INFOBAR_DELIMITERS 22
|
||||
#define COLOR_WIN_INFOBAR_HIGHLIGHT 23
|
||||
#define COLOR_WIN_INPUT 24
|
||||
#define COLOR_WIN_INPUT_CHANNEL 25
|
||||
#define COLOR_WIN_INPUT_NICK 26
|
||||
#define COLOR_WIN_NICK 27
|
||||
#define COLOR_WIN_NICK_AWAY 28
|
||||
#define COLOR_WIN_NICK_CHANOWNER 29
|
||||
#define COLOR_WIN_NICK_CHANADMIN 30
|
||||
#define COLOR_WIN_NICK_OP 31
|
||||
#define COLOR_WIN_NICK_HALFOP 32
|
||||
#define COLOR_WIN_NICK_VOICE 33
|
||||
#define COLOR_WIN_NICK_MORE 34
|
||||
#define COLOR_WIN_NICK_SEP 35
|
||||
#define COLOR_WIN_NICK_SELF 36
|
||||
#define COLOR_WIN_NICK_PRIVATE 37
|
||||
#define COLOR_WIN_NICK_FIRST 38
|
||||
#define COLOR_WIN_NICK_LAST 47
|
||||
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
|
||||
#define COLOR_DCC_SELECTED 44
|
||||
#define COLOR_DCC_WAITING 45
|
||||
#define COLOR_DCC_CONNECTING 46
|
||||
#define COLOR_DCC_ACTIVE 47
|
||||
#define COLOR_DCC_DONE 48
|
||||
#define COLOR_DCC_FAILED 49
|
||||
#define COLOR_DCC_ABORTED 50
|
||||
#define COLOR_DCC_SELECTED 48
|
||||
#define COLOR_DCC_WAITING 49
|
||||
#define COLOR_DCC_CONNECTING 50
|
||||
#define COLOR_DCC_ACTIVE 51
|
||||
#define COLOR_DCC_DONE 52
|
||||
#define COLOR_DCC_FAILED 53
|
||||
#define COLOR_DCC_ABORTED 54
|
||||
|
||||
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
|
||||
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
|
||||
@@ -98,6 +102,13 @@
|
||||
#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
|
||||
|
||||
#define KEY_SHOW_MODE_DISPLAY 1
|
||||
#define KEY_SHOW_MODE_BIND 2
|
||||
|
||||
typedef struct t_gui_message t_gui_message;
|
||||
|
||||
struct t_gui_message
|
||||
@@ -174,6 +185,7 @@ struct t_gui_buffer
|
||||
FILE *log_file; /* for logging buffer to file */
|
||||
|
||||
/* inupt buffer */
|
||||
int has_input; /* = 1 if buffer has input (DCC has not)*/
|
||||
char *input_buffer; /* input buffer */
|
||||
int input_buffer_alloc; /* input buffer: allocated size in mem */
|
||||
int input_buffer_size; /* buffer size (user input length) */
|
||||
@@ -215,6 +227,9 @@ struct t_gui_window
|
||||
int win_nick_height; /* height of nick window */
|
||||
int win_nick_start; /* # of 1st nick for display (scroll) */
|
||||
|
||||
/* input window settings */
|
||||
int win_input_x; /* position of cursor in input window */
|
||||
|
||||
/* windows for Curses GUI */
|
||||
void *win_title; /* title window */
|
||||
void *win_chat; /* chat window (example: channel) */
|
||||
@@ -248,6 +263,26 @@ struct t_gui_window
|
||||
t_gui_window *next_window; /* link to next window */
|
||||
};
|
||||
|
||||
typedef struct t_gui_key t_gui_key;
|
||||
|
||||
struct t_gui_key
|
||||
{
|
||||
char *key; /* key combo (ex: a, ^W, ^W^C, meta-a) */
|
||||
char *command; /* associated command (may be NULL) */
|
||||
void (*function)(); /* associated function (if cmd is NULL) */
|
||||
t_gui_key *prev_key; /* link to previous key */
|
||||
t_gui_key *next_key; /* link to next key */
|
||||
};
|
||||
|
||||
typedef struct t_gui_key_function t_gui_key_function;
|
||||
|
||||
struct t_gui_key_function
|
||||
{
|
||||
char *function_name; /* name of function */
|
||||
void (*function)(); /* associated function */
|
||||
char *description; /* description of function */
|
||||
};
|
||||
|
||||
/* variables */
|
||||
|
||||
extern int gui_init_ok;
|
||||
@@ -260,8 +295,15 @@ extern t_gui_buffer *gui_buffers;
|
||||
extern t_gui_buffer *last_gui_buffer;
|
||||
extern t_gui_buffer *buffer_before_dcc;
|
||||
extern t_gui_infobar *gui_infobar;
|
||||
extern t_gui_key *gui_keys;
|
||||
extern t_gui_key *last_gui_key;
|
||||
extern t_gui_key_function gui_key_functions[];
|
||||
extern char gui_key_buffer[128];
|
||||
extern int gui_key_grab;
|
||||
extern int gui_key_grab_count;
|
||||
extern char *gui_input_clipboard;
|
||||
|
||||
/* GUI independent functions */
|
||||
/* GUI independent functions: windows & buffers */
|
||||
|
||||
extern t_gui_window *gui_window_new (int, int, int, int);
|
||||
extern t_gui_buffer *gui_buffer_new (t_gui_window *, void *, void *, int, int);
|
||||
@@ -273,17 +315,61 @@ extern void gui_infobar_remove ();
|
||||
extern void gui_buffer_free (t_gui_buffer *, int);
|
||||
extern t_gui_line *gui_new_line (t_gui_buffer *);
|
||||
extern t_gui_message *gui_new_message (t_gui_buffer *);
|
||||
extern void gui_optimize_input_buffer_size (t_gui_buffer *);
|
||||
extern void gui_delete_previous_word (t_gui_buffer *);
|
||||
extern void gui_move_previous_word (t_gui_buffer *);
|
||||
extern void gui_move_next_word (t_gui_buffer *);
|
||||
extern void gui_buffer_insert_string (t_gui_buffer *, char *, int);
|
||||
extern void gui_input_clipboard_copy (char *, int);
|
||||
extern void gui_input_clipboard_paste ();
|
||||
extern void gui_input_insert_string (char *, int);
|
||||
extern void gui_input_insert_char ();
|
||||
extern void gui_input_return ();
|
||||
extern void gui_input_tab ();
|
||||
extern void gui_input_backspace ();
|
||||
extern void gui_input_delete ();
|
||||
extern void gui_input_delete_previous_word ();
|
||||
extern void gui_input_delete_next_word ();
|
||||
extern void gui_input_delete_begin_of_line ();
|
||||
extern void gui_input_delete_end_of_line ();
|
||||
extern void gui_input_delete_line ();
|
||||
extern void gui_input_transpose_chars ();
|
||||
extern void gui_input_home ();
|
||||
extern void gui_input_end ();
|
||||
extern void gui_input_left ();
|
||||
extern void gui_input_previous_word ();
|
||||
extern void gui_input_right ();
|
||||
extern void gui_input_next_word ();
|
||||
extern void gui_input_up ();
|
||||
extern void gui_input_down ();
|
||||
extern void gui_input_jump_smart ();
|
||||
extern void gui_input_jump_dcc ();
|
||||
extern void gui_input_jump_last_buffer ();
|
||||
extern void gui_input_jump_server ();
|
||||
extern void gui_input_jump_next_server ();
|
||||
extern void gui_input_hotlist_clear ();
|
||||
extern void gui_input_infobar_clear ();
|
||||
extern void gui_input_grab_key ();
|
||||
extern void gui_switch_to_previous_buffer ();
|
||||
extern void gui_switch_to_next_buffer ();
|
||||
extern void gui_switch_to_previous_window ();
|
||||
extern void gui_switch_to_next_window ();
|
||||
extern void gui_switch_to_dcc_buffer ();
|
||||
extern t_gui_buffer *gui_switch_to_buffer_by_number (t_gui_window *, int);
|
||||
extern void gui_move_buffer_to_number (t_gui_window *, int);
|
||||
extern void gui_window_print_log (t_gui_window *);
|
||||
extern void gui_buffer_print_log (t_gui_buffer *);
|
||||
|
||||
/* GUI dependant functions */
|
||||
/* GUI independent functions: keys */
|
||||
|
||||
extern void gui_key_init ();
|
||||
extern void gui_key_init_grab ();
|
||||
extern char *gui_key_get_internal_code (char *);
|
||||
extern char *gui_key_get_expanded_name (char *);
|
||||
extern void *gui_key_function_search_by_name (char *);
|
||||
extern char *gui_key_function_search_by_ptr (void *);
|
||||
extern t_gui_key *gui_key_bind (char *, char *);
|
||||
extern int gui_key_unbind (char *);
|
||||
extern int gui_key_pressed (char *);
|
||||
extern void gui_key_free (t_gui_key *);
|
||||
extern void gui_key_free_all ();
|
||||
|
||||
/* GUI dependant functions: display */
|
||||
|
||||
extern int gui_assign_color (int *, char *);
|
||||
extern int gui_get_color_by_name (char *);
|
||||
@@ -294,22 +380,18 @@ extern void gui_draw_buffer_title (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_chat (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_nick (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_status (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_infobar_time (t_gui_buffer *);
|
||||
extern void gui_draw_buffer_infobar (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_input (t_gui_buffer *, int);
|
||||
extern void gui_redraw_buffer (t_gui_buffer *);
|
||||
extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *);
|
||||
extern t_gui_buffer *gui_get_dcc_buffer ();
|
||||
extern void gui_switch_to_dcc_buffer ();
|
||||
extern void gui_switch_to_previous_buffer (t_gui_window *);
|
||||
extern void gui_switch_to_next_buffer (t_gui_window *);
|
||||
extern void gui_switch_to_previous_window (t_gui_window *);
|
||||
extern void gui_switch_to_next_window (t_gui_window *);
|
||||
extern void gui_move_page_up (t_gui_window *);
|
||||
extern void gui_move_page_down (t_gui_window *);
|
||||
extern void gui_nick_move_beginning (t_gui_window *);
|
||||
extern void gui_nick_move_end (t_gui_window *);
|
||||
extern void gui_nick_move_page_up (t_gui_window *);
|
||||
extern void gui_nick_move_page_down (t_gui_window *);
|
||||
extern void gui_input_page_up ();
|
||||
extern void gui_input_page_down ();
|
||||
extern void gui_input_nick_beginning ();
|
||||
extern void gui_input_nick_end ();
|
||||
extern void gui_input_nick_page_up ();
|
||||
extern void gui_input_nick_page_down ();
|
||||
extern void gui_curses_resize_handler ();
|
||||
extern void gui_window_init_subwindows (t_gui_window *);
|
||||
extern void gui_window_split_horiz (t_gui_window *);
|
||||
@@ -326,6 +408,7 @@ extern void gui_set_window_title ();
|
||||
extern void gui_init ();
|
||||
extern void gui_end ();
|
||||
extern void gui_printf_type_color (/*@null@*/ t_gui_buffer *, int, int, char *, ...);
|
||||
extern void gui_input_default_key_bindings ();
|
||||
extern void gui_main_loop ();
|
||||
|
||||
#endif /* gui.h */
|
||||
|
||||
+140
-9
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "../common/weechat.h"
|
||||
#include "irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
char *channel_modes = "iklmnst";
|
||||
@@ -89,7 +90,15 @@ void
|
||||
channel_free (t_irc_server *server, t_irc_channel *channel)
|
||||
{
|
||||
t_irc_channel *new_channels;
|
||||
|
||||
|
||||
/* close DCC CHAT */
|
||||
if ((t_irc_dcc *)(channel->dcc_chat) &&
|
||||
(!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status)))
|
||||
{
|
||||
dcc_close ((t_irc_dcc *)(channel->dcc_chat), DCC_ABORTED);
|
||||
dcc_redraw (1);
|
||||
}
|
||||
|
||||
/* remove channel from queue */
|
||||
if (server->last_channel == channel)
|
||||
server->last_channel = channel->prev_channel;
|
||||
@@ -103,14 +112,6 @@ channel_free (t_irc_server *server, t_irc_channel *channel)
|
||||
|
||||
if (channel->next_channel)
|
||||
(channel->next_channel)->prev_channel = channel->prev_channel;
|
||||
|
||||
/* close DCC CHAT */
|
||||
if ((t_irc_dcc *)(channel->dcc_chat) &&
|
||||
(!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status)))
|
||||
{
|
||||
dcc_close ((t_irc_dcc *)(channel->dcc_chat), DCC_ABORTED);
|
||||
dcc_redraw (1);
|
||||
}
|
||||
|
||||
/* free data */
|
||||
if (channel->name)
|
||||
@@ -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)
|
||||
*/
|
||||
|
||||
+134
-105
@@ -35,6 +35,10 @@ t_irc_command irc_commands[] =
|
||||
N_("[target]"),
|
||||
N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_admin, NULL },
|
||||
{ "amsg", N_("send message to all channels of all connected servers"),
|
||||
N_("text"),
|
||||
N_("text: text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_amsg, NULL },
|
||||
{ "away", N_("toggle away status"),
|
||||
N_("[-all] [message]"),
|
||||
N_("-all: toggle away status on all connected servers\n"
|
||||
@@ -42,11 +46,14 @@ t_irc_command irc_commands[] =
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
|
||||
{ "ban", N_("bans nicks or hosts"),
|
||||
N_("[channel] [nickname [nickname ...]]"),
|
||||
N_("channel: channel for ban\nnickname: user or host to ban"),
|
||||
N_("channel: channel for ban\n"
|
||||
"nickname: user or host to ban"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_ban, NULL },
|
||||
{ "ctcp", N_("send a ctcp message"),
|
||||
N_("nickname type"),
|
||||
N_("nickname: user to send ctcp to\ntype: \"action\" or \"version\""),
|
||||
{ "ctcp", N_("send a CTCP message (Client-To-Client Protocol)"),
|
||||
N_("nickname type [arguments]"),
|
||||
N_("nickname: user to send CTCP to\n"
|
||||
"type: CTCP type (examples: \"version\", \"ping\", ..)\n"
|
||||
"arguments: arguments for CTCP"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_ctcp, NULL },
|
||||
{ "dcc", N_("starts DCC (file or chat) or close chat"),
|
||||
N_("action [nickname [file]]"),
|
||||
@@ -55,28 +62,29 @@ t_irc_command irc_commands[] =
|
||||
"file: filename (on local host)"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_dcc, NULL },
|
||||
{ "dehalfop", N_("removes half channel operator status from nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
|
||||
{ "deop", N_("removes channel operator status from nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
|
||||
{ "devoice", N_("removes voice from nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
|
||||
{ "die", N_("shutdown the server"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, irc_cmd_send_die, NULL },
|
||||
{ "error", N_("error received from IRC server"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "halfop", N_("gives half channel operator status to nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
|
||||
{ "info", N_("get information describing the server"),
|
||||
N_("[target]"),
|
||||
N_("target: server name"),
|
||||
0, 1, 1, NULL, irc_cmd_send_info, NULL },
|
||||
{ "invite", N_("invite a nick on a channel"),
|
||||
N_("nickname channel"),
|
||||
N_("nickname: nick to invite\nchannel: channel to invite"),
|
||||
N_("nickname: nick to invite\n"
|
||||
"channel: channel to invite"),
|
||||
1, 2, 1, irc_cmd_send_invite, NULL, irc_cmd_recv_invite },
|
||||
{ "ison", N_("check if a nickname is currently on IRC"),
|
||||
N_("nickname [nickname ...]"),
|
||||
@@ -84,20 +92,26 @@ t_irc_command irc_commands[] =
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
|
||||
{ "join", N_("join a channel"),
|
||||
N_("channel[,channel] [key[,key]]"),
|
||||
N_("channel: channel name to join\nkey: key to join the channel"),
|
||||
N_("channel: channel name to join\n"
|
||||
"key: key to join the channel"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_join, irc_cmd_recv_join },
|
||||
{ "kick", N_("forcibly remove a user from a channel"),
|
||||
N_("[channel] nickname [comment]"),
|
||||
N_("channel: channel where user is\nnickname: nickname to kick\ncomment: comment for kick"),
|
||||
N_("channel: channel where user is\n"
|
||||
"nickname: nickname to kick\n"
|
||||
"comment: comment for kick"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_kick, irc_cmd_recv_kick },
|
||||
{ "kickban", N_("kicks and bans a nick from a channel"),
|
||||
N_("[channel] nickname [comment]"),
|
||||
N_("channel: channel where user is\nnickname: nickname to kick and ban\ncomment: comment for kick"),
|
||||
N_("channel: channel where user is\n"
|
||||
"nickname: nickname to kick and ban\n"
|
||||
"comment: comment for kick"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_kickban, NULL },
|
||||
{ "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 },
|
||||
N_("nickname: nickname\n"
|
||||
"comment: comment for kill"),
|
||||
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"
|
||||
@@ -145,8 +159,8 @@ t_irc_command irc_commands[] =
|
||||
0, 1, 1, NULL, irc_cmd_send_motd, NULL },
|
||||
{ "msg", N_("send message to a nick or channel"),
|
||||
N_("receiver[,receiver] text"),
|
||||
N_("receiver: nick or channel (may be mask, '*' = current channel)"
|
||||
"\ntext: text to send"),
|
||||
N_("receiver: nick or channel (may be mask, '*' = current channel)\n"
|
||||
"text: text to send"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
|
||||
{ "names", N_("list nicknames on channels"),
|
||||
N_("[channel[,channel]]"), N_("channel: channel name"),
|
||||
@@ -167,24 +181,26 @@ t_irc_command irc_commands[] =
|
||||
N_("user/password: used to get privileges on current IRC server"),
|
||||
2, 2, 1, NULL, irc_cmd_send_oper, NULL },
|
||||
{ "part", N_("leave a channel"),
|
||||
N_("[channel[,channel]] [part_message]"), N_("channel: channel name to leave\n"
|
||||
"part_message: part message (displayed to other users)"),
|
||||
N_("[channel[,channel]] [part_message]"),
|
||||
N_("channel: channel name to leave\n"
|
||||
"part_message: part message (displayed to other users)"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_part, irc_cmd_recv_part },
|
||||
{ "ping", N_("ping server"),
|
||||
N_("server1 [server2]"),
|
||||
N_("server1: server to ping\nserver2: forward ping to this server"),
|
||||
1, 2, 1, NULL, irc_cmd_send_ping, irc_cmd_recv_ping },
|
||||
{ "pong", N_("answer to a ping message"),
|
||||
N_("daemon [daemon2]"), N_("daemon: daemon who has responded to Ping message\n"
|
||||
"daemon2: forward message to this daemon"),
|
||||
N_("daemon [daemon2]"),
|
||||
N_("daemon: daemon who has responded to Ping message\n"
|
||||
"daemon2: forward message to this daemon"),
|
||||
1, 2, 1, NULL, irc_cmd_send_pong, irc_cmd_recv_pong },
|
||||
{ "privmsg", N_("message received"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
|
||||
{ "query", N_("send a private message to a nick"),
|
||||
N_("nickname [text]"),
|
||||
N_("nickname: nickname for private conversation"
|
||||
"\ntext: text to send"),
|
||||
N_("nickname: nickname for private conversation\n"
|
||||
"text: text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_query, NULL },
|
||||
{ "quit", N_("close all connections & quit"),
|
||||
N_("[quit_message]"),
|
||||
@@ -206,14 +222,17 @@ t_irc_command irc_commands[] =
|
||||
"type: reserved for future usage"),
|
||||
6, 6, 1, NULL, irc_cmd_send_service, NULL },
|
||||
{ "servlist", N_("list services currently connected to the network"),
|
||||
N_("[mask [type]]"), N_("mask: list only services matching this mask\n"
|
||||
"type: list only services of this type"),
|
||||
N_("[mask [type]]"),
|
||||
N_("mask: list only services matching this mask\n"
|
||||
"type: list only services of this type"),
|
||||
0, 2, 1, NULL, irc_cmd_send_servlist, NULL },
|
||||
{ "squery", N_("deliver a message to a service"),
|
||||
N_("service text"), N_("service: name of service\ntext: text to send"),
|
||||
N_("service text"),
|
||||
N_("service: name of service\ntext: text to send"),
|
||||
2, 2, 1, NULL, irc_cmd_send_squery, NULL },
|
||||
{ "squit", N_("disconnect server links"),
|
||||
N_("server comment"), N_("server: server name\ncomment: comment for quit"),
|
||||
N_("server comment"),
|
||||
N_("server: server name\ncomment: comment for quit"),
|
||||
2, 2, 1, NULL, irc_cmd_send_squit, NULL },
|
||||
{ "stats", N_("query statistics about server"),
|
||||
N_("[query [server]]"),
|
||||
@@ -222,21 +241,24 @@ t_irc_command irc_commands[] =
|
||||
{ "summon", N_("give users who are on a host running an IRC server a message "
|
||||
"asking them to please join IRC"),
|
||||
N_("user [target [channel]]"),
|
||||
N_("user: username\ntarget: server name\nchannel: channel name"),
|
||||
N_("user: username\ntarget: server name\n"
|
||||
"channel: channel name"),
|
||||
1, 3, 1, NULL, irc_cmd_send_summon, NULL },
|
||||
{ "time", N_("query local time from server"),
|
||||
N_("[target]"), N_("target: query time from specified server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_time, NULL },
|
||||
{ "topic", N_("get/set channel topic"),
|
||||
N_("[channel] [topic]"), N_("channel: channel name\ntopic: new topic for channel "
|
||||
"(if topic is \"-delete\" then topic is deleted)"),
|
||||
N_("[channel] [topic]"),
|
||||
N_("channel: channel name\ntopic: new topic for channel "
|
||||
"(if topic is \"-delete\" then topic is deleted)"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
|
||||
{ "trace", N_("find the route to specific server"),
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_trace, NULL },
|
||||
{ "unban", N_("unbans nicks or hosts"),
|
||||
N_("[channel] nickname [nickname ...]"),
|
||||
N_("channel: channel for unban\nnickname: user or host to unban"),
|
||||
N_("channel: channel for unban\n"
|
||||
"nickname: user or host to unban"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_unban, NULL },
|
||||
{ "userhost", N_("return a list of information about nicknames"),
|
||||
N_("nickname [nickname ...]"), N_("nickname: nickname"),
|
||||
@@ -245,80 +267,85 @@ t_irc_command irc_commands[] =
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_users, NULL },
|
||||
{ "version", N_("gives the version info of nick or server (current or specified)"),
|
||||
N_("[server | nickname]"), N_("server: server name\nnickname: nickname"),
|
||||
N_("[server | nickname]"),
|
||||
N_("server: server name\n"
|
||||
"nickname: nickname"),
|
||||
0, 1, 1, NULL, irc_cmd_send_version, NULL },
|
||||
{ "voice", N_("gives voice to nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
|
||||
{ "wallops", N_("send a message to all currently connected users who have "
|
||||
"set the 'w' user mode for themselves"),
|
||||
N_("text"), N_("text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
|
||||
{ "who", N_("generate a query which returns a list of information"),
|
||||
N_("[mask [\"o\"]]"), N_("mask: only information which match this mask\n"
|
||||
"o: only operators are returned according to the mask supplied"),
|
||||
N_("[mask [\"o\"]]"),
|
||||
N_("mask: only information which match this mask\n"
|
||||
"o: only operators are returned according to the mask supplied"),
|
||||
0, 2, 1, NULL, irc_cmd_send_who, NULL },
|
||||
{ "whois", N_("query information about user(s)"),
|
||||
N_("[server] nickname[,nickname]"), N_("server: server name\n"
|
||||
"nickname: nickname (may be a mask)"),
|
||||
N_("[server] nickname[,nickname]"),
|
||||
N_("server: server name\n"
|
||||
"nickname: nickname (may be a mask)"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_whois, NULL },
|
||||
{ "whowas", N_("ask for information about a nickname which no longer exists"),
|
||||
N_("nickname [,nickname [,nickname ...]] [count [target]]"),
|
||||
N_("nickname: nickname to search\ncount: number of replies to return "
|
||||
"(full search if negative number)\n"
|
||||
"target: reply should match this mask"),
|
||||
N_("nickname: nickname to search\n"
|
||||
"count: number of replies to return (full search if negative number)\n"
|
||||
"target: reply should match this mask"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_whowas, NULL },
|
||||
{ "001", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "002", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "003", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "004", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
|
||||
{ "005", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "212", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "219", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "250", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "251", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "252", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "253", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "254", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "255", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "256", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "257", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "258", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "259", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "260", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "261", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "262", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "263", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "264", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "265", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "266", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "267", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "268", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "269", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "301", N_("away message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
|
||||
{ "302", N_("userhost"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
|
||||
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
|
||||
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
|
||||
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
|
||||
{ "001", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "002", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "003", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "004", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
|
||||
{ "005", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "212", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "219", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "250", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "251", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "252", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "253", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "254", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "255", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "256", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "257", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "258", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "259", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "260", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "261", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "262", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "263", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "264", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "265", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "266", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "267", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "268", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "269", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "301", N_("away message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
|
||||
{ "302", N_("userhost"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
|
||||
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
|
||||
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
|
||||
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
|
||||
{ "307", N_("whois (registered nick)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
|
||||
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
|
||||
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
|
||||
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
|
||||
{ "314", N_("whowas"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
|
||||
{ "315", N_("end of /who list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
|
||||
{ "317", N_("whois (idle)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
|
||||
{ "318", N_("whois (end)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
|
||||
{ "319", N_("whois (channels)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
|
||||
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
|
||||
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
|
||||
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
|
||||
{ "314", N_("whowas"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
|
||||
{ "315", N_("end of /who list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
|
||||
{ "317", N_("whois (idle)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
|
||||
{ "318", N_("whois (end)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
|
||||
{ "319", N_("whois (channels)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
|
||||
{ "320", N_("whois (identified user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
|
||||
{ "321", N_("/list start"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
|
||||
{ "322", N_("channel (for /list)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
|
||||
{ "323", N_("/list end"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
|
||||
{ "324", N_("channel mode"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
|
||||
{ "329", "???", "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
|
||||
{ "331", N_("no topic for channel"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
|
||||
{ "321", N_("/list start"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
|
||||
{ "322", N_("channel (for /list)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
|
||||
{ "323", N_("/list end"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
|
||||
{ "324", N_("channel mode"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
|
||||
{ "329", "???", "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
|
||||
{ "331", N_("no topic for channel"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
|
||||
{ "332", N_("topic of channel"),
|
||||
N_("channel :topic"),
|
||||
N_("channel: name of channel\ntopic: topic of the channel"),
|
||||
N_("channel: name of channel\n"
|
||||
"topic: topic of the channel"),
|
||||
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 },
|
||||
{ "333", N_("infos about topic (nick & date changed)"),
|
||||
"", "",
|
||||
@@ -328,21 +355,22 @@ t_irc_command irc_commands[] =
|
||||
{ "352", N_("who"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
|
||||
{ "353", N_("list of nicks on channel"),
|
||||
N_("channel :[[@|+]nick ...]"),
|
||||
N_("channel: name of channel\nnick: nick on the channel"),
|
||||
N_("channel: name of channel\n"
|
||||
"nick: nick on the channel"),
|
||||
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_353 },
|
||||
{ "364", N_("links"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "365", N_("end of /links list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "366", N_("end of /names list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
|
||||
{ "367", N_("banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
|
||||
{ "368", N_("end of banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
|
||||
{ "364", N_("links"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "365", N_("end of /links list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "366", N_("end of /names list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
|
||||
{ "367", N_("banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
|
||||
{ "368", N_("end of banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
|
||||
{ "369", N_("end of /whowas list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "371", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "372", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "373", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "374", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "375", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "376", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "391", N_("server local time"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "371", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "372", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "373", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "374", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "375", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "376", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "391", N_("server local time"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "401", N_("no such nick/channel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "402", N_("no such server"),
|
||||
@@ -443,6 +471,7 @@ t_irc_command irc_commands[] =
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "502", N_("can't change mode for other users"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "671", N_("whois (secure connection)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
|
||||
{ "671", N_("whois (secure connection)"),
|
||||
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
|
||||
{ NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
+341
-115
@@ -63,6 +63,136 @@ dcc_redraw (int highlight)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_search: search a DCC
|
||||
*/
|
||||
|
||||
t_irc_dcc *
|
||||
dcc_search (t_irc_server *server, int type, int status, int port)
|
||||
{
|
||||
t_irc_dcc *ptr_dcc;
|
||||
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
if ((ptr_dcc->server == server)
|
||||
&& (ptr_dcc->type == type)
|
||||
&& (ptr_dcc->status = status)
|
||||
&& (ptr_dcc->port == port))
|
||||
return ptr_dcc;
|
||||
}
|
||||
|
||||
/* DCC not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_file_is_resumable: check if a file can be used for resuming a download
|
||||
*/
|
||||
|
||||
int
|
||||
dcc_file_is_resumable (t_irc_dcc *ptr_dcc, char *filename)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (!cfg_dcc_auto_resume)
|
||||
return 0;
|
||||
|
||||
if (access (filename, W_OK) == 0)
|
||||
{
|
||||
if (stat (filename, &st) != -1)
|
||||
{
|
||||
if ((unsigned long) st.st_size < ptr_dcc->size)
|
||||
{
|
||||
ptr_dcc->start_resume = (unsigned long) st.st_size;
|
||||
ptr_dcc->pos = st.st_size;
|
||||
ptr_dcc->last_check_pos = st.st_size;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* not resumable */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_find_filename: find local filename for a DCC
|
||||
* if type if file/recv, add a suffix (like .1) if needed
|
||||
* if download is resumable, set "start_resume" to good value
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_find_filename (t_irc_dcc *ptr_dcc)
|
||||
{
|
||||
char *ptr_home, *filename2;
|
||||
|
||||
ptr_home = getenv ("HOME");
|
||||
ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) +
|
||||
strlen (ptr_dcc->nick) +
|
||||
strlen (ptr_dcc->filename) +
|
||||
((cfg_dcc_download_path[0] == '~') ?
|
||||
strlen (ptr_home) : 0) +
|
||||
4);
|
||||
if (!ptr_dcc->local_filename)
|
||||
return;
|
||||
|
||||
if (cfg_dcc_download_path[0] == '~')
|
||||
{
|
||||
strcpy (ptr_dcc->local_filename, ptr_home);
|
||||
strcat (ptr_dcc->local_filename, cfg_dcc_download_path + 1);
|
||||
}
|
||||
else
|
||||
strcpy (ptr_dcc->local_filename, cfg_dcc_download_path);
|
||||
if (ptr_dcc->local_filename[strlen (ptr_dcc->local_filename) - 1] != DIR_SEPARATOR_CHAR)
|
||||
strcat (ptr_dcc->local_filename, DIR_SEPARATOR);
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->nick);
|
||||
strcat (ptr_dcc->local_filename, ".");
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->filename);
|
||||
|
||||
/* file already exists? */
|
||||
if (access (ptr_dcc->local_filename, F_OK) == 0)
|
||||
{
|
||||
if (dcc_file_is_resumable (ptr_dcc, ptr_dcc->local_filename))
|
||||
return;
|
||||
|
||||
/* if auto rename is not set, then abort DCC */
|
||||
if (!cfg_dcc_auto_rename)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
filename2 = (char *) malloc (strlen (ptr_dcc->local_filename) + 16);
|
||||
if (!filename2)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return;
|
||||
}
|
||||
ptr_dcc->filename_suffix = 0;
|
||||
do
|
||||
{
|
||||
ptr_dcc->filename_suffix++;
|
||||
sprintf (filename2, "%s.%d",
|
||||
ptr_dcc->local_filename,
|
||||
ptr_dcc->filename_suffix);
|
||||
if (access (filename2, F_OK) == 0)
|
||||
{
|
||||
if (dcc_file_is_resumable (ptr_dcc, filename2))
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
while (1);
|
||||
|
||||
free (ptr_dcc->local_filename);
|
||||
ptr_dcc->local_filename = strdup (filename2);
|
||||
free (filename2);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_calculate_speed: calculate DCC speed (for files only)
|
||||
*/
|
||||
@@ -81,7 +211,7 @@ dcc_calculate_speed (t_irc_dcc *ptr_dcc, int ended)
|
||||
elapsed = local_time - ptr_dcc->start_transfer;
|
||||
if (elapsed == 0)
|
||||
elapsed = 1;
|
||||
ptr_dcc->bytes_per_sec = ptr_dcc->pos / elapsed;
|
||||
ptr_dcc->bytes_per_sec = (ptr_dcc->pos - ptr_dcc->start_resume) / elapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -182,7 +312,7 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
|
||||
|
||||
ptr_dcc->status = status;
|
||||
|
||||
if (status == DCC_DONE)
|
||||
if ((status == DCC_DONE) || (status == DCC_ABORTED) || (status == DCC_FAILED))
|
||||
{
|
||||
if (DCC_IS_FILE(ptr_dcc->type))
|
||||
{
|
||||
@@ -192,20 +322,25 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
ptr_dcc->filename);
|
||||
gui_printf (ptr_dcc->server->buffer, _(" (local filename: "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
ptr_dcc->local_filename);
|
||||
if (ptr_dcc->local_filename)
|
||||
{
|
||||
gui_printf (ptr_dcc->server->buffer, _(" (local filename: "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
ptr_dcc->local_filename);
|
||||
gui_printf (ptr_dcc->server->buffer, ")");
|
||||
}
|
||||
if (ptr_dcc->type == DCC_FILE_SEND)
|
||||
gui_printf (ptr_dcc->server->buffer, _(") sent to "));
|
||||
gui_printf (ptr_dcc->server->buffer, _(" sent to "));
|
||||
else
|
||||
gui_printf (ptr_dcc->server->buffer, _(") received from "));
|
||||
gui_printf (ptr_dcc->server->buffer, _(" received from "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_NICK,
|
||||
"%s",
|
||||
ptr_dcc->nick);
|
||||
gui_printf (ptr_dcc->server->buffer, _(": ok!\n"));
|
||||
gui_printf (ptr_dcc->server->buffer,
|
||||
(status == DCC_DONE) ? _(": ok!\n") : _(": FAILED\n"));
|
||||
}
|
||||
}
|
||||
if (status == DCC_ABORTED)
|
||||
@@ -229,6 +364,14 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
|
||||
}
|
||||
}
|
||||
|
||||
/* remove empty file if received file failed and nothing was transfered */
|
||||
if (((status == DCC_FAILED) || (status == DCC_ABORTED))
|
||||
&& DCC_IS_FILE(ptr_dcc->type)
|
||||
&& DCC_IS_RECV(ptr_dcc->type)
|
||||
&& ptr_dcc->local_filename
|
||||
&& ptr_dcc->pos == 0)
|
||||
unlink (ptr_dcc->local_filename);
|
||||
|
||||
if (DCC_IS_CHAT(ptr_dcc->type))
|
||||
channel_remove_dcc (ptr_dcc);
|
||||
|
||||
@@ -262,7 +405,7 @@ dcc_channel_for_chat (t_irc_dcc *ptr_dcc)
|
||||
"(maybe private buffer has already DCC CHAT?)\n"),
|
||||
WEECHAT_ERROR);
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -281,18 +424,16 @@ dcc_channel_for_chat (t_irc_dcc *ptr_dcc)
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_accept: accepts a DCC file or chat request
|
||||
* dcc_recv_connect_init: connect to sender and init file or chat
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_accept (t_irc_dcc *ptr_dcc)
|
||||
dcc_recv_connect_init (t_irc_dcc *ptr_dcc)
|
||||
{
|
||||
char *ptr_home, *filename2;
|
||||
|
||||
if (!dcc_connect (ptr_dcc))
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -301,68 +442,15 @@ dcc_accept (t_irc_dcc *ptr_dcc)
|
||||
/* DCC file => look for local filename and open it in writing mode */
|
||||
if (DCC_IS_FILE(ptr_dcc->type))
|
||||
{
|
||||
ptr_home = getenv ("HOME");
|
||||
ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) +
|
||||
strlen (ptr_dcc->nick) +
|
||||
strlen (ptr_dcc->filename) +
|
||||
((cfg_dcc_download_path[0] == '~') ?
|
||||
strlen (ptr_home) : 0) +
|
||||
4);
|
||||
if (!ptr_dcc->local_filename)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
if (cfg_dcc_download_path[0] == '~')
|
||||
{
|
||||
strcpy (ptr_dcc->local_filename, ptr_home);
|
||||
strcat (ptr_dcc->local_filename, cfg_dcc_download_path + 1);
|
||||
}
|
||||
if (ptr_dcc->start_resume > 0)
|
||||
ptr_dcc->file = open (ptr_dcc->local_filename,
|
||||
O_APPEND | O_WRONLY | O_NONBLOCK);
|
||||
else
|
||||
strcpy (ptr_dcc->local_filename, cfg_dcc_download_path);
|
||||
if (ptr_dcc->local_filename[strlen (ptr_dcc->local_filename) - 1] != DIR_SEPARATOR_CHAR)
|
||||
strcat (ptr_dcc->local_filename, DIR_SEPARATOR);
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->nick);
|
||||
strcat (ptr_dcc->local_filename, ".");
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->filename);
|
||||
|
||||
/* file already exists? */
|
||||
if (access (ptr_dcc->local_filename, F_OK) == 0)
|
||||
{
|
||||
/* if auto rename is not set, then abort DCC */
|
||||
if (!cfg_dcc_auto_rename)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
|
||||
filename2 = (char *) malloc (strlen (ptr_dcc->local_filename) + 16);
|
||||
if (!filename2)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
ptr_dcc->filename_suffix = 0;
|
||||
do
|
||||
{
|
||||
ptr_dcc->filename_suffix++;
|
||||
sprintf (filename2, "%s.%d",
|
||||
ptr_dcc->local_filename,
|
||||
ptr_dcc->filename_suffix);
|
||||
}
|
||||
while (access (filename2, F_OK) == 0);
|
||||
|
||||
free (ptr_dcc->local_filename);
|
||||
ptr_dcc->local_filename = strdup (filename2);
|
||||
free (filename2);
|
||||
}
|
||||
ptr_dcc->file = open (ptr_dcc->local_filename,
|
||||
O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK,
|
||||
0644);
|
||||
ptr_dcc->file = open (ptr_dcc->local_filename,
|
||||
O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK,
|
||||
0644);
|
||||
ptr_dcc->start_transfer = time (NULL);
|
||||
ptr_dcc->last_check_time = time (NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -370,7 +458,94 @@ dcc_accept (t_irc_dcc *ptr_dcc)
|
||||
dcc_channel_for_chat (ptr_dcc);
|
||||
}
|
||||
}
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_accept: accepts a DCC file or chat request
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_accept (t_irc_dcc *ptr_dcc)
|
||||
{
|
||||
if (DCC_IS_FILE(ptr_dcc->type) && (ptr_dcc->start_resume > 0))
|
||||
{
|
||||
ptr_dcc->status = DCC_CONNECTING;
|
||||
server_sendf (ptr_dcc->server,
|
||||
(strchr (ptr_dcc->filename, ' ')) ?
|
||||
"PRIVMSG %s :\01DCC RESUME \"%s\" %d %u\01\r\n" :
|
||||
"PRIVMSG %s :\01DCC RESUME %s %d %u\01\r\n",
|
||||
ptr_dcc->nick, ptr_dcc->filename,
|
||||
ptr_dcc->port, ptr_dcc->start_resume);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
else
|
||||
dcc_recv_connect_init (ptr_dcc);
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_accept_resume: accepts a resume and inform the receiver
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_accept_resume (t_irc_server *server, char *filename, int port,
|
||||
unsigned long pos_start)
|
||||
{
|
||||
t_irc_dcc *ptr_dcc;
|
||||
|
||||
ptr_dcc = dcc_search (server, DCC_FILE_SEND, DCC_CONNECTING, port);
|
||||
if (ptr_dcc)
|
||||
{
|
||||
ptr_dcc->pos = pos_start;
|
||||
ptr_dcc->ack = pos_start;
|
||||
ptr_dcc->start_resume = pos_start;
|
||||
ptr_dcc->last_check_pos = pos_start;
|
||||
server_sendf (ptr_dcc->server,
|
||||
(strchr (ptr_dcc->filename, ' ')) ?
|
||||
"PRIVMSG %s :\01DCC ACCEPT \"%s\" %d %u\01\r\n" :
|
||||
"PRIVMSG %s :\01DCC ACCEPT %s %d %u\01\r\n",
|
||||
ptr_dcc->nick, ptr_dcc->filename,
|
||||
ptr_dcc->port, ptr_dcc->start_resume);
|
||||
|
||||
irc_display_prefix (ptr_dcc->server->buffer, PREFIX_INFO);
|
||||
gui_printf (ptr_dcc->server->buffer, _("DCC: file "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s ",
|
||||
ptr_dcc->filename);
|
||||
gui_printf (ptr_dcc->server->buffer, _("resumed at position %u\n"),
|
||||
ptr_dcc->start_resume);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
else
|
||||
gui_printf (server->buffer,
|
||||
_("%s can't resume file \"%s\" (port: %d, start position: %u): DCC not found or ended\n"),
|
||||
WEECHAT_ERROR, filename, port, pos_start);
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_start_resume: called when "DCC ACCEPT" is received (resume accepted by sender)
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_start_resume (t_irc_server *server, char *filename, int port,
|
||||
unsigned long pos_start)
|
||||
{
|
||||
t_irc_dcc *ptr_dcc;
|
||||
|
||||
ptr_dcc = dcc_search (server, DCC_FILE_RECV, DCC_CONNECTING, port);
|
||||
if (ptr_dcc)
|
||||
{
|
||||
ptr_dcc->pos = pos_start;
|
||||
ptr_dcc->ack = pos_start;
|
||||
ptr_dcc->start_resume = pos_start;
|
||||
ptr_dcc->last_check_pos = pos_start;
|
||||
dcc_recv_connect_init (ptr_dcc);
|
||||
}
|
||||
else
|
||||
gui_printf (server->buffer,
|
||||
_("%s can't resume file \"%s\" (port: %d, start position: %u): DCC not found or ended\n"),
|
||||
WEECHAT_ERROR, filename, port, pos_start);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -410,14 +585,20 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
new_dcc->filename = strdup (_("DCC chat"));
|
||||
else
|
||||
new_dcc->filename = (filename) ? strdup (filename) : NULL;
|
||||
new_dcc->local_filename = (local_filename) ? strdup (local_filename) : NULL;
|
||||
new_dcc->local_filename = NULL;
|
||||
new_dcc->filename_suffix = -1;
|
||||
new_dcc->size = size;
|
||||
new_dcc->pos = 0;
|
||||
new_dcc->ack = 0;
|
||||
new_dcc->last_check_time = 0;
|
||||
new_dcc->start_resume = 0;
|
||||
new_dcc->last_check_time = time (NULL);
|
||||
new_dcc->last_check_pos = 0;
|
||||
new_dcc->bytes_per_sec = 0;
|
||||
new_dcc->last_activity = time (NULL);
|
||||
if (local_filename)
|
||||
new_dcc->local_filename = strdup (local_filename);
|
||||
else
|
||||
dcc_find_filename (new_dcc);
|
||||
new_dcc->prev_dcc = NULL;
|
||||
new_dcc->next_dcc = dcc_list;
|
||||
if (dcc_list)
|
||||
@@ -443,6 +624,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
gui_printf (server->buffer, ", ");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%lu", size);
|
||||
gui_printf (server->buffer, _(" bytes\n"));
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
if (type == DCC_FILE_SEND)
|
||||
{
|
||||
@@ -456,6 +638,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
gui_printf (server->buffer, "), ");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%lu", size);
|
||||
gui_printf (server->buffer, _(" bytes\n"));
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
if (type == DCC_CHAT_RECV)
|
||||
{
|
||||
@@ -467,12 +650,40 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
"%d.%d.%d.%d",
|
||||
addr >> 24, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, ")\n");
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
if (type == DCC_CHAT_SEND)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_INFO);
|
||||
gui_printf (server->buffer, _("Sending DCC chat request to "));
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, "%s\n", nick);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
|
||||
if (DCC_IS_FILE(type) && (!new_dcc->local_filename))
|
||||
{
|
||||
dcc_close (new_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (DCC_IS_FILE(type) && (new_dcc->start_resume > 0))
|
||||
{
|
||||
irc_display_prefix (new_dcc->server->buffer, PREFIX_INFO);
|
||||
gui_printf (new_dcc->server->buffer, _("DCC: file "));
|
||||
gui_printf_color (new_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
new_dcc->filename);
|
||||
gui_printf (new_dcc->server->buffer, _(" (local filename: "));
|
||||
gui_printf_color (new_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
new_dcc->local_filename);
|
||||
gui_printf (new_dcc->server->buffer, ") ");
|
||||
gui_printf (new_dcc->server->buffer, _("will be resumed at position %u\n"),
|
||||
new_dcc->start_resume);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
|
||||
/* connect if needed and redraw DCC buffer */
|
||||
@@ -481,6 +692,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
if (!dcc_connect (new_dcc))
|
||||
{
|
||||
dcc_close (new_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -489,7 +701,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
|| ( (type == DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) )
|
||||
dcc_accept (new_dcc);
|
||||
else
|
||||
dcc_redraw (2);
|
||||
dcc_redraw (HOTLIST_PRIVATE);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 0);
|
||||
|
||||
return new_dcc;
|
||||
@@ -518,9 +730,9 @@ dcc_send_request (t_irc_server *server, int type, char *nick, char *filename)
|
||||
if (type == DCC_FILE_SEND)
|
||||
{
|
||||
/* add home if filename not beginning with '/' (not for Win32) */
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
filename2 = strdup (filename);
|
||||
#else
|
||||
#else
|
||||
if (filename[0] == '/')
|
||||
filename2 = strdup (filename);
|
||||
else
|
||||
@@ -550,7 +762,7 @@ dcc_send_request (t_irc_server *server, int type, char *nick, char *filename)
|
||||
strcat (filename2, DIR_SEPARATOR);
|
||||
strcat (filename2, filename);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* check if file exists */
|
||||
if (stat (filename2, &st) == -1)
|
||||
@@ -705,11 +917,11 @@ dcc_chat_sendf (t_irc_dcc *ptr_dcc, 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 (ptr_dcc->server->buffer, "[DEBUG] Sending to remote host (DCC CHAT) >>> %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,
|
||||
@@ -786,7 +998,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
|
||||
gui_printf_type_color (ptr_dcc->channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (strstr (ptr_buf, ptr_dcc->server->nick))
|
||||
if (irc_is_highlight (ptr_buf, ptr_dcc->server->nick))
|
||||
{
|
||||
gui_printf_type_color (ptr_dcc->channel->buffer,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
@@ -821,7 +1033,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
|
||||
else
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_ABORTED);
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -844,6 +1056,17 @@ dcc_handle ()
|
||||
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
/* check DCC timeout */
|
||||
if (DCC_IS_FILE(ptr_dcc->type) && !DCC_ENDED(ptr_dcc->status))
|
||||
{
|
||||
if ((cfg_dcc_timeout != 0) && (time (NULL) > ptr_dcc->last_activity + cfg_dcc_timeout))
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (ptr_dcc->status == DCC_CONNECTING)
|
||||
{
|
||||
if (ptr_dcc->type == DCC_FILE_SEND)
|
||||
@@ -858,6 +1081,7 @@ dcc_handle ()
|
||||
{
|
||||
if (FD_ISSET (ptr_dcc->sock, &read_fd))
|
||||
{
|
||||
ptr_dcc->last_activity = time (NULL);
|
||||
length = sizeof (addr);
|
||||
sock = accept (ptr_dcc->sock, (struct sockaddr *) &addr, &length);
|
||||
close (ptr_dcc->sock);
|
||||
@@ -865,21 +1089,21 @@ dcc_handle ()
|
||||
if (sock < 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->sock = sock;
|
||||
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
|
||||
ptr_dcc->status = DCC_ACTIVE;
|
||||
ptr_dcc->file = open (ptr_dcc->local_filename, O_RDONLY | O_NONBLOCK, 0644);
|
||||
ptr_dcc->start_transfer = time (NULL);
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -906,19 +1130,19 @@ dcc_handle ()
|
||||
if (sock < 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->sock = sock;
|
||||
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
|
||||
ptr_dcc->status = DCC_ACTIVE;
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
dcc_channel_for_chat (ptr_dcc);
|
||||
}
|
||||
}
|
||||
@@ -949,16 +1173,17 @@ dcc_handle ()
|
||||
if (num_read == 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (write (ptr_dcc->file, buffer, num_read) == -1)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->last_activity = time (NULL);
|
||||
ptr_dcc->pos += (unsigned long) num_read;
|
||||
pos = htonl (ptr_dcc->pos);
|
||||
send (ptr_dcc->sock, (char *) &pos, 4, 0);
|
||||
@@ -966,10 +1191,10 @@ dcc_handle ()
|
||||
if (ptr_dcc->pos >= ptr_dcc->size)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_DONE);
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
else
|
||||
dcc_redraw (0);
|
||||
dcc_redraw (HOTLIST_LOW);
|
||||
}
|
||||
}
|
||||
if (ptr_dcc->type == DCC_FILE_SEND)
|
||||
@@ -982,8 +1207,8 @@ dcc_handle ()
|
||||
"max is %d.\n"),
|
||||
sizeof (buffer));
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
if (ptr_dcc->pos > ptr_dcc->ack)
|
||||
{
|
||||
@@ -994,11 +1219,11 @@ dcc_handle ()
|
||||
if (num_read == 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
if (num_read < 4)
|
||||
return;
|
||||
continue;
|
||||
recv (ptr_dcc->sock, (char *) &pos, 4, 0);
|
||||
ptr_dcc->ack = ntohl (pos);
|
||||
|
||||
@@ -1006,8 +1231,8 @@ dcc_handle ()
|
||||
&& (ptr_dcc->ack >= ptr_dcc->size))
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_DONE);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1018,19 +1243,20 @@ dcc_handle ()
|
||||
if (num_read < 1)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
num_sent = send (ptr_dcc->sock, buffer, num_read, 0);
|
||||
if (num_sent < 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->last_activity = time (NULL);
|
||||
ptr_dcc->pos += (unsigned long) num_sent;
|
||||
dcc_calculate_speed (ptr_dcc, 0);
|
||||
dcc_redraw (0);
|
||||
dcc_redraw (HOTLIST_LOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+28
-9
@@ -57,7 +57,14 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
|
||||
gui_printf_type_color (buffer, type, COLOR_WIN_CHAT_PREFIX1, "%c ", prefix[2]);
|
||||
}
|
||||
else
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
|
||||
{
|
||||
if (strcmp (prefix, PREFIX_JOIN) == 0)
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_JOIN, "%s ", prefix);
|
||||
else if (strcmp (prefix, PREFIX_PART) == 0)
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PART, "%s ", prefix);
|
||||
else
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -66,13 +73,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 +112,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 +184,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 +217,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 : "");
|
||||
}
|
||||
|
||||
+491
-74
@@ -29,6 +29,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <sys/utsname.h>
|
||||
@@ -42,6 +43,92 @@
|
||||
#include "../plugins/plugins.h"
|
||||
|
||||
|
||||
/*
|
||||
* irc_is_highlight: returns 1 if given message contains highlight (with given nick
|
||||
* or at least one of string in "irc_higlight" setting
|
||||
*/
|
||||
|
||||
int
|
||||
irc_is_highlight (char *message, char *nick)
|
||||
{
|
||||
char *msg, *highlight, *pos, *pos_end;
|
||||
int end, length;
|
||||
|
||||
/* empty message ? */
|
||||
if (!message || !message[0])
|
||||
return 0;
|
||||
|
||||
/* highlight by nickname */
|
||||
if (strstr (message, nick))
|
||||
return 1;
|
||||
|
||||
/* no highlight by nickname and "irc_highlight" is empty */
|
||||
if (!cfg_irc_highlight || !cfg_irc_highlight[0])
|
||||
return 0;
|
||||
|
||||
/* convert both strings to lower case */
|
||||
if ((msg = strdup (message)) == NULL)
|
||||
return 0;
|
||||
if ((highlight = strdup (cfg_irc_highlight)) == NULL)
|
||||
{
|
||||
free (msg);
|
||||
return 0;
|
||||
}
|
||||
pos = msg;
|
||||
while (pos[0])
|
||||
{
|
||||
pos[0] = tolower (pos[0]);
|
||||
pos++;
|
||||
}
|
||||
pos = highlight;
|
||||
while (pos[0])
|
||||
{
|
||||
pos[0] = tolower (pos[0]);
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* look in "irc_highlight" for highlight */
|
||||
pos = highlight;
|
||||
end = 0;
|
||||
while (!end)
|
||||
{
|
||||
pos_end = strchr (pos, ',');
|
||||
if (!pos_end)
|
||||
{
|
||||
pos_end = strchr (pos, '\0');
|
||||
end = 1;
|
||||
}
|
||||
/* error parsing string! */
|
||||
if (!pos_end)
|
||||
{
|
||||
free (msg);
|
||||
free (highlight);
|
||||
return 0;
|
||||
}
|
||||
|
||||
length = pos_end - pos;
|
||||
pos_end[0] = '\0';
|
||||
if (length > 0)
|
||||
{
|
||||
/* highlight found! */
|
||||
if (strstr (msg, pos))
|
||||
{
|
||||
free (msg);
|
||||
free (highlight);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!end)
|
||||
pos = pos_end + 1;
|
||||
}
|
||||
|
||||
/* no highlight found with "irc_highlight" list */
|
||||
free (msg);
|
||||
free (highlight);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_recv_command: executes action when receiving IRC command
|
||||
* returns: 0 = all ok, command executed
|
||||
@@ -185,7 +272,7 @@ irc_cmd_recv_invite (t_irc_server *server, char *host, char *arguments)
|
||||
gui_printf (server->buffer, _("by"));
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
|
||||
" %s\n", host);
|
||||
hotlist_add (2, server->buffer);
|
||||
hotlist_add (HOTLIST_HIGHLIGHT, server->buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
else
|
||||
@@ -345,6 +432,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
|
||||
*/
|
||||
@@ -567,6 +724,31 @@ void irc_get_channel_modes (t_irc_channel *ptr_channel, char *channel_name,
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_SECRET);
|
||||
break;
|
||||
case 'q':
|
||||
pos = NULL;
|
||||
if (parm)
|
||||
{
|
||||
pos = strchr (parm, ' ');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
}
|
||||
if (nick_host)
|
||||
irc_display_mode (ptr_channel->buffer,
|
||||
channel_name, set_flag, "q", nick_host,
|
||||
(set_flag == '+') ?
|
||||
_("sets quiet on") :
|
||||
_("removes quiet on"),
|
||||
(parm) ? parm : NULL);
|
||||
|
||||
/* look for next parameter */
|
||||
if (parm && pos)
|
||||
{
|
||||
pos++;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
parm = pos;
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
if (nick_host)
|
||||
irc_display_mode (ptr_channel->buffer,
|
||||
@@ -926,7 +1108,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *arguments)
|
||||
(strcasecmp (host, "chanserv") != 0) &&
|
||||
(strcasecmp (host, "memoserv") != 0))
|
||||
{
|
||||
hotlist_add (2, server->buffer);
|
||||
hotlist_add (HOTLIST_PRIVATE, server->buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
@@ -1089,7 +1271,7 @@ int
|
||||
irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
{
|
||||
char *pos, *pos2, *host2;
|
||||
char *pos_file, *pos_addr, *pos_port, *pos_size; /* for DCC */
|
||||
char *pos_file, *pos_addr, *pos_port, *pos_size, *pos_start_resume; /* for DCC */
|
||||
t_irc_channel *ptr_channel;
|
||||
t_irc_nick *ptr_nick;
|
||||
struct utsname *buf;
|
||||
@@ -1137,7 +1319,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME);
|
||||
if (strstr (pos, server->nick))
|
||||
if (irc_is_highlight (pos, server->nick))
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
|
||||
@@ -1158,56 +1340,110 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
COLOR_WIN_CHAT_NICK, "%s", host);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, " %s\n", pos);
|
||||
return 0;
|
||||
}
|
||||
else if (strncmp (pos, "\01SOUND ", 7) == 0)
|
||||
if (strncmp (pos, "\01SOUND ", 7) == 0)
|
||||
{
|
||||
pos += 7;
|
||||
pos2 = strchr (pos, '\01');
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_INFO);
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_SERVER);
|
||||
gui_printf (ptr_channel->buffer,
|
||||
_("Received a CTCP SOUND \"%s\" from "),
|
||||
pos);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_NICK,
|
||||
"%s\n", host);
|
||||
return 0;
|
||||
}
|
||||
if (strncmp (pos, "\01PING", 5) == 0)
|
||||
{
|
||||
pos += 5;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
pos2 = strchr (pos, '\01');
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
else
|
||||
pos = NULL;
|
||||
if (pos && !pos[0])
|
||||
pos = NULL;
|
||||
if (pos)
|
||||
server_sendf (server, "NOTICE %s :\01PING %s\01\r\n",
|
||||
host, pos);
|
||||
else
|
||||
server_sendf (server, "NOTICE %s :\01PING\01\r\n",
|
||||
host);
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, "CTCP ");
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, "PING ");
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s\n", host);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* unknown CTCP ? */
|
||||
pos2 = strchr (pos + 1, '\01');
|
||||
if ((pos[0] == '\01') && pos2 && (pos2[1] == '\0'))
|
||||
{
|
||||
pos++;
|
||||
pos2[0] = '\0';
|
||||
pos2 = strchr (pos, ' ');
|
||||
if (pos2)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2++;
|
||||
if (!pos2[0])
|
||||
pos2 = NULL;
|
||||
}
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, _("Unknown CTCP "));
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, "%s ", pos);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s", host);
|
||||
if (pos2)
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, ": %s\n", pos2);
|
||||
else
|
||||
gui_printf (ptr_channel->buffer, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* other message */
|
||||
ptr_nick = nick_search (ptr_channel, host);
|
||||
if (irc_is_highlight (pos, server->nick))
|
||||
{
|
||||
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
|
||||
{
|
||||
ptr_nick = nick_search (ptr_channel, host);
|
||||
if (ptr_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);
|
||||
}
|
||||
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
|
||||
{
|
||||
@@ -1236,8 +1472,19 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
pos++;
|
||||
|
||||
/* version asked by another user => answer with WeeChat version */
|
||||
if (strcmp (pos, "\01VERSION\01") == 0)
|
||||
if (strncmp (pos, "\01VERSION", 8) == 0)
|
||||
{
|
||||
pos2 = strchr (pos + 8, ' ');
|
||||
if (pos2)
|
||||
{
|
||||
while (pos2[0] == ' ')
|
||||
pos2++;
|
||||
if (pos2[0] == '\01')
|
||||
pos2 = NULL;
|
||||
else if (!pos2[0])
|
||||
pos2 = NULL;
|
||||
}
|
||||
|
||||
buf = (struct utsname *) malloc (sizeof (struct utsname));
|
||||
if (buf && (uname (buf) == 0))
|
||||
{
|
||||
@@ -1256,15 +1503,20 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
" compiled on %s%s",
|
||||
host, "\01", PACKAGE_NAME, PACKAGE_VERSION, __DATE__,
|
||||
"\01\r\n");
|
||||
irc_display_prefix (server->buffer, PREFIX_INFO);
|
||||
irc_display_prefix (server->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("Received a "));
|
||||
COLOR_WIN_CHAT, "CTCP ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, _("CTCP VERSION "));
|
||||
COLOR_WIN_CHAT_CHANNEL, "VERSION ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("from"));
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s\n", host);
|
||||
COLOR_WIN_CHAT_NICK, " %s", host);
|
||||
if (pos2)
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, ": %s\n", pos2);
|
||||
else
|
||||
gui_printf (server->buffer, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1287,6 +1539,15 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
else
|
||||
server_sendf (server, "NOTICE %s :\01PING\01\r\n",
|
||||
host);
|
||||
irc_display_prefix (server->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, "CTCP ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, "PING ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s\n", host);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1358,9 +1619,123 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
dcc_add (server, DCC_FILE_RECV, (unsigned long) atol (pos_addr),
|
||||
dcc_add (server, DCC_FILE_RECV, strtoul (pos_addr, NULL, 10),
|
||||
atoi (pos_port), host, -1, pos_file, NULL,
|
||||
(unsigned long) atol (pos_size));
|
||||
strtoul (pos_size, NULL, 10));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* incoming DCC RESUME (asked by receiver) */
|
||||
if (strncmp (pos, "\01DCC RESUME", 11) == 0)
|
||||
{
|
||||
/* check if DCC RESUME is ok, i.e. with 0x01 at end */
|
||||
pos2 = strchr (pos + 1, '\01');
|
||||
if (!pos2)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2[0] = '\0';
|
||||
|
||||
/* DCC filename */
|
||||
pos_file = pos + 11;
|
||||
while (pos_file[0] == ' ')
|
||||
pos_file++;
|
||||
|
||||
/* look for resume start position */
|
||||
pos_start_resume = strrchr (pos_file, ' ');
|
||||
if (!pos_start_resume)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2 = pos_start_resume;
|
||||
pos_start_resume++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
/* look for DCC port */
|
||||
pos_port = strrchr (pos_file, ' ');
|
||||
if (!pos_port)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2 = pos_port;
|
||||
pos_port++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
dcc_accept_resume (server, pos_file, atoi (pos_port),
|
||||
strtoul (pos_start_resume, NULL, 10));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* incoming DCC ACCEPT (resume accepted by sender) */
|
||||
if (strncmp (pos, "\01DCC ACCEPT", 11) == 0)
|
||||
{
|
||||
/* check if DCC ACCEPT is ok, i.e. with 0x01 at end */
|
||||
pos2 = strchr (pos + 1, '\01');
|
||||
if (!pos2)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2[0] = '\0';
|
||||
|
||||
/* DCC filename */
|
||||
pos_file = pos + 11;
|
||||
while (pos_file[0] == ' ')
|
||||
pos_file++;
|
||||
|
||||
/* look for resume start position */
|
||||
pos_start_resume = strrchr (pos_file, ' ');
|
||||
if (!pos_start_resume)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2 = pos_start_resume;
|
||||
pos_start_resume++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
/* look for DCC port */
|
||||
pos_port = strrchr (pos_file, ' ');
|
||||
if (!pos_port)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2 = pos_port;
|
||||
pos_port++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
dcc_start_resume (server, pos_file, atoi (pos_port),
|
||||
strtoul (pos_start_resume, NULL, 10));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1426,7 +1801,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
return -1;
|
||||
}
|
||||
|
||||
dcc_add (server, DCC_CHAT_RECV, (unsigned long) atol (pos_addr),
|
||||
dcc_add (server, DCC_CHAT_RECV, strtoul (pos_addr, NULL, 10),
|
||||
atoi (pos_port), host, -1, NULL, NULL, 0);
|
||||
|
||||
return 0;
|
||||
@@ -1456,7 +1831,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME);
|
||||
if (strstr (pos, server->nick))
|
||||
if (irc_is_highlight (pos, server->nick))
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
|
||||
@@ -1480,33 +1855,68 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (strstr (pos, server->nick))
|
||||
/* unknown CTCP ? */
|
||||
pos2 = strchr (pos + 1, '\01');
|
||||
if ((pos[0] == '\01') && pos2 && (pos2[1] == '\0'))
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", host);
|
||||
if ( (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,
|
||||
_("Private %s> %s"),
|
||||
host, pos);
|
||||
pos++;
|
||||
pos2[0] = '\0';
|
||||
pos2 = strchr (pos, ' ');
|
||||
if (pos2)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2++;
|
||||
if (!pos2[0])
|
||||
pos2 = NULL;
|
||||
}
|
||||
irc_display_prefix (server->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("Unknown CTCP "));
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, "%s ", pos);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s", host);
|
||||
if (pos2)
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, ": %s\n", pos2);
|
||||
else
|
||||
gui_printf (server->buffer, "\n");
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_PRIVATE,
|
||||
"%s", host);
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (irc_is_highlight (pos, server->nick))
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", host);
|
||||
if ( (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,
|
||||
_("Private %s> %s"),
|
||||
host, pos);
|
||||
}
|
||||
else
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_PRIVATE,
|
||||
"%s", host);
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1794,7 +2204,14 @@ irc_cmd_recv_004 (t_irc_server *server, char *host, char *arguments)
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
server_sendf (server, "JOIN %s\r\n", ptr_channel->name);
|
||||
{
|
||||
if (ptr_channel->key)
|
||||
server_sendf (server, "JOIN %s %s\r\n",
|
||||
ptr_channel->name, ptr_channel->key);
|
||||
else
|
||||
server_sendf (server, "JOIN %s\r\n",
|
||||
ptr_channel->name);
|
||||
}
|
||||
}
|
||||
server->reconnect_join = 0;
|
||||
}
|
||||
@@ -3266,7 +3683,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, " ");
|
||||
|
||||
+179
-59
@@ -29,6 +29,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <sys/utsname.h>
|
||||
@@ -81,6 +82,61 @@ irc_cmd_send_admin (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_amsg: send message to all channels of all connected servers
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_amsg (t_irc_server *server, char *arguments)
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
t_irc_channel *ptr_channel;
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) server;
|
||||
|
||||
if (arguments)
|
||||
{
|
||||
gui_add_hotlist = 0;
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (ptr_server->is_connected)
|
||||
{
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
{
|
||||
server_sendf (ptr_server, "PRIVMSG %s :%s\r\n",
|
||||
ptr_channel->name, arguments);
|
||||
ptr_nick = nick_search (ptr_channel, ptr_server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, "%s\n", arguments);
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (ptr_server->buffer, PREFIX_ERROR);
|
||||
gui_printf (ptr_server->buffer,
|
||||
_("%s cannot find nick for sending message\n"),
|
||||
WEECHAT_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
gui_add_hotlist = 1;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_away: toggle away status
|
||||
*/
|
||||
@@ -120,9 +176,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 +216,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);
|
||||
}
|
||||
}
|
||||
@@ -274,53 +330,67 @@ irc_cmd_send_ban (t_irc_server *server, char *arguments)
|
||||
int
|
||||
irc_cmd_send_ctcp (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *pos, *pos2;
|
||||
char *pos_type, *pos_args, *pos;
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
|
||||
pos = strchr (arguments, ' ');
|
||||
if (pos)
|
||||
pos_type = strchr (arguments, ' ');
|
||||
if (pos_type)
|
||||
{
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
pos2 = strchr (pos, ' ');
|
||||
if (pos2)
|
||||
pos_type[0] = '\0';
|
||||
pos_type++;
|
||||
while (pos_type[0] == ' ')
|
||||
pos_type++;
|
||||
pos_args = strchr (pos_type, ' ');
|
||||
if (pos_args)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2++;
|
||||
pos_args[0] = '\0';
|
||||
pos_args++;
|
||||
while (pos_args[0] == ' ')
|
||||
pos_args++;
|
||||
}
|
||||
else
|
||||
pos2 = NULL;
|
||||
pos_args = NULL;
|
||||
|
||||
if (strcasecmp (pos, "version") == 0)
|
||||
pos = pos_type;
|
||||
while (pos[0])
|
||||
{
|
||||
if (pos2)
|
||||
server_sendf (server, "PRIVMSG %s :\01VERSION %s\01\r\n",
|
||||
arguments, pos2);
|
||||
else
|
||||
server_sendf (server, "PRIVMSG %s :\01VERSION\01\r\n",
|
||||
arguments);
|
||||
pos[0] = toupper (pos[0]);
|
||||
pos++;
|
||||
}
|
||||
if (strcasecmp (pos, "action") == 0)
|
||||
{
|
||||
if (pos2)
|
||||
server_sendf (server, "PRIVMSG %s :\01ACTION %s\01\r\n",
|
||||
arguments, pos2);
|
||||
else
|
||||
server_sendf (server, "PRIVMSG %s :\01ACTION\01\r\n",
|
||||
arguments);
|
||||
}
|
||||
if (strcasecmp (pos, "ping") == 0)
|
||||
|
||||
irc_display_prefix (server->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT, "CTCP");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, "(");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, "%s", arguments);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, ")");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT, ": ");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%s", pos_type);
|
||||
|
||||
if ((strcasecmp (pos_type, "ping") == 0) && (!pos_args))
|
||||
{
|
||||
gettimeofday (&tv, &tz);
|
||||
server_sendf (server, "PRIVMSG %s :\01PING %d %d\01\r\n",
|
||||
arguments, tv.tv_sec, tv.tv_usec);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT, " %d %d\n",
|
||||
tv.tv_sec, tv.tv_usec);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pos_args)
|
||||
{
|
||||
server_sendf (server, "PRIVMSG %s :\01%s %s\01\r\n",
|
||||
arguments, pos_type, pos_args);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT, " %s\n",
|
||||
pos_args);
|
||||
}
|
||||
else
|
||||
{
|
||||
server_sendf (server, "PRIVMSG %s :\01%s\01\r\n",
|
||||
arguments, pos_type);
|
||||
gui_printf (server->buffer, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -414,10 +484,17 @@ irc_cmd_send_dehalfop (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s -h %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s -h %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -440,10 +517,17 @@ irc_cmd_send_deop (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s -o %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s -o %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -466,10 +550,17 @@ irc_cmd_send_devoice (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s -v %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s -v %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -507,10 +598,17 @@ irc_cmd_send_halfop (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s +h %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s +h %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -580,7 +678,10 @@ irc_cmd_send_ison (t_irc_server *server, char *arguments)
|
||||
int
|
||||
irc_cmd_send_join (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "JOIN %s\r\n", arguments);
|
||||
if (string_is_channel (arguments))
|
||||
server_sendf (server, "JOIN %s\r\n", arguments);
|
||||
else
|
||||
server_sendf (server, "JOIN #%s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -876,7 +977,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 +1002,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 +1239,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 +1293,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;
|
||||
}
|
||||
@@ -1678,10 +1791,17 @@ irc_cmd_send_voice (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s +v %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s +v %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+640
-69
@@ -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,30 +120,54 @@ 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);
|
||||
|
||||
url = strdup (pos);
|
||||
pos_server = strchr (url, '@');
|
||||
if (pos_server)
|
||||
{
|
||||
pos_server[0] = '\0';
|
||||
pos_server++;
|
||||
pos = url + 6;
|
||||
if (!pos[0])
|
||||
{
|
||||
free (url);
|
||||
return -1;
|
||||
}
|
||||
pos2 = strchr (pos, ':');
|
||||
pos2 = strchr (url, ':');
|
||||
if (pos2)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
server->password = strdup (pos2 + 1);
|
||||
}
|
||||
server->nick1 = strdup (pos);
|
||||
server->nick1 = strdup (url);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -148,7 +182,7 @@ server_init_with_url (char *irc_url, t_irc_server *server)
|
||||
free (url);
|
||||
return -1;
|
||||
}
|
||||
pos_server = url + 6;
|
||||
pos_server = url;
|
||||
}
|
||||
if (!pos_server[0])
|
||||
{
|
||||
@@ -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);
|
||||
|
||||
+43
-7
@@ -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 */
|
||||
@@ -89,7 +98,7 @@ struct t_irc_nick
|
||||
int is_chanowner; /* chan owner? (specific to unrealircd) */
|
||||
int is_chanadmin; /* chan admin? (specific to unrealircd) */
|
||||
int is_op; /* operator privileges? */
|
||||
int is_halfop; /* half operaor privileges? */
|
||||
int is_halfop; /* half operator privileges? */
|
||||
int has_voice; /* nick has voice? */
|
||||
int is_away; /* = 1 if nick is away, otherwise 0 */
|
||||
int color; /* color for nickname in 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 */
|
||||
@@ -225,9 +242,11 @@ struct t_irc_dcc
|
||||
unsigned long size; /* file size */
|
||||
unsigned long pos; /* number of bytes received/sent */
|
||||
unsigned long ack; /* number of bytes received OK */
|
||||
unsigned long start_resume; /* start of resume (in bytes) */
|
||||
time_t last_check_time; /* last time we looked at bytes sent/rcv*/
|
||||
unsigned long last_check_pos; /* bytes sent/recv at last check */
|
||||
unsigned long bytes_per_sec; /* bytes per second */
|
||||
time_t last_activity; /* time of last byte received/sent */
|
||||
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
|
||||
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
|
||||
};
|
||||
@@ -248,9 +267,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 +287,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 +308,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) */
|
||||
@@ -301,6 +332,8 @@ extern void dcc_redraw (int);
|
||||
extern void dcc_free (t_irc_dcc *);
|
||||
extern void dcc_close (t_irc_dcc *, int);
|
||||
extern void dcc_accept (t_irc_dcc *);
|
||||
extern void dcc_accept_resume (t_irc_server *, char *, int, unsigned long);
|
||||
extern void dcc_start_resume (t_irc_server *, char *, int, unsigned long);
|
||||
extern t_irc_dcc *dcc_add (t_irc_server *, int, unsigned long, int, char *, int,
|
||||
char *, char *, unsigned long);
|
||||
extern void dcc_send_request (t_irc_server *, int, char *, char *);
|
||||
@@ -311,17 +344,19 @@ 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);
|
||||
|
||||
/* IRC protocol (irc-commands.c) */
|
||||
|
||||
extern int irc_is_highlight (char *, char *);
|
||||
extern int irc_recv_command (t_irc_server *, char *, char *, char *, char *);
|
||||
extern void irc_login (t_irc_server *);
|
||||
/* IRC commands issued by user */
|
||||
extern int irc_cmd_send_admin (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_amsg (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_away (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ban (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ctcp (t_irc_server *, char *);
|
||||
@@ -383,6 +418,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 *);
|
||||
|
||||
+50
-27
@@ -354,7 +354,7 @@ static XS (XS_IRC_add_command_handler)
|
||||
|
||||
static XS (XS_IRC_get_info)
|
||||
{
|
||||
char *arg, *info = NULL, *server;
|
||||
char *arg, *info = NULL, *server_name;
|
||||
t_irc_server *ptr_server;
|
||||
int integer;
|
||||
dXSARGS;
|
||||
@@ -364,13 +364,9 @@ static XS (XS_IRC_get_info)
|
||||
|
||||
if (items == 2)
|
||||
{
|
||||
server = SvPV (ST (0), integer);
|
||||
server_name = SvPV (ST (0), integer);
|
||||
arg = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
ptr_server = server_search (server_name);
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
@@ -385,14 +381,13 @@ static XS (XS_IRC_get_info)
|
||||
arg = SvPV (ST (0), integer);
|
||||
}
|
||||
|
||||
if (ptr_server && arg)
|
||||
if (arg)
|
||||
{
|
||||
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) ) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
@@ -402,7 +397,7 @@ static XS (XS_IRC_get_info)
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) ) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
@@ -411,7 +406,7 @@ static XS (XS_IRC_get_info)
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
|
||||
{
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
@@ -721,19 +716,18 @@ static XS (XS_weechat_get_info)
|
||||
{
|
||||
server_name = SvPV (ST (1), integer);
|
||||
ptr_server = server_search (server_name);
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s error: server not found for \"%s\" function\n"),
|
||||
"Perl", "get_info");
|
||||
XSRETURN_NO;
|
||||
}
|
||||
}
|
||||
else
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s error: server not found for \"%s\" function\n"),
|
||||
"Perl", "get_info");
|
||||
XSRETURN_NO;
|
||||
}
|
||||
|
||||
arg = SvPV (ST (0), integer);
|
||||
if (arg)
|
||||
{
|
||||
@@ -741,7 +735,7 @@ static XS (XS_weechat_get_info)
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) ) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
@@ -751,7 +745,7 @@ static XS (XS_weechat_get_info)
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) ) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
@@ -760,12 +754,41 @@ static XS (XS_weechat_get_info)
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
|
||||
{
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
return;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "100") == 0) || (strcasecmp (arg, "dccs") == 0) )
|
||||
{
|
||||
int nItems = 0;
|
||||
t_irc_dcc *p = dcc_list;
|
||||
|
||||
POPs;
|
||||
if (items == 2)
|
||||
POPs;
|
||||
|
||||
for(; p; p = p->next_dcc)
|
||||
{
|
||||
HV *infohash = (HV *) sv_2mortal((SV *) newHV());
|
||||
hv_store (infohash, "address32", 9, newSViv(p->addr), 0);
|
||||
hv_store (infohash, "cps", 3, newSViv(p->bytes_per_sec), 0);
|
||||
hv_store (infohash, "remote_file", 11, newSVpv(p->filename, 0), 0);
|
||||
hv_store (infohash, "local_file", 10, newSVpv(p->local_filename, 0), 0);
|
||||
hv_store (infohash, "nick", 4, newSVpv(p->nick, 0), 0);
|
||||
hv_store (infohash, "port", 4, newSViv(p->port), 0);
|
||||
hv_store (infohash, "pos", 3, newSVnv(p->pos), 0);
|
||||
hv_store (infohash, "size", 4, newSVnv(p->size), 0);
|
||||
hv_store (infohash, "status", 6, newSViv(p->status), 0);
|
||||
hv_store (infohash, "type", 4, newSViv(p->type), 0);
|
||||
|
||||
XPUSHs(newRV((SV *) infohash));
|
||||
++nItems;
|
||||
}
|
||||
XSRETURN(nItems);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info)
|
||||
XST_mPV (0, info);
|
||||
@@ -832,19 +855,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
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -362,6 +362,54 @@ wee_python_get_info (PyObject *self, PyObject *args)
|
||||
{
|
||||
return Py_BuildValue ("i", SERVER(gui_current_window->buffer)->is_away);
|
||||
}
|
||||
else if ( (strcasecmp (arg, "100") == 0) || (strcasecmp (arg, "dccs") == 0) )
|
||||
{
|
||||
t_irc_dcc *p = dcc_list;
|
||||
int nbdccs = 0;
|
||||
|
||||
for(; p; p = p->next_dcc)
|
||||
nbdccs++;
|
||||
|
||||
if (nbdccs == 0)
|
||||
return Py_None;
|
||||
|
||||
PyObject *list = PyList_New(nbdccs);
|
||||
|
||||
if (!list)
|
||||
return Py_None;
|
||||
|
||||
PyObject *listvalue;
|
||||
|
||||
int pos = 0;
|
||||
for(; p; p = p->next_dcc)
|
||||
{
|
||||
listvalue = Py_BuildValue("{s:k,s:k,s:s,s:s,s:s,s:i,s:k,s:k,s:i,s:i}",
|
||||
"address32", p->addr,
|
||||
"cps", p->bytes_per_sec,
|
||||
"remote_file", p->filename,
|
||||
"local_file", p->local_filename,
|
||||
"nick", p->nick,
|
||||
"port", p->port,
|
||||
"pos", p->pos,
|
||||
"size", p->size,
|
||||
"status", p->status,
|
||||
"type", p->type);
|
||||
if (listvalue)
|
||||
{
|
||||
if (PyList_SetItem(list, pos, listvalue) != 0)
|
||||
{
|
||||
PyMem_Free(listvalue);
|
||||
PyMem_Free(list);
|
||||
return Py_None;
|
||||
}
|
||||
}
|
||||
else
|
||||
return Py_None;
|
||||
pos++;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
if (info)
|
||||
return Py_BuildValue ("s", info);
|
||||
@@ -407,6 +455,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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
-5
@@ -1,5 +1,5 @@
|
||||
%define name weechat
|
||||
%define version 0.1.2
|
||||
%define version 0.1.4
|
||||
%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
|
||||
@@ -26,12 +26,12 @@ rm -rf $RPM_BUILD_ROOT
|
||||
./configure --enable-perl --enable-python
|
||||
make DESTDIR="$RPM_BUILD_ROOT" LOCALRPM="local"
|
||||
|
||||
%install
|
||||
%install
|
||||
make DESTDIR="$RPM_BUILD_ROOT" LOCALRPM="local" install
|
||||
|
||||
%find_lang %name
|
||||
|
||||
%clean
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f %{name}.lang
|
||||
@@ -40,7 +40,11 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/local/man/man1/weechat-curses.1*
|
||||
/usr/local/bin/weechat-curses
|
||||
|
||||
%changelog
|
||||
%changelog
|
||||
* Sat Jul 30 2005 FlashCode <flashcode@flashtux.org> 0.1.4-1
|
||||
- Released version 0.1.4
|
||||
* 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
File diff suppressed because it is too large
Load Diff
+27
-9
@@ -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:
|
||||
-------
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2005-05-21
|
||||
WeeChat known bugs, 2005-07-30
|
||||
|
||||
- ./configure does not check that Gtk 2.0 libraries are installed
|
||||
- when quitting WeeChat term title is not restored (if look_set_title is ON)
|
||||
|
||||
+47
-1
@@ -1,9 +1,55 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-05-21
|
||||
ChangeLog - 2005-07-30
|
||||
|
||||
|
||||
Version 0.1.4 (2005-07-30):
|
||||
* join and part/quit prefixes (arrows) now displayed with different colors
|
||||
* added "irc_highlight" setting, to get highlight with any word
|
||||
* fixed auto-rejoin for channels with key
|
||||
* fixed /ctcp command (now any command/data allowed)
|
||||
* added /amsg command (send text to all channels of all connected servers)
|
||||
* fixed SIGSEGV handler (now write a core file by aborting program)
|
||||
* fixed statusbar & infobar background refresh problem with some systems
|
||||
* added color for private in hotlist (different than color for highlight)
|
||||
* added DCC resume and timeout
|
||||
* added function for Perl/Python to get DCC list
|
||||
* fixed FIFO pipe (command now authorized on a buffer not connected
|
||||
to an IRC server)
|
||||
* topic completion now decodes UTF-8 string
|
||||
* fixed bug with IRC URL on command line (irc://)
|
||||
* new keyboard management: keys are setup in config file, new command
|
||||
/key was added and some new default keys were added, alt-k key is
|
||||
used to grab key (useful for /key command)
|
||||
* added seconds in infobar time (optional thanks to new setting)
|
||||
* fixed some curses refreshs
|
||||
* channels auto-prefixed by "#" (if no prefix found) for /join command
|
||||
|
||||
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)
|
||||
|
||||
+11
-5
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-05-21
|
||||
WeeChat FAQ, 2005-07-30
|
||||
=======================
|
||||
|
||||
Intended audience:
|
||||
@@ -50,8 +50,12 @@ Q: Why using WeeChat ? X-Chat and Irssi are so good...
|
||||
|
||||
A: Because WeeChat is very light and has new features.
|
||||
Some new features:
|
||||
* many GUI (Curses, Gtk, wxWidgets, Qt),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* many GUI (Curses, Gtk, wxWidgets, Qt)
|
||||
* nicklist available in all GUI
|
||||
* extensible with scripts (Perl, Python, Ruby)
|
||||
* horizontal and vertical window split
|
||||
* infobar highlight
|
||||
* FIFO pipe for remote control
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
@@ -83,7 +87,9 @@ A: You have to setup charset used for decoding, encoding, and internal WeeChat
|
||||
================================================================================
|
||||
Q: How can I customize key bindings?
|
||||
|
||||
A: Today you can't do that. This is planed for a future version.
|
||||
A: Key bindings are customizable with /key command.
|
||||
Default key Meta-k (usually Alt-k) lets you grab key code and insert it
|
||||
in input zone.
|
||||
|
||||
|
||||
2.5
|
||||
@@ -103,7 +109,7 @@ A: You can use /perl command to load scripts (default path is
|
||||
Q: How can I load Python scripts?
|
||||
Are Python scripts compatible with X-chat or/and Irssi ?
|
||||
|
||||
A: You can use /python command to load scripts (default path is
|
||||
A: You can use /python command to load scripts (default path is
|
||||
~/.weechat/python).
|
||||
Note that scripts in ~/.weechat/python/autoload are automatically loaded
|
||||
when WeeChat is starting up.
|
||||
|
||||
+10
-5
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-05-21
|
||||
WeeChat FAQ, 2005-07-30
|
||||
=======================
|
||||
|
||||
Public concerné :
|
||||
@@ -53,8 +53,12 @@ Q: Pourquoi utiliser WeeChat ? X-Chat et Irssi sont si bien...
|
||||
|
||||
R: Parce que WeeChat est très léger et a de nouvelles fonctionnalités.
|
||||
Quelques nouvelles fonctionnalités :
|
||||
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt),
|
||||
* extensible par des scripts (Perl, Python, Ruby),
|
||||
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt)
|
||||
* liste des pseudos disponible dans toutes les interfaces
|
||||
* extensible par des scripts (Perl, Python, Ruby)
|
||||
* découpage de la fenêtre horizontalement et verticalement
|
||||
* highlight dans la barre d'infos
|
||||
* tube FIFO pour contrôle à distance
|
||||
* développé à partir de zéro (non basé sur un quelconque client IRC)
|
||||
* multi-platformes
|
||||
* 100% GPL et libre
|
||||
@@ -87,8 +91,9 @@ R: Il faut configurer le charset utilis
|
||||
================================================================================
|
||||
Q: Comment puis-je configurer les raccourcis clavier ?
|
||||
|
||||
R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
|
||||
version future.
|
||||
R: Les raccourcis clavier sont modifiables avec la commande /key.
|
||||
La touche par défaut Meta-k (souvent Alt-k) permet de capturer le code
|
||||
d'une touche et de l'inclure dans la zone de saisie.
|
||||
|
||||
|
||||
2.5
|
||||
|
||||
+2
-4
@@ -15,9 +15,9 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
SUBDIRS = po intl src
|
||||
SUBDIRS = po doc intl src
|
||||
|
||||
EXTRA_DIST = config.rpath weechat-curses.1 BUGS FAQ FAQ.fr \
|
||||
EXTRA_DIST = config.rpath BUGS FAQ FAQ.fr \
|
||||
debian/changelog debian/control \
|
||||
debian/copyright \
|
||||
debian/rules debian/weechat-common.docs \
|
||||
@@ -25,6 +25,4 @@ EXTRA_DIST = config.rpath weechat-curses.1 BUGS FAQ FAQ.fr \
|
||||
debian/weechat-curses.install debian/weechat-gtk.dirs \
|
||||
debian/weechat-gtk.install
|
||||
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2005-07-30
|
||||
|
||||
WeeChat 0.1.4 released.
|
||||
|
||||
* FlashCode, 2005-07-02
|
||||
|
||||
WeeChat 0.1.3 released.
|
||||
|
||||
* FlashCode, 2005-05-21
|
||||
|
||||
WeeChat 0.1.2 released.
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
+15
-25
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2005-05-21
|
||||
TODO - 2005-07-20
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -10,38 +10,38 @@ Legend:
|
||||
? is this really necessary?
|
||||
|
||||
|
||||
v0.1.2:
|
||||
v0.1.4:
|
||||
------
|
||||
|
||||
* 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)
|
||||
|
||||
* WeeChat commands
|
||||
- be able to bind a key on more than one command
|
||||
- be able to make an alias running more than one command
|
||||
|
||||
* Configuration:
|
||||
- add key bindings to config file
|
||||
|
||||
* Plugins:
|
||||
# Python plugin
|
||||
# "/python load" and "/python unload" commands to (un)load Python scripts
|
||||
# irc_highlight setting to highlight custom words
|
||||
# save buffer notify levels
|
||||
# add key bindings to config file, and create /key command
|
||||
|
||||
|
||||
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,16 +52,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
|
||||
- completion system for scripts arguments
|
||||
|
||||
* Interface:
|
||||
- color for nicks (except own nick) when nick colors are disabled
|
||||
@@ -69,10 +63,6 @@ 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
|
||||
|
||||
+60
-26
@@ -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.4, 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.4])
|
||||
|
||||
# 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"
|
||||
@@ -233,6 +265,7 @@ LIBS="$LIBS $INTLLIBS"
|
||||
CFLAGS="$CFLAGS $CPPFLAGS"
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
doc/Makefile
|
||||
src/Makefile
|
||||
src/common/Makefile
|
||||
src/irc/Makefile
|
||||
@@ -286,6 +319,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
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
weechat (0.1.3-2) unstable; urgency=low
|
||||
|
||||
* Update config.{guess,sub} to fix FTBFS on k*BSD (Closes: #316791)
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Fri, 8 Jul 2005 21:30:38 +0200
|
||||
|
||||
weechat (0.1.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sat, 2 Jul 2005 20:06:29 +0200
|
||||
|
||||
weechat (0.1.2-3) unstable; urgency=low
|
||||
|
||||
* Apply patch against gui-display.c to fix curses color bug.
|
||||
* remove dh_install --sourcedir to allow builds on woody.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sun, 19 Jun 2005 22:37:11 +0200
|
||||
|
||||
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.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
4
|
||||
@@ -3,8 +3,8 @@ 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
|
||||
Standards-Version: 3.6.1
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev, libgnutls11-dev
|
||||
Standards-Version: 3.6.2.1
|
||||
|
||||
Package: weechat
|
||||
Architecture: all
|
||||
|
||||
@@ -38,9 +38,9 @@ install: build
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/weechat
|
||||
dh_install --sourcedir=debian/weechat
|
||||
install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
|
||||
dh_install
|
||||
# install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
# install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ binary-arch: build install
|
||||
dh_testroot -a
|
||||
# dh_installchangelogs -a
|
||||
# dh_installdocs -a
|
||||
dh_installman weechat-curses.1 -pweechat-curses
|
||||
dh_installman doc/weechat-curses.1 -pweechat-curses
|
||||
dh_link -a usr/share/doc/weechat-common usr/share/doc/weechat-curses
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
version=2
|
||||
http://weechat.flashtux.org/download/weechat-(\d.*)\.tar\.bz2
|
||||
@@ -1 +1 @@
|
||||
usr/share/locale
|
||||
debian/tmp/usr/share/locale/
|
||||
|
||||
@@ -1 +1 @@
|
||||
usr/bin/weechat-curses
|
||||
debian/tmp/usr/bin/weechat-curses
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
all: weechat_doc_fr.texi weechat_doc_en.texi weechat_doc_pt.texi weechat_doc_es.texi
|
||||
export LANG=fr_FR && makeinfo --html --no-split --number-sections weechat_doc_fr.texi
|
||||
export LANG=fr_FR && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_fr.texi >weechat_doc_fr.txt
|
||||
export LANG=en_EN && makeinfo --html --no-split --number-sections weechat_doc_en.texi
|
||||
export LANG=en_EN && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_en.texi >weechat_doc_en.txt
|
||||
export LANG=es_ES && makeinfo --html --no-split --number-sections weechat_doc_es.texi
|
||||
export LANG=es_ES && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_es.texi >weechat_doc_es.txt
|
||||
export LANG=pt_PT && makeinfo --html --no-split --number-sections weechat_doc_pt.texi
|
||||
export LANG=pt_PT && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_pt.texi >weechat_doc_pt.txt
|
||||
export LANG=fr_FR && texi2pdf weechat_doc_fr.texi
|
||||
export LANG=en_EN && texi2pdf weechat_doc_en.texi
|
||||
export LANG=es_ES && texi2pdf weechat_doc_es.texi
|
||||
export LANG=pt_PT && texi2pdf weechat_doc_pt.texi
|
||||
|
||||
clean:
|
||||
rm -rf weechat_doc_*.aux weechat_doc_*.cp weechat_doc_*.fn \
|
||||
weechat_doc_*.html weechat_doc_*.ky weechat_doc_*.log \
|
||||
weechat_doc_*.pdf weechat_doc_*.pg weechat_doc_*.toc \
|
||||
weechat_doc_*.tp weechat_doc_*.txt weechat_doc_*.vr
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
info_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
#weechat_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
# weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
AM_MAKEINFOHTMLFLAGS = --no-split --number-sections
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
@@ -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)
|
||||
@@ -23,10 +23,22 @@ It is compliant with RFCs 1459, 2810, 2811, 2812, and 2813.
|
||||
.br
|
||||
display config file help (list of options)
|
||||
.TP
|
||||
.B \-f, \-\-key\-functions
|
||||
.br
|
||||
display internal functions for keys
|
||||
.TP
|
||||
.B \-h, \-\-help
|
||||
.br
|
||||
display summary of options
|
||||
.TP
|
||||
.B \-i, \-\-irc\-commands
|
||||
.br
|
||||
display IRC commands
|
||||
.TP
|
||||
.B \-k, \-\-keys
|
||||
.br
|
||||
display default keys
|
||||
.TP
|
||||
.B \-l, \-\-license
|
||||
.br
|
||||
display program license
|
||||
@@ -34,12 +46,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
|
||||
+281
-154
@@ -35,9 +35,7 @@
|
||||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.1.2 - May, 21 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentation for WeeChat v0.1.4-cvs - July, 16 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -84,27 +82,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 +114,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 +137,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{apt-get install weechat-curses}
|
||||
@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 +174,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 +204,47 @@ 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 -f, --key-functions
|
||||
Display WeeChat internal functions for keys@*
|
||||
@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'@*
|
||||
@@ -311,7 +315,10 @@ Enable info bar@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Timestamp for time in infobar@*
|
||||
Type: string (any string), default value: '%B, %A %d %Y - %H:%M'@*
|
||||
Type: string (any string), default value: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Display seconds in infobar time@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Delay (in seconds) for highlight messages in infobar (0 = disable highlight notifications in infobar)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 7@*
|
||||
@@ -378,6 +385,9 @@ Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar
|
||||
Color for info bar text@*
|
||||
Type: color (Curses or Gtk color), default value: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Color for infobar delimiters@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Color for info bar highlight notification@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@@ -488,7 +498,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 +547,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 +583,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 +619,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 +660,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 +674,37 @@ Go to the beginning of command line@*
|
||||
@item End / Ctrl + E
|
||||
Go to the end of command line@*
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Erase previous / next char of command line@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
@item Ctrl + K
|
||||
Delete until end of line@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Redraw whole window@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Delete until beginning of line@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Erase previous word of command line@*
|
||||
@*
|
||||
@item Tab
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Erase previous / next char of command line@*
|
||||
@*
|
||||
@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
|
||||
@@ -680,30 +716,48 @@ Remove last infobar message@*
|
||||
@item F11 / F12
|
||||
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
|
||||
Switch to next buffer with activity (with priority: highlight, message, other)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Display current DCC@*
|
||||
@item Alt + B
|
||||
Go to previous word@*
|
||||
@*
|
||||
@item Alt + R
|
||||
@item Alt + D
|
||||
Delete next word@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Go to next word@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Clear hotlist (activity notification on other buffers)@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J then Alt + D
|
||||
Display current DCC@*
|
||||
@*
|
||||
@item Alt + J then Alt + L
|
||||
Switch to last buffer@*
|
||||
@*
|
||||
@item Alt + J then Alt + S
|
||||
Switch to server buffer@*
|
||||
@*
|
||||
@item Alt + X
|
||||
@item Alt + J then Alt + X
|
||||
Switch to first channel of next server (or server buffer if no channel is opened)@*
|
||||
@*
|
||||
@item Alt + digit (1-9)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item Alt + J then number (01-99)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Grab a key
|
||||
@*
|
||||
@item Alt + R
|
||||
Delete entire line@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@@ -715,7 +769,6 @@ Scroll nicklist@*
|
||||
WeeChat internal commands:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item alias [alias_name [command [arguments]]
|
||||
@*
|
||||
create an alias for a command@*
|
||||
@@ -765,6 +818,15 @@ display help about commands@*
|
||||
@*
|
||||
command: name of a WeeChat or IRC command@*
|
||||
@*
|
||||
@item key [key function/command] [unbind key] [functions] [reset -yes]
|
||||
@*
|
||||
bind/unbind keys@*
|
||||
@*
|
||||
key: bind this key to an internal function or a command (beginning by "/")@*
|
||||
unbind: unbind a key (if "all", default bindings are restored)@*
|
||||
functions: list internal functions for key bindings@*
|
||||
reset: restore bindings to the default values and delete ALL personal binding (use carefully!)@*
|
||||
@*
|
||||
@item perl [load filename] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
list/load/unload Perl scripts@*
|
||||
@@ -779,13 +841,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 +885,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 +1256,73 @@ nickname: nickname to search@*
|
||||
count: number of replies to return (full search if negative number)@*
|
||||
target: reply should match this mask@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
Internal functions for keys:@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminate line@*
|
||||
@item tab
|
||||
complete word@*
|
||||
@item backspace
|
||||
delete previous char@*
|
||||
@item delete
|
||||
delete next char@*
|
||||
@item delete_end_line
|
||||
delete until end of line@*
|
||||
@item delete_beginning_line
|
||||
delete until beginning of line@*
|
||||
@item delete_line
|
||||
delete entire line@*
|
||||
@item delete_previous_word
|
||||
delete previous word@*
|
||||
@item delete_next_word
|
||||
delete next word@*
|
||||
@item home
|
||||
go to beginning of line@*
|
||||
@item end
|
||||
go to end of line@*
|
||||
@item left
|
||||
move one char left@*
|
||||
@item previous_word
|
||||
move to previous word@*
|
||||
@item right
|
||||
move one char right@*
|
||||
@item next_word
|
||||
move to next word@*
|
||||
@item up
|
||||
call previous command in history@*
|
||||
@item down
|
||||
call next command in history@*
|
||||
@item page_up
|
||||
scroll one page up@*
|
||||
@item page_down
|
||||
scroll one page down@*
|
||||
@item infobar_clear
|
||||
clear infobar@*
|
||||
@item nick_page_up
|
||||
scroll nicklist one page up@*
|
||||
@item nick_page_down
|
||||
scroll nicklist one page down@*
|
||||
@item nick_beginning
|
||||
display beginning of nicklist@*
|
||||
@item nick_end
|
||||
display end of nicklist@*
|
||||
@item refresh
|
||||
refresh screen@*
|
||||
@item jump_smart
|
||||
jump to buffer with activity@*
|
||||
@item jump_dcc
|
||||
jump to DCC buffer@*
|
||||
@item jump_server
|
||||
jump to server buffer@*
|
||||
@item jump_next_server
|
||||
jump to next server@*
|
||||
@item hotlist_clear
|
||||
clear hotlist@*
|
||||
@item grab_key
|
||||
grab a key@*
|
||||
@end table
|
||||
|
||||
@node FIFO pipe, , WeeChat commands, Usage
|
||||
@@ -1215,15 +1343,19 @@ Some examples:
|
||||
@item @bullet{} change your nick on freenode to "mynick|out":
|
||||
@*
|
||||
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} display text on #weechat channel:
|
||||
@*
|
||||
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
|
||||
@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
|
||||
@*
|
||||
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1443,7 +1575,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 +1591,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 +1607,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 +1625,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 +1644,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 +1668,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 +1686,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 +1712,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 +1792,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}>@*
|
||||
|
||||
+215
-88
@@ -30,14 +30,13 @@
|
||||
@c end tex
|
||||
|
||||
@documentlanguage es
|
||||
@documentencoding ISO-8859-1
|
||||
|
||||
@titlepage
|
||||
|
||||
@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
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.4-cvs - 16 de Julio de 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -90,9 +89,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 +99,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
|
||||
@@ -150,7 +149,7 @@ Los paquetes binarios est@'an disponibles para las siguientes distribuciones:
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (o compatible con Debian)@*
|
||||
Para instalar WeeChat: @kbd{dpkg -i /direccion/weechat_x.y.z-1_i386.deb}
|
||||
Para instalar WeeChat: @kbd{apt-get install weechat-curses}
|
||||
@item
|
||||
Mandrake/Redhat (o cualquier distribuci@'on compatible con los paquetes RPM)@*
|
||||
Para instalar WeeChat: @kbd{rpm -i /direccion/weechat-x.y.z-1.i386.rpm}
|
||||
@@ -187,7 +186,7 @@ Adquiere los derechos de root e instala WeeChat:@*
|
||||
|
||||
Atenci@'on: Las fuentes CVS est@'an reservadas para usuarios con experiencia: Es posible que WeeChat no
|
||||
se instale o que se sea bastante inestable.
|
||||
¡Ya te he avisado!@*
|
||||
@exclamdown{}Ya te he avisado!@*
|
||||
|
||||
Para recuperar las fuentes CVS, escribe las l@'ineas siguientes:@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@@ -221,18 +220,25 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Obtener la ayuda del fichero de configuraci@'on (lista de opciones)@*
|
||||
@item -f, --key-functions
|
||||
Display WeeChat internal functions for keys@*
|
||||
@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 +253,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'@*
|
||||
@@ -270,7 +275,7 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
Juego de caracteres interno de WeeChat, deber@'ia ser ISO-xxxx aunque el locale sea UTF-8 (si no se especifica, se utiliza el juego de caracteres local)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'ISO-8859-1'@*
|
||||
@item look_buffer_timestamp
|
||||
Fecha y hora para las búfers@*
|
||||
Fecha y hora para las b@'ufers@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '[%H:%M:%S]'@*
|
||||
@item look_color_nicks
|
||||
Mostrar nombres de usuario con colores diferentes@*
|
||||
@@ -310,7 +315,10 @@ Activa la barra de informaci@'on@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Fecha y hora para las conversaciones guardadas@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y - %H:%M'@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Display seconds in infobar time@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Retraso (en segundos) para la notificaci@'on de mensajes en la barra de informaci@'on (0 = desactivar las notificaciones en la barra de informaci@'on)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 7@*
|
||||
@@ -377,6 +385,9 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
|
||||
@item col_infobar
|
||||
Color para el texto de la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Color para los delimitadores de la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Color para la notificaci@'on en la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'white'@*
|
||||
@@ -453,10 +464,10 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
|
||||
Color para el estado dcc "abortado"@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
|
||||
@item history_max_lines
|
||||
Número m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
|
||||
N@'umero m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 4096@*
|
||||
@item history_max_commands
|
||||
Número m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
|
||||
N@'umero m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 100@*
|
||||
@item log_auto_server
|
||||
Registrar autom@'aticamente los mensajes de servidor@*
|
||||
@@ -487,7 +498,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'@*
|
||||
@@ -510,7 +521,7 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
Aceptar autom@'aticamente los ficheros dcc entrantes@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_auto_accept_chats
|
||||
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (¡utilizar con precauci@'on!)@*
|
||||
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (@exclamdown{}utilizar con precauci@'on!)@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_timeout
|
||||
Tiempo de espera para la petici@'on dcc (en segundos)@*
|
||||
@@ -536,12 +547,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 +583,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 +619,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 +658,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
|
||||
|
||||
@@ -647,12 +674,21 @@ Ir al inicio de la l@'inea de comandos@*
|
||||
@item Fin / Ctrl + E
|
||||
Ir al final de la l@'inea de comandos@*
|
||||
@*
|
||||
@item Ctrl + K
|
||||
Delete until end of line@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Refrescar toda la ventana@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Delete until beginning of line@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Borrar la palabra anterior en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Backspace / Supr
|
||||
Borrar el caracter anterior / siguiente en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
Borrar la palabra anterior en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Tab
|
||||
Completar el comando o el seud@'onimo (@kbd{Tab} de nuevo: encontrar la pr@'oxima autocompletaci@'on)@*
|
||||
@*
|
||||
@@ -680,30 +716,48 @@ Borrar el @'ultimo mensaje en la barra de informaciones@*
|
||||
@item F11 / F12
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Refrescar toda la ventana@*
|
||||
@*
|
||||
@item Alt + flecha izquierda / Alt + flecha derecha
|
||||
Como F5 / F6@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Ir a la memoria temporal donde hay actividad (con el orden de prioridad siguiente: resaltado, mensaje, otros)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Obtener la lista de DCC actual@*
|
||||
@item Alt + B
|
||||
Go to previous word@*
|
||||
@*
|
||||
@item Alt + R
|
||||
@item Alt + D
|
||||
Delete next word@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Go to next word@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Borrar la 'hotlist' (notificaci@'on de actividad en otras memorias temporales)@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J then Alt + D
|
||||
Obtener la lista de DCC actual@*
|
||||
@*
|
||||
@item Alt + J then Alt + L
|
||||
Switch to last buffer@*
|
||||
@*
|
||||
@item Alt + J then Alt + S
|
||||
Ir a la memoria temporal del servidor@*
|
||||
@*
|
||||
@item Alt + X
|
||||
@item Alt + J then Alt + X
|
||||
Ir al primer canal del servidor siguiente (o a la memoria temporal del servidor si ning@'un canal est@'a abierto)@*
|
||||
@*
|
||||
@item Alt + (1-9)
|
||||
Saltar a la memoria temporal con ese n@'umero@*
|
||||
@*
|
||||
@item Alt + J then number (01-99)
|
||||
Saltar a la memoria temporal con ese n@'umero@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Grab a key
|
||||
@*
|
||||
@item Alt + R
|
||||
Delete entire line@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@@ -715,7 +769,6 @@ Scroll nicklist@*
|
||||
Comandos internos WeeChat:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item alias [nombre_alias [comando [argumentos]]
|
||||
@*
|
||||
crear un alias para un comando@*
|
||||
@@ -724,16 +777,16 @@ nombre_alias: nombre del seud@'onimo@*
|
||||
comando: nombre del comando (comando WeeChat @'o IRC, sin el primer '/')@*
|
||||
argumentos: par@'ametros para el comando@*
|
||||
@*
|
||||
@item buffer [acci@'on | número]
|
||||
@item buffer [acci@'on | n@'umero]
|
||||
@*
|
||||
gestionar los búfers@*
|
||||
gestionar los b@'ufers@*
|
||||
@*
|
||||
acci@'on: acci@'on a efectuar:@*
|
||||
move: desplaza el búfer en la lista (puede ser relativo, por ejemplo, -1)@*
|
||||
close: cierra el búfer (para un canal equivale a /part sin el mensaje de fin)@*
|
||||
list: lista los búfers abiertos (si no hay par@'ametros se supone esta lista)@*
|
||||
move: desplaza el b@'ufer en la lista (puede ser relativo, por ejemplo, -1)@*
|
||||
close: cierra el b@'ufer (para un canal equivale a /part sin el mensaje de fin)@*
|
||||
list: lista los b@'ufers abiertos (si no hay par@'ametros se supone esta lista)@*
|
||||
notify: fija el nivel de notificaci@'on (0=nunca, 1=highlight, 2=1+msg, 3=2+join/part)@*
|
||||
número: saltar al búfer por número@*
|
||||
n@'umero: saltar al b@'ufer por n@'umero@*
|
||||
@*
|
||||
@item clear [-all]
|
||||
@*
|
||||
@@ -765,6 +818,15 @@ mostrar ayuda sobre los comandos@*
|
||||
@*
|
||||
comando: nombre de un comando de Weechat @'o de IRC@*
|
||||
@*
|
||||
@item key [key function/command] [unbind key] [functions] [reset -yes]
|
||||
@*
|
||||
bind/unbind keys@*
|
||||
@*
|
||||
key: bind this key to an internal function or a command (beginning by "/")@*
|
||||
unbind: unbind a key (if "all", default bindings are restored)@*
|
||||
functions: list internal functions for key bindings@*
|
||||
reset: restore bindings to the default values and delete ALL personal binding (use carefully!)@*
|
||||
@*
|
||||
@item perl [load fichero] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
lista/carga/descarga de los Perl scripts@*
|
||||
@@ -779,19 +841,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 +885,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@*
|
||||
@@ -839,7 +901,7 @@ target: servidor objetivo@*
|
||||
revertir el estado ausente@*
|
||||
@*
|
||||
-all: revertir el estado ausente en todos los servidores conectados@*
|
||||
mensaje: mensaje para el estado ausente (si no se da ningún mensaje, se elimina el estado ausente)@*
|
||||
mensaje: mensaje para el estado ausente (si no se da ning@'un mensaje, se elimina el estado ausente)@*
|
||||
@*
|
||||
@item ban [canal] [usariio [usuario ...]]
|
||||
@*
|
||||
@@ -970,7 +1032,7 @@ modos del canal:@*
|
||||
s: indicador de canal secreto@*
|
||||
i: indicador de canal s@'olo con invitaci@'on@*
|
||||
t: indicador de tema s@'olo modificable por operador de canal@*
|
||||
n: ningún mensaje al canal desde el exterior@*
|
||||
n: ning@'un mensaje al canal desde el exterior@*
|
||||
m: canal moderado@*
|
||||
l: fijar el l@'imite de usuarios para el canal@*
|
||||
b: establecer una m@'ascara de baneo para mantener fuera a usuarios@*
|
||||
@@ -1186,15 +1248,81 @@ pedir informaci@'on sobre el/los usuario(s)@*
|
||||
servidor: nombre del servidor@*
|
||||
usuario: nombre de usuario (puede que sea una m@'ascara)@*
|
||||
@*
|
||||
@item whowas usuario [,usuario [,usuario ...]] [número [destinatario]]
|
||||
@item whowas usuario [,usuario [,usuario ...]] [n@'umero [destinatario]]
|
||||
@*
|
||||
pedir informaci@'on sobre un usuario que ya no existe@*
|
||||
@*
|
||||
usuario: nombre de usuario a buscar@*
|
||||
número: número de respuestas a devolver (búsqueda completa si el número es negativo)@*
|
||||
n@'umero: n@'umero de respuestas a devolver (b@'usqueda completa si el n@'umero es negativo)@*
|
||||
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
Internal functions for keys:@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminate line@*
|
||||
@item tab
|
||||
complete word@*
|
||||
@item backspace
|
||||
delete previous char@*
|
||||
@item delete
|
||||
delete next char@*
|
||||
@item delete_end_line
|
||||
delete until end of line@*
|
||||
@item delete_beginning_line
|
||||
delete until beginning of line@*
|
||||
@item delete_line
|
||||
delete entire line@*
|
||||
@item delete_previous_word
|
||||
delete previous word@*
|
||||
@item delete_next_word
|
||||
delete next word@*
|
||||
@item home
|
||||
go to beginning of line@*
|
||||
@item end
|
||||
go to end of line@*
|
||||
@item left
|
||||
move one char left@*
|
||||
@item previous_word
|
||||
move to previous word@*
|
||||
@item right
|
||||
move one char right@*
|
||||
@item next_word
|
||||
move to next word@*
|
||||
@item up
|
||||
call previous command in history@*
|
||||
@item down
|
||||
call next command in history@*
|
||||
@item page_up
|
||||
scroll one page up@*
|
||||
@item page_down
|
||||
scroll one page down@*
|
||||
@item infobar_clear
|
||||
clear infobar@*
|
||||
@item nick_page_up
|
||||
scroll nicklist one page up@*
|
||||
@item nick_page_down
|
||||
scroll nicklist one page down@*
|
||||
@item nick_beginning
|
||||
display beginning of nicklist@*
|
||||
@item nick_end
|
||||
display end of nicklist@*
|
||||
@item refresh
|
||||
refresh screen@*
|
||||
@item jump_smart
|
||||
jump to buffer with activity@*
|
||||
@item jump_dcc
|
||||
jump to DCC buffer@*
|
||||
@item jump_server
|
||||
jump to server buffer@*
|
||||
@item jump_next_server
|
||||
jump to next server@*
|
||||
@item hotlist_clear
|
||||
clear hotlist@*
|
||||
@item grab_key
|
||||
grab a key@*
|
||||
@end table
|
||||
|
||||
@node Canal FIFO, , Comandos WeeChat, Uso
|
||||
@@ -1217,15 +1345,19 @@ Algunos ejemplos:
|
||||
@item @bullet{} cambiar el seud@'onimo en freenode por "mynick|out":
|
||||
@*
|
||||
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} escribir texto en el canal #weechat:
|
||||
@*
|
||||
@command{echo "freenode,#weechat *@exclamdown{}Hola a todos!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} escribir texto en el canal corriente (el que se puede visualizar en WeeChat actualmente)
|
||||
@*
|
||||
@command{echo "*¡Hola!" >~/.weechat/weechat_fifo_12345}@*
|
||||
@command{echo "*@exclamdown{}Hola!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Advertencia:} esto es peligroso y no deber@'ias hacerlo.. salvo si lo que est@'as haciendo.
|
||||
@*
|
||||
@item @bullet{} enviar dos comandos para descargar y recargar los scripts Perl (tienes que separarlos con un \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1352,7 +1484,7 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
|
||||
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
|
||||
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
|
||||
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
|
||||
@code{@ @ @ @ weechat::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
|
||||
@code{@ @ @ @ weechat::print ("masc=$mascara, canal=$canal, msj=$mensaje\n");}@*
|
||||
@code{@} }@*
|
||||
@*
|
||||
|
||||
@@ -1445,7 +1577,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 +1593,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 +1609,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 +1647,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("masc="+mascara+", canal="+canal+", msj="+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 +1671,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 +1689,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 +1714,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
|
||||
@@ -1596,7 +1723,7 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
|
||||
@node Programas Ruby, , Programas Python, Extensiones
|
||||
@section Programas Ruby
|
||||
|
||||
¡No desarrollado!
|
||||
@exclamdown{}No desarrollado!
|
||||
|
||||
@c **************************** Autores / Soporte *****************************
|
||||
|
||||
|
||||
+288
-157
@@ -30,14 +30,13 @@
|
||||
@c end tex
|
||||
|
||||
@documentlanguage fr
|
||||
@documentencoding ISO-8859-1
|
||||
|
||||
@titlepage
|
||||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.1.2 - 21 Mai 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentation pour WeeChat v0.1.4-cvs - 16 Juillet 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -83,27 +82,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 +114,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 +137,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{apt-get install weechat-curses}
|
||||
@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 +174,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 +205,47 @@ 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 -f, --key-functions
|
||||
Afficher la liste des fonctions internes WeeChat pour les touches@*
|
||||
@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 +254,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'@*
|
||||
@@ -311,7 +316,10 @@ Active la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Horodatage pour les conversations sauvegard@'ees@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y - %H:%M'@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Afficher les secondes pour l'heure dans la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
D@'elai (en secondes) pour la notification des messages dans la barre d'infos (0 = d@'esactiver les notifications dans la barre d'infos)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 7@*
|
||||
@@ -378,6 +386,9 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar
|
||||
Couleur pour la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Couleur pour les d@'elimiteurs de la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Couleur pour la notification dans la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@@ -418,7 +429,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 +499,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 +548,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 +584,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 +620,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 +661,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 +675,37 @@ 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
|
||||
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
@item Ctrl + K
|
||||
Efface jusqu'@`a la fin de la ligne@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
R@'eaffiche toute la fen@^etre@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Efface jusqu'au d@'ebut de la ligne@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
|
||||
@*
|
||||
@item Tab
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@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
|
||||
@@ -680,30 +717,48 @@ Effacer le dernier message de la barre d'infos@*
|
||||
@item F11 / F12
|
||||
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
|
||||
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
|
||||
@*
|
||||
@item Alt + B
|
||||
Aller au mot pr@'ec@'edent@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Effacer le mot suivant@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Aller au mot suivant@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Vide la hotlist (notification d'activit@'e sur les autres tampons)@*
|
||||
@*
|
||||
@item Alt + J puis Alt + D
|
||||
Afficher les DCC en cours@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Vide la hotlist (notification d'activité sur les autres tampons)@*
|
||||
@item Alt + J puis Alt + L
|
||||
Sauter au dernier tampon@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J puis Alt + S
|
||||
Sauter au tampon du serveur@*
|
||||
@*
|
||||
@item Alt + X
|
||||
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
|
||||
@*
|
||||
@item Alt + chiffre (1-9)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item Alt + J then Alt + X
|
||||
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Capturer une touche
|
||||
@*
|
||||
@item Alt + J puis nombre (01-99)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Effacer la ligne enti@`ere@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Faire d@'efiler la liste des pseudos@*
|
||||
@*
|
||||
@@ -715,7 +770,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@*
|
||||
@@ -765,6 +819,15 @@ afficher l'aide sur les commandes@*
|
||||
@*
|
||||
commande: nom d'une commande WeeChat ou IRC@*
|
||||
@*
|
||||
@item key [touche fonction/commande] [unbind touche] [functions] [reset -yes]
|
||||
@*
|
||||
associer/lib@'erer des touches@*
|
||||
@*
|
||||
touche: associer cette touche @`a une fonction interne ou une commande (commen@,{c}ant par "/")@*
|
||||
unbind: supprimer l'association @`a une touche (si "all", toutes les associations de touches par d@'efaut sont restaur@'ees)@*
|
||||
functions: lister la liste des fonctions internes pour les associations de touches@*
|
||||
reset: restaur les touches aux valeurs par d@'efaut et supprime TOUTES les touches personnelles (utiliser avec pr@'ecaution !)@*
|
||||
@*
|
||||
@item perl [load fichier] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
liste/charge/d@'echarge des scripts Perl@*
|
||||
@@ -779,13 +842,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 +886,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 +1257,73 @@ 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
|
||||
|
||||
Fonctions internes pour les touches :@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminer la ligne@*
|
||||
@item tab
|
||||
compl@'eter le mot@*
|
||||
@item backspace
|
||||
effacer le caract@`ere pr@'ec@'edent@*
|
||||
@item delete
|
||||
effacer le caract@`ere suivant@*
|
||||
@item delete_end_line
|
||||
effacer jusqu'@`a la fin de la ligne@*
|
||||
@item delete_beginning_line
|
||||
effacer jusqu'au d@'ebut de la ligne@*
|
||||
@item delete_line
|
||||
effacer la ligne enti@`ere@*
|
||||
@item delete_previous_word
|
||||
effacer le mot pr@'ec@'edent@*
|
||||
@item delete_next_word
|
||||
effacer le mot suivant@*
|
||||
@item home
|
||||
aller au d@'ebut de la ligne@*
|
||||
@item end
|
||||
aller @`a la fin de la ligne@*
|
||||
@item left
|
||||
se d@'eplacer d'un caract@`ere @`a gauche@*
|
||||
@item previous_word
|
||||
se d@'eplacer au mot pr@'ec@'edent@*
|
||||
@item right
|
||||
se d@'eplacer d'un caract@`ere @`a droite@*
|
||||
@item next_word
|
||||
se d@'eplacer au mot suivant@*
|
||||
@item up
|
||||
appeler la commande pr@'ec@'edente dans l'historique@*
|
||||
@item down
|
||||
appeler la commande suivante dans l'historique@*
|
||||
@item page_up
|
||||
faire d@'efiler d'une page vers le haut@*
|
||||
@item page_down
|
||||
faire d@'efiler d'une page vers le bas@*
|
||||
@item infobar_clear
|
||||
effacer la barre d'infos@*
|
||||
@item nick_page_up
|
||||
faire d@'efiler la liste des pseudos d'une page vers le haut@*
|
||||
@item nick_page_down
|
||||
faire d@'efiler la liste des pseudos d'une page vers le bas@*
|
||||
@item nick_beginning
|
||||
afficher le d@'ebut de la liste des pseudos@*
|
||||
@item nick_end
|
||||
afficher la fin de la liste des pseudos@*
|
||||
@item refresh
|
||||
rafraichir l'@'ecran@*
|
||||
@item jump_smart
|
||||
sauter au tampon avec de l'activit@'e@*
|
||||
@item jump_dcc
|
||||
sauter au tampon DCC@*
|
||||
@item jump_server
|
||||
sauter au tampon du serveur@*
|
||||
@item jump_next_server
|
||||
sauter au prochain serveur@*
|
||||
@item hotlist_clear
|
||||
effacer la liste d'activit@'e@*
|
||||
@item grab_key
|
||||
capturer une touche@*
|
||||
@end table
|
||||
|
||||
@node Tube FIFO, , Commandes WeeChat, Utilisation
|
||||
@@ -1216,14 +1345,21 @@ serveur doit l'@^etre aussi.@*
|
||||
Quelques exemples :
|
||||
@table @asis
|
||||
@item @bullet{} changement du pseudo sur freenode en "pseudo|absent":
|
||||
@*
|
||||
@command{echo "freenode */nick pseudo|absent" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} affichage de texte sur le canal #weechat :
|
||||
@*
|
||||
@command{echo "freenode,#weechat *bonjour tout le monde !" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} affichage de texte sur le canal courant (le tampon affich@'e par WeeChat):
|
||||
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}@*
|
||||
@*
|
||||
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Attention :} ceci est dangereux et vous ne devriez pas le faire sauf si vous savez ce que vous faites !
|
||||
@item @bullet{} envoyer deux commandes pour décharger/recharger les scripts Perl (vous devez les séparer par \n):
|
||||
@*
|
||||
@item @bullet{} envoyer deux commandes pour d@'echarger/recharger les scripts Perl (vous devez les s@'eparer par \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1351,7 +1487,7 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
|
||||
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
|
||||
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
|
||||
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
|
||||
@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, message=$message\n");}@*
|
||||
@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, msg=$message\n");}@*
|
||||
@code{@} }@*
|
||||
@*
|
||||
|
||||
@@ -1444,7 +1580,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 +1597,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 +1613,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 +1631,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 +1651,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 +1675,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 +1693,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 +1718,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
|
||||
|
||||
+1053
-51
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -18,6 +18,7 @@
|
||||
./src/gui/gtk/gui-display.c
|
||||
./src/gui/gtk/gui-input.c
|
||||
./src/gui/gui-common.c
|
||||
./src/gui/gui-keyboard.c
|
||||
./src/gui/gui.h
|
||||
./src/common/command.c
|
||||
./src/common/command.h
|
||||
|
||||
+1269
-859
File diff suppressed because it is too large
Load Diff
+1256
-843
File diff suppressed because it is too large
Load Diff
+1280
-890
File diff suppressed because it is too large
Load Diff
+238
-56
@@ -47,11 +47,11 @@ t_weechat_command weechat_commands[] =
|
||||
{ "buffer", N_("manage buffers"),
|
||||
N_("[action | number]"),
|
||||
N_("action: action to do:\n"
|
||||
" move: move buffer in the list (may be relative, for example -1)\n"
|
||||
" close: close buffer (for channel: same as /part without part message)\n"
|
||||
" list: list opened buffers (no parameter implies this list)\n"
|
||||
" notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
|
||||
"number: jump to buffer by number"),
|
||||
" move: move buffer in the list (may be relative, for example -1)\n"
|
||||
" close: close buffer (for channel: same as /part without part message)\n"
|
||||
" list: list opened buffers (no parameter implies this list)\n"
|
||||
" notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
|
||||
"number: jump to buffer by number"),
|
||||
0, MAX_ARGS, weechat_cmd_buffer, NULL },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
@@ -72,31 +72,40 @@ t_weechat_command weechat_commands[] =
|
||||
{ "help", N_("display help about commands"),
|
||||
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
|
||||
0, 1, weechat_cmd_help, NULL },
|
||||
{ "key", N_("bind/unbind keys"),
|
||||
N_("[key function/command] [unbind key] [functions] [reset -yes]"),
|
||||
N_("key: bind this key to an internal function or a command (beginning by \"/\")\n"
|
||||
"unbind: unbind a key (if \"all\", default bindings are restored)\n"
|
||||
"functions: list internal functions for key bindings\n"
|
||||
"reset: restore bindings to the default values and delete ALL personal binding (use carefully!)"),
|
||||
0, MAX_ARGS, NULL, weechat_cmd_key },
|
||||
{ "perl", N_("list/load/unload Perl scripts"),
|
||||
N_("[load filename] | [autoload] | [reload] | [unload]"),
|
||||
N_("filename: Perl script (file) to load\n"
|
||||
"Without argument, /perl command lists all loaded Perl scripts."),
|
||||
"Without argument, /perl command lists all loaded Perl scripts."),
|
||||
0, 2, weechat_cmd_perl, NULL },
|
||||
{ "python", N_("list/load/unload Python scripts"),
|
||||
N_("[load filename] | [autoload] | [reload] | [unload]"),
|
||||
N_("filename: Python script (file) to load\n"
|
||||
"Without argument, /python command lists all loaded Python scripts."),
|
||||
"Without argument, /python command lists all loaded Python scripts."),
|
||||
0, 2, weechat_cmd_python, NULL },
|
||||
{ "server", N_("list, add or remove servers"),
|
||||
N_("[servername] | "
|
||||
"[servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 "
|
||||
"[nick2 [nick3]]] [-username username] [-realname realname] "
|
||||
"[-command command] [-autojoin channel[,channel]] ] | "
|
||||
"[del 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]"),
|
||||
N_("servername: server name, for internal & display use\n"
|
||||
"hostname: name or IP address of server\n"
|
||||
"port: port for server (integer)\n"
|
||||
"password: password for server\n"
|
||||
"nick1: first nick for server\n"
|
||||
"nick2: alternate nick for server\n"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user"),
|
||||
"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"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user"),
|
||||
0, MAX_ARGS, weechat_cmd_server, NULL },
|
||||
{ "save", N_("save config to disk"),
|
||||
N_("[file]"), N_("file: filename for writing config"),
|
||||
@@ -109,11 +118,10 @@ t_weechat_command weechat_commands[] =
|
||||
1, 1, NULL, weechat_cmd_unalias },
|
||||
{ "window", N_("manage windows"),
|
||||
N_("[list | splith | splitv | [merge [down | up | left | right | all]]]"),
|
||||
N_(
|
||||
"list: list opened windows (no parameter implies this list)\n"
|
||||
"splith: split current window horizontally\n"
|
||||
"splitv: split current window vertically\n"
|
||||
"merge: merge window with another"),
|
||||
N_("list: list opened windows (no parameter implies this list)\n"
|
||||
"splith: split current window horizontally\n"
|
||||
"splitv: split current window vertically\n"
|
||||
"merge: merge window with another"),
|
||||
0, 2, weechat_cmd_window, NULL },
|
||||
{ NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
|
||||
};
|
||||
@@ -706,7 +714,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);
|
||||
@@ -875,6 +883,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
t_irc_channel *ptr_channel;
|
||||
long number;
|
||||
char *error;
|
||||
int target_buffer;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
@@ -962,7 +971,9 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
if (SERVER(gui_current_window->buffer))
|
||||
{
|
||||
if (SERVER(gui_current_window->buffer)->is_connected)
|
||||
if (SERVER(gui_current_window->buffer)->is_connected
|
||||
&& CHANNEL(gui_current_window->buffer)
|
||||
&& CHANNEL(gui_current_window->buffer)->nicks)
|
||||
irc_cmd_send_part (SERVER(gui_current_window->buffer), NULL);
|
||||
else
|
||||
{
|
||||
@@ -995,7 +1006,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 +1022,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;
|
||||
}
|
||||
}
|
||||
@@ -1034,26 +1058,41 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
/* jump to buffer by number */
|
||||
|
||||
error = NULL;
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
if (argv[0][0] == '-')
|
||||
{
|
||||
if (!gui_switch_to_buffer_by_number (gui_current_window, (int) number))
|
||||
/* relative jump '-' */
|
||||
error = NULL;
|
||||
number = strtol (argv[0] + 1, &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s buffer \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[0], "buffer");
|
||||
return -1;
|
||||
target_buffer = gui_current_window->buffer->number - (int) number;
|
||||
if (target_buffer < 1)
|
||||
target_buffer = (last_gui_buffer) ? last_gui_buffer->number + target_buffer : 1;
|
||||
gui_switch_to_buffer_by_number (gui_current_window,
|
||||
target_buffer);
|
||||
}
|
||||
}
|
||||
else if (argv[0][0] == '+')
|
||||
{
|
||||
/* relative jump '+' */
|
||||
error = NULL;
|
||||
number = strtol (argv[0] + 1, &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
target_buffer = gui_current_window->buffer->number + (int) number;
|
||||
if (last_gui_buffer && target_buffer > last_gui_buffer->number)
|
||||
target_buffer -= last_gui_buffer->number;
|
||||
gui_switch_to_buffer_by_number (gui_current_window,
|
||||
target_buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s incorrect buffer number\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
/* absolute jump by number */
|
||||
error = NULL;
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
gui_switch_to_buffer_by_number (gui_current_window, (int) number);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1163,7 +1202,7 @@ weechat_cmd_debug (int argc, char **argv)
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "perl");
|
||||
WEECHAT_ERROR, "debug");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1307,6 +1346,139 @@ weechat_cmd_help (int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_key_display: display a key binding
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_cmd_key_display (t_gui_key *key, int new_key)
|
||||
{
|
||||
char *expanded_name;
|
||||
|
||||
expanded_name = gui_key_get_expanded_name (key->key);
|
||||
if (new_key)
|
||||
{
|
||||
gui_printf (NULL, _("New key binding:\n"));
|
||||
gui_printf (NULL, " %s", (expanded_name) ? expanded_name : key->key);
|
||||
}
|
||||
else
|
||||
gui_printf (NULL, " %20s", (expanded_name) ? expanded_name : key->key);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, " => ");
|
||||
gui_printf (NULL, "%s\n",
|
||||
(key->function) ?
|
||||
gui_key_function_search_by_ptr (key->function) : key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_key: bind/unbind keys
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_key (char *arguments)
|
||||
{
|
||||
char *pos;
|
||||
int i;
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
if (arguments)
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
}
|
||||
|
||||
if (!arguments || (arguments[0] == '\0'))
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("Key bindings:\n"));
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
weechat_cmd_key_display (ptr_key, 0);
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "unbind ", 7) == 0)
|
||||
{
|
||||
arguments += 7;
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (gui_key_unbind (arguments))
|
||||
gui_printf (NULL, _("Key \"%s\" unbinded\n"), arguments);
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to unbind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, arguments);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp (arguments, "functions") == 0)
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("Internal key functions:\n"));
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
gui_printf (NULL, "%25s %s\n",
|
||||
gui_key_functions[i].function_name,
|
||||
_(gui_key_functions[i].description));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "reset", 5) == 0)
|
||||
{
|
||||
arguments += 5;
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (strcasecmp (arguments, "-yes") == 0)
|
||||
{
|
||||
gui_key_free_all ();
|
||||
gui_key_init ();
|
||||
gui_printf (NULL, _("Default key bindings restored\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s \"-yes\" argument is required for keys reset (securuty reason)\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
pos = strchr (arguments, ' ');
|
||||
if (!pos)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s wrong argument count for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "key");
|
||||
return -1;
|
||||
}
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
ptr_key = gui_key_bind (arguments, pos);
|
||||
if (ptr_key)
|
||||
weechat_cmd_key_display (ptr_key, 1);
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to bind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, arguments);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_perl: list/load/unload Perl scripts
|
||||
*/
|
||||
@@ -1554,7 +1726,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 +1923,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 +2014,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);
|
||||
@@ -1872,11 +2049,11 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_set_cmd_display_option: display config option
|
||||
* weechat_cmd_set_display_option: display config option
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_set_cmd_display_option (t_config_option *option, char *prefix, void *value)
|
||||
weechat_cmd_set_display_option (t_config_option *option, char *prefix, void *value)
|
||||
{
|
||||
char *color_name, *pos_nickserv, *pos_pwd, *value2;
|
||||
|
||||
@@ -2019,7 +2196,7 @@ weechat_cmd_set (char *arguments)
|
||||
{
|
||||
ptr_option_value = config_get_server_option_ptr (ptr_server,
|
||||
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
|
||||
weechat_set_cmd_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
weechat_cmd_set_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
ptr_server->name,
|
||||
ptr_option_value);
|
||||
}
|
||||
@@ -2060,7 +2237,7 @@ weechat_cmd_set (char *arguments)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s", config_get_section (ptr_option));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "]\n");
|
||||
weechat_set_cmd_display_option (ptr_option, NULL, NULL);
|
||||
weechat_cmd_set_display_option (ptr_option, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2084,7 +2261,8 @@ weechat_cmd_set (char *arguments)
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
section_displayed = 0;
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -2102,7 +2280,7 @@ weechat_cmd_set (char *arguments)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "]\n");
|
||||
section_displayed = 1;
|
||||
}
|
||||
weechat_set_cmd_display_option (&weechat_options[i][j], NULL, NULL);
|
||||
weechat_cmd_set_display_option (&weechat_options[i][j], NULL, NULL);
|
||||
number_found++;
|
||||
}
|
||||
}
|
||||
@@ -2135,7 +2313,7 @@ weechat_cmd_set (char *arguments)
|
||||
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
|
||||
if (ptr_option_value)
|
||||
{
|
||||
weechat_set_cmd_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
weechat_cmd_set_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
ptr_server->name,
|
||||
ptr_option_value);
|
||||
number_found++;
|
||||
@@ -2268,6 +2446,10 @@ weechat_cmd_window (int argc, char **argv)
|
||||
else
|
||||
gui_window_merge_auto (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "-1") == 0)
|
||||
gui_switch_to_previous_window ();
|
||||
else if (strcasecmp (argv[0], "+1") == 0)
|
||||
gui_switch_to_next_window ();
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
|
||||
@@ -69,6 +69,7 @@ extern int weechat_cmd_connect (int, char **);
|
||||
extern int weechat_cmd_debug (int, char **);
|
||||
extern int weechat_cmd_disconnect (int, char **);
|
||||
extern int weechat_cmd_help (int, char **);
|
||||
extern int weechat_cmd_key (char *);
|
||||
extern int weechat_cmd_perl (int, char **);
|
||||
extern int weechat_cmd_python (int, char **);
|
||||
extern int weechat_cmd_save (int, char **);
|
||||
|
||||
+114
-17
@@ -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], *string;
|
||||
t_weechat_alias *ptr_alias;
|
||||
t_config_option *option;
|
||||
void *option_value;
|
||||
char option_string[2048];
|
||||
|
||||
/* WeeChat internal commands */
|
||||
|
||||
@@ -193,6 +201,20 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "key") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"unbind");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"functions");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"reset");
|
||||
return;
|
||||
}
|
||||
if (((strcasecmp (completion->base_command, "perl") == 0)
|
||||
|| (strcasecmp (completion->base_command, "python") == 0))
|
||||
&& (completion->base_command_arg == 1))
|
||||
@@ -211,34 +233,97 @@ 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_KEYS) && (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] = ' ';
|
||||
}
|
||||
}
|
||||
else
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "unalias") == 0)
|
||||
@@ -339,6 +424,9 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"action");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"ping");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"version");
|
||||
@@ -439,9 +527,16 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
|| !((t_irc_channel *)channel)->topic[0])
|
||||
completion_stop (completion);
|
||||
else
|
||||
{
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
((t_irc_channel *)channel)->topic);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
((t_irc_channel *)channel)->topic);
|
||||
string);
|
||||
free (string);
|
||||
}
|
||||
}
|
||||
else
|
||||
completion_stop (completion);
|
||||
@@ -471,6 +566,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++;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -112,16 +112,8 @@ fifo_exec (char *text)
|
||||
if (text[0] == '*')
|
||||
{
|
||||
pos_msg = text + 1;
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
ptr_buffer = gui_current_window->buffer;
|
||||
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s invalid buffer for displaying text via FIFO pipe\n"),
|
||||
WEECHAT_WARNING);
|
||||
return;
|
||||
}
|
||||
ptr_buffer = (gui_current_window->buffer->has_input) ? gui_current_window->buffer : gui_buffers;
|
||||
ptr_server = SERVER(ptr_buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -172,20 +164,12 @@ fifo_exec (char *text)
|
||||
}
|
||||
}
|
||||
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s invalid text received on FIFO pipe\n"),
|
||||
WEECHAT_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ptr_buffer)
|
||||
{
|
||||
if (ptr_channel)
|
||||
ptr_buffer = ptr_channel->buffer;
|
||||
else
|
||||
ptr_buffer = ptr_server->buffer;
|
||||
ptr_buffer = gui_buffers;
|
||||
}
|
||||
|
||||
user_command (ptr_server, ptr_buffer, pos_msg);
|
||||
|
||||
@@ -23,12 +23,17 @@
|
||||
|
||||
#include "../irc/irc.h"
|
||||
|
||||
#define HOTLIST_LOW 0
|
||||
#define HOTLIST_MSG 1
|
||||
#define HOTLIST_PRIVATE 2
|
||||
#define HOTLIST_HIGHLIGHT 3
|
||||
|
||||
typedef struct t_weechat_hotlist t_weechat_hotlist;
|
||||
|
||||
struct t_weechat_hotlist
|
||||
{
|
||||
int priority; /* 0=crappy msg (join/part), 1=msg, */
|
||||
/* 2=nick highlight */
|
||||
/* 2=pv, 3=nick highlight */
|
||||
t_gui_buffer *buffer; /* associated buffer */
|
||||
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
|
||||
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
|
||||
|
||||
+100
-31
@@ -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
|
||||
|
||||
|
||||
/*
|
||||
@@ -305,6 +313,48 @@ void wee_display_commands (int weechat_cmd, int irc_cmd)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_key_functions: display WeeChat key functions
|
||||
*/
|
||||
|
||||
void wee_display_key_functions ()
|
||||
{
|
||||
int i;
|
||||
|
||||
printf (_("Internal key functions:\n"));
|
||||
printf ("\n");
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
printf ("* %s: %s\n",
|
||||
gui_key_functions[i].function_name,
|
||||
_(gui_key_functions[i].description));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_keys: display WeeChat default keys
|
||||
*/
|
||||
|
||||
void wee_display_keys ()
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name;
|
||||
|
||||
printf (_("%s default keys:\n"), PACKAGE_NAME);
|
||||
printf ("\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
printf ("* %s => %s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
(ptr_key->function) ? gui_key_function_search_by_ptr (ptr_key->function) : ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_parse_args: parse command line args
|
||||
*/
|
||||
@@ -323,40 +373,52 @@ wee_parse_args (int argc, char *argv[])
|
||||
|| (strcmp (argv[i], "--config") == 0))
|
||||
{
|
||||
wee_display_config_options ();
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-f") == 0)
|
||||
|| (strcmp (argv[i], "--key-functions") == 0))
|
||||
{
|
||||
wee_display_key_functions ();
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-h") == 0)
|
||||
|| (strcmp (argv[i], "--help") == 0))
|
||||
{
|
||||
printf ("\n" WEE_USAGE1, argv[0], argv[0]);
|
||||
printf ("%s", WEE_USAGE2);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
if ((strcmp (argv[i], "-i") == 0)
|
||||
else if ((strcmp (argv[i], "-i") == 0)
|
||||
|| (strcmp (argv[i], "--irc-commands") == 0))
|
||||
{
|
||||
wee_display_commands (0, 1);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-k") == 0)
|
||||
|| (strcmp (argv[i], "--keys") == 0))
|
||||
{
|
||||
wee_display_keys ();
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-l") == 0)
|
||||
|| (strcmp (argv[i], "--license") == 0))
|
||||
{
|
||||
printf ("\n%s%s", WEE_LICENSE);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-v") == 0)
|
||||
|| (strcmp (argv[i], "--version") == 0))
|
||||
{
|
||||
printf (PACKAGE_VERSION "\n");
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
if ((strcmp (argv[i], "-w") == 0)
|
||||
else if ((strcmp (argv[i], "-w") == 0)
|
||||
|| (strcmp (argv[i], "--weechat-commands") == 0))
|
||||
{
|
||||
wee_display_commands (1, 0);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
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 +431,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);
|
||||
@@ -429,7 +492,7 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s unable to get HOME directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
dir_length = strlen (ptr_home) + 10;
|
||||
weechat_home =
|
||||
@@ -438,7 +501,7 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s not enough memory for home directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
DIR_SEPARATOR);
|
||||
@@ -448,7 +511,7 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create ~/.weechat directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
|
||||
dir_length = strlen (weechat_home) + 64;
|
||||
@@ -516,6 +579,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
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -599,7 +669,7 @@ wee_gui_shutdown ()
|
||||
*/
|
||||
|
||||
void
|
||||
wee_shutdown (int return_code)
|
||||
wee_shutdown (int return_code, int crash)
|
||||
{
|
||||
fifo_remove ();
|
||||
if (weechat_home)
|
||||
@@ -609,7 +679,16 @@ wee_shutdown (int return_code)
|
||||
if (local_charset)
|
||||
free (local_charset);
|
||||
alias_free_all ();
|
||||
exit (return_code);
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
gnutls_certificate_free_credentials (gnutls_xcred);
|
||||
gnutls_global_deinit();
|
||||
#endif
|
||||
|
||||
if (crash)
|
||||
abort();
|
||||
else
|
||||
exit (return_code);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -699,17 +778,6 @@ wee_dump (int crash)
|
||||
wee_log_printf ("\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* my_sigint: SIGINT handler, do nothing (just ignore this signal)
|
||||
* Prevents user for exiting with Ctrl-C
|
||||
*/
|
||||
|
||||
void
|
||||
my_sigint ()
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
/*
|
||||
* my_sigsegv: SIGSEGV handler: save crash log to ~/.weechat/weechat.log and exit
|
||||
*/
|
||||
@@ -725,7 +793,7 @@ my_sigsegv ()
|
||||
fprintf (stderr, "*** Please send this file to WeeChat developers.\n");
|
||||
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
|
||||
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -745,10 +813,11 @@ main (int argc, char *argv[])
|
||||
local_charset = strdup (nl_langinfo (CODESET));
|
||||
#endif
|
||||
|
||||
signal (SIGINT, my_sigint); /* ignore SIGINT signal */
|
||||
signal (SIGINT, SIG_IGN); /* ignore SIGINT signal */
|
||||
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */
|
||||
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */
|
||||
wee_init_vars (); /* initialize some variables */
|
||||
gui_key_init (); /* init keyboard (default key bindings) */
|
||||
wee_parse_args (argc, argv); /* parse command line args */
|
||||
wee_create_home_dirs (); /* create WeeChat directories */
|
||||
wee_init_log (); /* init log file */
|
||||
@@ -783,7 +852,7 @@ main (int argc, char *argv[])
|
||||
(void) config_write (NULL); /* save config file */
|
||||
command_index_free (); /* free commands index */
|
||||
wee_gui_shutdown (); /* shut down WeeChat GUI */
|
||||
wee_shutdown (EXIT_SUCCESS); /* quit WeeChat (oh no, why?) */
|
||||
wee_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */
|
||||
|
||||
return EXIT_SUCCESS; /* make gcc happy (never executed) */
|
||||
}
|
||||
|
||||
@@ -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,12 +86,14 @@
|
||||
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" \
|
||||
" -h, --help this help screen\n" \
|
||||
" -f, --key-functions display WeeChat internal functions for keys\n" \
|
||||
" -h, --help this help\n" \
|
||||
" -i, --irc-commands display IRC commands\n" \
|
||||
" -k, --keys display WeeChat default keys\n" \
|
||||
" -l, --license display WeeChat license\n" \
|
||||
" -v, --version display WeeChat version\n" \
|
||||
" -w, --weechat-commands display WeeChat commands\n\n"
|
||||
@@ -108,10 +114,14 @@ 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 *);
|
||||
extern long get_timeval_diff (struct timeval *, struct timeval *);
|
||||
extern void wee_shutdown (int);
|
||||
extern void wee_shutdown (int, int);
|
||||
|
||||
#endif /* weechat.h */
|
||||
|
||||
+246
-29
@@ -53,6 +53,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
|
||||
{ CONFIG_SECTION_IRC, "irc" },
|
||||
{ CONFIG_SECTION_DCC, "dcc" },
|
||||
{ CONFIG_SECTION_PROXY, "proxy" },
|
||||
{ CONFIG_SECTION_KEYS, "keys" },
|
||||
{ CONFIG_SECTION_ALIAS, "alias" },
|
||||
{ CONFIG_SECTION_SERVER, "server" }
|
||||
};
|
||||
@@ -82,6 +83,7 @@ char *cfg_look_no_nickname;
|
||||
char *cfg_look_completor;
|
||||
int cfg_look_infobar;
|
||||
char *cfg_look_infobar_timestamp;
|
||||
int cfg_look_infobar_seconds;
|
||||
int cfg_look_infobar_delay_highlight;
|
||||
|
||||
t_config_option weechat_options_look[] =
|
||||
@@ -170,7 +172,11 @@ t_config_option weechat_options_look[] =
|
||||
{ "look_infobar_timestamp", N_("timestamp for time in infobar"),
|
||||
N_("timestamp for time in infobar"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"%B, %A %d %Y - %H:%M", NULL, NULL, &cfg_look_infobar_timestamp, config_change_buffer_content },
|
||||
"%B, %A %d %Y", NULL, NULL, &cfg_look_infobar_timestamp, config_change_buffer_content },
|
||||
{ "look_infobar_seconds", N_("display seconds in infobar time"),
|
||||
N_("display seconds in infobar time"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_infobar_seconds, NULL, config_change_buffer_content },
|
||||
{ "look_infobar_delay_highlight", N_("delay (in seconds) for highlight messages in infobar"),
|
||||
N_("delay (in seconds) for highlight messages in infobar "
|
||||
"(0 = disable highlight notifications in infobar)"),
|
||||
@@ -188,6 +194,8 @@ int cfg_col_chat_time;
|
||||
int cfg_col_chat_time_sep;
|
||||
int cfg_col_chat_prefix1;
|
||||
int cfg_col_chat_prefix2;
|
||||
int cfg_col_chat_join;
|
||||
int cfg_col_chat_part;
|
||||
int cfg_col_chat_nick;
|
||||
int cfg_col_chat_host;
|
||||
int cfg_col_chat_channel;
|
||||
@@ -197,11 +205,13 @@ int cfg_col_chat_bg;
|
||||
int cfg_col_status;
|
||||
int cfg_col_status_delimiters;
|
||||
int cfg_col_status_data_msg;
|
||||
int cfg_col_status_data_private;
|
||||
int cfg_col_status_data_highlight;
|
||||
int cfg_col_status_data_other;
|
||||
int cfg_col_status_more;
|
||||
int cfg_col_status_bg;
|
||||
int cfg_col_infobar;
|
||||
int cfg_col_infobar_delimiters;
|
||||
int cfg_col_infobar_highlight;
|
||||
int cfg_col_infobar_bg;
|
||||
int cfg_col_input;
|
||||
@@ -260,6 +270,14 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for middle char of prefix"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"white", NULL, &cfg_col_chat_prefix2, NULL, &config_change_color },
|
||||
{ "col_chat_join", N_("color for join arrow (prefix)"),
|
||||
N_("color for join arrow (prefix)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightgreen", NULL, &cfg_col_chat_join, NULL, &config_change_color },
|
||||
{ "col_chat_part", N_("color for part/quit arrow (prefix)"),
|
||||
N_("color for part/quit arrow (prefix)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightred", NULL, &cfg_col_chat_part, NULL, &config_change_color },
|
||||
{ "col_chat_nick", N_("color for nicks in actions"),
|
||||
N_("color for nicks in actions (chat window)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -298,10 +316,14 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for window with new messages (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"yellow", NULL, &cfg_col_status_data_msg, NULL, &config_change_color },
|
||||
{ "col_status_private", N_("color for window with private message"),
|
||||
N_("color for window with private message (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightmagenta", NULL, &cfg_col_status_data_private, NULL, &config_change_color },
|
||||
{ "col_status_highlight", N_("color for window with highlight"),
|
||||
N_("color for window with highlight (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightmagenta", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
|
||||
"lightred", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
|
||||
{ "col_status_data_other", N_("color for window with new data (not messages)"),
|
||||
N_("color for window with new data (not messages) (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -320,6 +342,10 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for info bar text"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"black", NULL, &cfg_col_infobar, NULL, &config_change_color },
|
||||
{ "col_infobar_delimiters", N_("color for infobar delimiters"),
|
||||
N_("color for infobar delimiters"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"blue", NULL, &cfg_col_infobar_delimiters, NULL, &config_change_color },
|
||||
{ "col_infobar_highlight", N_("color for info bar highlight notification"),
|
||||
N_("color for info bar highlight notification"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -501,6 +527,7 @@ int cfg_irc_lag_check;
|
||||
int cfg_irc_lag_min_show;
|
||||
int cfg_irc_lag_disconnect;
|
||||
int cfg_irc_fifo_pipe;
|
||||
char *cfg_irc_highlight;
|
||||
|
||||
t_config_option weechat_options_irc[] =
|
||||
{ { "irc_display_away", N_("display message to all channels when away"),
|
||||
@@ -514,7 +541,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,
|
||||
@@ -539,6 +566,10 @@ t_config_option weechat_options_irc[] =
|
||||
N_("create a FIFO pipe for remote control"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &cfg_irc_fifo_pipe, NULL, config_change_fifo_pipe },
|
||||
{ "irc_highlight", N_("list of words to highlight"),
|
||||
N_("comma separated list of words to highlight (case insensitive comparison)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_irc_highlight, config_change_noop },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -597,8 +628,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 +642,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 +698,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 +746,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 }
|
||||
};
|
||||
|
||||
@@ -698,7 +758,7 @@ t_config_option weechat_options_server[] =
|
||||
t_config_option *weechat_options[CONFIG_NUMBER_SECTIONS] =
|
||||
{ weechat_options_look, weechat_options_colors, weechat_options_history,
|
||||
weechat_options_log, weechat_options_irc, weechat_options_dcc,
|
||||
weechat_options_proxy, NULL, weechat_options_server
|
||||
weechat_options_proxy, NULL, NULL, weechat_options_server
|
||||
};
|
||||
|
||||
|
||||
@@ -734,7 +794,8 @@ config_get_section (t_config_option *ptr_option)
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -834,6 +895,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 +977,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 +1001,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 +1072,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;
|
||||
}
|
||||
|
||||
@@ -1003,7 +1089,8 @@ config_option_search (char *option_name)
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -1017,6 +1104,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 +1221,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,
|
||||
@@ -1099,7 +1253,8 @@ config_default_values ()
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -1254,8 +1409,22 @@ config_read ()
|
||||
if (pos2 != NULL)
|
||||
pos2[0] = '\0';
|
||||
|
||||
if (section == CONFIG_SECTION_ALIAS)
|
||||
if (section == CONFIG_SECTION_KEYS)
|
||||
{
|
||||
if (pos[0])
|
||||
{
|
||||
/* bind key (overwrite any binding with same key) */
|
||||
gui_key_bind (line, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* unbin key if no value given */
|
||||
gui_key_unbind (line);
|
||||
}
|
||||
}
|
||||
else if (section == CONFIG_SECTION_ALIAS)
|
||||
{
|
||||
/* create new alias */
|
||||
if (alias_new (line, pos))
|
||||
weelist_add (&index_commands, &last_index_command, line);
|
||||
}
|
||||
@@ -1372,6 +1541,8 @@ config_create_default ()
|
||||
time_t current_time;
|
||||
struct passwd *my_passwd;
|
||||
char *realname, *pos;
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name, *function_name;
|
||||
|
||||
filename_length = strlen (weechat_home) + 64;
|
||||
filename =
|
||||
@@ -1399,13 +1570,10 @@ config_create_default ()
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (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)
|
||||
@@ -1433,6 +1601,27 @@ config_create_default ()
|
||||
}
|
||||
}
|
||||
|
||||
/* default key bindings */
|
||||
fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
if (ptr_key->function)
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
}
|
||||
else
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/* default aliases */
|
||||
/* TODO: remove comments when missing commands will be ok */
|
||||
fprintf (file, "\n[alias]\n");
|
||||
@@ -1443,20 +1632,20 @@ config_create_default ()
|
||||
fprintf (file, "C=clear\n");
|
||||
fprintf (file, "CL=clear\n");
|
||||
fprintf (file, "CLOSE=buffer close\n");
|
||||
fprintf (file, "# CHAT=dcc chat\n");
|
||||
fprintf (file, "CHAT=dcc chat\n");
|
||||
fprintf (file, "# GET=dcc get\n");
|
||||
fprintf (file, "# IG=ignore\n");
|
||||
fprintf (file, "J=join\n");
|
||||
fprintf (file, "K=kick\n");
|
||||
fprintf (file, "# KB=kickban\n");
|
||||
fprintf (file, "KB=kickban\n");
|
||||
fprintf (file, "# KN=knockout\n");
|
||||
fprintf (file, "LEAVE=part\n");
|
||||
fprintf (file, "M=msg\n");
|
||||
fprintf (file, "# MUB=unban *\n");
|
||||
fprintf (file, "MUB=unban *\n");
|
||||
fprintf (file, "N=names\n");
|
||||
fprintf (file, "Q=query\n");
|
||||
fprintf (file, "T=topic\n");
|
||||
fprintf (file, "# UB=unban\n");
|
||||
fprintf (file, "UB=unban\n");
|
||||
fprintf (file, "# UNIG=unignore\n");
|
||||
fprintf (file, "W=who\n");
|
||||
fprintf (file, "WC=part\n");
|
||||
@@ -1471,6 +1660,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 */
|
||||
@@ -1539,6 +1730,8 @@ config_write (char *config_name)
|
||||
time_t current_time;
|
||||
t_irc_server *ptr_server;
|
||||
t_weechat_alias *ptr_alias;
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name, *function_name;
|
||||
|
||||
if (config_name)
|
||||
filename = strdup (config_name);
|
||||
@@ -1571,13 +1764,10 @@ config_write (char *config_name)
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (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)
|
||||
@@ -1622,6 +1812,27 @@ config_write (char *config_name)
|
||||
}
|
||||
}
|
||||
|
||||
/* keys section */
|
||||
fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
if (ptr_key->function)
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
}
|
||||
else
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/* alias section */
|
||||
fprintf (file, "\n[alias]\n");
|
||||
for (ptr_alias = weechat_alias; ptr_alias;
|
||||
@@ -1647,6 +1858,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 +1876,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 : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,9 +33,10 @@
|
||||
#define CONFIG_SECTION_IRC 4
|
||||
#define CONFIG_SECTION_DCC 5
|
||||
#define CONFIG_SECTION_PROXY 6
|
||||
#define CONFIG_SECTION_ALIAS 7
|
||||
#define CONFIG_SECTION_SERVER 8
|
||||
#define CONFIG_NUMBER_SECTIONS 9
|
||||
#define CONFIG_SECTION_KEYS 7
|
||||
#define CONFIG_SECTION_ALIAS 8
|
||||
#define CONFIG_SECTION_SERVER 9
|
||||
#define CONFIG_NUMBER_SECTIONS 10
|
||||
|
||||
#define OPTION_TYPE_BOOLEAN 1 /* values: on/off */
|
||||
#define OPTION_TYPE_INT 2 /* values: from min to max */
|
||||
@@ -97,6 +98,7 @@ extern char *cfg_look_no_nickname;
|
||||
extern char *cfg_look_completor;
|
||||
extern int cfg_look_infobar;
|
||||
extern char *cfg_look_infobar_timestamp;
|
||||
extern int cfg_look_infobar_seconds;
|
||||
extern int cfg_look_infobar_delay_highlight;
|
||||
|
||||
extern int cfg_col_title;
|
||||
@@ -106,6 +108,8 @@ extern int cfg_col_chat_time;
|
||||
extern int cfg_col_chat_time_sep;
|
||||
extern int cfg_col_chat_prefix1;
|
||||
extern int cfg_col_chat_prefix2;
|
||||
extern int cfg_col_chat_join;
|
||||
extern int cfg_col_chat_part;
|
||||
extern int cfg_col_chat_nick;
|
||||
extern int cfg_col_chat_host;
|
||||
extern int cfg_col_chat_channel;
|
||||
@@ -115,11 +119,13 @@ extern int cfg_col_chat_bg;
|
||||
extern int cfg_col_status;
|
||||
extern int cfg_col_status_delimiters;
|
||||
extern int cfg_col_status_data_msg;
|
||||
extern int cfg_col_status_data_private;
|
||||
extern int cfg_col_status_data_highlight;
|
||||
extern int cfg_col_status_data_other;
|
||||
extern int cfg_col_status_more;
|
||||
extern int cfg_col_status_bg;
|
||||
extern int cfg_col_infobar;
|
||||
extern int cfg_col_infobar_delimiters;
|
||||
extern int cfg_col_infobar_highlight;
|
||||
extern int cfg_col_infobar_bg;
|
||||
extern int cfg_col_input;
|
||||
@@ -166,6 +172,7 @@ extern int cfg_irc_lag_check;
|
||||
extern int cfg_irc_lag_min_show;
|
||||
extern int cfg_irc_lag_disconnect;
|
||||
extern int cfg_irc_fifo_pipe;
|
||||
extern char *cfg_irc_highlight;
|
||||
|
||||
extern int cfg_dcc_auto_accept_files;
|
||||
extern int cfg_dcc_auto_accept_chats;
|
||||
@@ -178,8 +185,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 +204,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 *);
|
||||
|
||||
@@ -20,6 +20,7 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
noinst_LIBRARIES = lib_weechat_gui_common.a
|
||||
|
||||
lib_weechat_gui_common_a_SOURCES = gui-common.c \
|
||||
gui-keyboard.c \
|
||||
gui.h
|
||||
|
||||
if GUI_NCURSES
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user