1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-22 02:46:38 +02:00

Compare commits

...

55 Commits

Author SHA1 Message Date
Sebastien Helleu 150c5e9749 Version 0.1.5 2005-09-24 11:35:13 +00:00
Sebastien Helleu 6bec96cd4d Replaced gettext with macro "_" 2005-09-23 21:49:02 +00:00
Sebastien Helleu 068284dd19 Added /ame command (send CTCP action to all channels of all connected servers) 2005-09-23 09:57:45 +00:00
Sebastien Helleu 38a8c321c0 Added czech translations 2005-09-22 17:22:30 +00:00
Sebastien Helleu 0094d143b3 Updated doc 2005-09-22 14:20:17 +00:00
Sebastien Helleu 530dc9fb67 Added setting "irc_notice_as_pv" to see notices as pv 2005-09-22 08:21:53 +00:00
Sebastien Helleu 96a69fd7f3 Updated doc 2005-09-21 08:34:48 +00:00
Sebastien Helleu 938915d387 Added nicks colors in setup file 2005-09-20 17:44:44 +00:00
Sebastien Helleu 25bbe3d284 Fixed DCC bug: delete failed file only if really empty (on disk) 2005-09-20 16:14:04 +00:00
Sebastien Helleu 9c7d05f605 Fixed IRC message parser bug 2005-09-15 14:02:38 +00:00
Sebastien Helleu c953db4d64 Fixed window swtich functions (was changing windows buffer and should not) 2005-09-15 13:07:52 +00:00
Sebastien Helleu 9d6ca20478 Fixed window switch functions and bug when line is removed and that a window uses this line at scroll start point 2005-09-15 11:36:50 +00:00
Sebastien Helleu 7f4a213239 Fixed scroll problem (screen moving when scrolling and new line displayed) 2005-09-15 08:21:36 +00:00
Sebastien Helleu e18f14e5d3 One bug removed! 2005-09-14 08:59:49 +00:00
Sebastien Helleu 8f3455d0a9 Fixed infinite loop when scrolling back and displaying long lines 2005-09-14 08:39:14 +00:00
Sebastien Helleu dfbea2850a Fixed minor refresh bug in buffer clear function 2005-09-13 17:10:18 +00:00
Sebastien Helleu 8a299adb3b Fixed crash when closing a buffer used by more than one window 2005-09-13 17:04:34 +00:00
Sebastien Helleu a29416e352 Updated TODO 2005-09-13 07:00:33 +00:00
Sebastien Helleu c346216e34 Added missing "return 0" in handler for IRC command 221 2005-09-11 16:39:37 +00:00
Sebastien Helleu da7df57b1a Added global history keys (ctrl+up/down) 2005-09-11 16:30:51 +00:00
Sebastien Helleu 61fac4d49e Updated bugs 2005-09-11 14:32:07 +00:00
Sebastien Helleu 4f5c1b6e09 Updated Czech translations 2005-09-11 13:54:44 +00:00
Sebastien Helleu 2962a8e6c8 Added IRC commands: 042, 344, 345, 484 2005-09-10 08:53:35 +00:00
Sebastien Helleu 76263dc7cf Added IRC command "221" 2005-09-07 14:17:10 +00:00
Sebastien Helleu 554fa728ae Fixed command "331" ("no topic set for channel") 2005-09-07 10:16:00 +00:00
Sebastien Helleu 5881048405 Fixed DCC display bug (now decodes strings according to charset) 2005-09-07 10:14:07 +00:00
Sebastien Helleu c517253a72 Updated doc 2005-09-05 15:52:16 +00:00
Sebastien Helleu fe16f6d48f Added czech translation file 2005-09-04 19:21:30 +00:00
Sebastien Helleu f276fd9494 Fixed bug with nick change 2005-09-04 13:39:24 +00:00
Sebastien Helleu 517de7ab94 Removed nick color in nicklist when away and away check for nicks is disabled (= 0) 2005-09-04 13:20:56 +00:00
Sebastien Helleu 06463e5937 Added /ignore and /unignore commands 2005-09-04 12:55:25 +00:00
Sebastien Helleu d80c8e9e57 Fixed bug with strings comparison (str[n]casecmp) and some locales (like turkish), now using ASCII comparison 2005-09-03 12:37:20 +00:00
Sebastien Helleu f74b280a1f Added "505" IRC command 2005-09-02 08:17:17 +00:00
Sebastien Helleu cd4f50c136 Signal SIGQUIT is now ignored 2005-09-02 08:16:52 +00:00
Sebastien Helleu 767e378c53 Set non blockant socket for dcc connection (as it was made before) 2005-08-26 22:32:02 +00:00
Sebastien Helleu 60503d9383 Added command "020" 2005-08-22 11:43:43 +00:00
Sebastien Helleu 11321acb96 Added Ruby plugins skeleton 2005-08-21 16:32:48 +00:00
Sebastien Helleu 84b1a27265 Fixed empty private buffer when unknown CTCP is received 2005-08-21 09:49:58 +00:00
Sebastien Helleu 51322e7917 Fixed refresh bug when one line is bigger than screen size 2005-08-17 16:54:05 +00:00
Sebastien Helleu d256d72eef Fixed look_nicklist_min_size and look_nicklist_max_size options 2005-08-16 21:01:32 +00:00
Sebastien Helleu 8a61b0eee0 Updated TODO 2005-08-16 19:33:58 +00:00
Sebastien Helleu d4ecb032d4 Added example in server_autojoin description 2005-08-16 15:03:44 +00:00
Sebastien Helleu 3f946e304d Added completion for internal functions with /key command 2005-08-16 15:02:01 +00:00
Sebastien Helleu 97b6bbcb9e Revert code for irc_cmd_send_join function code (to prevent lag when sending
many /join commands to IRC server)
2005-08-15 21:52:15 +00:00
Sebastien Helleu 357edc193e Fixed bug and memory leak in irc_cmd_send_join function 2005-08-14 06:56:45 +00:00
Emmanuel Bouthenot ace03b808d add half (due to dcc) dcc support with proxies (only in ipv4 ) 2005-08-04 19:01:29 +00:00
Emmanuel Bouthenot 428cfbc297 fix an error in socket() while using ipv6 proxy 2005-08-03 19:18:28 +00:00
Julien Louis 02cd829c4c Update debian stuff 2005-08-01 19:54:39 +00:00
Emmanuel Bouthenot 17973de52a fix a stupid error about previous commit 2005-08-01 09:11:29 +00:00
Emmanuel Bouthenot 364667f788 improve support of keys when joining channel and with server autojoin 2005-07-31 23:01:14 +00:00
Sebastien Helleu 10d7c6c34a Fixed refrech bug when changing channel modes 2005-07-31 12:29:49 +00:00
Sebastien Helleu 38fa7c93ac Jump to next server now saves current channel buffer for each server 2005-07-31 11:32:28 +00:00
Sebastien Helleu 9e328d3fef ctrl-up/ctrl-down keys added to call previous/next command in global history (common to all buffers) 2005-07-30 18:41:48 +00:00
Sebastien Helleu 312d8015f5 Version 0.1.5-cvs 2005-07-30 09:05:09 +00:00
Sebastien Helleu 110aa59ca8 Version 0.1.4 2005-07-30 09:04:09 +00:00
110 changed files with 27340 additions and 10952 deletions
+3 -2
View File
@@ -1,12 +1,13 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2005-07-30
WeeChat known bugs, 2005-09-24
- color display problems when term has white background
- ./configure does not check that Ruby libraries are installed
- ./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)
- command name for /server can not contain spaces
- wrong alias is not created and not saved when quitting WeeChat
- when many WeeChat are launched, log file is not properly written (cleared by
each WeeChat at startup)
- display problems with old Konsole versions (Kde terminal) (???)
+25 -1
View File
@@ -1,9 +1,33 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-07-30
ChangeLog - 2005-09-24
Version 0.1.5 (2005-09-24):
* added /ame command (send CTCP action to all channels of all
connected servers)
* added setting "irc_notice_as_pv" to see notices as pv
* added nicks colors in setup file
* fixed DCC bug: delete failed file only if really empty (on disk)
* fixed IRC message parser bug
* fixed scroll problem (screen moving when scrolling and new line
displayed)
* fixed infinite loop when scrolling back and displaying long lines
* fixed crash when closing a buffer used by more than one window
* added some missing IRC commands
* fixed DCC display bug (now decodes string according to charset)
* added /ignore and /unignore commands
* fixed bug with strings comparison (str[n]casecmp) and some locales
(like turkish), now using ASCII comparison (thanks to roktas)
* signal SIGQUIT is now ignored
* fixed refresh bug when one line is bigger than screen size
* fixed look_nicklist_min_size and look_nicklist_max_size options
* fixed refresh bug when changing channel modes
* jump to next server now saves current channel buffer for each server
* ctrl-up/ctrl-down keys added to call previous/next command in global
history (common to all buffers)
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
+3 -3
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-07-30
WeeChat FAQ, 2005-09-24
=======================
Intended audience:
@@ -195,5 +195,5 @@ A: There's many tasks to do (code, documentation, ...)
================================================================================
Q: Can I give money or other things to WeeChat developers?
A: Beer is welcome :)
Otherwise Paypal account is: flashcode@free.fr (no limit for gifts :)
A: You can give us money to help development.
Details on http://weechat.flashtux.org/donate.php?lang=en
+3 -4
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-07-30
WeeChat FAQ, 2005-09-24
=======================
Public concerné :
@@ -206,6 +206,5 @@ R: Il y a plusieurs choses
================================================================================
Q: Puis-je donner de l'argent ou d'autres choses aux développeurs WeeChat ?
R: La bière est la bienvenue :)
Sinon le compte Paypal est: flashcode@free.fr (il n'y a pas de limite pour
les dons :)
R: Vous pouvez donner de l'argent pour aider le développement.
Plus de détails sur http://weechat.flashtux.org/donate.php
+4
View File
@@ -1,6 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-09-24
WeeChat 0.1.5 released.
* FlashCode, 2005-07-30
WeeChat 0.1.4 released.
+5 -13
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2005-07-20
TODO - 2005-09-24
Legend:
# done
@@ -10,7 +10,7 @@ Legend:
? is this really necessary?
v0.1.4:
v0.1.6:
------
* General:
@@ -21,20 +21,13 @@ v0.1.4:
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* TCP/IP communication:
# 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
- host with "*" possible with /ignore command
* Configuration:
# irc_highlight setting to highlight custom words
# save buffer notify levels
# add key bindings to config file, and create /key command
- be able to launch more than one command when connecting to server
Future versions:
@@ -44,8 +37,6 @@ Future versions:
- 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
nick/host
- when we're away, WeeChat should log all the lines begenning by our nick.
When we come back from our away it should print it to the current window
- "/notify" and "/unnotify" command to be warn by WeeChat when a given
@@ -59,6 +50,7 @@ Future versions:
* Interface:
- color for nicks (except own nick) when nick colors are disabled
- allow decode/encode charsets for servers or chan (not globally)
- interpret special chars in messages (color & bold for example)
- understand incomplete commands if unambigous (for example: /he for /help is ok)
? Qt GUI
+19 -6
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.1.4, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.5, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.4])
AM_INIT_AUTOMAKE([weechat], [0.1.5])
# Checks for programs.
AC_PROG_CC
@@ -30,7 +30,7 @@ AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Gettext
ALL_LINGUAS="fr es"
ALL_LINGUAS="fr es cs"
AM_GNU_GETTEXT
# Checks for libraries.
@@ -66,6 +66,7 @@ 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([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([DEBUG], [#undef DEBUG])
@@ -75,12 +76,11 @@ AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (defau
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(ruby, [ --enable-ruby Turn on Ruby plugins (default=no)],enable_ruby=$enableval,enable_ruby=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"
RUBY_CFLAGS=
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
@@ -88,7 +88,7 @@ AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
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(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
@@ -225,6 +225,18 @@ if test "x$enable_python" = "xyes" ; then
AC_DEFINE(PLUGIN_PYTHON)
fi
if test "x$enable_ruby" = "xyes" ; then
enable_plugins="yes"
# TODO: check that ruby lib and headers are installed
RUBY_CFLAGS=-I`ruby -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
RUBY_LFLAGS=-L`ruby -rrbconfig -e "puts Config::CONFIG[['archdir']]"` -lruby
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/ruby/lib_weechat_ruby.a $RUBY_LFLAGS"
AC_SUBST(RUBY_CFLAGS)
AC_DEFINE(PLUGIN_RUBY)
fi
if test "x$enable_plugins" = "xyes" ; then
AC_DEFINE(PLUGINS)
fi
@@ -272,6 +284,7 @@ AC_OUTPUT([Makefile
src/plugins/Makefile
src/plugins/perl/Makefile
src/plugins/python/Makefile
src/plugins/ruby/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
+15
View File
@@ -1,3 +1,18 @@
weechat (0.1.4-2) unstable; urgency=low
* Add autotools-dev to Build-Depends.
* update autotools stuff automatically to always
have up-to-date config.{guess,sub}
* Update Build-Depends: libgnutls11-dev -> libgnutls-dev
-- Julien Louis <ptitlouis@sysif.net> Mon, 1 Aug 2005 11:46:39 +0200
weechat (0.1.4-1) unstable; urgency=low
* New upstream release.
-- Julien Louis <ptitlouis@sysif.net> Sat, 30 Jul 2005 16:26:55 +0200
weechat (0.1.3-2) unstable; urgency=low
* Update config.{guess,sub} to fix FTBFS on k*BSD (Closes: #316791)
+1 -1
View File
@@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev, libgnutls11-dev
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev, libgnutls-dev, autotools-dev
Standards-Version: 3.6.2.1
Package: weechat
+6 -1
View File
@@ -15,7 +15,7 @@ configure: configure-stamp
configure-stamp:
dh_testdir
./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man \
--enable-perl --enable-python
--infodir=\$${prefix}/share/info --enable-perl --enable-python
touch configure-stamp
@@ -31,6 +31,10 @@ clean:
dh_testroot
rm -f build-stamp configure-stamp
-$(MAKE) distclean
test -r /usr/share/misc/config.guess && \
cp -f /usr/share/misc/config.guess config.guess
test -r /usr/share/misc/config.sub && \
cp -f /usr/share/misc/config.sub config.sub
dh_clean
install: build
@@ -50,6 +54,7 @@ binary-indep: build install
dh_testroot -pweechat-common -pweechat
dh_installchangelogs ChangeLog -pweechat-common
dh_installdocs -pweechat-common
dh_installinfo -pweechat-common
dh_installexamples -pweechat-common
dh_compress -pweechat-common -pweechat
dh_link -pweechat usr/share/doc/weechat-common usr/share/doc/weechat
+1 -1
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "July 2005" "FlashCode"
.TH WEECHAT 1 "September 2005" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
+124 -13
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.4-cvs - July, 16 2005
@subtitle Documentation for WeeChat v0.1.5 - September, 24 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -280,6 +280,9 @@ Type: string (any string), default value: '[%H:%M:%S]'@*
@item look_color_nicks
Display nick names with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item look_color_nicks_number
Number of colors to use for nicks colors@*
Type: integer (values: between 1 and 10), default value: 10@*
@item look_color_actions
Display actions with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -343,6 +346,12 @@ Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@item col_chat_prefix2
Color for middle char of prefix@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_chat_join
Color for join arrow (prefix)@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_chat_part
Color for part/quit arrow (prefix)@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_chat_nick
Color for nicks in actions (chat window)@*
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@@ -370,9 +379,12 @@ Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_status_data_msg
Color for window with new messages (status bar)@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_status_private
Color for window with private message (status bar)@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_status_highlight
Color for window with highlight (status bar)@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_status_data_other
Color for window with new data (not messages) (status bar)@*
Type: color (Curses or Gtk color), default value: 'default'@*
@@ -436,6 +448,36 @@ Type: color (Curses or Gtk color), default value: 'blue'@*
@item col_nick_self
Color for local nick@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_nick_color1
Color for nick@*
Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_nick_color2
Color for nick@*
Type: color (Curses or Gtk color), default value: 'magenta'@*
@item col_nick_color3
Color for nick@*
Type: color (Curses or Gtk color), default value: 'green'@*
@item col_nick_color4
Color for nick@*
Type: color (Curses or Gtk color), default value: 'brown'@*
@item col_nick_color5
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightblue'@*
@item col_nick_color6
Color for nick@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_nick_color7
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@item col_nick_color8
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_color9
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_nick_color10
Color for nick@*
Type: color (Curses or Gtk color), default value: 'blue'@*
@item col_nick_private
Color for other nick in private window@*
Type: color (Curses or Gtk color), default value: 'default'@*
@@ -502,6 +544,9 @@ 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'@*
@item irc_notice_as_pv
Display notices as private messages@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item irc_away_check
Interval between two checks for away (in minutes, 0 = never check)@*
Type: integer (values: between 0 and 2147483647), default value: 0@*
@@ -517,6 +562,9 @@ Type: integer (values: between 0 and 2147483647), default value: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item irc_highlight
Comma separated list of words to highlight (case insensitive comparison)@*
Type: string (any string), default value: ''@*
@item dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@@ -614,7 +662,7 @@ Type: string (any string), default value: ''@*
Delay (in seconds) after command was executed (example: give some time for authentication)@*
Type: integer (values: between 0 and 5), default value: 0@*
@item server_autojoin
Comma separated list of channels to join when connected to server@*
Comma separated list of channels to join when connected to server (example: "#chan1,#chan2,#chan3 #key1,#key2")@*
Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
@@ -701,6 +749,9 @@ Execute command or send message@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item Ctrl + up arrow / Ctrl + down arrow
Call again last commands/messages in global history@*
@*
@item PageUp / PageDown
Show buffer history@*
@*
@@ -818,6 +869,19 @@ display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item ignore [mask [[type | command] [channel [server]]]]
@*
ignore IRC messages and/or hosts@*
@*
mask: nick or host mask to ignore@*
type: type of message to ignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for ignore@*
server: name of server for ignore@*
@*
For each argument, '*' means all.@*
Without argument, /ignore command lists all defined ignore.@*
@*
@item key [key function/command] [unbind key] [functions] [reset -yes]
@*
bind/unbind keys@*
@@ -832,6 +896,7 @@ reset: restore bindings to the default values and delete ALL personal binding (u
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item python [load filename] | [autoload] | [reload] | [unload]
@@ -839,8 +904,17 @@ Without argument, /perl command lists all loaded Perl scripts.@*
list/load/unload Python scripts@*
@*
filename: Python script (file) to load@*
@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item ruby [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Ruby scripts@*
@*
filename: Ruby script (file) to load@*
@*
Without argument, /ruby command lists all loaded Ruby scripts.@*
@*
@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@*
@@ -876,6 +950,20 @@ remove an alias@*
@*
alias_name: name of alias to remove@*
@*
@item unignore [number | [mask [[type | command] [channel [server]]]]]
@*
unignore IRC messages and/or hosts@*
@*
number: # of ignore to unignore (number is displayed by list of ignore)@*
mask: nick or host mask to unignore@*
type: type of message to unignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for unignore@*
server: name of server for unignore@*
@*
For each argument, '*' means all.@*
Without argument, /unignore command lists all defined ignore.@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
manage windows@*
@@ -896,6 +984,18 @@ find information about the administrator of the server@*
@*
target: server@*
@*
@item ame message
@*
send a CTCP action to all channels of all connected servers@*
@*
message: message to send@*
@*
@item amsg text
@*
send message to all channels of all connected servers@*
@*
text: text to send@*
@*
@item away [-all] [message]
@*
toggle away status@*
@@ -910,12 +1010,13 @@ bans nicks or hosts@*
channel: channel for ban@*
nickname: user or host to ban@*
@*
@item ctcp nickname type
@item ctcp nickname type [arguments]
@*
send a ctcp message@*
send a CTCP message (Client-To-Client Protocol)@*
@*
nickname: user to send ctcp to@*
type: "action" or "version"@*
nickname: user to send CTCP to@*
type: CTCP type (examples: "version", "ping", ..)@*
arguments: arguments for CTCP@*
@*
@item dcc action [nickname [file]]
@*
@@ -925,15 +1026,15 @@ action: 'send' (file) or 'chat' or 'close' (chat)@*
nickname: nickname to send file or chat@*
file: filename (on local host)@*
@*
@item dehalfop nickname [nickname]
@item dehalfop [nickname [nickname]]
@*
removes half channel operator status from nickname(s)@*
@*
@item deop nickname [nickname]
@item deop [nickname [nickname]]
@*
removes channel operator status from nickname(s)@*
@*
@item devoice nickname [nickname]
@item devoice [nickname [nickname]]
@*
removes voice from nickname(s)@*
@*
@@ -941,7 +1042,7 @@ removes voice from nickname(s)@*
@*
shutdown the server@*
@*
@item halfop nickname [nickname]
@item halfop [nickname [nickname]]
@*
gives half channel operator status to nickname(s)@*
@*
@@ -1017,7 +1118,7 @@ target: server for forwarding request@*
@*
@item me message
@*
send a ctcp action to the current channel@*
send a CTCP action to the current channel@*
@*
message: message to send@*
@*
@@ -1224,7 +1325,7 @@ gives the version info of nick or server (current or specified)@*
server: server name@*
nickname: nickname@*
@*
@item voice nickname [nickname]
@item voice [nickname [nickname]]
@*
gives voice to nickname(s)@*
@*
@@ -1279,6 +1380,10 @@ delete entire line@*
delete previous word@*
@item delete_next_word
delete next word@*
@item clipboard_paste
paste current clipboard content@*
@item transpose_chars
transpose chars@*
@item home
go to beginning of line@*
@item end
@@ -1293,8 +1398,12 @@ move one char right@*
move to next word@*
@item up
call previous command in history@*
@item up_global
call previous command in global history@*
@item down
call next command in history@*
@item down_global
call next command in global history@*
@item page_up
scroll one page up@*
@item page_down
@@ -1315,6 +1424,8 @@ refresh screen@*
jump to buffer with activity@*
@item jump_dcc
jump to DCC buffer@*
@item jump_last_buffer
jump to last buffer@*
@item jump_server
jump to server buffer@*
@item jump_next_server
+195 -84
View File
@@ -36,7 +36,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.4-cvs - 16 de Julio de 2005
@subtitle Documentaci@'on para WeeChat v0.1.5 - 24 de Septiembre de 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -275,11 +275,14 @@ 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@'ufers@*
Fecha y hora para las bĂşfers@*
Typo: cadena (cualquier cadena), valor por defecto: '[%H:%M:%S]'@*
@item look_color_nicks
Mostrar nombres de usuario con colores diferentes@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item look_color_nicks_number
Number of colors to use for nicks colors@*
Typo: entero (valores: entre 1 y 10), valor por defecto: 10@*
@item look_color_actions
Mostrar acciones con colores diferentes@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@@ -317,7 +320,7 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
Fecha y hora para las conversaciones guardadas@*
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y'@*
@item look_infobar_seconds
Display seconds in infobar time@*
Mostrar segundos en la hora de la barra de herramientas@*
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)@*
@@ -343,6 +346,12 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightcyan'@*
@item col_chat_prefix2
Color para el car@'acter de en medio del prefijo@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'white'@*
@item col_chat_join
Color for join arrow (prefix)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightgreen'@*
@item col_chat_part
Color for part/quit arrow (prefix)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
@item col_chat_nick
Color para los nombres de usuario en las acciones (ventana de conversaci@'on)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightcyan'@*
@@ -370,9 +379,12 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'cyan'@*
@item col_status_data_msg
Color para una ventana con mensajes nuevos (barra de estado)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'yellow'@*
@item col_status_private
Color for window with private message (status bar)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_status_highlight
Color para una ventana con resaltado (barra de estado)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
@item col_status_data_other
Color para una ventana con nuevos datos (no mensajes) (barra de estado)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'default'@*
@@ -428,7 +440,7 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
Color para el s@'imbolo de voz@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Color para '+' al desplazar nicks@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_sep
Color para el separador de alias@*
@@ -436,6 +448,36 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
@item col_nick_self
Color para el alias local@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'white'@*
@item col_nick_color1
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'cyan'@*
@item col_nick_color2
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'magenta'@*
@item col_nick_color3
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'green'@*
@item col_nick_color4
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'brown'@*
@item col_nick_color5
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightblue'@*
@item col_nick_color6
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'default'@*
@item col_nick_color7
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightcyan'@*
@item col_nick_color8
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_color9
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightgreen'@*
@item col_nick_color10
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
@item col_nick_private
Color para el otro alias en la ventana privada@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'default'@*
@@ -464,10 +506,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@'umero m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
NĂşmero 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@'umero m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
NĂşmero 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@*
@@ -502,6 +544,9 @@ 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'@*
@item irc_notice_as_pv
Display notices as private messages@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item irc_away_check
Intervalo entre dos comprobaciones de ausencia (en minutos, 0 = no comprobar)@*
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 0@*
@@ -517,11 +562,14 @@ Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 5@*
@item irc_fifo_pipe
Crea una tuber@'ia FIFO para control remoto@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item irc_highlight
Comma separated list of words to highlight (case insensitive comparison)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item dcc_auto_accept_files
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 (@exclamdown{}utilizar con precauci@'on!)@*
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (¡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)@*
@@ -548,10 +596,10 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
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)@*
Tipo de proxy(http (por defecto), socks4, socks5)@*
Typo: cadena (valores: 'http', 'socks4', 'socks5'), valor por defecto: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Conectar al proxy en 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)@*
@@ -560,7 +608,7 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
Puerto para conectarse al servidor proxy@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 3128@*
@item proxy_username
Username for proxy server@*
Nombre de usuario para el servidor proxy@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_password
Contrase@~na para el servidor proxy@*
@@ -584,10 +632,10 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
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@*
Usar el protocolo IPv6 para la comunicaci@'on del servidor@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_ssl
Use SSL for server communication@*
Usar SSL para la comunicaci@'on del servidor@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_password
Contrase@~na para el servidor IRC@*
@@ -614,13 +662,13 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
Espera (en segundos) despu@'es de que el comando sea ejecutado (ejemplo: dar algo de tiempo para la autenticaci@'on)@*
Typo: entero (valores: entre 0 y 5), valor por defecto: 0@*
@item server_autojoin
Lista de canales (separados por comas) a unirse cuando se conecte a un servidor@*
Lista de canales (separados por comas) a unirse cuando se conecte a un servidor (ejemplo: "#chan1,#chan2,#chan3 #key1,#key2")@*
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,..)@*
Lista separada por comas de niveles de notificaci@'on para canales de este servidor (formato: #canal:1,...)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@end table
@@ -701,6 +749,9 @@ Ejecutar la l@'inea de comandos o enviar el mensaje@*
@item Flecha de arriba / Flecha de abajo
Mostrar los @'ultimos comandos/mensajes@*
@*
@item Ctrl + up arrow / Ctrl + down arrow
Call again last commands/messages in global history@*
@*
@item PageUp / PageDown
Obtener el hist@'orico de la memoria temporal (buffer)@*
@*
@@ -777,16 +828,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@'umero]
@item buffer [acci@'on | nĂşmero]
@*
gestionar los b@'ufers@*
gestionar los bĂşfers@*
@*
acci@'on: acci@'on a efectuar:@*
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)@*
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)@*
notify: fija el nivel de notificaci@'on (0=nunca, 1=highlight, 2=1+msg, 3=2+join/part)@*
n@'umero: saltar al b@'ufer por n@'umero@*
nĂşmero: saltar al bĂşfer por nĂşmero@*
@*
@item clear [-all]
@*
@@ -818,20 +869,34 @@ 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]
@item ignore [mask [[type | command] [channel [server]]]]
@*
bind/unbind keys@*
ignore IRC messages and/or hosts@*
@*
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!)@*
mask: nick or host mask to ignore@*
type: type of message to ignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for ignore@*
server: name of server for ignore@*
@*
For each argument, '*' means all.@*
Without argument, /ignore command lists all defined ignore.@*
@*
@item key [clave funci@'on/comando] [desatar clave] [funciones] [reset -yes]
@*
atar/desatar claves@*
@*
clave: ata esta clave a una funci@'on interna o a un comando (comenzando por "/ ")@*
desatar: desata una clave(si "all", se restauran los anclajes por defecto)@*
funciones: lista funciones internas para el anclaje de claves@*
reset: restaura anclajes a los valores por defecto y elimina todos los anclajes personales (usar cuidadosamente)@*
@*
@item perl [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Perl scripts@*
@*
fichero: Perl script (archivo) a cargar@*
@*
Sin argumentos, el comando /perl lista todos los Perl scripts cargados.@*
@*
@item python [load fichero] | [autoload] | [reload] | [unload]
@@ -839,23 +904,32 @@ Sin argumentos, el comando /perl lista todos los Perl scripts cargados.@*
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 ruby [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Ruby scripts@*
@*
fichero: Ruby script (archivo) a cargar@*
@*
Sin argumentos, el comando /ruby lista todos los Ruby scripts cargados.@*
@*
@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@*
@*
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@*
nombre_de_servidor: nombre del servidor, para uso interno y para mostrar@*
nombre_de_anfitri@'on: nombre o direcci@'on IP del servidor@*
puerto: puerto para el servidor (nĂşmero entero)@*
ipv6: utilizar protocolo IPv6@*
ssl: utilizar protocolo SSL@*
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@*
@*
@item save [archivo]
@*
@@ -876,6 +950,20 @@ eliminar un alias@*
@*
alias: nombre del alias a suprimir@*
@*
@item unignore [number | [mask [[type | command] [channel [server]]]]]
@*
unignore IRC messages and/or hosts@*
@*
number: # of ignore to unignore (number is displayed by list of ignore)@*
mask: nick or host mask to unignore@*
type: type of message to unignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for unignore@*
server: name of server for unignore@*
@*
For each argument, '*' means all.@*
Without argument, /unignore command lists all defined ignore.@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
gesti@'on de ventanas@*
@@ -896,12 +984,24 @@ encontrar informaci@'on sobre el administrador del servidor@*
@*
target: servidor objetivo@*
@*
@item ame mensaje
@*
send a CTCP action to all channels of all connected servers@*
@*
mensaje: mensaje a enviar@*
@*
@item amsg texto
@*
send message to all channels of all connected servers@*
@*
texto: texto a enviar@*
@*
@item away [-all] [mensaje]
@*
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@'un mensaje, se elimina el estado ausente)@*
mensaje: mensaje para el estado ausente (si no se da ningĂşn mensaje, se elimina el estado ausente)@*
@*
@item ban [canal] [usariio [usuario ...]]
@*
@@ -910,12 +1010,13 @@ banea usuarios o m@'aquinas@*
canal: canal en el que banear@*
usuario: nombre de usuario o m@'aquina a banear@*
@*
@item ctcp usuario tipo
@item ctcp nickname type [arguments]
@*
enviar un mensaje ctcp@*
send a CTCP message (Client-To-Client Protocol)@*
@*
usuario: usuario a quien enviar el ctcp@*
tipo: "action" @'o "version"@*
nickname: user to send CTCP to@*
type: CTCP type (examples: "version", "ping", ..)@*
arguments: arguments for CTCP@*
@*
@item dcc acci@'on [usuario [fichero]]
@*
@@ -925,15 +1026,15 @@ acci@'on: 'send' (env@'io de archivo) @'o 'chat' (charla) @'o 'close' (cerrar ch
usuario: nombre de usuario a quien enviar el archivo o la charla@*
fichero: nombre del fichero (en la m@'aquina local)@*
@*
@item dehalfop pseudo [pseudo]
@item dehalfop [pseudo [pseudo]]
@*
elimina el estado de media operador de canal a/a los usuario(s)@*
@*
@item deop pseudo [pseudo]
@item deop [pseudo [pseudo]]
@*
elimina el estado de operador de canal a/a los usuario(s)@*
@*
@item devoice pseudo [pseudo]
@item devoice [pseudo [pseudo]]
@*
elimina la voz a/a los usuario(s)@*
@*
@@ -941,7 +1042,7 @@ elimina la voz a/a los usuario(s)@*
@*
cerrar el servidor@*
@*
@item halfop pseudo [pseudo]
@item halfop [pseudo [pseudo]]
@*
dar el estado de media operador de canal a/a los usuario(s)@*
@*
@@ -1017,7 +1118,7 @@ objetivo: servidor al que remitir la consulta@*
@*
@item me mensaje
@*
enviar una acci@'on ctcp al canal actual@*
enviar una acci@'on CTCP al canal actual@*
@*
mensaje: mensaje a enviar@*
@*
@@ -1032,7 +1133,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@'un mensaje al canal desde el exterior@*
n: ningĂşn 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@*
@@ -1068,8 +1169,8 @@ canal: nombre del canal@*
@*
cambiar el nombre de usuario actual@*
@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
-all: establece el nuevo nombre de usuario para todos los servidores conectados@*
nickname: nuevo nombre de usuario@*
@*
@item notice usuario texto
@*
@@ -1224,7 +1325,7 @@ da la informaci@'on de versi@'on del usuario o servidor (actual o especificado)@
servidor: nombre de servidor@*
usuario: usuario@*
@*
@item voice pseudo [pseudo]
@item voice [pseudo [pseudo]]
@*
da voz a/a los usuario(s)@*
@*
@@ -1248,12 +1349,12 @@ 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@'umero [destinatario]]
@item whowas usuario [,usuario [,usuario ...]] [nĂşmero [destinatario]]
@*
pedir informaci@'on sobre un usuario que ya no existe@*
@*
usuario: nombre de usuario a buscar@*
n@'umero: n@'umero de respuestas a devolver (b@'usqueda completa si el n@'umero es negativo)@*
nĂşmero: nĂşmero de respuestas a devolver (bĂşsqueda completa si el nĂşmero es negativo)@*
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
@*
@end table
@@ -1262,65 +1363,75 @@ Internal functions for keys:@*
@table @kbd
@item return
terminate line@*
terminar l@'inea@*
@item tab
complete word@*
completar palabra@*
@item backspace
delete previous char@*
borrar el car@'acter anterior@*
@item delete
delete next char@*
borrar el car@'acter siguiente@*
@item delete_end_line
delete until end of line@*
borrar hasta fin de l@'inea@*
@item delete_beginning_line
delete until beginning of line@*
borrar hasta principio de l@'inea@*
@item delete_line
delete entire line@*
borrar l@'inea entera@*
@item delete_previous_word
delete previous word@*
borrar la palabra anterior@*
@item delete_next_word
delete next word@*
borrar la palabra siguiente@*
@item clipboard_paste
paste current clipboard content@*
@item transpose_chars
transpose chars@*
@item home
go to beginning of line@*
ir al principio de l@'inea@*
@item end
go to end of line@*
ir al final de l@'inea@*
@item left
move one char left@*
mover un car@'acter a la izquierda@*
@item previous_word
move to previous word@*
mover a la palabra anterior@*
@item right
move one char right@*
mover un car@'acter a la derecha@*
@item next_word
move to next word@*
mover a la palabra siguiente@*
@item up
call previous command in history@*
llamar al comando anterior en el historial@*
@item up_global
call previous command in global history@*
@item down
call next command in history@*
llamar al comando siguiente en el historial@*
@item down_global
call next command in global history@*
@item page_up
scroll one page up@*
desplazarse una p@'agina hacia arriba@*
@item page_down
scroll one page down@*
desplazarse una p@'agina hacia abajo@*
@item infobar_clear
clear infobar@*
limpiar barra de informaci@'on@*
@item nick_page_up
scroll nicklist one page up@*
desplazar la lista de nicks una p@'agina hacia arriba@*
@item nick_page_down
scroll nicklist one page down@*
desplazar la lista de nicks una p@'agina hacia abajo@*
@item nick_beginning
display beginning of nicklist@*
mostrar el principio de la lista de nicks@*
@item nick_end
display end of nicklist@*
mostrar el final de la lista de nicks@*
@item refresh
refresh screen@*
recargar la pantalla@*
@item jump_smart
jump to buffer with activity@*
saltar al bĂşfer con actividad@*
@item jump_dcc
jump to DCC buffer@*
saltar al bĂşfer DCC@*
@item jump_last_buffer
jump to last buffer@*
@item jump_server
jump to server buffer@*
saltar al bĂşfer servidor@*
@item jump_next_server
jump to next server@*
saltar al servidor siguiente@*
@item hotlist_clear
clear hotlist@*
limpiar hotlist@*
@item grab_key
grab a key@*
@end table
+124 -13
View File
@@ -36,7 +36,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.4-cvs - 16 Juillet 2005
@subtitle Documentation pour WeeChat v0.1.5 - 24 Septembre 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -281,6 +281,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '[%H:%M:%S]'@*
@item look_color_nicks
Afficher les utilisateurs avec diff@'erentes couleurs@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item look_color_nicks_number
Nombre de couleurs @`a utiliser pour les couleurs des pseudos@*
Type: entier (valeurs: entre 1 et 10), valeur par d@'efaut: 10@*
@item look_color_actions
Afficher les actions avec diff@'erentes couleurs@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -344,6 +347,12 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
@item col_chat_prefix2
Couleur pour le caract@`ere du milieu du pr@'efixe@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@item col_chat_join
Couleur pour la fl@`eche du join (pr@'efixe)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_chat_part
Couleur pour la fl@`eche du part/quit (pr@'efixe)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
@item col_chat_nick
Couleur pour les noms d'utilisateurs dans les actions (fen@^etre de discussion)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
@@ -371,9 +380,12 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
@item col_status_data_msg
Couleur pour une fen@^etre avec de nouvelles infos (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_status_private
Couleur pour une fen@^etre avec un message priv@'e (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_status_highlight
Couleur pour une fen@^etre avec un highlight (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
@item col_status_data_other
Couleur pour une fen@^etre avec des nouvelles donn@'ees (pas des infos) (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@@ -437,6 +449,36 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
@item col_nick_self
Couleur pour le pseudo local@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@item col_nick_color1
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
@item col_nick_color2
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'magenta'@*
@item col_nick_color3
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'green'@*
@item col_nick_color4
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'brown'@*
@item col_nick_color5
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightblue'@*
@item col_nick_color6
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_nick_color7
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
@item col_nick_color8
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_color9
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_nick_color10
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
@item col_nick_private
Couleur pour l'autre pseudo dans la fen@^etre priv@'ee@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@@ -503,6 +545,9 @@ 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'@*
@item irc_notice_as_pv
Afficher les notices comme des messages priv@'es@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item irc_away_check
Intervalle entre deux v@'erifications des absences (en minutes, 0 = ne jemais v@'erifier)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 0@*
@@ -518,6 +563,9 @@ Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 5@*
@item irc_fifo_pipe
Cr@'eer un tube FIFO pour le contr@^ole @`a distance@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item irc_highlight
Liste des mots pour la notification (s@'epar@'es par des virgules, le comparaison ne tient pas compte de la casse)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item dcc_auto_accept_files
Accepte automatiquement les fichiers dcc entrants@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@@ -615,7 +663,7 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
D@'elai (en secondes) apr@`es ex@'ecution de la commande (exemple: donner du temps pour l'authentification)@*
Type: entier (valeurs: entre 0 et 5), valeur par d@'efaut: 0@*
@item server_autojoin
Liste des canaux (s@'epar@'es par des virgules) @`a rejoindre lorsque connect@'e au serveur@*
Liste des canaux (s@'epar@'es par des virgules) @`a rejoindre lorsque connect@'e au serveur (exemple: "#chan1,#chan2,#chan3 #key1,#key2")@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_autorejoin
Rejoindre automatiquement les canaux quand mis dehors@*
@@ -702,6 +750,9 @@ Ex@'ecuter la commande ou envoyer le message@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item Ctrl + fl@`eche haut / Ctrl + fl@`eche bas
Rappeler les derni@`eres commandes/messages dans l'historique global@*
@*
@item PageUp / PageDown
Afficher l'historique du tampon@*
@*
@@ -819,6 +870,19 @@ afficher l'aide sur les commandes@*
@*
commande: nom d'une commande WeeChat ou IRC@*
@*
@item ignore [masque [[type | commande] [canal [serveur]]]]
@*
ignorer des messages IRC et/ou des masques@*
@*
masque: pseudo ou masque @`a ignorer@*
type: type de message @`a ignorer (action, ctcp, dcc, pv)@*
commande: commande IRC@*
canal: nom du canal pour le ignore@*
serveur: nom du serveur pour le ignore@*
@*
Pour chaque param@`etre, '*' signifie tou(te)s.@*
Sans param@`etre, la commande /ignore liste les ignore d@'efinis.@*
@*
@item key [touche fonction/commande] [unbind touche] [functions] [reset -yes]
@*
associer/lib@'erer des touches@*
@@ -833,6 +897,7 @@ reset: restaur les touches aux valeurs par d@'efaut et supprime TOUTES les touch
liste/charge/d@'echarge des scripts Perl@*
@*
fichier: script Perl (fichier) @`a charger@*
@*
Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@*
@*
@item python [load fichier] | [autoload] | [reload] | [unload]
@@ -840,8 +905,17 @@ Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@*
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 ruby [load fichier] | [autoload] | [reload] | [unload]
@*
liste/charge/d@'echarge des scripts Ruby@*
@*
fichier: script Ruby (fichier) @`a charger@*
@*
Sans param@`etre, la commande /ruby liste tous les scripts Ruby charg@'es.@*
@*
@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@*
@@ -877,6 +951,20 @@ supprimer un alias@*
@*
nom_alias: nom de l'alias @`a supprimer@*
@*
@item unignore [nombre | [masque [[type | commande] [canal [serveur]]]]]
@*
supprimer le ignore des messages IRC et/ou des masques@*
@*
nombre: num@'ero de ignore @`a supprimer (le nombre est affich@'e sur la liste des ignore)@*
masque: pseudo ou masque @`a ignorer@*
type: type de message @`a ignorer (action, ctcp, dcc, pv)@*
commande: commande IRC@*
canal: nom du canal pour le ignore@*
serveur: nom du serveur pour le ignore@*
@*
Pour chaque param@`etre, '*' signifie tou(te)s.@*
Sans param@`etre, /ignore liste les ignore d@'efinis.@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
gestion des fen@^etres@*
@@ -897,6 +985,18 @@ trouver les informations sur l'administrateur du serveur@*
@*
cible: serveur@*
@*
@item ame message
@*
envoyer une action CTCP @`a tous les canaux de tous les serveurs connect@'es@*
@*
message: message @`a envoyer@*
@*
@item amsg texte
@*
envoyer un message @`a tous les canaux de tous les serveurs connect@'es@*
@*
texte: texte @`a envoyer@*
@*
@item away [-all] [message]
@*
basculer le statut absent@*
@@ -911,12 +1011,13 @@ bannit des pseudos ou masques@*
canal: nom du canal pour le bannissement@*
pseudo: pseudo ou masque pour le bannissement@*
@*
@item ctcp pseudo type
@item ctcp pseudo type [arguments]
@*
envoyer un message ctcp@*
envoyer un message CTCP (Client-To-Client Protocol)@*
@*
pseudo: utilisateur pour envoyer le ctcp@*
type: "action" ou "version"@*
pseudo: utilisateur @`a qui envoyer le CTCP@*
type: type de CTCP (exemples: "version", "ping", etc...)@*
arguments: arguments pour le CTCP@*
@*
@item dcc action [pseudo [fichier]]
@*
@@ -926,15 +1027,15 @@ action: 'send' (envoi de fichier) ou 'chat' (discussion) ou 'close' (fermeture d
pseudo: pseudo pour envoyer le fichier ou discuter@*
fichier: nom du fichier (sur la machine locale)@*
@*
@item dehalfop pseudo [pseudo]
@item dehalfop [pseudo [pseudo]]
@*
retire le statut de demi-op@'erateur du canal @`a/aux nick(s)@*
@*
@item deop pseudo [pseudo]
@item deop [pseudo [pseudo]]
@*
retire le statut d'op@'erateur du canal @`a/aux nick(s)@*
@*
@item devoice pseudo [pseudo]
@item devoice [pseudo [pseudo]]
@*
retire la voix du/des pseudo(s)@*
@*
@@ -942,7 +1043,7 @@ retire la voix du/des pseudo(s)@*
@*
arr@^eter le serveur@*
@*
@item halfop pseudo [pseudo]
@item halfop [pseudo [pseudo]]
@*
donner le statut de demi-op@'erateur @`a un/des utilisateur(s)@*
@*
@@ -1018,7 +1119,7 @@ cible: serveur pour faire suivre la requ@^ete@*
@*
@item me message
@*
envoyer une action ctcp au canal courant@*
envoyer une action CTCP au canal courant@*
@*
message: message @`a envoyer@*
@*
@@ -1225,7 +1326,7 @@ retourne la version de l'utilisateur ou du serveur (courant ou sp@'ecifi@'e)@*
serveur: nom du serveur@*
pseudo: utilisateur@*
@*
@item voice pseudo [pseudo]
@item voice [pseudo [pseudo]]
@*
donne la voix @`a/aux utilisateur(s)@*
@*
@@ -1280,6 +1381,10 @@ effacer la ligne enti@`ere@*
effacer le mot pr@'ec@'edent@*
@item delete_next_word
effacer le mot suivant@*
@item clipboard_paste
coller le contenu du presse-papier@*
@item transpose_chars
inverser les caract@`eres@*
@item home
aller au d@'ebut de la ligne@*
@item end
@@ -1294,8 +1399,12 @@ se d@'eplacer d'un caract@`ere @`a droite@*
se d@'eplacer au mot suivant@*
@item up
appeler la commande pr@'ec@'edente dans l'historique@*
@item up_global
appeler la commande pr@'ec@'edente dans l'historique global@*
@item down
appeler la commande suivante dans l'historique@*
@item down_global
appeler la commande suivante dans l'historique global@*
@item page_up
faire d@'efiler d'une page vers le haut@*
@item page_down
@@ -1316,6 +1425,8 @@ rafraichir l'@'ecran@*
sauter au tampon avec de l'activit@'e@*
@item jump_dcc
sauter au tampon DCC@*
@item jump_last_buffer
sauter au dernier tampon@*
@item jump_server
sauter au tampon du serveur@*
@item jump_next_server
+124 -13
View File
@@ -36,7 +36,7 @@
@title WeeChat - Guia do Utilizador
@subtitle Cliente de IRC rapido, leve e extencivel
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.4-cvs - 16 de Julho de 2005
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.5 - 24 de Setembro de 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -278,6 +278,9 @@ Type: string (any string), default value: '[%H:%M:%S]'@*
@item look_color_nicks
Display nick names with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item look_color_nicks_number
Number of colors to use for nicks colors@*
Type: integer (values: between 1 and 10), default value: 10@*
@item look_color_actions
Display actions with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -341,6 +344,12 @@ Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@item col_chat_prefix2
Color for middle char of prefix@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_chat_join
Color for join arrow (prefix)@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_chat_part
Color for part/quit arrow (prefix)@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_chat_nick
Color for nicks in actions (chat window)@*
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@@ -368,9 +377,12 @@ Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_status_data_msg
Color for window with new messages (status bar)@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_status_private
Color for window with private message (status bar)@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_status_highlight
Color for window with highlight (status bar)@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_status_data_other
Color for window with new data (not messages) (status bar)@*
Type: color (Curses or Gtk color), default value: 'default'@*
@@ -434,6 +446,36 @@ Type: color (Curses or Gtk color), default value: 'blue'@*
@item col_nick_self
Color for local nick@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_nick_color1
Color for nick@*
Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_nick_color2
Color for nick@*
Type: color (Curses or Gtk color), default value: 'magenta'@*
@item col_nick_color3
Color for nick@*
Type: color (Curses or Gtk color), default value: 'green'@*
@item col_nick_color4
Color for nick@*
Type: color (Curses or Gtk color), default value: 'brown'@*
@item col_nick_color5
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightblue'@*
@item col_nick_color6
Color for nick@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_nick_color7
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@item col_nick_color8
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_color9
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_nick_color10
Color for nick@*
Type: color (Curses or Gtk color), default value: 'blue'@*
@item col_nick_private
Color for other nick in private window@*
Type: color (Curses or Gtk color), default value: 'default'@*
@@ -500,6 +542,9 @@ 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'@*
@item irc_notice_as_pv
Display notices as private messages@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item irc_away_check
Interval between two checks for away (in minutes, 0 = never check)@*
Type: integer (values: between 0 and 2147483647), default value: 0@*
@@ -515,6 +560,9 @@ Type: integer (values: between 0 and 2147483647), default value: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item irc_highlight
Comma separated list of words to highlight (case insensitive comparison)@*
Type: string (any string), default value: ''@*
@item dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@@ -612,7 +660,7 @@ Type: string (any string), default value: ''@*
Delay (in seconds) after command was executed (example: give some time for authentication)@*
Type: integer (values: between 0 and 5), default value: 0@*
@item server_autojoin
Comma separated list of channels to join when connected to server@*
Comma separated list of channels to join when connected to server (example: "#chan1,#chan2,#chan3 #key1,#key2")@*
Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
@@ -699,6 +747,9 @@ Executa o comando ou envia a mensagem@*
@item Seta para cima / Seta para baixo
Repetir os ultimos comandos/mensagens@*
@*
@item Ctrl + up arrow / Ctrl + down arrow
Call again last commands/messages in global history@*
@*
@item PageUp / PageDown
Navegar no hist@'orico da janela@*
@*
@@ -816,6 +867,19 @@ display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item ignore [mask [[type | command] [channel [server]]]]
@*
ignore IRC messages and/or hosts@*
@*
mask: nick or host mask to ignore@*
type: type of message to ignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for ignore@*
server: name of server for ignore@*
@*
For each argument, '*' means all.@*
Without argument, /ignore command lists all defined ignore.@*
@*
@item key [key function/command] [unbind key] [functions] [reset -yes]
@*
bind/unbind keys@*
@@ -830,6 +894,7 @@ reset: restore bindings to the default values and delete ALL personal binding (u
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item python [load filename] | [autoload] | [reload] | [unload]
@@ -837,8 +902,17 @@ Without argument, /perl command lists all loaded Perl scripts.@*
list/load/unload Python scripts@*
@*
filename: Python script (file) to load@*
@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item ruby [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Ruby scripts@*
@*
filename: Ruby script (file) to load@*
@*
Without argument, /ruby command lists all loaded Ruby scripts.@*
@*
@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@*
@@ -874,6 +948,20 @@ remove an alias@*
@*
alias_name: name of alias to remove@*
@*
@item unignore [number | [mask [[type | command] [channel [server]]]]]
@*
unignore IRC messages and/or hosts@*
@*
number: # of ignore to unignore (number is displayed by list of ignore)@*
mask: nick or host mask to unignore@*
type: type of message to unignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for unignore@*
server: name of server for unignore@*
@*
For each argument, '*' means all.@*
Without argument, /unignore command lists all defined ignore.@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
manage windows@*
@@ -894,6 +982,18 @@ find information about the administrator of the server@*
@*
target: server@*
@*
@item ame message
@*
send a CTCP action to all channels of all connected servers@*
@*
message: message to send@*
@*
@item amsg text
@*
send message to all channels of all connected servers@*
@*
text: text to send@*
@*
@item away [-all] [message]
@*
toggle away status@*
@@ -908,12 +1008,13 @@ bans nicks or hosts@*
channel: channel for ban@*
nickname: user or host to ban@*
@*
@item ctcp nickname type
@item ctcp nickname type [arguments]
@*
send a ctcp message@*
send a CTCP message (Client-To-Client Protocol)@*
@*
nickname: user to send ctcp to@*
type: "action" or "version"@*
nickname: user to send CTCP to@*
type: CTCP type (examples: "version", "ping", ..)@*
arguments: arguments for CTCP@*
@*
@item dcc action [nickname [file]]
@*
@@ -923,15 +1024,15 @@ action: 'send' (file) or 'chat' or 'close' (chat)@*
nickname: nickname to send file or chat@*
file: filename (on local host)@*
@*
@item dehalfop nickname [nickname]
@item dehalfop [nickname [nickname]]
@*
removes half channel operator status from nickname(s)@*
@*
@item deop nickname [nickname]
@item deop [nickname [nickname]]
@*
removes channel operator status from nickname(s)@*
@*
@item devoice nickname [nickname]
@item devoice [nickname [nickname]]
@*
removes voice from nickname(s)@*
@*
@@ -939,7 +1040,7 @@ removes voice from nickname(s)@*
@*
shutdown the server@*
@*
@item halfop nickname [nickname]
@item halfop [nickname [nickname]]
@*
gives half channel operator status to nickname(s)@*
@*
@@ -1015,7 +1116,7 @@ target: server for forwarding request@*
@*
@item me message
@*
send a ctcp action to the current channel@*
send a CTCP action to the current channel@*
@*
message: message to send@*
@*
@@ -1222,7 +1323,7 @@ gives the version info of nick or server (current or specified)@*
server: server name@*
nickname: nickname@*
@*
@item voice nickname [nickname]
@item voice [nickname [nickname]]
@*
gives voice to nickname(s)@*
@*
@@ -1277,6 +1378,10 @@ delete entire line@*
delete previous word@*
@item delete_next_word
delete next word@*
@item clipboard_paste
paste current clipboard content@*
@item transpose_chars
transpose chars@*
@item home
go to beginning of line@*
@item end
@@ -1291,8 +1396,12 @@ move one char right@*
move to next word@*
@item up
call previous command in history@*
@item up_global
call previous command in global history@*
@item down
call next command in history@*
@item down_global
call next command in global history@*
@item page_up
scroll one page up@*
@item page_down
@@ -1313,6 +1422,8 @@ refresh screen@*
jump to buffer with activity@*
@item jump_dcc
jump to DCC buffer@*
@item jump_last_buffer
jump to last buffer@*
@item jump_server
jump to server buffer@*
@item jump_next_server
+3
View File
@@ -6,11 +6,14 @@
./src/irc/irc-send.c
./src/irc/irc-recv.c
./src/irc/irc-dcc.c
./src/irc/irc-ignore.c
./src/irc/irc.h
./src/plugins/perl/wee-perl.c
./src/plugins/perl/wee-perl.h
./src/plugins/python/wee-python.c
./src/plugins/python/wee-python.h
./src/plugins/ruby/wee-ruby.c
./src/plugins/ruby/wee-ruby.h
./src/plugins/plugins.c
./src/plugins/plugins.h
./src/gui/curses/gui-input.c
+4389
View File
File diff suppressed because it is too large Load Diff
+1099 -888
View File
File diff suppressed because it is too large Load Diff
+1124 -889
View File
File diff suppressed because it is too large Load Diff
+1175 -976
View File
File diff suppressed because it is too large Load Diff
+382 -58
View File
@@ -72,6 +72,16 @@ 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 },
{ "ignore", N_("ignore IRC messages and/or hosts"),
N_("[mask [[type | command] [channel [server]]]]"),
N_(" mask: nick or host mask to ignore\n"
" type: type of message to ignore (action, ctcp, dcc, pv)\n"
"command: IRC command\n"
"channel: name of channel for ignore\n"
" server: name of server for ignore\n\n"
"For each argument, '*' means all.\n"
"Without argument, /ignore command lists all defined ignore."),
0, 4, weechat_cmd_ignore, 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"
@@ -81,14 +91,19 @@ t_weechat_command weechat_commands[] =
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"
N_("filename: Perl script (file) to load\n\n"
"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"
N_("filename: Python script (file) to load\n\n"
"Without argument, /python command lists all loaded Python scripts."),
0, 2, weechat_cmd_python, NULL },
{ "ruby", N_("list/load/unload Ruby scripts"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: Ruby script (file) to load\n\n"
"Without argument, /ruby command lists all loaded Ruby scripts."),
0, 2, weechat_cmd_ruby, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
@@ -116,6 +131,17 @@ t_weechat_command weechat_commands[] =
{ "unalias", N_("remove an alias"),
N_("alias_name"), N_("alias_name: name of alias to remove"),
1, 1, NULL, weechat_cmd_unalias },
{ "unignore", N_("unignore IRC messages and/or hosts"),
N_("[number | [mask [[type | command] [channel [server]]]]]"),
N_(" number: # of ignore to unignore (number is displayed by list of ignore)\n"
" mask: nick or host mask to unignore\n"
" type: type of message to unignore (action, ctcp, dcc, pv)\n"
"command: IRC command\n"
"channel: name of channel for unignore\n"
" server: name of server for unignore\n\n"
"For each argument, '*' means all.\n"
"Without argument, /unignore command lists all defined ignore."),
0, 4, weechat_cmd_unignore, NULL },
{ "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"
@@ -186,7 +212,7 @@ alias_search (char *alias_name)
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
{
if (strcasecmp (alias_name, ptr_alias->alias_name) == 0)
if (ascii_strcasecmp (alias_name, ptr_alias->alias_name) == 0)
return ptr_alias;
}
return NULL;
@@ -203,7 +229,7 @@ alias_find_pos (char *alias_name)
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
{
if (strcasecmp (alias_name, ptr_alias->alias_name) < 0)
if (ascii_strcasecmp (alias_name, ptr_alias->alias_name) < 0)
return ptr_alias;
}
return NULL;
@@ -479,7 +505,7 @@ exec_weechat_command (t_irc_server *server, char *string)
for (i = 0; weechat_commands[i].command_name; i++)
{
if (strcasecmp (weechat_commands[i].command_name, command + 1) == 0)
if (ascii_strcasecmp (weechat_commands[i].command_name, command + 1) == 0)
{
if ((argc < weechat_commands[i].min_arg)
|| (argc > weechat_commands[i].max_arg))
@@ -539,7 +565,7 @@ exec_weechat_command (t_irc_server *server, char *string)
}
for (i = 0; irc_commands[i].command_name; i++)
{
if ((strcasecmp (irc_commands[i].command_name, command + 1) == 0) &&
if ((ascii_strcasecmp (irc_commands[i].command_name, command + 1) == 0) &&
((irc_commands[i].cmd_function_args) ||
(irc_commands[i].cmd_function_1arg)))
{
@@ -610,7 +636,7 @@ exec_weechat_command (t_irc_server *server, char *string)
for (ptr_alias = weechat_alias; ptr_alias;
ptr_alias = ptr_alias->next_alias)
{
if (strcasecmp (ptr_alias->alias_name, command + 1) == 0)
if (ascii_strcasecmp (ptr_alias->alias_name, command + 1) == 0)
{
if (ptr_args)
{
@@ -869,6 +895,11 @@ weechat_cmd_buffer_display_info (t_gui_buffer *buffer)
"%s", SERVER(buffer)->name);
gui_printf (NULL, ")\n");
}
else
{
gui_printf (NULL, _("not connected"));
gui_printf (NULL, "\n");
}
}
/*
@@ -885,7 +916,7 @@ weechat_cmd_buffer (int argc, char **argv)
char *error;
int target_buffer;
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
{
/* list opened buffers */
@@ -903,7 +934,7 @@ weechat_cmd_buffer (int argc, char **argv)
}
else
{
if (strcasecmp (argv[0], "move") == 0)
if (ascii_strcasecmp (argv[0], "move") == 0)
{
/* move buffer to another number in the list */
@@ -938,7 +969,7 @@ weechat_cmd_buffer (int argc, char **argv)
return -1;
}
}
else if (strcasecmp (argv[0], "close") == 0)
else if (ascii_strcasecmp (argv[0], "close") == 0)
{
/* close buffer (server or channel/private) */
@@ -990,7 +1021,7 @@ weechat_cmd_buffer (int argc, char **argv)
}
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
else if (strcasecmp (argv[0], "notify") == 0)
else if (ascii_strcasecmp (argv[0], "notify") == 0)
{
/* set notify level for buffer */
@@ -1109,7 +1140,7 @@ weechat_cmd_clear (int argc, char **argv)
{
if (argc == 1)
{
if (strcasecmp (argv[0], "-all") == 0)
if (ascii_strcasecmp (argv[0], "-all") == 0)
gui_buffer_clear_all ();
else
{
@@ -1193,7 +1224,7 @@ weechat_cmd_debug (int argc, char **argv)
return -1;
}
if (strcasecmp (argv[0], "dump") == 0)
if (ascii_strcasecmp (argv[0], "dump") == 0)
{
wee_dump (0);
}
@@ -1289,7 +1320,7 @@ weechat_cmd_help (int argc, char **argv)
{
for (i = 0; weechat_commands[i].command_name; i++)
{
if (strcasecmp (weechat_commands[i].command_name, argv[0]) == 0)
if (ascii_strcasecmp (weechat_commands[i].command_name, argv[0]) == 0)
{
gui_printf (NULL, "\n");
gui_printf (NULL, "[w]");
@@ -1314,7 +1345,7 @@ weechat_cmd_help (int argc, char **argv)
}
for (i = 0; irc_commands[i].command_name; i++)
{
if ((strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
if ((ascii_strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
&& (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg))
{
gui_printf (NULL, "\n");
@@ -1346,6 +1377,93 @@ weechat_cmd_help (int argc, char **argv)
return 0;
}
/*
* weechat_cmd_ignore_display: display an ignore entry
*/
void
weechat_cmd_ignore_display (char *text, t_irc_ignore *ptr_ignore)
{
if (text)
gui_printf (NULL, "%s ", text);
gui_printf (NULL, _("on"));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, " %s", ptr_ignore->server_name);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "/");
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%s", ptr_ignore->channel_name);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, ":");
gui_printf (NULL, _(" ignoring "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%s", ptr_ignore->type);
gui_printf (NULL, _(" from "));
gui_printf_color (NULL, COLOR_WIN_CHAT_HOST, "%s\n", ptr_ignore->mask);
}
/*
* weechat_cmd_ignore: ignore IRC commands and/or hosts
*/
int
weechat_cmd_ignore (int argc, char **argv)
{
t_irc_ignore *ptr_ignore;
int i;
ptr_ignore = NULL;
switch (argc)
{
case 0:
/* List all ignore */
if (irc_ignore)
{
gui_printf (NULL, "\n");
gui_printf (NULL, _("List of ignore:\n"));
i = 0;
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
i++;
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "[");
gui_printf (NULL, "%d", i);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "] ");
weechat_cmd_ignore_display (NULL, ptr_ignore);
}
}
else
{
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf (NULL, _("No ignore defined.\n"));
}
return 0;
break;
case 1:
ptr_ignore = ignore_add (argv[0], "*", "*",
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 2:
ptr_ignore = ignore_add (argv[0], argv[1], "*",
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 3:
ptr_ignore = ignore_add (argv[0], argv[1], argv[2],
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 4:
ptr_ignore = ignore_add (argv[0], argv[1], argv[2], argv[3]);
break;
}
if (ptr_ignore)
{
gui_printf (NULL, "\n");
weechat_cmd_ignore_display (_("New ignore:"), ptr_ignore);
return 0;
}
else
return -1;
}
/*
* weechat_cmd_key_display: display a key binding
*/
@@ -1397,7 +1515,7 @@ weechat_cmd_key (char *arguments)
weechat_cmd_key_display (ptr_key, 0);
}
}
else if (strncasecmp (arguments, "unbind ", 7) == 0)
else if (ascii_strncasecmp (arguments, "unbind ", 7) == 0)
{
arguments += 7;
while (arguments[0] == ' ')
@@ -1413,7 +1531,7 @@ weechat_cmd_key (char *arguments)
return -1;
}
}
else if (strcasecmp (arguments, "functions") == 0)
else if (ascii_strcasecmp (arguments, "functions") == 0)
{
gui_printf (NULL, "\n");
gui_printf (NULL, _("Internal key functions:\n"));
@@ -1426,12 +1544,12 @@ weechat_cmd_key (char *arguments)
i++;
}
}
else if (strncasecmp (arguments, "reset", 5) == 0)
else if (ascii_strncasecmp (arguments, "reset", 5) == 0)
{
arguments += 5;
while (arguments[0] == ' ')
arguments++;
if (strcasecmp (arguments, "-yes") == 0)
if (ascii_strcasecmp (arguments, "-yes") == 0)
{
gui_key_free_all ();
gui_key_init ();
@@ -1486,7 +1604,7 @@ weechat_cmd_key (char *arguments)
int
weechat_cmd_perl (int argc, char **argv)
{
#ifdef PLUGIN_PERL
#ifdef PLUGIN_PERL
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
@@ -1565,18 +1683,18 @@ weechat_cmd_perl (int argc, char **argv)
break;
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
if (ascii_strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
else if (strcasecmp (argv[0], "reload") == 0)
else if (ascii_strcasecmp (argv[0], "reload") == 0)
{
plugin_unload (PLUGIN_TYPE_PERL, NULL);
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
else if (ascii_strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PERL, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
if (ascii_strcasecmp (argv[0], "load") == 0)
{
/* load Perl script */
if (strstr(argv[1], DIR_SEPARATOR))
@@ -1608,7 +1726,7 @@ weechat_cmd_perl (int argc, char **argv)
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "perl");
}
#else
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Perl support.\n"
@@ -1617,7 +1735,7 @@ weechat_cmd_perl (int argc, char **argv)
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGIN_PERL */
#endif /* PLUGIN_PERL */
return 0;
}
@@ -1629,7 +1747,7 @@ weechat_cmd_perl (int argc, char **argv)
int
weechat_cmd_python (int argc, char **argv)
{
#ifdef PLUGIN_PYTHON
#ifdef PLUGIN_PYTHON
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
@@ -1708,18 +1826,18 @@ weechat_cmd_python (int argc, char **argv)
break;
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
if (ascii_strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
else if (strcasecmp (argv[0], "reload") == 0)
else if (ascii_strcasecmp (argv[0], "reload") == 0)
{
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
else if (ascii_strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
if (ascii_strcasecmp (argv[0], "load") == 0)
{
/* load Python script */
if (strstr(argv[1], DIR_SEPARATOR))
@@ -1751,7 +1869,7 @@ weechat_cmd_python (int argc, char **argv)
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "python");
}
#else
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Python support.\n"
@@ -1760,7 +1878,150 @@ weechat_cmd_python (int argc, char **argv)
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGIN_PYTHON */
#endif /* PLUGIN_PYTHON */
return 0;
}
/*
* weechat_cmd_ruby: list/load/unload Ruby scripts
*/
int
weechat_cmd_ruby (int argc, char **argv)
{
#ifdef PLUGIN_RUBY
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
char *path_script;
switch (argc)
{
case 0:
/* list registered Ruby scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered %s scripts:\n"), "Ruby");
if (ruby_scripts)
{
for (ptr_plugin_script = ruby_scripts; ptr_plugin_script;
ptr_plugin_script = ptr_plugin_script->next_script)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, " %s v%s%s%s\n",
ptr_plugin_script->name,
ptr_plugin_script->version,
(ptr_plugin_script->description[0]) ? " - " : "",
ptr_plugin_script->description);
}
}
else
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Ruby message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s message handlers:\n"), "Ruby");
handler_found = 0;
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_RUBY)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Ruby",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Ruby command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s command handlers:\n"), "Ruby");
handler_found = 0;
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_RUBY)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Ruby",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
break;
case 1:
if (ascii_strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_RUBY, "ruby/autoload");
else if (ascii_strcasecmp (argv[0], "reload") == 0)
{
plugin_unload (PLUGIN_TYPE_RUBY, NULL);
plugin_auto_load (PLUGIN_TYPE_RUBY, "ruby/autoload");
}
else if (ascii_strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_RUBY, NULL);
break;
case 2:
if (ascii_strcasecmp (argv[0], "load") == 0)
{
/* load Ruby script */
if (strstr(argv[1], DIR_SEPARATOR))
path_script = NULL;
else
{
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, "ruby",
DIR_SEPARATOR, argv[1]);
}
plugin_load (PLUGIN_TYPE_RUBY,
(path_script) ? path_script : argv[1]);
if (path_script)
free (path_script);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "ruby");
}
break;
default:
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "ruby");
}
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Ruby support.\n"
"Please rebuild WeeChat with "
"\"--enable-ruby\" option for ./configure script\n"));
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGIN_RUBY */
return 0;
}
@@ -1819,7 +2080,7 @@ weechat_cmd_server (int argc, char **argv)
}
else
{
if (strcasecmp (argv[0], "del") == 0)
if (ascii_strcasecmp (argv[0], "del") == 0)
{
if (argc < 2)
{
@@ -1919,15 +2180,15 @@ weechat_cmd_server (int argc, char **argv)
{
if (argv[i][0] == '-')
{
if (strcasecmp (argv[i], "-auto") == 0)
if (ascii_strcasecmp (argv[i], "-auto") == 0)
server.autoconnect = 1;
if (strcasecmp (argv[i], "-noauto") == 0)
if (ascii_strcasecmp (argv[i], "-noauto") == 0)
server.autoconnect = 0;
if (strcasecmp (argv[i], "-ipv6") == 0)
if (ascii_strcasecmp (argv[i], "-ipv6") == 0)
server.ipv6 = 1;
if (strcasecmp (argv[i], "-ssl") == 0)
if (ascii_strcasecmp (argv[i], "-ssl") == 0)
server.ssl = 1;
if (strcasecmp (argv[i], "-pwd") == 0)
if (ascii_strcasecmp (argv[i], "-pwd") == 0)
{
if (i == (argc - 1))
{
@@ -1940,7 +2201,7 @@ weechat_cmd_server (int argc, char **argv)
}
server.password = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-nicks") == 0)
if (ascii_strcasecmp (argv[i], "-nicks") == 0)
{
if (i >= (argc - 3))
{
@@ -1955,7 +2216,7 @@ weechat_cmd_server (int argc, char **argv)
server.nick2 = strdup (argv[++i]);
server.nick3 = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-username") == 0)
if (ascii_strcasecmp (argv[i], "-username") == 0)
{
if (i == (argc - 1))
{
@@ -1968,7 +2229,7 @@ weechat_cmd_server (int argc, char **argv)
}
server.username = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-realname") == 0)
if (ascii_strcasecmp (argv[i], "-realname") == 0)
{
if (i == (argc - 1))
{
@@ -1981,7 +2242,7 @@ weechat_cmd_server (int argc, char **argv)
}
server.realname = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-command") == 0)
if (ascii_strcasecmp (argv[i], "-command") == 0)
{
if (i == (argc - 1))
{
@@ -1994,7 +2255,7 @@ weechat_cmd_server (int argc, char **argv)
}
server.command = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-autojoin") == 0)
if (ascii_strcasecmp (argv[i], "-autojoin") == 0)
{
if (i == (argc - 1))
{
@@ -2262,7 +2523,7 @@ weechat_cmd_set (char *arguments)
{
section_displayed = 0;
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
@@ -2371,6 +2632,69 @@ weechat_cmd_unalias (char *arguments)
return 0;
}
/*
* weechat_cmd_unignore: unignore IRC commands and/or hosts
*/
int
weechat_cmd_unignore (int argc, char **argv)
{
char *error;
int number, ret;
ret = 0;
switch (argc)
{
case 0:
/* List all ignore */
weechat_cmd_ignore (argc, argv);
return 0;
break;
case 1:
error = NULL;
number = strtol (argv[0], &error, 10);
if ((error) && (error[0] == '\0'))
ret = ignore_search_free_by_number (number);
else
ret = ignore_search_free (argv[0], "*", "*",
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 2:
ret = ignore_search_free (argv[0], argv[1], "*",
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 3:
ret = ignore_search_free (argv[0], argv[1], argv[2],
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 4:
ret = ignore_search_free (argv[0], argv[1], argv[2], argv[3]);
break;
}
if (ret)
{
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%d ", ret);
if (ret > 1)
gui_printf (NULL, _("ignore were removed.\n"));
else
gui_printf (NULL, _("ignore was removed.\n"));
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s no ignore found\n"),
WEECHAT_ERROR);
return -1;
}
return 0;
}
/*
* weechat_cmd_window: manage windows
*/
@@ -2381,7 +2705,7 @@ weechat_cmd_window (int argc, char **argv)
t_gui_window *ptr_win;
int i;
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
{
/* list opened windows */
@@ -2410,29 +2734,29 @@ weechat_cmd_window (int argc, char **argv)
}
else
{
if (strcasecmp (argv[0], "splith") == 0)
if (ascii_strcasecmp (argv[0], "splith") == 0)
{
/* split window horizontally */
gui_window_split_horiz (gui_current_window);
}
else if (strcasecmp (argv[0], "splitv") == 0)
else if (ascii_strcasecmp (argv[0], "splitv") == 0)
{
/* split window vertically */
gui_window_split_vertic (gui_current_window);
}
else if (strcasecmp (argv[0], "merge") == 0)
else if (ascii_strcasecmp (argv[0], "merge") == 0)
{
if (argc >= 2)
{
if (strcasecmp (argv[1], "down") == 0)
if (ascii_strcasecmp (argv[1], "down") == 0)
gui_window_merge_down (gui_current_window);
else if (strcasecmp (argv[1], "up") == 0)
else if (ascii_strcasecmp (argv[1], "up") == 0)
gui_window_merge_up (gui_current_window);
else if (strcasecmp (argv[1], "left") == 0)
else if (ascii_strcasecmp (argv[1], "left") == 0)
gui_window_merge_left (gui_current_window);
else if (strcasecmp (argv[1], "right") == 0)
else if (ascii_strcasecmp (argv[1], "right") == 0)
gui_window_merge_right (gui_current_window);
else if (strcasecmp (argv[1], "all") == 0)
else if (ascii_strcasecmp (argv[1], "all") == 0)
gui_window_merge_all (gui_current_window);
else
{
@@ -2446,10 +2770,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 if (ascii_strcasecmp (argv[0], "-1") == 0)
gui_switch_to_previous_window (gui_current_window);
else if (ascii_strcasecmp (argv[0], "+1") == 0)
gui_switch_to_next_window (gui_current_window);
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
+4
View File
@@ -69,13 +69,17 @@ 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 void weechat_cmd_ignore_display (char *, t_irc_ignore *);
extern int weechat_cmd_ignore (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_ruby (int, char **);
extern int weechat_cmd_save (int, char **);
extern int weechat_cmd_server (int, char **);
extern int weechat_cmd_set (char *);
extern int weechat_cmd_unalias (char *);
extern int weechat_cmd_unignore (int, char **);
extern int weechat_cmd_unset (char *);
extern int weechat_cmd_window (int, char **);
+167 -70
View File
@@ -102,6 +102,7 @@ completion_build_list (t_completion *completion, void *channel)
int i, j;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
char *pos, option_name[256], *string;
t_weechat_alias *ptr_alias;
t_config_option *option;
@@ -111,13 +112,13 @@ completion_build_list (t_completion *completion, void *channel)
/* WeeChat internal commands */
/* no completion for some commands */
if ((strcasecmp (completion->base_command, "server") == 0)
|| (strcasecmp (completion->base_command, "save") == 0))
if ((ascii_strcasecmp (completion->base_command, "server") == 0)
|| (ascii_strcasecmp (completion->base_command, "save") == 0))
{
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "alias") == 0)
if ((ascii_strcasecmp (completion->base_command, "alias") == 0)
&& (completion->base_command_arg == 1))
{
for (ptr_list = index_commands; ptr_list; ptr_list = ptr_list->next_weelist)
@@ -128,7 +129,7 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if ((strcasecmp (completion->base_command, "buffer") == 0)
if ((ascii_strcasecmp (completion->base_command, "buffer") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -145,7 +146,7 @@ completion_build_list (t_completion *completion, void *channel)
"notify");
return;
}
if ((strcasecmp (completion->base_command, "clear") == 0)
if ((ascii_strcasecmp (completion->base_command, "clear") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -153,8 +154,8 @@ completion_build_list (t_completion *completion, void *channel)
"-all");
return;
}
if ((strcasecmp (completion->base_command, "connect") == 0)
|| (strcasecmp (completion->base_command, "disconnect") == 0))
if ((ascii_strcasecmp (completion->base_command, "connect") == 0)
|| (ascii_strcasecmp (completion->base_command, "disconnect") == 0))
{
if (completion->base_command_arg == 1)
{
@@ -173,7 +174,7 @@ completion_build_list (t_completion *completion, void *channel)
return;
}
}
if (strcasecmp (completion->base_command, "debug") == 0)
if (ascii_strcasecmp (completion->base_command, "debug") == 0)
{
if (completion->base_command_arg == 1)
weelist_add (&completion->completion_list,
@@ -183,7 +184,7 @@ completion_build_list (t_completion *completion, void *channel)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "help") == 0)
if ((ascii_strcasecmp (completion->base_command, "help") == 0)
&& (completion->base_command_arg == 1))
{
for (i = 0; weechat_commands[i].command_name; i++)
@@ -201,22 +202,118 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if ((strcasecmp (completion->base_command, "key") == 0)
&& (completion->base_command_arg == 1))
if (ascii_strcasecmp (completion->base_command, "ignore") == 0)
{
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;
/* arg 1: nicks of current channel and "*" */
if (completion->base_command_arg == 1)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"*");
if (channel)
{
if (((t_irc_channel *)channel)->type == CHAT_CHANNEL)
{
for (ptr_nick = ((t_irc_channel *)channel)->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_nick->nick);
}
}
if (((t_irc_channel *)channel)->type == CHAT_PRIVATE)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)channel)->name);
}
}
return;
}
/* arg 2: type / command and "*" */
if (completion->base_command_arg == 2)
{
weelist_add(&completion->completion_list,
&completion->last_completion,
"*");
i = 0;
while (ignore_types[i])
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ignore_types[i]);
i++;
}
i = 0;
while (irc_commands[i].command_name)
{
if (irc_commands[i].recv_function)
weelist_add(&completion->completion_list,
&completion->last_completion,
irc_commands[i].command_name);
i++;
}
return;
}
/* arg 3: channel and "*" */
if (completion->base_command_arg == 3)
{
weelist_add(&completion->completion_list,
&completion->last_completion,
"*");
if (((t_irc_channel *)channel)->type == CHAT_CHANNEL)
weelist_add(&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)channel)->name);
return;
}
/* arg 4: server */
if (completion->base_command_arg == 4)
{
weelist_add(&completion->completion_list,
&completion->last_completion,
"*");
if (SERVER(gui_current_window->buffer))
weelist_add(&completion->completion_list,
&completion->last_completion,
SERVER(gui_current_window->buffer)->name);
return;
}
}
if (((strcasecmp (completion->base_command, "perl") == 0)
|| (strcasecmp (completion->base_command, "python") == 0))
if (ascii_strcasecmp (completion->base_command, "key") == 0)
{
if (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 (completion->base_command_arg == 2)
{
i = 0;
while (gui_key_functions[i].function_name)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
gui_key_functions[i].function_name);
i++;
}
return;
}
}
if (((ascii_strcasecmp (completion->base_command, "perl") == 0)
|| (ascii_strcasecmp (completion->base_command, "python") == 0))
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -233,14 +330,14 @@ completion_build_list (t_completion *completion, void *channel)
"unload");
return;
}
if (strcasecmp (completion->base_command, "set") == 0)
if (ascii_strcasecmp (completion->base_command, "set") == 0)
{
if (completion->base_command_arg == 1)
{
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
@@ -326,7 +423,7 @@ completion_build_list (t_completion *completion, void *channel)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "unalias") == 0)
if ((ascii_strcasecmp (completion->base_command, "unalias") == 0)
&& (completion->base_command_arg == 1))
{
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
@@ -337,7 +434,7 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if (strcasecmp (completion->base_command, "window") == 0)
if (ascii_strcasecmp (completion->base_command, "window") == 0)
{
if (completion->base_command_arg == 1)
{
@@ -383,33 +480,33 @@ completion_build_list (t_completion *completion, void *channel)
/* IRC commands */
/* no completion for some commands */
if ((strcasecmp (completion->base_command, "admin") == 0)
|| (strcasecmp (completion->base_command, "die") == 0)
|| (strcasecmp (completion->base_command, "info") == 0)
|| (strcasecmp (completion->base_command, "join") == 0)
|| (strcasecmp (completion->base_command, "links") == 0)
|| (strcasecmp (completion->base_command, "list") == 0)
|| (strcasecmp (completion->base_command, "lusers") == 0)
|| (strcasecmp (completion->base_command, "motd") == 0)
|| (strcasecmp (completion->base_command, "oper") == 0)
|| (strcasecmp (completion->base_command, "rehash") == 0)
|| (strcasecmp (completion->base_command, "restart") == 0)
|| (strcasecmp (completion->base_command, "service") == 0)
|| (strcasecmp (completion->base_command, "servlist") == 0)
|| (strcasecmp (completion->base_command, "squery") == 0)
|| (strcasecmp (completion->base_command, "squit") == 0)
|| (strcasecmp (completion->base_command, "stats") == 0)
|| (strcasecmp (completion->base_command, "summon") == 0)
|| (strcasecmp (completion->base_command, "time") == 0)
|| (strcasecmp (completion->base_command, "trace") == 0)
|| (strcasecmp (completion->base_command, "users") == 0)
|| (strcasecmp (completion->base_command, "wallops") == 0)
|| (strcasecmp (completion->base_command, "who") == 0))
if ((ascii_strcasecmp (completion->base_command, "admin") == 0)
|| (ascii_strcasecmp (completion->base_command, "die") == 0)
|| (ascii_strcasecmp (completion->base_command, "info") == 0)
|| (ascii_strcasecmp (completion->base_command, "join") == 0)
|| (ascii_strcasecmp (completion->base_command, "links") == 0)
|| (ascii_strcasecmp (completion->base_command, "list") == 0)
|| (ascii_strcasecmp (completion->base_command, "lusers") == 0)
|| (ascii_strcasecmp (completion->base_command, "motd") == 0)
|| (ascii_strcasecmp (completion->base_command, "oper") == 0)
|| (ascii_strcasecmp (completion->base_command, "rehash") == 0)
|| (ascii_strcasecmp (completion->base_command, "restart") == 0)
|| (ascii_strcasecmp (completion->base_command, "service") == 0)
|| (ascii_strcasecmp (completion->base_command, "servlist") == 0)
|| (ascii_strcasecmp (completion->base_command, "squery") == 0)
|| (ascii_strcasecmp (completion->base_command, "squit") == 0)
|| (ascii_strcasecmp (completion->base_command, "stats") == 0)
|| (ascii_strcasecmp (completion->base_command, "summon") == 0)
|| (ascii_strcasecmp (completion->base_command, "time") == 0)
|| (ascii_strcasecmp (completion->base_command, "trace") == 0)
|| (ascii_strcasecmp (completion->base_command, "users") == 0)
|| (ascii_strcasecmp (completion->base_command, "wallops") == 0)
|| (ascii_strcasecmp (completion->base_command, "who") == 0))
{
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "away") == 0)
if ((ascii_strcasecmp (completion->base_command, "away") == 0)
&& (completion->base_command_arg == 1))
{
if (cfg_irc_default_msg_away && cfg_irc_default_msg_away[0])
@@ -418,7 +515,7 @@ completion_build_list (t_completion *completion, void *channel)
cfg_irc_default_msg_away);
return;
}
if ((strcasecmp (completion->base_command, "ctcp") == 0)
if ((ascii_strcasecmp (completion->base_command, "ctcp") == 0)
&& (completion->base_command_arg == 2))
{
weelist_add (&completion->completion_list,
@@ -432,7 +529,7 @@ completion_build_list (t_completion *completion, void *channel)
"version");
return;
}
if ((strcasecmp (completion->base_command, "dcc") == 0)
if ((ascii_strcasecmp (completion->base_command, "dcc") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -446,7 +543,7 @@ completion_build_list (t_completion *completion, void *channel)
"close");
return;
}
if (strcasecmp (completion->base_command, "invite") == 0)
if (ascii_strcasecmp (completion->base_command, "invite") == 0)
{
/* arg1: nickname */
if (completion->base_command_arg == 1)
@@ -472,30 +569,30 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if (strcasecmp (completion->base_command, "kick") == 0)
if (ascii_strcasecmp (completion->base_command, "kick") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "kill") == 0)
if (ascii_strcasecmp (completion->base_command, "kill") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "me") == 0)
if (ascii_strcasecmp (completion->base_command, "me") == 0)
{
completion->context = COMPLETION_NICK;
return;
}
if (strcasecmp (completion->base_command, "notice") == 0)
if (ascii_strcasecmp (completion->base_command, "notice") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "part") == 0)
if ((ascii_strcasecmp (completion->base_command, "part") == 0)
&& (completion->base_command_arg == 1))
{
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
@@ -504,13 +601,13 @@ completion_build_list (t_completion *completion, void *channel)
cfg_irc_default_msg_part);
return;
}
if (strcasecmp (completion->base_command, "query") == 0)
if (ascii_strcasecmp (completion->base_command, "query") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "quit") == 0)
if ((ascii_strcasecmp (completion->base_command, "quit") == 0)
&& (completion->base_command_arg == 1))
{
if (cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0])
@@ -519,7 +616,7 @@ completion_build_list (t_completion *completion, void *channel)
cfg_irc_default_msg_quit);
return;
}
if (strcasecmp (completion->base_command, "topic") == 0)
if (ascii_strcasecmp (completion->base_command, "topic") == 0)
{
if (completion->base_command_arg == 1)
{
@@ -703,7 +800,7 @@ completion_command (t_completion *completion)
other_completion = 0;
for (ptr_weelist = index_commands; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
{
if (strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
@@ -711,7 +808,7 @@ completion_command (t_completion *completion)
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
ptr_weelist2 = ptr_weelist2->next_weelist)
{
if (strncasecmp (ptr_weelist2->data,
if (ascii_strncasecmp (ptr_weelist2->data,
completion->base_word + 1, length) == 0)
other_completion++;
}
@@ -725,7 +822,7 @@ completion_command (t_completion *completion)
other_completion++;
}
if (completion->word_found &&
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
word_found_seen = 1;
}
if (completion->word_found)
@@ -751,7 +848,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
for (ptr_weelist = completion->completion_list; ptr_weelist;
ptr_weelist = ptr_weelist->next_weelist)
{
if (strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
@@ -759,7 +856,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
ptr_weelist2 = ptr_weelist2->next_weelist)
{
if (strncasecmp (ptr_weelist2->data,
if (ascii_strncasecmp (ptr_weelist2->data,
completion->base_word, length) == 0)
other_completion++;
}
@@ -773,7 +870,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
other_completion++;
}
if (completion->word_found &&
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
word_found_seen = 1;
}
if (completion->word_found)
@@ -807,7 +904,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
other_completion = 0;
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
if (strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
if (ascii_strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
@@ -815,7 +912,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
ptr_nick2 = ptr_nick2->next_nick)
{
if (strncasecmp (ptr_nick2->nick,
if (ascii_strncasecmp (ptr_nick2->nick,
completion->base_word, length) == 0)
other_completion++;
}
@@ -829,7 +926,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
other_completion++;
}
if (completion->word_found &&
(strcasecmp (ptr_nick->nick, completion->word_found) == 0))
(ascii_strcasecmp (ptr_nick->nick, completion->word_found) == 0))
word_found_seen = 1;
}
if (completion->word_found)
+32 -32
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* history.c: memorize and call again commands or text */
/* history.c: memorize commands or text */
#ifdef HAVE_CONFIG_H
@@ -33,10 +33,10 @@
#include "../gui/gui.h"
t_history *history_general = NULL;
t_history *history_general_last = NULL;
t_history *history_general_ptr = NULL;
int num_history_general = 0;
t_history *history_global = NULL;
t_history *history_global_last = NULL;
t_history *history_global_ptr = NULL;
int num_history_global = 0;
/*
@@ -74,7 +74,7 @@ history_add (void *buffer, char *string)
{
t_history *new_history, *ptr_history;
/* add history to general history */
/* add history to global history */
new_history = (t_history *)malloc (sizeof (t_history));
if (new_history)
{
@@ -82,26 +82,26 @@ history_add (void *buffer, char *string)
if (cfg_log_hide_nickserv_pwd)
history_hide_password (new_history->text);
if (history_general)
history_general->prev_history = new_history;
if (history_global)
history_global->prev_history = new_history;
else
history_general_last = new_history;
new_history->next_history = history_general;
history_global_last = new_history;
new_history->next_history = history_global;
new_history->prev_history = NULL;
history_general = new_history;
num_history_general++;
history_global = new_history;
num_history_global++;
/* remove one command if necessary */
if ((cfg_history_max_commands > 0)
&& (num_history_general > cfg_history_max_commands))
&& (num_history_global > cfg_history_max_commands))
{
ptr_history = history_general_last->prev_history;
history_general_last->prev_history->next_history = NULL;
if (history_general_last->text)
free (history_general_last->text);
free (history_general_last);
history_general_last = ptr_history;
num_history_general--;
ptr_history = history_global_last->prev_history;
history_global_last->prev_history->next_history = NULL;
if (history_global_last->text)
free (history_global_last->text);
free (history_global_last);
history_global_last = ptr_history;
num_history_global--;
}
}
@@ -138,26 +138,26 @@ history_add (void *buffer, char *string)
}
/*
* history_general_free: free general history
* history_global_free: free global history
*/
void
history_general_free ()
history_global_free ()
{
t_history *ptr_history;
while (history_general)
while (history_global)
{
ptr_history = history_general->next_history;
if (history_general->text)
free (history_general->text);
free (history_general);
history_general = ptr_history;
ptr_history = history_global->next_history;
if (history_global->text)
free (history_global->text);
free (history_global);
history_global = ptr_history;
}
history_general = NULL;
history_general_last = NULL;
history_general_ptr = NULL;
num_history_general = 0;
history_global = NULL;
history_global_last = NULL;
history_global_ptr = NULL;
num_history_global = 0;
}
+5 -1
View File
@@ -30,8 +30,12 @@ struct t_history
t_history *prev_history; /* link to previous text/command */
};
extern t_history *history_global;
extern t_history *history_global_last;
extern t_history *history_global_ptr;
extern void history_add (void *, char *);
extern void history_general_free ();
extern void history_global_free ();
extern void history_buffer_free (void *);
#endif /* history.h */
+79 -3
View File
@@ -83,6 +83,78 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
#endif
/*
* ascii_strcasecmp: locale and case independent string comparison
*/
int
ascii_strcasecmp (char *string1, char *string2)
{
int c1, c2;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
while (string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
}
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* ascii_strncasecmp: locale and case independent string comparison
* with max length
*/
int
ascii_strncasecmp (char *string1, char *string2, int max)
{
int c1, c2, count;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
count = 0;
while ((count < max) && string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
count++;
}
if (count >= max)
return 0;
else
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* wee_log_printf: displays a message in WeeChat log (~/.weechat/weechat.log)
*/
@@ -131,7 +203,7 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (strcasecmp(from_code, to_code) != 0))
&& (ascii_strcasecmp(from_code, to_code) != 0))
{
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))
@@ -250,7 +322,7 @@ void wee_display_config_options ()
break;
}
printf (_(" . description: %s\n\n"),
gettext (weechat_options[i][j].long_description));
_(weechat_options[i][j].long_description));
j++;
}
}
@@ -418,7 +490,7 @@ wee_parse_args (int argc, char *argv[])
wee_display_commands (1, 0);
wee_shutdown (EXIT_SUCCESS, 0);
}
else if ((strncasecmp (argv[i], "irc", 3) == 0))
else if ((ascii_strncasecmp (argv[i], "irc", 3) == 0))
{
if (server_init_with_url (argv[i], &server_tmp) < 0)
{
@@ -772,6 +844,9 @@ wee_dump (int crash)
wee_log_printf ("\n");
gui_buffer_print_log (ptr_buffer);
}
wee_log_printf ("\n");
ignore_print_log ();
wee_log_printf ("\n");
wee_log_printf ("****** End of dump ******\n");
@@ -814,6 +889,7 @@ main (int argc, char *argv[])
#endif
signal (SIGINT, SIG_IGN); /* ignore SIGINT signal */
signal (SIGQUIT, SIG_IGN); /* ignore SIGQUIT 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 */
+2
View File
@@ -118,6 +118,8 @@ extern char *local_charset;
extern gnutls_certificate_credentials gnutls_xcred;
#endif
extern int ascii_strcasecmp (char *, char *);
extern int ascii_strncasecmp (char *, char *, int);
extern void wee_log_printf (char *, ...);
extern void wee_dump (int);
extern char *weechat_convert_encoding (char *, char *, char *);
+151 -38
View File
@@ -55,6 +55,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
{ CONFIG_SECTION_PROXY, "proxy" },
{ CONFIG_SECTION_KEYS, "keys" },
{ CONFIG_SECTION_ALIAS, "alias" },
{ CONFIG_SECTION_IGNORE, "ignore" },
{ CONFIG_SECTION_SERVER, "server" }
};
@@ -69,6 +70,7 @@ char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks;
int cfg_look_color_nicks_number;
int cfg_look_color_actions;
int cfg_look_remove_colors_from_msgs;
int cfg_look_nicklist;
@@ -123,6 +125,10 @@ t_config_option weechat_options_look[] =
N_("display nick names with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_color_nicks, NULL, config_change_noop },
{ "look_color_nicks_number", N_("number of colors to use for nicks colors"),
N_("number of colors to use for nicks colors"),
OPTION_TYPE_INT, 1, 10, 10,
NULL, NULL, &cfg_look_color_nicks_number, NULL, config_change_nicks_colors },
{ "look_color_actions", N_("display actions with different colors"),
N_("display actions with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -228,6 +234,7 @@ int cfg_col_nick_voice;
int cfg_col_nick_more;
int cfg_col_nick_sep;
int cfg_col_nick_self;
int cfg_col_nick_colors[COLOR_WIN_NICK_NUMBER];
int cfg_col_nick_private;
int cfg_col_nick_bg;
int cfg_col_dcc_selected;
@@ -414,6 +421,46 @@ t_config_option weechat_options_colors[] =
N_("color for local nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_nick_self, NULL, &config_change_color },
{ "col_nick_color1", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"cyan", NULL, &cfg_col_nick_colors[0], NULL, &config_change_color },
{ "col_nick_color2", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"magenta", NULL, &cfg_col_nick_colors[1], NULL, &config_change_color },
{ "col_nick_color3", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"green", NULL, &cfg_col_nick_colors[2], NULL, &config_change_color },
{ "col_nick_color4", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"brown", NULL, &cfg_col_nick_colors[3], NULL, &config_change_color },
{ "col_nick_color5", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightblue", NULL, &cfg_col_nick_colors[4], NULL, &config_change_color },
{ "col_nick_color6", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_nick_colors[5], NULL, &config_change_color },
{ "col_nick_color7", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightcyan", NULL, &cfg_col_nick_colors[6], NULL, &config_change_color },
{ "col_nick_color8", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_nick_colors[7], NULL, &config_change_color },
{ "col_nick_color9", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_nick_colors[8], NULL, &config_change_color },
{ "col_nick_color10", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"blue", NULL, &cfg_col_nick_colors[9], NULL, &config_change_color },
{ "col_nick_private", N_("color for other nick in private window"),
N_("color for other nick in private window"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -522,6 +569,7 @@ int cfg_irc_display_away;
char *cfg_irc_default_msg_away;
char *cfg_irc_default_msg_part;
char *cfg_irc_default_msg_quit;
int cfg_irc_notice_as_pv;
int cfg_irc_away_check;
int cfg_irc_lag_check;
int cfg_irc_lag_min_show;
@@ -546,6 +594,10 @@ t_config_option weechat_options_irc[] =
N_("default quit message ('%v' will be replaced by WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_quit, config_change_noop },
{ "irc_notice_as_pv", N_("display notices as private messages"),
N_("display notices as private messages"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_irc_notice_as_pv, NULL, config_change_noop },
{ "irc_away_check", N_("interval between two checks for away"),
N_("interval between two checks for away (in minutes, 0 = never check)"),
OPTION_TYPE_INT, 0, INT_MAX, 0,
@@ -739,7 +791,7 @@ t_config_option weechat_options_server[] =
OPTION_TYPE_INT, 0, 5, 0,
NULL, NULL, &(cfg_server.command_delay), NULL, NULL },
{ "server_autojoin", N_("list of channels to join when connected to server"),
N_("comma separated list of channels to join when connected to server"),
N_("comma separated list of channels to join when connected to server (example: \"#chan1,#chan2,#chan3 #key1,#key2\")"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.autojoin), NULL },
{ "server_autorejoin", N_("automatically rejoin channels when kicked"),
@@ -758,7 +810,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, NULL, weechat_options_server
weechat_options_proxy, NULL, NULL, NULL, weechat_options_server
};
@@ -775,7 +827,7 @@ get_pos_array_values (char **array, char *string)
i = 0;
while (array[i])
{
if (strcasecmp (array[i], string) == 0)
if (ascii_strcasecmp (array[i], string) == 0)
return i;
i++;
}
@@ -795,7 +847,7 @@ config_get_section (t_config_option *ptr_option)
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
@@ -858,7 +910,41 @@ config_change_buffer_content ()
void
config_change_color ()
{
t_gui_window *ptr_win;
gui_init_colors ();
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
gui_redraw_buffer (ptr_win->buffer);
}
/*
* config_change_nicks_colors: called when number of nicks color changed
*/
void
config_change_nicks_colors ()
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
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)
{
for (ptr_nick = ptr_channel->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
{
if (ptr_nick->color != COLOR_WIN_NICK_SELF)
ptr_nick->color = nick_find_color (ptr_nick);
}
}
}
}
}
/*
@@ -926,9 +1012,9 @@ config_option_set_value (t_config_option *option, char *value)
switch (option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (strcasecmp (value, "on") == 0)
if (ascii_strcasecmp (value, "on") == 0)
*(option->ptr_int) = BOOL_TRUE;
else if (strcasecmp (value, "off") == 0)
else if (ascii_strcasecmp (value, "off") == 0)
*(option->ptr_int) = BOOL_FALSE;
else
return -1;
@@ -965,43 +1051,43 @@ config_option_set_value (t_config_option *option, char *value)
void *
config_get_server_option_ptr (t_irc_server *server, char *option_name)
{
if (strcasecmp (option_name, "server_name") == 0)
if (ascii_strcasecmp (option_name, "server_name") == 0)
return (void *)(&server->name);
if (strcasecmp (option_name, "server_autoconnect") == 0)
if (ascii_strcasecmp (option_name, "server_autoconnect") == 0)
return (void *)(&server->autoconnect);
if (strcasecmp (option_name, "server_autoreconnect") == 0)
if (ascii_strcasecmp (option_name, "server_autoreconnect") == 0)
return (void *)(&server->autoreconnect);
if (strcasecmp (option_name, "server_autoreconnect_delay") == 0)
if (ascii_strcasecmp (option_name, "server_autoreconnect_delay") == 0)
return (void *)(&server->autoreconnect_delay);
if (strcasecmp (option_name, "server_address") == 0)
if (ascii_strcasecmp (option_name, "server_address") == 0)
return (void *)(&server->address);
if (strcasecmp (option_name, "server_port") == 0)
if (ascii_strcasecmp (option_name, "server_port") == 0)
return (void *)(&server->port);
if (strcasecmp (option_name, "server_ipv6") == 0)
if (ascii_strcasecmp (option_name, "server_ipv6") == 0)
return (void *)(&server->ipv6);
if (strcasecmp (option_name, "server_ssl") == 0)
if (ascii_strcasecmp (option_name, "server_ssl") == 0)
return (void *)(&server->ssl);
if (strcasecmp (option_name, "server_password") == 0)
if (ascii_strcasecmp (option_name, "server_password") == 0)
return (void *)(&server->password);
if (strcasecmp (option_name, "server_nick1") == 0)
if (ascii_strcasecmp (option_name, "server_nick1") == 0)
return (void *)(&server->nick1);
if (strcasecmp (option_name, "server_nick2") == 0)
if (ascii_strcasecmp (option_name, "server_nick2") == 0)
return (void *)(&server->nick2);
if (strcasecmp (option_name, "server_nick3") == 0)
if (ascii_strcasecmp (option_name, "server_nick3") == 0)
return (void *)(&server->nick3);
if (strcasecmp (option_name, "server_username") == 0)
if (ascii_strcasecmp (option_name, "server_username") == 0)
return (void *)(&server->username);
if (strcasecmp (option_name, "server_realname") == 0)
if (ascii_strcasecmp (option_name, "server_realname") == 0)
return (void *)(&server->realname);
if (strcasecmp (option_name, "server_command") == 0)
if (ascii_strcasecmp (option_name, "server_command") == 0)
return (void *)(&server->command);
if (strcasecmp (option_name, "server_command_delay") == 0)
if (ascii_strcasecmp (option_name, "server_command_delay") == 0)
return (void *)(&server->command_delay);
if (strcasecmp (option_name, "server_autojoin") == 0)
if (ascii_strcasecmp (option_name, "server_autojoin") == 0)
return (void *)(&server->autojoin);
if (strcasecmp (option_name, "server_autorejoin") == 0)
if (ascii_strcasecmp (option_name, "server_autorejoin") == 0)
return (void *)(&server->autorejoin);
if (strcasecmp (option_name, "server_notify_levels") == 0)
if (ascii_strcasecmp (option_name, "server_notify_levels") == 0)
return (void *)(&server->notify_levels);
/* option not found */
return NULL;
@@ -1031,7 +1117,7 @@ config_set_server_value (t_irc_server *server, char *option_name,
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
/* if option found, return pointer */
if (strcasecmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, option_name) == 0)
if (ascii_strcasecmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, option_name) == 0)
{
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
break;
@@ -1043,9 +1129,9 @@ config_set_server_value (t_irc_server *server, char *option_name,
switch (ptr_option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (strcasecmp (value, "on") == 0)
if (ascii_strcasecmp (value, "on") == 0)
*((int *)(ptr_data)) = BOOL_TRUE;
else if (strcasecmp (value, "off") == 0)
else if (ascii_strcasecmp (value, "off") == 0)
*((int *)(ptr_data)) = BOOL_FALSE;
else
return -2;
@@ -1090,12 +1176,12 @@ config_option_search (char *option_name)
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
/* if option found, return pointer */
if (strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
if (ascii_strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
return &weechat_options[i][j];
}
}
@@ -1254,7 +1340,7 @@ config_default_values ()
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
@@ -1428,6 +1514,21 @@ config_read ()
if (alias_new (line, pos))
weelist_add (&index_commands, &last_index_command, line);
}
else if (section == CONFIG_SECTION_IGNORE)
{
/* create new ignore */
if (ascii_strcasecmp (line, "ignore") != 0)
gui_printf (NULL,
_("%s %s, line %d: invalid option \"%s\"\n"),
WEECHAT_WARNING, filename, line_number, line);
else
{
if (!ignore_add_from_config (pos))
gui_printf (NULL,
_("%s %s, line %d: invalid ignore options \"%s\"\n"),
WEECHAT_WARNING, filename, line_number, pos);
}
}
else
{
option_number = -1;
@@ -1571,7 +1672,7 @@ config_create_default ()
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
@@ -1623,7 +1724,6 @@ config_create_default ()
}
/* default aliases */
/* TODO: remove comments when missing commands will be ok */
fprintf (file, "\n[alias]\n");
fprintf (file, "SAY=msg *\n");
fprintf (file, "BYE=quit\n");
@@ -1633,12 +1733,10 @@ config_create_default ()
fprintf (file, "CL=clear\n");
fprintf (file, "CLOSE=buffer close\n");
fprintf (file, "CHAT=dcc chat\n");
fprintf (file, "# GET=dcc get\n");
fprintf (file, "# IG=ignore\n");
fprintf (file, "IG=ignore\n");
fprintf (file, "J=join\n");
fprintf (file, "K=kick\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");
@@ -1646,12 +1744,14 @@ config_create_default ()
fprintf (file, "Q=query\n");
fprintf (file, "T=topic\n");
fprintf (file, "UB=unban\n");
fprintf (file, "# UNIG=unignore\n");
fprintf (file, "UNIG=unignore\n");
fprintf (file, "W=who\n");
fprintf (file, "WC=part\n");
fprintf (file, "WI=whois\n");
fprintf (file, "WW=whowas\n");
/* no ignore by default */
/* default server is freenode */
fprintf (file, "\n[server]\n");
fprintf (file, "server_name=freenode\n");
@@ -1730,6 +1830,7 @@ config_write (char *config_name)
time_t current_time;
t_irc_server *ptr_server;
t_weechat_alias *ptr_alias;
t_irc_ignore *ptr_ignore;
t_gui_key *ptr_key;
char *expanded_name, *function_name;
@@ -1765,7 +1866,7 @@ config_write (char *config_name)
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
@@ -1842,6 +1943,18 @@ config_write (char *config_name)
ptr_alias->alias_name, ptr_alias->alias_command + 1);
}
/* ignore section */
fprintf (file, "\n[ignore]\n");
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
fprintf (file, "ignore=%s,%s,%s,%s\n",
ptr_ignore->mask,
ptr_ignore->type,
ptr_ignore->channel_name,
ptr_ignore->server_name);
}
/* server section */
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
+7 -2
View File
@@ -35,8 +35,9 @@
#define CONFIG_SECTION_PROXY 6
#define CONFIG_SECTION_KEYS 7
#define CONFIG_SECTION_ALIAS 8
#define CONFIG_SECTION_SERVER 9
#define CONFIG_NUMBER_SECTIONS 10
#define CONFIG_SECTION_IGNORE 9
#define CONFIG_SECTION_SERVER 10
#define CONFIG_NUMBER_SECTIONS 11
#define OPTION_TYPE_BOOLEAN 1 /* values: on/off */
#define OPTION_TYPE_INT 2 /* values: from min to max */
@@ -86,6 +87,7 @@ extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern char *cfg_look_buffer_timestamp;
extern int cfg_look_color_nicks;
extern int cfg_look_color_nicks_number;
extern int cfg_look_color_actions;
extern int cfg_look_remove_colors_from_msgs;
extern int cfg_look_nicklist;
@@ -142,6 +144,7 @@ extern int cfg_col_nick_voice;
extern int cfg_col_nick_more;
extern int cfg_col_nick_sep;
extern int cfg_col_nick_self;
extern int cfg_col_nick_colors[COLOR_WIN_NICK_NUMBER];
extern int cfg_col_nick_private;
extern int cfg_col_nick_bg;
extern int cfg_col_dcc_selected;
@@ -167,6 +170,7 @@ extern int cfg_irc_display_away;
extern char *cfg_irc_default_msg_away;
extern char *cfg_irc_default_msg_part;
extern char *cfg_irc_default_msg_quit;
extern int cfg_irc_notice_as_pv;
extern int cfg_irc_away_check;
extern int cfg_irc_lag_check;
extern int cfg_irc_lag_min_show;
@@ -202,6 +206,7 @@ extern void config_change_title ();
extern void config_change_buffers ();
extern void config_change_buffer_content ();
extern void config_change_color ();
extern void config_change_nicks_colors ();
extern void config_change_away_check ();
extern void config_change_fifo_pipe ();
extern void config_change_notify_levels ();
+2 -2
View File
@@ -42,7 +42,7 @@ weelist_search (t_weelist *weelist, char *data)
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
{
if (strcasecmp (data, ptr_weelist->data) == 0)
if (ascii_strcasecmp (data, ptr_weelist->data) == 0)
return ptr_weelist;
}
/* word not found in list */
@@ -60,7 +60,7 @@ weelist_find_pos (t_weelist *weelist, char *data)
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
{
if (strcasecmp (data, ptr_weelist->data) < 0)
if (ascii_strcasecmp (data, ptr_weelist->data) < 0)
return ptr_weelist;
}
/* position not found, best position is at the end */
+259 -113
View File
@@ -60,10 +60,6 @@ t_gui_color gui_colors[] =
{ NULL, 0 }
};
char *nicks_colors[COLOR_WIN_NICK_NUMBER] =
{ "cyan", "magenta", "green", "brown", "lightblue", "default",
"lightcyan", "lightmagenta", "lightgreen", "blue" };
int color_attr[NUM_COLORS];
@@ -80,7 +76,7 @@ gui_assign_color (int *color, char *color_name)
i = 0;
while (gui_colors[i].name)
{
if (strcasecmp (gui_colors[i].name, color_name) == 0)
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
{
*color = gui_colors[i].color;
return 1;
@@ -105,7 +101,7 @@ gui_get_color_by_name (char *color_name)
i = 0;
while (gui_colors[i].name)
{
if (strcasecmp (gui_colors[i].name, color_name) == 0)
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
return gui_colors[i].color;
i++;
}
@@ -184,6 +180,13 @@ gui_calculate_pos_size (t_gui_window *window)
{
max_length = nick_get_max_length (CHANNEL(window->buffer));
if ((cfg_look_nicklist_min_size > 0)
&& (max_length < cfg_look_nicklist_min_size))
max_length = cfg_look_nicklist_min_size;
else if ((cfg_look_nicklist_max_size > 0)
&& (max_length > cfg_look_nicklist_max_size))
max_length = cfg_look_nicklist_max_size;
switch (cfg_look_nicklist_position)
{
case CFG_LOOK_NICKLIST_LEFT:
@@ -433,7 +436,7 @@ gui_display_word (t_gui_window *window, t_gui_line *line,
int end_of_word, chars_to_display, num_displayed;
if (!message || !end_msg ||
(window->win_chat_cursor_y > window->win_chat_height - 1))
((!simulate) && (window->win_chat_cursor_y > window->win_chat_height - 1)))
return;
snprintf (format_align, 32, "%%-%ds", line->length_align);
@@ -486,7 +489,6 @@ gui_display_word (t_gui_window *window, t_gui_line *line,
}
else
{
num_displayed = chars_to_display;
if ((!simulate) &&
((count == 0) || (*lines_displayed >= num_lines - count)))
@@ -519,7 +521,8 @@ gui_display_word (t_gui_window *window, t_gui_line *line,
/* end of word? */
if (!message || (message->prev_message == end_msg) ||
((message == end_msg) && (offset > end_offset)))
((message == end_msg) && (offset > end_offset)) ||
(window->win_chat_cursor_y >= window->win_chat_height))
end_of_word = 1;
}
@@ -587,9 +590,6 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
int word_length_with_spaces, word_length;
int skip_spaces;
if (window->win_chat_cursor_y > window->win_chat_height - 1)
return 0;
if (simulate)
{
x = window->win_chat_cursor_x;
@@ -600,6 +600,8 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
}
else
{
if (window->win_chat_cursor_y > window->win_chat_height - 1)
return 0;
x = window->win_chat_cursor_x;
y = window->win_chat_cursor_y;
num_lines = gui_display_line (window, line, 0, 1);
@@ -640,16 +642,21 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
word_end_msg, word_end_offset,
num_lines, count, &lines_displayed, simulate);
/* move pointer after end of word */
ptr_message = word_end_msg;
offset = word_end_offset;
gui_message_get_next_char (&ptr_message, &offset);
/* skip leading spaces? */
if (skip_spaces)
if (window->win_chat_cursor_y >= window->win_chat_height)
ptr_message = NULL;
else
{
while (ptr_message && (ptr_message->message[offset] == ' '))
gui_message_get_next_char (&ptr_message, &offset);
/* move pointer after end of word */
ptr_message = word_end_msg;
offset = word_end_offset;
gui_message_get_next_char (&ptr_message, &offset);
/* skip leading spaces? */
if (skip_spaces)
{
while (ptr_message && (ptr_message->message[offset] == ' '))
gui_message_get_next_char (&ptr_message, &offset);
}
}
}
else
@@ -669,6 +676,105 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
return lines_displayed;
}
/*
* gui_calculate_line_diff: returns pointer to line & offset for a difference
* with given line
*/
void
gui_calculate_line_diff (t_gui_window *window, t_gui_line **line, int *line_pos,
int difference)
{
int backward, current_size;
if (!line || !line_pos)
return;
backward = (difference < 0);
if (!(*line))
{
/* if looking backward, start at last line of buffer */
if (backward)
{
*line = window->buffer->last_line;
if (!(*line))
return;
current_size = gui_display_line (window, *line, 0, 1);
if (current_size == 0)
current_size = 1;
*line_pos = current_size - 1;
}
/* if looking forward, start at first line of buffer */
else
{
*line = window->buffer->lines;
if (!(*line))
return;
*line_pos = 0;
current_size = gui_display_line (window, *line, 0, 1);
}
}
else
current_size = gui_display_line (window, *line, 0, 1);
while ((*line) && (difference != 0))
{
/* looking backward */
if (backward)
{
if (*line_pos > 0)
(*line_pos)--;
else
{
*line = (*line)->prev_line;
if (*line)
{
current_size = gui_display_line (window, *line, 0, 1);
if (current_size == 0)
current_size = 1;
*line_pos = current_size - 1;
}
}
difference++;
}
/* looking forward */
else
{
if (*line_pos < current_size - 1)
(*line_pos)++;
else
{
*line = (*line)->next_line;
if (*line)
{
current_size = gui_display_line (window, *line, 0, 1);
if (current_size == 0)
current_size = 1;
*line_pos = 0;
}
}
difference--;
}
}
/* first or last line reached */
if (!(*line))
{
if (backward)
{
/* first line reached */
*line = window->buffer->lines;
*line_pos = 0;
}
else
{
/* last line reached => consider we'll display all until the end */
*line_pos = 0;
}
}
}
/*
* gui_draw_buffer_chat: draw chat window for a buffer
*/
@@ -680,12 +786,12 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
t_gui_line *ptr_line;
t_irc_dcc *dcc_first, *dcc_selected, *ptr_dcc;
char format_empty[32];
int i, j, lines_used, num_bars;
int i, j, line_pos, count, num_bars;
char *unit_name[] = { N_("bytes"), N_("Kb"), N_("Mb"), N_("Gb") };
char *unit_format[] = { "%.0Lf", "%.1Lf", "%.02Lf", "%.02Lf" };
long unit_divide[] = { 1, 1024, 1024*1024, 1024*1024,1024 };
int num_unit;
char format[32], date[128];
char format[32], date[128], *buf;
struct tm *date_tmp;
if (!gui_ok)
@@ -722,11 +828,16 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
gui_window_set_color (ptr_win->win_chat,
(ptr_dcc == dcc_selected) ?
COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
mvwprintw (ptr_win->win_chat, i, 0, "%s %-16s %s",
mvwprintw (ptr_win->win_chat, i, 0, "%s %-16s ",
(ptr_dcc == dcc_selected) ? "***" : " ",
ptr_dcc->nick,
(DCC_IS_CHAT(ptr_dcc->type)) ?
_(ptr_dcc->filename) : ptr_dcc->filename);
ptr_dcc->nick);
buf = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
(DCC_IS_CHAT(ptr_dcc->type)) ?
_(ptr_dcc->filename) : ptr_dcc->filename);
wprintw (ptr_win->win_chat, "%s", buf);
free (buf);
if (DCC_IS_FILE(ptr_dcc->type))
{
if (ptr_dcc->filename_suffix > 0)
@@ -743,8 +854,12 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
(DCC_IS_RECV(ptr_dcc->type)) ? "-->>" : "<<--");
gui_window_set_color (ptr_win->win_chat,
COLOR_DCC_WAITING + ptr_dcc->status);
wprintw (ptr_win->win_chat, "%-10s",
_(dcc_status_string[ptr_dcc->status]));
buf = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
_(dcc_status_string[ptr_dcc->status]));
wprintw (ptr_win->win_chat, "%-10s", buf);
free (buf);
/* other infos */
gui_window_set_color (ptr_win->win_chat,
@@ -790,9 +905,14 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
else
num_unit = 3;
sprintf (format, " (%s %%s/s)", unit_format[num_unit]);
buf = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
unit_name[num_unit]);
wprintw (ptr_win->win_chat, format,
((long double) ptr_dcc->bytes_per_sec) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
buf);
free (buf);
}
else
{
@@ -809,48 +929,56 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
}
else
{
ptr_line = buffer->last_line;
lines_used = 0;
ptr_win->win_chat_cursor_x = 0;
ptr_win->win_chat_cursor_y = 0;
while (ptr_line
&& (lines_used < (ptr_win->win_chat_height + ptr_win->sub_lines)))
/* display at position of scrolling */
if (ptr_win->start_line)
{
lines_used += gui_display_line (ptr_win, ptr_line, 0, 1);
ptr_line = ptr_line->prev_line;
ptr_line = ptr_win->start_line;
line_pos = ptr_win->start_line_pos;
}
if (lines_used > (ptr_win->win_chat_height + ptr_win->sub_lines))
else
{
/* screen will be full (we'll display only end of 1st line) */
ptr_line = (ptr_line) ? ptr_line->next_line : buffer->lines;
/* look for first line to display, sarting from last line */
ptr_line = NULL;
line_pos = 0;
gui_calculate_line_diff (ptr_win, &ptr_line, &line_pos,
(-1) * (ptr_win->win_chat_height - 1));
}
if (line_pos > 0)
{
/* display end of first line at top of screen */
gui_display_line (ptr_win, ptr_line,
gui_display_line (ptr_win, ptr_line, 0, 1) -
(lines_used - (ptr_win->win_chat_height + ptr_win->sub_lines)), 0);
line_pos, 0);
ptr_line = ptr_line->next_line;
ptr_win->first_line_displayed = 0;
}
else
{
/* all lines are displayed */
if (!ptr_line)
{
ptr_win->first_line_displayed = 1;
ptr_line = buffer->lines;
}
else
{
ptr_win->first_line_displayed = 0;
ptr_line = ptr_line->next_line;
}
}
ptr_win->first_line_displayed =
(ptr_line == ptr_win->buffer->lines);
/* display lines */
count = 0;
while (ptr_line && (ptr_win->win_chat_cursor_y <= ptr_win->win_chat_height - 1))
{
gui_display_line (ptr_win, ptr_line, 0, 0);
count = gui_display_line (ptr_win, ptr_line, 0, 0);
ptr_line = ptr_line->next_line;
}
/* check if last line of buffer is entirely displayed and scrolling */
/* if so, disable scroll (to remove status bar indicator) */
if (!ptr_line && ptr_win->start_line)
{
if (count == gui_display_line (ptr_win, ptr_win->buffer->last_line, 0, 1))
{
ptr_win->start_line = NULL;
ptr_win->start_line_pos = 0;
}
}
/* cursor is below end line of chat window? */
if (ptr_win->win_chat_cursor_y > ptr_win->win_chat_height - 1)
{
@@ -921,7 +1049,13 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
mvwprintw (ptr_win->win_nick, i, 0, format_empty, " ");
}
}
snprintf (format, 32, "%%-%ds", max_length);
snprintf (format, 32, "%%.%ds",
((cfg_look_nicklist_min_size > 0)
&& (max_length < cfg_look_nicklist_min_size)) ?
cfg_look_nicklist_min_size :
(((cfg_look_nicklist_max_size > 0)
&& (max_length > cfg_look_nicklist_max_size)) ?
cfg_look_nicklist_max_size : max_length));
if (has_colors ())
{
@@ -1033,7 +1167,7 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
((cfg_irc_away_check > 0) && (ptr_nick->is_away)) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
@@ -1328,7 +1462,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
if (x < 0)
x = 0;
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS_MORE);
if (ptr_win->sub_lines > 0)
if (ptr_win->start_line)
mvwprintw (ptr_win->win_status, 0, x, "%s", string);
else
{
@@ -1730,7 +1864,8 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
else
window->win_status = newwin (1, window->win_width, window->win_y + window->win_height - 2, window->win_x);
window->sub_lines = 0;
window->start_line = NULL;
window->start_line_pos = 0;
buffer->num_displayed++;
@@ -1742,7 +1877,7 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
*/
t_gui_buffer *
gui_get_dcc_buffer ()
gui_get_dcc_buffer (t_gui_window *window)
{
t_gui_buffer *ptr_buffer;
@@ -1755,7 +1890,7 @@ gui_get_dcc_buffer ()
if (ptr_buffer)
return ptr_buffer;
else
return gui_buffer_new (gui_current_window, NULL, NULL, 1, 0);
return gui_buffer_new (window, NULL, NULL, 1, 0);
}
/*
@@ -1763,17 +1898,20 @@ gui_get_dcc_buffer ()
*/
void
gui_input_page_up ()
gui_input_page_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (!gui_current_window->first_line_displayed)
if (!window->first_line_displayed)
{
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_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
(window->start_line) ?
(-1) * (window->win_chat_height - 1) :
(-1) * ((window->win_chat_height - 1) * 2));
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
@@ -1782,19 +1920,34 @@ gui_input_page_up ()
*/
void
gui_input_page_down ()
gui_input_page_down (t_gui_window *window)
{
t_gui_line *ptr_line;
int line_pos;
if (!gui_ok)
return;
if (gui_current_window->sub_lines > 0)
if (window->start_line)
{
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_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
window->win_chat_height - 1);
/* check if we can display all */
ptr_line = window->start_line;
line_pos = window->start_line_pos;
gui_calculate_line_diff (window, &ptr_line,
&line_pos,
window->win_chat_height - 1);
if (!ptr_line)
{
window->start_line = NULL;
window->start_line_pos = 0;
}
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
@@ -1803,17 +1956,17 @@ gui_input_page_down ()
*/
void
gui_input_nick_beginning ()
gui_input_nick_beginning (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (gui_current_window->buffer))
if (gui_buffer_has_nicklist (window->buffer))
{
if (gui_current_window->win_nick_start > 0)
if (window->win_nick_start > 0)
{
gui_current_window->win_nick_start = 0;
gui_draw_buffer_nick (gui_current_window->buffer, 1);
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
@@ -1823,27 +1976,26 @@ gui_input_nick_beginning ()
*/
void
gui_input_nick_end ()
gui_input_nick_end (t_gui_window *window)
{
int new_start;
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (gui_current_window->buffer))
if (gui_buffer_has_nicklist (window->buffer))
{
new_start =
CHANNEL(gui_current_window->buffer)->nicks_count -
gui_current_window->win_nick_height;
CHANNEL(window->buffer)->nicks_count - window->win_nick_height;
if (new_start < 0)
new_start = 0;
else if (new_start >= 1)
new_start++;
if (new_start != gui_current_window->win_nick_start)
if (new_start != window->win_nick_start)
{
gui_current_window->win_nick_start = new_start;
gui_draw_buffer_nick (gui_current_window->buffer, 1);
window->win_nick_start = new_start;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
@@ -1853,20 +2005,19 @@ gui_input_nick_end ()
*/
void
gui_input_nick_page_up ()
gui_input_nick_page_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (gui_current_window->buffer))
if (gui_buffer_has_nicklist (window->buffer))
{
if (gui_current_window->win_nick_start > 0)
if (window->win_nick_start > 0)
{
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);
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);
}
}
}
@@ -1876,26 +2027,22 @@ gui_input_nick_page_up ()
*/
void
gui_input_nick_page_down ()
gui_input_nick_page_down (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (gui_current_window->buffer))
if (gui_buffer_has_nicklist (window->buffer))
{
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 ((CHANNEL(window->buffer)->nicks_count > window->win_nick_height)
&& (window->win_nick_start + window->win_nick_height - 1
< CHANNEL(window->buffer)->nicks_count))
{
if (gui_current_window->win_nick_start == 0)
gui_current_window->win_nick_start +=
(gui_current_window->win_nick_height - 1);
if (window->win_nick_start == 0)
window->win_nick_start += (window->win_nick_height - 1);
else
gui_current_window->win_nick_start +=
(gui_current_window->win_nick_height - 2);
gui_draw_buffer_nick (gui_current_window->buffer, 1);
window->win_nick_start += (window->win_nick_height - 2);
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
@@ -2222,7 +2369,7 @@ gui_pre_init (int *argc, char **argv[])
void
gui_init_colors ()
{
int i, color;
int i;
if (has_colors ())
{
@@ -2306,9 +2453,8 @@ gui_init_colors ()
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
{
gui_assign_color (&color, nicks_colors[i]);
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_WIN_NICK_FIRST + i, cfg_col_nick_colors[i], cfg_col_chat_bg);
color_attr[COLOR_WIN_NICK_FIRST + i - 1] = (cfg_col_nick_colors[i] >= 0) ? cfg_col_nick_colors[i] & A_BOLD : 0;
}
init_pair (COLOR_DCC_SELECTED,
@@ -2465,8 +2611,8 @@ gui_end ()
while (gui_windows)
gui_window_free (gui_windows);
/* delete general history */
history_general_free ();
/* delete global history */
history_global_free ();
/* delete infobar messages */
while (gui_infobar)
+4 -2
View File
@@ -75,7 +75,9 @@ gui_input_default_key_bindings ()
gui_key_bind ( /* left */ "meta2-D", "left");
gui_key_bind ( /* right */ "meta2-C", "right");
gui_key_bind ( /* up */ "meta2-A", "up");
gui_key_bind ( /* ^up */ "meta-Oa", "up_global");
gui_key_bind ( /* down */ "meta2-B", "down");
gui_key_bind ( /* ^down */ "meta-Ob", "down_global");
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
@@ -141,7 +143,7 @@ gui_input_grab_end ()
{
if (gui_current_window->buffer->has_input)
{
gui_input_insert_string (expanded_key, -1);
gui_input_insert_string (gui_current_window, expanded_key, -1);
gui_current_window->buffer->input_buffer_pos += strlen (expanded_key);
gui_draw_buffer_input (gui_current_window->buffer, 1);
}
@@ -223,7 +225,7 @@ gui_input_read ()
/*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);
gui_input_insert_char (gui_current_window, key);
i++;
}
+2 -2
View File
@@ -89,7 +89,7 @@ gui_assign_color (int *color, char *color_name)
i = 0;
while (gui_colors[i].name)
{
if (strcasecmp (gui_colors[i].name, color_name) == 0)
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
{
*color = gui_colors[i].color;
return 1;
@@ -114,7 +114,7 @@ gui_get_color_by_name (char *color_name)
i = 0;
while (gui_colors[i].name)
{
if (strcasecmp (gui_colors[i].name, color_name) == 0)
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
return gui_colors[i].color;
i++;
}
+483 -397
View File
File diff suppressed because it is too large Load Diff
+14 -10
View File
@@ -77,8 +77,12 @@ t_gui_key_function gui_key_functions[] =
N_("move to next word") },
{ "up", gui_input_up,
N_("call previous command in history") },
{ "up_global", gui_input_up_global,
N_("call previous command in global history") },
{ "down", gui_input_down,
N_("call next command in history") },
{ "down_global", gui_input_down_global,
N_("call next command in global history") },
{ "page_up", gui_input_page_up,
N_("scroll one page up") },
{ "page_down", gui_input_page_down,
@@ -153,17 +157,17 @@ gui_key_get_internal_code (char *key)
result[0] = '\0';
while (key[0])
{
if (strncasecmp (key, "meta2-", 6) == 0)
if (ascii_strncasecmp (key, "meta2-", 6) == 0)
{
strcat (result, "^[[");
key += 6;
}
if (strncasecmp (key, "meta-", 5) == 0)
if (ascii_strncasecmp (key, "meta-", 5) == 0)
{
strcat (result, "^[");
key += 5;
}
else if (strncasecmp (key, "ctrl-", 5) == 0)
else if (ascii_strncasecmp (key, "ctrl-", 5) == 0)
{
strcat (result, "^");
key += 5;
@@ -196,12 +200,12 @@ gui_key_get_expanded_name (char *key)
result[0] = '\0';
while (key[0])
{
if (strncasecmp (key, "^[[", 3) == 0)
if (ascii_strncasecmp (key, "^[[", 3) == 0)
{
strcat (result, "meta2-");
key += 3;
}
if (strncasecmp (key, "^[", 2) == 0)
if (ascii_strncasecmp (key, "^[", 2) == 0)
{
strcat (result, "meta-");
key += 2;
@@ -235,7 +239,7 @@ gui_key_find_pos (t_gui_key *key)
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
{
if (strcasecmp (key->key, ptr_key->key) < 0)
if (ascii_strcasecmp (key->key, ptr_key->key) < 0)
return ptr_key;
}
return NULL;
@@ -320,7 +324,7 @@ gui_key_search (char *key)
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
{
if (strcasecmp (ptr_key->key, key) == 0)
if (ascii_strcasecmp (ptr_key->key, key) == 0)
return ptr_key;
}
@@ -377,7 +381,7 @@ gui_key_function_search_by_name (char *name)
i = 0;
while (gui_key_functions[i].function_name)
{
if (strcasecmp (gui_key_functions[i].function_name, name) == 0)
if (ascii_strcasecmp (gui_key_functions[i].function_name, name) == 0)
return gui_key_functions[i].function;
i++;
}
@@ -500,7 +504,7 @@ gui_key_pressed (char *key_str)
ptr_key = gui_key_search_part (gui_key_buffer);
if (ptr_key)
{
if (strcasecmp (ptr_key->key, gui_key_buffer) == 0)
if (ascii_strcasecmp (ptr_key->key, gui_key_buffer) == 0)
{
/* exact combo found => execute function or command */
gui_key_buffer[0] = '\0';
@@ -509,7 +513,7 @@ gui_key_pressed (char *key_str)
gui_current_window->buffer,
ptr_key->command);
else
(void)(ptr_key->function)();
(void)(ptr_key->function)(gui_current_window);
}
return 0;
}
+50 -43
View File
@@ -201,6 +201,9 @@ struct t_gui_buffer
t_history *ptr_history; /* current command in history */
int num_history; /* number of commands in history */
/* channel buffer before jumping to next server */
t_gui_buffer *old_channel_buffer; /* only used for server buffer */
/* link to previous/next buffer */
t_gui_buffer *prev_buffer; /* link to previous buffer */
t_gui_buffer *next_buffer; /* link to next buffer */
@@ -257,7 +260,8 @@ struct t_gui_window
t_gui_buffer *buffer; /* buffer currently displayed in window */
int first_line_displayed; /* = 1 if first line is displayed */
int sub_lines; /* if > 0 then do not display until end */
t_gui_line *start_line; /* pointer to line if scrolling */
int start_line_pos; /* position in first line displayed */
t_gui_window *prev_window; /* link to previous window */
t_gui_window *next_window; /* link to next window */
@@ -269,7 +273,8 @@ 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) */
void (*function)(t_gui_window *);
/* associated function (if cmd is NULL) */
t_gui_key *prev_key; /* link to previous key */
t_gui_key *next_key; /* link to next key */
};
@@ -316,40 +321,42 @@ 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_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 void gui_input_clipboard_paste (t_gui_window *);
extern void gui_input_insert_string (t_gui_window *, char *, int);
extern void gui_input_insert_char (t_gui_window *, int);
extern void gui_input_return (t_gui_window *);
extern void gui_input_tab (t_gui_window *);
extern void gui_input_backspace (t_gui_window *);
extern void gui_input_delete (t_gui_window *);
extern void gui_input_delete_previous_word (t_gui_window *);
extern void gui_input_delete_next_word (t_gui_window *);
extern void gui_input_delete_begin_of_line (t_gui_window *);
extern void gui_input_delete_end_of_line (t_gui_window *);
extern void gui_input_delete_line (t_gui_window *);
extern void gui_input_transpose_chars (t_gui_window *);
extern void gui_input_home (t_gui_window *);
extern void gui_input_end (t_gui_window *);
extern void gui_input_left (t_gui_window *);
extern void gui_input_previous_word (t_gui_window *);
extern void gui_input_right (t_gui_window *);
extern void gui_input_next_word (t_gui_window *);
extern void gui_input_up (t_gui_window *);
extern void gui_input_up_global (t_gui_window *);
extern void gui_input_down (t_gui_window *);
extern void gui_input_down_global (t_gui_window *);
extern void gui_input_jump_smart (t_gui_window *);
extern void gui_input_jump_dcc (t_gui_window *);
extern void gui_input_jump_last_buffer (t_gui_window *);
extern void gui_input_jump_server (t_gui_window *);
extern void gui_input_jump_next_server (t_gui_window *);
extern void gui_input_hotlist_clear (t_gui_window *);
extern void gui_input_infobar_clear (t_gui_window *);
extern void gui_input_grab_key (t_gui_window *);
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_switch_to_dcc_buffer (t_gui_window *);
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 *);
@@ -385,13 +392,13 @@ 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_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 t_gui_buffer *gui_get_dcc_buffer (t_gui_window *);
extern void gui_input_page_up (t_gui_window *);
extern void gui_input_page_down (t_gui_window *);
extern void gui_input_nick_beginning (t_gui_window *);
extern void gui_input_nick_end (t_gui_window *);
extern void gui_input_nick_page_up (t_gui_window *);
extern void gui_input_nick_page_down (t_gui_window *);
extern void gui_curses_resize_handler ();
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *);
+1
View File
@@ -27,4 +27,5 @@ lib_weechat_irc_a_SOURCES = irc.h \
irc-channel.c \
irc-nick.c \
irc-dcc.c \
irc-ignore.c \
irc-display.c
+8 -2
View File
@@ -143,11 +143,14 @@ t_irc_channel *
channel_search (t_irc_server *server, char *channel_name)
{
t_irc_channel *ptr_channel;
if (!server || !channel_name)
return NULL;
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (strcasecmp (ptr_channel->name, channel_name) == 0)
if (ascii_strcasecmp (ptr_channel->name, channel_name) == 0)
return ptr_channel;
}
return NULL;
@@ -162,6 +165,9 @@ string_is_channel (char *string)
{
char first_char[2];
if (!string)
return 0;
first_char[0] = string[0];
first_char[1] = '\0';
return (strpbrk (first_char, CHANNEL_PREFIX)) ? 1 : 0;
+13 -3
View File
@@ -35,6 +35,10 @@ t_irc_command irc_commands[] =
N_("[target]"),
N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_admin, NULL },
{ "ame", N_("send a CTCP action to all channels of all connected servers"),
N_("message"),
N_("message: message to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_ame, NULL },
{ "amsg", N_("send message to all channels of all connected servers"),
N_("text"),
N_("text: text to send"),
@@ -126,7 +130,7 @@ t_irc_command irc_commands[] =
N_("mask: servers matching the mask only\n"
"target: server for forwarding request"),
0, 2, 1, NULL, irc_cmd_send_lusers, NULL },
{ "me", N_("send a ctcp action to the current channel"),
{ "me", N_("send a CTCP action to the current channel"),
N_("message"),
N_("message: message to send"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
@@ -299,8 +303,11 @@ t_irc_command irc_commands[] =
{ "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 },
{ "020", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "042", 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 },
{ "221", N_("user mode string"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
{ "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 },
@@ -351,6 +358,8 @@ t_irc_command irc_commands[] =
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "344", N_("channel reop"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_344 },
{ "345", N_("end of channel reop list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_345 },
{ "351", N_("server version"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
{ "352", N_("who"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
{ "353", N_("list of nicks on channel"),
@@ -383,8 +392,6 @@ t_irc_command irc_commands[] =
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "406", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "406", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "407", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "409", N_("no origin"),
@@ -463,6 +470,8 @@ t_irc_command irc_commands[] =
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "483", N_("you can't kill a server!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "484", N_("your connection is restricted!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"),
@@ -471,6 +480,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 },
{ "505", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "671", N_("whois (secure connection)"),
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
+45 -12
View File
@@ -34,6 +34,8 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "../common/weechat.h"
#include "irc.h"
@@ -55,10 +57,10 @@ char *dcc_status_string[] = /* strings for DCC status */
void
dcc_redraw (int highlight)
{
gui_redraw_buffer (gui_get_dcc_buffer ());
gui_redraw_buffer (gui_get_dcc_buffer (gui_current_window));
if (highlight)
{
hotlist_add (highlight, gui_get_dcc_buffer ());
hotlist_add (highlight, gui_get_dcc_buffer (gui_current_window));
gui_draw_buffer_status (gui_current_window->buffer, 0);
}
}
@@ -233,6 +235,8 @@ int
dcc_connect (t_irc_dcc *ptr_dcc)
{
struct sockaddr_in addr;
struct hostent *hostent;
char *ip4;
if (ptr_dcc->type == DCC_CHAT_SEND)
ptr_dcc->status = DCC_WAITING;
@@ -245,12 +249,12 @@ dcc_connect (t_irc_dcc *ptr_dcc)
if (ptr_dcc->sock == -1)
return 0;
}
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
/* for sending (chat or file), listen to socket for a connection */
if (DCC_IS_SEND(ptr_dcc->type))
{
{
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
if (listen (ptr_dcc->sock, 1) == -1)
return 0;
if (fcntl (ptr_dcc->sock, F_SETFL, 0) == -1)
@@ -260,11 +264,32 @@ dcc_connect (t_irc_dcc *ptr_dcc)
/* for receiving (chat or file), connect to listening host */
if (DCC_IS_RECV(ptr_dcc->type))
{
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (ptr_dcc->port);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
if (cfg_proxy_use)
{
memset (&addr, 0, sizeof (addr));
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
ip4 = inet_ntoa(addr.sin_addr);
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (cfg_proxy_port);
addr.sin_family = AF_INET;
if ((hostent = gethostbyname (cfg_proxy_address)) == NULL)
return 0;
memcpy(&(addr.sin_addr),*(hostent->h_addr_list), sizeof(struct in_addr));
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
if (pass_proxy(ptr_dcc->sock, ip4, ptr_dcc->port, ptr_dcc->server->username) == -1)
return 0;
}
else
{
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (ptr_dcc->port);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
}
}
return 1;
@@ -309,6 +334,7 @@ void
dcc_close (t_irc_dcc *ptr_dcc, int status)
{
t_gui_buffer *ptr_buffer;
struct stat st;
ptr_dcc->status = status;
@@ -370,7 +396,14 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
&& DCC_IS_RECV(ptr_dcc->type)
&& ptr_dcc->local_filename
&& ptr_dcc->pos == 0)
unlink (ptr_dcc->local_filename);
{
/* erase file only if really empty on disk */
if (stat (ptr_dcc->local_filename, &st) != -1)
{
if ((unsigned long) st.st_size == 0)
unlink (ptr_dcc->local_filename);
}
}
if (DCC_IS_CHAT(ptr_dcc->type))
channel_remove_dcc (ptr_dcc);
+475
View File
@@ -0,0 +1,475 @@
/*
* 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
*/
/* irc-ignore.c: manages IRC ignore list */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
char *ignore_types[] =
{ IGNORE_ACTION, IGNORE_CTCP, IGNORE_DCC, IGNORE_PRIVATE, NULL };
t_irc_ignore *irc_ignore = NULL;
t_irc_ignore *last_irc_ignore = NULL;
/*
* ignore_check_mask: returns 1 is mask1 and mask2 are the same host
* anyone or both strings may have user and/or host after
*/
int
ignore_check_mask (char *mask1, char *mask2)
{
char *m1, *m2, *pos;
int match;
if (!mask1 || !mask1[0] || !mask2 || !mask2[0])
return 0;
m1 = strdup (mask1);
m2 = strdup (mask2);
pos = strchr (m1, '!');
if (!pos)
{
/* remove '!' from m2 */
pos = strchr (m2, '!');
if (pos)
pos[0] = '\0';
}
pos = strchr (m2, '!');
if (!pos)
{
/* remove '!' from m1 */
pos = strchr (m1, '!');
if (pos)
pos[0] = '\0';
}
/* TODO: use regexp to match both masks */
match = ascii_strcasecmp (m1, m2);
free (m1);
free (m2);
return (match == 0);
}
/*
* ignore_match: check if pointed ignore matches with arguments
*/
int
ignore_match (t_irc_ignore *ptr_ignore, char *mask, char *type, char *channel_name, char *server_name)
{
/* check mask */
if ((strcmp (mask, "*") != 0) && (strcmp (ptr_ignore->mask, "*") != 0)
&& (!ignore_check_mask (ptr_ignore->mask, mask)))
return 0;
/* mask is matching, go on with type */
if ((strcmp (type, "*") != 0) && (strcmp (ptr_ignore->type, "*") != 0)
&& (ascii_strcasecmp (ptr_ignore->type, type) != 0))
return 0;
/* mask and type matching, go on with server */
if (server_name && server_name[0])
{
if ((strcmp (server_name, "*") != 0) && (strcmp (ptr_ignore->server_name, "*") != 0)
&& (ascii_strcasecmp (ptr_ignore->server_name, server_name) != 0))
return 0;
}
else
{
if (strcmp (ptr_ignore->server_name, "*") != 0)
return 0;
}
/* mask, type and server matching, go on with channel */
if (channel_name && channel_name[0])
{
if ((strcmp (channel_name, "*") != 0) && (strcmp (ptr_ignore->channel_name, "*") != 0)
&& (ascii_strcasecmp (ptr_ignore->channel_name, channel_name) != 0))
return 0;
}
else
{
if (strcmp (ptr_ignore->channel_name, "*") != 0)
return 0;
}
/* all is matching => we find a ignore! */
return 1;
}
/*
* ignore_check: check if an ignore is set for arguments
* returns 1 if at least one ignore exists (message should NOT be displayed)
* 0 if no ignore found (message will be displayed)
*/
int
ignore_check (char *mask, char *type, char *channel_name, char *server_name)
{
t_irc_ignore *ptr_ignore;
if (!mask || !mask[0] || !type || !type[0])
return 0;
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
if (ignore_match (ptr_ignore, mask, type, channel_name, server_name))
return 1;
}
/* no ignore found */
return 0;
}
/*
* ignore_search: search for an ignore
*/
t_irc_ignore *
ignore_search (char *mask, char *type, char *channel_name, char *server_name)
{
t_irc_ignore *ptr_ignore;
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
if ((ascii_strcasecmp (ptr_ignore->mask, mask) == 0)
&& (ascii_strcasecmp (ptr_ignore->type, type) == 0)
&& (ascii_strcasecmp (ptr_ignore->channel_name, channel_name) == 0)
&& (ascii_strcasecmp (ptr_ignore->server_name, server_name) == 0))
return ptr_ignore;
}
/* ignore not found */
return NULL;
}
/*
* ignore_add: add an ignore in list
*/
t_irc_ignore *
ignore_add (char *mask, char *type, char *channel_name, char *server_name)
{
int i, type_index;
t_irc_command *command_ptr;
t_irc_ignore *new_ignore;
if (!mask || !mask[0] || !type || !type[0] || !channel_name || !channel_name[0]
|| !server_name || !server_name[0])
{
gui_printf (NULL,
_("%s too few arguments for ignore\n"),
WEECHAT_ERROR);
return NULL;
}
#ifdef DEBUG
wee_log_printf ("Adding ignore: mask:'%s', type:'%s', channel:'%s', server:'%s'\n",
mask, type, channel_name, server_name);
#endif
type_index = -1;
command_ptr = NULL;
if ((strcmp (mask, "*") == 0) && (strcmp (type, "*") == 0))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s mask or type/command should be non generic value for ignore\n"),
WEECHAT_ERROR);
return NULL;
}
if (ignore_search (mask, type, channel_name, server_name))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s ignore already exists\n"),
WEECHAT_ERROR);
return NULL;
}
if (strcmp (type, "*") != 0)
{
/* look for type in pre-defined ignore types */
for (i = 0; ignore_types[i]; i++)
{
if (ascii_strcasecmp (type, ignore_types[i]) == 0)
{
type_index = i;
break;
}
}
/* not a pre-defined ignore type, so it MUST be an IRC command */
if (type_index < 0)
{
for (i = 0; irc_commands[i].command_name; i++)
{
if (irc_commands[i].recv_function &&
(ascii_strcasecmp (type, irc_commands[i].command_name) == 0))
{
command_ptr = &irc_commands[i];
break;
}
}
}
/* not a pre-defined command and not an IRC command => error */
if ((type_index < 0) && (!command_ptr))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown type or IRC command \"%s\" for ignore\n"),
WEECHAT_ERROR, type);
return NULL;
}
}
/* create new ignore */
new_ignore = (t_irc_ignore *) malloc (sizeof (t_irc_ignore));
if (new_ignore)
{
new_ignore->mask = strdup (mask);
new_ignore->type = strdup (type);
new_ignore->server_name = strdup (server_name);
new_ignore->channel_name = strdup (channel_name);
/* add new ignore to queue */
new_ignore->prev_ignore = last_irc_ignore;
new_ignore->next_ignore = NULL;
if (irc_ignore)
last_irc_ignore->next_ignore = new_ignore;
else
irc_ignore = new_ignore;
last_irc_ignore = new_ignore;
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s not enough memory to create ignore\n"),
WEECHAT_ERROR);
return NULL;
}
return new_ignore;
}
/*
* ignore_add_from_config: add an ignore to list, read from config file
* (comma serparated values)
*/
t_irc_ignore *
ignore_add_from_config (char *string)
{
t_irc_ignore *new_ignore;
char *string2;
char *pos_mask, *pos_type, *pos_channel, *pos_server;
if (!string || !string[0])
return NULL;
new_ignore = NULL;
string2 = strdup (string);
pos_mask = string2;
pos_type = strchr (pos_mask, ',');
if (pos_type)
{
pos_type[0] = '\0';
pos_type++;
pos_channel = strchr (pos_type, ',');
if (pos_channel)
{
pos_channel[0] = '\0';
pos_channel++;
pos_server = strchr (pos_channel, ',');
if (pos_server)
{
pos_server[0] = '\0';
pos_server++;
new_ignore = ignore_add (pos_mask, pos_type, pos_channel, pos_server);
}
}
}
free (string2);
return new_ignore;
}
/*
* ignore_free: free an ignore
*/
void
ignore_free (t_irc_ignore *ptr_ignore)
{
t_irc_ignore *new_irc_ignore;
/* free data */
if (ptr_ignore->mask)
free (ptr_ignore->mask);
if (ptr_ignore->type)
free (ptr_ignore->type);
if (ptr_ignore->channel_name)
free (ptr_ignore->channel_name);
if (ptr_ignore->server_name)
free (ptr_ignore->server_name);
/* remove ignore from queue */
if (last_irc_ignore == ptr_ignore)
last_irc_ignore = ptr_ignore->prev_ignore;
if (ptr_ignore->prev_ignore)
{
(ptr_ignore->prev_ignore)->next_ignore = ptr_ignore->next_ignore;
new_irc_ignore = irc_ignore;
}
else
new_irc_ignore = ptr_ignore->next_ignore;
if (ptr_ignore->next_ignore)
(ptr_ignore->next_ignore)->prev_ignore = ptr_ignore->prev_ignore;
free (ptr_ignore);
irc_ignore = new_irc_ignore;
}
/*
* ignore_free_all: free all ignores
*/
void
ignore_free_all ()
{
while (irc_ignore)
ignore_free (irc_ignore);
}
/*
* ignore_search_free: search and free ignore(s)
* return: number of ignore found and deleted
* 0 if no ignore found
*/
int
ignore_search_free (char *mask, char *type, char *channel_name, char *server_name)
{
int found;
t_irc_ignore *ptr_ignore, *next_ignore;
found = 0;
ptr_ignore = irc_ignore;
while (ptr_ignore)
{
if (ignore_match (ptr_ignore, mask, type, channel_name, server_name))
{
found++;
if (found == 1)
gui_printf (NULL, "\n");
irc_display_prefix (NULL, PREFIX_INFO);
weechat_cmd_ignore_display (_("Removing ignore:"), ptr_ignore);
next_ignore = ptr_ignore->next_ignore;
ignore_free (ptr_ignore);
ptr_ignore = next_ignore;
}
else
ptr_ignore = ptr_ignore->next_ignore;
}
return found;
}
/*
* ignore_search_free_by_number: search and free ignore(s) by number
* return: 1 if ignore found and deleted
* 0 if ignore not found
*/
int
ignore_search_free_by_number (int number)
{
int i;
t_irc_ignore *ptr_ignore;
if (number < 1)
return 0;
i = 0;
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
i++;
if (i == number)
{
gui_printf (NULL, "\n");
irc_display_prefix (NULL, PREFIX_INFO);
weechat_cmd_ignore_display (_("Removing ignore:"), ptr_ignore);
ignore_free (ptr_ignore);
return 1;
}
}
/* ignore number not found */
return 0;
}
/*
* ignore_print_log: print ignore list in log (usually for crash dump)
*/
void
ignore_print_log ()
{
t_irc_ignore *ptr_ignore;
wee_log_printf ("[ignore list]\n");
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
wee_log_printf ("\n");
wee_log_printf (" -> ignore at 0x%X:\n", ptr_ignore);
wee_log_printf (" mask. . . . . . . : %s\n", ptr_ignore->mask);
wee_log_printf (" type. . . . . . . : %s\n", ptr_ignore->type);
wee_log_printf (" channel_name. . . : %s\n", ptr_ignore->channel_name);
wee_log_printf (" server_name . . . : %s\n", ptr_ignore->server_name);
wee_log_printf (" prev_ignore . . . : 0x%X\n", ptr_ignore->prev_ignore);
wee_log_printf (" next_ignore . . . : 0x%X\n", ptr_ignore->next_ignore);
}
}
+12 -9
View File
@@ -30,10 +30,11 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/weeconfig.h"
/*
* nick_find_color: find a color for a nick (less used will be better!)
* nick_find_color: find a color for a nick (according to nick letters)
*/
int
@@ -46,7 +47,7 @@ nick_find_color (t_irc_nick *nick)
{
color += (int)(nick->nick[i]);
}
color = (color % COLOR_WIN_NICK_NUMBER);
color = (color % cfg_look_color_nicks_number);
return COLOR_WIN_NICK_FIRST + color;
}
@@ -87,12 +88,11 @@ nick_compare (t_irc_nick *nick1, t_irc_nick *nick2)
score1 = nick_score_for_sort (nick1);
score2 = nick_score_for_sort (nick2);
comp = strcasecmp(nick1->nick, nick2->nick);
comp = ascii_strcasecmp (nick1->nick, nick2->nick);
if (comp > 0)
score1++;
else
if (comp < 0)
score2++;
if (comp < 0)
score2++;
/* nick1 > nick2 */
if (score1 > score2)
@@ -202,7 +202,7 @@ nick_new (t_irc_channel *channel, char *nick_name,
new_nick->is_halfop = is_halfop;
new_nick->has_voice = has_voice;
new_nick->is_away = 0;
if (strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0)
if (ascii_strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0)
new_nick->color = COLOR_WIN_NICK_SELF;
else
new_nick->color = nick_find_color (new_nick);
@@ -315,11 +315,14 @@ t_irc_nick *
nick_search (t_irc_channel *channel, char *nickname)
{
t_irc_nick *ptr_nick;
if (!nickname)
return NULL;
for (ptr_nick = channel->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
{
if (strcasecmp (ptr_nick->nick, nickname) == 0)
if (ascii_strcasecmp (ptr_nick->nick, nickname) == 0)
return ptr_nick;
}
return NULL;
+1822 -1385
View File
File diff suppressed because it is too large Load Diff
+43 -2
View File
@@ -82,6 +82,47 @@ irc_cmd_send_admin (t_irc_server *server, char *arguments)
return 0;
}
/*
* irc_cmd_send_ame: send a ctcp action to all channels of all connected servers
*/
int
irc_cmd_send_ame (t_irc_server *server, char *arguments)
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
/* make gcc happy */
(void) server;
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 :\01ACTION %s\01\r\n",
ptr_channel->name,
(arguments && arguments[0]) ? arguments : "");
irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME);
gui_printf_color (ptr_channel->buffer,
COLOR_WIN_CHAT_NICK, "%s", ptr_server->nick);
gui_printf_color (ptr_channel->buffer,
COLOR_WIN_CHAT, " %s\n",
(arguments && arguments[0]) ? arguments : "");
}
}
}
}
gui_add_hotlist = 1;
return 0;
}
/*
* irc_cmd_send_amsg: send message to all channels of all connected servers
*/
@@ -367,7 +408,7 @@ irc_cmd_send_ctcp (t_irc_server *server, char *arguments)
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))
if ((ascii_strcasecmp (pos_type, "ping") == 0) && (!pos_args))
{
gettimeofday (&tv, &tz);
server_sendf (server, "PRIVMSG %s :\01PING %d %d\01\r\n",
@@ -451,7 +492,7 @@ irc_cmd_send_dcc (t_irc_server *server, char *arguments)
dcc_send_request (server, DCC_CHAT_SEND, pos_nick, NULL);
}
else if (strcasecmp (arguments, "close") == 0)
else if (ascii_strcasecmp (arguments, "close") == 0)
{
if (BUFFER_IS_PRIVATE(gui_current_window->buffer) &&
CHANNEL(gui_current_window->buffer)->dcc_chat)
+282 -250
View File
@@ -523,6 +523,42 @@ server_msgq_add_msg (t_irc_server *server, char *msg)
}
}
/*
* server_msgq_add_unterminated: add an unterminated message to queue
*/
void
server_msgq_add_unterminated (t_irc_server *server, char *string)
{
if (server->unterminated_message)
{
server->unterminated_message =
(char *) realloc (server->unterminated_message,
strlen (server->unterminated_message) +
strlen (string) + 1);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
else
strcat (server->unterminated_message, string);
}
else
{
server->unterminated_message = strdup (string);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
}
}
/*
* server_msgq_add_buffer: explode received buffer, creating queued messages
*/
@@ -543,44 +579,27 @@ server_msgq_add_buffer (t_irc_server *server, char *buffer)
}
else
{
pos = strstr (buffer, "\n");
if (pos)
pos = strstr (buffer, "\r");
if (pos && !pos[1])
{
pos[0] = '\0';
server_msgq_add_msg (server, buffer);
buffer = pos + 1;
server_msgq_add_unterminated (server, buffer);
return;
}
else
{
if (server->unterminated_message)
pos = strstr (buffer, "\n");
if (pos)
{
server->unterminated_message =
(char *) realloc (server->unterminated_message,
strlen (server->unterminated_message) +
strlen (buffer) + 1);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
else
strcat (server->unterminated_message, buffer);
pos[0] = '\0';
server_msgq_add_msg (server, buffer);
buffer = pos + 1;
}
else
{
server->unterminated_message = strdup (buffer);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
server_msgq_add_unterminated (server, buffer);
return;
}
return;
}
}
}
@@ -663,8 +682,8 @@ server_msgq_flush ()
case -3:
irc_display_prefix (recv_msgq->server->buffer, PREFIX_ERROR);
gui_printf (recv_msgq->server->buffer,
_("%s Unknown command: cmd=%s, args=%s\n"),
WEECHAT_WARNING, command, args);
_("%s Unknown command: cmd=%s, host=%s, args=%s\n"),
WEECHAT_WARNING, command, host, args);
break;
}
@@ -900,12 +919,12 @@ void
convbase64_8x3_to_6x4(char *from, char* to)
{
unsigned char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
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 ];
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 ];
}
/*
@@ -916,91 +935,92 @@ void
base64encode(char *from, char *to)
{
char *f, *t;
int from_len;
char *f, *t;
int from_len;
from_len = strlen(from);
from_len = strlen(from);
f = from;
t = to;
f = from;
t = to;
while(from_len >= 3)
while(from_len >= 3)
{
convbase64_8x3_to_6x4(f, t);
f += 3 * sizeof(*f);
t += 4 * sizeof(*t);
from_len -= 3;
convbase64_8x3_to_6x4(f, t);
f += 3 * sizeof(*f);
t += 4 * sizeof(*t);
from_len -= 3;
}
if (from_len > 0)
if (from_len > 0)
{
char rest[3] = { 0, 0, 0 };
switch(from_len)
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;
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;
rest[0] = f[0];
rest[1] = f[1];
convbase64_8x3_to_6x4(rest, t);
t[3] = '=';
break;
}
t[4] = 0;
t[4] = 0;
}
}
/*
* pass_httpproxy: establish connection/authentification to an http proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_httpproxy(t_irc_server *server)
pass_httpproxy(int sock, char *address, int port)
{
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;
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)
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);
// 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", address, port, authbuf_base64);
}
else
else
{
// no authentification
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\n\r\n", server->address, server->port);
// no authentification
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\n\r\n", address, port);
}
m = send (server->sock, buffer, n, 0);
if (n != m)
return 1;
m = send (sock, buffer, n, 0);
if (n != m)
return 1;
n = recv(server->sock, buffer, sizeof(buffer), 0);
n = recv(sock, buffer, sizeof(buffer), 0);
/* success result must be like : "HTTP/1.0 200 OK" */
if (n < 12)
return 1;
/* 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;
if (memcmp (buffer, "HTTP/", 5) || memcmp (buffer + 9, "200", 3))
return 1;
return 0;
return 0;
}
/*
* resolve: resolve hostname on its IP address
* (works with ipv4 and ipv6)
* return :
* return :
* - 0 if resolution was successful
* - 1 if resolution fails
*/
@@ -1042,207 +1062,210 @@ resolve (char *hostname, char *ip, int *version)
/*
* pass_socks4proxy: establish connection/authentification throw a socks4 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks4proxy(t_irc_server *server)
pass_socks4proxy(int sock, char *address, int port, char *username)
{
/*
* socks4 protocol is explain here:
* http://archive.socks.permeo.com/protocol/socks4.protocol
*
*/
/*
* 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];
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);
socks4.version = 4;
socks4.method = 1;
socks4.port = htons (port);
resolve(address, ip_addr, NULL);
socks4.address = inet_addr (ip_addr);
strncpy (socks4.user, username, sizeof(socks4.user) - 1);
send (server->sock, (char *) &socks4, 8 + strlen(socks4.user) + 1, 0);
recv (server->sock, buffer, sizeof(buffer), 0);
send (sock, (char *) &socks4, 8 + strlen(socks4.user) + 1, 0);
recv (sock, buffer, sizeof(buffer), 0);
if (buffer[0] == 0 && buffer[1] == 90)
return 0;
if (buffer[0] == 0 && buffer[1] == 90)
return 0;
return 1;
return 1;
}
/*
* pass_socks5proxy: establish connection/authentification throw a socks5 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks5proxy(t_irc_server *server)
pass_socks5proxy(int sock, char *address, int port)
{
/*
* socks5 protocol is explained in RFC 1928
* socks5 authentication with username/pass is explained in RFC 1929
*/
/*
* 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)
struct s_sock5
{
/* with authentication */
/* -> socks server must respond with :
* - socks version (buffer[0]) = 5 => socks5
* - socks method (buffer[1]) = 2 => authentication
*/
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 (sock, (char *) &socks5, sizeof(socks5), 0);
/* server socks5 must respond with 2 bytes */
if (recv (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;
//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);
/* 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);
/* 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);
send (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;
/* server socks5 must respond with 2 bytes */
if (recv (sock, buffer, 2, 0) != 2)
return 1;
/* buffer[1] = auth state, must be 0 for success */
if (buffer[1] != 0)
return 1;
/* buffer[1] = auth state, must be 0 for success */
if (buffer[1] != 0)
return 1;
}
else
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;
/* 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 */
/* authentication successful then giving address/port to connect */
addr_len = strlen(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, address, addr_len); /* server address */
*((unsigned short *) (addr_buffer + 5 + addr_len)) = htons (port); /* server port */
send (server->sock, addr_buffer, addr_buffer_len, 0);
free(addr_buffer);
send (sock, addr_buffer, addr_buffer_len, 0);
free(addr_buffer);
/* dialog with proxy server */
if (recv (server->sock, buffer, 4, 0) != 4)
return 1;
/* dialog with proxy server */
if (recv (sock, buffer, 4, 0) != 4)
return 1;
if (!(buffer[0] == 5 && buffer[1] == 0))
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;
}
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 (sock, buffer, 6, 0) != 6)
return 1;
break;
case 3:
/* domainname
* server socks return server bound address and port
*/
/* reading address length */
if (recv (sock, buffer, 1, 0) != 1)
return 1;
addr_len = buffer[0];
/* reading address + port = addr_len + 2 */
if (recv (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 (sock, buffer, 18, 0) != 18)
return 1;
break;
default:
return 1;
}
return 0;
return 0;
}
/*
* pass_proxy: establish connection/authentification to a proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
* 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;
int
pass_proxy(int sock, char *address, int port, char *username)
{
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "http") == 0)
return pass_httpproxy(sock, address, port);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks4") == 0)
return pass_socks4proxy(sock, address, port, username);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks5") == 0)
return pass_socks5proxy(sock, address, port);
return 1;
}
/*
@@ -1291,7 +1314,7 @@ server_child (t_irc_server *server)
return 0;
}
if (pass_proxy(server))
if (pass_proxy(server->sock, server->address, server->port, server->username))
{
write(server->child_write, "4", 1);
freeaddrinfo (res);
@@ -1426,7 +1449,10 @@ server_connect (t_irc_server *server)
server->child_write = child_pipe[1];
/* create socket and set options */
server->sock = socket ((server->ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
if (cfg_proxy_use)
server->sock = socket ((cfg_proxy_ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
else
server->sock = socket ((server->ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
if (server->sock == -1)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
@@ -1583,6 +1609,9 @@ server_search (char *servername)
{
t_irc_server *ptr_server;
if (!servername)
return NULL;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
@@ -1621,6 +1650,9 @@ server_name_already_exists (char *name)
{
t_irc_server *ptr_server;
if (!name)
return 0;
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (strcmp (ptr_server->name, name) == 0)
+100 -58
View File
@@ -203,7 +203,7 @@ struct t_irc_command
/* function called when user enters cmd */
int (*cmd_function_1arg)(t_irc_server *, char *);
/* function called when user enters cmd */
int (*recv_function)(t_irc_server *, char *, char *);
int (*recv_function)(t_irc_server *, char *, char *, char *);
/* function called when cmd is received */
};
@@ -218,7 +218,7 @@ struct t_irc_message
t_irc_message *next_message; /* link to next message */
};
/* DCC */
/* DCC types */
typedef struct t_irc_dcc t_irc_dcc;
@@ -251,6 +251,30 @@ struct t_irc_dcc
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
};
/* ignore types */
/* pre-defined ignore types, all other types are made with IRC commands */
/* for example: part join quit notice invite ... */
#define IGNORE_ACTION "action"
#define IGNORE_CTCP "ctcp"
#define IGNORE_DCC "dcc"
#define IGNORE_PRIVATE "pv"
typedef struct t_irc_ignore t_irc_ignore;
struct t_irc_ignore
{
char *mask; /* nickname or mask */
char *type; /* type of ignore */
char *channel_name; /* name of channel, "*" == all */
char *server_name; /* name of server, "*" == all */
t_irc_ignore *prev_ignore; /* pointer to previous ignore */
t_irc_ignore *next_ignore; /* pointer to next ignore */
};
/* variables */
extern t_irc_command irc_commands[];
extern t_irc_server *irc_servers;
extern t_irc_message *recv_msgq, *msgq_last_msg;
@@ -258,6 +282,9 @@ extern int check_away;
extern t_irc_dcc *dcc_list;
extern char *dcc_status_string[6];
extern char *channel_modes;
extern char *ignore_types[];
extern t_irc_ignore *irc_ignore;
extern t_irc_ignore *irc_last_ignore;
/* server functions (irc-server.c) */
@@ -290,11 +317,11 @@ 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 pass_httpproxy(int, char*, int);
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);
extern int pass_socks4proxy(int, char*, int, char*);
extern int pass_socks5proxy(int, char*, int);
extern int pass_proxy(int, char*, int, char*);
/* channel functions (irc-channel.c) */
@@ -315,6 +342,7 @@ extern void channel_print_log (t_irc_channel *);
/* nick functions (irc-nick.c) */
extern int nick_find_color (t_irc_nick *);
extern t_irc_nick *nick_new (t_irc_channel *, char *, int, int, int, int, int);
extern void nick_resort (t_irc_channel *, t_irc_nick *);
extern void nick_change (t_irc_channel *, t_irc_nick *, char *);
@@ -356,6 +384,7 @@ 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_ame (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 *);
@@ -414,57 +443,70 @@ extern int irc_cmd_send_who (t_irc_server *, char *);
extern int irc_cmd_send_whois (t_irc_server *, char *);
extern int irc_cmd_send_whowas (t_irc_server *, char *);
/* IRC commands executed when received from server */
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 *);
extern int irc_cmd_recv_part (t_irc_server *, char *, char *);
extern int irc_cmd_recv_ping (t_irc_server *, char *, char *);
extern int irc_cmd_recv_pong (t_irc_server *, char *, char *);
extern int irc_cmd_recv_privmsg (t_irc_server *, char *, char *);
extern int irc_cmd_recv_quit (t_irc_server *, char *, char *);
extern int irc_cmd_recv_server_msg (t_irc_server *, char *, char *);
extern int irc_cmd_recv_server_reply (t_irc_server *, char *, char *);
extern int irc_cmd_recv_topic (t_irc_server *, char *, char *);
extern int irc_cmd_recv_001 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_004 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_301 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_302 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_303 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_305 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_306 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_307 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_311 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_312 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_313 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_314 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_315 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_317 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_318 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_319 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_320 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_321 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_322 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_323 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_324 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_329 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_331 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_332 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_333 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_341 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_351 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_352 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_353 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_365 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_366 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_367 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_368 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_433 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_438 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_671 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_error (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_invite (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_join (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_kick (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_kill (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_mode (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_nick (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_notice (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_part (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_ping (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_pong (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_privmsg (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_quit (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_server_msg (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_server_reply (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_topic (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_001 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_004 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_221 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_301 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_302 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_303 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_305 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_306 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_307 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_311 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_312 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_313 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_314 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_315 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_317 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_318 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_319 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_320 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_321 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_322 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_323 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_324 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_329 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_331 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_332 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_333 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_341 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_344 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_345 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_351 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_352 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_353 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_365 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_366 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_367 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_368 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_433 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_438 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_671 (t_irc_server *, char *, char *, char *);
/* ignore functions (irc-ignore.c) */
extern int ignore_check (char *, char *, char *, char *);
extern t_irc_ignore *ignore_add (char *, char *, char *, char *);
extern t_irc_ignore *ignore_add_from_config (char *);
extern void ignore_free_all ();
extern int ignore_search_free (char *, char *, char *, char *);
extern int ignore_search_free_by_number (int);
extern void ignore_print_log ();
#endif /* irc.h */
+4 -5
View File
@@ -25,12 +25,11 @@ if PLUGIN_PYTHON
python_dir = python
endif
# if PLUGIN_RUBY
# ruby_dir = ruby
# endif
if PLUGIN_RUBY
ruby_dir = ruby
endif
# SUBDIRS = $(perl_dir) $(python_dir) $(ruby_dir)
SUBDIRS = $(perl_dir) $(python_dir)
SUBDIRS = $(perl_dir) $(python_dir) $(ruby_dir)
noinst_LIBRARIES = lib_weechat_plugins.a
+18 -18
View File
@@ -73,7 +73,7 @@ static XS (XS_IRC_register)
for (ptr_perl_script = perl_scripts; ptr_perl_script;
ptr_perl_script = ptr_perl_script->next_script)
{
if (strcasecmp (ptr_perl_script->name, name) == 0)
if (ascii_strcasecmp (ptr_perl_script->name, name) == 0)
{
perl_script_found = ptr_perl_script;
break;
@@ -182,12 +182,12 @@ static XS (XS_IRC_print_with_channel)
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (!server || (strcasecmp (ptr_server->name, server)) == 0)
if (!server || (ascii_strcasecmp (ptr_server->name, server)) == 0)
{
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (strcasecmp (ptr_channel->name, channel) == 0)
if (ascii_strcasecmp (ptr_channel->name, channel) == 0)
{
ptr_buffer = ptr_channel->buffer;
break;
@@ -260,7 +260,7 @@ static XS (XS_IRC_command)
command = SvPV (ST (1), integer);
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (strcasecmp (ptr_server->name, server) == 0)
if (ascii_strcasecmp (ptr_server->name, server) == 0)
break;
}
if (!ptr_server)
@@ -383,30 +383,30 @@ static XS (XS_IRC_get_info)
if (arg)
{
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
if ( (ascii_strcasecmp (arg, "0") == 0) || (ascii_strcasecmp (arg, "version") == 0) )
{
info = PACKAGE_STRING;
}
else if ( ptr_server && ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) ) )
else if ( ptr_server && ( (ascii_strcasecmp (arg, "1") == 0) || (ascii_strcasecmp (arg, "nick") == 0) ) )
{
if (ptr_server->nick)
info = ptr_server->nick;
}
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
else if ( (ascii_strcasecmp (arg, "2") == 0) || (ascii_strcasecmp (arg, "channel") == 0) )
{
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
info = CHANNEL (gui_current_window->buffer)->name;
}
else if ( ptr_server && ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) ) )
else if ( ptr_server && ( (ascii_strcasecmp (arg, "3") == 0) || (ascii_strcasecmp (arg, "server") == 0) ) )
{
if (ptr_server->name)
info = ptr_server->name;
}
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
else if ( (ascii_strcasecmp (arg, "4") == 0) || (ascii_strcasecmp (arg, "weechatdir") == 0) )
{
info = weechat_home;
}
else if ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
else if ( ptr_server && ( (ascii_strcasecmp (arg, "5") == 0) || (ascii_strcasecmp (arg, "away") == 0) ) )
{
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
XSRETURN (1);
@@ -448,7 +448,7 @@ static XS (XS_weechat_register)
for (ptr_perl_script = perl_scripts; ptr_perl_script;
ptr_perl_script = ptr_perl_script->next_script)
{
if (strcasecmp (ptr_perl_script->name, name) == 0)
if (ascii_strcasecmp (ptr_perl_script->name, name) == 0)
{
perl_script_found = ptr_perl_script;
break;
@@ -731,36 +731,36 @@ static XS (XS_weechat_get_info)
arg = SvPV (ST (0), integer);
if (arg)
{
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
if ( (ascii_strcasecmp (arg, "0") == 0) || (ascii_strcasecmp (arg, "version") == 0) )
{
info = PACKAGE_STRING;
}
else if ( ptr_server && ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) ) )
else if ( ptr_server && ( (ascii_strcasecmp (arg, "1") == 0) || (ascii_strcasecmp (arg, "nick") == 0) ) )
{
if (ptr_server->nick)
info = ptr_server->nick;
}
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
else if ( (ascii_strcasecmp (arg, "2") == 0) || (ascii_strcasecmp (arg, "channel") == 0) )
{
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
info = CHANNEL (gui_current_window->buffer)->name;
}
else if ( ptr_server && ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) ) )
else if ( ptr_server && ( (ascii_strcasecmp (arg, "3") == 0) || (ascii_strcasecmp (arg, "server") == 0) ) )
{
if (ptr_server->name)
info = ptr_server->name;
}
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
else if ( (ascii_strcasecmp (arg, "4") == 0) || (ascii_strcasecmp (arg, "weechatdir") == 0) )
{
info = weechat_home;
}
else if ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
else if ( ptr_server && ( (ascii_strcasecmp (arg, "5") == 0) || (ascii_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) )
else if ( (ascii_strcasecmp (arg, "100") == 0) || (ascii_strcasecmp (arg, "dccs") == 0) )
{
int nItems = 0;
t_irc_dcc *p = dcc_list;
+81 -41
View File
@@ -43,6 +43,10 @@
#include "python/wee-python.h"
#endif
#ifdef PLUGIN_RUBY
#include "ruby/wee-ruby.h"
#endif
char *plugin_name[3] = { "Perl", "Python", "Ruby" };
@@ -115,15 +119,20 @@ plugin_auto_load (int plugin_type, char *directory)
void
plugin_init ()
{
#ifdef PLUGIN_PERL
#ifdef PLUGIN_PERL
wee_perl_init();
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
#endif
#endif
#ifdef PLUGIN_PYTHON
#ifdef PLUGIN_PYTHON
wee_python_init();
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
#endif
#endif
#ifdef PLUGIN_RUBY
wee_ruby_init();
plugin_auto_load (PLUGIN_TYPE_RUBY, "ruby/autoload");
#endif
}
/*
@@ -133,28 +142,30 @@ plugin_init ()
void
plugin_load (int plugin_type, char *filename)
{
#ifdef PLUGINS
#ifdef PLUGINS
switch (plugin_type)
{
case PLUGIN_TYPE_PERL:
#ifdef PLUGIN_PERL
#ifdef PLUGIN_PERL
wee_perl_load (filename);
#endif
#endif
break;
case PLUGIN_TYPE_PYTHON:
#ifdef PLUGIN_PYTHON
#ifdef PLUGIN_PYTHON
wee_python_load (filename);
#endif
#endif
break;
case PLUGIN_TYPE_RUBY:
/* TODO: load Ruby script */
#ifdef PLUGIN_RUBY
wee_ruby_load (filename);
#endif
break;
}
#else
#else
/* make gcc happy */
(void) plugin_type;
(void) filename;
#endif
#endif /* PLUGINS */
}
/*
@@ -170,7 +181,7 @@ plugin_handler_search (t_plugin_handler *plugin_handlers, char *name)
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
/* handler found */
if (strcasecmp (ptr_plugin_handler->name, name) == 0)
if (ascii_strcasecmp (ptr_plugin_handler->name, name) == 0)
return ptr_plugin_handler;
}
/* handler not found */
@@ -292,15 +303,15 @@ plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
void
plugin_event_msg (char *irc_command, char *server, char *arguments)
{
#ifdef PLUGINS
#ifdef PLUGINS
t_plugin_handler *ptr_plugin_handler;
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (strcasecmp (ptr_plugin_handler->name, irc_command) == 0)
if (ascii_strcasecmp (ptr_plugin_handler->name, irc_command) == 0)
{
#ifdef PLUGIN_PERL
#ifdef PLUGIN_PERL
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
{
if (ptr_plugin_handler->running == 0)
@@ -310,8 +321,8 @@ plugin_event_msg (char *irc_command, char *server, char *arguments)
ptr_plugin_handler->running = 0;
}
}
#endif
#ifdef PLUGIN_PYTHON
#endif
#ifdef PLUGIN_PYTHON
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
if (ptr_plugin_handler->running == 0)
@@ -321,15 +332,26 @@ plugin_event_msg (char *irc_command, char *server, char *arguments)
ptr_plugin_handler->running = 0;
}
}
#endif
#endif
#ifdef PLUGIN_RUBY
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_RUBY)
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_ruby_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
}
}
#else
#else
/* make gcc happy */
(void) irc_command;
(void) arguments;
(void) server;
#endif
#endif /* PLUGINS */
}
/*
@@ -339,15 +361,15 @@ plugin_event_msg (char *irc_command, char *server, char *arguments)
int
plugin_exec_command (char *user_command, char *server, char *arguments)
{
#ifdef PLUGINS
#ifdef PLUGINS
t_plugin_handler *ptr_plugin_handler;
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (strcasecmp (ptr_plugin_handler->name, user_command) == 0)
if (ascii_strcasecmp (ptr_plugin_handler->name, user_command) == 0)
{
#ifdef PLUGIN_PERL
#ifdef PLUGIN_PERL
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
{
if (ptr_plugin_handler->running == 0)
@@ -357,8 +379,8 @@ plugin_exec_command (char *user_command, char *server, char *arguments)
ptr_plugin_handler->running = 0;
}
}
#endif
#ifdef PLUGIN_PYTHON
#endif
#ifdef PLUGIN_PYTHON
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
if (ptr_plugin_handler->running == 0)
@@ -368,18 +390,29 @@ plugin_exec_command (char *user_command, char *server, char *arguments)
ptr_plugin_handler->running = 0;
}
}
#endif
#endif
#ifdef PLUGIN_RUBY
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_RUBY)
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_ruby_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
/* command executed */
return 1;
}
}
#else
#else
/* make gcc happy */
(void) user_command;
(void) arguments;
(void) server;
#endif
#endif /* PLUGINS */
/* no command executed */
return 0;
@@ -453,30 +486,33 @@ plugin_unload (int plugin_type, char *scriptname)
/* make gcc happy */
(void) scriptname;
#ifdef PLUGINS
#ifdef PLUGINS
switch (plugin_type)
{
case PLUGIN_TYPE_PERL:
#ifdef PLUGIN_PERL
#ifdef PLUGIN_PERL
/* unload one Perl script is not allowed */
wee_perl_end ();
wee_perl_init ();
#endif
#endif
break;
case PLUGIN_TYPE_PYTHON:
#ifdef PLUGIN_PYTHON
#ifdef PLUGIN_PYTHON
wee_python_end ();
wee_python_init ();
#endif
#endif
break;
case PLUGIN_TYPE_RUBY:
/* TODO: unload Ruby scripts */
#ifdef PLUGIN_RUBY
wee_ruby_end ();
wee_ruby_init ();
#endif
break;
}
#else
#else
/* make gcc happy */
(void) plugin_type;
#endif
#endif /* PLUGINS */
}
/*
@@ -489,11 +525,15 @@ plugin_end ()
plugin_handler_free_all (&plugin_msg_handlers, &last_plugin_msg_handler);
plugin_handler_free_all (&plugin_cmd_handlers, &last_plugin_cmd_handler);
#ifdef PLUGIN_PERL
#ifdef PLUGIN_PERL
wee_perl_end();
#endif
#endif
#ifdef PLUGIN_PYTHON
#ifdef PLUGIN_PYTHON
wee_python_end();
#endif
#endif
#ifdef PLUGIN_RUBY
wee_ruby_end();
#endif
}
+4
View File
@@ -67,6 +67,10 @@ extern t_plugin_script *perl_scripts;
extern t_plugin_script *python_scripts;
#endif
#ifdef PLUGIN_RUBY
extern t_plugin_script *ruby_scripts;
#endif
extern void plugin_auto_load (int, char *);
extern void plugin_init ();
extern void plugin_load (int, char *);
+10 -9
View File
@@ -66,7 +66,7 @@ wee_python_register (PyObject *self, PyObject *args)
for (ptr_python_script = python_scripts; ptr_python_script;
ptr_python_script = ptr_python_script->next_script)
{
if (strcasecmp (ptr_python_script->name, name) == 0)
if (ascii_strcasecmp (ptr_python_script->name, name) == 0)
{
python_script_found = ptr_python_script;
break;
@@ -321,7 +321,7 @@ wee_python_get_info (PyObject *self, PyObject *args)
{
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (strcasecmp (ptr_server->name, server) == 0)
if (ascii_strcasecmp (ptr_server->name, server) == 0)
break;
}
if (!ptr_server)
@@ -330,39 +330,40 @@ wee_python_get_info (PyObject *self, PyObject *args)
gui_printf (NULL,
_("%s error: server not found for \"%s\" function\n"),
"Python", "get_info");
return NULL;
}
}
if (ptr_server && arg)
{
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
if ( (ascii_strcasecmp (arg, "0") == 0) || (ascii_strcasecmp (arg, "version") == 0) )
{
info = PACKAGE_STRING;
}
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
else if ( (ascii_strcasecmp (arg, "1") == 0) || (ascii_strcasecmp (arg, "nick") == 0) )
{
if (ptr_server->nick)
info = ptr_server->nick;
}
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
else if ( (ascii_strcasecmp (arg, "2") == 0) || (ascii_strcasecmp (arg, "channel") == 0) )
{
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 ( (ascii_strcasecmp (arg, "3") == 0) || (ascii_strcasecmp (arg, "server") == 0) )
{
if (ptr_server->name)
info = ptr_server->name;
}
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
else if ( (ascii_strcasecmp (arg, "4") == 0) || (ascii_strcasecmp (arg, "weechatdir") == 0) )
{
info = weechat_home;
}
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
else if ( (ascii_strcasecmp (arg, "5") == 0) || (ascii_strcasecmp (arg, "away") == 0) )
{
return Py_BuildValue ("i", SERVER(gui_current_window->buffer)->is_away);
}
else if ( (strcasecmp (arg, "100") == 0) || (strcasecmp (arg, "dccs") == 0) )
else if ( (ascii_strcasecmp (arg, "100") == 0) || (ascii_strcasecmp (arg, "dccs") == 0) )
{
t_irc_dcc *p = dcc_list;
int nbdccs = 0;
+23
View File
@@ -0,0 +1,23 @@
# 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
#
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(RUBY_CFLAGS)
noinst_LIBRARIES = lib_weechat_ruby.a
lib_weechat_ruby_a_SOURCES = wee-ruby.h \
wee-ruby.c
+607
View File
@@ -0,0 +1,607 @@
/*
* 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
*/
/* wee-ruby.c: Ruby plugin support for WeeChat */
#include <ruby.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#undef _
#include "../../common/weechat.h"
#include "../plugins.h"
#include "wee-ruby.h"
#include "../../common/command.h"
#include "../../irc/irc.h"
#include "../../gui/gui.h"
t_plugin_script *ruby_scripts = NULL;
t_plugin_script *last_ruby_script = NULL;
/*
* register: startup function for all WeeChat Ruby scripts
*/
static VALUE
wee_ruby_register (VALUE class, VALUE name, VALUE version, VALUE shutdown_func, VALUE description)
{
char *c_name, *c_version, *c_shutdown_func, *c_description;
t_plugin_script *ptr_ruby_script, *ruby_script_found, *new_ruby_script;
if (NIL_P (name) || NIL_P (version) || NIL_P (shutdown_func) || NIL_P (description))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Ruby", "register");
return Qnil;
}
Check_Type (name, T_STRING);
Check_Type (version, T_STRING);
Check_Type (shutdown_func, T_STRING);
Check_Type (description, T_STRING);
c_name = STR2CSTR (name);
c_version = STR2CSTR (version);
c_shutdown_func = STR2CSTR (shutdown_func);
c_description = STR2CSTR (description);
ruby_script_found = NULL;
for (ptr_ruby_script = ruby_scripts; ptr_ruby_script;
ptr_ruby_script = ptr_ruby_script->next_script)
{
if (ascii_strcasecmp (ptr_ruby_script->name, c_name) == 0)
{
ruby_script_found = ptr_ruby_script;
break;
}
}
if (ruby_script_found)
{
/* error: another script already exists with this name! */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to register \"%s\" script (another script "
"already exists with this name)\n"),
"Ruby", name);
}
else
{
/* registering script */
new_ruby_script = (t_plugin_script *)malloc (sizeof (t_plugin_script));
if (new_ruby_script)
{
new_ruby_script->name = strdup (c_name);
new_ruby_script->version = strdup (c_version);
new_ruby_script->shutdown_func = strdup (c_shutdown_func);
new_ruby_script->description = strdup (c_description);
/* add new script to list */
new_ruby_script->prev_script = last_ruby_script;
new_ruby_script->next_script = NULL;
if (ruby_scripts)
last_ruby_script->next_script = new_ruby_script;
else
ruby_scripts = new_ruby_script;
last_ruby_script = new_ruby_script;
wee_log_printf (_("Registered %s script: \"%s\", version %s (%s)\n"),
"Ruby", c_name, c_version, c_description);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to load script \"%s\" (not enough memory)\n"),
"Ruby", c_name);
}
}
return Qnil;
}
/*
* print: print message into a buffer (current or specified one)
*/
static VALUE
wee_ruby_print (VALUE class, VALUE message, VALUE channel_name, VALUE server_name)
{
char *c_message, *c_channel_name, *c_server_name;
t_gui_buffer *ptr_buffer;
c_message = NULL;
c_channel_name = NULL;
c_server_name = NULL;
if (NIL_P (message))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Ruby", "print");
return Qnil;
}
Check_Type (message, T_STRING);
if (!NIL_P (channel_name))
Check_Type (channel_name, T_STRING);
if (!NIL_P (server_name))
Check_Type (server_name, T_STRING);
c_message = STR2CSTR (message);
if (!NIL_P (channel_name))
c_channel_name = STR2CSTR (channel_name);
if (!NIL_P (server_name))
c_server_name = STR2CSTR (server_name);
ptr_buffer = plugin_find_buffer (c_server_name, c_channel_name);
if (ptr_buffer)
{
irc_display_prefix (ptr_buffer, PREFIX_PLUGIN);
gui_printf (ptr_buffer, "%s\n", c_message);
return INT2FIX (1);
}
/* buffer not found */
return INT2FIX (0);
}
/*
* print_infobar: print message to infobar
*/
static VALUE
wee_ruby_print_infobar (VALUE class, VALUE delay, VALUE message)
{
int c_delay;
char *c_message;
c_delay = 1;
c_message = NULL;
if (NIL_P (delay) || NIL_P (message))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Ruby", "print_infobar");
return Qfalse;
}
Check_Type (delay, T_FIXNUM);
Check_Type (message, T_STRING);
c_delay = FIX2INT (delay);
c_message = STR2CSTR (message);
gui_infobar_printf (delay, COLOR_WIN_INFOBAR, c_message);
return Qtrue;
}
/*
* command: send command to server
*/
static VALUE
wee_ruby_command (VALUE class, VALUE command, VALUE channel_name, VALUE server_name)
{
char *c_command, *c_channel_name, *c_server_name;
t_gui_buffer *ptr_buffer;
c_command = NULL;
c_channel_name = NULL;
c_server_name = NULL;
if (NIL_P (command))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Ruby", "command");
return Qnil;
}
Check_Type (command, T_STRING);
if (!NIL_P (channel_name))
Check_Type (channel_name, T_STRING);
if (!NIL_P (server_name))
Check_Type (server_name, T_STRING);
c_command = STR2CSTR (command);
if (!NIL_P (channel_name))
c_channel_name = STR2CSTR (channel_name);
if (!NIL_P (server_name))
c_server_name = STR2CSTR (server_name);
ptr_buffer = plugin_find_buffer (c_server_name, c_channel_name);
if (ptr_buffer)
{
user_command (SERVER(ptr_buffer), ptr_buffer, c_command);
return INT2FIX (1);
}
/* buffer not found */
return INT2FIX (0);
}
/*
* add_message_handler: add handler for messages
*/
static VALUE
wee_ruby_add_message_handler (VALUE class, VALUE message, VALUE function)
{
char *c_message, *c_function;
if (NIL_P (message) || NIL_P (function))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Ruby", "add_message_handler");
return Qnil;
}
Check_Type (message, T_STRING);
Check_Type (function, T_STRING);
c_message = STR2CSTR (message);
c_function = STR2CSTR (function);
plugin_handler_add (&plugin_msg_handlers, &last_plugin_msg_handler,
PLUGIN_TYPE_RUBY, c_message, c_function);
return Qtrue;
}
/*
* add_command_handler: define/redefines commands
*/
static VALUE
wee_ruby_add_command_handler (VALUE class, VALUE name, VALUE function)
{
char *c_name, *c_function;
t_plugin_handler *ptr_plugin_handler;
if (NIL_P (name) || NIL_P (function))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Ruby", "add_command_handler");
return Qnil;
}
Check_Type (name, T_STRING);
Check_Type (function, T_STRING);
c_name = STR2CSTR (name);
c_function = STR2CSTR (function);
if (!weelist_search (index_commands, c_name))
weelist_add (&index_commands, &last_index_command, c_name);
ptr_plugin_handler = plugin_handler_search (plugin_cmd_handlers, c_name);
if (ptr_plugin_handler)
{
free (ptr_plugin_handler->function_name);
ptr_plugin_handler->function_name = strdup (c_function);
}
else
plugin_handler_add (&plugin_cmd_handlers, &last_plugin_cmd_handler,
PLUGIN_TYPE_PYTHON, c_name, c_function);
return Qtrue;
}
/*
* get_info: get various infos
*/
static VALUE
wee_ruby_get_info (VALUE class, VALUE arg, VALUE server_name)
{
char *c_arg, *info, *c_server_name;
t_irc_server *ptr_server;
if (NIL_P (arg))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Ruby", "get_info");
return Qnil;
}
Check_Type (arg, T_STRING);
if (!NIL_P (server_name))
Check_Type (server_name, T_STRING);
c_arg = STR2CSTR (arg);
if (!NIL_P (server_name))
c_server_name = STR2CSTR (server_name);
if (c_server_name == NULL)
{
ptr_server = SERVER(gui_current_window->buffer);
}
else
{
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (ascii_strcasecmp (ptr_server->name, c_server_name) == 0)
break;
}
if (!ptr_server)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: server not found for \"%s\" function\n"),
"Ruby", "get_info");
return Qnil;
}
}
if (ptr_server && c_arg)
{
if ( (ascii_strcasecmp (c_arg, "0") == 0) || (ascii_strcasecmp (c_arg, "version") == 0) )
{
info = PACKAGE_STRING;
}
else if ( (ascii_strcasecmp (c_arg, "1") == 0) || (ascii_strcasecmp (c_arg, "nick") == 0) )
{
if (ptr_server->nick)
info = ptr_server->nick;
}
else if ( (ascii_strcasecmp (c_arg, "2") == 0) || (ascii_strcasecmp (c_arg, "channel") == 0) )
{
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
info = CHANNEL (gui_current_window->buffer)->name;
}
else if ( (ascii_strcasecmp (c_arg, "3") == 0) || (ascii_strcasecmp (c_arg, "server") == 0) )
{
if (ptr_server->name)
info = ptr_server->name;
}
else if ( (ascii_strcasecmp (c_arg, "4") == 0) || (ascii_strcasecmp (c_arg, "weechatdir") == 0) )
{
info = weechat_home;
}
else if ( (ascii_strcasecmp (c_arg, "5") == 0) || (ascii_strcasecmp (c_arg, "away") == 0) )
{
return INT2FIX (SERVER(gui_current_window->buffer)->is_away);
}
else if ( (ascii_strcasecmp (c_arg, "100") == 0) || (ascii_strcasecmp (c_arg, "dccs") == 0) )
{
/* TODO: build dcc list */
}
if (info)
return rb_str_new2 (info);
else
return rb_str_new2 ("");
}
return INT2FIX (1);
}
/*
* Ruby subroutines
*/
/*
* wee_ruby_init: initialize Ruby interface for WeeChat
*/
void
wee_ruby_init ()
{
/* TODO: init Ruby environment */
/* ruby_init ();
if ()
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s error: error while launching interpreter\n"),
"Ruby");
}
else
{
wee_log_printf (_("Loading %s module \"weechat\"\n"), "Ruby");
}*/
}
/*
* wee_ruby_search: search a (loaded) Ruby script by name
*/
t_plugin_script *
wee_ruby_search (char *name)
{
t_plugin_script *ptr_ruby_script;
for (ptr_ruby_script = ruby_scripts; ptr_ruby_script;
ptr_ruby_script = ptr_ruby_script->next_script)
{
if (strcmp (ptr_ruby_script->name, name) == 0)
return ptr_ruby_script;
}
/* script not found */
return NULL;
}
/*
* wee_ruby_exec: execute a Ruby script
*/
int
wee_ruby_exec (char *function, char *server, char *arguments)
{
/* TODO: exec Ruby script */
}
/*
* wee_ruby_load: load a Ruby script
*/
int
wee_ruby_load (char *filename)
{
FILE *fp;
/* TODO: load & exec Ruby script */
gui_printf (NULL, "Ruby scripts not developed!\n");
/* execute Ruby script */
/*wee_log_printf (_("Loading %s script \"%s\"\n"), "Ruby", filename);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Loading %s script \"%s\"\n"), "Ruby", filename);
if ((fp = fopen (filename, "r")) == NULL)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: error while opening file \"%s\"\n"),
"Ruby", filename);
return 1;
}
if (xxxxxxx (fp, filename) != 0)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: error while parsing file \"%s\"\n"),
"Ruby", filename);
return 1;
}
fclose (fp);
return 0;*/
}
/*
* wee_ruby_script_free: free a Ruby script
*/
void
wee_ruby_script_free (t_plugin_script *ptr_ruby_script)
{
t_plugin_script *new_ruby_scripts;
/* remove script from list */
if (last_ruby_script == ptr_ruby_script)
last_ruby_script = ptr_ruby_script->prev_script;
if (ptr_ruby_script->prev_script)
{
(ptr_ruby_script->prev_script)->next_script = ptr_ruby_script->next_script;
new_ruby_scripts = ruby_scripts;
}
else
new_ruby_scripts = ptr_ruby_script->next_script;
if (ptr_ruby_script->next_script)
(ptr_ruby_script->next_script)->prev_script = ptr_ruby_script->prev_script;
/* free data */
if (ptr_ruby_script->name)
free (ptr_ruby_script->name);
if (ptr_ruby_script->version)
free (ptr_ruby_script->version);
if (ptr_ruby_script->shutdown_func)
free (ptr_ruby_script->shutdown_func);
if (ptr_ruby_script->description)
free (ptr_ruby_script->description);
free (ptr_ruby_script);
ruby_scripts = new_ruby_scripts;
}
/*
* wee_ruby_unload: unload a Ruby script
*/
void
wee_ruby_unload (t_plugin_script *ptr_ruby_script)
{
if (ptr_ruby_script)
{
wee_log_printf (_("Unloading %s script \"%s\"\n"),
"Ruby", ptr_ruby_script->name);
/* call shutdown callback function */
if (ptr_ruby_script->shutdown_func[0])
wee_ruby_exec (ptr_ruby_script->shutdown_func, "", "");
wee_ruby_script_free (ptr_ruby_script);
}
}
/*
* wee_ruby_unload_all: unload all Ruby scripts
*/
void
wee_ruby_unload_all ()
{
wee_log_printf (_("Unloading all %s scripts...\n"), "Ruby");
while (ruby_scripts)
wee_ruby_unload (ruby_scripts);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s scripts unloaded\n"), "Ruby");
}
/*
* wee_ruby_end: shutdown Ruby interface
*/
void
wee_ruby_end ()
{
/* unload all scripts */
wee_ruby_unload_all ();
/* free all handlers */
plugin_handler_free_all_type (&plugin_msg_handlers,
&last_plugin_msg_handler,
PLUGIN_TYPE_RUBY);
plugin_handler_free_all_type (&plugin_cmd_handlers,
&last_plugin_cmd_handler,
PLUGIN_TYPE_RUBY);
/* TODO: free Ruby interpreter */
/* free Ruby interpreter */
/* xxxxx ();
if ()
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s error: error while freeing interpreter\n"),
"Ruby");
}*/
}
+34
View File
@@ -0,0 +1,34 @@
/*
* 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
*/
#ifndef __WEECHAT_RUBY_H
#define __WEECHAT_RUBY_H 1
#include "../plugins.h"
extern void wee_ruby_init ();
extern t_plugin_script *wee_ruby_search (char *);
extern int wee_ruby_exec (char *, char *, char *);
extern int wee_ruby_load (char *);
extern void wee_ruby_unload (t_plugin_script *);
extern void wee_ruby_unload_all ();
extern void wee_ruby_end ();
#endif /* wee-ruby.h */
+3 -1
View File
@@ -1,5 +1,5 @@
%define name weechat
%define version 0.1.4
%define version 0.1.5
%define release 1
Name: %{name}
@@ -41,6 +41,8 @@ rm -rf $RPM_BUILD_ROOT
/usr/local/bin/weechat-curses
%changelog
* Sat Sep 24 2005 FlashCode <flashcode@flashtux.org> 0.1.5-1
- Released version 0.1.5
* 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
+3 -2
View File
@@ -1,12 +1,13 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2005-07-30
WeeChat known bugs, 2005-09-24
- color display problems when term has white background
- ./configure does not check that Ruby libraries are installed
- ./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)
- command name for /server can not contain spaces
- wrong alias is not created and not saved when quitting WeeChat
- when many WeeChat are launched, log file is not properly written (cleared by
each WeeChat at startup)
- display problems with old Konsole versions (Kde terminal) (???)
+25 -1
View File
@@ -1,9 +1,33 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-07-30
ChangeLog - 2005-09-24
Version 0.1.5 (2005-09-24):
* added /ame command (send CTCP action to all channels of all
connected servers)
* added setting "irc_notice_as_pv" to see notices as pv
* added nicks colors in setup file
* fixed DCC bug: delete failed file only if really empty (on disk)
* fixed IRC message parser bug
* fixed scroll problem (screen moving when scrolling and new line
displayed)
* fixed infinite loop when scrolling back and displaying long lines
* fixed crash when closing a buffer used by more than one window
* added some missing IRC commands
* fixed DCC display bug (now decodes string according to charset)
* added /ignore and /unignore commands
* fixed bug with strings comparison (str[n]casecmp) and some locales
(like turkish), now using ASCII comparison (thanks to roktas)
* signal SIGQUIT is now ignored
* fixed refresh bug when one line is bigger than screen size
* fixed look_nicklist_min_size and look_nicklist_max_size options
* fixed refresh bug when changing channel modes
* jump to next server now saves current channel buffer for each server
* ctrl-up/ctrl-down keys added to call previous/next command in global
history (common to all buffers)
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
+3 -3
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-07-30
WeeChat FAQ, 2005-09-24
=======================
Intended audience:
@@ -195,5 +195,5 @@ A: There's many tasks to do (code, documentation, ...)
================================================================================
Q: Can I give money or other things to WeeChat developers?
A: Beer is welcome :)
Otherwise Paypal account is: flashcode@free.fr (no limit for gifts :)
A: You can give us money to help development.
Details on http://weechat.flashtux.org/donate.php?lang=en
+3 -4
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-07-30
WeeChat FAQ, 2005-09-24
=======================
Public concerné :
@@ -206,6 +206,5 @@ R: Il y a plusieurs choses
================================================================================
Q: Puis-je donner de l'argent ou d'autres choses aux développeurs WeeChat ?
R: La bière est la bienvenue :)
Sinon le compte Paypal est: flashcode@free.fr (il n'y a pas de limite pour
les dons :)
R: Vous pouvez donner de l'argent pour aider le développement.
Plus de détails sur http://weechat.flashtux.org/donate.php
+4
View File
@@ -1,6 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-09-24
WeeChat 0.1.5 released.
* FlashCode, 2005-07-30
WeeChat 0.1.4 released.
+5 -13
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2005-07-20
TODO - 2005-09-24
Legend:
# done
@@ -10,7 +10,7 @@ Legend:
? is this really necessary?
v0.1.4:
v0.1.6:
------
* General:
@@ -21,20 +21,13 @@ v0.1.4:
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* TCP/IP communication:
# 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
- host with "*" possible with /ignore command
* Configuration:
# irc_highlight setting to highlight custom words
# save buffer notify levels
# add key bindings to config file, and create /key command
- be able to launch more than one command when connecting to server
Future versions:
@@ -44,8 +37,6 @@ Future versions:
- 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
nick/host
- when we're away, WeeChat should log all the lines begenning by our nick.
When we come back from our away it should print it to the current window
- "/notify" and "/unnotify" command to be warn by WeeChat when a given
@@ -59,6 +50,7 @@ Future versions:
* Interface:
- color for nicks (except own nick) when nick colors are disabled
- allow decode/encode charsets for servers or chan (not globally)
- interpret special chars in messages (color & bold for example)
- understand incomplete commands if unambigous (for example: /he for /help is ok)
? Qt GUI
+19 -6
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.1.4, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.5, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.4])
AM_INIT_AUTOMAKE([weechat], [0.1.5])
# Checks for programs.
AC_PROG_CC
@@ -30,7 +30,7 @@ AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Gettext
ALL_LINGUAS="fr es"
ALL_LINGUAS="fr es cs"
AM_GNU_GETTEXT
# Checks for libraries.
@@ -66,6 +66,7 @@ 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([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([DEBUG], [#undef DEBUG])
@@ -75,12 +76,11 @@ AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (defau
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(ruby, [ --enable-ruby Turn on Ruby plugins (default=no)],enable_ruby=$enableval,enable_ruby=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"
RUBY_CFLAGS=
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
@@ -88,7 +88,7 @@ AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
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(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
@@ -225,6 +225,18 @@ if test "x$enable_python" = "xyes" ; then
AC_DEFINE(PLUGIN_PYTHON)
fi
if test "x$enable_ruby" = "xyes" ; then
enable_plugins="yes"
# TODO: check that ruby lib and headers are installed
RUBY_CFLAGS=-I`ruby -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
RUBY_LFLAGS=-L`ruby -rrbconfig -e "puts Config::CONFIG[['archdir']]"` -lruby
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/ruby/lib_weechat_ruby.a $RUBY_LFLAGS"
AC_SUBST(RUBY_CFLAGS)
AC_DEFINE(PLUGIN_RUBY)
fi
if test "x$enable_plugins" = "xyes" ; then
AC_DEFINE(PLUGINS)
fi
@@ -272,6 +284,7 @@ AC_OUTPUT([Makefile
src/plugins/Makefile
src/plugins/perl/Makefile
src/plugins/python/Makefile
src/plugins/ruby/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
+15
View File
@@ -1,3 +1,18 @@
weechat (0.1.4-2) unstable; urgency=low
* Add autotools-dev to Build-Depends.
* update autotools stuff automatically to always
have up-to-date config.{guess,sub}
* Update Build-Depends: libgnutls11-dev -> libgnutls-dev
-- Julien Louis <ptitlouis@sysif.net> Mon, 1 Aug 2005 11:46:39 +0200
weechat (0.1.4-1) unstable; urgency=low
* New upstream release.
-- Julien Louis <ptitlouis@sysif.net> Sat, 30 Jul 2005 16:26:55 +0200
weechat (0.1.3-2) unstable; urgency=low
* Update config.{guess,sub} to fix FTBFS on k*BSD (Closes: #316791)
+1 -1
View File
@@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev, libgnutls11-dev
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev, libgnutls-dev, autotools-dev
Standards-Version: 3.6.2.1
Package: weechat
+6 -1
View File
@@ -15,7 +15,7 @@ configure: configure-stamp
configure-stamp:
dh_testdir
./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man \
--enable-perl --enable-python
--infodir=\$${prefix}/share/info --enable-perl --enable-python
touch configure-stamp
@@ -31,6 +31,10 @@ clean:
dh_testroot
rm -f build-stamp configure-stamp
-$(MAKE) distclean
test -r /usr/share/misc/config.guess && \
cp -f /usr/share/misc/config.guess config.guess
test -r /usr/share/misc/config.sub && \
cp -f /usr/share/misc/config.sub config.sub
dh_clean
install: build
@@ -50,6 +54,7 @@ binary-indep: build install
dh_testroot -pweechat-common -pweechat
dh_installchangelogs ChangeLog -pweechat-common
dh_installdocs -pweechat-common
dh_installinfo -pweechat-common
dh_installexamples -pweechat-common
dh_compress -pweechat-common -pweechat
dh_link -pweechat usr/share/doc/weechat-common usr/share/doc/weechat
+1 -1
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "July 2005" "FlashCode"
.TH WEECHAT 1 "September 2005" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
+124 -13
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.4-cvs - July, 16 2005
@subtitle Documentation for WeeChat v0.1.5 - September, 24 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -280,6 +280,9 @@ Type: string (any string), default value: '[%H:%M:%S]'@*
@item look_color_nicks
Display nick names with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item look_color_nicks_number
Number of colors to use for nicks colors@*
Type: integer (values: between 1 and 10), default value: 10@*
@item look_color_actions
Display actions with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -343,6 +346,12 @@ Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@item col_chat_prefix2
Color for middle char of prefix@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_chat_join
Color for join arrow (prefix)@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_chat_part
Color for part/quit arrow (prefix)@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_chat_nick
Color for nicks in actions (chat window)@*
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@@ -370,9 +379,12 @@ Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_status_data_msg
Color for window with new messages (status bar)@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_status_private
Color for window with private message (status bar)@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_status_highlight
Color for window with highlight (status bar)@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_status_data_other
Color for window with new data (not messages) (status bar)@*
Type: color (Curses or Gtk color), default value: 'default'@*
@@ -436,6 +448,36 @@ Type: color (Curses or Gtk color), default value: 'blue'@*
@item col_nick_self
Color for local nick@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_nick_color1
Color for nick@*
Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_nick_color2
Color for nick@*
Type: color (Curses or Gtk color), default value: 'magenta'@*
@item col_nick_color3
Color for nick@*
Type: color (Curses or Gtk color), default value: 'green'@*
@item col_nick_color4
Color for nick@*
Type: color (Curses or Gtk color), default value: 'brown'@*
@item col_nick_color5
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightblue'@*
@item col_nick_color6
Color for nick@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_nick_color7
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@item col_nick_color8
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_color9
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_nick_color10
Color for nick@*
Type: color (Curses or Gtk color), default value: 'blue'@*
@item col_nick_private
Color for other nick in private window@*
Type: color (Curses or Gtk color), default value: 'default'@*
@@ -502,6 +544,9 @@ 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'@*
@item irc_notice_as_pv
Display notices as private messages@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item irc_away_check
Interval between two checks for away (in minutes, 0 = never check)@*
Type: integer (values: between 0 and 2147483647), default value: 0@*
@@ -517,6 +562,9 @@ Type: integer (values: between 0 and 2147483647), default value: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item irc_highlight
Comma separated list of words to highlight (case insensitive comparison)@*
Type: string (any string), default value: ''@*
@item dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@@ -614,7 +662,7 @@ Type: string (any string), default value: ''@*
Delay (in seconds) after command was executed (example: give some time for authentication)@*
Type: integer (values: between 0 and 5), default value: 0@*
@item server_autojoin
Comma separated list of channels to join when connected to server@*
Comma separated list of channels to join when connected to server (example: "#chan1,#chan2,#chan3 #key1,#key2")@*
Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
@@ -701,6 +749,9 @@ Execute command or send message@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item Ctrl + up arrow / Ctrl + down arrow
Call again last commands/messages in global history@*
@*
@item PageUp / PageDown
Show buffer history@*
@*
@@ -818,6 +869,19 @@ display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item ignore [mask [[type | command] [channel [server]]]]
@*
ignore IRC messages and/or hosts@*
@*
mask: nick or host mask to ignore@*
type: type of message to ignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for ignore@*
server: name of server for ignore@*
@*
For each argument, '*' means all.@*
Without argument, /ignore command lists all defined ignore.@*
@*
@item key [key function/command] [unbind key] [functions] [reset -yes]
@*
bind/unbind keys@*
@@ -832,6 +896,7 @@ reset: restore bindings to the default values and delete ALL personal binding (u
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item python [load filename] | [autoload] | [reload] | [unload]
@@ -839,8 +904,17 @@ Without argument, /perl command lists all loaded Perl scripts.@*
list/load/unload Python scripts@*
@*
filename: Python script (file) to load@*
@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item ruby [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Ruby scripts@*
@*
filename: Ruby script (file) to load@*
@*
Without argument, /ruby command lists all loaded Ruby scripts.@*
@*
@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@*
@@ -876,6 +950,20 @@ remove an alias@*
@*
alias_name: name of alias to remove@*
@*
@item unignore [number | [mask [[type | command] [channel [server]]]]]
@*
unignore IRC messages and/or hosts@*
@*
number: # of ignore to unignore (number is displayed by list of ignore)@*
mask: nick or host mask to unignore@*
type: type of message to unignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for unignore@*
server: name of server for unignore@*
@*
For each argument, '*' means all.@*
Without argument, /unignore command lists all defined ignore.@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
manage windows@*
@@ -896,6 +984,18 @@ find information about the administrator of the server@*
@*
target: server@*
@*
@item ame message
@*
send a CTCP action to all channels of all connected servers@*
@*
message: message to send@*
@*
@item amsg text
@*
send message to all channels of all connected servers@*
@*
text: text to send@*
@*
@item away [-all] [message]
@*
toggle away status@*
@@ -910,12 +1010,13 @@ bans nicks or hosts@*
channel: channel for ban@*
nickname: user or host to ban@*
@*
@item ctcp nickname type
@item ctcp nickname type [arguments]
@*
send a ctcp message@*
send a CTCP message (Client-To-Client Protocol)@*
@*
nickname: user to send ctcp to@*
type: "action" or "version"@*
nickname: user to send CTCP to@*
type: CTCP type (examples: "version", "ping", ..)@*
arguments: arguments for CTCP@*
@*
@item dcc action [nickname [file]]
@*
@@ -925,15 +1026,15 @@ action: 'send' (file) or 'chat' or 'close' (chat)@*
nickname: nickname to send file or chat@*
file: filename (on local host)@*
@*
@item dehalfop nickname [nickname]
@item dehalfop [nickname [nickname]]
@*
removes half channel operator status from nickname(s)@*
@*
@item deop nickname [nickname]
@item deop [nickname [nickname]]
@*
removes channel operator status from nickname(s)@*
@*
@item devoice nickname [nickname]
@item devoice [nickname [nickname]]
@*
removes voice from nickname(s)@*
@*
@@ -941,7 +1042,7 @@ removes voice from nickname(s)@*
@*
shutdown the server@*
@*
@item halfop nickname [nickname]
@item halfop [nickname [nickname]]
@*
gives half channel operator status to nickname(s)@*
@*
@@ -1017,7 +1118,7 @@ target: server for forwarding request@*
@*
@item me message
@*
send a ctcp action to the current channel@*
send a CTCP action to the current channel@*
@*
message: message to send@*
@*
@@ -1224,7 +1325,7 @@ gives the version info of nick or server (current or specified)@*
server: server name@*
nickname: nickname@*
@*
@item voice nickname [nickname]
@item voice [nickname [nickname]]
@*
gives voice to nickname(s)@*
@*
@@ -1279,6 +1380,10 @@ delete entire line@*
delete previous word@*
@item delete_next_word
delete next word@*
@item clipboard_paste
paste current clipboard content@*
@item transpose_chars
transpose chars@*
@item home
go to beginning of line@*
@item end
@@ -1293,8 +1398,12 @@ move one char right@*
move to next word@*
@item up
call previous command in history@*
@item up_global
call previous command in global history@*
@item down
call next command in history@*
@item down_global
call next command in global history@*
@item page_up
scroll one page up@*
@item page_down
@@ -1315,6 +1424,8 @@ refresh screen@*
jump to buffer with activity@*
@item jump_dcc
jump to DCC buffer@*
@item jump_last_buffer
jump to last buffer@*
@item jump_server
jump to server buffer@*
@item jump_next_server
+195 -84
View File
@@ -36,7 +36,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.4-cvs - 16 de Julio de 2005
@subtitle Documentaci@'on para WeeChat v0.1.5 - 24 de Septiembre de 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -275,11 +275,14 @@ 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@'ufers@*
Fecha y hora para las bĂşfers@*
Typo: cadena (cualquier cadena), valor por defecto: '[%H:%M:%S]'@*
@item look_color_nicks
Mostrar nombres de usuario con colores diferentes@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item look_color_nicks_number
Number of colors to use for nicks colors@*
Typo: entero (valores: entre 1 y 10), valor por defecto: 10@*
@item look_color_actions
Mostrar acciones con colores diferentes@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@@ -317,7 +320,7 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
Fecha y hora para las conversaciones guardadas@*
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y'@*
@item look_infobar_seconds
Display seconds in infobar time@*
Mostrar segundos en la hora de la barra de herramientas@*
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)@*
@@ -343,6 +346,12 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightcyan'@*
@item col_chat_prefix2
Color para el car@'acter de en medio del prefijo@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'white'@*
@item col_chat_join
Color for join arrow (prefix)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightgreen'@*
@item col_chat_part
Color for part/quit arrow (prefix)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
@item col_chat_nick
Color para los nombres de usuario en las acciones (ventana de conversaci@'on)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightcyan'@*
@@ -370,9 +379,12 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'cyan'@*
@item col_status_data_msg
Color para una ventana con mensajes nuevos (barra de estado)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'yellow'@*
@item col_status_private
Color for window with private message (status bar)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_status_highlight
Color para una ventana con resaltado (barra de estado)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
@item col_status_data_other
Color para una ventana con nuevos datos (no mensajes) (barra de estado)@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'default'@*
@@ -428,7 +440,7 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
Color para el s@'imbolo de voz@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Color para '+' al desplazar nicks@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_sep
Color para el separador de alias@*
@@ -436,6 +448,36 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
@item col_nick_self
Color para el alias local@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'white'@*
@item col_nick_color1
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'cyan'@*
@item col_nick_color2
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'magenta'@*
@item col_nick_color3
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'green'@*
@item col_nick_color4
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'brown'@*
@item col_nick_color5
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightblue'@*
@item col_nick_color6
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'default'@*
@item col_nick_color7
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightcyan'@*
@item col_nick_color8
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_color9
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightgreen'@*
@item col_nick_color10
Color for nick@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
@item col_nick_private
Color para el otro alias en la ventana privada@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'default'@*
@@ -464,10 +506,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@'umero m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
NĂşmero 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@'umero m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
NĂşmero 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@*
@@ -502,6 +544,9 @@ 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'@*
@item irc_notice_as_pv
Display notices as private messages@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item irc_away_check
Intervalo entre dos comprobaciones de ausencia (en minutos, 0 = no comprobar)@*
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 0@*
@@ -517,11 +562,14 @@ Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 5@*
@item irc_fifo_pipe
Crea una tuber@'ia FIFO para control remoto@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item irc_highlight
Comma separated list of words to highlight (case insensitive comparison)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item dcc_auto_accept_files
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 (@exclamdown{}utilizar con precauci@'on!)@*
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (¡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)@*
@@ -548,10 +596,10 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
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)@*
Tipo de proxy(http (por defecto), socks4, socks5)@*
Typo: cadena (valores: 'http', 'socks4', 'socks5'), valor por defecto: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Conectar al proxy en 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)@*
@@ -560,7 +608,7 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
Puerto para conectarse al servidor proxy@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 3128@*
@item proxy_username
Username for proxy server@*
Nombre de usuario para el servidor proxy@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_password
Contrase@~na para el servidor proxy@*
@@ -584,10 +632,10 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
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@*
Usar el protocolo IPv6 para la comunicaci@'on del servidor@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_ssl
Use SSL for server communication@*
Usar SSL para la comunicaci@'on del servidor@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_password
Contrase@~na para el servidor IRC@*
@@ -614,13 +662,13 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
Espera (en segundos) despu@'es de que el comando sea ejecutado (ejemplo: dar algo de tiempo para la autenticaci@'on)@*
Typo: entero (valores: entre 0 y 5), valor por defecto: 0@*
@item server_autojoin
Lista de canales (separados por comas) a unirse cuando se conecte a un servidor@*
Lista de canales (separados por comas) a unirse cuando se conecte a un servidor (ejemplo: "#chan1,#chan2,#chan3 #key1,#key2")@*
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,..)@*
Lista separada por comas de niveles de notificaci@'on para canales de este servidor (formato: #canal:1,...)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@end table
@@ -701,6 +749,9 @@ Ejecutar la l@'inea de comandos o enviar el mensaje@*
@item Flecha de arriba / Flecha de abajo
Mostrar los @'ultimos comandos/mensajes@*
@*
@item Ctrl + up arrow / Ctrl + down arrow
Call again last commands/messages in global history@*
@*
@item PageUp / PageDown
Obtener el hist@'orico de la memoria temporal (buffer)@*
@*
@@ -777,16 +828,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@'umero]
@item buffer [acci@'on | nĂşmero]
@*
gestionar los b@'ufers@*
gestionar los bĂşfers@*
@*
acci@'on: acci@'on a efectuar:@*
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)@*
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)@*
notify: fija el nivel de notificaci@'on (0=nunca, 1=highlight, 2=1+msg, 3=2+join/part)@*
n@'umero: saltar al b@'ufer por n@'umero@*
nĂşmero: saltar al bĂşfer por nĂşmero@*
@*
@item clear [-all]
@*
@@ -818,20 +869,34 @@ 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]
@item ignore [mask [[type | command] [channel [server]]]]
@*
bind/unbind keys@*
ignore IRC messages and/or hosts@*
@*
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!)@*
mask: nick or host mask to ignore@*
type: type of message to ignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for ignore@*
server: name of server for ignore@*
@*
For each argument, '*' means all.@*
Without argument, /ignore command lists all defined ignore.@*
@*
@item key [clave funci@'on/comando] [desatar clave] [funciones] [reset -yes]
@*
atar/desatar claves@*
@*
clave: ata esta clave a una funci@'on interna o a un comando (comenzando por "/ ")@*
desatar: desata una clave(si "all", se restauran los anclajes por defecto)@*
funciones: lista funciones internas para el anclaje de claves@*
reset: restaura anclajes a los valores por defecto y elimina todos los anclajes personales (usar cuidadosamente)@*
@*
@item perl [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Perl scripts@*
@*
fichero: Perl script (archivo) a cargar@*
@*
Sin argumentos, el comando /perl lista todos los Perl scripts cargados.@*
@*
@item python [load fichero] | [autoload] | [reload] | [unload]
@@ -839,23 +904,32 @@ Sin argumentos, el comando /perl lista todos los Perl scripts cargados.@*
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 ruby [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Ruby scripts@*
@*
fichero: Ruby script (archivo) a cargar@*
@*
Sin argumentos, el comando /ruby lista todos los Ruby scripts cargados.@*
@*
@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@*
@*
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@*
nombre_de_servidor: nombre del servidor, para uso interno y para mostrar@*
nombre_de_anfitri@'on: nombre o direcci@'on IP del servidor@*
puerto: puerto para el servidor (nĂşmero entero)@*
ipv6: utilizar protocolo IPv6@*
ssl: utilizar protocolo SSL@*
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@*
@*
@item save [archivo]
@*
@@ -876,6 +950,20 @@ eliminar un alias@*
@*
alias: nombre del alias a suprimir@*
@*
@item unignore [number | [mask [[type | command] [channel [server]]]]]
@*
unignore IRC messages and/or hosts@*
@*
number: # of ignore to unignore (number is displayed by list of ignore)@*
mask: nick or host mask to unignore@*
type: type of message to unignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for unignore@*
server: name of server for unignore@*
@*
For each argument, '*' means all.@*
Without argument, /unignore command lists all defined ignore.@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
gesti@'on de ventanas@*
@@ -896,12 +984,24 @@ encontrar informaci@'on sobre el administrador del servidor@*
@*
target: servidor objetivo@*
@*
@item ame mensaje
@*
send a CTCP action to all channels of all connected servers@*
@*
mensaje: mensaje a enviar@*
@*
@item amsg texto
@*
send message to all channels of all connected servers@*
@*
texto: texto a enviar@*
@*
@item away [-all] [mensaje]
@*
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@'un mensaje, se elimina el estado ausente)@*
mensaje: mensaje para el estado ausente (si no se da ningĂşn mensaje, se elimina el estado ausente)@*
@*
@item ban [canal] [usariio [usuario ...]]
@*
@@ -910,12 +1010,13 @@ banea usuarios o m@'aquinas@*
canal: canal en el que banear@*
usuario: nombre de usuario o m@'aquina a banear@*
@*
@item ctcp usuario tipo
@item ctcp nickname type [arguments]
@*
enviar un mensaje ctcp@*
send a CTCP message (Client-To-Client Protocol)@*
@*
usuario: usuario a quien enviar el ctcp@*
tipo: "action" @'o "version"@*
nickname: user to send CTCP to@*
type: CTCP type (examples: "version", "ping", ..)@*
arguments: arguments for CTCP@*
@*
@item dcc acci@'on [usuario [fichero]]
@*
@@ -925,15 +1026,15 @@ acci@'on: 'send' (env@'io de archivo) @'o 'chat' (charla) @'o 'close' (cerrar ch
usuario: nombre de usuario a quien enviar el archivo o la charla@*
fichero: nombre del fichero (en la m@'aquina local)@*
@*
@item dehalfop pseudo [pseudo]
@item dehalfop [pseudo [pseudo]]
@*
elimina el estado de media operador de canal a/a los usuario(s)@*
@*
@item deop pseudo [pseudo]
@item deop [pseudo [pseudo]]
@*
elimina el estado de operador de canal a/a los usuario(s)@*
@*
@item devoice pseudo [pseudo]
@item devoice [pseudo [pseudo]]
@*
elimina la voz a/a los usuario(s)@*
@*
@@ -941,7 +1042,7 @@ elimina la voz a/a los usuario(s)@*
@*
cerrar el servidor@*
@*
@item halfop pseudo [pseudo]
@item halfop [pseudo [pseudo]]
@*
dar el estado de media operador de canal a/a los usuario(s)@*
@*
@@ -1017,7 +1118,7 @@ objetivo: servidor al que remitir la consulta@*
@*
@item me mensaje
@*
enviar una acci@'on ctcp al canal actual@*
enviar una acci@'on CTCP al canal actual@*
@*
mensaje: mensaje a enviar@*
@*
@@ -1032,7 +1133,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@'un mensaje al canal desde el exterior@*
n: ningĂşn 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@*
@@ -1068,8 +1169,8 @@ canal: nombre del canal@*
@*
cambiar el nombre de usuario actual@*
@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
-all: establece el nuevo nombre de usuario para todos los servidores conectados@*
nickname: nuevo nombre de usuario@*
@*
@item notice usuario texto
@*
@@ -1224,7 +1325,7 @@ da la informaci@'on de versi@'on del usuario o servidor (actual o especificado)@
servidor: nombre de servidor@*
usuario: usuario@*
@*
@item voice pseudo [pseudo]
@item voice [pseudo [pseudo]]
@*
da voz a/a los usuario(s)@*
@*
@@ -1248,12 +1349,12 @@ 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@'umero [destinatario]]
@item whowas usuario [,usuario [,usuario ...]] [nĂşmero [destinatario]]
@*
pedir informaci@'on sobre un usuario que ya no existe@*
@*
usuario: nombre de usuario a buscar@*
n@'umero: n@'umero de respuestas a devolver (b@'usqueda completa si el n@'umero es negativo)@*
nĂşmero: nĂşmero de respuestas a devolver (bĂşsqueda completa si el nĂşmero es negativo)@*
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
@*
@end table
@@ -1262,65 +1363,75 @@ Internal functions for keys:@*
@table @kbd
@item return
terminate line@*
terminar l@'inea@*
@item tab
complete word@*
completar palabra@*
@item backspace
delete previous char@*
borrar el car@'acter anterior@*
@item delete
delete next char@*
borrar el car@'acter siguiente@*
@item delete_end_line
delete until end of line@*
borrar hasta fin de l@'inea@*
@item delete_beginning_line
delete until beginning of line@*
borrar hasta principio de l@'inea@*
@item delete_line
delete entire line@*
borrar l@'inea entera@*
@item delete_previous_word
delete previous word@*
borrar la palabra anterior@*
@item delete_next_word
delete next word@*
borrar la palabra siguiente@*
@item clipboard_paste
paste current clipboard content@*
@item transpose_chars
transpose chars@*
@item home
go to beginning of line@*
ir al principio de l@'inea@*
@item end
go to end of line@*
ir al final de l@'inea@*
@item left
move one char left@*
mover un car@'acter a la izquierda@*
@item previous_word
move to previous word@*
mover a la palabra anterior@*
@item right
move one char right@*
mover un car@'acter a la derecha@*
@item next_word
move to next word@*
mover a la palabra siguiente@*
@item up
call previous command in history@*
llamar al comando anterior en el historial@*
@item up_global
call previous command in global history@*
@item down
call next command in history@*
llamar al comando siguiente en el historial@*
@item down_global
call next command in global history@*
@item page_up
scroll one page up@*
desplazarse una p@'agina hacia arriba@*
@item page_down
scroll one page down@*
desplazarse una p@'agina hacia abajo@*
@item infobar_clear
clear infobar@*
limpiar barra de informaci@'on@*
@item nick_page_up
scroll nicklist one page up@*
desplazar la lista de nicks una p@'agina hacia arriba@*
@item nick_page_down
scroll nicklist one page down@*
desplazar la lista de nicks una p@'agina hacia abajo@*
@item nick_beginning
display beginning of nicklist@*
mostrar el principio de la lista de nicks@*
@item nick_end
display end of nicklist@*
mostrar el final de la lista de nicks@*
@item refresh
refresh screen@*
recargar la pantalla@*
@item jump_smart
jump to buffer with activity@*
saltar al bĂşfer con actividad@*
@item jump_dcc
jump to DCC buffer@*
saltar al bĂşfer DCC@*
@item jump_last_buffer
jump to last buffer@*
@item jump_server
jump to server buffer@*
saltar al bĂşfer servidor@*
@item jump_next_server
jump to next server@*
saltar al servidor siguiente@*
@item hotlist_clear
clear hotlist@*
limpiar hotlist@*
@item grab_key
grab a key@*
@end table
+124 -13
View File
@@ -36,7 +36,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.4-cvs - 16 Juillet 2005
@subtitle Documentation pour WeeChat v0.1.5 - 24 Septembre 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -281,6 +281,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '[%H:%M:%S]'@*
@item look_color_nicks
Afficher les utilisateurs avec diff@'erentes couleurs@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item look_color_nicks_number
Nombre de couleurs @`a utiliser pour les couleurs des pseudos@*
Type: entier (valeurs: entre 1 et 10), valeur par d@'efaut: 10@*
@item look_color_actions
Afficher les actions avec diff@'erentes couleurs@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -344,6 +347,12 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
@item col_chat_prefix2
Couleur pour le caract@`ere du milieu du pr@'efixe@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@item col_chat_join
Couleur pour la fl@`eche du join (pr@'efixe)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_chat_part
Couleur pour la fl@`eche du part/quit (pr@'efixe)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
@item col_chat_nick
Couleur pour les noms d'utilisateurs dans les actions (fen@^etre de discussion)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
@@ -371,9 +380,12 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
@item col_status_data_msg
Couleur pour une fen@^etre avec de nouvelles infos (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_status_private
Couleur pour une fen@^etre avec un message priv@'e (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_status_highlight
Couleur pour une fen@^etre avec un highlight (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
@item col_status_data_other
Couleur pour une fen@^etre avec des nouvelles donn@'ees (pas des infos) (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@@ -437,6 +449,36 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
@item col_nick_self
Couleur pour le pseudo local@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@item col_nick_color1
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
@item col_nick_color2
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'magenta'@*
@item col_nick_color3
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'green'@*
@item col_nick_color4
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'brown'@*
@item col_nick_color5
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightblue'@*
@item col_nick_color6
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_nick_color7
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
@item col_nick_color8
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_color9
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_nick_color10
Couleur pour le pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
@item col_nick_private
Couleur pour l'autre pseudo dans la fen@^etre priv@'ee@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@@ -503,6 +545,9 @@ 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'@*
@item irc_notice_as_pv
Afficher les notices comme des messages priv@'es@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item irc_away_check
Intervalle entre deux v@'erifications des absences (en minutes, 0 = ne jemais v@'erifier)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 0@*
@@ -518,6 +563,9 @@ Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 5@*
@item irc_fifo_pipe
Cr@'eer un tube FIFO pour le contr@^ole @`a distance@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item irc_highlight
Liste des mots pour la notification (s@'epar@'es par des virgules, le comparaison ne tient pas compte de la casse)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item dcc_auto_accept_files
Accepte automatiquement les fichiers dcc entrants@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@@ -615,7 +663,7 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
D@'elai (en secondes) apr@`es ex@'ecution de la commande (exemple: donner du temps pour l'authentification)@*
Type: entier (valeurs: entre 0 et 5), valeur par d@'efaut: 0@*
@item server_autojoin
Liste des canaux (s@'epar@'es par des virgules) @`a rejoindre lorsque connect@'e au serveur@*
Liste des canaux (s@'epar@'es par des virgules) @`a rejoindre lorsque connect@'e au serveur (exemple: "#chan1,#chan2,#chan3 #key1,#key2")@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_autorejoin
Rejoindre automatiquement les canaux quand mis dehors@*
@@ -702,6 +750,9 @@ Ex@'ecuter la commande ou envoyer le message@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item Ctrl + fl@`eche haut / Ctrl + fl@`eche bas
Rappeler les derni@`eres commandes/messages dans l'historique global@*
@*
@item PageUp / PageDown
Afficher l'historique du tampon@*
@*
@@ -819,6 +870,19 @@ afficher l'aide sur les commandes@*
@*
commande: nom d'une commande WeeChat ou IRC@*
@*
@item ignore [masque [[type | commande] [canal [serveur]]]]
@*
ignorer des messages IRC et/ou des masques@*
@*
masque: pseudo ou masque @`a ignorer@*
type: type de message @`a ignorer (action, ctcp, dcc, pv)@*
commande: commande IRC@*
canal: nom du canal pour le ignore@*
serveur: nom du serveur pour le ignore@*
@*
Pour chaque param@`etre, '*' signifie tou(te)s.@*
Sans param@`etre, la commande /ignore liste les ignore d@'efinis.@*
@*
@item key [touche fonction/commande] [unbind touche] [functions] [reset -yes]
@*
associer/lib@'erer des touches@*
@@ -833,6 +897,7 @@ reset: restaur les touches aux valeurs par d@'efaut et supprime TOUTES les touch
liste/charge/d@'echarge des scripts Perl@*
@*
fichier: script Perl (fichier) @`a charger@*
@*
Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@*
@*
@item python [load fichier] | [autoload] | [reload] | [unload]
@@ -840,8 +905,17 @@ Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@*
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 ruby [load fichier] | [autoload] | [reload] | [unload]
@*
liste/charge/d@'echarge des scripts Ruby@*
@*
fichier: script Ruby (fichier) @`a charger@*
@*
Sans param@`etre, la commande /ruby liste tous les scripts Ruby charg@'es.@*
@*
@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@*
@@ -877,6 +951,20 @@ supprimer un alias@*
@*
nom_alias: nom de l'alias @`a supprimer@*
@*
@item unignore [nombre | [masque [[type | commande] [canal [serveur]]]]]
@*
supprimer le ignore des messages IRC et/ou des masques@*
@*
nombre: num@'ero de ignore @`a supprimer (le nombre est affich@'e sur la liste des ignore)@*
masque: pseudo ou masque @`a ignorer@*
type: type de message @`a ignorer (action, ctcp, dcc, pv)@*
commande: commande IRC@*
canal: nom du canal pour le ignore@*
serveur: nom du serveur pour le ignore@*
@*
Pour chaque param@`etre, '*' signifie tou(te)s.@*
Sans param@`etre, /ignore liste les ignore d@'efinis.@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
gestion des fen@^etres@*
@@ -897,6 +985,18 @@ trouver les informations sur l'administrateur du serveur@*
@*
cible: serveur@*
@*
@item ame message
@*
envoyer une action CTCP @`a tous les canaux de tous les serveurs connect@'es@*
@*
message: message @`a envoyer@*
@*
@item amsg texte
@*
envoyer un message @`a tous les canaux de tous les serveurs connect@'es@*
@*
texte: texte @`a envoyer@*
@*
@item away [-all] [message]
@*
basculer le statut absent@*
@@ -911,12 +1011,13 @@ bannit des pseudos ou masques@*
canal: nom du canal pour le bannissement@*
pseudo: pseudo ou masque pour le bannissement@*
@*
@item ctcp pseudo type
@item ctcp pseudo type [arguments]
@*
envoyer un message ctcp@*
envoyer un message CTCP (Client-To-Client Protocol)@*
@*
pseudo: utilisateur pour envoyer le ctcp@*
type: "action" ou "version"@*
pseudo: utilisateur @`a qui envoyer le CTCP@*
type: type de CTCP (exemples: "version", "ping", etc...)@*
arguments: arguments pour le CTCP@*
@*
@item dcc action [pseudo [fichier]]
@*
@@ -926,15 +1027,15 @@ action: 'send' (envoi de fichier) ou 'chat' (discussion) ou 'close' (fermeture d
pseudo: pseudo pour envoyer le fichier ou discuter@*
fichier: nom du fichier (sur la machine locale)@*
@*
@item dehalfop pseudo [pseudo]
@item dehalfop [pseudo [pseudo]]
@*
retire le statut de demi-op@'erateur du canal @`a/aux nick(s)@*
@*
@item deop pseudo [pseudo]
@item deop [pseudo [pseudo]]
@*
retire le statut d'op@'erateur du canal @`a/aux nick(s)@*
@*
@item devoice pseudo [pseudo]
@item devoice [pseudo [pseudo]]
@*
retire la voix du/des pseudo(s)@*
@*
@@ -942,7 +1043,7 @@ retire la voix du/des pseudo(s)@*
@*
arr@^eter le serveur@*
@*
@item halfop pseudo [pseudo]
@item halfop [pseudo [pseudo]]
@*
donner le statut de demi-op@'erateur @`a un/des utilisateur(s)@*
@*
@@ -1018,7 +1119,7 @@ cible: serveur pour faire suivre la requ@^ete@*
@*
@item me message
@*
envoyer une action ctcp au canal courant@*
envoyer une action CTCP au canal courant@*
@*
message: message @`a envoyer@*
@*
@@ -1225,7 +1326,7 @@ retourne la version de l'utilisateur ou du serveur (courant ou sp@'ecifi@'e)@*
serveur: nom du serveur@*
pseudo: utilisateur@*
@*
@item voice pseudo [pseudo]
@item voice [pseudo [pseudo]]
@*
donne la voix @`a/aux utilisateur(s)@*
@*
@@ -1280,6 +1381,10 @@ effacer la ligne enti@`ere@*
effacer le mot pr@'ec@'edent@*
@item delete_next_word
effacer le mot suivant@*
@item clipboard_paste
coller le contenu du presse-papier@*
@item transpose_chars
inverser les caract@`eres@*
@item home
aller au d@'ebut de la ligne@*
@item end
@@ -1294,8 +1399,12 @@ se d@'eplacer d'un caract@`ere @`a droite@*
se d@'eplacer au mot suivant@*
@item up
appeler la commande pr@'ec@'edente dans l'historique@*
@item up_global
appeler la commande pr@'ec@'edente dans l'historique global@*
@item down
appeler la commande suivante dans l'historique@*
@item down_global
appeler la commande suivante dans l'historique global@*
@item page_up
faire d@'efiler d'une page vers le haut@*
@item page_down
@@ -1316,6 +1425,8 @@ rafraichir l'@'ecran@*
sauter au tampon avec de l'activit@'e@*
@item jump_dcc
sauter au tampon DCC@*
@item jump_last_buffer
sauter au dernier tampon@*
@item jump_server
sauter au tampon du serveur@*
@item jump_next_server
+124 -13
View File
@@ -36,7 +36,7 @@
@title WeeChat - Guia do Utilizador
@subtitle Cliente de IRC rapido, leve e extencivel
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.4-cvs - 16 de Julho de 2005
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.5 - 24 de Setembro de 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -278,6 +278,9 @@ Type: string (any string), default value: '[%H:%M:%S]'@*
@item look_color_nicks
Display nick names with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item look_color_nicks_number
Number of colors to use for nicks colors@*
Type: integer (values: between 1 and 10), default value: 10@*
@item look_color_actions
Display actions with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -341,6 +344,12 @@ Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@item col_chat_prefix2
Color for middle char of prefix@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_chat_join
Color for join arrow (prefix)@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_chat_part
Color for part/quit arrow (prefix)@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_chat_nick
Color for nicks in actions (chat window)@*
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@@ -368,9 +377,12 @@ Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_status_data_msg
Color for window with new messages (status bar)@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_status_private
Color for window with private message (status bar)@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_status_highlight
Color for window with highlight (status bar)@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_status_data_other
Color for window with new data (not messages) (status bar)@*
Type: color (Curses or Gtk color), default value: 'default'@*
@@ -434,6 +446,36 @@ Type: color (Curses or Gtk color), default value: 'blue'@*
@item col_nick_self
Color for local nick@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_nick_color1
Color for nick@*
Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_nick_color2
Color for nick@*
Type: color (Curses or Gtk color), default value: 'magenta'@*
@item col_nick_color3
Color for nick@*
Type: color (Curses or Gtk color), default value: 'green'@*
@item col_nick_color4
Color for nick@*
Type: color (Curses or Gtk color), default value: 'brown'@*
@item col_nick_color5
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightblue'@*
@item col_nick_color6
Color for nick@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_nick_color7
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
@item col_nick_color8
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_color9
Color for nick@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_nick_color10
Color for nick@*
Type: color (Curses or Gtk color), default value: 'blue'@*
@item col_nick_private
Color for other nick in private window@*
Type: color (Curses or Gtk color), default value: 'default'@*
@@ -500,6 +542,9 @@ 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'@*
@item irc_notice_as_pv
Display notices as private messages@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item irc_away_check
Interval between two checks for away (in minutes, 0 = never check)@*
Type: integer (values: between 0 and 2147483647), default value: 0@*
@@ -515,6 +560,9 @@ Type: integer (values: between 0 and 2147483647), default value: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item irc_highlight
Comma separated list of words to highlight (case insensitive comparison)@*
Type: string (any string), default value: ''@*
@item dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@@ -612,7 +660,7 @@ Type: string (any string), default value: ''@*
Delay (in seconds) after command was executed (example: give some time for authentication)@*
Type: integer (values: between 0 and 5), default value: 0@*
@item server_autojoin
Comma separated list of channels to join when connected to server@*
Comma separated list of channels to join when connected to server (example: "#chan1,#chan2,#chan3 #key1,#key2")@*
Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
@@ -699,6 +747,9 @@ Executa o comando ou envia a mensagem@*
@item Seta para cima / Seta para baixo
Repetir os ultimos comandos/mensagens@*
@*
@item Ctrl + up arrow / Ctrl + down arrow
Call again last commands/messages in global history@*
@*
@item PageUp / PageDown
Navegar no hist@'orico da janela@*
@*
@@ -816,6 +867,19 @@ display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item ignore [mask [[type | command] [channel [server]]]]
@*
ignore IRC messages and/or hosts@*
@*
mask: nick or host mask to ignore@*
type: type of message to ignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for ignore@*
server: name of server for ignore@*
@*
For each argument, '*' means all.@*
Without argument, /ignore command lists all defined ignore.@*
@*
@item key [key function/command] [unbind key] [functions] [reset -yes]
@*
bind/unbind keys@*
@@ -830,6 +894,7 @@ reset: restore bindings to the default values and delete ALL personal binding (u
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item python [load filename] | [autoload] | [reload] | [unload]
@@ -837,8 +902,17 @@ Without argument, /perl command lists all loaded Perl scripts.@*
list/load/unload Python scripts@*
@*
filename: Python script (file) to load@*
@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item ruby [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Ruby scripts@*
@*
filename: Ruby script (file) to load@*
@*
Without argument, /ruby command lists all loaded Ruby scripts.@*
@*
@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@*
@@ -874,6 +948,20 @@ remove an alias@*
@*
alias_name: name of alias to remove@*
@*
@item unignore [number | [mask [[type | command] [channel [server]]]]]
@*
unignore IRC messages and/or hosts@*
@*
number: # of ignore to unignore (number is displayed by list of ignore)@*
mask: nick or host mask to unignore@*
type: type of message to unignore (action, ctcp, dcc, pv)@*
command: IRC command@*
channel: name of channel for unignore@*
server: name of server for unignore@*
@*
For each argument, '*' means all.@*
Without argument, /unignore command lists all defined ignore.@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
manage windows@*
@@ -894,6 +982,18 @@ find information about the administrator of the server@*
@*
target: server@*
@*
@item ame message
@*
send a CTCP action to all channels of all connected servers@*
@*
message: message to send@*
@*
@item amsg text
@*
send message to all channels of all connected servers@*
@*
text: text to send@*
@*
@item away [-all] [message]
@*
toggle away status@*
@@ -908,12 +1008,13 @@ bans nicks or hosts@*
channel: channel for ban@*
nickname: user or host to ban@*
@*
@item ctcp nickname type
@item ctcp nickname type [arguments]
@*
send a ctcp message@*
send a CTCP message (Client-To-Client Protocol)@*
@*
nickname: user to send ctcp to@*
type: "action" or "version"@*
nickname: user to send CTCP to@*
type: CTCP type (examples: "version", "ping", ..)@*
arguments: arguments for CTCP@*
@*
@item dcc action [nickname [file]]
@*
@@ -923,15 +1024,15 @@ action: 'send' (file) or 'chat' or 'close' (chat)@*
nickname: nickname to send file or chat@*
file: filename (on local host)@*
@*
@item dehalfop nickname [nickname]
@item dehalfop [nickname [nickname]]
@*
removes half channel operator status from nickname(s)@*
@*
@item deop nickname [nickname]
@item deop [nickname [nickname]]
@*
removes channel operator status from nickname(s)@*
@*
@item devoice nickname [nickname]
@item devoice [nickname [nickname]]
@*
removes voice from nickname(s)@*
@*
@@ -939,7 +1040,7 @@ removes voice from nickname(s)@*
@*
shutdown the server@*
@*
@item halfop nickname [nickname]
@item halfop [nickname [nickname]]
@*
gives half channel operator status to nickname(s)@*
@*
@@ -1015,7 +1116,7 @@ target: server for forwarding request@*
@*
@item me message
@*
send a ctcp action to the current channel@*
send a CTCP action to the current channel@*
@*
message: message to send@*
@*
@@ -1222,7 +1323,7 @@ gives the version info of nick or server (current or specified)@*
server: server name@*
nickname: nickname@*
@*
@item voice nickname [nickname]
@item voice [nickname [nickname]]
@*
gives voice to nickname(s)@*
@*
@@ -1277,6 +1378,10 @@ delete entire line@*
delete previous word@*
@item delete_next_word
delete next word@*
@item clipboard_paste
paste current clipboard content@*
@item transpose_chars
transpose chars@*
@item home
go to beginning of line@*
@item end
@@ -1291,8 +1396,12 @@ move one char right@*
move to next word@*
@item up
call previous command in history@*
@item up_global
call previous command in global history@*
@item down
call next command in history@*
@item down_global
call next command in global history@*
@item page_up
scroll one page up@*
@item page_down
@@ -1313,6 +1422,8 @@ refresh screen@*
jump to buffer with activity@*
@item jump_dcc
jump to DCC buffer@*
@item jump_last_buffer
jump to last buffer@*
@item jump_server
jump to server buffer@*
@item jump_next_server
+3
View File
@@ -6,11 +6,14 @@
./src/irc/irc-send.c
./src/irc/irc-recv.c
./src/irc/irc-dcc.c
./src/irc/irc-ignore.c
./src/irc/irc.h
./src/plugins/perl/wee-perl.c
./src/plugins/perl/wee-perl.h
./src/plugins/python/wee-python.c
./src/plugins/python/wee-python.h
./src/plugins/ruby/wee-ruby.c
./src/plugins/ruby/wee-ruby.h
./src/plugins/plugins.c
./src/plugins/plugins.h
./src/gui/curses/gui-input.c
+4389
View File
File diff suppressed because it is too large Load Diff
+1099 -888
View File
File diff suppressed because it is too large Load Diff
+1124 -889
View File
File diff suppressed because it is too large Load Diff
+1175 -976
View File
File diff suppressed because it is too large Load Diff
+382 -58
View File
@@ -72,6 +72,16 @@ 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 },
{ "ignore", N_("ignore IRC messages and/or hosts"),
N_("[mask [[type | command] [channel [server]]]]"),
N_(" mask: nick or host mask to ignore\n"
" type: type of message to ignore (action, ctcp, dcc, pv)\n"
"command: IRC command\n"
"channel: name of channel for ignore\n"
" server: name of server for ignore\n\n"
"For each argument, '*' means all.\n"
"Without argument, /ignore command lists all defined ignore."),
0, 4, weechat_cmd_ignore, 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"
@@ -81,14 +91,19 @@ t_weechat_command weechat_commands[] =
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"
N_("filename: Perl script (file) to load\n\n"
"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"
N_("filename: Python script (file) to load\n\n"
"Without argument, /python command lists all loaded Python scripts."),
0, 2, weechat_cmd_python, NULL },
{ "ruby", N_("list/load/unload Ruby scripts"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: Ruby script (file) to load\n\n"
"Without argument, /ruby command lists all loaded Ruby scripts."),
0, 2, weechat_cmd_ruby, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
@@ -116,6 +131,17 @@ t_weechat_command weechat_commands[] =
{ "unalias", N_("remove an alias"),
N_("alias_name"), N_("alias_name: name of alias to remove"),
1, 1, NULL, weechat_cmd_unalias },
{ "unignore", N_("unignore IRC messages and/or hosts"),
N_("[number | [mask [[type | command] [channel [server]]]]]"),
N_(" number: # of ignore to unignore (number is displayed by list of ignore)\n"
" mask: nick or host mask to unignore\n"
" type: type of message to unignore (action, ctcp, dcc, pv)\n"
"command: IRC command\n"
"channel: name of channel for unignore\n"
" server: name of server for unignore\n\n"
"For each argument, '*' means all.\n"
"Without argument, /unignore command lists all defined ignore."),
0, 4, weechat_cmd_unignore, NULL },
{ "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"
@@ -186,7 +212,7 @@ alias_search (char *alias_name)
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
{
if (strcasecmp (alias_name, ptr_alias->alias_name) == 0)
if (ascii_strcasecmp (alias_name, ptr_alias->alias_name) == 0)
return ptr_alias;
}
return NULL;
@@ -203,7 +229,7 @@ alias_find_pos (char *alias_name)
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
{
if (strcasecmp (alias_name, ptr_alias->alias_name) < 0)
if (ascii_strcasecmp (alias_name, ptr_alias->alias_name) < 0)
return ptr_alias;
}
return NULL;
@@ -479,7 +505,7 @@ exec_weechat_command (t_irc_server *server, char *string)
for (i = 0; weechat_commands[i].command_name; i++)
{
if (strcasecmp (weechat_commands[i].command_name, command + 1) == 0)
if (ascii_strcasecmp (weechat_commands[i].command_name, command + 1) == 0)
{
if ((argc < weechat_commands[i].min_arg)
|| (argc > weechat_commands[i].max_arg))
@@ -539,7 +565,7 @@ exec_weechat_command (t_irc_server *server, char *string)
}
for (i = 0; irc_commands[i].command_name; i++)
{
if ((strcasecmp (irc_commands[i].command_name, command + 1) == 0) &&
if ((ascii_strcasecmp (irc_commands[i].command_name, command + 1) == 0) &&
((irc_commands[i].cmd_function_args) ||
(irc_commands[i].cmd_function_1arg)))
{
@@ -610,7 +636,7 @@ exec_weechat_command (t_irc_server *server, char *string)
for (ptr_alias = weechat_alias; ptr_alias;
ptr_alias = ptr_alias->next_alias)
{
if (strcasecmp (ptr_alias->alias_name, command + 1) == 0)
if (ascii_strcasecmp (ptr_alias->alias_name, command + 1) == 0)
{
if (ptr_args)
{
@@ -869,6 +895,11 @@ weechat_cmd_buffer_display_info (t_gui_buffer *buffer)
"%s", SERVER(buffer)->name);
gui_printf (NULL, ")\n");
}
else
{
gui_printf (NULL, _("not connected"));
gui_printf (NULL, "\n");
}
}
/*
@@ -885,7 +916,7 @@ weechat_cmd_buffer (int argc, char **argv)
char *error;
int target_buffer;
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
{
/* list opened buffers */
@@ -903,7 +934,7 @@ weechat_cmd_buffer (int argc, char **argv)
}
else
{
if (strcasecmp (argv[0], "move") == 0)
if (ascii_strcasecmp (argv[0], "move") == 0)
{
/* move buffer to another number in the list */
@@ -938,7 +969,7 @@ weechat_cmd_buffer (int argc, char **argv)
return -1;
}
}
else if (strcasecmp (argv[0], "close") == 0)
else if (ascii_strcasecmp (argv[0], "close") == 0)
{
/* close buffer (server or channel/private) */
@@ -990,7 +1021,7 @@ weechat_cmd_buffer (int argc, char **argv)
}
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
else if (strcasecmp (argv[0], "notify") == 0)
else if (ascii_strcasecmp (argv[0], "notify") == 0)
{
/* set notify level for buffer */
@@ -1109,7 +1140,7 @@ weechat_cmd_clear (int argc, char **argv)
{
if (argc == 1)
{
if (strcasecmp (argv[0], "-all") == 0)
if (ascii_strcasecmp (argv[0], "-all") == 0)
gui_buffer_clear_all ();
else
{
@@ -1193,7 +1224,7 @@ weechat_cmd_debug (int argc, char **argv)
return -1;
}
if (strcasecmp (argv[0], "dump") == 0)
if (ascii_strcasecmp (argv[0], "dump") == 0)
{
wee_dump (0);
}
@@ -1289,7 +1320,7 @@ weechat_cmd_help (int argc, char **argv)
{
for (i = 0; weechat_commands[i].command_name; i++)
{
if (strcasecmp (weechat_commands[i].command_name, argv[0]) == 0)
if (ascii_strcasecmp (weechat_commands[i].command_name, argv[0]) == 0)
{
gui_printf (NULL, "\n");
gui_printf (NULL, "[w]");
@@ -1314,7 +1345,7 @@ weechat_cmd_help (int argc, char **argv)
}
for (i = 0; irc_commands[i].command_name; i++)
{
if ((strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
if ((ascii_strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
&& (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg))
{
gui_printf (NULL, "\n");
@@ -1346,6 +1377,93 @@ weechat_cmd_help (int argc, char **argv)
return 0;
}
/*
* weechat_cmd_ignore_display: display an ignore entry
*/
void
weechat_cmd_ignore_display (char *text, t_irc_ignore *ptr_ignore)
{
if (text)
gui_printf (NULL, "%s ", text);
gui_printf (NULL, _("on"));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, " %s", ptr_ignore->server_name);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "/");
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%s", ptr_ignore->channel_name);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, ":");
gui_printf (NULL, _(" ignoring "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%s", ptr_ignore->type);
gui_printf (NULL, _(" from "));
gui_printf_color (NULL, COLOR_WIN_CHAT_HOST, "%s\n", ptr_ignore->mask);
}
/*
* weechat_cmd_ignore: ignore IRC commands and/or hosts
*/
int
weechat_cmd_ignore (int argc, char **argv)
{
t_irc_ignore *ptr_ignore;
int i;
ptr_ignore = NULL;
switch (argc)
{
case 0:
/* List all ignore */
if (irc_ignore)
{
gui_printf (NULL, "\n");
gui_printf (NULL, _("List of ignore:\n"));
i = 0;
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
i++;
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "[");
gui_printf (NULL, "%d", i);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "] ");
weechat_cmd_ignore_display (NULL, ptr_ignore);
}
}
else
{
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf (NULL, _("No ignore defined.\n"));
}
return 0;
break;
case 1:
ptr_ignore = ignore_add (argv[0], "*", "*",
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 2:
ptr_ignore = ignore_add (argv[0], argv[1], "*",
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 3:
ptr_ignore = ignore_add (argv[0], argv[1], argv[2],
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 4:
ptr_ignore = ignore_add (argv[0], argv[1], argv[2], argv[3]);
break;
}
if (ptr_ignore)
{
gui_printf (NULL, "\n");
weechat_cmd_ignore_display (_("New ignore:"), ptr_ignore);
return 0;
}
else
return -1;
}
/*
* weechat_cmd_key_display: display a key binding
*/
@@ -1397,7 +1515,7 @@ weechat_cmd_key (char *arguments)
weechat_cmd_key_display (ptr_key, 0);
}
}
else if (strncasecmp (arguments, "unbind ", 7) == 0)
else if (ascii_strncasecmp (arguments, "unbind ", 7) == 0)
{
arguments += 7;
while (arguments[0] == ' ')
@@ -1413,7 +1531,7 @@ weechat_cmd_key (char *arguments)
return -1;
}
}
else if (strcasecmp (arguments, "functions") == 0)
else if (ascii_strcasecmp (arguments, "functions") == 0)
{
gui_printf (NULL, "\n");
gui_printf (NULL, _("Internal key functions:\n"));
@@ -1426,12 +1544,12 @@ weechat_cmd_key (char *arguments)
i++;
}
}
else if (strncasecmp (arguments, "reset", 5) == 0)
else if (ascii_strncasecmp (arguments, "reset", 5) == 0)
{
arguments += 5;
while (arguments[0] == ' ')
arguments++;
if (strcasecmp (arguments, "-yes") == 0)
if (ascii_strcasecmp (arguments, "-yes") == 0)
{
gui_key_free_all ();
gui_key_init ();
@@ -1486,7 +1604,7 @@ weechat_cmd_key (char *arguments)
int
weechat_cmd_perl (int argc, char **argv)
{
#ifdef PLUGIN_PERL
#ifdef PLUGIN_PERL
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
@@ -1565,18 +1683,18 @@ weechat_cmd_perl (int argc, char **argv)
break;
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
if (ascii_strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
else if (strcasecmp (argv[0], "reload") == 0)
else if (ascii_strcasecmp (argv[0], "reload") == 0)
{
plugin_unload (PLUGIN_TYPE_PERL, NULL);
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
else if (ascii_strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PERL, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
if (ascii_strcasecmp (argv[0], "load") == 0)
{
/* load Perl script */
if (strstr(argv[1], DIR_SEPARATOR))
@@ -1608,7 +1726,7 @@ weechat_cmd_perl (int argc, char **argv)
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "perl");
}
#else
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Perl support.\n"
@@ -1617,7 +1735,7 @@ weechat_cmd_perl (int argc, char **argv)
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGIN_PERL */
#endif /* PLUGIN_PERL */
return 0;
}
@@ -1629,7 +1747,7 @@ weechat_cmd_perl (int argc, char **argv)
int
weechat_cmd_python (int argc, char **argv)
{
#ifdef PLUGIN_PYTHON
#ifdef PLUGIN_PYTHON
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
@@ -1708,18 +1826,18 @@ weechat_cmd_python (int argc, char **argv)
break;
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
if (ascii_strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
else if (strcasecmp (argv[0], "reload") == 0)
else if (ascii_strcasecmp (argv[0], "reload") == 0)
{
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
else if (ascii_strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
if (ascii_strcasecmp (argv[0], "load") == 0)
{
/* load Python script */
if (strstr(argv[1], DIR_SEPARATOR))
@@ -1751,7 +1869,7 @@ weechat_cmd_python (int argc, char **argv)
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "python");
}
#else
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Python support.\n"
@@ -1760,7 +1878,150 @@ weechat_cmd_python (int argc, char **argv)
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGIN_PYTHON */
#endif /* PLUGIN_PYTHON */
return 0;
}
/*
* weechat_cmd_ruby: list/load/unload Ruby scripts
*/
int
weechat_cmd_ruby (int argc, char **argv)
{
#ifdef PLUGIN_RUBY
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
char *path_script;
switch (argc)
{
case 0:
/* list registered Ruby scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered %s scripts:\n"), "Ruby");
if (ruby_scripts)
{
for (ptr_plugin_script = ruby_scripts; ptr_plugin_script;
ptr_plugin_script = ptr_plugin_script->next_script)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, " %s v%s%s%s\n",
ptr_plugin_script->name,
ptr_plugin_script->version,
(ptr_plugin_script->description[0]) ? " - " : "",
ptr_plugin_script->description);
}
}
else
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Ruby message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s message handlers:\n"), "Ruby");
handler_found = 0;
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_RUBY)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Ruby",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Ruby command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s command handlers:\n"), "Ruby");
handler_found = 0;
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
{
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_RUBY)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Ruby",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
break;
case 1:
if (ascii_strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_RUBY, "ruby/autoload");
else if (ascii_strcasecmp (argv[0], "reload") == 0)
{
plugin_unload (PLUGIN_TYPE_RUBY, NULL);
plugin_auto_load (PLUGIN_TYPE_RUBY, "ruby/autoload");
}
else if (ascii_strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_RUBY, NULL);
break;
case 2:
if (ascii_strcasecmp (argv[0], "load") == 0)
{
/* load Ruby script */
if (strstr(argv[1], DIR_SEPARATOR))
path_script = NULL;
else
{
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, "ruby",
DIR_SEPARATOR, argv[1]);
}
plugin_load (PLUGIN_TYPE_RUBY,
(path_script) ? path_script : argv[1]);
if (path_script)
free (path_script);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "ruby");
}
break;
default:
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "ruby");
}
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Ruby support.\n"
"Please rebuild WeeChat with "
"\"--enable-ruby\" option for ./configure script\n"));
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGIN_RUBY */
return 0;
}
@@ -1819,7 +2080,7 @@ weechat_cmd_server (int argc, char **argv)
}
else
{
if (strcasecmp (argv[0], "del") == 0)
if (ascii_strcasecmp (argv[0], "del") == 0)
{
if (argc < 2)
{
@@ -1919,15 +2180,15 @@ weechat_cmd_server (int argc, char **argv)
{
if (argv[i][0] == '-')
{
if (strcasecmp (argv[i], "-auto") == 0)
if (ascii_strcasecmp (argv[i], "-auto") == 0)
server.autoconnect = 1;
if (strcasecmp (argv[i], "-noauto") == 0)
if (ascii_strcasecmp (argv[i], "-noauto") == 0)
server.autoconnect = 0;
if (strcasecmp (argv[i], "-ipv6") == 0)
if (ascii_strcasecmp (argv[i], "-ipv6") == 0)
server.ipv6 = 1;
if (strcasecmp (argv[i], "-ssl") == 0)
if (ascii_strcasecmp (argv[i], "-ssl") == 0)
server.ssl = 1;
if (strcasecmp (argv[i], "-pwd") == 0)
if (ascii_strcasecmp (argv[i], "-pwd") == 0)
{
if (i == (argc - 1))
{
@@ -1940,7 +2201,7 @@ weechat_cmd_server (int argc, char **argv)
}
server.password = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-nicks") == 0)
if (ascii_strcasecmp (argv[i], "-nicks") == 0)
{
if (i >= (argc - 3))
{
@@ -1955,7 +2216,7 @@ weechat_cmd_server (int argc, char **argv)
server.nick2 = strdup (argv[++i]);
server.nick3 = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-username") == 0)
if (ascii_strcasecmp (argv[i], "-username") == 0)
{
if (i == (argc - 1))
{
@@ -1968,7 +2229,7 @@ weechat_cmd_server (int argc, char **argv)
}
server.username = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-realname") == 0)
if (ascii_strcasecmp (argv[i], "-realname") == 0)
{
if (i == (argc - 1))
{
@@ -1981,7 +2242,7 @@ weechat_cmd_server (int argc, char **argv)
}
server.realname = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-command") == 0)
if (ascii_strcasecmp (argv[i], "-command") == 0)
{
if (i == (argc - 1))
{
@@ -1994,7 +2255,7 @@ weechat_cmd_server (int argc, char **argv)
}
server.command = strdup (argv[++i]);
}
if (strcasecmp (argv[i], "-autojoin") == 0)
if (ascii_strcasecmp (argv[i], "-autojoin") == 0)
{
if (i == (argc - 1))
{
@@ -2262,7 +2523,7 @@ weechat_cmd_set (char *arguments)
{
section_displayed = 0;
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
@@ -2371,6 +2632,69 @@ weechat_cmd_unalias (char *arguments)
return 0;
}
/*
* weechat_cmd_unignore: unignore IRC commands and/or hosts
*/
int
weechat_cmd_unignore (int argc, char **argv)
{
char *error;
int number, ret;
ret = 0;
switch (argc)
{
case 0:
/* List all ignore */
weechat_cmd_ignore (argc, argv);
return 0;
break;
case 1:
error = NULL;
number = strtol (argv[0], &error, 10);
if ((error) && (error[0] == '\0'))
ret = ignore_search_free_by_number (number);
else
ret = ignore_search_free (argv[0], "*", "*",
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 2:
ret = ignore_search_free (argv[0], argv[1], "*",
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 3:
ret = ignore_search_free (argv[0], argv[1], argv[2],
(SERVER(gui_current_window->buffer)) ?
SERVER(gui_current_window->buffer)->name : "*");
break;
case 4:
ret = ignore_search_free (argv[0], argv[1], argv[2], argv[3]);
break;
}
if (ret)
{
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%d ", ret);
if (ret > 1)
gui_printf (NULL, _("ignore were removed.\n"));
else
gui_printf (NULL, _("ignore was removed.\n"));
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s no ignore found\n"),
WEECHAT_ERROR);
return -1;
}
return 0;
}
/*
* weechat_cmd_window: manage windows
*/
@@ -2381,7 +2705,7 @@ weechat_cmd_window (int argc, char **argv)
t_gui_window *ptr_win;
int i;
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
{
/* list opened windows */
@@ -2410,29 +2734,29 @@ weechat_cmd_window (int argc, char **argv)
}
else
{
if (strcasecmp (argv[0], "splith") == 0)
if (ascii_strcasecmp (argv[0], "splith") == 0)
{
/* split window horizontally */
gui_window_split_horiz (gui_current_window);
}
else if (strcasecmp (argv[0], "splitv") == 0)
else if (ascii_strcasecmp (argv[0], "splitv") == 0)
{
/* split window vertically */
gui_window_split_vertic (gui_current_window);
}
else if (strcasecmp (argv[0], "merge") == 0)
else if (ascii_strcasecmp (argv[0], "merge") == 0)
{
if (argc >= 2)
{
if (strcasecmp (argv[1], "down") == 0)
if (ascii_strcasecmp (argv[1], "down") == 0)
gui_window_merge_down (gui_current_window);
else if (strcasecmp (argv[1], "up") == 0)
else if (ascii_strcasecmp (argv[1], "up") == 0)
gui_window_merge_up (gui_current_window);
else if (strcasecmp (argv[1], "left") == 0)
else if (ascii_strcasecmp (argv[1], "left") == 0)
gui_window_merge_left (gui_current_window);
else if (strcasecmp (argv[1], "right") == 0)
else if (ascii_strcasecmp (argv[1], "right") == 0)
gui_window_merge_right (gui_current_window);
else if (strcasecmp (argv[1], "all") == 0)
else if (ascii_strcasecmp (argv[1], "all") == 0)
gui_window_merge_all (gui_current_window);
else
{
@@ -2446,10 +2770,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 if (ascii_strcasecmp (argv[0], "-1") == 0)
gui_switch_to_previous_window (gui_current_window);
else if (ascii_strcasecmp (argv[0], "+1") == 0)
gui_switch_to_next_window (gui_current_window);
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
+4
View File
@@ -69,13 +69,17 @@ 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 void weechat_cmd_ignore_display (char *, t_irc_ignore *);
extern int weechat_cmd_ignore (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_ruby (int, char **);
extern int weechat_cmd_save (int, char **);
extern int weechat_cmd_server (int, char **);
extern int weechat_cmd_set (char *);
extern int weechat_cmd_unalias (char *);
extern int weechat_cmd_unignore (int, char **);
extern int weechat_cmd_unset (char *);
extern int weechat_cmd_window (int, char **);
+167 -70
View File
@@ -102,6 +102,7 @@ completion_build_list (t_completion *completion, void *channel)
int i, j;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
char *pos, option_name[256], *string;
t_weechat_alias *ptr_alias;
t_config_option *option;
@@ -111,13 +112,13 @@ completion_build_list (t_completion *completion, void *channel)
/* WeeChat internal commands */
/* no completion for some commands */
if ((strcasecmp (completion->base_command, "server") == 0)
|| (strcasecmp (completion->base_command, "save") == 0))
if ((ascii_strcasecmp (completion->base_command, "server") == 0)
|| (ascii_strcasecmp (completion->base_command, "save") == 0))
{
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "alias") == 0)
if ((ascii_strcasecmp (completion->base_command, "alias") == 0)
&& (completion->base_command_arg == 1))
{
for (ptr_list = index_commands; ptr_list; ptr_list = ptr_list->next_weelist)
@@ -128,7 +129,7 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if ((strcasecmp (completion->base_command, "buffer") == 0)
if ((ascii_strcasecmp (completion->base_command, "buffer") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -145,7 +146,7 @@ completion_build_list (t_completion *completion, void *channel)
"notify");
return;
}
if ((strcasecmp (completion->base_command, "clear") == 0)
if ((ascii_strcasecmp (completion->base_command, "clear") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -153,8 +154,8 @@ completion_build_list (t_completion *completion, void *channel)
"-all");
return;
}
if ((strcasecmp (completion->base_command, "connect") == 0)
|| (strcasecmp (completion->base_command, "disconnect") == 0))
if ((ascii_strcasecmp (completion->base_command, "connect") == 0)
|| (ascii_strcasecmp (completion->base_command, "disconnect") == 0))
{
if (completion->base_command_arg == 1)
{
@@ -173,7 +174,7 @@ completion_build_list (t_completion *completion, void *channel)
return;
}
}
if (strcasecmp (completion->base_command, "debug") == 0)
if (ascii_strcasecmp (completion->base_command, "debug") == 0)
{
if (completion->base_command_arg == 1)
weelist_add (&completion->completion_list,
@@ -183,7 +184,7 @@ completion_build_list (t_completion *completion, void *channel)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "help") == 0)
if ((ascii_strcasecmp (completion->base_command, "help") == 0)
&& (completion->base_command_arg == 1))
{
for (i = 0; weechat_commands[i].command_name; i++)
@@ -201,22 +202,118 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if ((strcasecmp (completion->base_command, "key") == 0)
&& (completion->base_command_arg == 1))
if (ascii_strcasecmp (completion->base_command, "ignore") == 0)
{
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;
/* arg 1: nicks of current channel and "*" */
if (completion->base_command_arg == 1)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"*");
if (channel)
{
if (((t_irc_channel *)channel)->type == CHAT_CHANNEL)
{
for (ptr_nick = ((t_irc_channel *)channel)->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_nick->nick);
}
}
if (((t_irc_channel *)channel)->type == CHAT_PRIVATE)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)channel)->name);
}
}
return;
}
/* arg 2: type / command and "*" */
if (completion->base_command_arg == 2)
{
weelist_add(&completion->completion_list,
&completion->last_completion,
"*");
i = 0;
while (ignore_types[i])
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ignore_types[i]);
i++;
}
i = 0;
while (irc_commands[i].command_name)
{
if (irc_commands[i].recv_function)
weelist_add(&completion->completion_list,
&completion->last_completion,
irc_commands[i].command_name);
i++;
}
return;
}
/* arg 3: channel and "*" */
if (completion->base_command_arg == 3)
{
weelist_add(&completion->completion_list,
&completion->last_completion,
"*");
if (((t_irc_channel *)channel)->type == CHAT_CHANNEL)
weelist_add(&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)channel)->name);
return;
}
/* arg 4: server */
if (completion->base_command_arg == 4)
{
weelist_add(&completion->completion_list,
&completion->last_completion,
"*");
if (SERVER(gui_current_window->buffer))
weelist_add(&completion->completion_list,
&completion->last_completion,
SERVER(gui_current_window->buffer)->name);
return;
}
}
if (((strcasecmp (completion->base_command, "perl") == 0)
|| (strcasecmp (completion->base_command, "python") == 0))
if (ascii_strcasecmp (completion->base_command, "key") == 0)
{
if (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 (completion->base_command_arg == 2)
{
i = 0;
while (gui_key_functions[i].function_name)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
gui_key_functions[i].function_name);
i++;
}
return;
}
}
if (((ascii_strcasecmp (completion->base_command, "perl") == 0)
|| (ascii_strcasecmp (completion->base_command, "python") == 0))
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -233,14 +330,14 @@ completion_build_list (t_completion *completion, void *channel)
"unload");
return;
}
if (strcasecmp (completion->base_command, "set") == 0)
if (ascii_strcasecmp (completion->base_command, "set") == 0)
{
if (completion->base_command_arg == 1)
{
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
@@ -326,7 +423,7 @@ completion_build_list (t_completion *completion, void *channel)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "unalias") == 0)
if ((ascii_strcasecmp (completion->base_command, "unalias") == 0)
&& (completion->base_command_arg == 1))
{
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
@@ -337,7 +434,7 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if (strcasecmp (completion->base_command, "window") == 0)
if (ascii_strcasecmp (completion->base_command, "window") == 0)
{
if (completion->base_command_arg == 1)
{
@@ -383,33 +480,33 @@ completion_build_list (t_completion *completion, void *channel)
/* IRC commands */
/* no completion for some commands */
if ((strcasecmp (completion->base_command, "admin") == 0)
|| (strcasecmp (completion->base_command, "die") == 0)
|| (strcasecmp (completion->base_command, "info") == 0)
|| (strcasecmp (completion->base_command, "join") == 0)
|| (strcasecmp (completion->base_command, "links") == 0)
|| (strcasecmp (completion->base_command, "list") == 0)
|| (strcasecmp (completion->base_command, "lusers") == 0)
|| (strcasecmp (completion->base_command, "motd") == 0)
|| (strcasecmp (completion->base_command, "oper") == 0)
|| (strcasecmp (completion->base_command, "rehash") == 0)
|| (strcasecmp (completion->base_command, "restart") == 0)
|| (strcasecmp (completion->base_command, "service") == 0)
|| (strcasecmp (completion->base_command, "servlist") == 0)
|| (strcasecmp (completion->base_command, "squery") == 0)
|| (strcasecmp (completion->base_command, "squit") == 0)
|| (strcasecmp (completion->base_command, "stats") == 0)
|| (strcasecmp (completion->base_command, "summon") == 0)
|| (strcasecmp (completion->base_command, "time") == 0)
|| (strcasecmp (completion->base_command, "trace") == 0)
|| (strcasecmp (completion->base_command, "users") == 0)
|| (strcasecmp (completion->base_command, "wallops") == 0)
|| (strcasecmp (completion->base_command, "who") == 0))
if ((ascii_strcasecmp (completion->base_command, "admin") == 0)
|| (ascii_strcasecmp (completion->base_command, "die") == 0)
|| (ascii_strcasecmp (completion->base_command, "info") == 0)
|| (ascii_strcasecmp (completion->base_command, "join") == 0)
|| (ascii_strcasecmp (completion->base_command, "links") == 0)
|| (ascii_strcasecmp (completion->base_command, "list") == 0)
|| (ascii_strcasecmp (completion->base_command, "lusers") == 0)
|| (ascii_strcasecmp (completion->base_command, "motd") == 0)
|| (ascii_strcasecmp (completion->base_command, "oper") == 0)
|| (ascii_strcasecmp (completion->base_command, "rehash") == 0)
|| (ascii_strcasecmp (completion->base_command, "restart") == 0)
|| (ascii_strcasecmp (completion->base_command, "service") == 0)
|| (ascii_strcasecmp (completion->base_command, "servlist") == 0)
|| (ascii_strcasecmp (completion->base_command, "squery") == 0)
|| (ascii_strcasecmp (completion->base_command, "squit") == 0)
|| (ascii_strcasecmp (completion->base_command, "stats") == 0)
|| (ascii_strcasecmp (completion->base_command, "summon") == 0)
|| (ascii_strcasecmp (completion->base_command, "time") == 0)
|| (ascii_strcasecmp (completion->base_command, "trace") == 0)
|| (ascii_strcasecmp (completion->base_command, "users") == 0)
|| (ascii_strcasecmp (completion->base_command, "wallops") == 0)
|| (ascii_strcasecmp (completion->base_command, "who") == 0))
{
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "away") == 0)
if ((ascii_strcasecmp (completion->base_command, "away") == 0)
&& (completion->base_command_arg == 1))
{
if (cfg_irc_default_msg_away && cfg_irc_default_msg_away[0])
@@ -418,7 +515,7 @@ completion_build_list (t_completion *completion, void *channel)
cfg_irc_default_msg_away);
return;
}
if ((strcasecmp (completion->base_command, "ctcp") == 0)
if ((ascii_strcasecmp (completion->base_command, "ctcp") == 0)
&& (completion->base_command_arg == 2))
{
weelist_add (&completion->completion_list,
@@ -432,7 +529,7 @@ completion_build_list (t_completion *completion, void *channel)
"version");
return;
}
if ((strcasecmp (completion->base_command, "dcc") == 0)
if ((ascii_strcasecmp (completion->base_command, "dcc") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -446,7 +543,7 @@ completion_build_list (t_completion *completion, void *channel)
"close");
return;
}
if (strcasecmp (completion->base_command, "invite") == 0)
if (ascii_strcasecmp (completion->base_command, "invite") == 0)
{
/* arg1: nickname */
if (completion->base_command_arg == 1)
@@ -472,30 +569,30 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if (strcasecmp (completion->base_command, "kick") == 0)
if (ascii_strcasecmp (completion->base_command, "kick") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "kill") == 0)
if (ascii_strcasecmp (completion->base_command, "kill") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "me") == 0)
if (ascii_strcasecmp (completion->base_command, "me") == 0)
{
completion->context = COMPLETION_NICK;
return;
}
if (strcasecmp (completion->base_command, "notice") == 0)
if (ascii_strcasecmp (completion->base_command, "notice") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "part") == 0)
if ((ascii_strcasecmp (completion->base_command, "part") == 0)
&& (completion->base_command_arg == 1))
{
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
@@ -504,13 +601,13 @@ completion_build_list (t_completion *completion, void *channel)
cfg_irc_default_msg_part);
return;
}
if (strcasecmp (completion->base_command, "query") == 0)
if (ascii_strcasecmp (completion->base_command, "query") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "quit") == 0)
if ((ascii_strcasecmp (completion->base_command, "quit") == 0)
&& (completion->base_command_arg == 1))
{
if (cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0])
@@ -519,7 +616,7 @@ completion_build_list (t_completion *completion, void *channel)
cfg_irc_default_msg_quit);
return;
}
if (strcasecmp (completion->base_command, "topic") == 0)
if (ascii_strcasecmp (completion->base_command, "topic") == 0)
{
if (completion->base_command_arg == 1)
{
@@ -703,7 +800,7 @@ completion_command (t_completion *completion)
other_completion = 0;
for (ptr_weelist = index_commands; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
{
if (strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
@@ -711,7 +808,7 @@ completion_command (t_completion *completion)
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
ptr_weelist2 = ptr_weelist2->next_weelist)
{
if (strncasecmp (ptr_weelist2->data,
if (ascii_strncasecmp (ptr_weelist2->data,
completion->base_word + 1, length) == 0)
other_completion++;
}
@@ -725,7 +822,7 @@ completion_command (t_completion *completion)
other_completion++;
}
if (completion->word_found &&
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
word_found_seen = 1;
}
if (completion->word_found)
@@ -751,7 +848,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
for (ptr_weelist = completion->completion_list; ptr_weelist;
ptr_weelist = ptr_weelist->next_weelist)
{
if (strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
@@ -759,7 +856,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
ptr_weelist2 = ptr_weelist2->next_weelist)
{
if (strncasecmp (ptr_weelist2->data,
if (ascii_strncasecmp (ptr_weelist2->data,
completion->base_word, length) == 0)
other_completion++;
}
@@ -773,7 +870,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
other_completion++;
}
if (completion->word_found &&
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
word_found_seen = 1;
}
if (completion->word_found)
@@ -807,7 +904,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
other_completion = 0;
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
if (strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
if (ascii_strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
@@ -815,7 +912,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
ptr_nick2 = ptr_nick2->next_nick)
{
if (strncasecmp (ptr_nick2->nick,
if (ascii_strncasecmp (ptr_nick2->nick,
completion->base_word, length) == 0)
other_completion++;
}
@@ -829,7 +926,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
other_completion++;
}
if (completion->word_found &&
(strcasecmp (ptr_nick->nick, completion->word_found) == 0))
(ascii_strcasecmp (ptr_nick->nick, completion->word_found) == 0))
word_found_seen = 1;
}
if (completion->word_found)
+32 -32
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* history.c: memorize and call again commands or text */
/* history.c: memorize commands or text */
#ifdef HAVE_CONFIG_H
@@ -33,10 +33,10 @@
#include "../gui/gui.h"
t_history *history_general = NULL;
t_history *history_general_last = NULL;
t_history *history_general_ptr = NULL;
int num_history_general = 0;
t_history *history_global = NULL;
t_history *history_global_last = NULL;
t_history *history_global_ptr = NULL;
int num_history_global = 0;
/*
@@ -74,7 +74,7 @@ history_add (void *buffer, char *string)
{
t_history *new_history, *ptr_history;
/* add history to general history */
/* add history to global history */
new_history = (t_history *)malloc (sizeof (t_history));
if (new_history)
{
@@ -82,26 +82,26 @@ history_add (void *buffer, char *string)
if (cfg_log_hide_nickserv_pwd)
history_hide_password (new_history->text);
if (history_general)
history_general->prev_history = new_history;
if (history_global)
history_global->prev_history = new_history;
else
history_general_last = new_history;
new_history->next_history = history_general;
history_global_last = new_history;
new_history->next_history = history_global;
new_history->prev_history = NULL;
history_general = new_history;
num_history_general++;
history_global = new_history;
num_history_global++;
/* remove one command if necessary */
if ((cfg_history_max_commands > 0)
&& (num_history_general > cfg_history_max_commands))
&& (num_history_global > cfg_history_max_commands))
{
ptr_history = history_general_last->prev_history;
history_general_last->prev_history->next_history = NULL;
if (history_general_last->text)
free (history_general_last->text);
free (history_general_last);
history_general_last = ptr_history;
num_history_general--;
ptr_history = history_global_last->prev_history;
history_global_last->prev_history->next_history = NULL;
if (history_global_last->text)
free (history_global_last->text);
free (history_global_last);
history_global_last = ptr_history;
num_history_global--;
}
}
@@ -138,26 +138,26 @@ history_add (void *buffer, char *string)
}
/*
* history_general_free: free general history
* history_global_free: free global history
*/
void
history_general_free ()
history_global_free ()
{
t_history *ptr_history;
while (history_general)
while (history_global)
{
ptr_history = history_general->next_history;
if (history_general->text)
free (history_general->text);
free (history_general);
history_general = ptr_history;
ptr_history = history_global->next_history;
if (history_global->text)
free (history_global->text);
free (history_global);
history_global = ptr_history;
}
history_general = NULL;
history_general_last = NULL;
history_general_ptr = NULL;
num_history_general = 0;
history_global = NULL;
history_global_last = NULL;
history_global_ptr = NULL;
num_history_global = 0;
}
+5 -1
View File
@@ -30,8 +30,12 @@ struct t_history
t_history *prev_history; /* link to previous text/command */
};
extern t_history *history_global;
extern t_history *history_global_last;
extern t_history *history_global_ptr;
extern void history_add (void *, char *);
extern void history_general_free ();
extern void history_global_free ();
extern void history_buffer_free (void *);
#endif /* history.h */
+79 -3
View File
@@ -83,6 +83,78 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
#endif
/*
* ascii_strcasecmp: locale and case independent string comparison
*/
int
ascii_strcasecmp (char *string1, char *string2)
{
int c1, c2;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
while (string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
}
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* ascii_strncasecmp: locale and case independent string comparison
* with max length
*/
int
ascii_strncasecmp (char *string1, char *string2, int max)
{
int c1, c2, count;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
count = 0;
while ((count < max) && string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
count++;
}
if (count >= max)
return 0;
else
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* wee_log_printf: displays a message in WeeChat log (~/.weechat/weechat.log)
*/
@@ -131,7 +203,7 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (strcasecmp(from_code, to_code) != 0))
&& (ascii_strcasecmp(from_code, to_code) != 0))
{
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))
@@ -250,7 +322,7 @@ void wee_display_config_options ()
break;
}
printf (_(" . description: %s\n\n"),
gettext (weechat_options[i][j].long_description));
_(weechat_options[i][j].long_description));
j++;
}
}
@@ -418,7 +490,7 @@ wee_parse_args (int argc, char *argv[])
wee_display_commands (1, 0);
wee_shutdown (EXIT_SUCCESS, 0);
}
else if ((strncasecmp (argv[i], "irc", 3) == 0))
else if ((ascii_strncasecmp (argv[i], "irc", 3) == 0))
{
if (server_init_with_url (argv[i], &server_tmp) < 0)
{
@@ -772,6 +844,9 @@ wee_dump (int crash)
wee_log_printf ("\n");
gui_buffer_print_log (ptr_buffer);
}
wee_log_printf ("\n");
ignore_print_log ();
wee_log_printf ("\n");
wee_log_printf ("****** End of dump ******\n");
@@ -814,6 +889,7 @@ main (int argc, char *argv[])
#endif
signal (SIGINT, SIG_IGN); /* ignore SIGINT signal */
signal (SIGQUIT, SIG_IGN); /* ignore SIGQUIT 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 */
+2
View File
@@ -118,6 +118,8 @@ extern char *local_charset;
extern gnutls_certificate_credentials gnutls_xcred;
#endif
extern int ascii_strcasecmp (char *, char *);
extern int ascii_strncasecmp (char *, char *, int);
extern void wee_log_printf (char *, ...);
extern void wee_dump (int);
extern char *weechat_convert_encoding (char *, char *, char *);
+151 -38
View File
@@ -55,6 +55,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
{ CONFIG_SECTION_PROXY, "proxy" },
{ CONFIG_SECTION_KEYS, "keys" },
{ CONFIG_SECTION_ALIAS, "alias" },
{ CONFIG_SECTION_IGNORE, "ignore" },
{ CONFIG_SECTION_SERVER, "server" }
};
@@ -69,6 +70,7 @@ char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks;
int cfg_look_color_nicks_number;
int cfg_look_color_actions;
int cfg_look_remove_colors_from_msgs;
int cfg_look_nicklist;
@@ -123,6 +125,10 @@ t_config_option weechat_options_look[] =
N_("display nick names with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_color_nicks, NULL, config_change_noop },
{ "look_color_nicks_number", N_("number of colors to use for nicks colors"),
N_("number of colors to use for nicks colors"),
OPTION_TYPE_INT, 1, 10, 10,
NULL, NULL, &cfg_look_color_nicks_number, NULL, config_change_nicks_colors },
{ "look_color_actions", N_("display actions with different colors"),
N_("display actions with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -228,6 +234,7 @@ int cfg_col_nick_voice;
int cfg_col_nick_more;
int cfg_col_nick_sep;
int cfg_col_nick_self;
int cfg_col_nick_colors[COLOR_WIN_NICK_NUMBER];
int cfg_col_nick_private;
int cfg_col_nick_bg;
int cfg_col_dcc_selected;
@@ -414,6 +421,46 @@ t_config_option weechat_options_colors[] =
N_("color for local nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_nick_self, NULL, &config_change_color },
{ "col_nick_color1", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"cyan", NULL, &cfg_col_nick_colors[0], NULL, &config_change_color },
{ "col_nick_color2", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"magenta", NULL, &cfg_col_nick_colors[1], NULL, &config_change_color },
{ "col_nick_color3", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"green", NULL, &cfg_col_nick_colors[2], NULL, &config_change_color },
{ "col_nick_color4", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"brown", NULL, &cfg_col_nick_colors[3], NULL, &config_change_color },
{ "col_nick_color5", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightblue", NULL, &cfg_col_nick_colors[4], NULL, &config_change_color },
{ "col_nick_color6", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_nick_colors[5], NULL, &config_change_color },
{ "col_nick_color7", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightcyan", NULL, &cfg_col_nick_colors[6], NULL, &config_change_color },
{ "col_nick_color8", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_nick_colors[7], NULL, &config_change_color },
{ "col_nick_color9", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_nick_colors[8], NULL, &config_change_color },
{ "col_nick_color10", N_("color for nick"),
N_("color for nick"),
OPTION_TYPE_COLOR, 0, 0, 0,
"blue", NULL, &cfg_col_nick_colors[9], NULL, &config_change_color },
{ "col_nick_private", N_("color for other nick in private window"),
N_("color for other nick in private window"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -522,6 +569,7 @@ int cfg_irc_display_away;
char *cfg_irc_default_msg_away;
char *cfg_irc_default_msg_part;
char *cfg_irc_default_msg_quit;
int cfg_irc_notice_as_pv;
int cfg_irc_away_check;
int cfg_irc_lag_check;
int cfg_irc_lag_min_show;
@@ -546,6 +594,10 @@ t_config_option weechat_options_irc[] =
N_("default quit message ('%v' will be replaced by WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_quit, config_change_noop },
{ "irc_notice_as_pv", N_("display notices as private messages"),
N_("display notices as private messages"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_irc_notice_as_pv, NULL, config_change_noop },
{ "irc_away_check", N_("interval between two checks for away"),
N_("interval between two checks for away (in minutes, 0 = never check)"),
OPTION_TYPE_INT, 0, INT_MAX, 0,
@@ -739,7 +791,7 @@ t_config_option weechat_options_server[] =
OPTION_TYPE_INT, 0, 5, 0,
NULL, NULL, &(cfg_server.command_delay), NULL, NULL },
{ "server_autojoin", N_("list of channels to join when connected to server"),
N_("comma separated list of channels to join when connected to server"),
N_("comma separated list of channels to join when connected to server (example: \"#chan1,#chan2,#chan3 #key1,#key2\")"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.autojoin), NULL },
{ "server_autorejoin", N_("automatically rejoin channels when kicked"),
@@ -758,7 +810,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, NULL, weechat_options_server
weechat_options_proxy, NULL, NULL, NULL, weechat_options_server
};
@@ -775,7 +827,7 @@ get_pos_array_values (char **array, char *string)
i = 0;
while (array[i])
{
if (strcasecmp (array[i], string) == 0)
if (ascii_strcasecmp (array[i], string) == 0)
return i;
i++;
}
@@ -795,7 +847,7 @@ config_get_section (t_config_option *ptr_option)
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
@@ -858,7 +910,41 @@ config_change_buffer_content ()
void
config_change_color ()
{
t_gui_window *ptr_win;
gui_init_colors ();
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
gui_redraw_buffer (ptr_win->buffer);
}
/*
* config_change_nicks_colors: called when number of nicks color changed
*/
void
config_change_nicks_colors ()
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
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)
{
for (ptr_nick = ptr_channel->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
{
if (ptr_nick->color != COLOR_WIN_NICK_SELF)
ptr_nick->color = nick_find_color (ptr_nick);
}
}
}
}
}
/*
@@ -926,9 +1012,9 @@ config_option_set_value (t_config_option *option, char *value)
switch (option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (strcasecmp (value, "on") == 0)
if (ascii_strcasecmp (value, "on") == 0)
*(option->ptr_int) = BOOL_TRUE;
else if (strcasecmp (value, "off") == 0)
else if (ascii_strcasecmp (value, "off") == 0)
*(option->ptr_int) = BOOL_FALSE;
else
return -1;
@@ -965,43 +1051,43 @@ config_option_set_value (t_config_option *option, char *value)
void *
config_get_server_option_ptr (t_irc_server *server, char *option_name)
{
if (strcasecmp (option_name, "server_name") == 0)
if (ascii_strcasecmp (option_name, "server_name") == 0)
return (void *)(&server->name);
if (strcasecmp (option_name, "server_autoconnect") == 0)
if (ascii_strcasecmp (option_name, "server_autoconnect") == 0)
return (void *)(&server->autoconnect);
if (strcasecmp (option_name, "server_autoreconnect") == 0)
if (ascii_strcasecmp (option_name, "server_autoreconnect") == 0)
return (void *)(&server->autoreconnect);
if (strcasecmp (option_name, "server_autoreconnect_delay") == 0)
if (ascii_strcasecmp (option_name, "server_autoreconnect_delay") == 0)
return (void *)(&server->autoreconnect_delay);
if (strcasecmp (option_name, "server_address") == 0)
if (ascii_strcasecmp (option_name, "server_address") == 0)
return (void *)(&server->address);
if (strcasecmp (option_name, "server_port") == 0)
if (ascii_strcasecmp (option_name, "server_port") == 0)
return (void *)(&server->port);
if (strcasecmp (option_name, "server_ipv6") == 0)
if (ascii_strcasecmp (option_name, "server_ipv6") == 0)
return (void *)(&server->ipv6);
if (strcasecmp (option_name, "server_ssl") == 0)
if (ascii_strcasecmp (option_name, "server_ssl") == 0)
return (void *)(&server->ssl);
if (strcasecmp (option_name, "server_password") == 0)
if (ascii_strcasecmp (option_name, "server_password") == 0)
return (void *)(&server->password);
if (strcasecmp (option_name, "server_nick1") == 0)
if (ascii_strcasecmp (option_name, "server_nick1") == 0)
return (void *)(&server->nick1);
if (strcasecmp (option_name, "server_nick2") == 0)
if (ascii_strcasecmp (option_name, "server_nick2") == 0)
return (void *)(&server->nick2);
if (strcasecmp (option_name, "server_nick3") == 0)
if (ascii_strcasecmp (option_name, "server_nick3") == 0)
return (void *)(&server->nick3);
if (strcasecmp (option_name, "server_username") == 0)
if (ascii_strcasecmp (option_name, "server_username") == 0)
return (void *)(&server->username);
if (strcasecmp (option_name, "server_realname") == 0)
if (ascii_strcasecmp (option_name, "server_realname") == 0)
return (void *)(&server->realname);
if (strcasecmp (option_name, "server_command") == 0)
if (ascii_strcasecmp (option_name, "server_command") == 0)
return (void *)(&server->command);
if (strcasecmp (option_name, "server_command_delay") == 0)
if (ascii_strcasecmp (option_name, "server_command_delay") == 0)
return (void *)(&server->command_delay);
if (strcasecmp (option_name, "server_autojoin") == 0)
if (ascii_strcasecmp (option_name, "server_autojoin") == 0)
return (void *)(&server->autojoin);
if (strcasecmp (option_name, "server_autorejoin") == 0)
if (ascii_strcasecmp (option_name, "server_autorejoin") == 0)
return (void *)(&server->autorejoin);
if (strcasecmp (option_name, "server_notify_levels") == 0)
if (ascii_strcasecmp (option_name, "server_notify_levels") == 0)
return (void *)(&server->notify_levels);
/* option not found */
return NULL;
@@ -1031,7 +1117,7 @@ config_set_server_value (t_irc_server *server, char *option_name,
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
/* if option found, return pointer */
if (strcasecmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, option_name) == 0)
if (ascii_strcasecmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, option_name) == 0)
{
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
break;
@@ -1043,9 +1129,9 @@ config_set_server_value (t_irc_server *server, char *option_name,
switch (ptr_option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (strcasecmp (value, "on") == 0)
if (ascii_strcasecmp (value, "on") == 0)
*((int *)(ptr_data)) = BOOL_TRUE;
else if (strcasecmp (value, "off") == 0)
else if (ascii_strcasecmp (value, "off") == 0)
*((int *)(ptr_data)) = BOOL_FALSE;
else
return -2;
@@ -1090,12 +1176,12 @@ config_option_search (char *option_name)
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
/* if option found, return pointer */
if (strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
if (ascii_strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
return &weechat_options[i][j];
}
}
@@ -1254,7 +1340,7 @@ config_default_values ()
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
@@ -1428,6 +1514,21 @@ config_read ()
if (alias_new (line, pos))
weelist_add (&index_commands, &last_index_command, line);
}
else if (section == CONFIG_SECTION_IGNORE)
{
/* create new ignore */
if (ascii_strcasecmp (line, "ignore") != 0)
gui_printf (NULL,
_("%s %s, line %d: invalid option \"%s\"\n"),
WEECHAT_WARNING, filename, line_number, line);
else
{
if (!ignore_add_from_config (pos))
gui_printf (NULL,
_("%s %s, line %d: invalid ignore options \"%s\"\n"),
WEECHAT_WARNING, filename, line_number, pos);
}
}
else
{
option_number = -1;
@@ -1571,7 +1672,7 @@ config_create_default ()
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
@@ -1623,7 +1724,6 @@ config_create_default ()
}
/* default aliases */
/* TODO: remove comments when missing commands will be ok */
fprintf (file, "\n[alias]\n");
fprintf (file, "SAY=msg *\n");
fprintf (file, "BYE=quit\n");
@@ -1633,12 +1733,10 @@ config_create_default ()
fprintf (file, "CL=clear\n");
fprintf (file, "CLOSE=buffer close\n");
fprintf (file, "CHAT=dcc chat\n");
fprintf (file, "# GET=dcc get\n");
fprintf (file, "# IG=ignore\n");
fprintf (file, "IG=ignore\n");
fprintf (file, "J=join\n");
fprintf (file, "K=kick\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");
@@ -1646,12 +1744,14 @@ config_create_default ()
fprintf (file, "Q=query\n");
fprintf (file, "T=topic\n");
fprintf (file, "UB=unban\n");
fprintf (file, "# UNIG=unignore\n");
fprintf (file, "UNIG=unignore\n");
fprintf (file, "W=who\n");
fprintf (file, "WC=part\n");
fprintf (file, "WI=whois\n");
fprintf (file, "WW=whowas\n");
/* no ignore by default */
/* default server is freenode */
fprintf (file, "\n[server]\n");
fprintf (file, "server_name=freenode\n");
@@ -1730,6 +1830,7 @@ config_write (char *config_name)
time_t current_time;
t_irc_server *ptr_server;
t_weechat_alias *ptr_alias;
t_irc_ignore *ptr_ignore;
t_gui_key *ptr_key;
char *expanded_name, *function_name;
@@ -1765,7 +1866,7 @@ config_write (char *config_name)
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
&& (i != CONFIG_SECTION_SERVER))
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
@@ -1842,6 +1943,18 @@ config_write (char *config_name)
ptr_alias->alias_name, ptr_alias->alias_command + 1);
}
/* ignore section */
fprintf (file, "\n[ignore]\n");
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
fprintf (file, "ignore=%s,%s,%s,%s\n",
ptr_ignore->mask,
ptr_ignore->type,
ptr_ignore->channel_name,
ptr_ignore->server_name);
}
/* server section */
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
+7 -2
View File
@@ -35,8 +35,9 @@
#define CONFIG_SECTION_PROXY 6
#define CONFIG_SECTION_KEYS 7
#define CONFIG_SECTION_ALIAS 8
#define CONFIG_SECTION_SERVER 9
#define CONFIG_NUMBER_SECTIONS 10
#define CONFIG_SECTION_IGNORE 9
#define CONFIG_SECTION_SERVER 10
#define CONFIG_NUMBER_SECTIONS 11
#define OPTION_TYPE_BOOLEAN 1 /* values: on/off */
#define OPTION_TYPE_INT 2 /* values: from min to max */
@@ -86,6 +87,7 @@ extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern char *cfg_look_buffer_timestamp;
extern int cfg_look_color_nicks;
extern int cfg_look_color_nicks_number;
extern int cfg_look_color_actions;
extern int cfg_look_remove_colors_from_msgs;
extern int cfg_look_nicklist;
@@ -142,6 +144,7 @@ extern int cfg_col_nick_voice;
extern int cfg_col_nick_more;
extern int cfg_col_nick_sep;
extern int cfg_col_nick_self;
extern int cfg_col_nick_colors[COLOR_WIN_NICK_NUMBER];
extern int cfg_col_nick_private;
extern int cfg_col_nick_bg;
extern int cfg_col_dcc_selected;
@@ -167,6 +170,7 @@ extern int cfg_irc_display_away;
extern char *cfg_irc_default_msg_away;
extern char *cfg_irc_default_msg_part;
extern char *cfg_irc_default_msg_quit;
extern int cfg_irc_notice_as_pv;
extern int cfg_irc_away_check;
extern int cfg_irc_lag_check;
extern int cfg_irc_lag_min_show;
@@ -202,6 +206,7 @@ extern void config_change_title ();
extern void config_change_buffers ();
extern void config_change_buffer_content ();
extern void config_change_color ();
extern void config_change_nicks_colors ();
extern void config_change_away_check ();
extern void config_change_fifo_pipe ();
extern void config_change_notify_levels ();
+2 -2
View File
@@ -42,7 +42,7 @@ weelist_search (t_weelist *weelist, char *data)
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
{
if (strcasecmp (data, ptr_weelist->data) == 0)
if (ascii_strcasecmp (data, ptr_weelist->data) == 0)
return ptr_weelist;
}
/* word not found in list */
@@ -60,7 +60,7 @@ weelist_find_pos (t_weelist *weelist, char *data)
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
{
if (strcasecmp (data, ptr_weelist->data) < 0)
if (ascii_strcasecmp (data, ptr_weelist->data) < 0)
return ptr_weelist;
}
/* position not found, best position is at the end */
+259 -113
View File
@@ -60,10 +60,6 @@ t_gui_color gui_colors[] =
{ NULL, 0 }
};
char *nicks_colors[COLOR_WIN_NICK_NUMBER] =
{ "cyan", "magenta", "green", "brown", "lightblue", "default",
"lightcyan", "lightmagenta", "lightgreen", "blue" };
int color_attr[NUM_COLORS];
@@ -80,7 +76,7 @@ gui_assign_color (int *color, char *color_name)
i = 0;
while (gui_colors[i].name)
{
if (strcasecmp (gui_colors[i].name, color_name) == 0)
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
{
*color = gui_colors[i].color;
return 1;
@@ -105,7 +101,7 @@ gui_get_color_by_name (char *color_name)
i = 0;
while (gui_colors[i].name)
{
if (strcasecmp (gui_colors[i].name, color_name) == 0)
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
return gui_colors[i].color;
i++;
}
@@ -184,6 +180,13 @@ gui_calculate_pos_size (t_gui_window *window)
{
max_length = nick_get_max_length (CHANNEL(window->buffer));
if ((cfg_look_nicklist_min_size > 0)
&& (max_length < cfg_look_nicklist_min_size))
max_length = cfg_look_nicklist_min_size;
else if ((cfg_look_nicklist_max_size > 0)
&& (max_length > cfg_look_nicklist_max_size))
max_length = cfg_look_nicklist_max_size;
switch (cfg_look_nicklist_position)
{
case CFG_LOOK_NICKLIST_LEFT:
@@ -433,7 +436,7 @@ gui_display_word (t_gui_window *window, t_gui_line *line,
int end_of_word, chars_to_display, num_displayed;
if (!message || !end_msg ||
(window->win_chat_cursor_y > window->win_chat_height - 1))
((!simulate) && (window->win_chat_cursor_y > window->win_chat_height - 1)))
return;
snprintf (format_align, 32, "%%-%ds", line->length_align);
@@ -486,7 +489,6 @@ gui_display_word (t_gui_window *window, t_gui_line *line,
}
else
{
num_displayed = chars_to_display;
if ((!simulate) &&
((count == 0) || (*lines_displayed >= num_lines - count)))
@@ -519,7 +521,8 @@ gui_display_word (t_gui_window *window, t_gui_line *line,
/* end of word? */
if (!message || (message->prev_message == end_msg) ||
((message == end_msg) && (offset > end_offset)))
((message == end_msg) && (offset > end_offset)) ||
(window->win_chat_cursor_y >= window->win_chat_height))
end_of_word = 1;
}
@@ -587,9 +590,6 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
int word_length_with_spaces, word_length;
int skip_spaces;
if (window->win_chat_cursor_y > window->win_chat_height - 1)
return 0;
if (simulate)
{
x = window->win_chat_cursor_x;
@@ -600,6 +600,8 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
}
else
{
if (window->win_chat_cursor_y > window->win_chat_height - 1)
return 0;
x = window->win_chat_cursor_x;
y = window->win_chat_cursor_y;
num_lines = gui_display_line (window, line, 0, 1);
@@ -640,16 +642,21 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
word_end_msg, word_end_offset,
num_lines, count, &lines_displayed, simulate);
/* move pointer after end of word */
ptr_message = word_end_msg;
offset = word_end_offset;
gui_message_get_next_char (&ptr_message, &offset);
/* skip leading spaces? */
if (skip_spaces)
if (window->win_chat_cursor_y >= window->win_chat_height)
ptr_message = NULL;
else
{
while (ptr_message && (ptr_message->message[offset] == ' '))
gui_message_get_next_char (&ptr_message, &offset);
/* move pointer after end of word */
ptr_message = word_end_msg;
offset = word_end_offset;
gui_message_get_next_char (&ptr_message, &offset);
/* skip leading spaces? */
if (skip_spaces)
{
while (ptr_message && (ptr_message->message[offset] == ' '))
gui_message_get_next_char (&ptr_message, &offset);
}
}
}
else
@@ -669,6 +676,105 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
return lines_displayed;
}
/*
* gui_calculate_line_diff: returns pointer to line & offset for a difference
* with given line
*/
void
gui_calculate_line_diff (t_gui_window *window, t_gui_line **line, int *line_pos,
int difference)
{
int backward, current_size;
if (!line || !line_pos)
return;
backward = (difference < 0);
if (!(*line))
{
/* if looking backward, start at last line of buffer */
if (backward)
{
*line = window->buffer->last_line;
if (!(*line))
return;
current_size = gui_display_line (window, *line, 0, 1);
if (current_size == 0)
current_size = 1;
*line_pos = current_size - 1;
}
/* if looking forward, start at first line of buffer */
else
{
*line = window->buffer->lines;
if (!(*line))
return;
*line_pos = 0;
current_size = gui_display_line (window, *line, 0, 1);
}
}
else
current_size = gui_display_line (window, *line, 0, 1);
while ((*line) && (difference != 0))
{
/* looking backward */
if (backward)
{
if (*line_pos > 0)
(*line_pos)--;
else
{
*line = (*line)->prev_line;
if (*line)
{
current_size = gui_display_line (window, *line, 0, 1);
if (current_size == 0)
current_size = 1;
*line_pos = current_size - 1;
}
}
difference++;
}
/* looking forward */
else
{
if (*line_pos < current_size - 1)
(*line_pos)++;
else
{
*line = (*line)->next_line;
if (*line)
{
current_size = gui_display_line (window, *line, 0, 1);
if (current_size == 0)
current_size = 1;
*line_pos = 0;
}
}
difference--;
}
}
/* first or last line reached */
if (!(*line))
{
if (backward)
{
/* first line reached */
*line = window->buffer->lines;
*line_pos = 0;
}
else
{
/* last line reached => consider we'll display all until the end */
*line_pos = 0;
}
}
}
/*
* gui_draw_buffer_chat: draw chat window for a buffer
*/
@@ -680,12 +786,12 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
t_gui_line *ptr_line;
t_irc_dcc *dcc_first, *dcc_selected, *ptr_dcc;
char format_empty[32];
int i, j, lines_used, num_bars;
int i, j, line_pos, count, num_bars;
char *unit_name[] = { N_("bytes"), N_("Kb"), N_("Mb"), N_("Gb") };
char *unit_format[] = { "%.0Lf", "%.1Lf", "%.02Lf", "%.02Lf" };
long unit_divide[] = { 1, 1024, 1024*1024, 1024*1024,1024 };
int num_unit;
char format[32], date[128];
char format[32], date[128], *buf;
struct tm *date_tmp;
if (!gui_ok)
@@ -722,11 +828,16 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
gui_window_set_color (ptr_win->win_chat,
(ptr_dcc == dcc_selected) ?
COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
mvwprintw (ptr_win->win_chat, i, 0, "%s %-16s %s",
mvwprintw (ptr_win->win_chat, i, 0, "%s %-16s ",
(ptr_dcc == dcc_selected) ? "***" : " ",
ptr_dcc->nick,
(DCC_IS_CHAT(ptr_dcc->type)) ?
_(ptr_dcc->filename) : ptr_dcc->filename);
ptr_dcc->nick);
buf = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
(DCC_IS_CHAT(ptr_dcc->type)) ?
_(ptr_dcc->filename) : ptr_dcc->filename);
wprintw (ptr_win->win_chat, "%s", buf);
free (buf);
if (DCC_IS_FILE(ptr_dcc->type))
{
if (ptr_dcc->filename_suffix > 0)
@@ -743,8 +854,12 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
(DCC_IS_RECV(ptr_dcc->type)) ? "-->>" : "<<--");
gui_window_set_color (ptr_win->win_chat,
COLOR_DCC_WAITING + ptr_dcc->status);
wprintw (ptr_win->win_chat, "%-10s",
_(dcc_status_string[ptr_dcc->status]));
buf = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
_(dcc_status_string[ptr_dcc->status]));
wprintw (ptr_win->win_chat, "%-10s", buf);
free (buf);
/* other infos */
gui_window_set_color (ptr_win->win_chat,
@@ -790,9 +905,14 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
else
num_unit = 3;
sprintf (format, " (%s %%s/s)", unit_format[num_unit]);
buf = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
unit_name[num_unit]);
wprintw (ptr_win->win_chat, format,
((long double) ptr_dcc->bytes_per_sec) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
buf);
free (buf);
}
else
{
@@ -809,48 +929,56 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
}
else
{
ptr_line = buffer->last_line;
lines_used = 0;
ptr_win->win_chat_cursor_x = 0;
ptr_win->win_chat_cursor_y = 0;
while (ptr_line
&& (lines_used < (ptr_win->win_chat_height + ptr_win->sub_lines)))
/* display at position of scrolling */
if (ptr_win->start_line)
{
lines_used += gui_display_line (ptr_win, ptr_line, 0, 1);
ptr_line = ptr_line->prev_line;
ptr_line = ptr_win->start_line;
line_pos = ptr_win->start_line_pos;
}
if (lines_used > (ptr_win->win_chat_height + ptr_win->sub_lines))
else
{
/* screen will be full (we'll display only end of 1st line) */
ptr_line = (ptr_line) ? ptr_line->next_line : buffer->lines;
/* look for first line to display, sarting from last line */
ptr_line = NULL;
line_pos = 0;
gui_calculate_line_diff (ptr_win, &ptr_line, &line_pos,
(-1) * (ptr_win->win_chat_height - 1));
}
if (line_pos > 0)
{
/* display end of first line at top of screen */
gui_display_line (ptr_win, ptr_line,
gui_display_line (ptr_win, ptr_line, 0, 1) -
(lines_used - (ptr_win->win_chat_height + ptr_win->sub_lines)), 0);
line_pos, 0);
ptr_line = ptr_line->next_line;
ptr_win->first_line_displayed = 0;
}
else
{
/* all lines are displayed */
if (!ptr_line)
{
ptr_win->first_line_displayed = 1;
ptr_line = buffer->lines;
}
else
{
ptr_win->first_line_displayed = 0;
ptr_line = ptr_line->next_line;
}
}
ptr_win->first_line_displayed =
(ptr_line == ptr_win->buffer->lines);
/* display lines */
count = 0;
while (ptr_line && (ptr_win->win_chat_cursor_y <= ptr_win->win_chat_height - 1))
{
gui_display_line (ptr_win, ptr_line, 0, 0);
count = gui_display_line (ptr_win, ptr_line, 0, 0);
ptr_line = ptr_line->next_line;
}
/* check if last line of buffer is entirely displayed and scrolling */
/* if so, disable scroll (to remove status bar indicator) */
if (!ptr_line && ptr_win->start_line)
{
if (count == gui_display_line (ptr_win, ptr_win->buffer->last_line, 0, 1))
{
ptr_win->start_line = NULL;
ptr_win->start_line_pos = 0;
}
}
/* cursor is below end line of chat window? */
if (ptr_win->win_chat_cursor_y > ptr_win->win_chat_height - 1)
{
@@ -921,7 +1049,13 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
mvwprintw (ptr_win->win_nick, i, 0, format_empty, " ");
}
}
snprintf (format, 32, "%%-%ds", max_length);
snprintf (format, 32, "%%.%ds",
((cfg_look_nicklist_min_size > 0)
&& (max_length < cfg_look_nicklist_min_size)) ?
cfg_look_nicklist_min_size :
(((cfg_look_nicklist_max_size > 0)
&& (max_length > cfg_look_nicklist_max_size)) ?
cfg_look_nicklist_max_size : max_length));
if (has_colors ())
{
@@ -1033,7 +1167,7 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
((cfg_irc_away_check > 0) && (ptr_nick->is_away)) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
@@ -1328,7 +1462,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
if (x < 0)
x = 0;
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS_MORE);
if (ptr_win->sub_lines > 0)
if (ptr_win->start_line)
mvwprintw (ptr_win->win_status, 0, x, "%s", string);
else
{
@@ -1730,7 +1864,8 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
else
window->win_status = newwin (1, window->win_width, window->win_y + window->win_height - 2, window->win_x);
window->sub_lines = 0;
window->start_line = NULL;
window->start_line_pos = 0;
buffer->num_displayed++;
@@ -1742,7 +1877,7 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
*/
t_gui_buffer *
gui_get_dcc_buffer ()
gui_get_dcc_buffer (t_gui_window *window)
{
t_gui_buffer *ptr_buffer;
@@ -1755,7 +1890,7 @@ gui_get_dcc_buffer ()
if (ptr_buffer)
return ptr_buffer;
else
return gui_buffer_new (gui_current_window, NULL, NULL, 1, 0);
return gui_buffer_new (window, NULL, NULL, 1, 0);
}
/*
@@ -1763,17 +1898,20 @@ gui_get_dcc_buffer ()
*/
void
gui_input_page_up ()
gui_input_page_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (!gui_current_window->first_line_displayed)
if (!window->first_line_displayed)
{
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_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
(window->start_line) ?
(-1) * (window->win_chat_height - 1) :
(-1) * ((window->win_chat_height - 1) * 2));
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
@@ -1782,19 +1920,34 @@ gui_input_page_up ()
*/
void
gui_input_page_down ()
gui_input_page_down (t_gui_window *window)
{
t_gui_line *ptr_line;
int line_pos;
if (!gui_ok)
return;
if (gui_current_window->sub_lines > 0)
if (window->start_line)
{
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_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
window->win_chat_height - 1);
/* check if we can display all */
ptr_line = window->start_line;
line_pos = window->start_line_pos;
gui_calculate_line_diff (window, &ptr_line,
&line_pos,
window->win_chat_height - 1);
if (!ptr_line)
{
window->start_line = NULL;
window->start_line_pos = 0;
}
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
@@ -1803,17 +1956,17 @@ gui_input_page_down ()
*/
void
gui_input_nick_beginning ()
gui_input_nick_beginning (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (gui_current_window->buffer))
if (gui_buffer_has_nicklist (window->buffer))
{
if (gui_current_window->win_nick_start > 0)
if (window->win_nick_start > 0)
{
gui_current_window->win_nick_start = 0;
gui_draw_buffer_nick (gui_current_window->buffer, 1);
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
@@ -1823,27 +1976,26 @@ gui_input_nick_beginning ()
*/
void
gui_input_nick_end ()
gui_input_nick_end (t_gui_window *window)
{
int new_start;
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (gui_current_window->buffer))
if (gui_buffer_has_nicklist (window->buffer))
{
new_start =
CHANNEL(gui_current_window->buffer)->nicks_count -
gui_current_window->win_nick_height;
CHANNEL(window->buffer)->nicks_count - window->win_nick_height;
if (new_start < 0)
new_start = 0;
else if (new_start >= 1)
new_start++;
if (new_start != gui_current_window->win_nick_start)
if (new_start != window->win_nick_start)
{
gui_current_window->win_nick_start = new_start;
gui_draw_buffer_nick (gui_current_window->buffer, 1);
window->win_nick_start = new_start;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
@@ -1853,20 +2005,19 @@ gui_input_nick_end ()
*/
void
gui_input_nick_page_up ()
gui_input_nick_page_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (gui_current_window->buffer))
if (gui_buffer_has_nicklist (window->buffer))
{
if (gui_current_window->win_nick_start > 0)
if (window->win_nick_start > 0)
{
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);
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);
}
}
}
@@ -1876,26 +2027,22 @@ gui_input_nick_page_up ()
*/
void
gui_input_nick_page_down ()
gui_input_nick_page_down (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (gui_current_window->buffer))
if (gui_buffer_has_nicklist (window->buffer))
{
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 ((CHANNEL(window->buffer)->nicks_count > window->win_nick_height)
&& (window->win_nick_start + window->win_nick_height - 1
< CHANNEL(window->buffer)->nicks_count))
{
if (gui_current_window->win_nick_start == 0)
gui_current_window->win_nick_start +=
(gui_current_window->win_nick_height - 1);
if (window->win_nick_start == 0)
window->win_nick_start += (window->win_nick_height - 1);
else
gui_current_window->win_nick_start +=
(gui_current_window->win_nick_height - 2);
gui_draw_buffer_nick (gui_current_window->buffer, 1);
window->win_nick_start += (window->win_nick_height - 2);
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
@@ -2222,7 +2369,7 @@ gui_pre_init (int *argc, char **argv[])
void
gui_init_colors ()
{
int i, color;
int i;
if (has_colors ())
{
@@ -2306,9 +2453,8 @@ gui_init_colors ()
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
{
gui_assign_color (&color, nicks_colors[i]);
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_WIN_NICK_FIRST + i, cfg_col_nick_colors[i], cfg_col_chat_bg);
color_attr[COLOR_WIN_NICK_FIRST + i - 1] = (cfg_col_nick_colors[i] >= 0) ? cfg_col_nick_colors[i] & A_BOLD : 0;
}
init_pair (COLOR_DCC_SELECTED,
@@ -2465,8 +2611,8 @@ gui_end ()
while (gui_windows)
gui_window_free (gui_windows);
/* delete general history */
history_general_free ();
/* delete global history */
history_global_free ();
/* delete infobar messages */
while (gui_infobar)
+4 -2
View File
@@ -75,7 +75,9 @@ gui_input_default_key_bindings ()
gui_key_bind ( /* left */ "meta2-D", "left");
gui_key_bind ( /* right */ "meta2-C", "right");
gui_key_bind ( /* up */ "meta2-A", "up");
gui_key_bind ( /* ^up */ "meta-Oa", "up_global");
gui_key_bind ( /* down */ "meta2-B", "down");
gui_key_bind ( /* ^down */ "meta-Ob", "down_global");
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
@@ -141,7 +143,7 @@ gui_input_grab_end ()
{
if (gui_current_window->buffer->has_input)
{
gui_input_insert_string (expanded_key, -1);
gui_input_insert_string (gui_current_window, expanded_key, -1);
gui_current_window->buffer->input_buffer_pos += strlen (expanded_key);
gui_draw_buffer_input (gui_current_window->buffer, 1);
}
@@ -223,7 +225,7 @@ gui_input_read ()
/*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);
gui_input_insert_char (gui_current_window, key);
i++;
}
+2 -2
View File
@@ -89,7 +89,7 @@ gui_assign_color (int *color, char *color_name)
i = 0;
while (gui_colors[i].name)
{
if (strcasecmp (gui_colors[i].name, color_name) == 0)
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
{
*color = gui_colors[i].color;
return 1;
@@ -114,7 +114,7 @@ gui_get_color_by_name (char *color_name)
i = 0;
while (gui_colors[i].name)
{
if (strcasecmp (gui_colors[i].name, color_name) == 0)
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
return gui_colors[i].color;
i++;
}
File diff suppressed because it is too large Load Diff
+14 -10
View File
@@ -77,8 +77,12 @@ t_gui_key_function gui_key_functions[] =
N_("move to next word") },
{ "up", gui_input_up,
N_("call previous command in history") },
{ "up_global", gui_input_up_global,
N_("call previous command in global history") },
{ "down", gui_input_down,
N_("call next command in history") },
{ "down_global", gui_input_down_global,
N_("call next command in global history") },
{ "page_up", gui_input_page_up,
N_("scroll one page up") },
{ "page_down", gui_input_page_down,
@@ -153,17 +157,17 @@ gui_key_get_internal_code (char *key)
result[0] = '\0';
while (key[0])
{
if (strncasecmp (key, "meta2-", 6) == 0)
if (ascii_strncasecmp (key, "meta2-", 6) == 0)
{
strcat (result, "^[[");
key += 6;
}
if (strncasecmp (key, "meta-", 5) == 0)
if (ascii_strncasecmp (key, "meta-", 5) == 0)
{
strcat (result, "^[");
key += 5;
}
else if (strncasecmp (key, "ctrl-", 5) == 0)
else if (ascii_strncasecmp (key, "ctrl-", 5) == 0)
{
strcat (result, "^");
key += 5;
@@ -196,12 +200,12 @@ gui_key_get_expanded_name (char *key)
result[0] = '\0';
while (key[0])
{
if (strncasecmp (key, "^[[", 3) == 0)
if (ascii_strncasecmp (key, "^[[", 3) == 0)
{
strcat (result, "meta2-");
key += 3;
}
if (strncasecmp (key, "^[", 2) == 0)
if (ascii_strncasecmp (key, "^[", 2) == 0)
{
strcat (result, "meta-");
key += 2;
@@ -235,7 +239,7 @@ gui_key_find_pos (t_gui_key *key)
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
{
if (strcasecmp (key->key, ptr_key->key) < 0)
if (ascii_strcasecmp (key->key, ptr_key->key) < 0)
return ptr_key;
}
return NULL;
@@ -320,7 +324,7 @@ gui_key_search (char *key)
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
{
if (strcasecmp (ptr_key->key, key) == 0)
if (ascii_strcasecmp (ptr_key->key, key) == 0)
return ptr_key;
}
@@ -377,7 +381,7 @@ gui_key_function_search_by_name (char *name)
i = 0;
while (gui_key_functions[i].function_name)
{
if (strcasecmp (gui_key_functions[i].function_name, name) == 0)
if (ascii_strcasecmp (gui_key_functions[i].function_name, name) == 0)
return gui_key_functions[i].function;
i++;
}
@@ -500,7 +504,7 @@ gui_key_pressed (char *key_str)
ptr_key = gui_key_search_part (gui_key_buffer);
if (ptr_key)
{
if (strcasecmp (ptr_key->key, gui_key_buffer) == 0)
if (ascii_strcasecmp (ptr_key->key, gui_key_buffer) == 0)
{
/* exact combo found => execute function or command */
gui_key_buffer[0] = '\0';
@@ -509,7 +513,7 @@ gui_key_pressed (char *key_str)
gui_current_window->buffer,
ptr_key->command);
else
(void)(ptr_key->function)();
(void)(ptr_key->function)(gui_current_window);
}
return 0;
}
+50 -43
View File
@@ -201,6 +201,9 @@ struct t_gui_buffer
t_history *ptr_history; /* current command in history */
int num_history; /* number of commands in history */
/* channel buffer before jumping to next server */
t_gui_buffer *old_channel_buffer; /* only used for server buffer */
/* link to previous/next buffer */
t_gui_buffer *prev_buffer; /* link to previous buffer */
t_gui_buffer *next_buffer; /* link to next buffer */
@@ -257,7 +260,8 @@ struct t_gui_window
t_gui_buffer *buffer; /* buffer currently displayed in window */
int first_line_displayed; /* = 1 if first line is displayed */
int sub_lines; /* if > 0 then do not display until end */
t_gui_line *start_line; /* pointer to line if scrolling */
int start_line_pos; /* position in first line displayed */
t_gui_window *prev_window; /* link to previous window */
t_gui_window *next_window; /* link to next window */
@@ -269,7 +273,8 @@ 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) */
void (*function)(t_gui_window *);
/* associated function (if cmd is NULL) */
t_gui_key *prev_key; /* link to previous key */
t_gui_key *next_key; /* link to next key */
};
@@ -316,40 +321,42 @@ 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_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 void gui_input_clipboard_paste (t_gui_window *);
extern void gui_input_insert_string (t_gui_window *, char *, int);
extern void gui_input_insert_char (t_gui_window *, int);
extern void gui_input_return (t_gui_window *);
extern void gui_input_tab (t_gui_window *);
extern void gui_input_backspace (t_gui_window *);
extern void gui_input_delete (t_gui_window *);
extern void gui_input_delete_previous_word (t_gui_window *);
extern void gui_input_delete_next_word (t_gui_window *);
extern void gui_input_delete_begin_of_line (t_gui_window *);
extern void gui_input_delete_end_of_line (t_gui_window *);
extern void gui_input_delete_line (t_gui_window *);
extern void gui_input_transpose_chars (t_gui_window *);
extern void gui_input_home (t_gui_window *);
extern void gui_input_end (t_gui_window *);
extern void gui_input_left (t_gui_window *);
extern void gui_input_previous_word (t_gui_window *);
extern void gui_input_right (t_gui_window *);
extern void gui_input_next_word (t_gui_window *);
extern void gui_input_up (t_gui_window *);
extern void gui_input_up_global (t_gui_window *);
extern void gui_input_down (t_gui_window *);
extern void gui_input_down_global (t_gui_window *);
extern void gui_input_jump_smart (t_gui_window *);
extern void gui_input_jump_dcc (t_gui_window *);
extern void gui_input_jump_last_buffer (t_gui_window *);
extern void gui_input_jump_server (t_gui_window *);
extern void gui_input_jump_next_server (t_gui_window *);
extern void gui_input_hotlist_clear (t_gui_window *);
extern void gui_input_infobar_clear (t_gui_window *);
extern void gui_input_grab_key (t_gui_window *);
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_switch_to_dcc_buffer (t_gui_window *);
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 *);
@@ -385,13 +392,13 @@ 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_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 t_gui_buffer *gui_get_dcc_buffer (t_gui_window *);
extern void gui_input_page_up (t_gui_window *);
extern void gui_input_page_down (t_gui_window *);
extern void gui_input_nick_beginning (t_gui_window *);
extern void gui_input_nick_end (t_gui_window *);
extern void gui_input_nick_page_up (t_gui_window *);
extern void gui_input_nick_page_down (t_gui_window *);
extern void gui_curses_resize_handler ();
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *);
+1
View File
@@ -27,4 +27,5 @@ lib_weechat_irc_a_SOURCES = irc.h \
irc-channel.c \
irc-nick.c \
irc-dcc.c \
irc-ignore.c \
irc-display.c
+8 -2
View File
@@ -143,11 +143,14 @@ t_irc_channel *
channel_search (t_irc_server *server, char *channel_name)
{
t_irc_channel *ptr_channel;
if (!server || !channel_name)
return NULL;
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (strcasecmp (ptr_channel->name, channel_name) == 0)
if (ascii_strcasecmp (ptr_channel->name, channel_name) == 0)
return ptr_channel;
}
return NULL;
@@ -162,6 +165,9 @@ string_is_channel (char *string)
{
char first_char[2];
if (!string)
return 0;
first_char[0] = string[0];
first_char[1] = '\0';
return (strpbrk (first_char, CHANNEL_PREFIX)) ? 1 : 0;
+13 -3
View File
@@ -35,6 +35,10 @@ t_irc_command irc_commands[] =
N_("[target]"),
N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_admin, NULL },
{ "ame", N_("send a CTCP action to all channels of all connected servers"),
N_("message"),
N_("message: message to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_ame, NULL },
{ "amsg", N_("send message to all channels of all connected servers"),
N_("text"),
N_("text: text to send"),
@@ -126,7 +130,7 @@ t_irc_command irc_commands[] =
N_("mask: servers matching the mask only\n"
"target: server for forwarding request"),
0, 2, 1, NULL, irc_cmd_send_lusers, NULL },
{ "me", N_("send a ctcp action to the current channel"),
{ "me", N_("send a CTCP action to the current channel"),
N_("message"),
N_("message: message to send"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
@@ -299,8 +303,11 @@ t_irc_command irc_commands[] =
{ "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 },
{ "020", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "042", 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 },
{ "221", N_("user mode string"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
{ "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 },
@@ -351,6 +358,8 @@ t_irc_command irc_commands[] =
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "344", N_("channel reop"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_344 },
{ "345", N_("end of channel reop list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_345 },
{ "351", N_("server version"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
{ "352", N_("who"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
{ "353", N_("list of nicks on channel"),
@@ -383,8 +392,6 @@ t_irc_command irc_commands[] =
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "406", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "406", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "407", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "409", N_("no origin"),
@@ -463,6 +470,8 @@ t_irc_command irc_commands[] =
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "483", N_("you can't kill a server!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "484", N_("your connection is restricted!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"),
@@ -471,6 +480,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 },
{ "505", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "671", N_("whois (secure connection)"),
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
+45 -12
View File
@@ -34,6 +34,8 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "../common/weechat.h"
#include "irc.h"
@@ -55,10 +57,10 @@ char *dcc_status_string[] = /* strings for DCC status */
void
dcc_redraw (int highlight)
{
gui_redraw_buffer (gui_get_dcc_buffer ());
gui_redraw_buffer (gui_get_dcc_buffer (gui_current_window));
if (highlight)
{
hotlist_add (highlight, gui_get_dcc_buffer ());
hotlist_add (highlight, gui_get_dcc_buffer (gui_current_window));
gui_draw_buffer_status (gui_current_window->buffer, 0);
}
}
@@ -233,6 +235,8 @@ int
dcc_connect (t_irc_dcc *ptr_dcc)
{
struct sockaddr_in addr;
struct hostent *hostent;
char *ip4;
if (ptr_dcc->type == DCC_CHAT_SEND)
ptr_dcc->status = DCC_WAITING;
@@ -245,12 +249,12 @@ dcc_connect (t_irc_dcc *ptr_dcc)
if (ptr_dcc->sock == -1)
return 0;
}
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
/* for sending (chat or file), listen to socket for a connection */
if (DCC_IS_SEND(ptr_dcc->type))
{
{
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
if (listen (ptr_dcc->sock, 1) == -1)
return 0;
if (fcntl (ptr_dcc->sock, F_SETFL, 0) == -1)
@@ -260,11 +264,32 @@ dcc_connect (t_irc_dcc *ptr_dcc)
/* for receiving (chat or file), connect to listening host */
if (DCC_IS_RECV(ptr_dcc->type))
{
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (ptr_dcc->port);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
if (cfg_proxy_use)
{
memset (&addr, 0, sizeof (addr));
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
ip4 = inet_ntoa(addr.sin_addr);
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (cfg_proxy_port);
addr.sin_family = AF_INET;
if ((hostent = gethostbyname (cfg_proxy_address)) == NULL)
return 0;
memcpy(&(addr.sin_addr),*(hostent->h_addr_list), sizeof(struct in_addr));
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
if (pass_proxy(ptr_dcc->sock, ip4, ptr_dcc->port, ptr_dcc->server->username) == -1)
return 0;
}
else
{
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (ptr_dcc->port);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
}
}
return 1;
@@ -309,6 +334,7 @@ void
dcc_close (t_irc_dcc *ptr_dcc, int status)
{
t_gui_buffer *ptr_buffer;
struct stat st;
ptr_dcc->status = status;
@@ -370,7 +396,14 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
&& DCC_IS_RECV(ptr_dcc->type)
&& ptr_dcc->local_filename
&& ptr_dcc->pos == 0)
unlink (ptr_dcc->local_filename);
{
/* erase file only if really empty on disk */
if (stat (ptr_dcc->local_filename, &st) != -1)
{
if ((unsigned long) st.st_size == 0)
unlink (ptr_dcc->local_filename);
}
}
if (DCC_IS_CHAT(ptr_dcc->type))
channel_remove_dcc (ptr_dcc);
+475
View File
@@ -0,0 +1,475 @@
/*
* 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
*/
/* irc-ignore.c: manages IRC ignore list */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
char *ignore_types[] =
{ IGNORE_ACTION, IGNORE_CTCP, IGNORE_DCC, IGNORE_PRIVATE, NULL };
t_irc_ignore *irc_ignore = NULL;
t_irc_ignore *last_irc_ignore = NULL;
/*
* ignore_check_mask: returns 1 is mask1 and mask2 are the same host
* anyone or both strings may have user and/or host after
*/
int
ignore_check_mask (char *mask1, char *mask2)
{
char *m1, *m2, *pos;
int match;
if (!mask1 || !mask1[0] || !mask2 || !mask2[0])
return 0;
m1 = strdup (mask1);
m2 = strdup (mask2);
pos = strchr (m1, '!');
if (!pos)
{
/* remove '!' from m2 */
pos = strchr (m2, '!');
if (pos)
pos[0] = '\0';
}
pos = strchr (m2, '!');
if (!pos)
{
/* remove '!' from m1 */
pos = strchr (m1, '!');
if (pos)
pos[0] = '\0';
}
/* TODO: use regexp to match both masks */
match = ascii_strcasecmp (m1, m2);
free (m1);
free (m2);
return (match == 0);
}
/*
* ignore_match: check if pointed ignore matches with arguments
*/
int
ignore_match (t_irc_ignore *ptr_ignore, char *mask, char *type, char *channel_name, char *server_name)
{
/* check mask */
if ((strcmp (mask, "*") != 0) && (strcmp (ptr_ignore->mask, "*") != 0)
&& (!ignore_check_mask (ptr_ignore->mask, mask)))
return 0;
/* mask is matching, go on with type */
if ((strcmp (type, "*") != 0) && (strcmp (ptr_ignore->type, "*") != 0)
&& (ascii_strcasecmp (ptr_ignore->type, type) != 0))
return 0;
/* mask and type matching, go on with server */
if (server_name && server_name[0])
{
if ((strcmp (server_name, "*") != 0) && (strcmp (ptr_ignore->server_name, "*") != 0)
&& (ascii_strcasecmp (ptr_ignore->server_name, server_name) != 0))
return 0;
}
else
{
if (strcmp (ptr_ignore->server_name, "*") != 0)
return 0;
}
/* mask, type and server matching, go on with channel */
if (channel_name && channel_name[0])
{
if ((strcmp (channel_name, "*") != 0) && (strcmp (ptr_ignore->channel_name, "*") != 0)
&& (ascii_strcasecmp (ptr_ignore->channel_name, channel_name) != 0))
return 0;
}
else
{
if (strcmp (ptr_ignore->channel_name, "*") != 0)
return 0;
}
/* all is matching => we find a ignore! */
return 1;
}
/*
* ignore_check: check if an ignore is set for arguments
* returns 1 if at least one ignore exists (message should NOT be displayed)
* 0 if no ignore found (message will be displayed)
*/
int
ignore_check (char *mask, char *type, char *channel_name, char *server_name)
{
t_irc_ignore *ptr_ignore;
if (!mask || !mask[0] || !type || !type[0])
return 0;
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
if (ignore_match (ptr_ignore, mask, type, channel_name, server_name))
return 1;
}
/* no ignore found */
return 0;
}
/*
* ignore_search: search for an ignore
*/
t_irc_ignore *
ignore_search (char *mask, char *type, char *channel_name, char *server_name)
{
t_irc_ignore *ptr_ignore;
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
if ((ascii_strcasecmp (ptr_ignore->mask, mask) == 0)
&& (ascii_strcasecmp (ptr_ignore->type, type) == 0)
&& (ascii_strcasecmp (ptr_ignore->channel_name, channel_name) == 0)
&& (ascii_strcasecmp (ptr_ignore->server_name, server_name) == 0))
return ptr_ignore;
}
/* ignore not found */
return NULL;
}
/*
* ignore_add: add an ignore in list
*/
t_irc_ignore *
ignore_add (char *mask, char *type, char *channel_name, char *server_name)
{
int i, type_index;
t_irc_command *command_ptr;
t_irc_ignore *new_ignore;
if (!mask || !mask[0] || !type || !type[0] || !channel_name || !channel_name[0]
|| !server_name || !server_name[0])
{
gui_printf (NULL,
_("%s too few arguments for ignore\n"),
WEECHAT_ERROR);
return NULL;
}
#ifdef DEBUG
wee_log_printf ("Adding ignore: mask:'%s', type:'%s', channel:'%s', server:'%s'\n",
mask, type, channel_name, server_name);
#endif
type_index = -1;
command_ptr = NULL;
if ((strcmp (mask, "*") == 0) && (strcmp (type, "*") == 0))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s mask or type/command should be non generic value for ignore\n"),
WEECHAT_ERROR);
return NULL;
}
if (ignore_search (mask, type, channel_name, server_name))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s ignore already exists\n"),
WEECHAT_ERROR);
return NULL;
}
if (strcmp (type, "*") != 0)
{
/* look for type in pre-defined ignore types */
for (i = 0; ignore_types[i]; i++)
{
if (ascii_strcasecmp (type, ignore_types[i]) == 0)
{
type_index = i;
break;
}
}
/* not a pre-defined ignore type, so it MUST be an IRC command */
if (type_index < 0)
{
for (i = 0; irc_commands[i].command_name; i++)
{
if (irc_commands[i].recv_function &&
(ascii_strcasecmp (type, irc_commands[i].command_name) == 0))
{
command_ptr = &irc_commands[i];
break;
}
}
}
/* not a pre-defined command and not an IRC command => error */
if ((type_index < 0) && (!command_ptr))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown type or IRC command \"%s\" for ignore\n"),
WEECHAT_ERROR, type);
return NULL;
}
}
/* create new ignore */
new_ignore = (t_irc_ignore *) malloc (sizeof (t_irc_ignore));
if (new_ignore)
{
new_ignore->mask = strdup (mask);
new_ignore->type = strdup (type);
new_ignore->server_name = strdup (server_name);
new_ignore->channel_name = strdup (channel_name);
/* add new ignore to queue */
new_ignore->prev_ignore = last_irc_ignore;
new_ignore->next_ignore = NULL;
if (irc_ignore)
last_irc_ignore->next_ignore = new_ignore;
else
irc_ignore = new_ignore;
last_irc_ignore = new_ignore;
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s not enough memory to create ignore\n"),
WEECHAT_ERROR);
return NULL;
}
return new_ignore;
}
/*
* ignore_add_from_config: add an ignore to list, read from config file
* (comma serparated values)
*/
t_irc_ignore *
ignore_add_from_config (char *string)
{
t_irc_ignore *new_ignore;
char *string2;
char *pos_mask, *pos_type, *pos_channel, *pos_server;
if (!string || !string[0])
return NULL;
new_ignore = NULL;
string2 = strdup (string);
pos_mask = string2;
pos_type = strchr (pos_mask, ',');
if (pos_type)
{
pos_type[0] = '\0';
pos_type++;
pos_channel = strchr (pos_type, ',');
if (pos_channel)
{
pos_channel[0] = '\0';
pos_channel++;
pos_server = strchr (pos_channel, ',');
if (pos_server)
{
pos_server[0] = '\0';
pos_server++;
new_ignore = ignore_add (pos_mask, pos_type, pos_channel, pos_server);
}
}
}
free (string2);
return new_ignore;
}
/*
* ignore_free: free an ignore
*/
void
ignore_free (t_irc_ignore *ptr_ignore)
{
t_irc_ignore *new_irc_ignore;
/* free data */
if (ptr_ignore->mask)
free (ptr_ignore->mask);
if (ptr_ignore->type)
free (ptr_ignore->type);
if (ptr_ignore->channel_name)
free (ptr_ignore->channel_name);
if (ptr_ignore->server_name)
free (ptr_ignore->server_name);
/* remove ignore from queue */
if (last_irc_ignore == ptr_ignore)
last_irc_ignore = ptr_ignore->prev_ignore;
if (ptr_ignore->prev_ignore)
{
(ptr_ignore->prev_ignore)->next_ignore = ptr_ignore->next_ignore;
new_irc_ignore = irc_ignore;
}
else
new_irc_ignore = ptr_ignore->next_ignore;
if (ptr_ignore->next_ignore)
(ptr_ignore->next_ignore)->prev_ignore = ptr_ignore->prev_ignore;
free (ptr_ignore);
irc_ignore = new_irc_ignore;
}
/*
* ignore_free_all: free all ignores
*/
void
ignore_free_all ()
{
while (irc_ignore)
ignore_free (irc_ignore);
}
/*
* ignore_search_free: search and free ignore(s)
* return: number of ignore found and deleted
* 0 if no ignore found
*/
int
ignore_search_free (char *mask, char *type, char *channel_name, char *server_name)
{
int found;
t_irc_ignore *ptr_ignore, *next_ignore;
found = 0;
ptr_ignore = irc_ignore;
while (ptr_ignore)
{
if (ignore_match (ptr_ignore, mask, type, channel_name, server_name))
{
found++;
if (found == 1)
gui_printf (NULL, "\n");
irc_display_prefix (NULL, PREFIX_INFO);
weechat_cmd_ignore_display (_("Removing ignore:"), ptr_ignore);
next_ignore = ptr_ignore->next_ignore;
ignore_free (ptr_ignore);
ptr_ignore = next_ignore;
}
else
ptr_ignore = ptr_ignore->next_ignore;
}
return found;
}
/*
* ignore_search_free_by_number: search and free ignore(s) by number
* return: 1 if ignore found and deleted
* 0 if ignore not found
*/
int
ignore_search_free_by_number (int number)
{
int i;
t_irc_ignore *ptr_ignore;
if (number < 1)
return 0;
i = 0;
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
i++;
if (i == number)
{
gui_printf (NULL, "\n");
irc_display_prefix (NULL, PREFIX_INFO);
weechat_cmd_ignore_display (_("Removing ignore:"), ptr_ignore);
ignore_free (ptr_ignore);
return 1;
}
}
/* ignore number not found */
return 0;
}
/*
* ignore_print_log: print ignore list in log (usually for crash dump)
*/
void
ignore_print_log ()
{
t_irc_ignore *ptr_ignore;
wee_log_printf ("[ignore list]\n");
for (ptr_ignore = irc_ignore; ptr_ignore;
ptr_ignore = ptr_ignore->next_ignore)
{
wee_log_printf ("\n");
wee_log_printf (" -> ignore at 0x%X:\n", ptr_ignore);
wee_log_printf (" mask. . . . . . . : %s\n", ptr_ignore->mask);
wee_log_printf (" type. . . . . . . : %s\n", ptr_ignore->type);
wee_log_printf (" channel_name. . . : %s\n", ptr_ignore->channel_name);
wee_log_printf (" server_name . . . : %s\n", ptr_ignore->server_name);
wee_log_printf (" prev_ignore . . . : 0x%X\n", ptr_ignore->prev_ignore);
wee_log_printf (" next_ignore . . . : 0x%X\n", ptr_ignore->next_ignore);
}
}
+12 -9
View File
@@ -30,10 +30,11 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/weeconfig.h"
/*
* nick_find_color: find a color for a nick (less used will be better!)
* nick_find_color: find a color for a nick (according to nick letters)
*/
int
@@ -46,7 +47,7 @@ nick_find_color (t_irc_nick *nick)
{
color += (int)(nick->nick[i]);
}
color = (color % COLOR_WIN_NICK_NUMBER);
color = (color % cfg_look_color_nicks_number);
return COLOR_WIN_NICK_FIRST + color;
}
@@ -87,12 +88,11 @@ nick_compare (t_irc_nick *nick1, t_irc_nick *nick2)
score1 = nick_score_for_sort (nick1);
score2 = nick_score_for_sort (nick2);
comp = strcasecmp(nick1->nick, nick2->nick);
comp = ascii_strcasecmp (nick1->nick, nick2->nick);
if (comp > 0)
score1++;
else
if (comp < 0)
score2++;
if (comp < 0)
score2++;
/* nick1 > nick2 */
if (score1 > score2)
@@ -202,7 +202,7 @@ nick_new (t_irc_channel *channel, char *nick_name,
new_nick->is_halfop = is_halfop;
new_nick->has_voice = has_voice;
new_nick->is_away = 0;
if (strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0)
if (ascii_strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0)
new_nick->color = COLOR_WIN_NICK_SELF;
else
new_nick->color = nick_find_color (new_nick);
@@ -315,11 +315,14 @@ t_irc_nick *
nick_search (t_irc_channel *channel, char *nickname)
{
t_irc_nick *ptr_nick;
if (!nickname)
return NULL;
for (ptr_nick = channel->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
{
if (strcasecmp (ptr_nick->nick, nickname) == 0)
if (ascii_strcasecmp (ptr_nick->nick, nickname) == 0)
return ptr_nick;
}
return NULL;
+1822 -1385
View File
File diff suppressed because it is too large Load Diff
+43 -2
View File
@@ -82,6 +82,47 @@ irc_cmd_send_admin (t_irc_server *server, char *arguments)
return 0;
}
/*
* irc_cmd_send_ame: send a ctcp action to all channels of all connected servers
*/
int
irc_cmd_send_ame (t_irc_server *server, char *arguments)
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
/* make gcc happy */
(void) server;
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 :\01ACTION %s\01\r\n",
ptr_channel->name,
(arguments && arguments[0]) ? arguments : "");
irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME);
gui_printf_color (ptr_channel->buffer,
COLOR_WIN_CHAT_NICK, "%s", ptr_server->nick);
gui_printf_color (ptr_channel->buffer,
COLOR_WIN_CHAT, " %s\n",
(arguments && arguments[0]) ? arguments : "");
}
}
}
}
gui_add_hotlist = 1;
return 0;
}
/*
* irc_cmd_send_amsg: send message to all channels of all connected servers
*/
@@ -367,7 +408,7 @@ irc_cmd_send_ctcp (t_irc_server *server, char *arguments)
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))
if ((ascii_strcasecmp (pos_type, "ping") == 0) && (!pos_args))
{
gettimeofday (&tv, &tz);
server_sendf (server, "PRIVMSG %s :\01PING %d %d\01\r\n",
@@ -451,7 +492,7 @@ irc_cmd_send_dcc (t_irc_server *server, char *arguments)
dcc_send_request (server, DCC_CHAT_SEND, pos_nick, NULL);
}
else if (strcasecmp (arguments, "close") == 0)
else if (ascii_strcasecmp (arguments, "close") == 0)
{
if (BUFFER_IS_PRIVATE(gui_current_window->buffer) &&
CHANNEL(gui_current_window->buffer)->dcc_chat)
+282 -250
View File
@@ -523,6 +523,42 @@ server_msgq_add_msg (t_irc_server *server, char *msg)
}
}
/*
* server_msgq_add_unterminated: add an unterminated message to queue
*/
void
server_msgq_add_unterminated (t_irc_server *server, char *string)
{
if (server->unterminated_message)
{
server->unterminated_message =
(char *) realloc (server->unterminated_message,
strlen (server->unterminated_message) +
strlen (string) + 1);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
else
strcat (server->unterminated_message, string);
}
else
{
server->unterminated_message = strdup (string);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
}
}
/*
* server_msgq_add_buffer: explode received buffer, creating queued messages
*/
@@ -543,44 +579,27 @@ server_msgq_add_buffer (t_irc_server *server, char *buffer)
}
else
{
pos = strstr (buffer, "\n");
if (pos)
pos = strstr (buffer, "\r");
if (pos && !pos[1])
{
pos[0] = '\0';
server_msgq_add_msg (server, buffer);
buffer = pos + 1;
server_msgq_add_unterminated (server, buffer);
return;
}
else
{
if (server->unterminated_message)
pos = strstr (buffer, "\n");
if (pos)
{
server->unterminated_message =
(char *) realloc (server->unterminated_message,
strlen (server->unterminated_message) +
strlen (buffer) + 1);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
else
strcat (server->unterminated_message, buffer);
pos[0] = '\0';
server_msgq_add_msg (server, buffer);
buffer = pos + 1;
}
else
{
server->unterminated_message = strdup (buffer);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
server_msgq_add_unterminated (server, buffer);
return;
}
return;
}
}
}
@@ -663,8 +682,8 @@ server_msgq_flush ()
case -3:
irc_display_prefix (recv_msgq->server->buffer, PREFIX_ERROR);
gui_printf (recv_msgq->server->buffer,
_("%s Unknown command: cmd=%s, args=%s\n"),
WEECHAT_WARNING, command, args);
_("%s Unknown command: cmd=%s, host=%s, args=%s\n"),
WEECHAT_WARNING, command, host, args);
break;
}
@@ -900,12 +919,12 @@ void
convbase64_8x3_to_6x4(char *from, char* to)
{
unsigned char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
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 ];
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 ];
}
/*
@@ -916,91 +935,92 @@ void
base64encode(char *from, char *to)
{
char *f, *t;
int from_len;
char *f, *t;
int from_len;
from_len = strlen(from);
from_len = strlen(from);
f = from;
t = to;
f = from;
t = to;
while(from_len >= 3)
while(from_len >= 3)
{
convbase64_8x3_to_6x4(f, t);
f += 3 * sizeof(*f);
t += 4 * sizeof(*t);
from_len -= 3;
convbase64_8x3_to_6x4(f, t);
f += 3 * sizeof(*f);
t += 4 * sizeof(*t);
from_len -= 3;
}
if (from_len > 0)
if (from_len > 0)
{
char rest[3] = { 0, 0, 0 };
switch(from_len)
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;
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;
rest[0] = f[0];
rest[1] = f[1];
convbase64_8x3_to_6x4(rest, t);
t[3] = '=';
break;
}
t[4] = 0;
t[4] = 0;
}
}
/*
* pass_httpproxy: establish connection/authentification to an http proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_httpproxy(t_irc_server *server)
pass_httpproxy(int sock, char *address, int port)
{
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;
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)
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);
// 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", address, port, authbuf_base64);
}
else
else
{
// no authentification
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\n\r\n", server->address, server->port);
// no authentification
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\n\r\n", address, port);
}
m = send (server->sock, buffer, n, 0);
if (n != m)
return 1;
m = send (sock, buffer, n, 0);
if (n != m)
return 1;
n = recv(server->sock, buffer, sizeof(buffer), 0);
n = recv(sock, buffer, sizeof(buffer), 0);
/* success result must be like : "HTTP/1.0 200 OK" */
if (n < 12)
return 1;
/* 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;
if (memcmp (buffer, "HTTP/", 5) || memcmp (buffer + 9, "200", 3))
return 1;
return 0;
return 0;
}
/*
* resolve: resolve hostname on its IP address
* (works with ipv4 and ipv6)
* return :
* return :
* - 0 if resolution was successful
* - 1 if resolution fails
*/
@@ -1042,207 +1062,210 @@ resolve (char *hostname, char *ip, int *version)
/*
* pass_socks4proxy: establish connection/authentification throw a socks4 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks4proxy(t_irc_server *server)
pass_socks4proxy(int sock, char *address, int port, char *username)
{
/*
* socks4 protocol is explain here:
* http://archive.socks.permeo.com/protocol/socks4.protocol
*
*/
/*
* 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];
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);
socks4.version = 4;
socks4.method = 1;
socks4.port = htons (port);
resolve(address, ip_addr, NULL);
socks4.address = inet_addr (ip_addr);
strncpy (socks4.user, username, sizeof(socks4.user) - 1);
send (server->sock, (char *) &socks4, 8 + strlen(socks4.user) + 1, 0);
recv (server->sock, buffer, sizeof(buffer), 0);
send (sock, (char *) &socks4, 8 + strlen(socks4.user) + 1, 0);
recv (sock, buffer, sizeof(buffer), 0);
if (buffer[0] == 0 && buffer[1] == 90)
return 0;
if (buffer[0] == 0 && buffer[1] == 90)
return 0;
return 1;
return 1;
}
/*
* pass_socks5proxy: establish connection/authentification throw a socks5 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks5proxy(t_irc_server *server)
pass_socks5proxy(int sock, char *address, int port)
{
/*
* socks5 protocol is explained in RFC 1928
* socks5 authentication with username/pass is explained in RFC 1929
*/
/*
* 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)
struct s_sock5
{
/* with authentication */
/* -> socks server must respond with :
* - socks version (buffer[0]) = 5 => socks5
* - socks method (buffer[1]) = 2 => authentication
*/
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 (sock, (char *) &socks5, sizeof(socks5), 0);
/* server socks5 must respond with 2 bytes */
if (recv (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;
//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);
/* 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);
/* 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);
send (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;
/* server socks5 must respond with 2 bytes */
if (recv (sock, buffer, 2, 0) != 2)
return 1;
/* buffer[1] = auth state, must be 0 for success */
if (buffer[1] != 0)
return 1;
/* buffer[1] = auth state, must be 0 for success */
if (buffer[1] != 0)
return 1;
}
else
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;
/* 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 */
/* authentication successful then giving address/port to connect */
addr_len = strlen(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, address, addr_len); /* server address */
*((unsigned short *) (addr_buffer + 5 + addr_len)) = htons (port); /* server port */
send (server->sock, addr_buffer, addr_buffer_len, 0);
free(addr_buffer);
send (sock, addr_buffer, addr_buffer_len, 0);
free(addr_buffer);
/* dialog with proxy server */
if (recv (server->sock, buffer, 4, 0) != 4)
return 1;
/* dialog with proxy server */
if (recv (sock, buffer, 4, 0) != 4)
return 1;
if (!(buffer[0] == 5 && buffer[1] == 0))
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;
}
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 (sock, buffer, 6, 0) != 6)
return 1;
break;
case 3:
/* domainname
* server socks return server bound address and port
*/
/* reading address length */
if (recv (sock, buffer, 1, 0) != 1)
return 1;
addr_len = buffer[0];
/* reading address + port = addr_len + 2 */
if (recv (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 (sock, buffer, 18, 0) != 18)
return 1;
break;
default:
return 1;
}
return 0;
return 0;
}
/*
* pass_proxy: establish connection/authentification to a proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
* 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;
int
pass_proxy(int sock, char *address, int port, char *username)
{
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "http") == 0)
return pass_httpproxy(sock, address, port);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks4") == 0)
return pass_socks4proxy(sock, address, port, username);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks5") == 0)
return pass_socks5proxy(sock, address, port);
return 1;
}
/*
@@ -1291,7 +1314,7 @@ server_child (t_irc_server *server)
return 0;
}
if (pass_proxy(server))
if (pass_proxy(server->sock, server->address, server->port, server->username))
{
write(server->child_write, "4", 1);
freeaddrinfo (res);
@@ -1426,7 +1449,10 @@ server_connect (t_irc_server *server)
server->child_write = child_pipe[1];
/* create socket and set options */
server->sock = socket ((server->ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
if (cfg_proxy_use)
server->sock = socket ((cfg_proxy_ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
else
server->sock = socket ((server->ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
if (server->sock == -1)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
@@ -1583,6 +1609,9 @@ server_search (char *servername)
{
t_irc_server *ptr_server;
if (!servername)
return NULL;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
@@ -1621,6 +1650,9 @@ server_name_already_exists (char *name)
{
t_irc_server *ptr_server;
if (!name)
return 0;
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (strcmp (ptr_server->name, name) == 0)

Some files were not shown because too many files have changed in this diff Show More