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

Compare commits

...

84 Commits

Author SHA1 Message Date
Sebastien Helleu b738f4c8aa Version 0.1.3 2005-07-02 17:21:50 +00:00
Sebastien Helleu 6f3b6d9e50 Version 0.1.3 2005-07-02 17:03:23 +00:00
Sebastien Helleu def35c5a66 Updated doc 2005-07-02 16:07:52 +00:00
Sebastien Helleu da4ee1a6ee Added tests after getaddrinfo function 2005-07-02 16:01:02 +00:00
Sebastien Helleu 7c31dd9189 gnutls lib now optional, configure goes on if lib is not found 2005-07-02 15:59:44 +00:00
Sebastien Helleu dbad2a0206 Translated some messages and added calls to freeaddrinfo() function 2005-06-30 20:16:07 +00:00
Emmanuel Bouthenot ec1d57063c - proxy support (http, socks4, socks5) with authentification for http, socks5 2005-06-30 19:22:01 +00:00
Sebastien Helleu 5bd56f86c6 * commands from users outside channel now authorized (if special user or channel without "n" flag)
* completion added for config option (with /set command)
2005-06-30 12:55:36 +00:00
Sebastien Helleu 2fab4da03d Updated TODO with SSL and IPv6 2005-06-28 08:33:13 +00:00
Sebastien Helleu c69c77507c Added IPv6 and SSL options for command line IRC url 2005-06-28 08:24:43 +00:00
Sebastien Helleu b330ec3dae Added IPv6 support 2005-06-27 16:27:31 +00:00
Sebastien Helleu ae8f8a5700 gnutls code compiled according to pre-processor var HAVE_GNUTLS 2005-06-22 21:08:21 +00:00
Julien Louis 5e8b47f187 * Add --disable-gnutls option to turn off gnutls support
* Remove wxwidgets checks when --enable-wxwidgets arg is not given
2005-06-22 18:50:24 +00:00
Sebastien Helleu f4abd0bf59 Added certificate management in SSL (connection now ok with SSL server) 2005-06-21 08:05:58 +00:00
Sebastien Helleu abe7e08147 kill command now received and displayed 2005-06-20 14:04:17 +00:00
Sebastien Helleu 4e9193a943 Added SSL support with gnutls lib 2005-06-19 20:55:10 +00:00
Julien Louis bbd373c44d Update debian/changelog 2005-06-19 19:44:01 +00:00
Sebastien Helleu 6b011234cf Added kolter and ptitlouis 2005-06-19 15:51:22 +00:00
Sebastien Helleu 71a76ada48 Channel notify levels are saved in config file 2005-06-19 14:22:11 +00:00
Sebastien Helleu a7ddb89076 Updated README 2005-06-18 20:27:05 +00:00
Sebastien Helleu 6fe262c131 File automatically updated 2005-06-18 11:44:37 +00:00
Julien Louis 0a32bc5326 Fix wrong debhelper version dependency. 2005-06-18 09:38:59 +00:00
Sebastien Helleu 70fe8e9472 part message now accepts %v (replaced by WeeChat version), like quit message 2005-06-18 09:28:16 +00:00
Julien Louis b0310b6e78 Set debhelper compatibility to avoid warnings during package build 2005-06-18 09:25:30 +00:00
Julien Louis 8218316502 Sync with official debian package 2005-06-18 08:42:08 +00:00
Emmanuel Bouthenot d00c99f292 errors while loading perl scripts are now displayed in server buffer (instead of current buffer) 2005-06-16 17:02:37 +00:00
Emmanuel Bouthenot f72e5952f2 in python scripts, all messages written in stdin and stderr are redirect in server window 2005-06-16 16:52:17 +00:00
Emmanuel Bouthenot ebf5f9e66d in python scripts, all messages written in stdin and stderr are redirect in server window 2005-06-16 16:41:41 +00:00
Emmanuel Bouthenot 7330dc862a fix a filename error while loading a python script manually 2005-06-16 16:38:36 +00:00
Sebastien Helleu 9eb1422bb7 Fixed plugins "print" and "prnt" functions: now ok for writing on server buffers 2005-06-16 11:02:19 +00:00
Sebastien Helleu d86a783b6a Fixed color problem with new libcurses version 2005-06-15 17:17:45 +00:00
Sebastien Helleu 5b3f96dace Display message content when nick is not found for an incoming "PRIVMSG" message 2005-06-15 17:16:35 +00:00
Emmanuel Bouthenot 821c2e87c8 update examples in python API 2005-06-05 12:54:31 +00:00
Sebastien Helleu 1de7b52aa2 Fixed crash when using alt-S or alt-X keys on DCC buffer (alt-D) 2005-05-31 15:09:54 +00:00
Sebastien Helleu 4d4a667094 Fixed crash when using alt-S or alt-X keys on DCC buffer (alt-D) 2005-05-31 07:55:17 +00:00
Emmanuel Bouthenot 0eb3d45582 Fix python library detection on FreeBSD 2005-05-29 15:15:12 +00:00
Sebastien Helleu 7c63a73999 Added cast to prevent problems with AMD64 where size_t is not int 2005-05-29 07:20:15 +00:00
Sebastien Helleu 2ab3467c05 Added cast for away time display (to prevent problems with *BSD, where time_t is int and not long int) 2005-05-29 06:46:01 +00:00
Emmanuel Bouthenot 37d74c4941 Fix perl headers and library detection on various systems 2005-05-24 15:14:54 +00:00
Sebastien Helleu 01186c6c8b Fixed startup crash when weechat config file is not found 2005-05-24 14:10:56 +00:00
Emmanuel Bouthenot 29ffe7e0d8 Remove unused $PERL_LIB var due to an impoved libperl detection 2005-05-23 21:52:53 +00:00
Emmanuel Bouthenot a8619181b7 Fix libperl and libpython detection 2005-05-23 21:45:50 +00:00
Julien Louis 5a90270a79 Fix configure args handling 2005-05-22 17:40:25 +00:00
Sebastien Helleu 3900a0f5ae Version 0.1.3-cvs 2005-05-22 16:12:24 +00:00
Sebastien Helleu 5f46617b11 Version 0.1.2 2005-05-21 07:04:11 +00:00
Sebastien Helleu 68ec2acbb3 Empty sources added for wxWidgets GUI 2005-05-21 05:29:50 +00:00
Sebastien Helleu e7041a467b Added "++++" at bottom of nicklist if end of nicklist is not displayed 2005-05-18 19:03:34 +00:00
Julien Louis ee2121b917 Remove weechat-gtk dependency since GTK gui does not exist 2005-05-12 19:56:53 +00:00
Sebastien Helleu bff5f95056 Plugin message handler is now called for own messages (as "privmsg" IRC command, with "localhost" as host to differenciate from other messages) 2005-05-08 12:19:47 +00:00
Sebastien Helleu 2b178c73fa Updated doc with new Perl/Python script interface 2005-05-07 22:53:05 +00:00
Sebastien Helleu 13d8a4f093 Fixed buffer detection for Perl/Python "print" and "command" functions 2005-05-07 11:26:31 +00:00
Sebastien Helleu b935a02ceb Perl and Python libraries now cheked in configure script 2005-05-07 09:29:26 +00:00
Sebastien Helleu e7c899014c Fixed nicklist sort mode: now modes are not cumulated any more (so for example all op will be sorted together) 2005-05-07 06:56:01 +00:00
Sebastien Helleu f88b75b241 Allow only server (with blank channel) for buffer search (for print & command functions) 2005-05-05 16:41:22 +00:00
Sebastien Helleu c8ad30020b Improved Perl interface and some changes in Python:
- function "print_with_channel" was removed
- function "command" now runs weechat command or send text to channel
- Perl functions are now called with weechat::name (instead of IRC::name)
- IRC::xxx functions are still active for compatibility with old scripts
2005-05-05 16:26:34 +00:00
Sebastien Helleu c6fc8bd147 Added Python plugin support 2005-05-01 19:03:15 +00:00
Sebastien Helleu eda55fbdb4 Added Python plugin support 2005-05-01 18:53:23 +00:00
Sebastien Helleu dca4064502 Added nicklist scroll keys (Alt+{home/end/pgup/pgdn} or F11/F12) 2005-04-30 19:21:28 +00:00
Sebastien Helleu 8a3d30b03a Changes for Mac OS X platform (now ok) 2005-04-30 10:29:54 +00:00
Sebastien Helleu 40d02fdffd Added IRC command "671" 2005-04-28 18:34:12 +00:00
Sebastien Helleu 7cc2635652 wxWidgets CFLAGS & libs are used for wxWidgets GUI only 2005-04-24 18:33:26 +00:00
Sebastien Helleu df2f164ffc wxWidgets missing error is now displayed only if this frontend is selected with --enable-wxwidgets switch 2005-04-24 12:01:23 +00:00
Benoit Papillault eb0b722ee5 Added WxWidgets frontend (no source files) 2005-04-24 11:08:22 +00:00
Sebastien Helleu 04d6257224 Backup and restore Makefile.am before and after gettextize 2005-04-24 08:48:54 +00:00
Sebastien Helleu 73c69d2d71 Added transfer rate for DCC files 2005-04-23 18:13:25 +00:00
Sebastien Helleu 2f9f37bed6 Updated autogen.sh script 2005-04-23 15:03:27 +00:00
Sebastien Helleu d90587c443 Fixed call to "has_color" in gui_window_set_color function 2005-04-22 16:47:02 +00:00
Sebastien Helleu 992632857f Added "485" IRC command 2005-04-20 21:27:44 +00:00
Sebastien Helleu 5ebab583f6 Added "-all" option for /nick command, added "341" IRC command (for invitation) 2005-04-19 21:02:59 +00:00
Sebastien Helleu ca117dbb24 Added config.rpath in extra dist 2005-04-19 20:08:19 +00:00
Sebastien Helleu 40c348df7a Removed debian/files from extra dist (not used) 2005-04-17 21:58:03 +00:00
Sebastien Helleu 0b781f96f7 Improved gettext installation (now ok under BSD) 2005-04-17 19:01:18 +00:00
Sebastien Helleu 5090689a76 Buffers timestamp can now be changed (new option in config file) 2005-04-09 11:34:15 +00:00
Sebastien Helleu a92ca4961b Hotlist not changed when self away or nick change 2005-04-09 08:03:53 +00:00
Sebastien Helleu ae8a4633ef Allow nick completion in private buffer with /me command 2005-04-07 18:58:01 +00:00
Sebastien Helleu 38505d02dd Fixed display bug with "-MORE-" in private or server buffers 2005-04-05 18:21:01 +00:00
Sebastien Helleu 20dcc4f56e Fixed crash when purging old DCC 2005-04-03 17:12:12 +00:00
Sebastien Helleu 36b2e10497 Fixed crash with 64-bits arch (like AMD64) when converting UTF-8, added weechat version in log at startup 2005-03-24 16:42:24 +00:00
Sebastien Helleu cec88e0047 "FIFO pipe" chapter translated to spanish 2005-03-21 21:57:16 +00:00
Sebastien Helleu 3198879ff2 Added missing IRC command 307 2005-03-21 06:18:03 +00:00
Sebastien Helleu 88a6fc7f16 Updated file 2005-03-20 10:17:30 +00:00
Sebastien Helleu fbcd5b3673 Remove compilation in parent dir for gui dir 2005-03-20 10:09:42 +00:00
Sebastien Helleu 7fe5afe3cb Check return codes in autogen.sh, remove compilation in parent dir for gui dir 2005-03-20 10:04:51 +00:00
Sebastien Helleu 212ca071c6 Version 0.1.2-cvs 2005-03-20 09:52:24 +00:00
122 changed files with 20002 additions and 6694 deletions
+996
View File
@@ -0,0 +1,996 @@
1 Notes on the Free Translation Project
***************************************
Free software is going international! The Free Translation Project is
a way to get maintainers of free software, translators, and users all
together, so that free software will gradually become able to speak many
languages. A few packages already provide translations for their
messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work on translations can contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
1.1 Quick configuration advice
==============================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias, message inheritance, automatic
charset conversion or plural form handling) as the implementation here.
It is also not possible to offer this additional functionality on top
of a `catgets' implementation. Future versions of GNU `gettext' will
very likely convey even more functionality. So it might be a good idea
to change to GNU `gettext' as soon as possible.
So you need _not_ provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
1.2 INSTALL Matters
===================
Some packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU `gettext'. Other packages have their own ways to
internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. If not, the included GNU
`gettext' library will be used. This library is wholly contained
within this package, usually in the `intl/' subdirectory, so prior
installation of the GNU `gettext' package is _not_ required.
Installers may use special options at configuration time for changing
the default behaviour. The commands:
./configure --with-included-gettext
./configure --disable-nls
will, respectively, bypass any pre-existing `gettext' to use the
internationalizing routines provided within this package, or else,
_totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might not be desirable. You should use
the more recent version of the GNU `gettext' library. I.e. if the file
`intl/VERSION' shows that the library which comes with this package is
more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
Internationalized packages usually have many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
1.3 Using This Package
======================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
and `CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your country by running the command
`locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
Special advice for Norwegian users: The language code for Norwegian
bokma*l changed from `no' to `nb' recently (in 2003). During the
transition period, while some message catalogs for this language are
installed under `nb' and some older ones under `no', it's recommended
for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
older translations are used.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
1.4 Translating Teams
=====================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skill are praised more than
programming skill, here.
1.5 Available Packages
======================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of May 2005.
The matrix shows, in regard of each package, for which languages PO
files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB
+-------------------------------------------------+
GNUnet | |
a2ps | [] [] [] [] [] |
aegis | () |
ant-phone | () |
anubis | [] |
ap-utils | |
aspell | [] [] [] [] |
bash | [] [] |
batchelor | [] |
bfd | |
bibshelf | [] |
binutils | [] |
bison | [] [] |
bluez-pin | [] [] [] [] |
clisp | [] [] |
console-tools | [] [] |
coreutils | [] [] [] [] |
cpio | |
cpplib | [] [] [] |
darkstat | [] () [] |
dialog | [] [] [] [] [] [] |
diffutils | [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] [] |
fetchmail | [] [] () [] |
fileutils | [] [] |
findutils | [] [] [] |
flex | [] [] [] |
fslint | [] |
gas | |
gawk | [] [] [] |
gbiff | [] |
gcal | [] |
gcc | [] |
gettext-examples | [] [] [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] [] [] |
gip | |
gliv | [] |
glunarclock | |
gmult | [] [] |
gnubiff | () |
gnucash | [] () () [] |
gnucash-glossary | [] () |
gpe-aerial | [] [] |
gpe-beam | [] [] |
gpe-calendar | [] [] |
gpe-clock | [] [] |
gpe-conf | [] [] |
gpe-contacts | |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] |
gpsdrive | () () |
gramadoir | [] [] |
grep | [] [] [] [] [] [] |
gretl | |
gsasl | [] |
gss | |
gst-plugins | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] () |
gtkspell | [] [] [] |
hello | [] [] [] [] |
id-utils | [] [] |
impost | |
indent | [] [] |
iso_3166 | |
iso_3166_1 | [] [] [] [] [] |
iso_3166_2 | |
iso_3166_3 | [] |
iso_4217 | |
iso_639 | |
jpilot | [] |
jtag | |
jwhois | |
kbd | [] [] [] [] |
latrine | () |
ld | [] |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] [] [] |
libgphoto2 | [] |
libgphoto2_port | [] |
libgsasl | |
libiconv | [] [] [] [] [] |
libidn | |
lifelines | [] () |
lilypond | [] |
lingoteach | |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | [] |
make | [] [] |
man-db | [] () [] [] |
minicom | [] [] |
mysecretdiary | [] [] |
nano | [] () [] |
nano_1_0 | [] () [] [] |
opcodes | [] |
parted | [] [] [] [] |
psmisc | |
ptx | [] [] [] |
pwdutils | |
python | |
radius | [] |
recode | [] [] [] [] [] |
rpm | [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] [] [] |
sed | [] [] |
sh-utils | [] [] |
shared-mime-info | [] [] |
sharutils | [] [] [] [] [] |
silky | |
skencil | [] () |
sketch | [] () |
solfege | [] |
soundtracker | [] [] |
sp | [] |
stardict | [] |
tar | |
texinfo | [] [] |
textutils | [] [] [] |
tin | () () |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] [] |
vorbis-tools | [] [] [] [] |
wastesedge | () |
wdiff | [] [] [] [] |
wget | |
xchat | [] [] [] [] [] |
xkeyboard-config | |
xpad | |
+-------------------------------------------------+
af am ar az be bg bs ca cs cy da de el en en_GB
10 0 0 2 7 5 0 40 43 2 51 91 19 1 14
eo es et eu fa fi fr ga gl he hi hr hu id is
+-----------------------------------------------+
GNUnet | |
a2ps | [] [] [] |
aegis | |
ant-phone | [] |
anubis | [] |
ap-utils | [] |
aspell | [] [] |
bash | [] [] [] [] |
batchelor | [] [] |
bfd | [] |
bibshelf | [] [] |
binutils | [] [] |
bison | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] |
clisp | [] [] |
console-tools | |
coreutils | [] [] [] [] [] |
cpio | [] [] |
cpplib | [] [] |
darkstat | [] () [] [] [] |
dialog | [] [] [] [] [] [] [] |
diffutils | [] [] [] [] [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] |
error | [] [] [] [] [] |
fetchmail | [] |
fileutils | [] [] [] [] [] |
findutils | [] [] [] [] |
flex | [] [] [] |
fslint | [] |
gas | [] [] |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] [] |
gcc | [] |
gettext-examples | [] [] [] |
gettext-runtime | [] [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] |
gip | [] [] [] |
gliv | () |
glunarclock | [] [] [] |
gmult | [] [] |
gnubiff | () |
gnucash | [] () |
gnucash-glossary | [] |
gpe-aerial | [] [] |
gpe-beam | [] [] |
gpe-calendar | [] [] [] [] |
gpe-clock | [] [] [] |
gpe-conf | [] |
gpe-contacts | [] |
gpe-edit | [] [] |
gpe-go | [] [] |
gpe-login | [] [] [] |
gpe-ownerinfo | [] [] [] [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] [] |
gpe-taskmanager | [] [] [] |
gpe-timesheet | [] [] [] [] |
gpe-today | [] [] [] [] |
gpe-todo | [] [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] |
gpsdrive | () () [] |
gramadoir | [] [] |
grep | [] [] [] [] [] [] [] [] [] [] [] |
gretl | [] [] |
gsasl | [] [] [] |
gss | [] |
gst-plugins | [] [] |
gstreamer | |
gtick | [] [] [] [] |
gtkspell | [] [] [] [] [] |
hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] |
impost | [] [] |
indent | [] [] [] [] [] [] [] [] [] [] |
iso_3166 | [] [] [] |
iso_3166_1 | [] [] [] [] [] [] [] |
iso_3166_2 | [] |
iso_3166_3 | [] |
iso_4217 | [] [] [] |
iso_639 | [] [] [] [] |
jpilot | [] [] |
jtag | [] |
jwhois | [] [] [] [] |
kbd | [] [] |
latrine | [] [] |
ld | [] [] |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] [] [] [] [] |
libgphoto2 | [] [] [] |
libgphoto2_port | [] |
libgsasl | [] [] |
libiconv | [] [] [] [] [] [] [] [] [] [] |
libidn | [] [] |
lifelines | () |
lilypond | |
lingoteach | [] [] |
lynx | [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] [] [] [] [] |
man-db | () |
minicom | [] [] [] [] |
mysecretdiary | [] [] [] |
nano | [] [] () [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] |
psmisc | [] |
ptx | [] [] [] [] [] [] [] [] [] |
pwdutils | |
python | |
radius | [] [] |
recode | [] [] [] [] [] [] [] |
rpm | [] |
screem | |
scrollkeeper | [] [] [] |
sed | [] [] [] [] [] [] |
sh-utils | [] [] [] [] [] [] |
shared-mime-info | [] [] [] [] [] [] |
sharutils | [] [] [] [] [] [] |
silky | [] |
skencil | [] [] |
sketch | [] [] |
solfege | |
soundtracker | [] [] |
sp | [] |
stardict | [] |
tar | [] [] [] [] |
texinfo | [] [] [] |
textutils | [] [] [] [] [] |
tin | [] () |
tp-robot | [] [] |
tuxpaint | [] [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | [] [] |
util-linux | [] [] [] [] [] |
vorbis-tools | [] [] |
wastesedge | () |
wdiff | [] [] [] [] [] [] [] |
wget | [] [] [] [] |
xchat | [] [] [] [] [] |
xkeyboard-config | |
xpad | [] [] [] |
+-----------------------------------------------+
eo es et eu fa fi fr ga gl he hi hr hu id is
15 85 21 15 2 35 115 45 16 8 1 6 40 27 1
it ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
+--------------------------------------------------+
GNUnet | |
a2ps | () () [] [] () |
aegis | () |
ant-phone | [] |
anubis | [] [] [] |
ap-utils | |
aspell | [] [] |
bash | [] |
batchelor | [] |
bfd | |
bibshelf | [] |
binutils | |
bison | [] [] [] [] |
bluez-pin | [] [] |
clisp | [] |
console-tools | |
coreutils | [] [] |
cpio | |
cpplib | [] |
darkstat | [] [] |
dialog | [] [] |
diffutils | [] [] [] [] |
doodle | [] |
e2fsprogs | [] |
enscript | [] |
error | [] |
fetchmail | [] [] |
fileutils | [] [] [] |
findutils | [] [] |
flex | [] [] |
fslint | [] |
gas | |
gawk | [] [] |
gbiff | [] |
gcal | |
gcc | |
gettext-examples | [] [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] [] [] |
gimp-print | [] [] |
gip | [] |
gliv | [] |
glunarclock | [] [] |
gmult | [] [] |
gnubiff | () |
gnucash | [] () () [] |
gnucash-glossary | [] [] |
gpe-aerial | [] |
gpe-beam | [] |
gpe-calendar | [] |
gpe-clock | [] |
gpe-conf | [] |
gpe-contacts | |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] |
gpe-ownerinfo | [] |
gpe-sketchbook | [] |
gpe-su | [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] |
gpe-todo | [] |
gphoto2 | [] [] [] |
gprof | |
gpsdrive | () () () () |
gramadoir | () |
grep | [] [] [] [] |
gretl | [] |
gsasl | [] |
gss | |
gst-plugins | [] [] |
gstreamer | [] [] |
gtick | [] [] |
gtkspell | [] [] [] |
hello | [] [] [] [] [] [] [] [] [] |
id-utils | [] [] |
impost | |
indent | [] [] [] |
iso_3166 | [] |
iso_3166_1 | [] [] |
iso_3166_2 | [] |
iso_3166_3 | [] |
iso_4217 | [] [] [] |
iso_639 | [] [] [] |
jpilot | () () () |
jtag | |
jwhois | [] [] |
kbd | [] |
latrine | [] [] |
ld | |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] |
libgphoto2 | [] [] |
libgphoto2_port | [] [] |
libgsasl | [] |
libiconv | [] [] |
libidn | [] |
lifelines | [] |
lilypond | |
lingoteach | [] [] |
lynx | [] [] [] |
m4 | [] [] |
mailutils | |
make | [] [] [] |
man-db | () |
minicom | [] |
mysecretdiary | [] |
nano | [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] |
parted | [] [] [] [] |
psmisc | [] [] [] |
ptx | [] [] [] |
pwdutils | |
python | |
radius | |
recode | [] [] |
rpm | [] [] |
screem | [] |
scrollkeeper | [] [] [] |
sed | [] [] |
sh-utils | [] [] [] |
shared-mime-info | [] [] [] [] |
sharutils | [] [] [] |
silky | [] |
skencil | |
sketch | |
solfege | [] [] [] |
soundtracker | [] |
sp | () |
stardict | [] [] |
tar | [] [] [] |
texinfo | [] [] [] |
textutils | [] [] [] |
tin | |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] |
vorbis-tools | [] |
wastesedge | [] |
wdiff | [] [] [] |
wget | [] |
xchat | [] [] [] [] [] |
xkeyboard-config | [] |
xpad | [] |
+--------------------------------------------------+
it ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
46 35 11 2 1 1 2 2 3 11 0 15 96 7 5 0
or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv
+----------------------------------------------+
GNUnet | |
a2ps | () [] [] [] [] [] [] |
aegis | () () |
ant-phone | [] |
anubis | [] [] [] |
ap-utils | () |
aspell | [] [] |
bash | [] [] [] |
batchelor | [] |
bfd | |
bibshelf | |
binutils | [] [] |
bison | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] [] [] |
clisp | [] |
console-tools | [] |
coreutils | [] [] [] [] |
cpio | [] [] |
cpplib | |
darkstat | [] [] [] [] [] [] |
dialog | [] [] [] [] [] [] [] |
diffutils | [] [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] |
fetchmail | [] [] [] [] |
fileutils | [] [] [] [] [] |
findutils | [] [] [] [] [] [] |
flex | [] [] [] [] [] |
fslint | [] [] [] |
gas | |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] |
gcc | |
gettext-examples | [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] [] [] |
gimp-print | [] [] |
gip | [] [] [] |
gliv | [] [] [] |
glunarclock | [] [] [] [] [] [] |
gmult | [] [] [] [] |
gnubiff | () [] |
gnucash | () [] [] [] [] |
gnucash-glossary | [] [] [] |
gpe-aerial | [] [] [] [] [] [] |
gpe-beam | [] [] [] [] [] [] |
gpe-calendar | [] [] [] [] [] [] [] |
gpe-clock | [] [] [] [] [] [] [] |
gpe-conf | [] [] [] [] [] [] |
gpe-contacts | [] [] [] [] |
gpe-edit | [] [] [] [] [] [] [] |
gpe-go | [] [] [] [] [] |
gpe-login | [] [] [] [] [] [] [] |
gpe-ownerinfo | [] [] [] [] [] [] [] |
gpe-sketchbook | [] [] [] [] [] [] [] |
gpe-su | [] [] [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] [] [] |
gpe-timesheet | [] [] [] [] [] [] [] |
gpe-today | [] [] [] [] [] [] [] |
gpe-todo | [] [] [] [] [] [] [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] |
gpsdrive | [] [] |
gramadoir | [] |
grep | [] [] [] [] [] [] [] |
gretl | [] |
gsasl | [] [] [] [] [] |
gss | [] [] [] |
gst-plugins | [] [] [] [] |
gstreamer | [] [] [] [] |
gtick | [] [] [] |
gtkspell | [] [] [] [] [] [] |
hello | [] [] [] [] [] [] [] |
id-utils | [] [] [] [] |
impost | |
indent | [] [] [] [] [] [] |
iso_3166 | [] [] [] [] [] |
iso_3166_1 | [] [] [] [] |
iso_3166_2 | |
iso_3166_3 | [] [] [] |
iso_4217 | [] [] |
iso_639 | [] [] [] |
jpilot | |
jtag | [] |
jwhois | [] [] [] () () |
kbd | [] [] [] |
latrine | [] [] |
ld | [] |
libc | [] [] [] [] [] |
libextractor | [] |
libgpewidget | [] [] [] [] [] [] |
libgphoto2 | [] [] |
libgphoto2_port | [] |
libgsasl | [] [] [] |
libiconv | [] [] [] [] [] [] [] [] [] [] |
libidn | [] () |
lifelines | [] [] |
lilypond | |
lingoteach | [] |
lynx | [] [] [] |
m4 | [] [] [] [] [] |
mailutils | [] [] [] |
make | [] [] [] [] |
man-db | [] [] |
minicom | [] [] [] [] |
mysecretdiary | [] [] [] [] |
nano | [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
psmisc | [] [] |
ptx | [] [] [] [] [] [] |
pwdutils | [] |
python | |
radius | [] [] |
recode | [] [] [] [] [] [] |
rpm | [] [] [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] [] |
sed | [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] |
shared-mime-info | [] [] [] [] [] [] |
sharutils | [] [] [] |
silky | [] |
skencil | [] [] [] |
sketch | [] [] [] |
solfege | |
soundtracker | [] [] |
sp | |
stardict | [] [] |
tar | [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] |
tin | |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] |
vorbis-tools | [] [] |
wastesedge | |
wdiff | [] [] [] [] [] [] |
wget | |
xchat | [] [] [] [] [] [] [] |
xkeyboard-config | |
xpad | |
+----------------------------------------------+
or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv
1 3 47 29 57 6 78 73 5 44 12 12 50 85
ta tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
+-----------------------------------------------+
GNUnet | | 0
a2ps | [] [] [] | 19
aegis | | 0
ant-phone | [] [] | 5
anubis | [] [] [] | 11
ap-utils | () [] | 2
aspell | [] [] [] | 13
bash | [] | 11
batchelor | [] [] | 7
bfd | | 1
bibshelf | [] | 5
binutils | [] | 6
bison | [] [] | 18
bluez-pin | [] [] [] [] [] | 25
clisp | | 7
console-tools | [] [] | 5
coreutils | [] [] | 17
cpio | [] [] [] | 7
cpplib | [] [] | 8
darkstat | [] () () | 15
dialog | [] [] [] | 25
diffutils | [] [] [] [] | 28
doodle | [] | 5
e2fsprogs | [] | 8
enscript | [] | 12
error | [] [] [] | 16
fetchmail | [] | 12
fileutils | [] [] [] | 18
findutils | [] [] | 17
flex | [] [] | 15
fslint | [] | 7
gas | [] | 3
gawk | [] | 14
gbiff | [] | 5
gcal | [] | 5
gcc | [] [] | 4
gettext-examples | [] [] [] [] [] | 21
gettext-runtime | [] [] [] [] [] | 25
gettext-tools | [] [] [] [] [] | 19
gimp-print | [] | 11
gip | [] | 8
gliv | [] [] | 7
glunarclock | [] [] | 13
gmult | [] [] [] | 13
gnubiff | [] | 3
gnucash | () [] | 10
gnucash-glossary | [] [] | 9
gpe-aerial | [] [] | 13
gpe-beam | [] [] | 13
gpe-calendar | [] [] [] [] | 18
gpe-clock | [] [] [] [] | 17
gpe-conf | [] [] | 12
gpe-contacts | [] [] | 7
gpe-edit | [] [] [] [] | 15
gpe-go | [] [] | 11
gpe-login | [] [] [] [] [] | 18
gpe-ownerinfo | [] [] [] [] | 19
gpe-sketchbook | [] [] | 14
gpe-su | [] [] [] | 16
gpe-taskmanager | [] [] [] | 17
gpe-timesheet | [] [] [] [] | 17
gpe-today | [] [] [] [] [] | 19
gpe-todo | [] [] [] | 17
gphoto2 | [] [] [] | 18
gprof | [] [] | 10
gpsdrive | | 3
gramadoir | [] | 6
grep | [] [] [] [] | 32
gretl | | 4
gsasl | [] [] | 12
gss | [] | 5
gst-plugins | [] [] [] | 17
gstreamer | [] [] [] [] | 15
gtick | [] | 11
gtkspell | [] [] [] [] | 21
hello | [] [] [] [] | 37
id-utils | [] [] | 13
impost | [] | 3
indent | [] [] [] [] | 25
iso_3166 | [] [] [] | 12
iso_3166_1 | [] [] | 20
iso_3166_2 | | 2
iso_3166_3 | [] [] | 8
iso_4217 | [] [] | 10
iso_639 | [] [] | 12
jpilot | [] [] [] | 6
jtag | | 2
jwhois | [] [] [] | 12
kbd | [] [] | 12
latrine | [] [] | 8
ld | [] | 5
libc | [] [] | 22
libextractor | | 1
libgpewidget | [] [] | 17
libgphoto2 | [] | 9
libgphoto2_port | | 5
libgsasl | [] | 7
libiconv | [] [] [] [] [] | 32
libidn | [] [] | 6
lifelines | | 4
lilypond | | 1
lingoteach | [] | 6
lynx | [] [] [] | 15
m4 | [] [] | 17
mailutils | [] | 7
make | [] [] | 18
man-db | | 5
minicom | | 11
mysecretdiary | [] [] | 12
nano | [] [] | 13
nano_1_0 | [] [] [] | 18
opcodes | [] [] | 9
parted | [] [] [] | 18
psmisc | [] | 7
ptx | [] [] | 23
pwdutils | | 1
python | | 0
radius | [] | 6
recode | [] [] | 22
rpm | [] [] | 11
screem | | 1
scrollkeeper | [] [] [] | 24
sed | [] [] [] | 21
sh-utils | [] | 15
shared-mime-info | [] [] [] | 21
sharutils | [] [] [] | 20
silky | | 3
skencil | | 6
sketch | | 6
solfege | | 4
soundtracker | [] | 8
sp | [] | 3
stardict | [] [] [] [] | 10
tar | [] [] [] [] | 15
texinfo | [] [] | 14
textutils | [] [] [] | 17
tin | | 1
tp-robot | [] [] [] | 8
tuxpaint | [] [] [] [] | 34
unicode-han-tra... | | 0
unicode-transla... | | 2
util-linux | [] [] [] | 18
vorbis-tools | [] | 10
wastesedge | | 1
wdiff | [] [] | 22
wget | [] [] | 7
xchat | [] [] [] [] | 26
xkeyboard-config | [] | 2
xpad | [] | 5
+-----------------------------------------------+
73 teams ta tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
149 domains 0 0 0 1 77 30 0 92 16 0 42 32 0 1746
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If May 2005 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
1.6 Using `gettext' in new packages
===================================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
the translation teams.
+27 -9
View File
@@ -1,16 +1,34 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
Developer:
---------
Developers:
----------
* General code
FlashCode <flashcode@flashtux.org>
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
* Python plugin
Kolter <kolter@free.fr>
Web : http://kolter.free.fr
IRC : nick is "kolter" @ irc.freenode.net
Jabber: kolter@jabber.org
Debian packager:
---------------
Julien Louis <ptitlouis@sysif.net>
IRC : nicks are "ptitlouis" or "tioui" @ irc.freenode.net
Jabber: ptitlouis@amessage.info
FlashCode <flashcode@flashtux.org>
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
Testers:
-------
+1 -4
View File
@@ -1,12 +1,9 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2005-02-12
WeeChat known bugs, 2005-05-21
- ./configure does not check that Curses headers are installed
- ./configure does not check that Gtk 2.0 libraries are installed
- ./configure does not check that Perl headers & libraries are installed
- too much nicks in the channel (> height of window) => some nicks are hidden
- 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
+38 -1
View File
@@ -1,9 +1,46 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-03-20
ChangeLog - 2005-06-30
Version 0.1.3 (2005-07-02):
* proxy support (http, socks4, socks5) with authentification (http, socks5)
and ipv6 support (client to proxy)
* completion added for config option (with /set command)
* commands from users outside channel now authorized (if special user or
channel without "n" flag)
* added IPv6 support
* kill command now received and displayed
* added SSL support
* channel notify levels are saved in config file (new option
"server_notify_levels" for server sections)
* part message now accepts %v (replaced by WeeChat version), like quit message
* errors while loading perl scripts are now displayed in server buffer
(instead of current buffer)
* in python scripts, all messages written in stdin and stderr are redirected
in server buffer
* fix a filename error while loading a python script manually
* fixed plugins "print" and "prnt" functions: now ok for writing on server
buffers
* fixed color problem with new libcurses version
* fixed crash when using Alt-S or Alt-X on DCC buffer (Alt-D)
* fixed startup crash when config file (~/.weechat/weechat.rc) is not found
* improved Perl/Python libs detection for ./configure script
Version 0.1.2 (2005-05-21):
* added Python plugin support, improved Perl interface (and now Perl/Python
libraries are checked by configure script)
* added nicklist scroll keys (Alt+{home/end/pgup/pgdn} or F11/F12)
* added transfer rate for DCC files
* added "-all" option for /nick command
* buffers timestamp can now be changed (new option in config file)
* WeeChat now ok under *BSD and Mac OS X
* fixed nicklist sort
* fixed crash when purging old DCC
* fixed crash with 64-bits arch (like AMD64) when converting UTF-8
* added missing IRC commands (307, 341, 485, 671)
Version 0.1.1 (2005-03-20):
* added nicks count for channel buffers
* added FIFO pipe for remote control
+37 -13
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-02-06
WeeChat FAQ, 2005-05-21
=======================
Intended audience:
@@ -22,8 +22,10 @@ finding a solution.
Q: I heard about many GUI for WeeChat. How can I compile/use them?
A: Curses GUI is built by default.
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
To build Gtk, wxWidgets or Qt GUI you've to specify extra options to
./configure script:
--enable-gtk to enable Gtk GUI
--enable-wxwidgets to enable wxWidgets GUI
--enable-qt to enable Qt QUI
Type ./configure --help to see available options.
WARNING: only Curses GUI is ok today. Other GUI are under development!
@@ -34,8 +36,8 @@ A: Curses GUI is built by default.
Q: I can't compile WeeChat CVS.
A: Check that you have latest version of autoconf and automake.
WeeChat has been developed with autoconf version 2.56 and automake
version 1.7.
WeeChat has been developed with autoconf version 2.59 and automake
version 1.9.5.
You should have at least these versions in order to compile WeeChat CVS.
If you can't or don't want to install these versions, you can download and
install "devel package", a package built almost every day, based on CVS.
@@ -48,12 +50,14 @@ Q: Why using WeeChat ? X-Chat and Irssi are so good...
A: Because WeeChat is very light and has new features.
Some new features:
* many GUI (Curses, Gtk, Qt),
* many GUI (Curses, Gtk, wxWidgets, Qt),
* extensible with scripts (Perl, Python, Ruby),
* developed from scratch (not based on any other IRC client)
* multi-platform
* 100% GPL and free
This is the "geekest" IRC client ;)
More info on this page: http://weechat.flashtux.org/features.php
2.2
@@ -61,6 +65,7 @@ A: Because WeeChat is very light and has new features.
Q: I've launched WeeChat, but I'm lost, what can I do?
A: For help you can type /help. For help about a command, type /help command.
Keys and commands are listed in documentation.
2.3
@@ -86,19 +91,23 @@ A: Today you can't do that. This is planed for a future version.
Q: How can I load Perl scripts?
Are Perl scripts compatible with X-chat or/and Irssi ?
A: You can use /perl command to load scripts
(default path is ~/.weechat/perl).
A: You can use /perl command to load scripts (default path is
~/.weechat/perl).
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
when WeeChat is starting up.
WeeChat perl scripts are compatible with X-Chat, but not with Irssi,
sorry ;)
WeeChat Perl scripts are 80% compatible with X-Chat, but not with Irssi.
2.6
================================================================================
Q: How can I load Python scripts?
Are Python scripts compatible with X-chat or/and Irssi ?
A: Today Python interface is not developed, so you can't load any Python script.
A: You can use /python command to load scripts (default path is
~/.weechat/python).
Note that scripts in ~/.weechat/python/autoload are automatically loaded
when WeeChat is starting up.
WeeChat Python scripts are 80% compatible with X-Chat, but not with Irssi.
2.7
@@ -148,13 +157,27 @@ A: There is 2 ways to submit your feature request:
3.4
================================================================================
Q: Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
Q: What is the list of supported platforms for WeeChat?
A: Yes. Future versions will be available for these OS.
A: Today WeeChat was succesfully tested on these platforms:
- GNU/Linux (any distribution / i386, AMD64, Sparc)
- FreeBSD
- NetBSD
- OpenBSD
- Mac OS X
- Microsoft Windows (with Cygwin and some code changes)
3.5
================================================================================
Q: Will WeeChat be ported to QNX or other operating systems?
A: Yes. Future versions will be available for these OS.
We need help for such systems, any help is welcome :)
3.6
================================================================================
Q: I want to help WeeChat developers. What can I do?
A: There's many tasks to do (code, documentation, ...)
@@ -162,8 +185,9 @@ A: There's many tasks to do (code, documentation, ...)
http://weechat.flashtux.org/support.php
3.6
3.7
================================================================================
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 :)
+38 -15
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-02-06
WeeChat FAQ, 2005-05-21
=======================
Public concerné :
@@ -23,9 +23,10 @@ Q: J'ai entendu parler de plusieurs interfaces pour WeeChat.
Comment puis-je les compiler/utiliser ?
R: L'interface Curses est construite par défaut.
Pour construire l'interface Gtk ou Qt, vous devez spécifier des options
pour le script ./configure :
Pour construire l'interface Gtk, wxWidgets ou Qt, vous devez spécifier des
options pour le script ./configure :
--enable-gtk pour activer l'interface Gtk
--enable-wxwidgets pour activer l'interface wxWidgets
--enable-qt pour activer l'interface Qt
Tapez ./configure --help pour voir les options disponibles.
ATTENTION : seule l'interface Curses est ok aujourd'hui.
@@ -37,8 +38,8 @@ R: L'interface Curses est construite par d
Q: Je ne peux pas compiler le CVS WeeChat.
R: Vérifiez que vous avez bien la dernière version d'autoconf et automake.
WeeChat a été développé avec autoconf version 2.56 et automake
version 1.7.
WeeChat a été développé avec autoconf version 2.59 et automake
version 1.9.5.
Vous devez avoir au moins ces versions pour compiler le CVS WeeChat.
Si vous n'avez pas ou ne souhaitez pas installer ces versions, vous
pouvez télécharger et installer le paquet "devel", un paquet construit
@@ -52,12 +53,14 @@ Q: Pourquoi utiliser WeeChat ? X-Chat et Irssi sont si bien...
R: Parce que WeeChat est très léger et a de nouvelles fonctionnalités.
Quelques nouvelles fonctionnalités :
* plusieurs interfaces (Curses, Gtk, Qt),
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt),
* extensible par des scripts (Perl, Python, Ruby),
* développé à partir de zéro (non basé sur un quelconque client IRC)
* multi-platformes
* 100% GPL et libre
C'est le client IRC le plus "geek" ;)
Plus d'infos sur cette page: http://weechat.flashtux.org/features.php
2.2
@@ -66,6 +69,7 @@ Q: J'ai lanc
R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
tapez /help commande.
Les touches et commandes sont listées dans la documentation.
2.3
@@ -92,20 +96,23 @@ R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
Q: Comment puis-je charger des scripts Perl ?
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
R: La commande /perl permet de charger les scripts Perl
(le chemin par défaut est ~/.weechat/perl).
R: La commande /perl permet de charger les scripts Perl (le chemin par défaut
est ~/.weechat/perl).
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Perl WeeChat sont compatibles avec X-Chat, mais pas Irssi,
désolé ;)
Les scripts Perl WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
2.6
================================================================================
Q: Comment puis-je charger les scripts Python ?
Les scripts Python sont-ils compatibles avec X-chat et/ou Irssi ?
R: Aujourd'hui l'interface Python n'est pas déceloppée.
Vous ne pouvez donc charger aucun script Python.
R: La commande /python permet de charger les scripts Python (le chemin par
défaut est ~/.weechat/python).
Notez que les scripts dans ~/.weechat/python/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Python WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
2.7
@@ -161,13 +168,27 @@ R: Il y a 2 mani
3.4
================================================================================
Q: WeeChat sera-t-il porté sur *BSD, QNX, MacOS X, Microsoft Windows ?
Q: Quelle est la liste des plate-formes supportées par WeeChat ?
R: Oui. Les futures versions seront disponibles pour ces OS.
R: Aujourd'hui WeeChat a été testé avec succès sur ces plate-formes :
- GNU/Linux (toute distribution / i386, AMD64, Sparc)
- FreeBSD
- NetBSD
- OpenBSD
- Mac OS X
- Microsoft Windows (avec Cygwin et quelques modifications de code)
3.5
================================================================================
Q: WeeChat sera-t-il porté sur QNX ou d'autres systèmes d'exploitation ?
R: Oui. Les futures versions seront disponibles pour ces OS.
Nous avons besoin d'aide pour ces systèmes, toute aide est la bienvenue :)
3.6
================================================================================
Q: Je souhaiterai aider les développeurs WeeChat. Que puis-je faire ?
R: Il y a plusieurs choses Ă  faire (code, documentation, ...)
@@ -176,8 +197,10 @@ R: Il y a plusieurs choses
http://weechat.flashtux.org/support.php
3.6
3.7
================================================================================
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 :)
+4 -2
View File
@@ -17,12 +17,14 @@
SUBDIRS = po intl src
EXTRA_DIST = weechat-curses.1 BUGS FAQ FAQ.fr \
EXTRA_DIST = config.rpath weechat-curses.1 BUGS FAQ FAQ.fr \
debian/changelog debian/control \
debian/copyright debian/files \
debian/copyright \
debian/rules debian/weechat-common.docs \
debian/weechat-common.install debian/weechat-curses.dirs \
debian/weechat-curses.install debian/weechat-gtk.dirs \
debian/weechat-gtk.install
man_MANS = weechat-curses.1
ACLOCAL_AMFLAGS = -I m4
+8
View File
@@ -1,6 +1,14 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-07-02
WeeChat 0.1.3 released.
* FlashCode, 2005-05-21
WeeChat 0.1.2 released.
* FlashCode, 2005-03-20
WeeChat 0.1.1 released.
+3 -3
View File
@@ -14,7 +14,7 @@ Features
* small, fast and very light
* customizable and extensible with scripts (Perl, Python, Ruby) (2)
* compliant with RFC 1459,2810,2811,2812,2813
* developed from scratch (not based on any other IRC client, except for look ;)
* developed from scratch
* multi-platform (GNU/Linux, *BSD, Windows & other) (3)
* 100% GPL & free
@@ -44,5 +44,5 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
---
(1) only Curses interface is available today
(2) only Perl interface is available today
(3) only GNU/Linux version is available today
(2) only Perl and Python interfaces are available today
(3) only GNU/Linux and *BSD versions are available today
+10 -21
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2005-03-20
TODO - 2005-07-02
Legend:
# done
@@ -10,31 +10,32 @@ Legend:
? is this really necessary?
v0.1.1:
v0.1.3:
------
* General:
+ Windows version
+ Solaris version
+ *BSD version
* IRC protocol:
# "/dcc send" command
# "/dcc chat" command (and incoming DCC chats)
- customizable CTCP version reply
* Interface:
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* TCP/IP communication:
# connect to server with child process (background)
# SSL support
# IPv6 protocol implementation
# proxy support (http, socks4, socks5) with authentification
(http, socks5) and ipv6 support (client to proxy)
* Configuration:
# save buffer notify levels
Future versions:
---------------
* IRC protocol:
- customizable CTCP version reply
- complete "/list" command: add regexp search, display only channels that
match regexp
- "/ignore" and "/unignore" commands: hide all that is write by a given
@@ -45,15 +46,10 @@ Future versions:
nick/host connect to the given irc network
* WeeChat commands:
- "/reload" command: reload the WeeChat's config file
- "/highlight" command: highlight a given word when it appears on
channels/privates
- "/completion" command: do shortcuts (for example when we type "u"
in the text bar it send it to the server as "you")
- "/exec" command: execute a command as if we was in shell
and show us the output on the current window. An option to exec
like -o could send the output to the server, on the current
channel/private
- "/last": command to look for text in previous messages
* Interface:
@@ -62,14 +58,7 @@ Future versions:
- understand incomplete commands if unambigous (for example: /he for /help is ok)
? Qt GUI
* TCP/IP communication:
- proxy support
- SSL support
- IPv6 protocol implementation
* Plugins:
- Python plugin
- "/python load" and "/python unload" commands to (un)load Python scripts
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
+13 -53
View File
@@ -1,55 +1,15 @@
#!/bin/sh
rm -f config.cache
### GETTEXT ###
echo searching for GNU gettext intl directory...
dirs="/usr/share /usr/local/share /opt/share /usr /usr/local /opt /usr/gnu/share"
found=0
for try in $dirs; do
echo -n " -> $try/gettext/intl... "
if test -d $try/gettext/intl; then
echo found it
found=1
break
fi
echo no
done
if test "$found" != 1; then
echo ERROR: Cannot find gettext/intl directory.
echo ERROR: Install GNU gettext in /usr or /usr/local prefix.
exit 7
fi;
echo copying gettext intl files...
intldir="$try/gettext/intl"
if test ! -d intl; then
mkdir intl
fi
olddir=`pwd`
cd $intldir
for file in *; do
if test $file != COPYING.LIB-2.0 && test $file != COPYING.LIB-2.1; then
rm -f $olddir/intl/$file
cp $intldir/$file $olddir/intl/
fi
done
cp -f $try/gettext/po/Makefile.in.in $olddir/po/
cd $olddir
if test -f intl/plural.c; then
sleep 2
touch intl/plural.c
fi
### END GETTEXT ###
echo "running aclocal..."
aclocal -I /usr/share/aclocal
echo "running autoconf..."
autoconf
echo "running autoheader..."
autoheader
echo "running automake..."
automake -a
echo "autogen.sh ok, now run ./configure script"
# gettextize updates Makefile.am, configure.in
cp configure.in configure.in.old
cp Makefile.am Makefile.am.old
gettextize --copy --force --intl --no-changelog &&
mv Makefile.am.old Makefile.am
mv configure.in.old configure.in
aclocal &&
# autoheader creates config.h.in needed by autoconf
autoheader &&
# autoconf creates configure
autoconf &&
# automake creates Makefile.in
automake --add-missing --copy --gnu
+167 -15
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.1, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.3, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.1])
AM_INIT_AUTOMAKE([weechat], [0.1.3])
# Checks for programs.
AC_PROG_CC
@@ -44,42 +44,88 @@ AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h s
AC_HEADER_TIME
AC_STRUCT_TM
AC_MSG_CHECKING([for socklen_t])
AC_CACHE_VAL(ac_cv_type_socklen_t,
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t t;],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no,
)])
if test $ac_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
fi
AC_MSG_RESULT($ac_cv_type_socklen_t)
# Checks for library functions.
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],,enable_ncurses=yes)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],enable_ncurses=$enableval,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets,[ --enable-wxwidgets Turn on WxWidgets interface (default=no)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=$enableval,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=$enableval,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python plugins (default=no)],enable_python=$enableval,enable_python=no)
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=auto)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
enable_plugins="no"
enable_python="no"
PYTHON_CFLAGS=
enable_ruby="no"
RUBY_CFLAGS=
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
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_PYTHON, test "$enable_python" = "yes")
# AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([ncurses library not found! Install ncurses library or run ./configure with --disable-ncurses parameter.])
AC_MSG_ERROR([
*** ncurses library not found!
*** Please install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
NCURSES_LIBS="-lncurses"
AC_SUBST(NCURSES_LIBS)
fi
if test "x$enable_wxwidgets" = "xyes" ; then
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.3.4, wxWin=1)
if test "$wxWin" != 1; then
AC_MSG_ERROR([
*** wxWindows must be installed on your system
*** but wx-config script couldn't be found.
*** Please check that wx-config is in path, the directory
*** where wxWindows libraries are installed (returned by
*** 'wx-config --libs' command) is in LD_LIBRARY_PATH or
*** equivalent variable and wxWindows version is 2.3.4 or above.
])
fi
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
LDFLAGS="$LDFLAGS $WX_LIBS"
WXWIDGETS_CFLAGS=""
WXWIDGETS_LIBS=""
fi
if test "x$enable_gtk" = "xyes" ; then
#if test "$LIBGTK_FOUND" = "0" ; then
# AC_MSG_ERROR([Gtk+ library not found! Install Gtk+ (2.0 or higher) library or run ./configure without --enable-gtk parameter.])
@@ -94,18 +140,112 @@ PLUGINS_LIBS=
if test "x$enable_perl" = "xyes" ; then
enable_plugins="yes"
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `perl -MExtUtils::Embed -e ldopts`"
PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
AC_PATH_PROG(PERL, perl perl5)
if test -z $PERL ; then
AC_MSG_ERROR([
*** Perl must be installed on your system
*** but perl interpreter couldn't be found in path.
Please check that perl is in path, or install
it with your software package manager.])
fi
AC_MSG_CHECKING(for Perl headers files)
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
else
AC_MSG_ERROR([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `$PERL -MExtUtils::Embed -e ldopts`"
else
AC_MSG_ERROR([
*** Perl library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
AC_SUBST(PERL_CFLAGS)
AC_DEFINE(PLUGIN_PERL)
fi
if test "x$enable_python" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2)
if test -z $PYTHON ; then
AC_MSG_ERROR([
*** Python must be installed on your system
*** but python interpreter couldn't be found in path.
*** Please check that python is in path, or install
*** it with your software package manager.])
fi
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE="$PYTHON_SYSPREFIX/include/python$PYTHON_VERSION"
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS=-I`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
else
AC_MSG_ERROR([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.])
fi
AC_MSG_RESULT(found)
PYTHON_LIB="$PYTHON_SYSPREFIX/lib/python$PYTHON_VERSION/config"
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so" -o -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-lpython$PYTHON_VERSION -lpthread -lutil"
else
AC_MSG_ERROR([
*** Python library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/python/lib_weechat_python.a $PYTHON_LFLAGS"
AC_SUBST(PYTHON_CFLAGS)
AC_DEFINE(PLUGIN_PYTHON)
fi
if test "x$enable_plugins" = "xyes" ; then
AC_DEFINE(PLUGINS)
fi
AC_SUBST(PLUGINS_LIBS)
if test "x$enable_gnutls" = "xyes" ; then
found_gnutls="no"
AM_PATH_LIBGNUTLS( 1.0.0, found_gnutls=yes, AC_MSG_WARN([[
*** libgnutls was not found. You may want to get it from
*** ftp://ftp.gnutls.org/pub/gnutls/
*** WeeChat will be built without GnuTLS support.]]))
if test "x$found_gnutls" = "xyes" ; then
GNUTLS_LIBS="-lgnutls"
AC_SUBST(GNUTLS_LIBS)
AC_DEFINE(HAVE_GNUTLS)
else
enable_gnutls="no"
fi
fi
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
CFLAGS="-O2"
@@ -120,14 +260,20 @@ if test "x$debug" = "x2" ; then
AC_DEFINE(DEBUG)
fi
dnl For FreeBSD
LIBS="$LIBS $INTLLIBS"
CFLAGS="$CFLAGS $CPPFLAGS"
AC_OUTPUT([Makefile
src/Makefile
src/common/Makefile
src/irc/Makefile
src/plugins/Makefile
src/plugins/perl/Makefile
src/plugins/python/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
src/gui/gtk/Makefile
src/gui/qt/Makefile
intl/Makefile
@@ -140,6 +286,9 @@ listgui=
if test "x$enable_ncurses" = "xyes" ; then
listgui="$listgui ncurses"
fi
if test "x$enable_wxwidgets" = "xyes"; then
listgui="$listgui WxWidgets"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
fi
@@ -148,7 +297,9 @@ if test "x$enable_qt" = "xyes" ; then
fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([No interface specified... Please specify at least ncurses, Gtk or Qt.])
AC_MSG_ERROR([
*** No interface specified...
*** Please specify at least ncurses, WxWidgets, Gtk or Qt.])
fi
msg_debug_compiler="no"
@@ -167,6 +318,7 @@ echo Build with Plugin support..... : $enable_plugins
echo Build with Perl support....... : $enable_perl
echo Build with Python support..... : $enable_python
echo Build with Ruby support....... : $enable_ruby
echo Build with GNUtls support..... : $enable_gnutls
echo
echo Compile with debug info....... : $msg_debug_compiler
echo Print debugging messages...... : $msg_debug_verbose
+22 -1
View File
@@ -1,6 +1,27 @@
weechat (0.1.2-2) unstable; urgency=low
* Patch src/gui/curse/gui-display.c to fix segfault
when config file does not exists (Closes: #310589).
-- Julien Louis <ptitlouis@sysif.net> Tue, 24 May 2005 20:55:02 +0200
weechat (0.1.2-1) unstable; urgency=low
* WeeChat version 0.1.2, see ChangeLog for detail.
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 21 May 2005 08:00:00 +0200
weechat (0.1.1-2) unstable; urgency=low
* debian/control:
- Add myself to uploaders.
- Remove unecessary dependency on weechat-gtk (Closes: #308287).
-- Julien Louis <ptitlouis@sysif.net> Tue, 10 May 2005 22:38:52 +0200
weechat (0.1.1-1) unstable; urgency=low
* WeeChat version 0.1.1, see ChangeLog for detail.
* WeeChat version 0.1.1, see ChangeLog for detail (closes: #306492)
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 20 Mar 2005 08:00:00 +0200
+1
View File
@@ -0,0 +1 @@
4
+3 -2
View File
@@ -2,12 +2,13 @@ Source: weechat
Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.4), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev
Standards-Version: 3.6.1
Package: weechat
Architecture: all
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${Source-Version})
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version})
Description: Fast, light and extensible IRC client
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
for many operating systems. Everything can be done with a keyboard.
+1 -1
View File
@@ -1,5 +1,5 @@
This package was debianized by FlashCode <flashcode@flashtux.org> on
Sat, 20 Mar 2005 08:00:00 +0200.
Sat, 21 May 2005 08:00:00 +0200.
It was downloaded from http://weechat.flashtux.org/download
+1 -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-perl --enable-python
touch configure-stamp
+355 -148
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
@subtitle Documentation for WeeChat v0.1.3 - July, 03 2005
@image{weechat_image}
@@ -84,27 +84,27 @@ version 2 or higher.
@node Description, Pre-requisites, Introduction, Introduction
@section Description
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
designed for many operating systems.@*
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
designed for many operating systems.@*
@*
Main features are:
Main features are:
@itemize @minus
@item
multi-servers connection
@item
many GUI (Graphical User Interface): Curses, Gtk and Qt
@item
small, fast and light
@item
customizable and extensible with scripts
@item
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
@item
multi-platform (Gnu/Linux, *BSD, Windows and other)
@item
@item
multi-servers connection (with SSL, IPv6, proxy)
@item
many GUI: Curses, wxWidgets, Gtk and Qt
@item
small, fast and light
@item
customizable and extensible with scripts
@item
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
@item
multi-platform (Gnu/Linux, *BSD, MacOS X, Windows and other)
@item
100% GPL, free software
@end itemize
@end itemize
@*
WeeChat homepage is here:@*
@uref{http://weechat.flashtux.org}@*
@@ -116,20 +116,20 @@ In order to install WeeChat, you @b{need}:@*
@itemize @bullet
@item
A running Gnu/Linux system (with compiler tools for source package)
A running Gnu/Linux system (with compiler tools for source package)
@item
"root" privileges (to install WeeChat)
@item
According to GUI, one of the following libraries:
@itemize @minus
@item
Curses: ncurses library,
@item
Gtk: *** GUI not developed ***,
@item
Qt: *** GUI not developed ***,
According to GUI, one of the following libraries:
@itemize @minus
@item
Curses: ncurses library,
@item
Gtk: *** GUI not developed ***,
@item
Qt: *** GUI not developed ***,
@end itemize
@end itemize
@end itemize
@c ******************************* Installation *******************************
@@ -139,31 +139,31 @@ Qt: *** GUI not developed ***,
@menu
* Binary package::
* Source package::
* Source package::
* CVS sources::
@end menu
@node Binary package, Source package, Installation, Installation
@section Binary package
Binary packages are available for these distributions:
@itemize @bullet
@item
Debian (or any Debian compatible distribution)@*
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (or any RPM compatible distribution)@*
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
To install: @kbd{emerge weechat}
@item
*BSD (not available!)
@item
Slackware (not available!)
@item
Windows (not available!)
@end itemize
Binary packages are available for these distributions:
@itemize @bullet
@item
Debian (or any Debian compatible distribution)@*
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
@item
Mandriva/Redhat (or any RPM compatible distribution)@*
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
To install: @kbd{emerge weechat}
@item
*BSD (not available!)
@item
Slackware (not available!)
@item
Windows (not available!)
@end itemize
where x.y.z is the version (for example 0.0.1)
@*
@@ -176,27 +176,27 @@ All you have to do is to run in a console or a terminal:@*
@kbd{make}@*
Nota: to build only some interfaces, you can give parameters
to ./configure, type @kbd{./configure --help} for help about options.@*
Then get root privileges and install WeeChat:@*
@kbd{su}@*
(enter root password)@*
@kbd{make install}@*
Then get root privileges and install WeeChat:@*
@kbd{su}@*
(enter root password)@*
@kbd{make install}@*
@node CVS sources, , Source package, Installation
@section CVS sources
Warning: CVS sources are for advanced users: it may not compile or not be stable.
You're warned!@*
To get CVS sources, issue these commands:@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(when prompted for a password, just press Enter key)@*
Warning: CVS sources are for advanced users: it may not compile or not be stable.
You're warned!@*
To get CVS sources, issue these commands:@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(when prompted for a password, just press Enter key)@*
Execute this script:@*
@kbd{./autogen.sh}@*
Then follow instructions for source package - @xref{Source package}.
Then follow instructions for source package - @xref{Source package}.
@c ********************************** Usage ***********************************
@@ -206,40 +206,45 @@ Then follow instructions for source package - @xref{Source package}.
@menu
* Run WeeChat::
* Config file::
* Key bindings::
* Config file::
* Key bindings::
* WeeChat commands::
* FIFO pipe::
@end menu
@node Run WeeChat, Config file, Usage, Usage
@section Run WeeChat
@subsection Command line parameters
@subsection Command line parameters
@table @code
@item -c, --config
Display config file help (list of options)@*
@item -h, --help
Display help screen@*
@item -i, --irc-commands
Display IRC commands list@*
@item -l, --license
Display WeeChat license@*
@item -v, --version
@item -v, --version
Display WeeChat version@*
@end table
@subsection Run WeeChat
Just issue this command to run WeeChat:@*
@item -w, --weechat-commands
Display WeeChat commands list@*
@end table
@subsection Run WeeChat
Just issue this command to run WeeChat:@*
@kbd{weechat-curses} (for Curses front-end)@*
or @kbd{weechat-wxwidgets} (for wxWidgets front-end)@*
or @kbd{weechat-gtk} (for Gtk front-end)@*
or @kbd{weechat-qt} (for Qt front-end)@*
When you run WeeChat for the first time, a default configuration file is
created, with default options.@*
The default configuration file is: ~/.weechat/weechat.rc@*
You can edit this file at your convenience to configure WeeChat, or you can
or @kbd{weechat-qt} (for Qt front-end)@*
When you run WeeChat for the first time, a default configuration file is
created, with default options.@*
The default configuration file is: ~/.weechat/weechat.rc@*
You can edit this file at your convenience to configure WeeChat, or you can
set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
@node Config file, Key bindings, Run WeeChat, Usage
@@ -248,7 +253,6 @@ set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
List of options for config file:@*
@table @kbd
@item look_set_title
Set title for window (terminal for Curses GUI) with name & version@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -270,6 +274,9 @@ Type: string (any string), default value: ''@*
@item look_charset_internal
Internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)@*
Type: string (any string), default value: 'ISO-8859-1'@*
@item look_buffer_timestamp
Timestamp for buffers@*
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'@*
@@ -414,6 +421,9 @@ Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_voice
Color for voice symbol@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_sep
Color for nick separator@*
Type: color (Curses or Gtk color), default value: 'blue'@*
@@ -482,7 +492,7 @@ Default message when away@*
Type: string (any string), default value: 'away'@*
@item irc_default_msg_part
Default part message (leaving channel)@*
Type: string (any string), default value: ''@*
Type: string (any string), default value: 'WeeChat %v'@*
@item irc_default_msg_quit
Default quit message ('%v' will be replaced by WeeChat version in string)@*
Type: string (any string), default value: 'WeeChat %v'@*
@@ -498,6 +508,9 @@ Type: integer (values: between 0 and 2147483647), default value: 1@*
@item irc_lag_disconnect
Disconnect after important lag (in minutes, 0 = never disconnect)@*
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 dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@@ -528,12 +541,21 @@ Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item proxy_use
Use a proxy server to connect to irc server@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item proxy_type
Proxy type (http (default), socks4, socks5)@*
Type: string (values: 'http', 'socks4', 'socks5'), default value: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item proxy_address
Proxy server address (IP or hostname)@*
Type: string (any string), default value: ''@*
@item proxy_port
Port for connecting to proxy server@*
Type: integer (values: between 0 and 65535), default value: 1080@*
Type: integer (values: between 0 and 65535), default value: 3128@*
@item proxy_username
Username for proxy server@*
Type: string (any string), default value: ''@*
@item proxy_password
Password for proxy server@*
Type: string (any string), default value: ''@*
@@ -555,6 +577,12 @@ Type: string (any string), default value: ''@*
@item server_port
Port for connecting to server@*
Type: integer (values: between 0 and 65535), default value: 6667@*
@item server_ipv6
Use IPv6 protocol for server communication@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item server_ssl
Use SSL for server communication@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item server_password
Password for IRC server@*
Type: string (any string), default value: ''@*
@@ -585,7 +613,9 @@ Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item server_notify_levels
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
Type: string (any string), default value: ''@*
@end table
Colors for Curses GUI are:@*
@@ -624,11 +654,11 @@ Colors for Curses GUI are:@*
@node Key bindings, WeeChat commands, Config file, Usage
@section Key bindings
@table @kbd
@item Left arrow / Right arrow
Go to previous / next char in command line@*
@*
@*
@item Ctrl + left arrow / Ctrl + right arrow
Go to previous / next word in command line@*
@*
@@ -638,28 +668,28 @@ Go to the beginning of command line@*
@item End / Ctrl + E
Go to the end of command line@*
@*
@item Backspace / Delete
@item Backspace / Delete
Erase previous / next char of command line@*
@*
@item Ctrl + Backspace / Ctrl + W
@*
@item Ctrl + Backspace / Ctrl + W
Erase previous word of command line@*
@*
@item Tab
@*
@item Tab
Complete command or nick (@kbd{Tab} again: find next completion)@*
@*
@item Any char
Insert char to cursor position in the command line@*
@*
@item Enter
@*
@item Any char
Insert char to cursor position in the command line@*
@*
@item Enter
Execute command or send message@*
@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item PageUp / PageDown
@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item PageUp / PageDown
Show buffer history@*
@*
@item F5 / F6
@item F5 / F6
Switch to previous / next buffer@*
@*
@item F7 / F8
@@ -668,10 +698,13 @@ Switch to previous / next window@*
@item F10
Remove last infobar message@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@item Alt + left arrow / Alt + right arrow
@*
@item Alt + left arrow / Alt + right arrow
Same as F5 / F6@*
@*
@item Alt + A
@@ -692,6 +725,9 @@ Switch to first channel of next server (or server buffer if no channel is opened
@item Alt + digit (1-9)
Switch to buffer by number@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node WeeChat commands, FIFO pipe, Key bindings, Usage
@@ -700,7 +736,6 @@ Switch to buffer by number@*
WeeChat internal commands:@*
@table @kbd
@item alias [alias_name [command [arguments]]
@*
create an alias for a command@*
@@ -750,20 +785,29 @@ display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item perl [load filename] | [autoload] | [unload]
@item perl [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@item python [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Python scripts@*
@*
filename: Python script (file) to load@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@*
list, add or remove servers@*
@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
ipv6: use IPv6 protocol@*
ssl: use SSL protocol@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
@@ -799,13 +843,11 @@ splith: split current window horizontally@*
splitv: split current window vertically@*
merge: merge window with another@*
@*
@end table
IRC commands:@*
@table @kbd
@item admin [target]
@*
find information about the administrator of the server@*
@@ -980,11 +1022,12 @@ list nicknames on channels@*
@*
channel: channel name@*
@*
@item nick nickname
@item nick [-all] nickname
@*
change current nickname@*
@*
nickname: new nickname for current IRC server@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
@*
@item notice nickname text
@*
@@ -1171,7 +1214,6 @@ nickname: nickname to search@*
count: number of replies to return (full search if negative number)@*
target: reply should match this mask@*
@*
@end table
@node FIFO pipe, , WeeChat commands, Usage
@@ -1251,7 +1293,7 @@ List all Perl scripts: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( name, version, shutdown_function, description );}@*
@command{weechat::register ( name, version, shutdown_function, description );}@*
@*
This is first function to call in Perl script.@*
All Perl scripts for WeeChat should call this function.@*
@@ -1267,42 +1309,29 @@ unloaded (optional parameter, empty string means nothing is called at the end)
@end itemize
@*
@emph{Example:}@*
@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{IRC::print ( message );}@*
@*
Print message in current window (channel or server).@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@end itemize
@*
@emph{Example:}@*
@code{IRC::print ("message");}@*
@*
@item
@command{IRC::print_with_channel ( channel, [server,] message );}@*
@command{weechat::print ( message, [channel, [server]] );}@*
@*
Print message in a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@item @option{message}: message to display
@end itemize
@*
@emph{Examples:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
@code{IRC::print_with_channel ("#weechat", "message");}@*
@code{weechat::print ("message");}@*
@code{weechat::print ("message", "#weechat");}@*
@code{weechat::print ("message", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( delay, message );}@*
@command{weechat::print_infobar ( delay, message );}@*
@*
Print message in infobar.@*
@@ -1314,11 +1343,11 @@ Print message in infobar.@*
@end itemize
@*
@emph{Example:}@*
@code{IRC::print_infobar (5, "message");}@*
@code{weechat::print_infobar (5, "message");}@*
@*
@item
@command{IRC::add_message_handler ( name, function );}@*
@command{weechat::add_message_handler ( name, function );}@*
@*
Attach a Perl function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@@ -1333,18 +1362,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Example:}@*
@code{IRC::add_message_handler ("privmsg", my_function);}@*
@code{weechat::add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("server=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( name, function );}@*
@command{weechat::add_command_handler ( name, function );}@*
@*
Create new WeeChat command, linked with Perl function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -1359,23 +1388,41 @@ available until your Perl script will be unloaded.
@end itemize
@*
@emph{Example:}@*
@code{IRC::add_command_handler ("command", my_command);}@*
@code{weechat::add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [server,] name );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( name, [server] );}@*
@*
Get various info about WeeChat, server or user.@*
@emph{Arguments:}
@itemize @minus
@item @option{server}: internal name of server
@item @option{name}: name of info to retrieve:
@item @option{server}: internal name of server
@itemize @minus
@item @option{0 or version}: get WeeChat version
@item @option{1 or nick}: get nickname
@@ -1388,7 +1435,7 @@ Get various info about WeeChat, server or user.@*
@*
@emph{Examples:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1396,7 +1443,167 @@ Get various info about WeeChat, server or user.@*
@node Python scripts, Ruby scripts, Perl scripts, Extensions
@section Python scripts
Not developed!
@subsection Load/unload Python scripts
Python scripts are loaded and unloaded with @command{/python} command.
(type @kbd{/help python} within WeeChat to get help about command).@*
@emph{Examples:}@*
@itemize @bullet
@item
Load a Python script: @kbd{/python load /tmp/sample.py}@*
@item
Unload all Python scripts: @kbd{/python unload}@*
@item
List all Python scripts: @kbd{/python}@*
@end itemize
@subsection WeeChat / Python API
@itemize @bullet
@item
@command{weechat.register ( name, version, shutdown_function, description )}@*
@*
This is first function to call in Python script.@*
All Python scripts for WeeChat should call this function.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: unique name to identify script (each script must have
unique name)
@item @option{version}: script's version
@item @option{shutdown_function}: Python function called when script is
unloaded (optional parameter, empty string means nothing is called at the end)
@item @option{description}: short description of script.
@end itemize
@*
@emph{Example:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@*
@*
@item
@command{weechat.prnt ( message, [channel, [server]] )}@*
@*
Print message in a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( delay, message )}@*
@*
Print message in infobar.@*
@emph{Arguments:}
@itemize @minus
@item @option{delay}: after this delay (in seconds), message will be erased
(if 0, message will not be erased).
@item @option{message}: message to display
@end itemize
@*
@emph{Example:}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( name, function )}@*
@*
Attach a Python function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of IRC message@*
To know list of IRC messages, please refer to RFC 1459 and/or 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{function}: Python function called when message is received
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_message_handler ("privmsg", my_function)}@*
@code{def my_function(server, args):}@*
@code{@ @ @ @ weechat.prnt("server="+server)}@*
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("host="+hostmask+", channel="+channel+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( name, function )}@*
@*
Create new WeeChat command, linked with Python function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of new command@*
This name may be existing command, so that the command is overrided by
Python function. Be careful when overriding WeeChat commands, they'll not be
available until your Python script will be unloaded.
@item @option{function}: Python function linked with command
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_command_handler ("command", my_command)}@*
@code{def my_command(server, args):}@*
@code{@ @ @ @ weechat.prnt("server:"+server+" arguments:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( name, [server] )}@*
@*
Get various info about WeeChat, server or user.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of info to retrieve:
@item @option{server}: internal name of server
@itemize @minus
@item @option{0 or version}: get WeeChat version
@item @option{1 or nick}: get nickname
@item @option{2 or channel}: get channel name
@item @option{3 or server}: get server name
@item @option{4 or weechatdir}: get WeeChat home directory
@item @option{5 or away}: get away flag for server
@end itemize
@end itemize
@*
@emph{Examples:}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
@node Ruby scripts, , Python scripts, Extensions
@section Ruby scripts
@@ -1472,7 +1679,7 @@ Look for WeeChat support page for detail:@*
@node Copyright, , Get support, Authors / Support
@section Copyright
This manual documents WeeChat IRC client, it is part of WeeChat.@*
This manual documents WeeChat IRC client, it is part of WeeChat.@*
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
+302 -97
View File
@@ -35,7 +35,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.1 - 20 de marzo de 2005
@subtitle Documentaci@'on para WeeChat v0.1.3 - 03 de Julio de 2005
@image{weechat_image}
@@ -90,9 +90,9 @@ dise@~nado para diferentes sistemas operativos.@*
Las caracter@'isticas principales son las siguientes:
@itemize @minus
@item
conexi@'on multi-servidores
conexi@'on multi-servidores (con SSL, IPv6, proxy)
@item
m@'ultiples interfaces: Curses, Gtk y Qt
m@'ultiples interfaces: Curses, wxWidgets, Gtk y Qt
@item
peque@~no, r@'apido y ligero.
@item
@@ -100,7 +100,7 @@ parametrizable y extensible mediante guiones (scripts)
@item
conforme a las RFCs 1459, 2810, 2811, 2812, y 2813
@item
multi-plataforma (Gnu/Linux, *BSD, Windows y otros sistemas operativos)
multi-plataforma (Gnu/Linux, *BSD, MacOS X, Windows y otros sistemas operativos)
@item
100% GPL, con Licencia Libre
@end itemize
@@ -210,7 +210,7 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
* Ficheros de configuracion::
* Atajos de teclado::
* Comandos WeeChat::
* FIFO pipe::
* Canal FIFO::
@end menu
@node Iniciar WeeChat, Ficheros de configuracion, Uso, Uso
@@ -223,16 +223,21 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
Obtener la ayuda del fichero de configuraci@'on (lista de opciones)@*
@item -h, --help
Obtener la ayuda@*
@item -i, --irc-commands
Display IRC commands list@*
@item -l, --license
Obtener la licencia de WeeChat@*
@item -v, --version
Obtener la versi@'on de WeeChat@*
@item -w, --weechat-commands
Display WeeChat commands list@*
@end table
@subsection Lanzar WeeChat
Para ejecutar WeeChat, basta escribir la l@'inea siguiente:@*
@kbd{weechat-curses} (para el interfaz con Curses)@*
o @kbd{weechat-wxwidgets} (para el interfaz con wxWidgets)@*
o @kbd{weechat-gtk} (para el interfaz con Gtk)@*
o @kbd{weechat-qt} (para el interfaz con Qt)@*
@@ -247,7 +252,6 @@ Puedes editarlo para configurar WeeChat con las opciones deseadas, o tambi@'en p
Enumeraci@'on de las opciones del fichero de configuraci@'on:@*
@table @kbd
@item look_set_title
Define el t@'itulo de la ventana (el terminal para la interfaz Curses) con el nombre y la versi@'on@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@@ -269,6 +273,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item look_charset_internal
Juego de caracteres interno de WeeChat, deber@'ia ser ISO-xxxx aunque el locale sea UTF-8 (si no se especifica, se utiliza el juego de caracteres local)@*
Typo: cadena (cualquier cadena), valor por defecto: 'ISO-8859-1'@*
@item look_buffer_timestamp
Fecha y hora para las bĂşfers@*
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'@*
@@ -413,6 +420,9 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_voice
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@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_sep
Color para el separador de alias@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
@@ -481,7 +491,7 @@ Mensaje por defecto para el estado ausente@*
Typo: cadena (cualquier cadena), valor por defecto: 'away'@*
@item irc_default_msg_part
Mensaje por defecto de salida (saliendo de un canal)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
@item irc_default_msg_quit
Mensaje de fin por defecto ('%v' ser@'a reemplazado por la versi@'on de WeeChat en la cadena)@*
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
@@ -498,7 +508,7 @@ Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 1@*
Desconexi@'on tras un lag importante (en minutos, 0 = no desconectar nunca)@*
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Crea una tuber@'ia FIFO para control remoto@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item dcc_auto_accept_files
Aceptar autom@'aticamente los ficheros dcc entrantes@*
@@ -530,12 +540,21 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item proxy_use
Utilizar un proxy para conectarse al servidor irc@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item proxy_type
Proxy type (http (default), socks4, socks5)@*
Typo: cadena (valores: 'http', 'socks4', 'socks5'), valor por defecto: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item proxy_address
Direcci@'on del servidor proxy (IP o nombre de m@'aquina)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_port
Puerto para conectarse al servidor proxy@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 1080@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 3128@*
@item proxy_username
Username for proxy server@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_password
Contrase@~na para el servidor proxy@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@@ -557,6 +576,12 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item server_port
Puerto para conectarse al servidor@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 6667@*
@item server_ipv6
Use IPv6 protocol for server communication@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_ssl
Use SSL for server communication@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_password
Contrase@~na para el servidor IRC@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@@ -587,7 +612,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item server_autorejoin
Unirse de nuevo autom@'aticamente a los canales cuando sea expulsado@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item server_notify_levels
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@end table
Los colores para el interfaz Curses son:@*
@@ -624,7 +651,6 @@ Los colores para el interfaz Curses son:@*
@kbd{white}: blanco
@end itemize
@node Atajos de teclado, Comandos WeeChat, Ficheros de configuracion, Uso
@section Atajos de teclado
@@ -671,6 +697,9 @@ Ir a la ventana anterior / siguiente@*
@item F10
Borrar el @'ultimo mensaje en la barra de informaciones@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Refrescar toda la ventana@*
@*
@@ -695,15 +724,17 @@ Ir al primer canal del servidor siguiente (o a la memoria temporal del servidor
@item Alt + (1-9)
Saltar a la memoria temporal con ese n@'umero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node Comandos WeeChat, FIFO pipe, Atajos de teclado, Uso
@node Comandos WeeChat, Canal FIFO, Atajos de teclado, Uso
@section Comandos WeeChat
Comandos internos WeeChat:@*
@table @kbd
@item alias [nombre_alias [comando [argumentos]]
@*
crear un alias para un comando@*
@@ -743,9 +774,9 @@ nombre_del_servidor: nombre del servidor del que desconectarse@*
@*
@item debug dump
@*
print debug messages@*
imprime mensajes de depuraci@'on@*
@*
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)@*
volcado: almacena un volcado de memoria en el archivo de registro de Weechat (se escribe el mismo volcado cuando Weechat se cuelga)@*
@*
@item help [comando]
@*
@@ -753,26 +784,35 @@ mostrar ayuda sobre los comandos@*
@*
comando: nombre de un comando de Weechat @'o de IRC@*
@*
@item perl [load fichero] | [autoload] | [unload]
@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 server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@item python [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Python scripts@*
@*
fichero: Python script (archivo) a cargar@*
Sin argumentos, el comando /python lista todos los Python scripts cargados.@*
@*
@item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-ipv6] [-ssl] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@*
lista, a@~nade o elimina servidores@*
@*
nombre_de_servidor: nombre del servidor, para uso interno y para mostrar@*
nombre/IP: nombre o direcci@'on IP del servidor@*
puerto: puerto para el servidor (nĂşmero entero)@*
contrase@~na: contrase@~na para el servidor@*
alias1: primer alias para el servidor@*
alias2: alias alternativo para el servidor@*
alias3: segundo alias alternativo para el servidor@*
nombre_de_usuario: nombre de usuario@*
nombre_real: nombre real del usuario@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
ipv6: use IPv6 protocol@*
ssl: use SSL protocol@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
nick3: second alternate nick for server@*
username: user name@*
realname: real name of user@*
@*
@item save [archivo]
@*
@@ -802,13 +842,11 @@ splith: dividir la ventana actual horizontalmente@*
splitv: dividir la ventana actual verticalmente@*
merge: fusionar una ventana con otra@*
@*
@end table
Comandos IRC:@*
@table @kbd
@item admin [target]
@*
encontrar informaci@'on sobre el administrador del servidor@*
@@ -824,10 +862,10 @@ mensaje: mensaje para el estado ausente (si no se da ning
@*
@item ban [canal] [usariio [usuario ...]]
@*
bans nicks or hosts@*
banea usuarios o m@'aquinas@*
@*
channel: channel for ban@*
nickname: user or host to ban@*
canal: canal en el que banear@*
usuario: nombre de usuario o m@'aquina a banear@*
@*
@item ctcp usuario tipo
@*
@@ -900,11 +938,11 @@ comentario: comentario para la expulsi@'on@*
@*
@item kickban [canal] usuario [comentario]
@*
kicks and bans a nick from a channel@*
expulsa y banea a un usuario de un canal@*
@*
channel: channel where user is@*
nickname: nickname to kick and ban@*
comment: comment for kick@*
canal: canal donde est@'a el usuario@*
usuario: nombre de usuario a expulsar y banear@*
comentario: comentario para la expulsi@'on@*
@*
@item kill usuario comentario
@*
@@ -983,11 +1021,12 @@ listar usuarios en canales@*
@*
canal: nombre del canal@*
@*
@item nick usuario
@item nick [-all] usuarios
@*
cambiar el nombre de usuario actual@*
@*
usuario: nuevo nombre de usuario para el servidor IRC actual@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
@*
@item notice usuario texto
@*
@@ -1118,10 +1157,10 @@ target: servidor objetivo@*
@*
@item unban [canal] usuario [usuario ...]
@*
unbans nicks or hosts@*
desbanea usuarios o m@'aquinas@*
@*
channel: channel for unban@*
nickname: user or host to unban@*
canal: canal en el que desbanear (quitar la prohibici@'on)@*
usuario: usuario o m@'aquina a desbanear@*
@*
@item userhost usuario [usuario ...]
@*
@@ -1174,40 +1213,42 @@ usuario: nombre de usuario a buscar@*
nĂşmero: nĂşmero de respuestas a devolver (bĂşsqueda completa si el nĂşmero es negativo)@*
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
@*
@end table
@node FIFO pipe, , Comandos WeeChat, Uso
@section FIFO pipe
@node Canal FIFO, , Comandos WeeChat, Uso
@section Canal FIFO
You can remote control WeeChat, by sending commands or text to a FIFO pipe
(you have to enable option "irc_fifo_pipe", it is disabled by default).@*
The FIFO pipe is located in ~/.weechat/ and is called "weechat_fifo_xxxxx"
(where xxxxx is the process ID (PID) of running WeeChat).@*
So if many WeeChat are running, you have many FIFO pipe, one for each session.@*
Puedes controlar WeeChat a distantia, enviando comandos o texto a un canal FIFO
(debes activar la opci@'on "irc_fifo_pipe" que est@'a desactivada por defecto).@*
El canal FIFO est@'a dentro del directorio ~/.weechat/ y se llama
"weechat_fifo_xxxxx" (donde xxxxx es el ID del proceso (PID) de WeeChat).@*
Entonces si tienes varios WeeChat que se est@'an ejecutando, tendr@'as varios
canales FIFO, uno por cada sesi@'on.@*
@*
The syntax for the FIFO pipe commands/text is:@*
@command{server,channel *text or command here}@*
where server and channel are optional, but if channel is here, server should be too.@*
La sintaxis para enviar comandos o texto dentro del canal FIFO es la siguiente:@*
@command{servidor,canal *texto o comando aqu@'i}@*
donde el serviros y el canal son opcionales pero si precisa el canal, debes
precisar tambi@'en el servidor.@*
@*
Some examples:
Algunos ejemplos:
@table @asis
@item @bullet{} change your nick on freenode to "mynick|out":
@item @bullet{} cambiar el seud@'onimo en freenode por "mynick|out":
@*
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on #weechat channel:
@item @bullet{} escribir texto en el canal #weechat:
@*
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
@command{echo "freenode,#weechat *@exclamdown{}Hola a todos!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} escribir texto en el canal corriente (el que se puede visualizar en WeeChat actualmente)
@*
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
@command{echo "*¡Hola!" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
@b{Advertencia:} esto es peligroso y no deber@'ias hacerlo.. salvo si lo que est@'as haciendo.
@item @bullet{} enviar dos comandos para descargar y recargar los scripts Perl (tienes que separarlos con un \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
You can write a script to send command to all running WeeChat at same time, for example:@*
Puedes escribir un script que envia los comandos a todos los programas WeeChat
que se est@'an ejecutando de momento. Por ejemplo:@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
@@ -1217,8 +1258,8 @@ You can write a script to send command to all running WeeChat at same time, for
fi
@end verbatim
@*
If the script is called "auto_weechat_command", you can run it with:@*
@command{./auto_weechat_command "freenode,#weechat *hello"}
Si el script se llama "auto_weechat_command", puedes ejecutarlo hac@'i:@*
@command{./auto_weechat_command "freenode,#weechat *Hola"}
@c ******************************* Extensions *********************************
@@ -1253,7 +1294,7 @@ Listar los programas Perl cargados: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@command{weechat::register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@*
Es la primera funci@'on a la que llamar en el programa Perl.@*
Todos los programas en Perl para WeeChat deben llamar esta funci@'on.@*
@@ -1269,42 +1310,29 @@ tener un nombre distinto)
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@code{weechat::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@*
@item
@command{IRC::print ( mensaje );}@*
@*
Escribe un mensaje en la ventana actual (canal o servidor).@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::print ("mensaje");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [servidor,] mensaje );}@*
@command{weechat::print ( mensaje, [canal, [servidor]] );}@*
@*
Escribe un mensaje en un canal.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@item @option{canal}: nombre del canal
@item @option{servidor}: (opcional) nombre interno del servidor
@item @option{mensaje}: mensaje que debe escribir en el canal
@end itemize
@*
@emph{Ejemplos:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "mensaje");}@*
@code{IRC::print_with_channel ("#weechat", "mensaje");}@*
@emph{Ejemplo:}@*
@code{weechat::print ("mensaje");}@*
@code{weechat::print ("mensaje", "#weechat");}@*
@code{weechat::print ("mensaje", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( retraso, mensaje );}@*
@command{weechat::print_infobar ( retraso, mensaje );}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@@ -1316,11 +1344,11 @@ Escribir un mensaje en la barra de informaciones.@*
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::print_infobar (5, "mensaje");}@*
@code{weechat::print_infobar (5, "mensaje");}@*
@*
@item
@command{IRC::add_message_handler ( nombre, funci@'on );}@*
@command{weechat::add_message_handler ( nombre, funci@'on );}@*
@*
Adjunta una funci@'on Perl a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@@ -1336,18 +1364,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::add_message_handler ("privmsg", mi_funcion);}@*
@code{weechat::add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ IRC::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@ @ @ @ weechat::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nombre, funci@'on );}@*
@command{weechat::add_command_handler ( nombre, funci@'on );}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Perl.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@@ -1362,23 +1390,41 @@ al antiguo comando si el script Perl est@'a cargado.
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::add_command_handler ("comando", mi_comando);}@*
@code{weechat::add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [servidor,] nombre );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nombre, [servidor] );}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{servidor}: nombre interno del servidor
@item @option{nombre}: nombre de la informaci@'on que se quiere obtener:
@item @option{servidor}: nombre interno del servidor
@itemize @minus
@item @option{0 o version}: obtener la versi@'on de WeeChat
@item @option{1 o nick}: obtener el seud@'onimo
@@ -1390,8 +1436,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$version = weechat::get_info("version");}@*
@code{$nick = weechat::get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1399,7 +1445,166 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@node Programas Python, Programas Ruby, Programas Perl, Extensiones
@section Programas Python
¡No desarrollado!
@subsection Cargar/descargar programas Python
Los programas Python se cargan y descargan con el comando @command{/python}
(escribiendo @kbd{/help python} en WeeChat para obtener la ayuda acerca del comando).@*
@emph{Ejemplos:}@*
@itemize @bullet
@item
Cargar un programa Python: @kbd{/python load /tmp/ejemplo.py}@*
@item Descargar todos los programas Python: @kbd{/python unload}@*
@item
Listar los programas Python cargados: @kbd{/python}@*
@end itemize
@subsection Interfaz WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on )}@*
@*
Es la primera funci@'on a la que llamar en el programa Python.@*
Todos los programas en Python para WeeChat deben llamar esta funci@'on.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre @'unico para identificar el programa (cada programa debe
tener un nombre distinto)
@item @option{versi@'on}: versi@'on del programa
@item @option{funci@'on_final}: funci@'on Python llamada cuando el programa finaliza
(par@'ametro facultativo, una cadena llena significa que no hay ninguna funci@'on que llamar)
@item @option{descripci@'on}: descripci@'on breve del programa
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...")}@*
@*
@item
@command{weechat.prnt ( mensaje, [canal, [servidor]] )}@*
@*
Escribe un mensaje en un canal.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@item @option{canal}: nombre del canal
@item @option{servidor}: (opcional) nombre interno del servidor
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.prnt ("mensaje")}@*
@code{weechat.prnt ("mensaje", "#weechat")}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( retraso, mensaje )}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{retraso}: periodo en segundo durante el cual se mostrar@'a el mensaje
(si es 0, el mensaje no se borrar@'a).
@item @option{mensaje}: mensaje que se escribir@'a en la barra de informaciones.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.print_infobar (5, "mensaje")}@*
@*
@item
@command{weechat.add_message_handler ( nombre, funci@'on )}@*
@*
Adjunta una funci@'on Python a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre del mensaje IRC que producir@'a la llamada a la funci@'on.@*
Para saber qu@'e tipo de mensajes IRC existen puede leer las
RFC 1459 y/o 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{funci@'on}: funci@'on en Python llamada cuando se reciba el mensaje.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_message_handler ("privmsg", mi_funcion)}@*
@code{def mi_funcion(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("servidor="+servidor)}@*
@code{@ @ @ @ null, canal, mensaje = string.split(args, ":", 2)}@*
@code{@ @ @ @ mascara, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("mascara="+mascara+", canal="+canal+", mensaje="+mensaje)}@*
@*
@item
@command{weechat.add_command_handler ( nombre, funci@'on )}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Python.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre del nuevo comando@*
Puede ser un comando que ya existe, y en este caso el nuevo comando sustituir@'a
el antiguo. Ten cuidado cuando sustituyas a un comando de WeeChat, no podr@'a acceder
al antiguo comando si el script Python est@'a cargado.
@item @option{funcion}: funci@'on Python assiciada al comando.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_command_handler ("comando", mi_comando)}@*
@code{def mi_comando(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("Servidor:"+servidor+" Par@'ametros:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nombre, [servidor] )}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre de la informaci@'on que se quiere obtener:
@item @option{servidor}: nombre interno del servidor
@itemize @minus
@item @option{0 o version}: obtener la versi@'on de WeeChat
@item @option{1 o nick}: obtener el seud@'onimo
@item @option{2 o channel}: obtener el nombre del canal
@item @option{3 o server}: obtener el nombre del servidor
@item @option{4 o weechatdir}: obtener el directorio home de WeeChat
@item @option{5 o away}: obtener la informaci@'on "away" del servidor
@end itemize
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
@node Programas Ruby, , Programas Python, Extensiones
@section Programas Ruby
+351 -147
View File
@@ -35,7 +35,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
@subtitle Documentation pour WeeChat v0.1.3 - 03 Juillet 2005
@image{weechat_image}
@@ -83,27 +83,27 @@ License version 2 ou plus.
@node Description, Pre-requis, Introduction, Introduction
@section Description
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
concu pour diff@'erents syst@`emes d'exploitation.@*
@*
Ses principales caract@'eristiques sont les suivantes :
@*
Ses principales caract@'eristiques sont les suivantes :
@itemize @minus
@item
connexion multi-serveurs
@item
plusieurs interfaces : Curses, Gtk et Qt
@item
petit, rapide et l@'eger
@item
param@'etrable et extensible avec des scripts
@item
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
@item
multi-plateformes (Gnu/Linux, *BSD, Windows et d'autres syst@`emes)
@item
@item
connexion multi-serveurs (avec SSL, IPv6, proxy)
@item
plusieurs interfaces : Curses, wxWidgets, Gtk et Qt
@item
petit, rapide et l@'eger
@item
param@'etrable et extensible avec des scripts
@item
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
@item
multi-plateformes (Gnu/Linux, *BSD, MacOS X, Windows et d'autres syst@`emes)
@item
100% GPL, logiciel libre
@end itemize
@end itemize
@*
La page d'accueil de WeeChat est ici :@*
@uref{http://weechat.flashtux.org}@*
@@ -115,20 +115,20 @@ Pour installer WeeChat, vous @b{devez} avoir :@*
@itemize @bullet
@item
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
@item
Droits "root" (pour installer WeeChat)
@item
Selon l'interface, une des biblioth@`eques suivantes :
@itemize @minus
@item
Curses: la librairie ncurses,
@item
Gtk: *** interface non d@'evelopp@'ee ***,
@item
Qt: *** interface non d@'evelopp@'ee ***,
Selon l'interface, une des biblioth@`eques suivantes :
@itemize @minus
@item
Curses: la librairie ncurses,
@item
Gtk: *** interface non d@'evelopp@'ee ***,
@item
Qt: *** interface non d@'evelopp@'ee ***,
@end itemize
@end itemize
@end itemize
@c ******************************* Installation *******************************
@@ -138,31 +138,31 @@ Qt: *** interface non d@'evelopp@'ee ***,
@menu
* Paquet binaire::
* Paquet source::
* Paquet source::
* Sources CVS::
@end menu
@node Paquet binaire, Paquet source, Installation, Installation
@section Paquet binaire
Les paquets binaires sont disponibles pour les distributions suivantes :
@itemize @bullet
@item
Debian (ou toute distribution compatible Debian)@*
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
Pour installer : @kbd{emerge weechat}
@item
*BSD (non disponible !)
@item
Slackware (non disponible !)
@item
Windows (non disponible !)
@end itemize
Les paquets binaires sont disponibles pour les distributions suivantes :
@itemize @bullet
@item
Debian (ou toute distribution compatible Debian)@*
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
Pour installer : @kbd{emerge weechat}
@item
*BSD (non disponible !)
@item
Slackware (non disponible !)
@item
Windows (non disponible !)
@end itemize
o@`u x.y.z est la version (par exemple 0.0.1)
@*
@@ -175,28 +175,28 @@ Tapez simplement dans une console ou un terminal :@*
@kbd{make}@*
Note: pour ne construire que certaines interfaces, vous pouvez passer des param@`etres
@`a ./configure, tapez @kbd{./configure --help} pour de l'aide sur ces options.@*
Obtenez les droits root et installez WeeChat :@*
@kbd{su}@*
(entrez le mot de passe de root)@*
@kbd{make install}@*
Obtenez les droits root et installez WeeChat :@*
@kbd{su}@*
(entrez le mot de passe de root)@*
@kbd{make install}@*
@node Sources CVS, , Paquet source, Installation
@section Sources CVS
@section Sources CVS
Attention: les sources CVS sont r@'eserv@'es aux utilisateurs avanc@'es : il se peut
que WeeChat ne compile pas et qu'il soit tr@`s instable.
Vous @^etes pr@'evenus !@*
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
que WeeChat ne compile pas et qu'il soit tr@`s instable.
Vous @^etes pr@'evenus !@*
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
Ex@'ecutez ce script :@*
@kbd{./autogen.sh}@*
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
@c ******************************* Utilisation ********************************
@@ -206,40 +206,45 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
@menu
* Lancer WeeChat::
* Fichier de configuration::
* Raccourcis clavier::
* Fichier de configuration::
* Raccourcis clavier::
* Commandes WeeChat::
* Tube FIFO::
@end menu
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
@section Lancer WeeChat
@subsection Param@`etres de ligne de commande
@subsection Param@`etres de ligne de commande
@table @code
@item -c, --config
Afficher l'aide sur le fichier de config (liste des options)@*
@item -h, --help
Afficher l'aide@*
@item -i, --irc-commands
Afficher la liste des commandes IRC@*
@item -l, --license
Afficher la licence de WeeChat@*
@item -v, --version
@item -v, --version
Afficher la version de WeeChat@*
@end table
@subsection Lancer WeeChat
Tapez simplement cette commande pour lancer WeeChat :@*
@item -w, --weechat-commands
Afficher la liste des commandes WeeChat@*
@end table
@subsection Lancer WeeChat
Tapez simplement cette commande pour lancer WeeChat :@*
@kbd{weechat-curses} (pour l'interface Curses)@*
ou @kbd{weechat-wxwidgets} (pour l'interface wxWidgets)@*
ou @kbd{weechat-gtk} (pour l'interface Gtk)@*
ou @kbd{weechat-qt} (pour l'interface Qt)@*
ou @kbd{weechat-qt} (pour l'interface Qt)@*
Lorsque vous lancez WeeChat pour la premi@`ere fois, un fichier de configuration
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} - @xref{Commandes WeeChat}.
@node Fichier de configuration, Raccourcis clavier, Lancer WeeChat, Utilisation
@@ -248,7 +253,6 @@ vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} -
Liste des options du fichier de configuration :@*
@table @kbd
@item look_set_title
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -270,6 +274,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item look_charset_internal
Jeu de caract@`eres interne @`a WeeChat, devrait @^etre ISO-xxxx m@^eme si la locale est UTF-8 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'ISO-8859-1'@*
@item look_buffer_timestamp
Horodatage pour les tampons@*
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'@*
@@ -414,6 +421,9 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_voice
Couleur pour le symbole voix@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_nick_more
Couleur pour les '+' lors du scroll sur les pseudos@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_sep
Couleur pour le s@'eparateur de pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
@@ -482,7 +492,7 @@ Message par d@'efaut pour l'absence@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'away'@*
@item irc_default_msg_part
Message par d@'efaut pour le part (quitte un canal)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@item irc_default_msg_quit
Message de fin par d@'efaut ('%v' sera remplac@'e par la version de WeeChat dans la cha@^ine)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@@ -531,12 +541,21 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item proxy_use
Utiliser un proxy pour se connecter au serveur irc@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item proxy_type
Type de proxy (http (d@'efaut), socks4, socks5)@*
Type: cha@^ine (valeurs: 'http', 'socks4', 'socks5'), valeur par d@'efaut: 'http'@*
@item proxy_ipv6
Se connecter au proxy en ipv6@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item proxy_address
Adresse du serveur proxy (IP ou nom)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item proxy_port
Port pour se connecter au serveur proxy@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 1080@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 3128@*
@item proxy_username
Nom d'utilisateur pour le serveur proxy@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item proxy_password
Mot de passe pour le serveur proxy@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -558,6 +577,12 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_port
Port pour se connecter au serveur@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 6667@*
@item server_ipv6
Utiliser le protocole IPv6 pour la communication avec le serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item server_ssl
Utiliser SSL pour la communication avec le serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item server_password
Mot de passe pour le serveur IRC@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -588,7 +613,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_autorejoin
Rejoindre automatiquement les canaux quand mis dehors@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item server_notify_levels
Liste des niveaux de notifications (s@'epar@'es par des virgules) pour les canaux de ce serveur (format: #canal:1,..)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@end table
Les couleurs pour l'interface Curses sont :@*
@@ -627,11 +654,11 @@ Les couleurs pour l'interface Curses sont :@*
@node Raccourcis clavier, Commandes WeeChat, Fichier de configuration, Utilisation
@section Raccourcis clavier
@table @kbd
@item Fl@`eche gauche / Fl@`eche droite
Aller au caract@`ere pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@*
@item Ctrl + fl@`eche gauche / Ctrl + fl@`eche droite
Aller au mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@@ -641,28 +668,28 @@ Aller au d@'ebut de la ligne de commande@*
@item End / Ctrl + E
Aller @`a la fin de la ligne de commande@*
@*
@item Backspace / Delete
@item Backspace / Delete
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@item Ctrl + Backspace / Ctrl + W
@*
@item Ctrl + Backspace / Ctrl + W
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
@*
@item Tab
@*
@item Tab
Compl@'eter la commande ou le pseudo (@kbd{Tab} @`a nouveau : trouver la compl@'etion suivante)@*
@*
@item Tout caract@`ere
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
@*
@item Entr@'ee
@*
@item Tout caract@`ere
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
@*
@item Entr@'ee
Ex@'ecuter la commande ou envoyer le message@*
@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item PageUp / PageDown
@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item PageUp / PageDown
Afficher l'historique du tampon@*
@*
@item F5 / F6
@*
@item F5 / F6
Aller au tampon pr@'ec@'edent / suivant@*
@*
@item F7 / F8
@@ -671,10 +698,13 @@ Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@item F11 / F12
Faire d@'efiler la liste des pseudos@*
@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
Identique @`a F5 / F6@*
@*
@item Alt + A
@@ -695,6 +725,9 @@ Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal
@item Alt + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Faire d@'efiler la liste des pseudos@*
@*
@end table
@node Commandes WeeChat, Tube FIFO, Raccourcis clavier, Utilisation
@@ -703,7 +736,6 @@ Sauter au tampon avec ce num@'ero@*
Commandes internes WeeChat :@*
@table @kbd
@item alias [nom_alias [commande [param@`etres]]
@*
cr@'eer un alias pour une commande@*
@@ -753,20 +785,29 @@ afficher l'aide sur les commandes@*
@*
commande: nom d'une commande WeeChat ou IRC@*
@*
@item perl [load fichier] | [autoload] | [unload]
@item perl [load fichier] | [autoload] | [reload] | [unload]
@*
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 server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@item python [load fichier] | [autoload] | [reload] | [unload]
@*
liste/charge/d@'echarge des scripts Python@*
@*
fichier: script Python (fichier) @`a charger@*
Sans param@`etre, la commande /python liste tous les scripts Python charg@'es.@*
@*
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-ipv6] [-ssl] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@*
liste, ajoute ou retire des serveurs@*
@*
nom_serveur: nom du serveur, pour usage interne et affichage@*
nom/IP: nom ou adresse IP du serveur@*
port: port pour le serveur (nombre entier)@*
ipv6: utiliser le protocole IPv6@*
ssl: utiliser le protocole SSL@*
mot_de_passe: mot de passe pour le serveur@*
pseudo1: premier pseudo pour le serveur@*
pseudo2: pseudo alternatif pour le serveur@*
@@ -802,13 +843,11 @@ splith: @'eclate la fen@^etre en deux horizontalement@*
splitv: @'eclate la fen@^etre en deux verticalement@*
merge: fusionne la fen@^etre avec une autre@*
@*
@end table
Commandes IRC :@*
@table @kbd
@item admin [cible]
@*
trouver les informations sur l'administrateur du serveur@*
@@ -983,11 +1022,12 @@ lister les utilisateurs sur des canaux@*
@*
canal: nom du canal@*
@*
@item nick pseudo
@item nick [-all] pseudo
@*
changer le pseudo courant@*
@*
pseudo: nouveau pseudo pour le serveur IRC courant@*
-all: d@'efinir le nouveau pseudo sur tous les serveurs connect@'es@*
pseudo: nouveau pseudo@*
@*
@item notice pseudo texte
@*
@@ -1174,7 +1214,6 @@ pseudo: pseudo @`a chercher@*
nombre: nombre de r@'eponses @`a retourner (recherche compl@`ete si nombre n@'egatif)@*
cible: la r@'eponse doit correspondre @`a ce masque@*
@*
@end table
@node Tube FIFO, , Commandes WeeChat, Utilisation
@@ -1254,7 +1293,7 @@ Lister les scripts Perl charg@'es : @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nom, version, fonction_de_fin, description );}@*
@command{weechat::register ( nom, version, fonction_de_fin, description );}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Perl.@*
Tout script Perl pour WeeChat doit appeler cette fonction.@*
@@ -1271,42 +1310,29 @@ de fonction @`a appeler)
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@code{weechat::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@*
@item
@command{IRC::print ( message );}@*
@*
Affiche un message dans la fen@^etre courante (canal ou serveur).@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::print ("message");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [serveur,] message );}@*
@command{weechat::print ( message, [canal, [serveur]] );}@*
@*
Affiche un message dans un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemples :}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
@code{IRC::print_with_channel ("#weechat", "message");}@*
@emph{Exemple :}@*
@code{weechat::print ("message");}@*
@code{weechat::print ("message", "#weechat");}@*
@code{weechat::print ("message", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( d@'elai, message );}@*
@command{weechat::print_infobar ( d@'elai, message );}@*
@*
Affiche un message dans la barre d'infos.@*
@@ -1318,11 +1344,11 @@ Affiche un message dans la barre d'infos.@*
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::print_infobar (5, "message");}@*
@code{weechat::print_infobar (5, "message");}@*
@*
@item
@command{IRC::add_message_handler ( nom, fonction );}@*
@command{weechat::add_message_handler ( nom, fonction );}@*
@*
Attache une fonction Perl @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@@ -1338,18 +1364,18 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::add_message_handler ("privmsg", ma_fonction);}@*
@code{weechat::add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ IRC::print ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nom, fonction );}@*
@command{weechat::add_command_handler ( nom, fonction );}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Perl.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@@ -1364,23 +1390,41 @@ ne seront plus accessibles tant que le script Perl sera charg@'e.
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::add_command_handler ("commande", ma_commande);}@*
@code{weechat::add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [serveur,] nom );}@*
@command{weechat::command ( commande, [canal, [serveur]] );}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal)
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemples :}@*
@code{weechat::command ("bonjour tout le monde !");}@*
@code{weechat::command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nom, [serveur] );}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{serveur}: nom interne du serveur
@item @option{nom}: nom de l'info @`a obtenir :
@item @option{serveur}: nom interne du serveur
@itemize @minus
@item @option{0 ou version}: obtenir la version de WeeChat
@item @option{1 ou nick}: obtenir le pseudo
@@ -1393,7 +1437,7 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@*
@emph{Exemples :}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1401,7 +1445,167 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@node Scripts Python, Scripts Ruby, Scripts Perl, Extensions
@section Scripts Python
Non d@'evelopp@'e !
@subsection Charger/d@'echarger des scripts Python
Les scripts Python sont charg@'es et d@'echarg@'es avec la commande @command{/python}
(tapez @kbd{/help python} dans WeeChat pour obtenir de l'aide sur la commande).@*
@emph{Exemples :}@*
@itemize @bullet
@item
Charger un script Python : @kbd{/python load /tmp/essai.py}@*
@item D@'echarger tous les scripts Python : @kbd{/python unload}@*
@item
Lister les scripts Python charg@'es : @kbd{/python}@*
@end itemize
@subsection Interface WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nom, version, fonction_de_fin, description )}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Python.@*
Tout script Python pour WeeChat doit appeler cette fonction.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom unique pour identifier le script (chaque script doit
avoir un nom diff@'erent)
@item @option{version}: version du script
@item @option{fonction_de_fin}: fonction Python appel@'ee quand le script est
d@'echarg@'e (param@`etre facultatif, une cha@^ine vide signifiant qu'il n'y a pas
de fonction @`a appeler)
@item @option{description}: description br@`eve du script.
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !")}@*
@*
@item
@command{weechat.prnt ( message, [canal, [serveur]] )}@*
@*
Affiche un message dans un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( d@'elai, message )}@*
@*
Affiche un message dans la barre d'infos.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{d@'elai}: d@'elai (en secondes) pendant lequel le message est affich@'e
(si 0, le message ne sera pas effac@'e).
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( nom, fonction )}@*
@*
Attache une fonction Python @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom du message IRC pour lequel la fonction est appel@'ee@*
Pour conna@^itre la liste des messages IRC disponibles, merci de consulter les
RFC 1459 et/ou 2812 :@*
RFC 1459 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{fonction}: fonction Python appel@'ee lorsque le message est re@,{c}u
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_message_handler ("privmsg", ma_fonction)}@*
@code{def ma_fonction(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur="+serveur)}@*
@code{@ @ @ @ null, canal, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ masque, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("masque="+masque+", canal="+canal+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( nom, fonction )}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Python.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom de la nouvelle commande@*
Il peut s'agir d'une commande existante, auquel cas celle-ci est @'ecras@'ee par
la fonction Python. Soyez prudent en @'ecrasant les commandes WeeChat, car elles
ne seront plus accessibles tant que le script Python sera charg@'e.
@item @option{fonction}: fonction Python associ@'ee @`a la commande
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_command_handler ("commande", ma_commande)}@*
@code{def ma_commande(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur:"+serveur+" param@`etres:"+args)}@*
@*
@item
@command{weechat.command ( commande, [canal, [serveur]] )}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal)
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemples :}@*
@code{weechat.command ("bonjour tout le monde !")}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nom, [serveur] )}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom de l'info @`a obtenir :
@item @option{serveur}: nom interne du serveur
@itemize @minus
@item @option{0 ou version}: obtenir la version de WeeChat
@item @option{1 ou nick}: obtenir le pseudo
@item @option{2 ou channel}: obtenir le nom du canal
@item @option{3 ou server}: obtenir le nom du serveur
@item @option{4 ou weechatdir}: obtenir le r@'epertoire maison de WeeChat
@item @option{5 ou away}: obtenir le drapeau "away" du serveur
@end itemize
@end itemize
@*
@emph{Exemples :}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
@node Scripts Ruby, , Scripts Python, Extensions
@section Scripts Ruby
+1098 -40
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -9,6 +9,8 @@
./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/plugins.c
./src/plugins/plugins.h
./src/gui/curses/gui-input.c
+985 -764
View File
File diff suppressed because it is too large Load Diff
+999 -765
View File
File diff suppressed because it is too large Load Diff
+993 -774
View File
File diff suppressed because it is too large Load Diff
+209 -23
View File
@@ -73,19 +73,26 @@ t_weechat_command weechat_commands[] =
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
0, 1, weechat_cmd_help, NULL },
{ "perl", N_("list/load/unload Perl scripts"),
N_("[load filename] | [autoload] | [unload]"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: Perl script (file) to load\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"
"Without argument, /python command lists all loaded Python scripts."),
0, 2, weechat_cmd_python, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 "
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
"[nick2 [nick3]]] [-username username] [-realname realname] "
"[-command command] [-autojoin channel[,channel]] ] | "
"[del servername]"),
N_("servername: server name, for internal & display use\n"
"hostname: name or IP address of server\n"
"port: port for server (integer)\n"
"ipv6: use IPv6 protocol\n"
"ssl: use SSL protocol\n"
"password: password for server\n"
"nick1: first nick for server\n"
"nick2: alternate nick for server\n"
@@ -652,6 +659,8 @@ void
user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
{
t_irc_nick *ptr_nick;
int plugin_args_length;
char *plugin_args;
if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n'))
return;
@@ -677,7 +686,7 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
else
server_sendf (server, "PRIVMSG %s :%s\r\n",
CHANNEL(buffer)->name, command);
if (CHANNEL(buffer)->type == CHAT_PRIVATE)
{
gui_printf_type_color (CHANNEL(buffer)->buffer,
@@ -699,7 +708,7 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
ptr_nick = nick_search (CHANNEL(buffer), server->nick);
if (ptr_nick)
{
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick,
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_color (CHANNEL(buffer)->buffer,
COLOR_WIN_CHAT, "%s\n", command);
@@ -712,6 +721,27 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
WEECHAT_ERROR);
}
}
/* sending a copy of the message as PRIVMSG to plugins because irc server doesn't */
plugin_args_length = strlen ("localhost PRIVMSG :") +
strlen (CHANNEL(buffer)->name) + strlen(command) + 16;
plugin_args = (char *) malloc (plugin_args_length * sizeof (*plugin_args));
if (plugin_args)
{
snprintf (plugin_args, plugin_args_length,
"localhost PRIVMSG %s :%s",
CHANNEL(buffer)->name, command);
plugin_event_msg ("privmsg", server->name, plugin_args);
free (plugin_args);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s unable to call handler for message (not enough memory)\n"),
WEECHAT_ERROR);
}
}
else
{
@@ -967,7 +997,8 @@ weechat_cmd_buffer (int argc, char **argv)
(ptr_buffer->dcc) ? "DCC" :
((BUFFER_IS_SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
CHANNEL(ptr_buffer)->name));
if (ptr_buffer->dcc)
if ((!BUFFER_IS_CHANNEL(ptr_buffer))
&& (!BUFFER_IS_PRIVATE(ptr_buffer)))
gui_printf (NULL, "-");
else
gui_printf (NULL, "%d", ptr_buffer->notify_level);
@@ -982,22 +1013,34 @@ weechat_cmd_buffer (int argc, char **argv)
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0'))
{
if ((number < 0) || (number > 3))
if ((number < NOTIFY_LEVEL_MIN) || (number > NOTIFY_LEVEL_MAX))
{
/* invalid highlight level */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
return -1;
}
if ((!BUFFER_IS_CHANNEL(gui_current_window->buffer))
&& (!BUFFER_IS_PRIVATE(gui_current_window->buffer)))
{
/* invalid buffer type (only ok on channel or private) */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect buffer for notify (must be channel or private)\n"),
WEECHAT_ERROR);
return -1;
}
gui_current_window->buffer->notify_level = number;
channel_set_notify_level (SERVER(gui_current_window->buffer),
CHANNEL(gui_current_window->buffer),
number);
}
else
{
/* invalid number */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
WEECHAT_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
return -1;
}
}
@@ -1286,19 +1329,18 @@ weechat_cmd_help (int argc, char **argv)
int
weechat_cmd_perl (int argc, char **argv)
{
#ifdef PLUGINS
#ifdef PLUGIN_PERL
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
char *path_script;
#ifdef PLUGIN_PERL
switch (argc)
{
case 0:
/* list registered Perl scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered Perl scripts:\n"));
gui_printf (NULL, _("Registered %s scripts:\n"), "Perl");
if (perl_scripts)
{
for (ptr_plugin_script = perl_scripts; ptr_plugin_script;
@@ -1320,7 +1362,7 @@ weechat_cmd_perl (int argc, char **argv)
/* list Perl message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Perl message handlers:\n"));
gui_printf (NULL, _("%s message handlers:\n"), "Perl");
handler_found = 0;
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
@@ -1329,8 +1371,9 @@ weechat_cmd_perl (int argc, char **argv)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => Perl(%s)\n"),
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Perl",
ptr_plugin_handler->function_name);
}
}
@@ -1342,7 +1385,7 @@ weechat_cmd_perl (int argc, char **argv)
/* list Perl command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Perl command handlers:\n"));
gui_printf (NULL, _("%s command handlers:\n"), "Perl");
handler_found = 0;
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
@@ -1351,8 +1394,9 @@ weechat_cmd_perl (int argc, char **argv)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => Perl(%s)\n"),
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Perl",
ptr_plugin_handler->function_name);
}
}
@@ -1366,13 +1410,13 @@ weechat_cmd_perl (int argc, char **argv)
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
if (strcasecmp (argv[0], "unload") == 0)
else if (strcasecmp (argv[0], "reload") == 0)
{
/* unload all Perl scripts */
plugin_unload (PLUGIN_TYPE_PERL, NULL);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Perl scripts unloaded\n"));
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PERL, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
@@ -1418,11 +1462,148 @@ weechat_cmd_perl (int argc, char **argv)
(void) argv;
#endif /* PLUGIN_PERL */
return 0;
}
/*
* weechat_cmd_python: list/load/unload Python scripts
*/
int
weechat_cmd_python (int argc, char **argv)
{
#ifdef PLUGIN_PYTHON
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 Python scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered %s scripts:\n"), "Python");
if (python_scripts)
{
for (ptr_plugin_script = python_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 Python message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s message handlers:\n"), "Python");
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_PYTHON)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Python",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Python command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s command handlers:\n"), "Python");
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_PYTHON)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Python",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
break;
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
else if (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)
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
{
/* load Python 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, "python",
DIR_SEPARATOR, argv[1]);
}
plugin_load (PLUGIN_TYPE_PYTHON,
(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, "python");
}
break;
default:
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "python");
}
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Python support.\n"
"Please rebuild WeeChat with "
"\"--enable-python\" option for ./configure script\n"));
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGINS */
#endif /* PLUGIN_PYTHON */
return 0;
}
@@ -1585,6 +1766,10 @@ weechat_cmd_server (int argc, char **argv)
server.autoconnect = 1;
if (strcasecmp (argv[i], "-noauto") == 0)
server.autoconnect = 0;
if (strcasecmp (argv[i], "-ipv6") == 0)
server.ipv6 = 1;
if (strcasecmp (argv[i], "-ssl") == 0)
server.ssl = 1;
if (strcasecmp (argv[i], "-pwd") == 0)
{
if (i == (argc - 1))
@@ -1672,10 +1857,11 @@ weechat_cmd_server (int argc, char **argv)
new_server = server_new (server.name, server.autoconnect,
server.autoreconnect,
server.autoreconnect_delay,
0, server.address, server.port, server.password,
0, server.address, server.port, server.ipv6,
server.ssl, server.password,
server.nick1, server.nick2, server.nick3,
server.username, server.realname,
server.command, 1, server.autojoin, 1);
server.command, 1, server.autojoin, 1, NULL);
if (new_server)
{
irc_display_prefix (NULL, PREFIX_INFO);
+1
View File
@@ -70,6 +70,7 @@ extern int weechat_cmd_debug (int, char **);
extern int weechat_cmd_disconnect (int, char **);
extern int weechat_cmd_help (int, char **);
extern int weechat_cmd_perl (int, char **);
extern int weechat_cmd_python (int, char **);
extern int weechat_cmd_save (int, char **);
extern int weechat_cmd_server (int, char **);
extern int weechat_cmd_set (char *);
+96 -17
View File
@@ -47,6 +47,7 @@ completion_init (t_completion *completion)
completion->base_command_arg = 0;
completion->position = -1;
completion->base_word = NULL;
completion->args = NULL;
completion->completion_list = NULL;
completion->last_completion = NULL;
@@ -67,6 +68,10 @@ completion_free (t_completion *completion)
free (completion->base_word);
completion->base_word = NULL;
if (completion->args)
free (completion->args);
completion->args = NULL;
while (completion->completion_list)
weelist_remove (&completion->completion_list,
&completion->last_completion,
@@ -97,8 +102,11 @@ completion_build_list (t_completion *completion, void *channel)
int i, j;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
char option_name[256];
char *pos, option_name[256];
t_weechat_alias *ptr_alias;
t_config_option *option;
void *option_value;
char option_string[2048];
/* WeeChat internal commands */
@@ -193,7 +201,8 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if ((strcasecmp (completion->base_command, "perl") == 0)
if (((strcasecmp (completion->base_command, "perl") == 0)
|| (strcasecmp (completion->base_command, "python") == 0))
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -202,37 +211,100 @@ completion_build_list (t_completion *completion, void *channel)
weelist_add (&completion->completion_list,
&completion->last_completion,
"autoload");
weelist_add (&completion->completion_list,
&completion->last_completion,
"reload");
weelist_add (&completion->completion_list,
&completion->last_completion,
"unload");
return;
}
if ((strcasecmp (completion->base_command, "set") == 0)
&& (completion->base_command_arg == 1))
if (strcasecmp (completion->base_command, "set") == 0)
{
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
if (completion->base_command_arg == 1)
{
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
for (j = 0; weechat_options[i][j].option_name; j++)
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
}
}
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
option_name);
}
}
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
else if (completion->base_command_arg == 3)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
if (completion->args)
{
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_name);
pos = strchr (completion->args, ' ');
if (pos)
pos[0] = '\0';
option = NULL;
option_value = NULL;
config_option_search_option_value (completion->args, &option, &option_value);
if (option && option_value)
{
switch (option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (option_value && (*((int *)(option_value))))
weelist_add (&completion->completion_list,
&completion->last_completion,
"on");
else
weelist_add (&completion->completion_list,
&completion->last_completion,
"off");
break;
case OPTION_TYPE_INT:
snprintf (option_string, sizeof (option_string) - 1,
"%d", (option_value) ? *((int *)(option_value)) : option->default_int);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_string);
break;
case OPTION_TYPE_INT_WITH_STRING:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
option->array_values[*((int *)(option_value))] :
option->array_values[option->default_int]);
break;
case OPTION_TYPE_COLOR:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
gui_get_color_by_value (*((int *)(option_value))) :
option->default_string);
break;
case OPTION_TYPE_STRING:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
*((char **)(option_value)) :
option->default_string);
break;
}
}
if (pos)
pos[0] = ' ';
}
}
return;
@@ -392,6 +464,11 @@ completion_build_list (t_completion *completion, void *channel)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "me") == 0)
{
completion->context = COMPLETION_NICK;
return;
}
if (strcasecmp (completion->base_command, "notice") == 0)
{
if (completion->base_command_arg != 1)
@@ -462,6 +539,8 @@ completion_find_context (t_completion *completion, void *channel, char *buffer,
command_arg++;
i++;
while ((i < pos) && (buffer[i] == ' ')) i++;
if (!completion->args)
completion->args = strdup (buffer + i);
}
else
i++;
+1
View File
@@ -39,6 +39,7 @@ struct t_completion
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
char *args; /* command line args (including base word) */
/* for command argument completion */
t_weelist *completion_list; /* data list for completion */
+39 -8
View File
@@ -48,11 +48,17 @@
#include <time.h>
#include <signal.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
#include "weechat.h"
#include "weeconfig.h"
@@ -68,9 +74,13 @@ int sigsegv = 0; /* SIGSEGV received?
char *weechat_home = NULL; /* WeeChat home dir. (example: /home/toto/.weechat) */
FILE *weechat_log_file = NULL; /* WeeChat log file (~/.weechat/weechat.log) */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1 */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1 */
int server_cmd_line; /* at least one server on WeeChat command line */
int server_cmd_line; /* at least one server on WeeChat command line */
#ifdef HAVE_GNUTLS
gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
#endif
/*
@@ -115,8 +125,10 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
#ifdef HAVE_ICONV
iconv_t cd;
char *inbuf, *ptr_inbuf, *ptr_outbuf;
int inbytesleft, outbytesleft;
char *inbuf;
ICONV_CONST char *ptr_inbuf;
char *ptr_outbuf;
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (strcasecmp(from_code, to_code) != 0))
@@ -352,7 +364,7 @@ wee_parse_args (int argc, char *argv[])
wee_display_commands (1, 0);
wee_shutdown (EXIT_SUCCESS);
}
else if ((strncasecmp (argv[i], "irc://", 6) == 0))
else if ((strncasecmp (argv[i], "irc", 3) == 0))
{
if (server_init_with_url (argv[i], &server_tmp) < 0)
{
@@ -365,9 +377,10 @@ wee_parse_args (int argc, char *argv[])
server_tmp.autoreconnect,
server_tmp.autoreconnect_delay,
1, server_tmp.address, server_tmp.port,
server_tmp.ipv6, server_tmp.ssl,
server_tmp.password, server_tmp.nick1,
server_tmp.nick2, server_tmp.nick3,
NULL, NULL, NULL, 0, server_tmp.autojoin, 1))
NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL))
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
WEECHAT_WARNING, argv[i]);
server_destroy (&server_tmp);
@@ -512,6 +525,13 @@ wee_init_vars ()
/* init received messages queue */
recv_msgq = NULL;
msgq_last_msg = NULL;
/* init gnutls */
#ifdef HAVE_GNUTLS
gnutls_global_init ();
gnutls_certificate_allocate_credentials (&gnutls_xcred);
gnutls_certificate_set_x509_trust_file (gnutls_xcred, "ca.pem", GNUTLS_X509_FMT_PEM);
#endif
}
/*
@@ -573,6 +593,9 @@ weechat_welcome_message ()
cfg_look_startup_version)
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX1,
"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
wee_log_printf ("%s (%s %s %s)\n",
PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
}
/*
@@ -602,6 +625,12 @@ wee_shutdown (int return_code)
if (local_charset)
free (local_charset);
alias_free_all ();
#ifdef HAVE_GNUTLS
gnutls_certificate_free_credentials (gnutls_xcred);
gnutls_global_deinit();
#endif
exit (return_code);
}
@@ -625,7 +654,7 @@ wee_dump (int crash)
if (crash)
{
sigsegv = 1;
wee_log_printf ("very bad, WeeChat is crashing (SIGSEGV received)...\n");
wee_log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)...\n");
}
wee_log_printf ("\n");
@@ -734,7 +763,9 @@ main (int argc, char *argv[])
textdomain (PACKAGE);
#endif
#ifdef HAVE_LANGINFO_CODESET
local_charset = strdup (nl_langinfo (CODESET));
#endif
signal (SIGINT, my_sigint); /* ignore SIGINT signal */
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */
@@ -761,8 +792,8 @@ main (int argc, char *argv[])
}
gui_init (); /* init WeeChat interface */
plugin_init (); /* init plugin interface(s) */
weechat_welcome_message (); /* display WeeChat welcome message */
plugin_init (); /* init plugin interface(s) */
/* auto-connect to servers */
server_auto_connect (server_cmd_line);
fifo_create (); /* create FIFO pipe for remote control */
+14 -2
View File
@@ -28,9 +28,17 @@
#include <stdio.h>
#include <sys/time.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#if defined(ENABLE_NLS) && !defined(_)
#include <locale.h>
#include <libintl.h>
#ifdef HAVE_LIBINTL_H
#include <libintl.h>
#else
#include "../../intl/libintl.h"
#endif
#define _(x) gettext(x)
#ifdef gettext_noop
#define N_(string) gettext_noop (string)
@@ -78,7 +86,7 @@
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
"Usage: %s [options ...]\n" \
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
" or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]\n\n"
#define WEE_USAGE2 \
" -c, --config display config file options\n" \
@@ -104,6 +112,10 @@ extern int quit_weechat;
extern char *weechat_home;
extern char *local_charset;
#ifdef HAVE_GNUTLS
extern gnutls_certificate_credentials gnutls_xcred;
#endif
extern void wee_log_printf (char *, ...);
extern void wee_dump (int);
extern char *weechat_convert_encoding (char *, char *, char *);
+149 -18
View File
@@ -66,6 +66,7 @@ char *cfg_look_weechat_slogan;
char *cfg_look_charset_decode;
char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks;
int cfg_look_color_actions;
int cfg_look_remove_colors_from_msgs;
@@ -112,6 +113,10 @@ t_config_option weechat_options_look[] =
N_("internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"ISO-8859-1", NULL, NULL, &cfg_look_charset_internal, config_change_buffer_content },
{ "look_buffer_timestamp", N_("timestamp for buffers"),
N_("timestamp for buffers"),
OPTION_TYPE_STRING, 0, 0, 0,
"[%H:%M:%S]", NULL, NULL, &cfg_look_buffer_timestamp, config_change_buffer_content },
{ "look_color_nicks", N_("display nick names with different colors"),
N_("display nick names with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -210,6 +215,7 @@ int cfg_col_nick_chanadmin;
int cfg_col_nick_op;
int cfg_col_nick_halfop;
int cfg_col_nick_voice;
int cfg_col_nick_more;
int cfg_col_nick_sep;
int cfg_col_nick_self;
int cfg_col_nick_private;
@@ -370,6 +376,10 @@ t_config_option weechat_options_colors[] =
N_("color for voice symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_nick_voice, NULL, &config_change_color },
{ "col_nick_more", N_("color for '+' when scrolling nicks"),
N_("color for '+' when scrolling nicks"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_nick_more, NULL, &config_change_color },
{ "col_nick_sep", N_("color for nick separator"),
N_("color for nick separator"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -504,7 +514,7 @@ t_config_option weechat_options_irc[] =
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
{ "irc_default_msg_quit", N_("default quit message"),
N_("default quit message ('%v' will be replaced by WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -587,8 +597,13 @@ t_config_option weechat_options_dcc[] =
/* config, proxy section */
int cfg_proxy_use;
int cfg_proxy_type;
int cfg_proxy_ipv6;
char *cfg_proxy_type_values[] =
{ "http", "socks4", "socks5", NULL };
char *cfg_proxy_address;
int cfg_proxy_port;
char *cfg_proxy_username;
char *cfg_proxy_password;
t_config_option weechat_options_proxy[] =
@@ -596,14 +611,26 @@ t_config_option weechat_options_proxy[] =
N_("use a proxy server to connect to irc server"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_proxy_use, NULL, config_change_noop },
{ "proxy_type", N_("proxy type"),
N_("proxy type (http (default), socks4, socks5)"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"http", cfg_proxy_type_values, &cfg_proxy_type, NULL, config_change_noop },
{ "proxy_ipv6", N_("use ipv6 proxy"),
N_("connect to proxy in ipv6"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_proxy_ipv6, NULL, config_change_noop },
{ "proxy_address", N_("proxy address"),
N_("proxy server address (IP or hostname)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_address, config_change_noop },
{ "proxy_port", N_("port for proxy"),
N_("port for connecting to proxy server"),
OPTION_TYPE_INT, 0, 65535, 1080,
OPTION_TYPE_INT, 0, 65535, 3128,
NULL, NULL, &cfg_proxy_port, NULL, config_change_noop },
{ "proxy_username", N_("proxy username"),
N_("username for proxy server"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_username, config_change_noop },
{ "proxy_password", N_("proxy password"),
N_("password for proxy server"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -640,6 +667,14 @@ t_config_option weechat_options_server[] =
N_("port for connecting to server"),
OPTION_TYPE_INT, 0, 65535, 6667,
NULL, NULL, &(cfg_server.port), NULL, NULL },
{ "server_ipv6", N_("use IPv6 protocol for server communication"),
N_("use IPv6 protocol for server communication"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &(cfg_server.ipv6), NULL, NULL },
{ "server_ssl", N_("use SSL for server communication"),
N_("use SSL for server communication"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &(cfg_server.ssl), NULL, NULL },
{ "server_password", N_("server password"),
N_("password for IRC server"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -680,6 +715,10 @@ t_config_option weechat_options_server[] =
N_("automatically rejoin channels when kicked"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &(cfg_server.autorejoin), NULL, NULL },
{ "server_notify_levels", N_("notify levels for channels of this server"),
N_("comma separated list of notify levels for channels of this server (format: #channel:1,..)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.notify_levels), config_change_notify_levels },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -824,6 +863,23 @@ config_change_fifo_pipe ()
}
}
/*
* config_change_notify_levels: called when notify levels is changed for a server
*/
void
config_change_notify_levels ()
{
t_gui_buffer *ptr_buffer;
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (BUFFER_IS_CHANNEL(ptr_buffer) || BUFFER_IS_PRIVATE(ptr_buffer))
ptr_buffer->notify_level =
channel_get_notify_level (SERVER(ptr_buffer), CHANNEL(ptr_buffer));
}
}
/*
* config_option_set_value: set new value for an option
* return: 0 if success
@@ -889,6 +945,10 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
return (void *)(&server->address);
if (strcasecmp (option_name, "server_port") == 0)
return (void *)(&server->port);
if (strcasecmp (option_name, "server_ipv6") == 0)
return (void *)(&server->ipv6);
if (strcasecmp (option_name, "server_ssl") == 0)
return (void *)(&server->ssl);
if (strcasecmp (option_name, "server_password") == 0)
return (void *)(&server->password);
if (strcasecmp (option_name, "server_nick1") == 0)
@@ -909,6 +969,8 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
return (void *)(&server->autojoin);
if (strcasecmp (option_name, "server_autorejoin") == 0)
return (void *)(&server->autorejoin);
if (strcasecmp (option_name, "server_notify_levels") == 0)
return (void *)(&server->notify_levels);
/* option not found */
return NULL;
}
@@ -978,6 +1040,8 @@ config_set_server_value (t_irc_server *server, char *option_name,
*((char **)ptr_data) = strdup (value);
break;
}
if (ptr_option->handler_change != NULL)
(void) (ptr_option->handler_change());
return 0;
}
@@ -1007,6 +1071,72 @@ config_option_search (char *option_name)
return NULL;
}
/*
* config_option_search_option_value: look for type and value of an option
* (including server options)
* if option is not found, NULL is returned
*/
void
config_option_search_option_value (char *option_name, t_config_option **option,
void **option_value)
{
t_config_option *ptr_option;
t_irc_server *ptr_server;
int i;
void *ptr_value;
char *pos;
ptr_option = NULL;
ptr_value = NULL;
ptr_option = config_option_search (option_name);
if (!ptr_option)
{
pos = strchr (option_name, '.');
if (pos)
{
pos[0] = '\0';
ptr_server = server_search (option_name);
if (ptr_server)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
if (strcmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name,
pos + 1) == 0)
{
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
ptr_value = config_get_server_option_ptr (ptr_server, pos + 1);
break;
}
}
}
pos[0] = '.';
}
}
else
{
switch (ptr_option->option_type)
{
case OPTION_TYPE_BOOLEAN:
case OPTION_TYPE_INT:
case OPTION_TYPE_INT_WITH_STRING:
case OPTION_TYPE_COLOR:
ptr_value = (void *)(ptr_option->ptr_int);
break;
case OPTION_TYPE_STRING:
ptr_value = (void *)(ptr_option->ptr_string);
break;
}
}
if (ptr_option)
{
*option = ptr_option;
*option_value = ptr_value;
}
}
/*
* config_set_value: set new value for an option (found by name)
* return: 0 if success
@@ -1058,12 +1188,13 @@ config_allocate_server (char *filename, int line_number)
return 0;
}
if (!server_new (cfg_server.name,
cfg_server.autoconnect, cfg_server.autoreconnect,
cfg_server.autoreconnect_delay, 0, cfg_server.address, cfg_server.port,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin))
cfg_server.autoconnect, cfg_server.autoreconnect,
cfg_server.autoreconnect_delay, 0, cfg_server.address,
cfg_server.port, cfg_server.ipv6, cfg_server.ssl,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin, cfg_server.notify_levels))
{
server_free_all ();
gui_printf (NULL,
@@ -1379,7 +1510,7 @@ config_create_default ()
}
printf (_("%s: creating default config file...\n"), PACKAGE_NAME);
wee_log_printf (_("creating default config file\n"));
wee_log_printf (_("Creating default config file\n"));
current_time = time (NULL);
fprintf (file, _("#\n# %s configuration file, created by "
@@ -1392,10 +1523,6 @@ config_create_default ()
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
{
switch (weechat_options[i][j].option_type)
@@ -1461,6 +1588,8 @@ config_create_default ()
fprintf (file, "server_autoreconnect_delay=30\n");
fprintf (file, "server_address=irc.freenode.net\n");
fprintf (file, "server_port=6667\n");
fprintf (file, "server_ipv6=off\n");
fprintf (file, "server_ssl=off\n");
fprintf (file, "server_password=\n");
/* Get the user's name from /etc/passwd */
@@ -1551,7 +1680,7 @@ config_write (char *config_name)
return -1;
}
wee_log_printf (_("saving config to disk\n"));
wee_log_printf (_("Saving config to disk\n"));
current_time = time (NULL);
fprintf (file, _("#\n# %s configuration file, created by "
@@ -1564,10 +1693,6 @@ config_write (char *config_name)
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
{
switch (weechat_options[i][j].option_type)
@@ -1637,6 +1762,10 @@ config_write (char *config_name)
ptr_server->autoreconnect_delay);
fprintf (file, "server_address=%s\n", ptr_server->address);
fprintf (file, "server_port=%d\n", ptr_server->port);
fprintf (file, "server_ipv6=%s\n",
(ptr_server->ipv6) ? "on" : "off");
fprintf (file, "server_ssl=%s\n",
(ptr_server->ssl) ? "on" : "off");
fprintf (file, "server_password=%s\n",
(ptr_server->password) ? ptr_server->password : "");
fprintf (file, "server_nick1=%s\n", ptr_server->nick1);
@@ -1651,6 +1780,8 @@ config_write (char *config_name)
(ptr_server->autojoin) ? ptr_server->autojoin : "");
fprintf (file, "server_autorejoin=%s\n",
(ptr_server->autorejoin) ? "on" : "off");
fprintf (file, "server_notify_levels=%s\n",
(ptr_server->notify_levels) ? ptr_server->notify_levels : "");
}
}
+8
View File
@@ -83,6 +83,7 @@ extern char *cfg_look_weechat_slogan;
extern char *cfg_look_charset_decode;
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_actions;
extern int cfg_look_remove_colors_from_msgs;
@@ -132,6 +133,7 @@ extern int cfg_col_nick_chanadmin;
extern int cfg_col_nick_op;
extern int cfg_col_nick_halfop;
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_private;
@@ -176,8 +178,12 @@ extern int cfg_dcc_auto_rename;
extern int cfg_dcc_auto_resume;
extern int cfg_proxy_use;
extern int cfg_proxy_type;
extern char *cfg_proxy_type_values[];
extern int cfg_proxy_ipv6;
extern char *cfg_proxy_address;
extern int cfg_proxy_port;
extern char *cfg_proxy_username;
extern char *cfg_proxy_password;
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
@@ -191,8 +197,10 @@ extern void config_change_buffer_content ();
extern void config_change_color ();
extern void config_change_away_check ();
extern void config_change_fifo_pipe ();
extern void config_change_notify_levels ();
extern int config_option_set_value (t_config_option *, char *);
extern t_config_option *config_option_search (char *);
extern void config_option_search_option_value (char *, t_config_option **, void **);
extern int config_set_value (char *, char *);
extern void *config_get_server_option_ptr (t_irc_server *, char *);
extern int config_set_server_value (t_irc_server *, char *, char *);
+12 -1
View File
@@ -15,10 +15,21 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
noinst_LIBRARIES = lib_weechat_gui_common.a
lib_weechat_gui_common_a_SOURCES = gui-common.c \
gui.h
if GUI_NCURSES
curses_dir=curses
endif
if GUI_WXWIDGETS
wxwidgets_dir=wxwidgets
endif
if GUI_GTK
gtk_dir=gtk
endif
@@ -27,4 +38,4 @@ if GUI_QT
qt_dir=qt
endif
SUBDIRS = $(curses_dir) $(gtk_dir) $(qt_dir)
SUBDIRS = . $(curses_dir) $(wxwidgets_dir) $(gtk_dir) $(qt_dir)
+5 -5
View File
@@ -19,12 +19,12 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
bin_PROGRAMS = weechat-curses
weechat_curses_LDADD = ../../common/lib_weechat_main.a \
weechat_curses_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(NCURSES_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS) \
$(GNUTLS_LIBS)
weechat_curses_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
weechat_curses_SOURCES = gui-display.c \
gui-input.c
+313 -126
View File
@@ -30,6 +30,7 @@
#include <string.h>
#include <signal.h>
#include <time.h>
#include <ctype.h>
#include <ncurses.h>
#include "../../common/weechat.h"
@@ -65,6 +66,7 @@ char *nicks_colors[COLOR_WIN_NICK_NUMBER] =
int color_attr[NUM_COLORS];
/*
* gui_assign_color: assign a color (read from config)
*/
@@ -141,7 +143,7 @@ gui_get_color_by_value (int color_value)
void
gui_window_set_color (WINDOW *window, int num_color)
{
if (has_colors)
if (has_colors ())
{
if (color_attr[num_color - 1] & A_BOLD)
wattron (window, COLOR_PAIR (num_color) | A_BOLD);
@@ -763,6 +765,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
wprintw (ptr_win->win_chat, ">");
for (j = 0; j < 10 - num_bars; j++)
wprintw (ptr_win->win_chat, " ");
if (ptr_dcc->size < 1024*10)
num_unit = 0;
else if (ptr_dcc->size < 1024*1024)
@@ -777,20 +780,31 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
unit_format[num_unit],
unit_format[num_unit]);
wprintw (ptr_win->win_chat, format,
((long double) ptr_dcc->pos) / ((long double)(unit_divide[num_unit])),
((long double)(ptr_dcc->pos)) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit],
((long double) ptr_dcc->size) / ((long double)(unit_divide[num_unit])),
((long double)(ptr_dcc->size)) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
if (ptr_dcc->bytes_per_sec < 1024*1024)
num_unit = 1;
else if (ptr_dcc->bytes_per_sec < 1024*1024*1024)
num_unit = 2;
else
num_unit = 3;
sprintf (format, " (%s %%s/s)", unit_format[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]);
wclrtoeol (ptr_win->win_chat);
}
else
{
date_tmp = localtime (&(ptr_dcc->start_time));
strftime (date, sizeof (date) - 1, "%a, %d %b %Y %H:%M:%S", date_tmp);
wprintw (ptr_win->win_chat, " %s", date);
wclrtoeol (ptr_win->win_chat);
}
wclrtoeol (ptr_win->win_chat);
ptr_win->dcc_last_displayed = ptr_dcc;
i += 2;
}
@@ -860,7 +874,7 @@ void
gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
int i, x, y, column, max_length;
int i, j, x, y, column, max_length, nicks_displayed;
char format[32], format_empty[32];
t_irc_nick *ptr_nick;
@@ -943,71 +957,103 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
x = 0;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0;
column = 0;
for (ptr_nick = CHANNEL(buffer)->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_height - 1);
else
nicks_displayed = ptr_win->win_nick_height;
ptr_nick = CHANNEL(buffer)->nicks;
for (i = 0; i < ptr_win->win_nick_start; i++)
{
switch (cfg_look_nicklist_position)
if (!ptr_nick)
break;
ptr_nick = ptr_nick->next_nick;
}
if (ptr_nick)
{
for (i = 0; i < nicks_displayed; i++)
{
case CFG_LOOK_NICKLIST_LEFT:
x = 0;
break;
case CFG_LOOK_NICKLIST_RIGHT:
x = 1;
break;
case CFG_LOOK_NICKLIST_TOP:
case CFG_LOOK_NICKLIST_BOTTOM:
x = column;
break;
}
if (ptr_nick->is_chanowner)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANOWNER);
mvwprintw (ptr_win->win_nick, y, x, "~");
x++;
}
else if (ptr_nick->is_chanadmin)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANADMIN);
mvwprintw (ptr_win->win_nick, y, x, "&");
x++;
}
else if (ptr_nick->is_op)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_OP);
mvwprintw (ptr_win->win_nick, y, x, "@");
x++;
}
else if (ptr_nick->is_halfop)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_HALFOP);
mvwprintw (ptr_win->win_nick, y, x, "%%");
x++;
}
else if (ptr_nick->has_voice)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_VOICE);
mvwprintw (ptr_win->win_nick, y, x, "+");
x++;
}
else
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, " ");
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
y++;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
{
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
switch (cfg_look_nicklist_position)
{
column += max_length + 2;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
0 : 1;
case CFG_LOOK_NICKLIST_LEFT:
x = 0;
break;
case CFG_LOOK_NICKLIST_RIGHT:
x = 1;
break;
case CFG_LOOK_NICKLIST_TOP:
case CFG_LOOK_NICKLIST_BOTTOM:
x = column;
break;
}
if ( ((i == 0) && (ptr_win->win_nick_start > 0))
|| ((i == nicks_displayed - 1) && (ptr_nick->next_nick)) )
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_MORE);
j = (max_length + 1) >= 4 ? 4 : max_length + 1;
for (x = 1; x <= j; x++)
mvwprintw (ptr_win->win_nick, y, x, "+");
}
else
{
if (ptr_nick->is_chanowner)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANOWNER);
mvwprintw (ptr_win->win_nick, y, x, "~");
x++;
}
else if (ptr_nick->is_chanadmin)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANADMIN);
mvwprintw (ptr_win->win_nick, y, x, "&");
x++;
}
else if (ptr_nick->is_op)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_OP);
mvwprintw (ptr_win->win_nick, y, x, "@");
x++;
}
else if (ptr_nick->is_halfop)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_HALFOP);
mvwprintw (ptr_win->win_nick, y, x, "%%");
x++;
}
else if (ptr_nick->has_voice)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_VOICE);
mvwprintw (ptr_win->win_nick, y, x, "+");
x++;
}
else
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, " ");
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
ptr_nick = ptr_nick->next_nick;
if (!ptr_nick)
break;
}
y++;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
{
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
{
column += max_length + 2;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
0 : 1;
}
}
}
}
@@ -1269,7 +1315,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
x = ptr_win->win_width - strlen (str_nicks) - 4;
}
else
x = ptr_win->win_width;
x = ptr_win->win_width - 2;
string = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
@@ -1282,7 +1328,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
mvwprintw (ptr_win->win_status, 0, x, "%s", string);
else
{
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", strlen (string));
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", (int)(strlen (string)));
mvwprintw (ptr_win->win_status, 0, x, format_more, " ");
}
if (gui_buffer_has_nicklist (ptr_win->buffer))
@@ -1313,7 +1359,7 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;
char text[1024 + 1];
char text_time[1024 + 1];
/* make gcc happy */
(void) buffer;
@@ -1338,9 +1384,9 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
local_time = localtime (&time_seconds);
if (local_time)
{
strftime (text, 1024, cfg_look_infobar_timestamp, local_time);
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
wprintw (ptr_win->win_infobar, "%s", text);
wprintw (ptr_win->win_infobar, "%s", text_time);
}
if (gui_infobar)
{
@@ -1552,6 +1598,7 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
gui_current_window->buffer->num_displayed--;
window->buffer = buffer;
window->win_nick_start = 0;
gui_calculate_pos_size (window);
/* destroy Curses windows */
@@ -1800,6 +1847,100 @@ gui_move_page_down (t_gui_window *window)
}
}
/*
* gui_nick_move_beginning: go to beginning of nicklist
*/
void
gui_nick_move_beginning (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if (window->win_nick_start > 0)
{
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_end: go to the end of nicklist
*/
void
gui_nick_move_end (t_gui_window *window)
{
int new_start;
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
new_start = 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 != window->win_nick_start)
{
window->win_nick_start = new_start;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_page_up: scroll one page up in nicklist
*/
void
gui_nick_move_page_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if (window->win_nick_start > 0)
{
window->win_nick_start -= (window->win_nick_height - 1);
if (window->win_nick_start <= 1)
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_page_down: scroll one page down in nicklist
*/
void
gui_nick_move_page_down (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if ((CHANNEL(window->buffer)->nicks_count > window->win_nick_height)
&& (window->win_nick_start + window->win_nick_height - 1 < CHANNEL(window->buffer)->nicks_count))
{
if (window->win_nick_start == 0)
window->win_nick_start += (window->win_nick_height - 1);
else
window->win_nick_start += (window->win_nick_height - 2);
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_window_init_subviews: init subviews for a WeeChat window
*/
@@ -2130,91 +2271,93 @@ gui_init_colors ()
use_default_colors ();
init_pair (COLOR_WIN_TITLE,
cfg_col_title & A_CHARTEXT, cfg_col_title_bg);
cfg_col_title, cfg_col_title_bg);
init_pair (COLOR_WIN_CHAT,
cfg_col_chat & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_TIME,
cfg_col_chat_time & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_time, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_TIME_SEP,
cfg_col_chat_time_sep & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_time_sep, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX1,
cfg_col_chat_prefix1 & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_prefix1, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX2,
cfg_col_chat_prefix2 & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_prefix2, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_NICK,
cfg_col_chat_nick & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_nick, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HOST,
cfg_col_chat_host & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_host, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_CHANNEL,
cfg_col_chat_channel & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_channel, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_DARK,
cfg_col_chat_dark & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_dark, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HIGHLIGHT,
cfg_col_chat_highlight & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_highlight, cfg_col_chat_bg);
init_pair (COLOR_WIN_STATUS,
cfg_col_status & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DELIMITERS,
cfg_col_status_delimiters & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_delimiters, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_MSG,
cfg_col_status_data_msg & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_msg, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_HIGHLIGHT,
cfg_col_status_data_highlight & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_highlight, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_OTHER,
cfg_col_status_data_other & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_other, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_MORE,
cfg_col_status_more & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_more, cfg_col_status_bg);
init_pair (COLOR_WIN_INFOBAR,
cfg_col_infobar & A_CHARTEXT, cfg_col_infobar_bg);
cfg_col_infobar, cfg_col_infobar_bg);
init_pair (COLOR_WIN_INFOBAR_HIGHLIGHT,
cfg_col_infobar_highlight & A_CHARTEXT, cfg_col_infobar_bg);
cfg_col_infobar_highlight, cfg_col_infobar_bg);
init_pair (COLOR_WIN_INPUT,
cfg_col_input & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input, cfg_col_input_bg);
init_pair (COLOR_WIN_INPUT_CHANNEL,
cfg_col_input_channel & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input_channel, cfg_col_input_bg);
init_pair (COLOR_WIN_INPUT_NICK,
cfg_col_input_nick & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input_nick, cfg_col_input_bg);
init_pair (COLOR_WIN_NICK,
cfg_col_nick & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_AWAY,
cfg_col_nick_away & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_away, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_CHANOWNER,
cfg_col_nick_chanowner & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_chanowner, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_CHANADMIN,
cfg_col_nick_chanadmin & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_chanadmin, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_OP,
cfg_col_nick_op & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_op, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_HALFOP,
cfg_col_nick_halfop & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_halfop, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_VOICE,
cfg_col_nick_voice & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_voice, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_MORE,
cfg_col_nick_more, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SEP,
cfg_col_nick_sep & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_sep, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SELF,
cfg_col_nick_self & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_self, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_PRIVATE,
cfg_col_nick_private & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_private, cfg_col_nick_bg);
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
{
gui_assign_color (&color, nicks_colors[i]);
init_pair (COLOR_WIN_NICK_FIRST + i, color & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_WIN_NICK_FIRST + i, color, cfg_col_chat_bg);
color_attr[COLOR_WIN_NICK_FIRST + i - 1] = (color >= 0) ? color & A_BOLD : 0;
}
init_pair (COLOR_DCC_SELECTED,
cfg_col_dcc_selected & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_selected, cfg_col_chat_bg);
init_pair (COLOR_DCC_WAITING,
cfg_col_dcc_waiting & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_waiting, cfg_col_chat_bg);
init_pair (COLOR_DCC_CONNECTING,
cfg_col_dcc_connecting & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_connecting, cfg_col_chat_bg);
init_pair (COLOR_DCC_ACTIVE,
cfg_col_dcc_active & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_active, cfg_col_chat_bg);
init_pair (COLOR_DCC_DONE,
cfg_col_dcc_done & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_done, cfg_col_chat_bg);
init_pair (COLOR_DCC_FAILED,
cfg_col_dcc_failed & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_failed, cfg_col_chat_bg);
init_pair (COLOR_DCC_ABORTED,
cfg_col_dcc_aborted & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_aborted, cfg_col_chat_bg);
color_attr[COLOR_WIN_TITLE - 1] = (cfg_col_title >= 0) ? cfg_col_title & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT - 1] = (cfg_col_chat >= 0) ? cfg_col_chat & A_BOLD : 0;
@@ -2246,6 +2389,7 @@ gui_init_colors ()
color_attr[COLOR_WIN_NICK_OP - 1] = (cfg_col_nick_op >= 0) ? cfg_col_nick_op & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_HALFOP - 1] = (cfg_col_nick_halfop >= 0) ? cfg_col_nick_halfop & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_VOICE - 1] = (cfg_col_nick_voice >= 0) ? cfg_col_nick_voice & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_MORE - 1] = (cfg_col_nick_more >= 0) ? cfg_col_nick_more & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_SEP - 1] = 0;
color_attr[COLOR_WIN_NICK_SELF - 1] = (cfg_col_nick_self >= 0) ? cfg_col_nick_self & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_PRIVATE - 1] = (cfg_col_nick_private >= 0) ? cfg_col_nick_private & A_BOLD : 0;
@@ -2398,7 +2542,7 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
pos[0] = '\n';
if (buffer->num_displayed > 0)
gui_draw_buffer_chat (buffer, 0);
if (buffer->num_displayed == 0)
if (gui_add_hotlist && (buffer->num_displayed == 0))
{
if (3 - buffer->last_line->line_with_message -
buffer->last_line->line_with_highlight <=
@@ -2423,7 +2567,11 @@ void
gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message, ...)
{
static char buf[8192];
char timestamp[16];
char text_time[1024 + 1];
char text_time_char[2];
time_t time_seconds;
struct tm *local_time;
int time_first_digit, time_last_digit;
char *pos, *buf2, *buf3;
int i, j;
va_list argptr;
@@ -2452,6 +2600,12 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
wee_log_printf ("gui_printf without buffer! this is a bug, please send to developers - thanks\n");
return;
}
if (buffer->dcc)
buffer = gui_buffers;
if (buffer->dcc)
return;
}
va_start (argptr, message);
@@ -2502,19 +2656,52 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
pos = buf3 - 1;
while (pos)
{
/* TODO: read timestamp format from config! */
if ((!buffer->last_line) || (buffer->line_complete))
{
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "[");
snprintf (timestamp, 16, "%02d", date_tmp->tm_hour);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
snprintf (timestamp, 16, "%02d", date_tmp->tm_min);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
snprintf (timestamp, 16, "%02d", date_tmp->tm_sec);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "] ");
time_seconds = time (NULL);
local_time = localtime (&time_seconds);
strftime (text_time, 1024, cfg_look_buffer_timestamp, local_time);
time_first_digit = -1;
time_last_digit = -1;
i = 0;
while (text_time[i])
{
if (isdigit (text_time[i]))
{
if (time_first_digit == -1)
time_first_digit = i;
time_last_digit = i;
}
i++;
}
text_time_char[1] = '\0';
i = 0;
while (text_time[i])
{
text_time_char[0] = text_time[i];
if (time_first_digit < 0)
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
text_time_char);
else
{
if ((i < time_first_digit) || (i > time_last_digit))
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK,
text_time_char);
else
{
if (isdigit (text_time[i]))
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
text_time_char);
else
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP,
text_time_char);
}
}
i++;
}
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, " ");
}
gui_add_message (buffer, type, color, pos + 1);
pos = strchr (pos + 1, '\n');
+65 -39
View File
@@ -53,7 +53,7 @@ gui_read_keyb ()
int key, i;
t_gui_buffer *ptr_buffer;
t_irc_server *ptr_server;
t_irc_dcc *ptr_dcc;
t_irc_dcc *ptr_dcc, *ptr_dcc_next;
char new_char[3], *decoded_string;
t_irc_dcc *dcc_selected;
@@ -72,8 +72,6 @@ gui_read_keyb ()
case KEY_F(3):
case KEY_F(4):
case KEY_F(9):
case KEY_F(11):
case KEY_F(12):
break;
/* previous buffer in window */
case KEY_F(5):
@@ -96,6 +94,12 @@ gui_read_keyb ()
gui_infobar_remove ();
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
break;
case KEY_F(11):
gui_nick_move_page_up (gui_current_window);
break;
case KEY_F(12):
gui_nick_move_page_down (gui_current_window);
break;
/* cursor up */
case KEY_UP:
if (gui_current_window->buffer->dcc)
@@ -416,25 +420,38 @@ gui_read_keyb ()
case KEY_RIGHT:
gui_switch_to_next_buffer (gui_current_window);
break;
/* Alt + home */
case KEY_HOME:
gui_nick_move_beginning (gui_current_window);
break;
/* Alt + end */
case KEY_END:
gui_nick_move_end (gui_current_window);
break;
/* Alt + page up */
case KEY_PPAGE:
gui_nick_move_page_up (gui_current_window);
break;
/* Alt + page down */
case KEY_NPAGE:
gui_nick_move_page_down (gui_current_window);
break;
case 79:
/* TODO: replace 79 by constant name! */
if (key == 79)
if ((key = getch()) != ERR)
{
if ((key = getch()) != ERR)
switch (key)
{
switch (key)
{
/* Control + Right */
case 99:
if (!gui_current_window->buffer->dcc)
gui_move_next_word (gui_current_window->buffer);
break;
/* Control + Left */
case 100:
if (!gui_current_window->buffer->dcc)
gui_move_previous_word (gui_current_window->buffer);
break;
}
/* Control + Right */
case 99:
if (!gui_current_window->buffer->dcc)
gui_move_next_word (gui_current_window->buffer);
break;
/* Control + Left */
case 100:
if (!gui_current_window->buffer->dcc)
gui_move_previous_word (gui_current_window->buffer);
break;
}
}
break;
@@ -502,33 +519,39 @@ gui_read_keyb ()
/* Alt-S: jump to server buffer */
case 's':
case 'S':
if (SERVER(gui_current_window->buffer)->buffer !=
gui_current_window->buffer)
if (!gui_current_window->buffer->dcc)
{
gui_switch_to_buffer (gui_current_window,
SERVER(gui_current_window->buffer)->buffer);
gui_redraw_buffer (gui_current_window->buffer);
if (SERVER(gui_current_window->buffer)->buffer !=
gui_current_window->buffer)
{
gui_switch_to_buffer (gui_current_window,
SERVER(gui_current_window->buffer)->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
break;
/* Alt-X: jump to first channel/private of next server */
case 'x':
case 'X':
ptr_server = SERVER(gui_current_window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
while (ptr_server != SERVER(gui_current_window->buffer))
if (!gui_current_window->buffer->dcc)
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
if (ptr_server != SERVER(gui_current_window->buffer))
{
ptr_buffer = (ptr_server->channels) ?
ptr_server->channels->buffer : ptr_server->buffer;
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (gui_current_window->buffer);
ptr_server = SERVER(gui_current_window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
while (ptr_server != SERVER(gui_current_window->buffer))
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
if (ptr_server != SERVER(gui_current_window->buffer))
{
ptr_buffer = (ptr_server->channels) ?
ptr_server->channels->buffer : ptr_server->buffer;
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
break;
}
@@ -591,10 +614,13 @@ gui_read_keyb ()
case 'p':
case 'P':
gui_current_window->dcc_selected = NULL;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
ptr_dcc = dcc_list;
while (ptr_dcc)
{
ptr_dcc_next = ptr_dcc->next_dcc;
if (DCC_ENDED(ptr_dcc->status))
dcc_free (ptr_dcc);
ptr_dcc = ptr_dcc_next;
}
gui_redraw_buffer (gui_current_window->buffer);
break;
+3 -4
View File
@@ -19,12 +19,11 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GTK_CFLAGS)
bin_PROGRAMS = weechat-gtk
weechat_gtk_LDADD = ../../common/lib_weechat_main.a \
weechat_gtk_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(GTK_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_gtk_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
weechat_gtk_SOURCES = gui-display.c \
gui-input.c
+10 -7
View File
@@ -43,6 +43,8 @@
int gui_init_ok = 0; /* = 1 if GUI is initialized */
int gui_ok = 0; /* = 1 if GUI is ok */
/* (0 when term size too small) */
int gui_add_hotlist = 1; /* 0 is for temporarly disable */
/* hotlist add for all buffers */
t_gui_window *gui_windows = NULL; /* pointer to first window */
t_gui_window *last_gui_window = NULL; /* pointer to last window */
@@ -64,7 +66,7 @@ gui_window_new (int x, int y, int width, int height)
t_gui_window *new_window;
#ifdef DEBUG
wee_log_printf ("creating new window (x:%d, y:%d, width:%d, height:%d)\n",
wee_log_printf ("Creating new window (x:%d, y:%d, width:%d, height:%d)\n",
x, y, width, height);
#endif
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
@@ -85,6 +87,7 @@ gui_window_new (int x, int y, int width, int height)
new_window->win_nick_y = 0;
new_window->win_nick_width = 0;
new_window->win_nick_height = 0;
new_window->win_nick_start = 0;
new_window->win_title = NULL;
new_window->win_chat = NULL;
@@ -135,7 +138,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
t_gui_buffer *new_buffer;
#ifdef DEBUG
wee_log_printf ("creating new buffer\n");
wee_log_printf ("Creating new buffer\n");
#endif
/* use first buffer if no server was assigned to this buffer */
@@ -183,7 +186,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
new_buffer->line_complete = 1;
/* notify level */
new_buffer->notify_level = 3;
new_buffer->notify_level = channel_get_notify_level (server, channel);
/* create/append to log file */
new_buffer->log_filename = NULL;
@@ -324,8 +327,7 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
else
wee_log_printf (_("%s not enough memory for infobar message\n"),
WEECHAT_ERROR);
wee_log_printf (_("Not enough memory for infobar message\n"));
free (buf2);
}
@@ -500,7 +502,7 @@ gui_new_line (t_gui_buffer *buffer)
}
else
{
wee_log_printf (_("%s not enough memory for new line!\n"));
wee_log_printf (_("Not enough memory for new line\n"));
return NULL;
}
@@ -543,7 +545,7 @@ gui_new_message (t_gui_buffer *buffer)
}
else
{
wee_log_printf (_("not enough memory!\n"));
wee_log_printf (_("Not enough memory for new message\n"));
return NULL;
}
return new_message;
@@ -840,6 +842,7 @@ gui_window_print_log (t_gui_window *window)
wee_log_printf (" win_nick_y. . . . . : %d\n", window->win_nick_y);
wee_log_printf (" win_nick_width. . . : %d\n", window->win_nick_width);
wee_log_printf (" win_nick_height . . : %d\n", window->win_nick_height);
wee_log_printf (" win_nick_start. . . : %d\n", window->win_nick_start);
wee_log_printf (" win_title . . . . . : 0x%X\n", window->win_title);
wee_log_printf (" win_chat. . . . . . : 0x%X\n", window->win_chat);
wee_log_printf (" win_nick. . . . . . : 0x%X\n", window->win_nick);
+29 -18
View File
@@ -26,7 +26,7 @@
#define INPUT_BUFFER_BLOCK_SIZE 256
#define NUM_COLORS 49
#define NUM_COLORS 50
#define COLOR_WIN_TITLE 1
#define COLOR_WIN_CHAT 2
#define COLOR_WIN_CHAT_TIME 3
@@ -56,19 +56,20 @@
#define COLOR_WIN_NICK_OP 27
#define COLOR_WIN_NICK_HALFOP 28
#define COLOR_WIN_NICK_VOICE 29
#define COLOR_WIN_NICK_SEP 30
#define COLOR_WIN_NICK_SELF 31
#define COLOR_WIN_NICK_PRIVATE 32
#define COLOR_WIN_NICK_FIRST 33
#define COLOR_WIN_NICK_LAST 42
#define COLOR_WIN_NICK_MORE 30
#define COLOR_WIN_NICK_SEP 31
#define COLOR_WIN_NICK_SELF 32
#define COLOR_WIN_NICK_PRIVATE 33
#define COLOR_WIN_NICK_FIRST 34
#define COLOR_WIN_NICK_LAST 43
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
#define COLOR_DCC_SELECTED 43
#define COLOR_DCC_WAITING 44
#define COLOR_DCC_CONNECTING 45
#define COLOR_DCC_ACTIVE 46
#define COLOR_DCC_DONE 47
#define COLOR_DCC_FAILED 48
#define COLOR_DCC_ABORTED 49
#define COLOR_DCC_SELECTED 44
#define COLOR_DCC_WAITING 45
#define COLOR_DCC_CONNECTING 46
#define COLOR_DCC_ACTIVE 47
#define COLOR_DCC_DONE 48
#define COLOR_DCC_FAILED 49
#define COLOR_DCC_ABORTED 50
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
@@ -97,6 +98,10 @@
#define gui_printf_nolog(buffer, fmt, argz...) \
gui_printf_type_color(buffer, MSG_TYPE_INFO | MSG_TYPE_NOLOG, -1, fmt, ##argz)
#define NOTIFY_LEVEL_MIN 0
#define NOTIFY_LEVEL_MAX 3
#define NOTIFY_LEVEL_DEFAULT NOTIFY_LEVEL_MAX
typedef struct t_gui_message t_gui_message;
struct t_gui_message
@@ -209,9 +214,10 @@ struct t_gui_window
int win_chat_cursor_y; /* position of cursor in chat window */
/* nicklist window settings */
int win_nick_x, win_nick_y; /* chat window position */
int win_nick_width; /* width of chat window */
int win_nick_height; /* height of chat window */
int win_nick_x, win_nick_y; /* nick window position */
int win_nick_width; /* width of nick window */
int win_nick_height; /* height of nick window */
int win_nick_start; /* # of 1st nick for display (scroll) */
/* windows for Curses GUI */
void *win_title; /* title window */
@@ -250,6 +256,7 @@ struct t_gui_window
extern int gui_init_ok;
extern int gui_ok;
extern int gui_add_hotlist;
extern t_gui_window *gui_windows;
extern t_gui_window *last_gui_window;
extern t_gui_window *gui_current_window;
@@ -301,8 +308,12 @@ extern void gui_switch_to_previous_buffer (t_gui_window *);
extern void gui_switch_to_next_buffer (t_gui_window *);
extern void gui_switch_to_previous_window (t_gui_window *);
extern void gui_switch_to_next_window (t_gui_window *);
extern void gui_move_page_up ();
extern void gui_move_page_down ();
extern void gui_move_page_up (t_gui_window *);
extern void gui_move_page_down (t_gui_window *);
extern void gui_nick_move_beginning (t_gui_window *);
extern void gui_nick_move_end (t_gui_window *);
extern void gui_nick_move_page_up (t_gui_window *);
extern void gui_nick_move_page_down (t_gui_window *);
extern void gui_curses_resize_handler ();
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *);
+29
View File
@@ -0,0 +1,29 @@
# 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\"
bin_PROGRAMS = weechat-wxwidgets
weechat_wxwidgets_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(WXWIDGETS_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_wxwidgets_SOURCES = gui-display.c \
gui-input.c
+20
View File
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-display.c: display functions for wxWidgets GUI */
+20
View File
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* gui-input: user input functions for wxWidgets GUI */
+131
View File
@@ -30,6 +30,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../gui/gui.h"
char *channel_modes = "iklmnst";
@@ -262,6 +263,136 @@ channel_remove_dcc (t_irc_dcc *ptr_dcc)
}
}
/*
* channel_get_notify_level: get channel notify level
*/
int
channel_get_notify_level (t_irc_server *server, t_irc_channel *channel)
{
char *name, *pos, *pos2, notify;
if ((!server) || (!channel))
return NOTIFY_LEVEL_DEFAULT;
if ((!server->notify_levels) || (!server->notify_levels[0]))
return NOTIFY_LEVEL_DEFAULT;
name = (char *) malloc (strlen (channel->name) + 2);
strcpy (name, channel->name);
strcat (name, ":");
pos = strstr (server->notify_levels, name);
free (name);
if (!pos)
return NOTIFY_LEVEL_DEFAULT;
pos2 = pos + strlen (channel->name);
if (pos2[0] != ':')
return NOTIFY_LEVEL_DEFAULT;
pos2++;
if (!pos2[0])
return NOTIFY_LEVEL_DEFAULT;
notify = (int)(pos2[0] - '0');
if ((notify < NOTIFY_LEVEL_MIN) || (notify > NOTIFY_LEVEL_MAX))
return NOTIFY_LEVEL_DEFAULT;
else
return notify;
}
/*
* server_remove_notify_level: remove channel notify from list
*/
void
channel_remove_notify_level (t_irc_server *server, t_irc_channel *channel)
{
char *name, *pos, *pos2;
if ((!server) || (!channel))
return;
name = (char *) malloc (strlen (channel->name) + 2);
strcpy (name, channel->name);
strcat (name, ":");
pos = strstr (server->notify_levels, name);
free (name);
if (pos)
{
pos2 = pos + strlen (channel->name);
if (pos2[0] == ':')
{
pos2++;
if (pos2[0])
{
pos2++;
if (pos2[0] == ',')
pos2++;
if (!pos2[0] && (pos != server->notify_levels))
pos--;
strcpy (pos, pos2);
server->notify_levels = (char *) realloc (server->notify_levels,
strlen (server->notify_levels) + 1);
}
}
}
}
/*
* server_set_notify_level: set channel notify level
*/
void
channel_set_notify_level (t_irc_server *server, t_irc_channel *channel, int notify)
{
char *name, *pos, *pos2, level_string[2];
if ((!server) || (!channel))
return;
if (notify == NOTIFY_LEVEL_DEFAULT)
{
channel_remove_notify_level (server, channel);
return;
}
if (!server->notify_levels)
{
server->notify_levels = (char *) malloc (strlen (channel->name) + 3);
server->notify_levels[0] = '\0';
}
else
{
name = (char *) malloc (strlen (channel->name) + 2);
strcpy (name, channel->name);
strcat (name, ":");
pos = strstr (server->notify_levels, name);
free (name);
if (pos)
{
pos2 = pos + strlen (channel->name) + 1;
if (pos2[0])
{
pos2[0] = '0' + notify;
return;
}
}
/* realloc notify list to add channel */
server->notify_levels = (char *) realloc (server->notify_levels,
strlen (server->notify_levels) + 1 +
strlen (channel->name) + 2 + 1);
}
/* channel not in notify list => add it */
if (server->notify_levels[0])
strcat (server->notify_levels, ",");
strcat (server->notify_levels, channel->name);
strcat (server->notify_levels, ":");
level_string[0] = notify + '0';
level_string[1] = '\0';
strcat (server->notify_levels, level_string);
}
/*
* channel_print_log: print channel infos in log (usually for crash dump)
*/
+10 -3
View File
@@ -97,7 +97,7 @@ t_irc_command irc_commands[] =
{ "kill", N_("close client-server connection"),
N_("nickname comment"),
N_("nickname: nickname\ncomment: comment for kill"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, NULL },
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
{ "links", N_("list all servernames which are known by the server answering the query"),
N_("[[server] server_mask]"),
N_("server: this server should answer the query\n"
@@ -152,8 +152,10 @@ t_irc_command irc_commands[] =
N_("[channel[,channel]]"), N_("channel: channel name"),
0, 1, 1, NULL, irc_cmd_send_names, NULL },
{ "nick", N_("change current nickname"),
N_("nickname"), N_("nickname: new nickname for current IRC server"),
1, 1, 1, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
N_("[-all] nickname"),
N_("-all: set new nickname for all connected servers\n"
"nickname: new nickname"),
1, 2, 1, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
{ "notice", N_("send notice message to user"),
N_("nickname text"), N_("nickname: user to send notice to\ntext: text to send"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
@@ -298,6 +300,7 @@ t_irc_command irc_commands[] =
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "307", N_("whois (registered nick)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
@@ -320,6 +323,7 @@ t_irc_command irc_commands[] =
{ "333", N_("infos about topic (nick & date changed)"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "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"),
@@ -431,11 +435,14 @@ 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 },
{ "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"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "501", N_("unknown mode flag"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "502", N_("can't change mode for other users"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "671", N_("whois (secure connection)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
};
+45 -2
View File
@@ -63,6 +63,38 @@ dcc_redraw (int highlight)
}
}
/*
* dcc_calculate_speed: calculate DCC speed (for files only)
*/
void
dcc_calculate_speed (t_irc_dcc *ptr_dcc, int ended)
{
time_t local_time, elapsed;
local_time = time (NULL);
if (ended || local_time > ptr_dcc->last_check_time)
{
if (ended)
{
elapsed = local_time - ptr_dcc->start_transfer;
if (elapsed == 0)
elapsed = 1;
ptr_dcc->bytes_per_sec = ptr_dcc->pos / elapsed;
}
else
{
elapsed = local_time - ptr_dcc->last_check_time;
if (elapsed == 0)
elapsed = 1;
ptr_dcc->bytes_per_sec = (ptr_dcc->pos - ptr_dcc->last_check_pos) / elapsed;
}
ptr_dcc->last_check_time = local_time;
ptr_dcc->last_check_pos = ptr_dcc->pos;
}
}
/*
* dcc_connect: connect to another host
*/
@@ -200,6 +232,9 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
if (DCC_IS_CHAT(ptr_dcc->type))
channel_remove_dcc (ptr_dcc);
if (DCC_IS_FILE(ptr_dcc->type))
dcc_calculate_speed (ptr_dcc, 1);
if (ptr_dcc->sock != -1)
{
close (ptr_dcc->sock);
@@ -327,6 +362,7 @@ dcc_accept (t_irc_dcc *ptr_dcc)
ptr_dcc->file = open (ptr_dcc->local_filename,
O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK,
0644);
ptr_dcc->start_transfer = time (NULL);
}
else
{
@@ -363,6 +399,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
new_dcc->type = type;
new_dcc->status = DCC_WAITING;
new_dcc->start_time = time (NULL);
new_dcc->start_transfer = time (NULL);
new_dcc->addr = addr;
new_dcc->port = port;
new_dcc->nick = strdup (nick);
@@ -378,6 +415,9 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
new_dcc->size = size;
new_dcc->pos = 0;
new_dcc->ack = 0;
new_dcc->last_check_time = 0;
new_dcc->last_check_pos = 0;
new_dcc->bytes_per_sec = 0;
new_dcc->prev_dcc = NULL;
new_dcc->next_dcc = dcc_list;
if (dcc_list)
@@ -786,7 +826,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
}
/*
* dcc_handle: receive/send data for each active DCC (files only)
* dcc_handle: receive/send data for all active DCC
*/
void
@@ -838,6 +878,7 @@ dcc_handle ()
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
ptr_dcc->status = DCC_ACTIVE;
ptr_dcc->file = open (ptr_dcc->local_filename, O_RDONLY | O_NONBLOCK, 0644);
ptr_dcc->start_transfer = time (NULL);
dcc_redraw (1);
}
}
@@ -921,6 +962,7 @@ dcc_handle ()
ptr_dcc->pos += (unsigned long) num_read;
pos = htonl (ptr_dcc->pos);
send (ptr_dcc->sock, (char *) &pos, 4, 0);
dcc_calculate_speed (ptr_dcc, 0);
if (ptr_dcc->pos >= ptr_dcc->size)
{
dcc_close (ptr_dcc, DCC_DONE);
@@ -987,6 +1029,7 @@ dcc_handle ()
return;
}
ptr_dcc->pos += (unsigned long) num_sent;
dcc_calculate_speed (ptr_dcc, 0);
dcc_redraw (0);
}
}
@@ -1008,7 +1051,7 @@ dcc_end ()
if (ptr_dcc->sock != -1)
{
if (ptr_dcc->status == DCC_ACTIVE)
wee_log_printf (_("aborting active DCC: \"%s\" from %s\n"),
wee_log_printf (_("Aborting active DCC: \"%s\" from %s\n"),
ptr_dcc->filename, ptr_dcc->nick);
dcc_close (ptr_dcc, DCC_FAILED);
}
+20 -8
View File
@@ -66,13 +66,14 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
*/
void
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
int display_around, int color_nick, int no_nickmode)
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
int message_type, int display_around, int color_nick, int no_nickmode)
{
if (display_around)
gui_printf_type_color (buffer,
message_type, COLOR_WIN_CHAT_DARK, "<");
if (cfg_look_nickmode)
message_type, COLOR_WIN_CHAT_DARK,
(nick) ? "<" : ">");
if (nick && cfg_look_nickmode)
{
if (nick->is_chanowner)
gui_printf_type_color (buffer,
@@ -104,19 +105,20 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_CHAT_HIGHLIGHT,
"%s", nick->nick);
"%s", (nick) ? nick->nick : nickname);
else
gui_printf_type_color (buffer,
message_type,
(color_nick) ?
(nick && color_nick) ?
((cfg_look_color_nicks) ?
nick->color : COLOR_WIN_CHAT) :
COLOR_WIN_CHAT,
"%s", nick->nick);
"%s", (nick) ? nick->nick : nickname);
if (display_around)
gui_printf_type_color (buffer,
message_type, COLOR_WIN_CHAT_DARK, "> ");
message_type, COLOR_WIN_CHAT_DARK,
(nick) ? "> " : "< ");
}
/*
@@ -175,6 +177,12 @@ irc_display_server (t_irc_server *server)
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_port . . . . . . .: %d\n",
server->port);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_ipv6 . . . . . . .: %s\n",
(server->ipv6) ? _("yes") : _("no"));
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_ssl . . . . . . . .: %s\n",
(server->ssl) ? _("yes") : _("no"));
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_password . . . . .: %s\n",
(server->password && server->password[0]) ?
@@ -202,4 +210,8 @@ irc_display_server (t_irc_server *server)
" server_autojoin . . . . .: %s\n",
(server->autojoin && server->autojoin[0]) ?
server->autojoin : "");
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_notify_levels . . .: %s\n",
(server->notify_levels && server->notify_levels[0]) ?
server->notify_levels : "");
}
+22 -4
View File
@@ -51,6 +51,26 @@ nick_find_color (t_irc_nick *nick)
return COLOR_WIN_NICK_FIRST + color;
}
/*
* nick_score_for_sort: return score for sorting nick, according to privileges
*/
int
nick_score_for_sort (t_irc_nick *nick)
{
if (nick->is_chanowner)
return -32;
if (nick->is_chanadmin)
return -16;
if (nick->is_op)
return -8;
if (nick->is_halfop)
return -4;
if (nick->has_voice)
return -2;
return 0;
}
/*
* nick_compare: compare two nicks
* return: -1 is nick1 < nick2
@@ -64,10 +84,8 @@ nick_compare (t_irc_nick *nick1, t_irc_nick *nick2)
{
int score1, score2, comp;
score1 = - ( (nick1->is_chanowner * 32) + (nick1->is_chanadmin * 16) +
(nick1->is_op * 8) + (nick1->is_halfop * 4) + (nick1->has_voice * 2) );
score2 = - ( (nick2->is_chanowner * 32) + (nick2->is_chanadmin * 16) +
(nick2->is_op * 8) + (nick2->is_halfop * 4) + (nick2->has_voice * 2) );
score1 = nick_score_for_sort (nick1);
score2 = nick_score_for_sort (nick2);
comp = strcasecmp(nick1->nick, nick2->nick);
if (comp > 0)
+257 -49
View File
@@ -345,6 +345,76 @@ irc_cmd_recv_kick (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_kill: 'kill' message received
*/
int
irc_cmd_recv_kill (t_irc_server *server, char *host, char *arguments)
{
char *pos, *pos_host2, *pos_comment;
t_irc_channel *ptr_channel;
pos = strchr (host, '!');
if (pos)
pos[0] = '\0';
pos_host2 = strchr (arguments, ' ');
if (pos_host2)
{
pos_host2[0] = '\0';
pos_host2++;
while (pos_host2[0] == ' ')
pos_host2++;
pos_comment = strchr (pos_host2, ' ');
if (pos_comment)
{
pos_comment[0] = '\0';
pos_comment++;
while (pos_comment[0] == ' ')
pos_comment++;
if (pos_comment[0] == ':')
pos_comment++;
}
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
irc_display_prefix (ptr_channel->buffer, PREFIX_PART);
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK,
"%s", host);
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
_(" has killed "));
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK,
"%s", arguments);
if (pos_comment)
{
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
_(" from server"));
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK,
" (");
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
"%s", pos_comment);
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK,
")\n");
}
else
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
_(" from server\n"));
}
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s host \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, "", "kill");
return -1;
}
return 0;
}
/*
* irc_get_channel_modes: get channel modes
*/
@@ -740,29 +810,30 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
if (pos)
pos[0] = '\0';
/* change nickname in any opened private window */
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer))
{
if ((CHANNEL(ptr_buffer)->name)
&& (strcasecmp (host, CHANNEL(ptr_buffer)->name) == 0))
{
free (CHANNEL(ptr_buffer)->name);
CHANNEL(ptr_buffer)->name = strdup (arguments);
}
}
}
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
ptr_nick = nick_search (ptr_channel, host);
if (ptr_nick)
{
/* change nickname in any opened private window */
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer))
{
if ((CHANNEL(ptr_buffer)->name)
&& (strcmp (ptr_nick->nick, CHANNEL(ptr_buffer)->name) == 0))
{
free (CHANNEL(ptr_buffer)->name);
CHANNEL(ptr_buffer)->name = strdup (arguments);
}
}
}
/* change nickname on channel */
nick_is_me = (strcmp (ptr_nick->nick, server->nick) == 0) ? 1 : 0;
if (nick_is_me)
gui_add_hotlist = 0;
nick_change (ptr_channel, ptr_nick, arguments);
irc_display_prefix (ptr_channel->buffer, PREFIX_INFO);
if (nick_is_me)
@@ -786,6 +857,7 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
arguments);
if (gui_buffer_has_nicklist (ptr_channel->buffer))
gui_draw_buffer_nick (ptr_channel->buffer, 1);
gui_add_hotlist = 1;
}
}
@@ -1174,37 +1246,28 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
else
{
ptr_nick = nick_search (ptr_channel, host);
if (ptr_nick)
if (strstr (pos, server->nick))
{
if (strstr (pos, server->nick))
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
1, -1, 0);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("On %s: %s> %s"),
ptr_channel->name,
host, pos);
}
else
irc_display_nick (ptr_channel->buffer, ptr_nick,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
COLOR_WIN_CHAT, "%s\n", pos);
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : host,
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
1, -1, 0);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("On %s: %s> %s"),
ptr_channel->name,
host, pos);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s nick \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, host, "privmsg");
return -1;
}
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : host,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
COLOR_WIN_CHAT, "%s\n", pos);
}
}
else
@@ -1994,6 +2057,48 @@ irc_cmd_recv_306 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_307: '307' command (whois, registered nick)
*/
int
irc_cmd_recv_307 (t_irc_server *server, char *host, char *arguments)
{
char *pos_nick, *pos_msg;
/* make gcc happy */
(void) host;
pos_nick = strchr (arguments, ' ');
if (pos_nick)
{
while (pos_nick[0] == ' ')
pos_nick++;
pos_msg = strchr (pos_nick, ' ');
if (pos_msg)
{
pos_msg[0] = '\0';
pos_msg++;
while (pos_msg[0] == ' ')
pos_msg++;
if (pos_msg[0] == ':')
pos_msg++;
irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "[");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK, "%s", pos_nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "] ");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT, "%s\n",
pos_msg);
}
}
return 0;
}
/*
* irc_cmd_recv_311: '311' command (whois, user)
*/
@@ -2847,6 +2952,68 @@ irc_cmd_recv_333 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_341: '341' command received (inviting)
*/
int
irc_cmd_recv_341 (t_irc_server *server, char *host, char *arguments)
{
char *pos, *pos_nick, *pos_channel;
pos = strchr (host, '!');
if (pos)
pos[0] = '\0';
pos_nick = strchr (arguments, ' ');
if (pos_nick)
{
pos_nick[0] = '\0';
pos_nick++;
while (pos_nick[0] == ' ')
pos_nick++;
pos_channel = strchr (pos_nick, ' ');
if (pos_channel)
{
pos_channel[0] = '\0';
pos_channel++;
while (pos_channel[0] == ' ')
pos_channel++;
if (pos_channel[0] == ':')
pos_channel++;
irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
"%s ", arguments);
gui_printf (server->buffer, _("has invited"));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
" %s ", pos_nick);
gui_printf (server->buffer, _("on"));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL,
" %s\n", pos_channel);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify channel for \"%s\" command\n"),
WEECHAT_ERROR, "341");
return -1;
}
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify nickname for \"%s\" command\n"),
WEECHAT_ERROR, "341");
return -1;
}
return 0;
}
/*
* irc_cmd_recv_351: '351' command received (server version)
*/
@@ -2970,16 +3137,16 @@ irc_cmd_recv_352 (t_irc_server *server, char *host, char *arguments)
PREFIX_SERVER);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK,
"%s", pos_nick);
"%s ", pos_nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT,
_(" on "));
_("on"));
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_CHANNEL,
"%s ", pos_channel);
" %s", pos_channel);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT,
"%s %s ",
" %s %s ",
pos_attr, pos_hopcount);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_HOST,
@@ -3160,7 +3327,7 @@ irc_cmd_recv_366 (t_irc_server *server, char *host, char *arguments)
for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_MSG, 0, 0, 1);
if (ptr_nick != ptr_channel->last_nick)
gui_printf (ptr_channel->buffer, " ");
@@ -3511,3 +3678,44 @@ irc_cmd_recv_438 (t_irc_server *server, char *host, char *arguments)
return 0;
}
/*
* irc_cmd_recv_671: '671' command (whois, secure connection)
*/
int
irc_cmd_recv_671 (t_irc_server *server, char *host, char *arguments)
{
char *pos_nick, *pos_message;
/* make gcc happy */
(void) host;
pos_nick = strchr (arguments, ' ');
if (pos_nick)
{
while (pos_nick[0] == ' ')
pos_nick++;
pos_message = strchr (pos_nick, ' ');
if (pos_message)
{
pos_message[0] = '\0';
pos_message++;
while (pos_message[0] == ' ')
pos_message++;
if (pos_message[0] == ':')
pos_message++;
irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "[");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK, "%s", pos_nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, "] ");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT, "%s\n", pos_message);
}
}
return 0;
}
+52 -19
View File
@@ -94,6 +94,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
time_t elapsed;
char buffer[4096];
gui_add_hotlist = 0;
if (arguments && (strncmp (arguments, "-all", 4) == 0))
{
pos = arguments + 4;
@@ -119,9 +120,9 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
{
snprintf (buffer, sizeof (buffer),
"is back (gone %.2ld:%.2ld:%.2ld)",
elapsed / 3600,
(elapsed / 60) % 60,
elapsed % 60);
(long int)(elapsed / 3600),
(long int)((elapsed / 60) % 60),
(long int)(elapsed % 60));
irc_send_me_all_channels (ptr_server, buffer);
}
}
@@ -159,9 +160,9 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
{
snprintf (buffer, sizeof (buffer),
"is back (gone %.2ld:%.2ld:%.2ld)",
elapsed / 3600,
(elapsed / 60) % 60,
elapsed % 60);
(long int)(elapsed / 3600),
(long int)((elapsed / 60) % 60),
(long int)(elapsed % 60));
irc_send_me_all_channels (server, buffer);
}
}
@@ -184,6 +185,7 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
}
}
gui_draw_buffer_status (gui_current_window->buffer, 1);
gui_add_hotlist = 1;
return 0;
}
@@ -874,7 +876,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
ptr_nick = nick_search (ptr_channel, server->nick);
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
@@ -899,7 +901,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
ptr_nick = nick_search (ptr_channel, server->nick);
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type_color (ptr_channel->buffer,
MSG_TYPE_MSG,
@@ -1031,9 +1033,28 @@ irc_cmd_send_names (t_irc_server *server, char *arguments)
int
irc_cmd_send_nick (t_irc_server *server, int argc, char **argv)
{
if (argc != 1)
return -1;
server_sendf (server, "NICK %s\r\n", argv[0]);
t_irc_server *ptr_server;
if (argc == 2)
{
if (strncmp (argv[0], "-all", 4) != 0)
return -1;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (ptr_server->is_connected)
server_sendf (ptr_server, "NICK %s\r\n", argv[1]);
}
}
else
{
if (argc == 1)
server_sendf (server, "NICK %s\r\n", argv[0]);
else
return -1;
}
return 0;
}
@@ -1117,7 +1138,7 @@ irc_cmd_send_oper (t_irc_server *server, char *arguments)
int
irc_cmd_send_part (t_irc_server *server, char *arguments)
{
char *channel_name, *pos_args;
char *channel_name, *pos_args, *ptr_arg, *pos, buffer[4096];
t_irc_channel *ptr_channel;
if (arguments)
@@ -1171,16 +1192,28 @@ irc_cmd_send_part (t_irc_server *server, char *arguments)
pos_args = NULL;
}
if (pos_args)
server_sendf (server, "PART %s :%s\r\n", channel_name, pos_args);
else
ptr_arg = (pos_args) ? pos_args :
(cfg_irc_default_msg_part && cfg_irc_default_msg_part[0]) ?
cfg_irc_default_msg_part : NULL;
if (ptr_arg)
{
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
server_sendf (server, "PART %s :%s\r\n",
channel_name, cfg_irc_default_msg_part);
pos = strstr (ptr_arg, "%v");
if (pos)
{
pos[0] = '\0';
snprintf (buffer, sizeof (buffer), "%s%s%s",
ptr_arg, PACKAGE_VERSION, pos + 2);
pos[0] = '%';
}
else
server_sendf (server, "PART %s\r\n", channel_name);
snprintf (buffer, sizeof (buffer), "%s",
ptr_arg);
server_sendf (server, "PART %s :%s\r\n",
channel_name, buffer);
}
else
server_sendf (server, "PART %s\r\n", channel_name);
return 0;
}
+637 -66
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* irc-server.c: (dis)connection and communication with irc server */
/* irc-server.c: connection and communication with IRC server */
#ifdef HAVE_CONFIG_H
@@ -39,6 +39,10 @@
#include <arpa/inet.h>
#include <netdb.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include "../common/weechat.h"
#include "irc.h"
#include "../common/weeconfig.h"
@@ -67,6 +71,8 @@ server_init (t_irc_server *server)
server->command_line = 0;
server->address = NULL;
server->port = -1;
server->ipv6 = 0;
server->ssl = 0;
server->password = NULL;
server->nick1 = NULL;
server->nick2 = NULL;
@@ -77,6 +83,7 @@ server_init (t_irc_server *server)
server->command_delay = 1;
server->autojoin = NULL;
server->autorejoin = 0;
server->notify_levels = NULL;
/* internal vars */
server->child_pid = 0;
@@ -84,6 +91,9 @@ server_init (t_irc_server *server)
server->child_write = -1;
server->sock = -1;
server->is_connected = 0;
#ifdef HAVE_GNUTLS
server->ssl_connected = 0;
#endif
server->unterminated_message = NULL;
server->nick = NULL;
server->reconnect_start = 0;
@@ -110,18 +120,42 @@ int
server_init_with_url (char *irc_url, t_irc_server *server)
{
char *url, *pos_server, *pos_channel, *pos, *pos2;
int ipv6, ssl;
struct passwd *my_passwd;
server_init (server);
if (strncasecmp (irc_url, "irc://", 6) != 0)
ipv6 = 0;
ssl = 0;
if (strncasecmp (irc_url, "irc6://", 7) == 0)
{
pos = irc_url + 7;
ipv6 = 1;
}
else if (strncasecmp (irc_url, "ircs://", 7) == 0)
{
pos = irc_url + 7;
ssl = 1;
}
else if ((strncasecmp (irc_url, "irc6s://", 8) == 0)
|| (strncasecmp (irc_url, "ircs6://", 8) == 0))
{
pos = irc_url + 8;
ipv6 = 1;
ssl = 1;
}
else if (strncasecmp (irc_url, "irc://", 6) == 0)
{
pos = irc_url + 6;
}
else
return -1;
url = strdup (irc_url);
pos_server = strchr (url, '@');
if (pos_server)
{
pos_server[0] = '\0';
pos_server++;
pos = url + 6;
if (!pos[0])
{
free (url);
@@ -183,6 +217,9 @@ server_init_with_url (char *irc_url, t_irc_server *server)
free (url);
server->ipv6 = ipv6;
server->ssl = ssl;
/* some default values */
if (server->port < 0)
server->port = DEFAULT_IRC_PORT;
@@ -256,6 +293,10 @@ server_destroy (t_irc_server *server)
free (server->command);
if (server->autojoin)
free (server->autojoin);
if (server->notify_levels)
free (server->notify_levels);
if (server->unterminated_message)
free (server->unterminated_message);
if (server->nick)
free (server->nick);
if (server->channels)
@@ -312,26 +353,26 @@ server_free_all ()
t_irc_server *
server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_delay,
int command_line, char *address, int port, char *password,
int command_line, char *address, int port, int ipv6, int ssl, char *password,
char *nick1, char *nick2, char *nick3, char *username,
char *realname, char *command, int command_delay, char *autojoin,
int autorejoin)
int autorejoin, char *notify_levels)
{
t_irc_server *new_server;
if (!name || !address || (port < 0))
return NULL;
#ifdef DEBUG
wee_log_printf ("creating new server (name:%s, address:%s, port:%d, pwd:%s, "
#ifdef DEBUG
wee_log_printf ("Creating new server (name:%s, address:%s, port:%d, pwd:%s, "
"nick1:%s, nick2:%s, nick3:%s, username:%s, realname:%s, "
"command:%s, autojoin:%s, autorejoin:%s)\n",
"command:%s, autojoin:%s, autorejoin:%s, notify_levels:%s)\n",
name, address, port, (password) ? password : "",
(nick1) ? nick1 : "", (nick2) ? nick2 : "", (nick3) ? nick3 : "",
(username) ? username : "", (realname) ? realname : "",
(command) ? command : "", (autojoin) ? autojoin : "",
(autorejoin) ? "on" : "off");
#endif
(autorejoin) ? "on" : "off", (notify_levels) ? notify_levels : "");
#endif
if ((new_server = server_alloc ()))
{
@@ -342,6 +383,8 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
new_server->command_line = command_line;
new_server->address = strdup (address);
new_server->port = port;
new_server->ipv6 = ipv6;
new_server->ssl = ssl;
new_server->password = (password) ? strdup (password) : strdup ("");
new_server->nick1 = (nick1) ? strdup (nick1) : strdup ("weechat_user");
new_server->nick2 = (nick2) ? strdup (nick2) : strdup ("weechat2");
@@ -357,6 +400,8 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
(autojoin) ? strdup (autojoin) : NULL;
new_server->autorejoin = autorejoin;
new_server->nick = strdup (new_server->nick1);
new_server->notify_levels =
(notify_levels) ? strdup (notify_levels) : NULL;
}
else
return NULL;
@@ -364,7 +409,7 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
}
/*
* server_send: send data to irc server
* server_send: send data to IRC server
*/
int
@@ -373,11 +418,16 @@ server_send (t_irc_server *server, char *buffer, int size_buf)
if (!server)
return -1;
return send (server->sock, buffer, size_buf, 0);
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
return gnutls_record_send (server->gnutls_sess, buffer, size_buf);
else
#endif
return send (server->sock, buffer, size_buf, 0);
}
/*
* server_sendf: send formatted data to irc server
* server_sendf: send formatted data to IRC server
*/
void
@@ -401,11 +451,11 @@ server_sendf (t_irc_server *server, char *fmt, ...)
buffer[sizeof (buffer) - 1] = '\0';
if ((size_buf < 0) || (size_buf > (int) (sizeof (buffer) - 1)))
size_buf = strlen (buffer);
#ifdef DEBUG
#ifdef DEBUG
buffer[size_buf - 2] = '\0';
gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer);
buffer[size_buf - 2] = '\r';
#endif
#endif
buf2 = weechat_convert_encoding ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
cfg_look_charset_encode,
@@ -551,9 +601,9 @@ server_msgq_flush ()
{
if (recv_msgq->data)
{
#ifdef DEBUG
#ifdef DEBUG
gui_printf (gui_current_window->buffer, "[DEBUG] %s\n", recv_msgq->data);
#endif
#endif
ptr_data = recv_msgq->data;
entire_line = strdup (ptr_data);
@@ -563,9 +613,9 @@ server_msgq_flush ()
if (ptr_data)
{
#ifdef DEBUG
#ifdef DEBUG
gui_printf (NULL, "[DEBUG] data received from server: %s\n", ptr_data);
#endif
#endif
host = NULL;
command = NULL;
@@ -644,7 +694,16 @@ server_recv (t_irc_server *server)
static char buffer[4096 + 2];
int num_read;
num_read = recv (server->sock, buffer, sizeof (buffer) - 2, 0);
if (!server)
return;
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
num_read = gnutls_record_recv (server->gnutls_sess, buffer, sizeof (buffer) - 2);
else
#endif
num_read = recv (server->sock, buffer, sizeof (buffer) - 2, 0);
if (num_read > 0)
{
buffer[num_read] = '\0';
@@ -701,8 +760,16 @@ server_close_connection (t_irc_server *server)
/* close network socket */
if (server->sock != -1)
{
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
gnutls_bye (server->gnutls_sess, GNUTLS_SHUT_RDWR);
#endif
close (server->sock);
server->sock = -1;
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
gnutls_deinit (server->gnutls_sess);
#endif
}
/* free any pending message */
@@ -714,6 +781,9 @@ server_close_connection (t_irc_server *server)
/* server is now disconnected */
server->is_connected = 0;
#ifdef HAVE_GNUTLS
server->ssl_connected = 0;
#endif
}
/*
@@ -751,31 +821,70 @@ server_child_read (t_irc_server *server)
{
/* connection OK */
case '0':
/* enable SSL if asked */
#ifdef HAVE_GNUTLS
if (server->ssl_connected)
{
gnutls_transport_set_ptr (server->gnutls_sess, (gnutls_transport_ptr) server->sock);
if (gnutls_handshake (server->gnutls_sess) < 0)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s gnutls handshake failed\n"),
WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
return;
}
}
#endif
/* kill child and login to server */
server_kill_child (server);
irc_login (server);
break;
/* adress not found */
case '1':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
else
gui_printf (server->buffer,
_("%s address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* IP address not found */
case '2':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s IP address not found\n"), WEECHAT_ERROR);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy IP address not found\n"), WEECHAT_ERROR);
else
gui_printf (server->buffer,
_("%s IP address not found\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* connection refused */
/* connection refused */
case '3':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s connection refused\n"), WEECHAT_ERROR);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy connection refused\n"), WEECHAT_ERROR);
else
gui_printf (server->buffer,
_("%s connection refused\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* proxy fails to connect to server */
case '4':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s proxy fails to establish connection to server (check username/password if used)\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
@@ -783,6 +892,359 @@ server_child_read (t_irc_server *server)
}
}
/*
* convbase64_8x3_to_6x4 : convert 3 bytes of 8 bits in 4 bytes of 6 bits
*/
void
convbase64_8x3_to_6x4(char *from, char* to)
{
unsigned char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
to[0] = base64_table [ (from[0] & 0xfc) >> 2 ];
to[1] = base64_table [ ((from[0] & 0x03) << 4) + ((from[1] & 0xf0) >> 4) ];
to[2] = base64_table [ ((from[1] & 0x0f) << 2) + ((from[2] & 0xc0) >> 6) ];
to[3] = base64_table [ from[2] & 0x3f ];
}
/*
* base64encode: encode a string in base64
*/
void
base64encode(char *from, char *to)
{
char *f, *t;
int from_len;
from_len = strlen(from);
f = from;
t = to;
while(from_len >= 3)
{
convbase64_8x3_to_6x4(f, t);
f += 3 * sizeof(*f);
t += 4 * sizeof(*t);
from_len -= 3;
}
if (from_len > 0)
{
char rest[3] = { 0, 0, 0 };
switch(from_len)
{
case 1 :
rest[0] = f[0];
convbase64_8x3_to_6x4(rest, t);
t[2] = t[3] = '=';
break;
case 2 :
rest[0] = f[0];
rest[1] = f[1];
convbase64_8x3_to_6x4(rest, t);
t[3] = '=';
break;
}
t[4] = 0;
}
}
/*
* pass_httpproxy: establish connection/authentification to an http proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_httpproxy(t_irc_server *server)
{
char buffer[256];
char authbuf[128]; // seems to be enougth to store username + password
char authbuf_base64[196]; // enougth to store base64 encoded authbuf
int n, m;
if (strlen(cfg_proxy_username) > 0)
{
// authentification
snprintf(authbuf, sizeof(authbuf), "%s:%s", cfg_proxy_username, cfg_proxy_password);
base64encode(authbuf, authbuf_base64);
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\nProxy-Authorization: Basic %s\r\n\r\n", server->address, server->port, authbuf_base64);
}
else
{
// no authentification
n = snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\n\r\n", server->address, server->port);
}
m = send (server->sock, buffer, n, 0);
if (n != m)
return 1;
n = recv(server->sock, buffer, sizeof(buffer), 0);
/* success result must be like : "HTTP/1.0 200 OK" */
if (n < 12)
return 1;
if (memcmp (buffer, "HTTP/", 5) || memcmp (buffer + 9, "200", 3))
return 1;
return 0;
}
/*
* resolve: resolve hostname on its IP address
* (works with ipv4 and ipv6)
* return :
* - 0 if resolution was successful
* - 1 if resolution fails
*/
int
resolve (char *hostname, char *ip, int *version)
{
char ipbuffer[NI_MAXHOST];
struct addrinfo *res;
if (version != NULL)
*version = 0;
res = NULL;
if (getaddrinfo (hostname, NULL, NULL, &res) != 0)
return 1;
if (!res)
return 1;
if (getnameinfo (res->ai_addr, res->ai_addrlen, ipbuffer, sizeof(ipbuffer), NULL, 0, NI_NUMERICHOST) != 0)
{
freeaddrinfo (res);
return 1;
}
if ((res->ai_family == AF_INET) && (version != NULL))
*version = 4;
if ((res->ai_family == AF_INET6) && (version != NULL))
*version = 6;
strcpy (ip, ipbuffer);
freeaddrinfo (res);
return 0;
}
/*
* pass_socks4proxy: establish connection/authentification throw a socks4 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks4proxy(t_irc_server *server)
{
/*
* socks4 protocol is explain here:
* http://archive.socks.permeo.com/protocol/socks4.protocol
*
*/
struct s_socks4
{
char version; /* 1 byte */ /* socks version : 4 or 5 */
char method; /* 1 byte */ /* socks method : connect (1) or bind (2) */
unsigned short port; /* 2 bytes */ /* destination port */
unsigned long address; /* 4 bytes */ /* destination address */
char user[64]; /* username (64 characters seems to be enought) */
} socks4;
unsigned char buffer[24];
char ip_addr[NI_MAXHOST];
socks4.version = 4;
socks4.method = 1;
socks4.port = htons (server->port);
resolve(server->address, ip_addr, NULL);
socks4.address = inet_addr (ip_addr);
strncpy (socks4.user, server->username, sizeof(socks4.user) - 1);
send (server->sock, (char *) &socks4, 8 + strlen(socks4.user) + 1, 0);
recv (server->sock, buffer, sizeof(buffer), 0);
if (buffer[0] == 0 && buffer[1] == 90)
return 0;
return 1;
}
/*
* pass_socks5proxy: establish connection/authentification throw a socks5 proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_socks5proxy(t_irc_server *server)
{
/*
* socks5 protocol is explained in RFC 1928
* socks5 authentication with username/pass is explained in RFC 1929
*/
struct s_sock5
{
char version; /* 1 byte */ /* socks version : 4 or 5 */
char nmethods; /* 1 byte */ /* size in byte(s) of field 'method', here 1 byte */
char method; /* 1-255 bytes */ /* socks method : noauth (0), auth(user/pass) (2), ... */
} socks5;
unsigned char buffer[288];
int username_len, password_len, addr_len, addr_buffer_len;
unsigned char *addr_buffer;
socks5.version = 5;
socks5.nmethods = 1;
if (strlen(cfg_proxy_username) > 0)
/* with authentication */
socks5.method = 2;
else
/* without authentication */
socks5.method = 0;
send (server->sock, (char *) &socks5, sizeof(socks5), 0);
/* server socks5 must respond with 2 bytes */
if (recv (server->sock, buffer, 2, 0) != 2)
return 1;
if (strlen(cfg_proxy_username) > 0)
{
/* with authentication */
/* -> socks server must respond with :
* - socks version (buffer[0]) = 5 => socks5
* - socks method (buffer[1]) = 2 => authentication
*/
//if (!(buffer[0] == 5 && buffer[1] == 2))
if (buffer[0] != 5 || buffer[1] != 2)
return 1;
/* authentication as in RFC 1929 */
username_len = strlen(cfg_proxy_username);
password_len = strlen(cfg_proxy_password);
/* make username/password buffer */
buffer[0] = 1;
buffer[1] = (unsigned char) username_len;
memcpy(buffer + 2, cfg_proxy_username, username_len);
buffer[2 + username_len] = (unsigned char) password_len;
memcpy(buffer + 3 + username_len, cfg_proxy_password, password_len);
send (server->sock, buffer, 3 + username_len + password_len, 0);
/* server socks5 must respond with 2 bytes */
if (recv (server->sock, buffer, 2, 0) != 2)
return 1;
/* buffer[1] = auth state, must be 0 for success */
if (buffer[1] != 0)
return 1;
}
else
{
/* without authentication */
/* -> socks server must respond with :
* - socks version (buffer[0]) = 5 => socks5
* - socks method (buffer[1]) = 0 => no authentication
*/
if (!(buffer[0] == 5 && buffer[1] == 0))
return 1;
}
/* authentication successful then giving address/port to connect */
addr_len = strlen(server->address);
addr_buffer_len = 4 + 1 + addr_len + 2;
addr_buffer = (unsigned char *) malloc ( addr_buffer_len * sizeof(*addr_buffer));
if (!addr_buffer)
return 1;
addr_buffer[0] = 5; /* version 5 */
addr_buffer[1] = 1; /* command: 1 for connect */
addr_buffer[2] = 0; /* reserved */
addr_buffer[3] = 3; /* address type : ipv4 (1), domainname (3), ipv6 (4) */
addr_buffer[4] = (unsigned char) addr_len;
memcpy (addr_buffer + 5, server->address, addr_len); /* server address */
*((unsigned short *) (addr_buffer + 5 + addr_len)) = htons (server->port); /* server port */
send (server->sock, addr_buffer, addr_buffer_len, 0);
free(addr_buffer);
/* dialog with proxy server */
if (recv (server->sock, buffer, 4, 0) != 4)
return 1;
if (!(buffer[0] == 5 && buffer[1] == 0))
return 1;
switch(buffer[3]) {
/* buffer[3] = address type */
case 1 :
/* ipv4
* server socks return server bound address and port
* address of 4 bytes and port of 2 bytes (= 6 bytes)
*/
if (recv (server->sock, buffer, 6, 0) != 6)
return 1;
break;
case 3:
/* domainname
* server socks return server bound address and port
*/
/* reading address length */
if (recv (server->sock, buffer, 1, 0) != 1)
return 1;
addr_len = buffer[0];
/* reading address + port = addr_len + 2 */
if (recv (server->sock, buffer, addr_len + 2, 0) != (addr_len + 2))
return 1;
break;
case 4 :
/* ipv6
* server socks return server bound address and port
* address of 16 bytes and port of 2 bytes (= 18 bytes)
*/
if (recv (server->sock, buffer, 18, 0) != 18)
return 1;
break;
default:
return 1;
}
return 0;
}
/*
* pass_proxy: establish connection/authentification to a proxy
* return :
* - 0 if connexion throw proxy was successful
* - 1 if connexion fails
*/
int
pass_proxy(t_irc_server *server)
{
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "http") == 0)
return pass_httpproxy(server);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks4") == 0)
return pass_socks4proxy(server);
if (strcmp(cfg_proxy_type_values[cfg_proxy_type], "socks5") == 0)
return pass_socks5proxy(server);
return 1;
}
/*
* server_child: child process trying to connect to server
*/
@@ -790,42 +1252,90 @@ server_child_read (t_irc_server *server)
int
server_child (t_irc_server *server)
{
struct hostent *ip4_hostent;
struct sockaddr_in addr;
char *ip_address;
int error;
struct addrinfo hints, *res;
/* bind to hostname */
ip4_hostent = gethostbyname (server->address);
if (!ip4_hostent)
res = NULL;
if (cfg_proxy_use)
{
write (server->child_write, "1", 1);
return 0;
memset (&hints, 0, sizeof (hints));
hints.ai_family = (cfg_proxy_ipv6) ? AF_INET6 : AF_INET;
hints.ai_socktype = SOCK_STREAM;
if (getaddrinfo (cfg_proxy_address, NULL, &hints, &res) !=0)
{
write(server->child_write, "1", 1);
return 0;
}
if (!res)
{
write(server->child_write, "1", 1);
return 0;
}
if ((cfg_proxy_ipv6 && (res->ai_family != AF_INET6))
|| ((!cfg_proxy_ipv6 && (res->ai_family != AF_INET))))
{
write (server->child_write, "2", 1);
freeaddrinfo (res);
return 0;
}
if (cfg_proxy_ipv6)
((struct sockaddr_in6 *)(res->ai_addr))->sin6_port = htons (cfg_proxy_port);
else
((struct sockaddr_in *)(res->ai_addr))->sin_port = htons (cfg_proxy_port);
if (connect (server->sock, res->ai_addr, res->ai_addrlen) != 0)
{
write(server->child_write, "3", 1);
freeaddrinfo (res);
return 0;
}
if (pass_proxy(server))
{
write(server->child_write, "4", 1);
freeaddrinfo (res);
return 0;
}
}
memset (&addr, 0, sizeof (addr));
memcpy (&addr.sin_addr, ip4_hostent->h_addr, ip4_hostent->h_length);
addr.sin_port = htons (server->port);
addr.sin_family = AF_INET;
/* find IP address */
ip_address = inet_ntoa (addr.sin_addr);
if (!ip_address)
else
{
write (server->child_write, "2", 1);
return 0;
memset (&hints, 0, sizeof(hints));
hints.ai_family = (server->ipv6) ? AF_INET6 : AF_INET;
hints.ai_socktype = SOCK_STREAM;
if (getaddrinfo (server->address, NULL, &hints, &res) !=0)
{
write(server->child_write, "1", 1);
return 0;
}
if (!res)
{
write(server->child_write, "1", 1);
return 0;
}
if ((server->ipv6 && (res->ai_family != AF_INET6))
|| ((!server->ipv6 && (res->ai_family != AF_INET))))
{
write(server->child_write, "2", 1);
freeaddrinfo (res);
return 0;
}
if (server->ipv6)
((struct sockaddr_in6 *)(res->ai_addr))->sin6_port = htons (server->port);
else
((struct sockaddr_in *)(res->ai_addr))->sin_port = htons (server->port);
if (connect (server->sock, res->ai_addr, res->ai_addrlen) != 0)
{
write(server->child_write, "3", 1);
freeaddrinfo (res);
return 0;
}
}
/* connect to server */
error = connect (server->sock, (struct sockaddr *) &addr, sizeof (addr));
if (error != 0)
{
write (server->child_write, "3", 1);
return 0;
}
/* connection OK */
write (server->child_write, "0", 1);
freeaddrinfo (res);
return 0;
}
@@ -838,17 +1348,72 @@ server_connect (t_irc_server *server)
{
int child_pipe[2], set;
pid_t pid;
#ifdef HAVE_GNUTLS
const int cert_type_prio[] = { GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 };
#endif
#ifndef HAVE_GNUTLS
if (server->ssl)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot connect with SSL since WeeChat was not built "
"with GNUtls support\n"), WEECHAT_ERROR);
return 0;
}
#endif
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer,
_("%s: connecting to %s:%d...\n"),
PACKAGE_NAME, server->address, server->port);
wee_log_printf (_("connecting to server %s:%d...\n"),
server->address, server->port);
if (cfg_proxy_use)
{
gui_printf (server->buffer,
_("%s: connecting to server %s:%d%s%s via %s proxy %s:%d%s...\n"),
PACKAGE_NAME, server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "",
cfg_proxy_type_values[cfg_proxy_type], cfg_proxy_address, cfg_proxy_port,
(cfg_proxy_ipv6) ? " (IPv6)" : "");
wee_log_printf (_("Connecting to server %s:%d%s%s via %s proxy %s:%d%s...\n"),
server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "",
cfg_proxy_type_values[cfg_proxy_type], cfg_proxy_address, cfg_proxy_port,
(cfg_proxy_ipv6) ? " (IPv6)" : "");
}
else
{
gui_printf (server->buffer,
_("%s: connecting to server %s:%d%s%s...\n"),
PACKAGE_NAME, server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "");
wee_log_printf (_("Connecting to server %s:%d%s%s...\n"),
server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "");
}
/* close any opened connection and kill child process if running */
server_close_connection (server);
/* init SSL if asked */
#ifdef HAVE_GNUTLS
server->ssl_connected = 0;
if (server->ssl)
{
if (gnutls_init (&server->gnutls_sess, GNUTLS_CLIENT) != 0)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s gnutls init error\n"), WEECHAT_ERROR);
return 0;
}
gnutls_set_default_priority (server->gnutls_sess);
gnutls_certificate_type_set_priority (server->gnutls_sess, cert_type_prio);
gnutls_credentials_set (server->gnutls_sess, GNUTLS_CRD_CERTIFICATE, gnutls_xcred);
server->ssl_connected = 1;
}
#endif
/* create pipe for child process */
if (pipe (child_pipe) < 0)
{
@@ -861,13 +1426,12 @@ server_connect (t_irc_server *server)
server->child_write = child_pipe[1];
/* create socket and set options */
server->sock = socket (AF_INET, SOCK_STREAM, 0);
server->sock = socket ((server->ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
if (server->sock == -1)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot create socket\n"), WEECHAT_ERROR);
server_close_connection (server);
return 0;
}
@@ -947,7 +1511,8 @@ server_auto_connect (int command_line)
{
(void) gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1);
gui_redraw_buffer (gui_current_window->buffer);
server_connect (ptr_server);
if (!server_connect (ptr_server))
server_reconnect_schedule (ptr_server);
}
}
}
@@ -1143,6 +1708,8 @@ server_print_log (t_irc_server *server)
wee_log_printf (" command_line. . . . : %d\n", server->command_line);
wee_log_printf (" address . . . . . . : '%s'\n", server->address);
wee_log_printf (" port. . . . . . . . : %d\n", server->port);
wee_log_printf (" ipv6. . . . . . . . : %d\n", server->ipv6);
wee_log_printf (" ssl . . . . . . . . : %d\n", server->ssl);
wee_log_printf (" password. . . . . . : '%s'\n",
(server->password && server->password[0]) ? "(hidden)" : server->password);
wee_log_printf (" nick1 . . . . . . . : '%s'\n", server->nick1);
@@ -1155,11 +1722,15 @@ server_print_log (t_irc_server *server)
wee_log_printf (" command_delay . . . : %d\n", server->command_delay);
wee_log_printf (" autojoin. . . . . . : '%s'\n", server->autojoin);
wee_log_printf (" autorejoin. . . . . : %d\n", server->autorejoin);
wee_log_printf (" notify_levels . . . : %s\n", server->notify_levels);
wee_log_printf (" child_pid . . . . . : %d\n", server->child_pid);
wee_log_printf (" child_read . . . . : %d\n", server->child_read);
wee_log_printf (" child_write . . . . : %d\n", server->child_write);
wee_log_printf (" sock. . . . . . . . : %d\n", server->sock);
wee_log_printf (" is_connected. . . . : %d\n", server->is_connected);
#ifdef HAVE_GNUTLS
wee_log_printf(" ssl_connected . . . : %d\n", server->ssl_connected);
#endif
wee_log_printf (" unterminated_message: '%s'\n", server->unterminated_message);
wee_log_printf (" nick. . . . . . . . : '%s'\n", server->nick);
wee_log_printf (" reconnect_start . . : %ld\n", server->reconnect_start);
+43 -6
View File
@@ -21,9 +21,18 @@
#ifndef __WEECHAT_IRC_H
#define __WEECHAT_IRC_H 1
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include "../gui/gui.h"
/* prefixes for chat window */
@@ -137,23 +146,31 @@ struct t_irc_server
int command_line; /* server was given on command line */
char *address; /* address of server (IP or name) */
int port; /* port for server (6667 by default) */
int ipv6; /* use IPv6 protocol */
int ssl; /* SSL protocol */
char *password; /* password for server */
char *nick1; /* first nickname for the server */
char *nick2; /* alternate nickname */
char *nick3; /* 2nd alternate nickname */
char *username; /* user name */
char *realname; /* real name */
char *command; /* command to run once connected */
char *command; /* command to run once connected */
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
char *notify_levels; /* channels notify levels */
/* internal vars */
pid_t child_pid; /* pid of child process (connecting) */
int child_read; /* to read into child pipe */
int child_write; /* to write into child pipe */
int sock; /* socket for server */
int sock; /* socket for server (IPv4 or IPv6) */
int is_connected; /* 1 if WeeChat is connected to server */
#ifdef HAVE_GNUTLS
int ssl_connected; /* = 1 if connected with SSL */
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
#endif
char *unterminated_message; /* beginning of a message in input buf */
char *nick; /* current nickname */
time_t reconnect_start; /* this time + delay = reconnect time */
@@ -212,6 +229,7 @@ struct t_irc_dcc
int type; /* DCC type (send or receive) */
int status; /* DCC status (waiting, sending, ..) */
time_t start_time; /* the time when DCC started */
time_t start_transfer; /* the time when DCC transfer started */
unsigned long addr; /* IP address */
int port; /* port */
char *nick; /* remote nick */
@@ -224,6 +242,9 @@ struct t_irc_dcc
unsigned long size; /* file size */
unsigned long pos; /* number of bytes received/sent */
unsigned long ack; /* number of bytes received OK */
time_t last_check_time; /* last time we looked at bytes sent/rcv*/
unsigned long last_check_pos; /* bytes sent/recv at last check */
unsigned long bytes_per_sec; /* bytes per second */
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
};
@@ -244,9 +265,9 @@ extern t_irc_server *server_alloc ();
extern void server_destroy (t_irc_server *);
extern void server_free (t_irc_server *);
extern void server_free_all ();
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, char *,
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, int, int,
char *, char *, char *, char *, char *, char *,
int, char *, int);
char *, int, char *, int, char *);
extern int server_send (t_irc_server *, char *, int);
extern void server_sendf (t_irc_server *, char *, ...);
extern void server_recv (t_irc_server *);
@@ -264,6 +285,15 @@ extern void server_check_away ();
extern void server_set_away (t_irc_server *, char *, int);
extern void server_print_log (t_irc_server *);
/* proxy functions (irc-server.c) */
extern void convbase64_8x3_to_6x4(char *from, char* to);
extern void base64encode(char *from, char *to);
extern int pass_httpproxy(t_irc_server *server);
extern int resolve(char *hostname, char *ip, int *version);
extern int pass_socks4proxy(t_irc_server *server);
extern int pass_socks5proxy(t_irc_server *server);
extern int pass_proxy(t_irc_server *server);
/* channel functions (irc-channel.c) */
extern t_irc_channel *channel_new (t_irc_server *, int, char *, int);
@@ -276,6 +306,9 @@ extern void channel_check_away (t_irc_server *, t_irc_channel *);
extern void channel_set_away (t_irc_channel *, char *, int);
extern int channel_create_dcc (t_irc_dcc *);
extern void channel_remove_dcc (t_irc_dcc *);
extern int channel_get_notify_level (t_irc_server *, t_irc_channel *);
extern void channel_remove_notify_level (t_irc_server *, t_irc_channel *);
extern void channel_set_notify_level (t_irc_server *, t_irc_channel *, int);
extern void channel_print_log (t_irc_channel *);
/* nick functions (irc-nick.c) */
@@ -307,7 +340,7 @@ extern void dcc_end ();
/* IRC display (irc-diplay.c) */
extern void irc_display_prefix (/*@null@*/ t_gui_buffer *, char *);
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, int, int, int, int);
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, char *, int, int, int, int);
extern void irc_display_mode (t_gui_buffer *, char *, char, char *, char *,
char *, char *);
extern void irc_display_server (t_irc_server *ptr_server);
@@ -379,6 +412,7 @@ extern int irc_cmd_recv_error (t_irc_server *, char *, char *);
extern int irc_cmd_recv_invite (t_irc_server *, char *, char *);
extern int irc_cmd_recv_join (t_irc_server *, char *, char *);
extern int irc_cmd_recv_kick (t_irc_server *, char *, char *);
extern int irc_cmd_recv_kill (t_irc_server *, char *, char *);
extern int irc_cmd_recv_mode (t_irc_server *, char *, char *);
extern int irc_cmd_recv_nick (t_irc_server *, char *, char *);
extern int irc_cmd_recv_notice (t_irc_server *, char *, char *);
@@ -397,6 +431,7 @@ 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 *);
@@ -414,6 +449,7 @@ 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 *);
@@ -423,5 +459,6 @@ 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 *);
#endif /* irc.h */
+4 -4
View File
@@ -21,16 +21,16 @@ if PLUGIN_PERL
perl_dir = perl
endif
# if PLUGIN_PYTHON
# python_dir = python
# endif
if PLUGIN_PYTHON
python_dir = python
endif
# if PLUGIN_RUBY
# ruby_dir = ruby
# endif
# SUBDIRS = $(perl_dir) $(python_dir) $(ruby_dir)
SUBDIRS = $(perl_dir)
SUBDIRS = $(perl_dir) $(python_dir)
noinst_LIBRARIES = lib_weechat_plugins.a
+408 -23
View File
@@ -45,10 +45,14 @@ t_plugin_script *last_perl_script = NULL;
extern void boot_DynaLoader (pTHX_ CV* cv);
/******************************* Old interface ********************************/
/*
* IRC::register: startup function for all WeeChat Perl scripts
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_register)
{
char *name, *version, *shutdown_func, *description;
@@ -78,12 +82,12 @@ static XS (XS_IRC_register)
if (perl_script_found)
{
/* error: another scripts already exists with this name! */
/* error: another script already exists with this name! */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: unable to register Perl script \"%s\" (another script "
_("%s error: unable to register \"%s\" script (another script "
"already exists with this name)\n"),
name);
"Perl", name);
}
else
{
@@ -105,15 +109,15 @@ static XS (XS_IRC_register)
perl_scripts = new_perl_script;
last_perl_script = new_perl_script;
wee_log_printf (_("registered Perl script: \"%s\", version %s (%s)\n"),
name, version, description);
wee_log_printf (_("Registered %s script: \"%s\", version %s (%s)\n"),
"Perl", name, version, description);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s unable to load Perl script \"%s\" (not enough memory)\n"),
WEECHAT_ERROR, name);
_("%s error: unable to load script \"%s\" (not enough memory)\n"),
"Perl", name);
}
}
XST_mPV (0, VERSION);
@@ -124,6 +128,8 @@ static XS (XS_IRC_register)
* IRC::print: print message to current buffer
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_print)
{
int i, integer;
@@ -148,6 +154,8 @@ static XS (XS_IRC_print)
* (server is optional)
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_print_with_channel)
{
int integer;
@@ -207,6 +215,8 @@ static XS (XS_IRC_print_with_channel)
* IRC::print_infobar: print message to infobar
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_print_infobar)
{
int integer;
@@ -221,7 +231,8 @@ static XS (XS_IRC_print_infobar)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: wrong parameters for IRC::print_infobar Perl function\n"));
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "print_infobar");
}
XSRETURN_EMPTY;
@@ -231,6 +242,8 @@ static XS (XS_IRC_print_infobar)
* IRC::command: send command to server
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_command)
{
int integer;
@@ -254,7 +267,8 @@ static XS (XS_IRC_command)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: server not found for IRC::command Perl function\n"));
_("%s error: server not found for \"%s\" function\n"),
"Perl", "command");
}
}
else
@@ -280,6 +294,8 @@ static XS (XS_IRC_command)
* IRC::add_message_handler: add handler for messages (privmsg, ...)
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_add_message_handler)
{
char *name, *function;
@@ -301,6 +317,8 @@ static XS (XS_IRC_add_message_handler)
* IRC::add_command_handler: add command handler (define/redefine commands)
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_add_command_handler)
{
char *name, *function;
@@ -332,6 +350,8 @@ static XS (XS_IRC_add_command_handler)
* IRC::get_info: get various infos
*/
/*** DEPRECATED function, kept for compatibility only, please don't update! ***/
static XS (XS_IRC_get_info)
{
char *arg, *info = NULL, *server;
@@ -355,7 +375,8 @@ static XS (XS_IRC_get_info)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: server not found for IRC::get_info Perl function\n"));
_("%s error: server not found for \"%s\" function\n"),
"Perl", "get_info");
}
}
else
@@ -406,6 +427,355 @@ static XS (XS_IRC_get_info)
XSRETURN (1);
}
/******************************* New interface ********************************/
/*
* weechat::register: startup function for all WeeChat Perl scripts
*/
static XS (XS_weechat_register)
{
char *name, *version, *shutdown_func, *description;
int integer;
t_plugin_script *ptr_perl_script, *perl_script_found, *new_perl_script;
dXSARGS;
/* make gcc happy */
(void) items;
(void) cv;
name = SvPV (ST (0), integer);
version = SvPV (ST (1), integer);
shutdown_func = SvPV (ST (2), integer);
description = SvPV (ST (3), integer);
perl_script_found = NULL;
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)
{
perl_script_found = ptr_perl_script;
break;
}
}
if (perl_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"),
"Perl", name);
}
else
{
/* registering script */
new_perl_script = (t_plugin_script *)malloc (sizeof (t_plugin_script));
if (new_perl_script)
{
new_perl_script->name = strdup (name);
new_perl_script->version = strdup (version);
new_perl_script->shutdown_func = strdup (shutdown_func);
new_perl_script->description = strdup (description);
/* add new script to list */
new_perl_script->prev_script = last_perl_script;
new_perl_script->next_script = NULL;
if (perl_scripts)
last_perl_script->next_script = new_perl_script;
else
perl_scripts = new_perl_script;
last_perl_script = new_perl_script;
wee_log_printf (_("Registered %s script: \"%s\", version %s (%s)\n"),
"Perl", name, version, description);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to load script \"%s\" (not enough memory)\n"),
"Perl", name);
}
}
XST_mPV (0, VERSION);
XSRETURN (1);
}
/*
* weechat::print: print message into a buffer (current or specified one)
*/
static XS (XS_weechat_print)
{
int integer;
char *message, *channel_name, *server_name;
t_gui_buffer *ptr_buffer;
dXSARGS;
/* make gcc happy */
(void) cv;
if ((items < 1) || (items > 3))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "print");
XSRETURN_NO;
return;
}
channel_name = NULL;
server_name = NULL;
if (items > 1)
{
channel_name = SvPV (ST (1), integer);
if (items > 2)
server_name = SvPV (ST (2), integer);
}
ptr_buffer = plugin_find_buffer (server_name, channel_name);
if (ptr_buffer)
{
message = SvPV (ST (0), integer);
irc_display_prefix (ptr_buffer, PREFIX_PLUGIN);
gui_printf (ptr_buffer, "%s%s",
message,
((strlen (message) == 0) || (message[strlen (message) - 1] != '\n')) ? "\n" : "");
XSRETURN_YES;
}
/* buffer not found */
XSRETURN_NO;
}
/*
* weechat::print_infobar: print message to infobar
*/
static XS (XS_weechat_print_infobar)
{
int integer;
dXSARGS;
/* make gcc happy */
(void) cv;
if (items != 2)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "print_infobar");
XSRETURN_NO;
}
gui_infobar_printf (SvIV (ST (0)), COLOR_WIN_INFOBAR, SvPV (ST (1), integer));
XSRETURN_YES;
}
/*
* weechat::command: send command to server
*/
static XS (XS_weechat_command)
{
int integer;
char *command, *channel_name, *server_name;
t_gui_buffer *ptr_buffer;
dXSARGS;
/* make gcc happy */
(void) cv;
if ((items < 1) || (items > 3))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "command");
XSRETURN_NO;
return;
}
channel_name = NULL;
server_name = NULL;
if (items > 1)
{
channel_name = SvPV (ST (1), integer);
if (items > 2)
server_name = SvPV (ST (2), integer);
}
ptr_buffer = plugin_find_buffer (server_name, channel_name);
if (ptr_buffer)
{
command = SvPV (ST (0), integer);
user_command (SERVER(ptr_buffer), ptr_buffer, command);
XSRETURN_YES;
}
/* buffer not found */
XSRETURN_NO;
}
/*
* weechat::add_message_handler: add handler for messages (privmsg, ...)
*/
static XS (XS_weechat_add_message_handler)
{
char *name, *function;
int integer;
dXSARGS;
/* make gcc happy */
(void) cv;
if (items != 2)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "add_message_handler");
XSRETURN_NO;
}
name = SvPV (ST (0), integer);
function = SvPV (ST (1), integer);
plugin_handler_add (&plugin_msg_handlers, &last_plugin_msg_handler,
PLUGIN_TYPE_PERL, name, function);
XSRETURN_YES;
}
/*
* weechat::add_command_handler: add command handler (define/redefine commands)
*/
static XS (XS_weechat_add_command_handler)
{
char *name, *function;
int integer;
t_plugin_handler *ptr_plugin_handler;
dXSARGS;
/* make gcc happy */
(void) cv;
if (items != 2)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "add_command_handler");
XSRETURN_NO;
}
name = SvPV (ST (0), integer);
function = SvPV (ST (1), integer);
if (!weelist_search (index_commands, name))
weelist_add (&index_commands, &last_index_command, name);
ptr_plugin_handler = plugin_handler_search (plugin_cmd_handlers, name);
if (ptr_plugin_handler)
{
free (ptr_plugin_handler->function_name);
ptr_plugin_handler->function_name = strdup (function);
}
else
plugin_handler_add (&plugin_cmd_handlers, &last_plugin_cmd_handler,
PLUGIN_TYPE_PERL, name, function);
XSRETURN_YES;
}
/*
* weechat::get_info: get various infos
*/
static XS (XS_weechat_get_info)
{
char *arg, *info = NULL, *server_name;
t_irc_server *ptr_server;
int integer;
dXSARGS;
/* make gcc happy */
(void) cv;
if ((items < 1) || (items > 2))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Perl", "get_info");
XSRETURN_NO;
}
if (items == 2)
{
server_name = SvPV (ST (1), integer);
ptr_server = server_search (server_name);
}
else
ptr_server = SERVER(gui_current_window->buffer);
if (!ptr_server)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: server not found for \"%s\" function\n"),
"Perl", "get_info");
XSRETURN_NO;
}
arg = SvPV (ST (0), integer);
if (arg)
{
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
{
info = PACKAGE_STRING;
}
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
{
if (ptr_server->nick)
info = ptr_server->nick;
}
else if ( (strcasecmp (arg, "2") == 0) || (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) )
{
if (ptr_server->name)
info = ptr_server->name;
}
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
{
info = weechat_home;
}
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
{
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
XSRETURN (1);
return;
}
if (info)
XST_mPV (0, info);
else
XST_mPV (0, "");
}
XSRETURN (1);
}
/*
* xs_init: initialize subroutines
*/
@@ -414,6 +784,8 @@ void
xs_init (pTHX)
{
newXS ("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__);
/* DEPRECATED & old interface (WeeChat <= 0.1.1), kept for compatibility */
newXS ("IRC::register", XS_IRC_register, "IRC");
newXS ("IRC::print", XS_IRC_print, "IRC");
newXS ("IRC::print_with_channel", XS_IRC_print_with_channel, "IRC");
@@ -422,6 +794,15 @@ xs_init (pTHX)
newXS ("IRC::add_message_handler", XS_IRC_add_message_handler, "IRC");
newXS ("IRC::add_command_handler", XS_IRC_add_command_handler, "IRC");
newXS ("IRC::get_info", XS_IRC_get_info, "IRC");
/* new interface (WeeChat >= 0.1.2) */
newXS ("weechat::register", XS_weechat_register, "weechat");
newXS ("weechat::print", XS_weechat_print, "weechat");
newXS ("weechat::print_infobar", XS_weechat_print_infobar, "weechat");
newXS ("weechat::command", XS_weechat_command, "weechat");
newXS ("weechat::add_message_handler", XS_weechat_add_message_handler, "weechat");
newXS ("weechat::add_command_handler", XS_weechat_add_command_handler, "weechat");
newXS ("weechat::get_info", XS_weechat_get_info, "weechat");
}
/*
@@ -433,7 +814,7 @@ wee_perl_init ()
{
char *perl_args[] = { "", "-e", "0" };
/* Following Perl code is extracted/modified from X-Chat IRC client */
/* X-Chat is (c) 1998-2002 Peter Zelezny */
/* X-Chat is (c) 1998-2005 Peter Zelezny */
char *weechat_perl_func =
{
"sub wee_perl_load_file"
@@ -451,21 +832,22 @@ wee_perl_init ()
" my $content = wee_perl_load_file ($filename);"
" if ($content eq \"__WEECHAT_ERROR__\")"
" {"
" IRC::print \"WeeChat Error: Perl script '$filename' not found.\\n\";"
" weechat::print \"WeeChat Error: Perl script '$filename' not found.\\n\", \"\";"
" return 1;"
" }"
" eval $content;"
" if ($@)"
" {"
" IRC::print \"WeeChat error: unable to load Perl script '$filename':\\n\";"
" IRC::print \"$@\\n\";"
" weechat::print \"WeeChat error: unable to load Perl script '$filename':\\n\", \"\";"
" weechat::print \"$@\\n\";"
" return 2;"
" }"
" return 0;"
"}"
"$SIG{__WARN__} = sub { IRC::print \"$_[0]\n\"; };"
"$SIG{__WARN__} = sub { weechat::print \"$_[0]\n\", \"\"; };"
};
wee_log_printf (_("Loading %s module \"weechat\"\n"), "Perl");
my_perl = perl_alloc ();
perl_construct (my_perl);
perl_parse (my_perl, xs_init, 3, perl_args, NULL);
@@ -524,7 +906,7 @@ wee_perl_exec (char *function, char *server, char *arguments)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: %s\n"),
_("Perl error: %s"),
SvPV (sv, count));
POPs;
}
@@ -534,8 +916,8 @@ wee_perl_exec (char *function, char *server, char *arguments)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: too much values from \"%s\" (%d). Expected: 1.\n"),
function, count);
_("%s error: too much values from \"%s\" (%d). Expected: 1.\n"),
"Perl", function, count);
}
else
return_code = POPi;
@@ -556,9 +938,9 @@ int
wee_perl_load (char *filename)
{
/* execute Perl script */
wee_log_printf (_("loading Perl script \"%s\"\n"), filename);
wee_log_printf (_("Loading %s script \"%s\"\n"), "Perl", filename);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Loading Perl script \"%s\"\n"), filename);
gui_printf (NULL, _("Loading %s script \"%s\"\n"), "Perl", filename);
return wee_perl_exec ("wee_perl_load_eval_file", filename, "");
}
@@ -607,8 +989,8 @@ wee_perl_unload (t_plugin_script *ptr_perl_script)
{
if (ptr_perl_script)
{
wee_log_printf (_("unloading Perl script \"%s\"\n"),
ptr_perl_script->name);
wee_log_printf (_("Unloading %s script \"%s\"\n"),
"Perl", ptr_perl_script->name);
/* call shutdown callback function */
if (ptr_perl_script->shutdown_func[0])
@@ -624,9 +1006,12 @@ wee_perl_unload (t_plugin_script *ptr_perl_script)
void
wee_perl_unload_all ()
{
wee_log_printf (_("unloading all Perl scripts...\n"));
wee_log_printf (_("Unloading all %s scripts...\n"), "Perl");
while (perl_scripts)
wee_perl_unload (perl_scripts);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s scripts unloaded\n"), "Perl");
}
/*
+120 -7
View File
@@ -39,6 +39,10 @@
#include "perl/wee-perl.h"
#endif
#ifdef PLUGIN_PYTHON
#include "python/wee-python.h"
#endif
char *plugin_name[3] = { "Perl", "Python", "Ruby" };
@@ -86,7 +90,7 @@ plugin_auto_load (int plugin_type, char *directory)
lstat (entry->d_name, &statbuf);
if (! S_ISDIR(statbuf.st_mode))
{
wee_log_printf (_("auto-loading %s script: %s%s%s\n"),
wee_log_printf (_("Auto-loading %s script: %s%s%s\n"),
plugin_name[plugin_type],
dir_name, DIR_SEPARATOR, entry->d_name);
plugin_load (plugin_type, entry->d_name);
@@ -115,6 +119,11 @@ plugin_init ()
wee_perl_init();
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
#endif
#ifdef PLUGIN_PYTHON
wee_python_init();
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
#endif
}
/*
@@ -133,7 +142,9 @@ plugin_load (int plugin_type, char *filename)
#endif
break;
case PLUGIN_TYPE_PYTHON:
/* TODO: load Python script */
#ifdef PLUGIN_PYTHON
wee_python_load (filename);
#endif
break;
case PLUGIN_TYPE_RUBY:
/* TODO: load Ruby script */
@@ -183,6 +194,7 @@ plugin_handler_add (t_plugin_handler **plugin_handlers,
new_plugin_handler->plugin_type = plugin_type;
new_plugin_handler->name = strdup (name);
new_plugin_handler->function_name = strdup (function);
new_plugin_handler->running = 0;
/* add new handler to list */
new_plugin_handler->prev_handler = *last_plugin_handler;
@@ -278,7 +290,7 @@ plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
*/
void
plugin_event_msg (char *irc_command, char *arguments, char *server)
plugin_event_msg (char *irc_command, char *server, char *arguments)
{
#ifdef PLUGINS
t_plugin_handler *ptr_plugin_handler;
@@ -290,7 +302,25 @@ plugin_event_msg (char *irc_command, char *arguments, char *server)
{
#ifdef PLUGIN_PERL
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_perl_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
#ifdef PLUGIN_PYTHON
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_python_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
}
}
@@ -307,7 +337,7 @@ plugin_event_msg (char *irc_command, char *arguments, char *server)
*/
int
plugin_exec_command (char *user_command, char *arguments, char *server)
plugin_exec_command (char *user_command, char *server, char *arguments)
{
#ifdef PLUGINS
t_plugin_handler *ptr_plugin_handler;
@@ -319,7 +349,25 @@ plugin_exec_command (char *user_command, char *arguments, char *server)
{
#ifdef PLUGIN_PERL
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_perl_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
#ifdef PLUGIN_PYTHON
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PYTHON)
{
if (ptr_plugin_handler->running == 0)
{
ptr_plugin_handler->running = 1;
wee_python_exec (ptr_plugin_handler->function_name, server, arguments);
ptr_plugin_handler->running = 0;
}
}
#endif
/* command executed */
@@ -337,6 +385,64 @@ plugin_exec_command (char *user_command, char *arguments, char *server)
return 0;
}
/*
* plugin_find_buffer: find a buffer for text display or command execution
*/
t_gui_buffer *
plugin_find_buffer (char *server, char *channel)
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_gui_buffer *ptr_buffer;
ptr_server = NULL;
ptr_channel = NULL;
ptr_buffer = NULL;
if (server && server[0])
{
ptr_server = server_search (server);
if (!ptr_server)
return NULL;
}
else
{
ptr_server = SERVER(gui_current_window->buffer);
if (!ptr_server)
ptr_server = SERVER(gui_buffers);
}
if (channel && channel[0])
{
if (ptr_server)
{
ptr_channel = channel_search (ptr_server, channel);
if (ptr_channel)
ptr_buffer = ptr_channel->buffer;
}
}
else
{
if (!channel)
{
ptr_buffer = gui_current_window->buffer;
if (ptr_buffer->dcc)
ptr_buffer = gui_buffers;
}
else
{
if (ptr_server)
ptr_buffer = ptr_server->buffer;
}
}
if (!ptr_buffer)
return NULL;
return (ptr_buffer->dcc) ? NULL : ptr_buffer;
}
/*
* plugin_unload: unload all scripts for a plugin type
*/
@@ -358,7 +464,10 @@ plugin_unload (int plugin_type, char *scriptname)
#endif
break;
case PLUGIN_TYPE_PYTHON:
/* TODO: unload Python scripts */
#ifdef PLUGIN_PYTHON
wee_python_end ();
wee_python_init ();
#endif
break;
case PLUGIN_TYPE_RUBY:
/* TODO: unload Ruby scripts */
@@ -383,4 +492,8 @@ plugin_end ()
#ifdef PLUGIN_PERL
wee_perl_end();
#endif
#ifdef PLUGIN_PYTHON
wee_python_end();
#endif
}
+11 -2
View File
@@ -21,6 +21,8 @@
#ifndef __WEECHAT_PLUGINS_H
#define __WEECHAT_PLUGINS_H 1
#include "../gui/gui.h"
#define PLUGIN_TYPE_PERL 0
#define PLUGIN_TYPE_PYTHON 1
#define PLUGIN_TYPE_RUBY 2
@@ -45,6 +47,8 @@ struct t_plugin_handler
char *name; /* name of IRC command (PRIVMSG, ..)
or command (without first '/') */
char *function_name; /* name of function (handler) */
int running; /* 1 if currently running */
/* (used to prevent circular call) */
t_plugin_handler *prev_handler; /* link to previous handler */
t_plugin_handler *next_handler; /* link to next handler */
};
@@ -59,17 +63,22 @@ extern t_plugin_handler *last_plugin_cmd_handler;
extern t_plugin_script *perl_scripts;
#endif
#ifdef PLUGIN_PYTHON
extern t_plugin_script *python_scripts;
#endif
extern void plugin_auto_load (int, char *);
extern void plugin_init ();
extern void plugin_load (int, char *);
extern void plugin_unload (int, /*@null@*/ char *);
extern void plugin_unload (int, char *);
extern t_plugin_handler *plugin_handler_search (t_plugin_handler *, char *);
extern void plugin_handler_add (t_plugin_handler **, t_plugin_handler **,
int, char *, char *);
extern void plugin_handler_free_all_type (t_plugin_handler **,
t_plugin_handler **, int);
extern void plugin_event_msg (char *, char *, char *);
extern int plugin_exec_command (char *, /*@null@*/ char *, char *);
extern int plugin_exec_command (char *, char *, char *);
extern t_gui_buffer *plugin_find_buffer (char *, char *);
extern void plugin_end ();
#endif /* plugins.h */
+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\" $(PYTHON_CFLAGS)
noinst_LIBRARIES = lib_weechat_python.a
lib_weechat_python_a_SOURCES = wee-python.h \
wee-python.c
+688
View File
@@ -0,0 +1,688 @@
/*
* 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-python.c: Python plugin support for WeeChat */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <Python.h>
#include <stdlib.h>
#include <string.h>
#undef _
#include "../../common/weechat.h"
#include "../plugins.h"
#include "wee-python.h"
#include "../../common/command.h"
#include "../../irc/irc.h"
#include "../../gui/gui.h"
t_plugin_script *python_scripts = NULL;
t_plugin_script *last_python_script = NULL;
/*
* weechat.register: startup function for all WeeChat Python scripts
*/
static PyObject *
wee_python_register (PyObject *self, PyObject *args)
{
char *name, *version, *shutdown_func, *description;
t_plugin_script *ptr_python_script, *python_script_found, *new_python_script;
/* make gcc happy */
(void) self;
if (!PyArg_ParseTuple (args, "ssss", &name, &version, &shutdown_func, &description))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "register");
return NULL;
}
python_script_found = NULL;
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)
{
python_script_found = ptr_python_script;
break;
}
}
if (python_script_found)
{
/* error: another scripts 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"),
"Python", name);
}
else
{
/* registering script */
new_python_script = (t_plugin_script *)malloc (sizeof (t_plugin_script));
if (new_python_script)
{
new_python_script->name = strdup (name);
new_python_script->version = strdup (version);
new_python_script->shutdown_func = strdup (shutdown_func);
new_python_script->description = strdup (description);
/* add new script to list */
new_python_script->prev_script = last_python_script;
new_python_script->next_script = NULL;
if (python_scripts)
last_python_script->next_script = new_python_script;
else
python_scripts = new_python_script;
last_python_script = new_python_script;
wee_log_printf (_("Registered %s script: \"%s\", version %s (%s)\n"),
"Python", name, version, description);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to load script \"%s\" (not enough memory)\n"),
"Python", name);
}
}
Py_INCREF (Py_None);
return Py_None;
}
/*
* weechat.print: print message into a buffer (current or specified one)
*/
static PyObject *
wee_python_print (PyObject *self, PyObject *args)
{
char *message, *channel_name, *server_name;
t_gui_buffer *ptr_buffer;
/* make gcc happy */
(void) self;
message = NULL;
channel_name = NULL;
server_name = NULL;
if (!PyArg_ParseTuple (args, "s|ss", &message, &channel_name, &server_name))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "prnt");
return NULL;
}
ptr_buffer = plugin_find_buffer (server_name, channel_name);
if (ptr_buffer)
{
irc_display_prefix (ptr_buffer, PREFIX_PLUGIN);
gui_printf (ptr_buffer, "%s\n", message);
return Py_BuildValue ("i", 1);
}
/* buffer not found */
return Py_BuildValue ("i", 0);
}
/*
* weechat.print_infobar: print message to infobar
*/
static PyObject *
wee_python_print_infobar (PyObject *self, PyObject *args)
{
int delay;
char *message;
/* make gcc happy */
(void) self;
delay = 1;
message = NULL;
if (!PyArg_ParseTuple (args, "is", &delay, &message))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "print_infobar");
return NULL;
}
gui_infobar_printf (delay, COLOR_WIN_INFOBAR, message);
Py_INCREF (Py_None);
return Py_None;
}
/*
* weechat.command: send command to server
*/
static PyObject *
wee_python_command (PyObject *self, PyObject *args)
{
char *command, *channel_name, *server_name;
t_gui_buffer *ptr_buffer;
/* make gcc happy */
(void) self;
command = NULL;
channel_name = NULL;
server_name = NULL;
if (!PyArg_ParseTuple (args, "s|ss", &command, &channel_name, &server_name))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "command");
return NULL;
}
ptr_buffer = plugin_find_buffer (server_name, channel_name);
if (ptr_buffer)
{
user_command (SERVER(ptr_buffer), ptr_buffer, command);
return Py_BuildValue ("i", 1);
}
/* buffer not found */
return Py_BuildValue ("i", 0);
}
/*
* weechat.add_message_handler: add handler for messages
*/
static PyObject *
wee_python_add_message_handler (PyObject *self, PyObject *args)
{
char *message, *function;
/* make gcc happy */
(void) self;
if (!PyArg_ParseTuple (args, "ss", &message, &function))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "add_message_handler");
return NULL;
}
plugin_handler_add (&plugin_msg_handlers, &last_plugin_msg_handler,
PLUGIN_TYPE_PYTHON, message, function);
Py_INCREF (Py_None);
return Py_None;
}
/*
* weechat.add_command_handler: define/redefines commands
*/
static PyObject *
wee_python_add_command_handler(PyObject *self, PyObject *args)
{
char *name, *function;
t_plugin_handler *ptr_plugin_handler;
/* make gcc happy */
(void) self;
if (!PyArg_ParseTuple (args, "ss", &name, &function))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "add_command_handler");
return NULL;
}
if (!weelist_search (index_commands, name))
weelist_add (&index_commands, &last_index_command, name);
ptr_plugin_handler = plugin_handler_search (plugin_cmd_handlers, name);
if (ptr_plugin_handler)
{
free (ptr_plugin_handler->function_name);
ptr_plugin_handler->function_name = strdup (function);
}
else
plugin_handler_add (&plugin_cmd_handlers, &last_plugin_cmd_handler,
PLUGIN_TYPE_PYTHON, name, function);
Py_INCREF (Py_None);
return Py_None;
}
/*
* weechat.get_info: get various infos
*/
static PyObject *
wee_python_get_info (PyObject *self, PyObject *args)
{
char *arg, *info = NULL, *server = NULL;
t_irc_server *ptr_server;
/* make gcc happy */
(void) self;
if (!PyArg_ParseTuple (args, "s|s", &arg, &server))
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: wrong parameters for \"%s\" function\n"),
"Python", "get_info");
return NULL;
}
if (server == NULL)
{
ptr_server = SERVER(gui_current_window->buffer);
}
else
{
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (strcasecmp (ptr_server->name, server) == 0)
break;
}
if (!ptr_server)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: server not found for \"%s\" function\n"),
"Python", "get_info");
}
}
if (ptr_server && arg)
{
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
{
info = PACKAGE_STRING;
}
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
{
if (ptr_server->nick)
info = ptr_server->nick;
}
else if ( (strcasecmp (arg, "2") == 0) || (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) )
{
if (ptr_server->name)
info = ptr_server->name;
}
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
{
info = weechat_home;
}
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
{
return Py_BuildValue ("i", SERVER(gui_current_window->buffer)->is_away);
}
if (info)
return Py_BuildValue ("s", info);
else
return Py_BuildValue ("s", "");
}
return Py_BuildValue ("i", 1);
}
/*
* Python subroutines
*/
static
PyMethodDef weechat_funcs[] = {
{ "register", wee_python_register, METH_VARARGS, "" },
{ "prnt", wee_python_print, METH_VARARGS, "" },
{ "print_infobar", wee_python_print_infobar, METH_VARARGS, "" },
{ "command", wee_python_command, METH_VARARGS, "" },
{ "add_message_handler", wee_python_add_message_handler, METH_VARARGS, "" },
{ "add_command_handler", wee_python_add_command_handler, METH_VARARGS, "" },
{ "get_info", wee_python_get_info, METH_VARARGS, "" },
{ NULL, NULL, 0, NULL }
};
/*
* wee_python_init: initialize Python interface for WeeChat
*/
void
wee_python_init ()
{
Py_Initialize ();
if (Py_IsInitialized () == 0)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s error: error while launching interpreter\n"),
"Python");
}
else
{
wee_log_printf (_("Loading %s module \"weechat\"\n"), "Python");
Py_InitModule ("weechat", weechat_funcs);
if (PyRun_SimpleString (
"import weechat, sys, string\n"
"class weechatStdout:\n"
"\tdef write(self, str):\n"
"\t\tstr = string.strip(str)\n"
"\t\tif str != \"\":\n"
"\t\t\tweechat.prnt(\"Python stdout : \" + str, \"\")\n"
"class weechatStderr:\n"
"\tdef write(self, str):\n"
"\t\tstr = string.strip(str)\n"
"\t\tif str != \"\":\n"
"\t\t\tweechat.prnt(\"Python stderr : \" + str, \"\")\n"
"sys.stdout = weechatStdout()\n"
"sys.stderr = weechatStderr()\n"
) != 0)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL,
_("%s error: error while redirecting stdout and stderr\n"),
"Python");
}
}
}
/*
* wee_python_search: search a (loaded) Python script by name
*/
t_plugin_script *
wee_python_search (char *name)
{
t_plugin_script *ptr_python_script;
for (ptr_python_script = python_scripts; ptr_python_script;
ptr_python_script = ptr_python_script->next_script)
{
if (strcmp (ptr_python_script->name, name) == 0)
return ptr_python_script;
}
/* script not found */
return NULL;
}
/*
* wee_python_exec: execute a Python script
*/
int
wee_python_exec (char *function, char *server, char *arguments)
{
int len, return_code, i, j, alen;
char *srv, *args, *runstring;
return_code = 1;
if (arguments == NULL)
{
alen = 0;
args = strdup ("");
}
else
{
alen = (int) strlen (arguments);
args = (char *) malloc ( 2 * alen * sizeof (*args));
}
if (!args)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to run function \"%s\" in script (not enough memory)\n"),
"Python", function);
return 0;
}
// copy arguments in args to escape double quotes
j = 0;
for (i=0; i < alen; ++i)
{
if (arguments[i] == '"' || arguments[i] == '\\')
{
args[j] = '\\';
++j;
}
args[j] = arguments[i];
++j;
}
args[j] = 0;
if (server == NULL)
srv = strdup ("");
else
srv = strdup (server);
if (!srv)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to run function \"%s\" in script (not enough memory)\n"),
"Python", function);
free (args);
return 0;
}
len = (int) strlen (function);
len += (int) strlen ("(\"\",\"\")");
len += (int) strlen (srv);
len += (int) strlen (args);
len += 1;
runstring = (char *) malloc ( len * sizeof (*runstring));
if (runstring)
{
sprintf (runstring, "%s(\"%s\",\"%s\")", function, srv, args);
if (PyRun_SimpleString (runstring) != 0)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: error while running function \"%s\"\n"),
"Python", function);
return_code = 0;
}
free (runstring);
}
else
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: unable to run function \"%s\" in script (not enough memory)\n"),
"Python", function);
return_code = 0;
}
free (args);
free (srv);
return return_code;
}
/*
* wee_python_load: load a Python script
*/
int
wee_python_load (char *filename)
{
FILE *fp;
/* execute Python script */
wee_log_printf (_("Loading %s script \"%s\"\n"), "Python", filename);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Loading %s script \"%s\"\n"), "Python", filename);
if ((fp = fopen (filename, "r")) == NULL)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: error while opening file \"%s\"\n"),
"Python", filename);
return 1;
}
if (PyRun_SimpleFile (fp, filename) != 0)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s error: error while parsing file \"%s\"\n"),
"Python", filename);
return 1;
}
fclose (fp);
return 0;
}
/*
* wee_python_script_free: free a Python script
*/
void
wee_python_script_free (t_plugin_script *ptr_python_script)
{
t_plugin_script *new_python_scripts;
/* remove script from list */
if (last_python_script == ptr_python_script)
last_python_script = ptr_python_script->prev_script;
if (ptr_python_script->prev_script)
{
(ptr_python_script->prev_script)->next_script = ptr_python_script->next_script;
new_python_scripts = python_scripts;
}
else
new_python_scripts = ptr_python_script->next_script;
if (ptr_python_script->next_script)
(ptr_python_script->next_script)->prev_script = ptr_python_script->prev_script;
/* free data */
if (ptr_python_script->name)
free (ptr_python_script->name);
if (ptr_python_script->version)
free (ptr_python_script->version);
if (ptr_python_script->shutdown_func)
free (ptr_python_script->shutdown_func);
if (ptr_python_script->description)
free (ptr_python_script->description);
free (ptr_python_script);
python_scripts = new_python_scripts;
}
/*
* wee_python_unload: unload a Python script
*/
void
wee_python_unload (t_plugin_script *ptr_python_script)
{
if (ptr_python_script)
{
wee_log_printf (_("Unloading %s script \"%s\"\n"),
"Python", ptr_python_script->name);
/* call shutdown callback function */
if (ptr_python_script->shutdown_func[0])
wee_python_exec (ptr_python_script->shutdown_func, "", "");
wee_python_script_free (ptr_python_script);
}
}
/*
* wee_python_unload_all: unload all Python scripts
*/
void
wee_python_unload_all ()
{
wee_log_printf (_("Unloading all %s scripts...\n"), "Python");
while (python_scripts)
wee_python_unload (python_scripts);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s scripts unloaded\n"), "Python");
}
/*
* wee_python_end: shutdown Python interface
*/
void
wee_python_end ()
{
/* unload all scripts */
wee_python_unload_all ();
/* free all handlers */
plugin_handler_free_all_type (&plugin_msg_handlers,
&last_plugin_msg_handler,
PLUGIN_TYPE_PYTHON);
plugin_handler_free_all_type (&plugin_cmd_handlers,
&last_plugin_cmd_handler,
PLUGIN_TYPE_PYTHON);
/* free Python interpreter */
Py_Finalize ();
if (Py_IsInitialized () != 0)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("%s error: error while freeing interpreter\n"),
"Python");
}
}
+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_PYTHON_H
#define __WEECHAT_PYTHON_H 1
#include "../plugins.h"
extern void wee_python_init ();
extern t_plugin_script *wee_python_search (char *);
extern int wee_python_exec (char *, char *, char *);
extern int wee_python_load (char *);
extern void wee_python_unload (t_plugin_script *);
extern void wee_python_unload_all ();
extern void wee_python_end ();
#endif /* wee-python.h */
+11 -7
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "February 2005" "FlashCode"
.TH WEECHAT 1 "July 2005" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
@@ -27,6 +27,10 @@ display config file help (list of options)
.br
display summary of options
.TP
.B \-i, \-\-irc\-commands
.br
display IRC commands
.TP
.B \-l, \-\-license
.br
display program license
@@ -34,12 +38,16 @@ display program license
.B \-v, \-\-version
.br
display WeeChat version
.TP
.B \-w, \-\-weechat\-commands
.br
display WeeChat commands
.SH URL
WeeChat can use an URL (Uniform Resource Locator) to automatically connect
to an IRC server. These are in the following form:
.TP
.B irc://[[nickname][:password]@]server[:port][/[#&+!]channel]
.B irc[6][s]://[[nickname][:password]@]server[:port][/[#&+!]channel[,channel...]]
.TP
Exemple to join WeeChat channel support with nick "FlashCode":
irc://FlashCode@irc.freenode.net/weechat
@@ -53,11 +61,7 @@ configuration file for WeeChat
WeeChat log file
.SH AUTHOR
WeeChat is written by:
.br
- FlashCode <flashcode@flashtux.org>
- Bounga <bounga@altern.org>
- Xahlexx <xahlexx@weeland.org>
WeeChat is written by FlashCode <flashcode@flashtux.org>
.br
WeeChat on the web:
.UR
+7 -3
View File
@@ -1,5 +1,5 @@
%define name weechat
%define version 0.1.1
%define version 0.1.3
%define release 1
Name: %{name}
@@ -10,7 +10,7 @@ Source: http://weechat.flashtux.org/download/%{name}-%{version}.tar.gz
URL: http://weechat.flashtux.org
Group: Networking/IRC
BuildRoot: %{_tmppath}/%{name}-buildroot
Requires: perl
Requires: perl, python, libgnutls
License: GPL
%description
@@ -23,7 +23,7 @@ rm -rf $RPM_BUILD_ROOT
%setup
%build
./configure --enable-perl
./configure --enable-perl --enable-python
make DESTDIR="$RPM_BUILD_ROOT" LOCALRPM="local"
%install
@@ -41,6 +41,10 @@ rm -rf $RPM_BUILD_ROOT
/usr/local/bin/weechat-curses
%changelog
* Sat Jul 02 2005 FlashCode <flashcode@flashtux.org> 0.1.3-1
- Released version 0.1.3
* Sat May 21 2005 FlashCode <flashcode@flashtux.org> 0.1.2-1
- Released version 0.1.2
* Sat Mar 20 2005 FlashCode <flashcode@flashtux.org> 0.1.1-1
- Released version 0.1.1
* Sat Feb 12 2005 FlashCode <flashcode@flashtux.org> 0.1.0-1
+996
View File
@@ -0,0 +1,996 @@
1 Notes on the Free Translation Project
***************************************
Free software is going international! The Free Translation Project is
a way to get maintainers of free software, translators, and users all
together, so that free software will gradually become able to speak many
languages. A few packages already provide translations for their
messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work on translations can contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
1.1 Quick configuration advice
==============================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias, message inheritance, automatic
charset conversion or plural form handling) as the implementation here.
It is also not possible to offer this additional functionality on top
of a `catgets' implementation. Future versions of GNU `gettext' will
very likely convey even more functionality. So it might be a good idea
to change to GNU `gettext' as soon as possible.
So you need _not_ provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
1.2 INSTALL Matters
===================
Some packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU `gettext'. Other packages have their own ways to
internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. If not, the included GNU
`gettext' library will be used. This library is wholly contained
within this package, usually in the `intl/' subdirectory, so prior
installation of the GNU `gettext' package is _not_ required.
Installers may use special options at configuration time for changing
the default behaviour. The commands:
./configure --with-included-gettext
./configure --disable-nls
will, respectively, bypass any pre-existing `gettext' to use the
internationalizing routines provided within this package, or else,
_totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might not be desirable. You should use
the more recent version of the GNU `gettext' library. I.e. if the file
`intl/VERSION' shows that the library which comes with this package is
more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
Internationalized packages usually have many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
1.3 Using This Package
======================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
and `CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your country by running the command
`locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
Special advice for Norwegian users: The language code for Norwegian
bokma*l changed from `no' to `nb' recently (in 2003). During the
transition period, while some message catalogs for this language are
installed under `nb' and some older ones under `no', it's recommended
for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
older translations are used.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
1.4 Translating Teams
=====================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skill are praised more than
programming skill, here.
1.5 Available Packages
======================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of May 2005.
The matrix shows, in regard of each package, for which languages PO
files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB
+-------------------------------------------------+
GNUnet | |
a2ps | [] [] [] [] [] |
aegis | () |
ant-phone | () |
anubis | [] |
ap-utils | |
aspell | [] [] [] [] |
bash | [] [] |
batchelor | [] |
bfd | |
bibshelf | [] |
binutils | [] |
bison | [] [] |
bluez-pin | [] [] [] [] |
clisp | [] [] |
console-tools | [] [] |
coreutils | [] [] [] [] |
cpio | |
cpplib | [] [] [] |
darkstat | [] () [] |
dialog | [] [] [] [] [] [] |
diffutils | [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] [] |
fetchmail | [] [] () [] |
fileutils | [] [] |
findutils | [] [] [] |
flex | [] [] [] |
fslint | [] |
gas | |
gawk | [] [] [] |
gbiff | [] |
gcal | [] |
gcc | [] |
gettext-examples | [] [] [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] [] [] |
gip | |
gliv | [] |
glunarclock | |
gmult | [] [] |
gnubiff | () |
gnucash | [] () () [] |
gnucash-glossary | [] () |
gpe-aerial | [] [] |
gpe-beam | [] [] |
gpe-calendar | [] [] |
gpe-clock | [] [] |
gpe-conf | [] [] |
gpe-contacts | |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] |
gpsdrive | () () |
gramadoir | [] [] |
grep | [] [] [] [] [] [] |
gretl | |
gsasl | [] |
gss | |
gst-plugins | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] () |
gtkspell | [] [] [] |
hello | [] [] [] [] |
id-utils | [] [] |
impost | |
indent | [] [] |
iso_3166 | |
iso_3166_1 | [] [] [] [] [] |
iso_3166_2 | |
iso_3166_3 | [] |
iso_4217 | |
iso_639 | |
jpilot | [] |
jtag | |
jwhois | |
kbd | [] [] [] [] |
latrine | () |
ld | [] |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] [] [] |
libgphoto2 | [] |
libgphoto2_port | [] |
libgsasl | |
libiconv | [] [] [] [] [] |
libidn | |
lifelines | [] () |
lilypond | [] |
lingoteach | |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | [] |
make | [] [] |
man-db | [] () [] [] |
minicom | [] [] |
mysecretdiary | [] [] |
nano | [] () [] |
nano_1_0 | [] () [] [] |
opcodes | [] |
parted | [] [] [] [] |
psmisc | |
ptx | [] [] [] |
pwdutils | |
python | |
radius | [] |
recode | [] [] [] [] [] |
rpm | [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] [] [] |
sed | [] [] |
sh-utils | [] [] |
shared-mime-info | [] [] |
sharutils | [] [] [] [] [] |
silky | |
skencil | [] () |
sketch | [] () |
solfege | [] |
soundtracker | [] [] |
sp | [] |
stardict | [] |
tar | |
texinfo | [] [] |
textutils | [] [] [] |
tin | () () |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] [] |
vorbis-tools | [] [] [] [] |
wastesedge | () |
wdiff | [] [] [] [] |
wget | |
xchat | [] [] [] [] [] |
xkeyboard-config | |
xpad | |
+-------------------------------------------------+
af am ar az be bg bs ca cs cy da de el en en_GB
10 0 0 2 7 5 0 40 43 2 51 91 19 1 14
eo es et eu fa fi fr ga gl he hi hr hu id is
+-----------------------------------------------+
GNUnet | |
a2ps | [] [] [] |
aegis | |
ant-phone | [] |
anubis | [] |
ap-utils | [] |
aspell | [] [] |
bash | [] [] [] [] |
batchelor | [] [] |
bfd | [] |
bibshelf | [] [] |
binutils | [] [] |
bison | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] |
clisp | [] [] |
console-tools | |
coreutils | [] [] [] [] [] |
cpio | [] [] |
cpplib | [] [] |
darkstat | [] () [] [] [] |
dialog | [] [] [] [] [] [] [] |
diffutils | [] [] [] [] [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] |
error | [] [] [] [] [] |
fetchmail | [] |
fileutils | [] [] [] [] [] |
findutils | [] [] [] [] |
flex | [] [] [] |
fslint | [] |
gas | [] [] |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] [] |
gcc | [] |
gettext-examples | [] [] [] |
gettext-runtime | [] [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] |
gip | [] [] [] |
gliv | () |
glunarclock | [] [] [] |
gmult | [] [] |
gnubiff | () |
gnucash | [] () |
gnucash-glossary | [] |
gpe-aerial | [] [] |
gpe-beam | [] [] |
gpe-calendar | [] [] [] [] |
gpe-clock | [] [] [] |
gpe-conf | [] |
gpe-contacts | [] |
gpe-edit | [] [] |
gpe-go | [] [] |
gpe-login | [] [] [] |
gpe-ownerinfo | [] [] [] [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] [] |
gpe-taskmanager | [] [] [] |
gpe-timesheet | [] [] [] [] |
gpe-today | [] [] [] [] |
gpe-todo | [] [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] |
gpsdrive | () () [] |
gramadoir | [] [] |
grep | [] [] [] [] [] [] [] [] [] [] [] |
gretl | [] [] |
gsasl | [] [] [] |
gss | [] |
gst-plugins | [] [] |
gstreamer | |
gtick | [] [] [] [] |
gtkspell | [] [] [] [] [] |
hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] |
impost | [] [] |
indent | [] [] [] [] [] [] [] [] [] [] |
iso_3166 | [] [] [] |
iso_3166_1 | [] [] [] [] [] [] [] |
iso_3166_2 | [] |
iso_3166_3 | [] |
iso_4217 | [] [] [] |
iso_639 | [] [] [] [] |
jpilot | [] [] |
jtag | [] |
jwhois | [] [] [] [] |
kbd | [] [] |
latrine | [] [] |
ld | [] [] |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] [] [] [] [] |
libgphoto2 | [] [] [] |
libgphoto2_port | [] |
libgsasl | [] [] |
libiconv | [] [] [] [] [] [] [] [] [] [] |
libidn | [] [] |
lifelines | () |
lilypond | |
lingoteach | [] [] |
lynx | [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] [] [] [] [] |
man-db | () |
minicom | [] [] [] [] |
mysecretdiary | [] [] [] |
nano | [] [] () [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] |
psmisc | [] |
ptx | [] [] [] [] [] [] [] [] [] |
pwdutils | |
python | |
radius | [] [] |
recode | [] [] [] [] [] [] [] |
rpm | [] |
screem | |
scrollkeeper | [] [] [] |
sed | [] [] [] [] [] [] |
sh-utils | [] [] [] [] [] [] |
shared-mime-info | [] [] [] [] [] [] |
sharutils | [] [] [] [] [] [] |
silky | [] |
skencil | [] [] |
sketch | [] [] |
solfege | |
soundtracker | [] [] |
sp | [] |
stardict | [] |
tar | [] [] [] [] |
texinfo | [] [] [] |
textutils | [] [] [] [] [] |
tin | [] () |
tp-robot | [] [] |
tuxpaint | [] [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | [] [] |
util-linux | [] [] [] [] [] |
vorbis-tools | [] [] |
wastesedge | () |
wdiff | [] [] [] [] [] [] [] |
wget | [] [] [] [] |
xchat | [] [] [] [] [] |
xkeyboard-config | |
xpad | [] [] [] |
+-----------------------------------------------+
eo es et eu fa fi fr ga gl he hi hr hu id is
15 85 21 15 2 35 115 45 16 8 1 6 40 27 1
it ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
+--------------------------------------------------+
GNUnet | |
a2ps | () () [] [] () |
aegis | () |
ant-phone | [] |
anubis | [] [] [] |
ap-utils | |
aspell | [] [] |
bash | [] |
batchelor | [] |
bfd | |
bibshelf | [] |
binutils | |
bison | [] [] [] [] |
bluez-pin | [] [] |
clisp | [] |
console-tools | |
coreutils | [] [] |
cpio | |
cpplib | [] |
darkstat | [] [] |
dialog | [] [] |
diffutils | [] [] [] [] |
doodle | [] |
e2fsprogs | [] |
enscript | [] |
error | [] |
fetchmail | [] [] |
fileutils | [] [] [] |
findutils | [] [] |
flex | [] [] |
fslint | [] |
gas | |
gawk | [] [] |
gbiff | [] |
gcal | |
gcc | |
gettext-examples | [] [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] [] [] |
gimp-print | [] [] |
gip | [] |
gliv | [] |
glunarclock | [] [] |
gmult | [] [] |
gnubiff | () |
gnucash | [] () () [] |
gnucash-glossary | [] [] |
gpe-aerial | [] |
gpe-beam | [] |
gpe-calendar | [] |
gpe-clock | [] |
gpe-conf | [] |
gpe-contacts | |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] |
gpe-ownerinfo | [] |
gpe-sketchbook | [] |
gpe-su | [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] |
gpe-todo | [] |
gphoto2 | [] [] [] |
gprof | |
gpsdrive | () () () () |
gramadoir | () |
grep | [] [] [] [] |
gretl | [] |
gsasl | [] |
gss | |
gst-plugins | [] [] |
gstreamer | [] [] |
gtick | [] [] |
gtkspell | [] [] [] |
hello | [] [] [] [] [] [] [] [] [] |
id-utils | [] [] |
impost | |
indent | [] [] [] |
iso_3166 | [] |
iso_3166_1 | [] [] |
iso_3166_2 | [] |
iso_3166_3 | [] |
iso_4217 | [] [] [] |
iso_639 | [] [] [] |
jpilot | () () () |
jtag | |
jwhois | [] [] |
kbd | [] |
latrine | [] [] |
ld | |
libc | [] [] [] [] [] |
libextractor | |
libgpewidget | [] |
libgphoto2 | [] [] |
libgphoto2_port | [] [] |
libgsasl | [] |
libiconv | [] [] |
libidn | [] |
lifelines | [] |
lilypond | |
lingoteach | [] [] |
lynx | [] [] [] |
m4 | [] [] |
mailutils | |
make | [] [] [] |
man-db | () |
minicom | [] |
mysecretdiary | [] |
nano | [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] |
parted | [] [] [] [] |
psmisc | [] [] [] |
ptx | [] [] [] |
pwdutils | |
python | |
radius | |
recode | [] [] |
rpm | [] [] |
screem | [] |
scrollkeeper | [] [] [] |
sed | [] [] |
sh-utils | [] [] [] |
shared-mime-info | [] [] [] [] |
sharutils | [] [] [] |
silky | [] |
skencil | |
sketch | |
solfege | [] [] [] |
soundtracker | [] |
sp | () |
stardict | [] [] |
tar | [] [] [] |
texinfo | [] [] [] |
textutils | [] [] [] |
tin | |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] |
vorbis-tools | [] |
wastesedge | [] |
wdiff | [] [] [] |
wget | [] |
xchat | [] [] [] [] [] |
xkeyboard-config | [] |
xpad | [] |
+--------------------------------------------------+
it ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
46 35 11 2 1 1 2 2 3 11 0 15 96 7 5 0
or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv
+----------------------------------------------+
GNUnet | |
a2ps | () [] [] [] [] [] [] |
aegis | () () |
ant-phone | [] |
anubis | [] [] [] |
ap-utils | () |
aspell | [] [] |
bash | [] [] [] |
batchelor | [] |
bfd | |
bibshelf | |
binutils | [] [] |
bison | [] [] [] [] [] |
bluez-pin | [] [] [] [] [] [] [] [] |
clisp | [] |
console-tools | [] |
coreutils | [] [] [] [] |
cpio | [] [] |
cpplib | |
darkstat | [] [] [] [] [] [] |
dialog | [] [] [] [] [] [] [] |
diffutils | [] [] [] [] [] [] |
doodle | [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] |
fetchmail | [] [] [] [] |
fileutils | [] [] [] [] [] |
findutils | [] [] [] [] [] [] |
flex | [] [] [] [] [] |
fslint | [] [] [] |
gas | |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] |
gcc | |
gettext-examples | [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] [] [] |
gimp-print | [] [] |
gip | [] [] [] |
gliv | [] [] [] |
glunarclock | [] [] [] [] [] [] |
gmult | [] [] [] [] |
gnubiff | () [] |
gnucash | () [] [] [] [] |
gnucash-glossary | [] [] [] |
gpe-aerial | [] [] [] [] [] [] |
gpe-beam | [] [] [] [] [] [] |
gpe-calendar | [] [] [] [] [] [] [] |
gpe-clock | [] [] [] [] [] [] [] |
gpe-conf | [] [] [] [] [] [] |
gpe-contacts | [] [] [] [] |
gpe-edit | [] [] [] [] [] [] [] |
gpe-go | [] [] [] [] [] |
gpe-login | [] [] [] [] [] [] [] |
gpe-ownerinfo | [] [] [] [] [] [] [] |
gpe-sketchbook | [] [] [] [] [] [] [] |
gpe-su | [] [] [] [] [] [] [] |
gpe-taskmanager | [] [] [] [] [] [] [] |
gpe-timesheet | [] [] [] [] [] [] [] |
gpe-today | [] [] [] [] [] [] [] |
gpe-todo | [] [] [] [] [] [] [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] |
gpsdrive | [] [] |
gramadoir | [] |
grep | [] [] [] [] [] [] [] |
gretl | [] |
gsasl | [] [] [] [] [] |
gss | [] [] [] |
gst-plugins | [] [] [] [] |
gstreamer | [] [] [] [] |
gtick | [] [] [] |
gtkspell | [] [] [] [] [] [] |
hello | [] [] [] [] [] [] [] |
id-utils | [] [] [] [] |
impost | |
indent | [] [] [] [] [] [] |
iso_3166 | [] [] [] [] [] |
iso_3166_1 | [] [] [] [] |
iso_3166_2 | |
iso_3166_3 | [] [] [] |
iso_4217 | [] [] |
iso_639 | [] [] [] |
jpilot | |
jtag | [] |
jwhois | [] [] [] () () |
kbd | [] [] [] |
latrine | [] [] |
ld | [] |
libc | [] [] [] [] [] |
libextractor | [] |
libgpewidget | [] [] [] [] [] [] |
libgphoto2 | [] [] |
libgphoto2_port | [] |
libgsasl | [] [] [] |
libiconv | [] [] [] [] [] [] [] [] [] [] |
libidn | [] () |
lifelines | [] [] |
lilypond | |
lingoteach | [] |
lynx | [] [] [] |
m4 | [] [] [] [] [] |
mailutils | [] [] [] |
make | [] [] [] [] |
man-db | [] [] |
minicom | [] [] [] [] |
mysecretdiary | [] [] [] [] |
nano | [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
psmisc | [] [] |
ptx | [] [] [] [] [] [] |
pwdutils | [] |
python | |
radius | [] [] |
recode | [] [] [] [] [] [] |
rpm | [] [] [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] [] |
sed | [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] |
shared-mime-info | [] [] [] [] [] [] |
sharutils | [] [] [] |
silky | [] |
skencil | [] [] [] |
sketch | [] [] [] |
solfege | |
soundtracker | [] [] |
sp | |
stardict | [] [] |
tar | [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] |
tin | |
tp-robot | [] |
tuxpaint | [] [] [] [] [] [] [] [] |
unicode-han-tra... | |
unicode-transla... | |
util-linux | [] [] [] |
vorbis-tools | [] [] |
wastesedge | |
wdiff | [] [] [] [] [] [] |
wget | |
xchat | [] [] [] [] [] [] [] |
xkeyboard-config | |
xpad | |
+----------------------------------------------+
or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv
1 3 47 29 57 6 78 73 5 44 12 12 50 85
ta tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
+-----------------------------------------------+
GNUnet | | 0
a2ps | [] [] [] | 19
aegis | | 0
ant-phone | [] [] | 5
anubis | [] [] [] | 11
ap-utils | () [] | 2
aspell | [] [] [] | 13
bash | [] | 11
batchelor | [] [] | 7
bfd | | 1
bibshelf | [] | 5
binutils | [] | 6
bison | [] [] | 18
bluez-pin | [] [] [] [] [] | 25
clisp | | 7
console-tools | [] [] | 5
coreutils | [] [] | 17
cpio | [] [] [] | 7
cpplib | [] [] | 8
darkstat | [] () () | 15
dialog | [] [] [] | 25
diffutils | [] [] [] [] | 28
doodle | [] | 5
e2fsprogs | [] | 8
enscript | [] | 12
error | [] [] [] | 16
fetchmail | [] | 12
fileutils | [] [] [] | 18
findutils | [] [] | 17
flex | [] [] | 15
fslint | [] | 7
gas | [] | 3
gawk | [] | 14
gbiff | [] | 5
gcal | [] | 5
gcc | [] [] | 4
gettext-examples | [] [] [] [] [] | 21
gettext-runtime | [] [] [] [] [] | 25
gettext-tools | [] [] [] [] [] | 19
gimp-print | [] | 11
gip | [] | 8
gliv | [] [] | 7
glunarclock | [] [] | 13
gmult | [] [] [] | 13
gnubiff | [] | 3
gnucash | () [] | 10
gnucash-glossary | [] [] | 9
gpe-aerial | [] [] | 13
gpe-beam | [] [] | 13
gpe-calendar | [] [] [] [] | 18
gpe-clock | [] [] [] [] | 17
gpe-conf | [] [] | 12
gpe-contacts | [] [] | 7
gpe-edit | [] [] [] [] | 15
gpe-go | [] [] | 11
gpe-login | [] [] [] [] [] | 18
gpe-ownerinfo | [] [] [] [] | 19
gpe-sketchbook | [] [] | 14
gpe-su | [] [] [] | 16
gpe-taskmanager | [] [] [] | 17
gpe-timesheet | [] [] [] [] | 17
gpe-today | [] [] [] [] [] | 19
gpe-todo | [] [] [] | 17
gphoto2 | [] [] [] | 18
gprof | [] [] | 10
gpsdrive | | 3
gramadoir | [] | 6
grep | [] [] [] [] | 32
gretl | | 4
gsasl | [] [] | 12
gss | [] | 5
gst-plugins | [] [] [] | 17
gstreamer | [] [] [] [] | 15
gtick | [] | 11
gtkspell | [] [] [] [] | 21
hello | [] [] [] [] | 37
id-utils | [] [] | 13
impost | [] | 3
indent | [] [] [] [] | 25
iso_3166 | [] [] [] | 12
iso_3166_1 | [] [] | 20
iso_3166_2 | | 2
iso_3166_3 | [] [] | 8
iso_4217 | [] [] | 10
iso_639 | [] [] | 12
jpilot | [] [] [] | 6
jtag | | 2
jwhois | [] [] [] | 12
kbd | [] [] | 12
latrine | [] [] | 8
ld | [] | 5
libc | [] [] | 22
libextractor | | 1
libgpewidget | [] [] | 17
libgphoto2 | [] | 9
libgphoto2_port | | 5
libgsasl | [] | 7
libiconv | [] [] [] [] [] | 32
libidn | [] [] | 6
lifelines | | 4
lilypond | | 1
lingoteach | [] | 6
lynx | [] [] [] | 15
m4 | [] [] | 17
mailutils | [] | 7
make | [] [] | 18
man-db | | 5
minicom | | 11
mysecretdiary | [] [] | 12
nano | [] [] | 13
nano_1_0 | [] [] [] | 18
opcodes | [] [] | 9
parted | [] [] [] | 18
psmisc | [] | 7
ptx | [] [] | 23
pwdutils | | 1
python | | 0
radius | [] | 6
recode | [] [] | 22
rpm | [] [] | 11
screem | | 1
scrollkeeper | [] [] [] | 24
sed | [] [] [] | 21
sh-utils | [] | 15
shared-mime-info | [] [] [] | 21
sharutils | [] [] [] | 20
silky | | 3
skencil | | 6
sketch | | 6
solfege | | 4
soundtracker | [] | 8
sp | [] | 3
stardict | [] [] [] [] | 10
tar | [] [] [] [] | 15
texinfo | [] [] | 14
textutils | [] [] [] | 17
tin | | 1
tp-robot | [] [] [] | 8
tuxpaint | [] [] [] [] | 34
unicode-han-tra... | | 0
unicode-transla... | | 2
util-linux | [] [] [] | 18
vorbis-tools | [] | 10
wastesedge | | 1
wdiff | [] [] | 22
wget | [] [] | 7
xchat | [] [] [] [] | 26
xkeyboard-config | [] | 2
xpad | [] | 5
+-----------------------------------------------+
73 teams ta tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
149 domains 0 0 0 1 77 30 0 92 16 0 42 32 0 1746
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If May 2005 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
1.6 Using `gettext' in new packages
===================================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
the translation teams.
+27 -9
View File
@@ -1,16 +1,34 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
Developer:
---------
Developers:
----------
* General code
FlashCode <flashcode@flashtux.org>
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
* Python plugin
Kolter <kolter@free.fr>
Web : http://kolter.free.fr
IRC : nick is "kolter" @ irc.freenode.net
Jabber: kolter@jabber.org
Debian packager:
---------------
Julien Louis <ptitlouis@sysif.net>
IRC : nicks are "ptitlouis" or "tioui" @ irc.freenode.net
Jabber: ptitlouis@amessage.info
FlashCode <flashcode@flashtux.org>
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
Testers:
-------
+1 -4
View File
@@ -1,12 +1,9 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2005-02-12
WeeChat known bugs, 2005-05-21
- ./configure does not check that Curses headers are installed
- ./configure does not check that Gtk 2.0 libraries are installed
- ./configure does not check that Perl headers & libraries are installed
- too much nicks in the channel (> height of window) => some nicks are hidden
- 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
+38 -1
View File
@@ -1,9 +1,46 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-03-20
ChangeLog - 2005-06-30
Version 0.1.3 (2005-07-02):
* proxy support (http, socks4, socks5) with authentification (http, socks5)
and ipv6 support (client to proxy)
* completion added for config option (with /set command)
* commands from users outside channel now authorized (if special user or
channel without "n" flag)
* added IPv6 support
* kill command now received and displayed
* added SSL support
* channel notify levels are saved in config file (new option
"server_notify_levels" for server sections)
* part message now accepts %v (replaced by WeeChat version), like quit message
* errors while loading perl scripts are now displayed in server buffer
(instead of current buffer)
* in python scripts, all messages written in stdin and stderr are redirected
in server buffer
* fix a filename error while loading a python script manually
* fixed plugins "print" and "prnt" functions: now ok for writing on server
buffers
* fixed color problem with new libcurses version
* fixed crash when using Alt-S or Alt-X on DCC buffer (Alt-D)
* fixed startup crash when config file (~/.weechat/weechat.rc) is not found
* improved Perl/Python libs detection for ./configure script
Version 0.1.2 (2005-05-21):
* added Python plugin support, improved Perl interface (and now Perl/Python
libraries are checked by configure script)
* added nicklist scroll keys (Alt+{home/end/pgup/pgdn} or F11/F12)
* added transfer rate for DCC files
* added "-all" option for /nick command
* buffers timestamp can now be changed (new option in config file)
* WeeChat now ok under *BSD and Mac OS X
* fixed nicklist sort
* fixed crash when purging old DCC
* fixed crash with 64-bits arch (like AMD64) when converting UTF-8
* added missing IRC commands (307, 341, 485, 671)
Version 0.1.1 (2005-03-20):
* added nicks count for channel buffers
* added FIFO pipe for remote control
+37 -13
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-02-06
WeeChat FAQ, 2005-05-21
=======================
Intended audience:
@@ -22,8 +22,10 @@ finding a solution.
Q: I heard about many GUI for WeeChat. How can I compile/use them?
A: Curses GUI is built by default.
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
To build Gtk, wxWidgets or Qt GUI you've to specify extra options to
./configure script:
--enable-gtk to enable Gtk GUI
--enable-wxwidgets to enable wxWidgets GUI
--enable-qt to enable Qt QUI
Type ./configure --help to see available options.
WARNING: only Curses GUI is ok today. Other GUI are under development!
@@ -34,8 +36,8 @@ A: Curses GUI is built by default.
Q: I can't compile WeeChat CVS.
A: Check that you have latest version of autoconf and automake.
WeeChat has been developed with autoconf version 2.56 and automake
version 1.7.
WeeChat has been developed with autoconf version 2.59 and automake
version 1.9.5.
You should have at least these versions in order to compile WeeChat CVS.
If you can't or don't want to install these versions, you can download and
install "devel package", a package built almost every day, based on CVS.
@@ -48,12 +50,14 @@ Q: Why using WeeChat ? X-Chat and Irssi are so good...
A: Because WeeChat is very light and has new features.
Some new features:
* many GUI (Curses, Gtk, Qt),
* many GUI (Curses, Gtk, wxWidgets, Qt),
* extensible with scripts (Perl, Python, Ruby),
* developed from scratch (not based on any other IRC client)
* multi-platform
* 100% GPL and free
This is the "geekest" IRC client ;)
More info on this page: http://weechat.flashtux.org/features.php
2.2
@@ -61,6 +65,7 @@ A: Because WeeChat is very light and has new features.
Q: I've launched WeeChat, but I'm lost, what can I do?
A: For help you can type /help. For help about a command, type /help command.
Keys and commands are listed in documentation.
2.3
@@ -86,19 +91,23 @@ A: Today you can't do that. This is planed for a future version.
Q: How can I load Perl scripts?
Are Perl scripts compatible with X-chat or/and Irssi ?
A: You can use /perl command to load scripts
(default path is ~/.weechat/perl).
A: You can use /perl command to load scripts (default path is
~/.weechat/perl).
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
when WeeChat is starting up.
WeeChat perl scripts are compatible with X-Chat, but not with Irssi,
sorry ;)
WeeChat Perl scripts are 80% compatible with X-Chat, but not with Irssi.
2.6
================================================================================
Q: How can I load Python scripts?
Are Python scripts compatible with X-chat or/and Irssi ?
A: Today Python interface is not developed, so you can't load any Python script.
A: You can use /python command to load scripts (default path is
~/.weechat/python).
Note that scripts in ~/.weechat/python/autoload are automatically loaded
when WeeChat is starting up.
WeeChat Python scripts are 80% compatible with X-Chat, but not with Irssi.
2.7
@@ -148,13 +157,27 @@ A: There is 2 ways to submit your feature request:
3.4
================================================================================
Q: Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
Q: What is the list of supported platforms for WeeChat?
A: Yes. Future versions will be available for these OS.
A: Today WeeChat was succesfully tested on these platforms:
- GNU/Linux (any distribution / i386, AMD64, Sparc)
- FreeBSD
- NetBSD
- OpenBSD
- Mac OS X
- Microsoft Windows (with Cygwin and some code changes)
3.5
================================================================================
Q: Will WeeChat be ported to QNX or other operating systems?
A: Yes. Future versions will be available for these OS.
We need help for such systems, any help is welcome :)
3.6
================================================================================
Q: I want to help WeeChat developers. What can I do?
A: There's many tasks to do (code, documentation, ...)
@@ -162,8 +185,9 @@ A: There's many tasks to do (code, documentation, ...)
http://weechat.flashtux.org/support.php
3.6
3.7
================================================================================
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 :)
+38 -15
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2005-02-06
WeeChat FAQ, 2005-05-21
=======================
Public concerné :
@@ -23,9 +23,10 @@ Q: J'ai entendu parler de plusieurs interfaces pour WeeChat.
Comment puis-je les compiler/utiliser ?
R: L'interface Curses est construite par défaut.
Pour construire l'interface Gtk ou Qt, vous devez spécifier des options
pour le script ./configure :
Pour construire l'interface Gtk, wxWidgets ou Qt, vous devez spécifier des
options pour le script ./configure :
--enable-gtk pour activer l'interface Gtk
--enable-wxwidgets pour activer l'interface wxWidgets
--enable-qt pour activer l'interface Qt
Tapez ./configure --help pour voir les options disponibles.
ATTENTION : seule l'interface Curses est ok aujourd'hui.
@@ -37,8 +38,8 @@ R: L'interface Curses est construite par d
Q: Je ne peux pas compiler le CVS WeeChat.
R: Vérifiez que vous avez bien la dernière version d'autoconf et automake.
WeeChat a été développé avec autoconf version 2.56 et automake
version 1.7.
WeeChat a été développé avec autoconf version 2.59 et automake
version 1.9.5.
Vous devez avoir au moins ces versions pour compiler le CVS WeeChat.
Si vous n'avez pas ou ne souhaitez pas installer ces versions, vous
pouvez télécharger et installer le paquet "devel", un paquet construit
@@ -52,12 +53,14 @@ Q: Pourquoi utiliser WeeChat ? X-Chat et Irssi sont si bien...
R: Parce que WeeChat est très léger et a de nouvelles fonctionnalités.
Quelques nouvelles fonctionnalités :
* plusieurs interfaces (Curses, Gtk, Qt),
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt),
* extensible par des scripts (Perl, Python, Ruby),
* développé à partir de zéro (non basé sur un quelconque client IRC)
* multi-platformes
* 100% GPL et libre
C'est le client IRC le plus "geek" ;)
Plus d'infos sur cette page: http://weechat.flashtux.org/features.php
2.2
@@ -66,6 +69,7 @@ Q: J'ai lanc
R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
tapez /help commande.
Les touches et commandes sont listées dans la documentation.
2.3
@@ -92,20 +96,23 @@ R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
Q: Comment puis-je charger des scripts Perl ?
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
R: La commande /perl permet de charger les scripts Perl
(le chemin par défaut est ~/.weechat/perl).
R: La commande /perl permet de charger les scripts Perl (le chemin par défaut
est ~/.weechat/perl).
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Perl WeeChat sont compatibles avec X-Chat, mais pas Irssi,
désolé ;)
Les scripts Perl WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
2.6
================================================================================
Q: Comment puis-je charger les scripts Python ?
Les scripts Python sont-ils compatibles avec X-chat et/ou Irssi ?
R: Aujourd'hui l'interface Python n'est pas déceloppée.
Vous ne pouvez donc charger aucun script Python.
R: La commande /python permet de charger les scripts Python (le chemin par
défaut est ~/.weechat/python).
Notez que les scripts dans ~/.weechat/python/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Python WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
2.7
@@ -161,13 +168,27 @@ R: Il y a 2 mani
3.4
================================================================================
Q: WeeChat sera-t-il porté sur *BSD, QNX, MacOS X, Microsoft Windows ?
Q: Quelle est la liste des plate-formes supportées par WeeChat ?
R: Oui. Les futures versions seront disponibles pour ces OS.
R: Aujourd'hui WeeChat a été testé avec succès sur ces plate-formes :
- GNU/Linux (toute distribution / i386, AMD64, Sparc)
- FreeBSD
- NetBSD
- OpenBSD
- Mac OS X
- Microsoft Windows (avec Cygwin et quelques modifications de code)
3.5
================================================================================
Q: WeeChat sera-t-il porté sur QNX ou d'autres systèmes d'exploitation ?
R: Oui. Les futures versions seront disponibles pour ces OS.
Nous avons besoin d'aide pour ces systèmes, toute aide est la bienvenue :)
3.6
================================================================================
Q: Je souhaiterai aider les développeurs WeeChat. Que puis-je faire ?
R: Il y a plusieurs choses Ă  faire (code, documentation, ...)
@@ -176,8 +197,10 @@ R: Il y a plusieurs choses
http://weechat.flashtux.org/support.php
3.6
3.7
================================================================================
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 :)
+4 -2
View File
@@ -17,12 +17,14 @@
SUBDIRS = po intl src
EXTRA_DIST = weechat-curses.1 BUGS FAQ FAQ.fr \
EXTRA_DIST = config.rpath weechat-curses.1 BUGS FAQ FAQ.fr \
debian/changelog debian/control \
debian/copyright debian/files \
debian/copyright \
debian/rules debian/weechat-common.docs \
debian/weechat-common.install debian/weechat-curses.dirs \
debian/weechat-curses.install debian/weechat-gtk.dirs \
debian/weechat-gtk.install
man_MANS = weechat-curses.1
ACLOCAL_AMFLAGS = -I m4
+8
View File
@@ -1,6 +1,14 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-07-02
WeeChat 0.1.3 released.
* FlashCode, 2005-05-21
WeeChat 0.1.2 released.
* FlashCode, 2005-03-20
WeeChat 0.1.1 released.
+3 -3
View File
@@ -14,7 +14,7 @@ Features
* small, fast and very light
* customizable and extensible with scripts (Perl, Python, Ruby) (2)
* compliant with RFC 1459,2810,2811,2812,2813
* developed from scratch (not based on any other IRC client, except for look ;)
* developed from scratch
* multi-platform (GNU/Linux, *BSD, Windows & other) (3)
* 100% GPL & free
@@ -44,5 +44,5 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
---
(1) only Curses interface is available today
(2) only Perl interface is available today
(3) only GNU/Linux version is available today
(2) only Perl and Python interfaces are available today
(3) only GNU/Linux and *BSD versions are available today
+10 -21
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2005-03-20
TODO - 2005-07-02
Legend:
# done
@@ -10,31 +10,32 @@ Legend:
? is this really necessary?
v0.1.1:
v0.1.3:
------
* General:
+ Windows version
+ Solaris version
+ *BSD version
* IRC protocol:
# "/dcc send" command
# "/dcc chat" command (and incoming DCC chats)
- customizable CTCP version reply
* Interface:
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* TCP/IP communication:
# connect to server with child process (background)
# SSL support
# IPv6 protocol implementation
# proxy support (http, socks4, socks5) with authentification
(http, socks5) and ipv6 support (client to proxy)
* Configuration:
# save buffer notify levels
Future versions:
---------------
* IRC protocol:
- customizable CTCP version reply
- complete "/list" command: add regexp search, display only channels that
match regexp
- "/ignore" and "/unignore" commands: hide all that is write by a given
@@ -45,15 +46,10 @@ Future versions:
nick/host connect to the given irc network
* WeeChat commands:
- "/reload" command: reload the WeeChat's config file
- "/highlight" command: highlight a given word when it appears on
channels/privates
- "/completion" command: do shortcuts (for example when we type "u"
in the text bar it send it to the server as "you")
- "/exec" command: execute a command as if we was in shell
and show us the output on the current window. An option to exec
like -o could send the output to the server, on the current
channel/private
- "/last": command to look for text in previous messages
* Interface:
@@ -62,14 +58,7 @@ Future versions:
- understand incomplete commands if unambigous (for example: /he for /help is ok)
? Qt GUI
* TCP/IP communication:
- proxy support
- SSL support
- IPv6 protocol implementation
* Plugins:
- Python plugin
- "/python load" and "/python unload" commands to (un)load Python scripts
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
+13 -53
View File
@@ -1,55 +1,15 @@
#!/bin/sh
rm -f config.cache
### GETTEXT ###
echo searching for GNU gettext intl directory...
dirs="/usr/share /usr/local/share /opt/share /usr /usr/local /opt /usr/gnu/share"
found=0
for try in $dirs; do
echo -n " -> $try/gettext/intl... "
if test -d $try/gettext/intl; then
echo found it
found=1
break
fi
echo no
done
if test "$found" != 1; then
echo ERROR: Cannot find gettext/intl directory.
echo ERROR: Install GNU gettext in /usr or /usr/local prefix.
exit 7
fi;
echo copying gettext intl files...
intldir="$try/gettext/intl"
if test ! -d intl; then
mkdir intl
fi
olddir=`pwd`
cd $intldir
for file in *; do
if test $file != COPYING.LIB-2.0 && test $file != COPYING.LIB-2.1; then
rm -f $olddir/intl/$file
cp $intldir/$file $olddir/intl/
fi
done
cp -f $try/gettext/po/Makefile.in.in $olddir/po/
cd $olddir
if test -f intl/plural.c; then
sleep 2
touch intl/plural.c
fi
### END GETTEXT ###
echo "running aclocal..."
aclocal -I /usr/share/aclocal
echo "running autoconf..."
autoconf
echo "running autoheader..."
autoheader
echo "running automake..."
automake -a
echo "autogen.sh ok, now run ./configure script"
# gettextize updates Makefile.am, configure.in
cp configure.in configure.in.old
cp Makefile.am Makefile.am.old
gettextize --copy --force --intl --no-changelog &&
mv Makefile.am.old Makefile.am
mv configure.in.old configure.in
aclocal &&
# autoheader creates config.h.in needed by autoconf
autoheader &&
# autoconf creates configure
autoconf &&
# automake creates Makefile.in
automake --add-missing --copy --gnu
+167 -15
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.1, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.3, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.1])
AM_INIT_AUTOMAKE([weechat], [0.1.3])
# Checks for programs.
AC_PROG_CC
@@ -44,42 +44,88 @@ AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h s
AC_HEADER_TIME
AC_STRUCT_TM
AC_MSG_CHECKING([for socklen_t])
AC_CACHE_VAL(ac_cv_type_socklen_t,
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t t;],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no,
)])
if test $ac_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
fi
AC_MSG_RESULT($ac_cv_type_socklen_t)
# Checks for library functions.
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],,enable_ncurses=yes)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],enable_ncurses=$enableval,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets,[ --enable-wxwidgets Turn on WxWidgets interface (default=no)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=$enableval,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=$enableval,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python plugins (default=no)],enable_python=$enableval,enable_python=no)
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=auto)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
enable_plugins="no"
enable_python="no"
PYTHON_CFLAGS=
enable_ruby="no"
RUBY_CFLAGS=
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
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_PYTHON, test "$enable_python" = "yes")
# AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([ncurses library not found! Install ncurses library or run ./configure with --disable-ncurses parameter.])
AC_MSG_ERROR([
*** ncurses library not found!
*** Please install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
NCURSES_LIBS="-lncurses"
AC_SUBST(NCURSES_LIBS)
fi
if test "x$enable_wxwidgets" = "xyes" ; then
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.3.4, wxWin=1)
if test "$wxWin" != 1; then
AC_MSG_ERROR([
*** wxWindows must be installed on your system
*** but wx-config script couldn't be found.
*** Please check that wx-config is in path, the directory
*** where wxWindows libraries are installed (returned by
*** 'wx-config --libs' command) is in LD_LIBRARY_PATH or
*** equivalent variable and wxWindows version is 2.3.4 or above.
])
fi
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
LDFLAGS="$LDFLAGS $WX_LIBS"
WXWIDGETS_CFLAGS=""
WXWIDGETS_LIBS=""
fi
if test "x$enable_gtk" = "xyes" ; then
#if test "$LIBGTK_FOUND" = "0" ; then
# AC_MSG_ERROR([Gtk+ library not found! Install Gtk+ (2.0 or higher) library or run ./configure without --enable-gtk parameter.])
@@ -94,18 +140,112 @@ PLUGINS_LIBS=
if test "x$enable_perl" = "xyes" ; then
enable_plugins="yes"
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `perl -MExtUtils::Embed -e ldopts`"
PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
AC_PATH_PROG(PERL, perl perl5)
if test -z $PERL ; then
AC_MSG_ERROR([
*** Perl must be installed on your system
*** but perl interpreter couldn't be found in path.
Please check that perl is in path, or install
it with your software package manager.])
fi
AC_MSG_CHECKING(for Perl headers files)
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
else
AC_MSG_ERROR([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/perl/lib_weechat_perl.a `$PERL -MExtUtils::Embed -e ldopts`"
else
AC_MSG_ERROR([
*** Perl library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
AC_SUBST(PERL_CFLAGS)
AC_DEFINE(PLUGIN_PERL)
fi
if test "x$enable_python" = "xyes" ; then
enable_plugins="yes"
AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2)
if test -z $PYTHON ; then
AC_MSG_ERROR([
*** Python must be installed on your system
*** but python interpreter couldn't be found in path.
*** Please check that python is in path, or install
*** it with your software package manager.])
fi
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE="$PYTHON_SYSPREFIX/include/python$PYTHON_VERSION"
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS=-I`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
else
AC_MSG_ERROR([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.])
fi
AC_MSG_RESULT(found)
PYTHON_LIB="$PYTHON_SYSPREFIX/lib/python$PYTHON_VERSION/config"
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so" -o -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-lpython$PYTHON_VERSION -lpthread -lutil"
else
AC_MSG_ERROR([
*** Python library couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
PLUGINS_LIBS="$PLUGINS_LIBS ../../plugins/python/lib_weechat_python.a $PYTHON_LFLAGS"
AC_SUBST(PYTHON_CFLAGS)
AC_DEFINE(PLUGIN_PYTHON)
fi
if test "x$enable_plugins" = "xyes" ; then
AC_DEFINE(PLUGINS)
fi
AC_SUBST(PLUGINS_LIBS)
if test "x$enable_gnutls" = "xyes" ; then
found_gnutls="no"
AM_PATH_LIBGNUTLS( 1.0.0, found_gnutls=yes, AC_MSG_WARN([[
*** libgnutls was not found. You may want to get it from
*** ftp://ftp.gnutls.org/pub/gnutls/
*** WeeChat will be built without GnuTLS support.]]))
if test "x$found_gnutls" = "xyes" ; then
GNUTLS_LIBS="-lgnutls"
AC_SUBST(GNUTLS_LIBS)
AC_DEFINE(HAVE_GNUTLS)
else
enable_gnutls="no"
fi
fi
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
CFLAGS="-O2"
@@ -120,14 +260,20 @@ if test "x$debug" = "x2" ; then
AC_DEFINE(DEBUG)
fi
dnl For FreeBSD
LIBS="$LIBS $INTLLIBS"
CFLAGS="$CFLAGS $CPPFLAGS"
AC_OUTPUT([Makefile
src/Makefile
src/common/Makefile
src/irc/Makefile
src/plugins/Makefile
src/plugins/perl/Makefile
src/plugins/python/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
src/gui/gtk/Makefile
src/gui/qt/Makefile
intl/Makefile
@@ -140,6 +286,9 @@ listgui=
if test "x$enable_ncurses" = "xyes" ; then
listgui="$listgui ncurses"
fi
if test "x$enable_wxwidgets" = "xyes"; then
listgui="$listgui WxWidgets"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
fi
@@ -148,7 +297,9 @@ if test "x$enable_qt" = "xyes" ; then
fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([No interface specified... Please specify at least ncurses, Gtk or Qt.])
AC_MSG_ERROR([
*** No interface specified...
*** Please specify at least ncurses, WxWidgets, Gtk or Qt.])
fi
msg_debug_compiler="no"
@@ -167,6 +318,7 @@ echo Build with Plugin support..... : $enable_plugins
echo Build with Perl support....... : $enable_perl
echo Build with Python support..... : $enable_python
echo Build with Ruby support....... : $enable_ruby
echo Build with GNUtls support..... : $enable_gnutls
echo
echo Compile with debug info....... : $msg_debug_compiler
echo Print debugging messages...... : $msg_debug_verbose
+22 -1
View File
@@ -1,6 +1,27 @@
weechat (0.1.2-2) unstable; urgency=low
* Patch src/gui/curse/gui-display.c to fix segfault
when config file does not exists (Closes: #310589).
-- Julien Louis <ptitlouis@sysif.net> Tue, 24 May 2005 20:55:02 +0200
weechat (0.1.2-1) unstable; urgency=low
* WeeChat version 0.1.2, see ChangeLog for detail.
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 21 May 2005 08:00:00 +0200
weechat (0.1.1-2) unstable; urgency=low
* debian/control:
- Add myself to uploaders.
- Remove unecessary dependency on weechat-gtk (Closes: #308287).
-- Julien Louis <ptitlouis@sysif.net> Tue, 10 May 2005 22:38:52 +0200
weechat (0.1.1-1) unstable; urgency=low
* WeeChat version 0.1.1, see ChangeLog for detail.
* WeeChat version 0.1.1, see ChangeLog for detail (closes: #306492)
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 20 Mar 2005 08:00:00 +0200
+1
View File
@@ -0,0 +1 @@
4
+3 -2
View File
@@ -2,12 +2,13 @@ Source: weechat
Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.4), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev
Standards-Version: 3.6.1
Package: weechat
Architecture: all
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${Source-Version})
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version})
Description: Fast, light and extensible IRC client
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
for many operating systems. Everything can be done with a keyboard.
+1 -1
View File
@@ -1,5 +1,5 @@
This package was debianized by FlashCode <flashcode@flashtux.org> on
Sat, 20 Mar 2005 08:00:00 +0200.
Sat, 21 May 2005 08:00:00 +0200.
It was downloaded from http://weechat.flashtux.org/download
+1 -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-perl --enable-python
touch configure-stamp
+355 -148
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
@subtitle Documentation for WeeChat v0.1.3 - July, 03 2005
@image{weechat_image}
@@ -84,27 +84,27 @@ version 2 or higher.
@node Description, Pre-requisites, Introduction, Introduction
@section Description
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
designed for many operating systems.@*
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
designed for many operating systems.@*
@*
Main features are:
Main features are:
@itemize @minus
@item
multi-servers connection
@item
many GUI (Graphical User Interface): Curses, Gtk and Qt
@item
small, fast and light
@item
customizable and extensible with scripts
@item
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
@item
multi-platform (Gnu/Linux, *BSD, Windows and other)
@item
@item
multi-servers connection (with SSL, IPv6, proxy)
@item
many GUI: Curses, wxWidgets, Gtk and Qt
@item
small, fast and light
@item
customizable and extensible with scripts
@item
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
@item
multi-platform (Gnu/Linux, *BSD, MacOS X, Windows and other)
@item
100% GPL, free software
@end itemize
@end itemize
@*
WeeChat homepage is here:@*
@uref{http://weechat.flashtux.org}@*
@@ -116,20 +116,20 @@ In order to install WeeChat, you @b{need}:@*
@itemize @bullet
@item
A running Gnu/Linux system (with compiler tools for source package)
A running Gnu/Linux system (with compiler tools for source package)
@item
"root" privileges (to install WeeChat)
@item
According to GUI, one of the following libraries:
@itemize @minus
@item
Curses: ncurses library,
@item
Gtk: *** GUI not developed ***,
@item
Qt: *** GUI not developed ***,
According to GUI, one of the following libraries:
@itemize @minus
@item
Curses: ncurses library,
@item
Gtk: *** GUI not developed ***,
@item
Qt: *** GUI not developed ***,
@end itemize
@end itemize
@end itemize
@c ******************************* Installation *******************************
@@ -139,31 +139,31 @@ Qt: *** GUI not developed ***,
@menu
* Binary package::
* Source package::
* Source package::
* CVS sources::
@end menu
@node Binary package, Source package, Installation, Installation
@section Binary package
Binary packages are available for these distributions:
@itemize @bullet
@item
Debian (or any Debian compatible distribution)@*
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (or any RPM compatible distribution)@*
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
To install: @kbd{emerge weechat}
@item
*BSD (not available!)
@item
Slackware (not available!)
@item
Windows (not available!)
@end itemize
Binary packages are available for these distributions:
@itemize @bullet
@item
Debian (or any Debian compatible distribution)@*
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
@item
Mandriva/Redhat (or any RPM compatible distribution)@*
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
To install: @kbd{emerge weechat}
@item
*BSD (not available!)
@item
Slackware (not available!)
@item
Windows (not available!)
@end itemize
where x.y.z is the version (for example 0.0.1)
@*
@@ -176,27 +176,27 @@ All you have to do is to run in a console or a terminal:@*
@kbd{make}@*
Nota: to build only some interfaces, you can give parameters
to ./configure, type @kbd{./configure --help} for help about options.@*
Then get root privileges and install WeeChat:@*
@kbd{su}@*
(enter root password)@*
@kbd{make install}@*
Then get root privileges and install WeeChat:@*
@kbd{su}@*
(enter root password)@*
@kbd{make install}@*
@node CVS sources, , Source package, Installation
@section CVS sources
Warning: CVS sources are for advanced users: it may not compile or not be stable.
You're warned!@*
To get CVS sources, issue these commands:@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(when prompted for a password, just press Enter key)@*
Warning: CVS sources are for advanced users: it may not compile or not be stable.
You're warned!@*
To get CVS sources, issue these commands:@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(when prompted for a password, just press Enter key)@*
Execute this script:@*
@kbd{./autogen.sh}@*
Then follow instructions for source package - @xref{Source package}.
Then follow instructions for source package - @xref{Source package}.
@c ********************************** Usage ***********************************
@@ -206,40 +206,45 @@ Then follow instructions for source package - @xref{Source package}.
@menu
* Run WeeChat::
* Config file::
* Key bindings::
* Config file::
* Key bindings::
* WeeChat commands::
* FIFO pipe::
@end menu
@node Run WeeChat, Config file, Usage, Usage
@section Run WeeChat
@subsection Command line parameters
@subsection Command line parameters
@table @code
@item -c, --config
Display config file help (list of options)@*
@item -h, --help
Display help screen@*
@item -i, --irc-commands
Display IRC commands list@*
@item -l, --license
Display WeeChat license@*
@item -v, --version
@item -v, --version
Display WeeChat version@*
@end table
@subsection Run WeeChat
Just issue this command to run WeeChat:@*
@item -w, --weechat-commands
Display WeeChat commands list@*
@end table
@subsection Run WeeChat
Just issue this command to run WeeChat:@*
@kbd{weechat-curses} (for Curses front-end)@*
or @kbd{weechat-wxwidgets} (for wxWidgets front-end)@*
or @kbd{weechat-gtk} (for Gtk front-end)@*
or @kbd{weechat-qt} (for Qt front-end)@*
When you run WeeChat for the first time, a default configuration file is
created, with default options.@*
The default configuration file is: ~/.weechat/weechat.rc@*
You can edit this file at your convenience to configure WeeChat, or you can
or @kbd{weechat-qt} (for Qt front-end)@*
When you run WeeChat for the first time, a default configuration file is
created, with default options.@*
The default configuration file is: ~/.weechat/weechat.rc@*
You can edit this file at your convenience to configure WeeChat, or you can
set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
@node Config file, Key bindings, Run WeeChat, Usage
@@ -248,7 +253,6 @@ set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
List of options for config file:@*
@table @kbd
@item look_set_title
Set title for window (terminal for Curses GUI) with name & version@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -270,6 +274,9 @@ Type: string (any string), default value: ''@*
@item look_charset_internal
Internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)@*
Type: string (any string), default value: 'ISO-8859-1'@*
@item look_buffer_timestamp
Timestamp for buffers@*
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'@*
@@ -414,6 +421,9 @@ Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_voice
Color for voice symbol@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_nick_more
Color for '+' when scrolling nicks@*
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
@item col_nick_sep
Color for nick separator@*
Type: color (Curses or Gtk color), default value: 'blue'@*
@@ -482,7 +492,7 @@ Default message when away@*
Type: string (any string), default value: 'away'@*
@item irc_default_msg_part
Default part message (leaving channel)@*
Type: string (any string), default value: ''@*
Type: string (any string), default value: 'WeeChat %v'@*
@item irc_default_msg_quit
Default quit message ('%v' will be replaced by WeeChat version in string)@*
Type: string (any string), default value: 'WeeChat %v'@*
@@ -498,6 +508,9 @@ Type: integer (values: between 0 and 2147483647), default value: 1@*
@item irc_lag_disconnect
Disconnect after important lag (in minutes, 0 = never disconnect)@*
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 dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@@ -528,12 +541,21 @@ Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item proxy_use
Use a proxy server to connect to irc server@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item proxy_type
Proxy type (http (default), socks4, socks5)@*
Type: string (values: 'http', 'socks4', 'socks5'), default value: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item proxy_address
Proxy server address (IP or hostname)@*
Type: string (any string), default value: ''@*
@item proxy_port
Port for connecting to proxy server@*
Type: integer (values: between 0 and 65535), default value: 1080@*
Type: integer (values: between 0 and 65535), default value: 3128@*
@item proxy_username
Username for proxy server@*
Type: string (any string), default value: ''@*
@item proxy_password
Password for proxy server@*
Type: string (any string), default value: ''@*
@@ -555,6 +577,12 @@ Type: string (any string), default value: ''@*
@item server_port
Port for connecting to server@*
Type: integer (values: between 0 and 65535), default value: 6667@*
@item server_ipv6
Use IPv6 protocol for server communication@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item server_ssl
Use SSL for server communication@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item server_password
Password for IRC server@*
Type: string (any string), default value: ''@*
@@ -585,7 +613,9 @@ Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item server_notify_levels
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
Type: string (any string), default value: ''@*
@end table
Colors for Curses GUI are:@*
@@ -624,11 +654,11 @@ Colors for Curses GUI are:@*
@node Key bindings, WeeChat commands, Config file, Usage
@section Key bindings
@table @kbd
@item Left arrow / Right arrow
Go to previous / next char in command line@*
@*
@*
@item Ctrl + left arrow / Ctrl + right arrow
Go to previous / next word in command line@*
@*
@@ -638,28 +668,28 @@ Go to the beginning of command line@*
@item End / Ctrl + E
Go to the end of command line@*
@*
@item Backspace / Delete
@item Backspace / Delete
Erase previous / next char of command line@*
@*
@item Ctrl + Backspace / Ctrl + W
@*
@item Ctrl + Backspace / Ctrl + W
Erase previous word of command line@*
@*
@item Tab
@*
@item Tab
Complete command or nick (@kbd{Tab} again: find next completion)@*
@*
@item Any char
Insert char to cursor position in the command line@*
@*
@item Enter
@*
@item Any char
Insert char to cursor position in the command line@*
@*
@item Enter
Execute command or send message@*
@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item PageUp / PageDown
@*
@item Up arrow / Down arrow
Call again last commands/messages@*
@*
@item PageUp / PageDown
Show buffer history@*
@*
@item F5 / F6
@item F5 / F6
Switch to previous / next buffer@*
@*
@item F7 / F8
@@ -668,10 +698,13 @@ Switch to previous / next window@*
@item F10
Remove last infobar message@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@item Alt + left arrow / Alt + right arrow
@*
@item Alt + left arrow / Alt + right arrow
Same as F5 / F6@*
@*
@item Alt + A
@@ -692,6 +725,9 @@ Switch to first channel of next server (or server buffer if no channel is opened
@item Alt + digit (1-9)
Switch to buffer by number@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node WeeChat commands, FIFO pipe, Key bindings, Usage
@@ -700,7 +736,6 @@ Switch to buffer by number@*
WeeChat internal commands:@*
@table @kbd
@item alias [alias_name [command [arguments]]
@*
create an alias for a command@*
@@ -750,20 +785,29 @@ display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item perl [load filename] | [autoload] | [unload]
@item perl [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@item python [load filename] | [autoload] | [reload] | [unload]
@*
list/load/unload Python scripts@*
@*
filename: Python script (file) to load@*
Without argument, /python command lists all loaded Python scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@*
list, add or remove servers@*
@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
ipv6: use IPv6 protocol@*
ssl: use SSL protocol@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
@@ -799,13 +843,11 @@ splith: split current window horizontally@*
splitv: split current window vertically@*
merge: merge window with another@*
@*
@end table
IRC commands:@*
@table @kbd
@item admin [target]
@*
find information about the administrator of the server@*
@@ -980,11 +1022,12 @@ list nicknames on channels@*
@*
channel: channel name@*
@*
@item nick nickname
@item nick [-all] nickname
@*
change current nickname@*
@*
nickname: new nickname for current IRC server@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
@*
@item notice nickname text
@*
@@ -1171,7 +1214,6 @@ nickname: nickname to search@*
count: number of replies to return (full search if negative number)@*
target: reply should match this mask@*
@*
@end table
@node FIFO pipe, , WeeChat commands, Usage
@@ -1251,7 +1293,7 @@ List all Perl scripts: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( name, version, shutdown_function, description );}@*
@command{weechat::register ( name, version, shutdown_function, description );}@*
@*
This is first function to call in Perl script.@*
All Perl scripts for WeeChat should call this function.@*
@@ -1267,42 +1309,29 @@ unloaded (optional parameter, empty string means nothing is called at the end)
@end itemize
@*
@emph{Example:}@*
@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@*
@*
@item
@command{IRC::print ( message );}@*
@*
Print message in current window (channel or server).@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@end itemize
@*
@emph{Example:}@*
@code{IRC::print ("message");}@*
@*
@item
@command{IRC::print_with_channel ( channel, [server,] message );}@*
@command{weechat::print ( message, [channel, [server]] );}@*
@*
Print message in a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@item @option{message}: message to display
@end itemize
@*
@emph{Examples:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
@code{IRC::print_with_channel ("#weechat", "message");}@*
@code{weechat::print ("message");}@*
@code{weechat::print ("message", "#weechat");}@*
@code{weechat::print ("message", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( delay, message );}@*
@command{weechat::print_infobar ( delay, message );}@*
@*
Print message in infobar.@*
@@ -1314,11 +1343,11 @@ Print message in infobar.@*
@end itemize
@*
@emph{Example:}@*
@code{IRC::print_infobar (5, "message");}@*
@code{weechat::print_infobar (5, "message");}@*
@*
@item
@command{IRC::add_message_handler ( name, function );}@*
@command{weechat::add_message_handler ( name, function );}@*
@*
Attach a Perl function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@@ -1333,18 +1362,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Example:}@*
@code{IRC::add_message_handler ("privmsg", my_function);}@*
@code{weechat::add_message_handler ("privmsg", my_function);}@*
@code{sub my_function}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("server=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("server=$_[0]\n");}@*
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( name, function );}@*
@command{weechat::add_command_handler ( name, function );}@*
@*
Create new WeeChat command, linked with Perl function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -1359,23 +1388,41 @@ available until your Perl script will be unloaded.
@end itemize
@*
@emph{Example:}@*
@code{IRC::add_command_handler ("command", my_command);}@*
@code{weechat::add_command_handler ("command", my_command);}@*
@code{sub my_command}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Server: $_[0], arguments: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [server,] name );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( name, [server] );}@*
@*
Get various info about WeeChat, server or user.@*
@emph{Arguments:}
@itemize @minus
@item @option{server}: internal name of server
@item @option{name}: name of info to retrieve:
@item @option{server}: internal name of server
@itemize @minus
@item @option{0 or version}: get WeeChat version
@item @option{1 or nick}: get nickname
@@ -1388,7 +1435,7 @@ Get various info about WeeChat, server or user.@*
@*
@emph{Examples:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1396,7 +1443,167 @@ Get various info about WeeChat, server or user.@*
@node Python scripts, Ruby scripts, Perl scripts, Extensions
@section Python scripts
Not developed!
@subsection Load/unload Python scripts
Python scripts are loaded and unloaded with @command{/python} command.
(type @kbd{/help python} within WeeChat to get help about command).@*
@emph{Examples:}@*
@itemize @bullet
@item
Load a Python script: @kbd{/python load /tmp/sample.py}@*
@item
Unload all Python scripts: @kbd{/python unload}@*
@item
List all Python scripts: @kbd{/python}@*
@end itemize
@subsection WeeChat / Python API
@itemize @bullet
@item
@command{weechat.register ( name, version, shutdown_function, description )}@*
@*
This is first function to call in Python script.@*
All Python scripts for WeeChat should call this function.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: unique name to identify script (each script must have
unique name)
@item @option{version}: script's version
@item @option{shutdown_function}: Python function called when script is
unloaded (optional parameter, empty string means nothing is called at the end)
@item @option{description}: short description of script.
@end itemize
@*
@emph{Example:}@*
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@*
@*
@item
@command{weechat.prnt ( message, [channel, [server]] )}@*
@*
Print message in a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{message}: message to display
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( delay, message )}@*
@*
Print message in infobar.@*
@emph{Arguments:}
@itemize @minus
@item @option{delay}: after this delay (in seconds), message will be erased
(if 0, message will not be erased).
@item @option{message}: message to display
@end itemize
@*
@emph{Example:}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( name, function )}@*
@*
Attach a Python function to an IRC message.@*
Function will be called each time IRC message will be received.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of IRC message@*
To know list of IRC messages, please refer to RFC 1459 and/or 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{function}: Python function called when message is received
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_message_handler ("privmsg", my_function)}@*
@code{def my_function(server, args):}@*
@code{@ @ @ @ weechat.prnt("server="+server)}@*
@code{@ @ @ @ null, channel, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ hostmask, null, channel = string.split(string.strip(channel), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("host="+hostmask+", channel="+channel+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( name, function )}@*
@*
Create new WeeChat command, linked with Python function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of new command@*
This name may be existing command, so that the command is overrided by
Python function. Be careful when overriding WeeChat commands, they'll not be
available until your Python script will be unloaded.
@item @option{function}: Python function linked with command
@end itemize
@*
@emph{Example:}@*
@code{weechat.add_command_handler ("command", my_command)}@*
@code{def my_command(server, args):}@*
@code{@ @ @ @ weechat.prnt("server:"+server+" arguments:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( name, [server] )}@*
@*
Get various info about WeeChat, server or user.@*
@emph{Arguments:}
@itemize @minus
@item @option{name}: name of info to retrieve:
@item @option{server}: internal name of server
@itemize @minus
@item @option{0 or version}: get WeeChat version
@item @option{1 or nick}: get nickname
@item @option{2 or channel}: get channel name
@item @option{3 or server}: get server name
@item @option{4 or weechatdir}: get WeeChat home directory
@item @option{5 or away}: get away flag for server
@end itemize
@end itemize
@*
@emph{Examples:}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
@node Ruby scripts, , Python scripts, Extensions
@section Ruby scripts
@@ -1472,7 +1679,7 @@ Look for WeeChat support page for detail:@*
@node Copyright, , Get support, Authors / Support
@section Copyright
This manual documents WeeChat IRC client, it is part of WeeChat.@*
This manual documents WeeChat IRC client, it is part of WeeChat.@*
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
+302 -97
View File
@@ -35,7 +35,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.1 - 20 de marzo de 2005
@subtitle Documentaci@'on para WeeChat v0.1.3 - 03 de Julio de 2005
@image{weechat_image}
@@ -90,9 +90,9 @@ dise@~nado para diferentes sistemas operativos.@*
Las caracter@'isticas principales son las siguientes:
@itemize @minus
@item
conexi@'on multi-servidores
conexi@'on multi-servidores (con SSL, IPv6, proxy)
@item
m@'ultiples interfaces: Curses, Gtk y Qt
m@'ultiples interfaces: Curses, wxWidgets, Gtk y Qt
@item
peque@~no, r@'apido y ligero.
@item
@@ -100,7 +100,7 @@ parametrizable y extensible mediante guiones (scripts)
@item
conforme a las RFCs 1459, 2810, 2811, 2812, y 2813
@item
multi-plataforma (Gnu/Linux, *BSD, Windows y otros sistemas operativos)
multi-plataforma (Gnu/Linux, *BSD, MacOS X, Windows y otros sistemas operativos)
@item
100% GPL, con Licencia Libre
@end itemize
@@ -210,7 +210,7 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
* Ficheros de configuracion::
* Atajos de teclado::
* Comandos WeeChat::
* FIFO pipe::
* Canal FIFO::
@end menu
@node Iniciar WeeChat, Ficheros de configuracion, Uso, Uso
@@ -223,16 +223,21 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
Obtener la ayuda del fichero de configuraci@'on (lista de opciones)@*
@item -h, --help
Obtener la ayuda@*
@item -i, --irc-commands
Display IRC commands list@*
@item -l, --license
Obtener la licencia de WeeChat@*
@item -v, --version
Obtener la versi@'on de WeeChat@*
@item -w, --weechat-commands
Display WeeChat commands list@*
@end table
@subsection Lanzar WeeChat
Para ejecutar WeeChat, basta escribir la l@'inea siguiente:@*
@kbd{weechat-curses} (para el interfaz con Curses)@*
o @kbd{weechat-wxwidgets} (para el interfaz con wxWidgets)@*
o @kbd{weechat-gtk} (para el interfaz con Gtk)@*
o @kbd{weechat-qt} (para el interfaz con Qt)@*
@@ -247,7 +252,6 @@ Puedes editarlo para configurar WeeChat con las opciones deseadas, o tambi@'en p
Enumeraci@'on de las opciones del fichero de configuraci@'on:@*
@table @kbd
@item look_set_title
Define el t@'itulo de la ventana (el terminal para la interfaz Curses) con el nombre y la versi@'on@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@@ -269,6 +273,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item look_charset_internal
Juego de caracteres interno de WeeChat, deber@'ia ser ISO-xxxx aunque el locale sea UTF-8 (si no se especifica, se utiliza el juego de caracteres local)@*
Typo: cadena (cualquier cadena), valor por defecto: 'ISO-8859-1'@*
@item look_buffer_timestamp
Fecha y hora para las bĂşfers@*
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'@*
@@ -413,6 +420,9 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_voice
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@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightmagenta'@*
@item col_nick_sep
Color para el separador de alias@*
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
@@ -481,7 +491,7 @@ Mensaje por defecto para el estado ausente@*
Typo: cadena (cualquier cadena), valor por defecto: 'away'@*
@item irc_default_msg_part
Mensaje por defecto de salida (saliendo de un canal)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
@item irc_default_msg_quit
Mensaje de fin por defecto ('%v' ser@'a reemplazado por la versi@'on de WeeChat en la cadena)@*
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
@@ -498,7 +508,7 @@ Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 1@*
Desconexi@'on tras un lag importante (en minutos, 0 = no desconectar nunca)@*
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 5@*
@item irc_fifo_pipe
Create a FIFO pipe for remote control@*
Crea una tuber@'ia FIFO para control remoto@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item dcc_auto_accept_files
Aceptar autom@'aticamente los ficheros dcc entrantes@*
@@ -530,12 +540,21 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item proxy_use
Utilizar un proxy para conectarse al servidor irc@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item proxy_type
Proxy type (http (default), socks4, socks5)@*
Typo: cadena (valores: 'http', 'socks4', 'socks5'), valor por defecto: 'http'@*
@item proxy_ipv6
Connect to proxy in ipv6@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item proxy_address
Direcci@'on del servidor proxy (IP o nombre de m@'aquina)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_port
Puerto para conectarse al servidor proxy@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 1080@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 3128@*
@item proxy_username
Username for proxy server@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item proxy_password
Contrase@~na para el servidor proxy@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@@ -557,6 +576,12 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item server_port
Puerto para conectarse al servidor@*
Typo: entero (valores: entre 0 y 65535), valor por defecto: 6667@*
@item server_ipv6
Use IPv6 protocol for server communication@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_ssl
Use SSL for server communication@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
@item server_password
Contrase@~na para el servidor IRC@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@@ -587,7 +612,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
@item server_autorejoin
Unirse de nuevo autom@'aticamente a los canales cuando sea expulsado@*
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
@item server_notify_levels
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
Typo: cadena (cualquier cadena), valor por defecto: ''@*
@end table
Los colores para el interfaz Curses son:@*
@@ -624,7 +651,6 @@ Los colores para el interfaz Curses son:@*
@kbd{white}: blanco
@end itemize
@node Atajos de teclado, Comandos WeeChat, Ficheros de configuracion, Uso
@section Atajos de teclado
@@ -671,6 +697,9 @@ Ir a la ventana anterior / siguiente@*
@item F10
Borrar el @'ultimo mensaje en la barra de informaciones@*
@*
@item F11 / F12
Scroll nicklist@*
@*
@item Ctrl + L
Refrescar toda la ventana@*
@*
@@ -695,15 +724,17 @@ Ir al primer canal del servidor siguiente (o a la memoria temporal del servidor
@item Alt + (1-9)
Saltar a la memoria temporal con ese n@'umero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Scroll nicklist@*
@*
@end table
@node Comandos WeeChat, FIFO pipe, Atajos de teclado, Uso
@node Comandos WeeChat, Canal FIFO, Atajos de teclado, Uso
@section Comandos WeeChat
Comandos internos WeeChat:@*
@table @kbd
@item alias [nombre_alias [comando [argumentos]]
@*
crear un alias para un comando@*
@@ -743,9 +774,9 @@ nombre_del_servidor: nombre del servidor del que desconectarse@*
@*
@item debug dump
@*
print debug messages@*
imprime mensajes de depuraci@'on@*
@*
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)@*
volcado: almacena un volcado de memoria en el archivo de registro de Weechat (se escribe el mismo volcado cuando Weechat se cuelga)@*
@*
@item help [comando]
@*
@@ -753,26 +784,35 @@ mostrar ayuda sobre los comandos@*
@*
comando: nombre de un comando de Weechat @'o de IRC@*
@*
@item perl [load fichero] | [autoload] | [unload]
@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 server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@item python [load fichero] | [autoload] | [reload] | [unload]
@*
lista/carga/descarga de los Python scripts@*
@*
fichero: Python script (archivo) a cargar@*
Sin argumentos, el comando /python lista todos los Python scripts cargados.@*
@*
@item server [nombre_de_servidor] | [nombre_de_servidor nombre/IP puerto [-auto | -noauto] [-ipv6] [-ssl] [-pwd contrase@~na] [-nicks alias1 [alias2 [alias3]]] [-username nombre de usuario] [-realname nombre_real] [-command comando] [-autojoin canal[,canal]] ] | [del nombre_de_servidor]
@*
lista, a@~nade o elimina servidores@*
@*
nombre_de_servidor: nombre del servidor, para uso interno y para mostrar@*
nombre/IP: nombre o direcci@'on IP del servidor@*
puerto: puerto para el servidor (nĂşmero entero)@*
contrase@~na: contrase@~na para el servidor@*
alias1: primer alias para el servidor@*
alias2: alias alternativo para el servidor@*
alias3: segundo alias alternativo para el servidor@*
nombre_de_usuario: nombre de usuario@*
nombre_real: nombre real del usuario@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
ipv6: use IPv6 protocol@*
ssl: use SSL protocol@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
nick3: second alternate nick for server@*
username: user name@*
realname: real name of user@*
@*
@item save [archivo]
@*
@@ -802,13 +842,11 @@ splith: dividir la ventana actual horizontalmente@*
splitv: dividir la ventana actual verticalmente@*
merge: fusionar una ventana con otra@*
@*
@end table
Comandos IRC:@*
@table @kbd
@item admin [target]
@*
encontrar informaci@'on sobre el administrador del servidor@*
@@ -824,10 +862,10 @@ mensaje: mensaje para el estado ausente (si no se da ning
@*
@item ban [canal] [usariio [usuario ...]]
@*
bans nicks or hosts@*
banea usuarios o m@'aquinas@*
@*
channel: channel for ban@*
nickname: user or host to ban@*
canal: canal en el que banear@*
usuario: nombre de usuario o m@'aquina a banear@*
@*
@item ctcp usuario tipo
@*
@@ -900,11 +938,11 @@ comentario: comentario para la expulsi@'on@*
@*
@item kickban [canal] usuario [comentario]
@*
kicks and bans a nick from a channel@*
expulsa y banea a un usuario de un canal@*
@*
channel: channel where user is@*
nickname: nickname to kick and ban@*
comment: comment for kick@*
canal: canal donde est@'a el usuario@*
usuario: nombre de usuario a expulsar y banear@*
comentario: comentario para la expulsi@'on@*
@*
@item kill usuario comentario
@*
@@ -983,11 +1021,12 @@ listar usuarios en canales@*
@*
canal: nombre del canal@*
@*
@item nick usuario
@item nick [-all] usuarios
@*
cambiar el nombre de usuario actual@*
@*
usuario: nuevo nombre de usuario para el servidor IRC actual@*
-all: set new nickname for all connected servers@*
nickname: new nickname@*
@*
@item notice usuario texto
@*
@@ -1118,10 +1157,10 @@ target: servidor objetivo@*
@*
@item unban [canal] usuario [usuario ...]
@*
unbans nicks or hosts@*
desbanea usuarios o m@'aquinas@*
@*
channel: channel for unban@*
nickname: user or host to unban@*
canal: canal en el que desbanear (quitar la prohibici@'on)@*
usuario: usuario o m@'aquina a desbanear@*
@*
@item userhost usuario [usuario ...]
@*
@@ -1174,40 +1213,42 @@ usuario: nombre de usuario a buscar@*
nĂşmero: nĂşmero de respuestas a devolver (bĂşsqueda completa si el nĂşmero es negativo)@*
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
@*
@end table
@node FIFO pipe, , Comandos WeeChat, Uso
@section FIFO pipe
@node Canal FIFO, , Comandos WeeChat, Uso
@section Canal FIFO
You can remote control WeeChat, by sending commands or text to a FIFO pipe
(you have to enable option "irc_fifo_pipe", it is disabled by default).@*
The FIFO pipe is located in ~/.weechat/ and is called "weechat_fifo_xxxxx"
(where xxxxx is the process ID (PID) of running WeeChat).@*
So if many WeeChat are running, you have many FIFO pipe, one for each session.@*
Puedes controlar WeeChat a distantia, enviando comandos o texto a un canal FIFO
(debes activar la opci@'on "irc_fifo_pipe" que est@'a desactivada por defecto).@*
El canal FIFO est@'a dentro del directorio ~/.weechat/ y se llama
"weechat_fifo_xxxxx" (donde xxxxx es el ID del proceso (PID) de WeeChat).@*
Entonces si tienes varios WeeChat que se est@'an ejecutando, tendr@'as varios
canales FIFO, uno por cada sesi@'on.@*
@*
The syntax for the FIFO pipe commands/text is:@*
@command{server,channel *text or command here}@*
where server and channel are optional, but if channel is here, server should be too.@*
La sintaxis para enviar comandos o texto dentro del canal FIFO es la siguiente:@*
@command{servidor,canal *texto o comando aqu@'i}@*
donde el serviros y el canal son opcionales pero si precisa el canal, debes
precisar tambi@'en el servidor.@*
@*
Some examples:
Algunos ejemplos:
@table @asis
@item @bullet{} change your nick on freenode to "mynick|out":
@item @bullet{} cambiar el seud@'onimo en freenode por "mynick|out":
@*
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on #weechat channel:
@item @bullet{} escribir texto en el canal #weechat:
@*
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
@command{echo "freenode,#weechat *@exclamdown{}Hola a todos!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} escribir texto en el canal corriente (el que se puede visualizar en WeeChat actualmente)
@*
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
@command{echo "*¡Hola!" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
@b{Advertencia:} esto es peligroso y no deber@'ias hacerlo.. salvo si lo que est@'as haciendo.
@item @bullet{} enviar dos comandos para descargar y recargar los scripts Perl (tienes que separarlos con un \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
You can write a script to send command to all running WeeChat at same time, for example:@*
Puedes escribir un script que envia los comandos a todos los programas WeeChat
que se est@'an ejecutando de momento. Por ejemplo:@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
@@ -1217,8 +1258,8 @@ You can write a script to send command to all running WeeChat at same time, for
fi
@end verbatim
@*
If the script is called "auto_weechat_command", you can run it with:@*
@command{./auto_weechat_command "freenode,#weechat *hello"}
Si el script se llama "auto_weechat_command", puedes ejecutarlo hac@'i:@*
@command{./auto_weechat_command "freenode,#weechat *Hola"}
@c ******************************* Extensions *********************************
@@ -1253,7 +1294,7 @@ Listar los programas Perl cargados: @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@command{weechat::register ( nombre, versi@'on, funci@'on_final, descripci@'on );}@*
@*
Es la primera funci@'on a la que llamar en el programa Perl.@*
Todos los programas en Perl para WeeChat deben llamar esta funci@'on.@*
@@ -1269,42 +1310,29 @@ tener un nombre distinto)
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@code{weechat::register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...");}@*
@*
@item
@command{IRC::print ( mensaje );}@*
@*
Escribe un mensaje en la ventana actual (canal o servidor).@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::print ("mensaje");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [servidor,] mensaje );}@*
@command{weechat::print ( mensaje, [canal, [servidor]] );}@*
@*
Escribe un mensaje en un canal.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@item @option{canal}: nombre del canal
@item @option{servidor}: (opcional) nombre interno del servidor
@item @option{mensaje}: mensaje que debe escribir en el canal
@end itemize
@*
@emph{Ejemplos:}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "mensaje");}@*
@code{IRC::print_with_channel ("#weechat", "mensaje");}@*
@emph{Ejemplo:}@*
@code{weechat::print ("mensaje");}@*
@code{weechat::print ("mensaje", "#weechat");}@*
@code{weechat::print ("mensaje", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( retraso, mensaje );}@*
@command{weechat::print_infobar ( retraso, mensaje );}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@@ -1316,11 +1344,11 @@ Escribir un mensaje en la barra de informaciones.@*
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::print_infobar (5, "mensaje");}@*
@code{weechat::print_infobar (5, "mensaje");}@*
@*
@item
@command{IRC::add_message_handler ( nombre, funci@'on );}@*
@command{weechat::add_message_handler ( nombre, funci@'on );}@*
@*
Adjunta una funci@'on Perl a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@@ -1336,18 +1364,18 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::add_message_handler ("privmsg", mi_funcion);}@*
@code{weechat::add_message_handler ("privmsg", mi_funcion);}@*
@code{sub mi_funcion}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $mensaje) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($mascara, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ IRC::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@ @ @ @ weechat::print ("mascara=$mascara, canal=$canal, mensaje=$mensaje\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nombre, funci@'on );}@*
@command{weechat::add_command_handler ( nombre, funci@'on );}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Perl.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@@ -1362,23 +1390,41 @@ al antiguo comando si el script Perl est@'a cargado.
@end itemize
@*
@emph{Ejemplo:}@*
@code{IRC::add_command_handler ("comando", mi_comando);}@*
@code{weechat::add_command_handler ("comando", mi_comando);}@*
@code{sub mi_comando}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Servidor: $_[0], Par@'ametros: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [servidor,] nombre );}@*
@command{weechat::command ( command, [channel, [server]] );}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat::command ("hello world!");}@*
@code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nombre, [servidor] );}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{servidor}: nombre interno del servidor
@item @option{nombre}: nombre de la informaci@'on que se quiere obtener:
@item @option{servidor}: nombre interno del servidor
@itemize @minus
@item @option{0 o version}: obtener la versi@'on de WeeChat
@item @option{1 o nick}: obtener el seud@'onimo
@@ -1390,8 +1436,8 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$version = weechat::get_info("version");}@*
@code{$nick = weechat::get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1399,7 +1445,166 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@node Programas Python, Programas Ruby, Programas Perl, Extensiones
@section Programas Python
¡No desarrollado!
@subsection Cargar/descargar programas Python
Los programas Python se cargan y descargan con el comando @command{/python}
(escribiendo @kbd{/help python} en WeeChat para obtener la ayuda acerca del comando).@*
@emph{Ejemplos:}@*
@itemize @bullet
@item
Cargar un programa Python: @kbd{/python load /tmp/ejemplo.py}@*
@item Descargar todos los programas Python: @kbd{/python unload}@*
@item
Listar los programas Python cargados: @kbd{/python}@*
@end itemize
@subsection Interfaz WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nombre, versi@'on, funci@'on_final, descripci@'on )}@*
@*
Es la primera funci@'on a la que llamar en el programa Python.@*
Todos los programas en Python para WeeChat deben llamar esta funci@'on.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre @'unico para identificar el programa (cada programa debe
tener un nombre distinto)
@item @option{versi@'on}: versi@'on del programa
@item @option{funci@'on_final}: funci@'on Python llamada cuando el programa finaliza
(par@'ametro facultativo, una cadena llena significa que no hay ninguna funci@'on que llamar)
@item @option{descripci@'on}: descripci@'on breve del programa
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.register ("ejemplo", "1.0", "fin_ejemplo", "programa de ejemplo...")}@*
@*
@item
@command{weechat.prnt ( mensaje, [canal, [servidor]] )}@*
@*
Escribe un mensaje en un canal.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{mensaje}: mensaje a escribir
@item @option{canal}: nombre del canal
@item @option{servidor}: (opcional) nombre interno del servidor
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.prnt ("mensaje")}@*
@code{weechat.prnt ("mensaje", "#weechat")}@*
@code{weechat.prnt ("mensaje", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( retraso, mensaje )}@*
@*
Escribir un mensaje en la barra de informaciones.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{retraso}: periodo en segundo durante el cual se mostrar@'a el mensaje
(si es 0, el mensaje no se borrar@'a).
@item @option{mensaje}: mensaje que se escribir@'a en la barra de informaciones.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.print_infobar (5, "mensaje")}@*
@*
@item
@command{weechat.add_message_handler ( nombre, funci@'on )}@*
@*
Adjunta una funci@'on Python a un mensaje IRC.@*
Se llamar@'a a la funci@'on cada vez que el mensaje IRC se reciba.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre del mensaje IRC que producir@'a la llamada a la funci@'on.@*
Para saber qu@'e tipo de mensajes IRC existen puede leer las
RFC 1459 y/o 2812:@*
RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{funci@'on}: funci@'on en Python llamada cuando se reciba el mensaje.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_message_handler ("privmsg", mi_funcion)}@*
@code{def mi_funcion(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("servidor="+servidor)}@*
@code{@ @ @ @ null, canal, mensaje = string.split(args, ":", 2)}@*
@code{@ @ @ @ mascara, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("mascara="+mascara+", canal="+canal+", mensaje="+mensaje)}@*
@*
@item
@command{weechat.add_command_handler ( nombre, funci@'on )}@*
@*
A@~nadir un nuevo comando WeeChat, con un enlace a una funci@'on en Python.@*
Se llamar@'a a la funci@'on cuando el usuario lance el comando con @kbd{/nombre}.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre del nuevo comando@*
Puede ser un comando que ya existe, y en este caso el nuevo comando sustituir@'a
el antiguo. Ten cuidado cuando sustituyas a un comando de WeeChat, no podr@'a acceder
al antiguo comando si el script Python est@'a cargado.
@item @option{funcion}: funci@'on Python assiciada al comando.
@end itemize
@*
@emph{Ejemplo:}@*
@code{weechat.add_command_handler ("comando", mi_comando)}@*
@code{def mi_comando(servidor, args):}@*
@code{@ @ @ @ weechat.prnt("Servidor:"+servidor+" Par@'ametros:"+args)}@*
@*
@item
@command{weechat.command ( command, [channel, [server]] )}@*
@*
Execute a command or send a message to a channel.@*
@emph{Arguments:}
@itemize @minus
@item @option{command}: command to execute (or message to send in a channel)
@item @option{channel}: name of channel
@item @option{server}: internal name of server
@end itemize
@*
@emph{Examples:}@*
@code{weechat.command ("hello world!")}@*
@code{weechat.command ("/kick toto please leave this chan", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nombre, [servidor] )}@*
@*
Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
@emph{Par@'ametros:}
@itemize @minus
@item @option{nombre}: nombre de la informaci@'on que se quiere obtener:
@item @option{servidor}: nombre interno del servidor
@itemize @minus
@item @option{0 o version}: obtener la versi@'on de WeeChat
@item @option{1 o nick}: obtener el seud@'onimo
@item @option{2 o channel}: obtener el nombre del canal
@item @option{3 o server}: obtener el nombre del servidor
@item @option{4 o weechatdir}: obtener el directorio home de WeeChat
@item @option{5 o away}: obtener la informaci@'on "away" del servidor
@end itemize
@end itemize
@*
@emph{Ejemplos:}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
@node Programas Ruby, , Programas Python, Extensiones
@section Programas Ruby
+351 -147
View File
@@ -35,7 +35,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
@subtitle Documentation pour WeeChat v0.1.3 - 03 Juillet 2005
@image{weechat_image}
@@ -83,27 +83,27 @@ License version 2 ou plus.
@node Description, Pre-requis, Introduction, Introduction
@section Description
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
concu pour diff@'erents syst@`emes d'exploitation.@*
@*
Ses principales caract@'eristiques sont les suivantes :
@*
Ses principales caract@'eristiques sont les suivantes :
@itemize @minus
@item
connexion multi-serveurs
@item
plusieurs interfaces : Curses, Gtk et Qt
@item
petit, rapide et l@'eger
@item
param@'etrable et extensible avec des scripts
@item
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
@item
multi-plateformes (Gnu/Linux, *BSD, Windows et d'autres syst@`emes)
@item
@item
connexion multi-serveurs (avec SSL, IPv6, proxy)
@item
plusieurs interfaces : Curses, wxWidgets, Gtk et Qt
@item
petit, rapide et l@'eger
@item
param@'etrable et extensible avec des scripts
@item
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
@item
multi-plateformes (Gnu/Linux, *BSD, MacOS X, Windows et d'autres syst@`emes)
@item
100% GPL, logiciel libre
@end itemize
@end itemize
@*
La page d'accueil de WeeChat est ici :@*
@uref{http://weechat.flashtux.org}@*
@@ -115,20 +115,20 @@ Pour installer WeeChat, vous @b{devez} avoir :@*
@itemize @bullet
@item
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
@item
Droits "root" (pour installer WeeChat)
@item
Selon l'interface, une des biblioth@`eques suivantes :
@itemize @minus
@item
Curses: la librairie ncurses,
@item
Gtk: *** interface non d@'evelopp@'ee ***,
@item
Qt: *** interface non d@'evelopp@'ee ***,
Selon l'interface, une des biblioth@`eques suivantes :
@itemize @minus
@item
Curses: la librairie ncurses,
@item
Gtk: *** interface non d@'evelopp@'ee ***,
@item
Qt: *** interface non d@'evelopp@'ee ***,
@end itemize
@end itemize
@end itemize
@c ******************************* Installation *******************************
@@ -138,31 +138,31 @@ Qt: *** interface non d@'evelopp@'ee ***,
@menu
* Paquet binaire::
* Paquet source::
* Paquet source::
* Sources CVS::
@end menu
@node Paquet binaire, Paquet source, Installation, Installation
@section Paquet binaire
Les paquets binaires sont disponibles pour les distributions suivantes :
@itemize @bullet
@item
Debian (ou toute distribution compatible Debian)@*
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
Pour installer : @kbd{emerge weechat}
@item
*BSD (non disponible !)
@item
Slackware (non disponible !)
@item
Windows (non disponible !)
@end itemize
Les paquets binaires sont disponibles pour les distributions suivantes :
@itemize @bullet
@item
Debian (ou toute distribution compatible Debian)@*
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
@item
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
@item
Gentoo@*
Pour installer : @kbd{emerge weechat}
@item
*BSD (non disponible !)
@item
Slackware (non disponible !)
@item
Windows (non disponible !)
@end itemize
o@`u x.y.z est la version (par exemple 0.0.1)
@*
@@ -175,28 +175,28 @@ Tapez simplement dans une console ou un terminal :@*
@kbd{make}@*
Note: pour ne construire que certaines interfaces, vous pouvez passer des param@`etres
@`a ./configure, tapez @kbd{./configure --help} pour de l'aide sur ces options.@*
Obtenez les droits root et installez WeeChat :@*
@kbd{su}@*
(entrez le mot de passe de root)@*
@kbd{make install}@*
Obtenez les droits root et installez WeeChat :@*
@kbd{su}@*
(entrez le mot de passe de root)@*
@kbd{make install}@*
@node Sources CVS, , Paquet source, Installation
@section Sources CVS
@section Sources CVS
Attention: les sources CVS sont r@'eserv@'es aux utilisateurs avanc@'es : il se peut
que WeeChat ne compile pas et qu'il soit tr@`s instable.
Vous @^etes pr@'evenus !@*
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
que WeeChat ne compile pas et qu'il soit tr@`s instable.
Vous @^etes pr@'evenus !@*
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
Ex@'ecutez ce script :@*
@kbd{./autogen.sh}@*
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
@c ******************************* Utilisation ********************************
@@ -206,40 +206,45 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
@menu
* Lancer WeeChat::
* Fichier de configuration::
* Raccourcis clavier::
* Fichier de configuration::
* Raccourcis clavier::
* Commandes WeeChat::
* Tube FIFO::
@end menu
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
@section Lancer WeeChat
@subsection Param@`etres de ligne de commande
@subsection Param@`etres de ligne de commande
@table @code
@item -c, --config
Afficher l'aide sur le fichier de config (liste des options)@*
@item -h, --help
Afficher l'aide@*
@item -i, --irc-commands
Afficher la liste des commandes IRC@*
@item -l, --license
Afficher la licence de WeeChat@*
@item -v, --version
@item -v, --version
Afficher la version de WeeChat@*
@end table
@subsection Lancer WeeChat
Tapez simplement cette commande pour lancer WeeChat :@*
@item -w, --weechat-commands
Afficher la liste des commandes WeeChat@*
@end table
@subsection Lancer WeeChat
Tapez simplement cette commande pour lancer WeeChat :@*
@kbd{weechat-curses} (pour l'interface Curses)@*
ou @kbd{weechat-wxwidgets} (pour l'interface wxWidgets)@*
ou @kbd{weechat-gtk} (pour l'interface Gtk)@*
ou @kbd{weechat-qt} (pour l'interface Qt)@*
ou @kbd{weechat-qt} (pour l'interface Qt)@*
Lorsque vous lancez WeeChat pour la premi@`ere fois, un fichier de configuration
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} - @xref{Commandes WeeChat}.
@node Fichier de configuration, Raccourcis clavier, Lancer WeeChat, Utilisation
@@ -248,7 +253,6 @@ vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} -
Liste des options du fichier de configuration :@*
@table @kbd
@item look_set_title
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -270,6 +274,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item look_charset_internal
Jeu de caract@`eres interne @`a WeeChat, devrait @^etre ISO-xxxx m@^eme si la locale est UTF-8 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'ISO-8859-1'@*
@item look_buffer_timestamp
Horodatage pour les tampons@*
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'@*
@@ -414,6 +421,9 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_voice
Couleur pour le symbole voix@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_nick_more
Couleur pour les '+' lors du scroll sur les pseudos@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
@item col_nick_sep
Couleur pour le s@'eparateur de pseudo@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
@@ -482,7 +492,7 @@ Message par d@'efaut pour l'absence@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'away'@*
@item irc_default_msg_part
Message par d@'efaut pour le part (quitte un canal)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@item irc_default_msg_quit
Message de fin par d@'efaut ('%v' sera remplac@'e par la version de WeeChat dans la cha@^ine)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@@ -531,12 +541,21 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item proxy_use
Utiliser un proxy pour se connecter au serveur irc@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item proxy_type
Type de proxy (http (d@'efaut), socks4, socks5)@*
Type: cha@^ine (valeurs: 'http', 'socks4', 'socks5'), valeur par d@'efaut: 'http'@*
@item proxy_ipv6
Se connecter au proxy en ipv6@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item proxy_address
Adresse du serveur proxy (IP ou nom)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item proxy_port
Port pour se connecter au serveur proxy@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 1080@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 3128@*
@item proxy_username
Nom d'utilisateur pour le serveur proxy@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item proxy_password
Mot de passe pour le serveur proxy@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -558,6 +577,12 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_port
Port pour se connecter au serveur@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 6667@*
@item server_ipv6
Utiliser le protocole IPv6 pour la communication avec le serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item server_ssl
Utiliser SSL pour la communication avec le serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item server_password
Mot de passe pour le serveur IRC@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -588,7 +613,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_autorejoin
Rejoindre automatiquement les canaux quand mis dehors@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item server_notify_levels
Liste des niveaux de notifications (s@'epar@'es par des virgules) pour les canaux de ce serveur (format: #canal:1,..)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@end table
Les couleurs pour l'interface Curses sont :@*
@@ -627,11 +654,11 @@ Les couleurs pour l'interface Curses sont :@*
@node Raccourcis clavier, Commandes WeeChat, Fichier de configuration, Utilisation
@section Raccourcis clavier
@table @kbd
@item Fl@`eche gauche / Fl@`eche droite
Aller au caract@`ere pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@*
@item Ctrl + fl@`eche gauche / Ctrl + fl@`eche droite
Aller au mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@@ -641,28 +668,28 @@ Aller au d@'ebut de la ligne de commande@*
@item End / Ctrl + E
Aller @`a la fin de la ligne de commande@*
@*
@item Backspace / Delete
@item Backspace / Delete
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@item Ctrl + Backspace / Ctrl + W
@*
@item Ctrl + Backspace / Ctrl + W
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
@*
@item Tab
@*
@item Tab
Compl@'eter la commande ou le pseudo (@kbd{Tab} @`a nouveau : trouver la compl@'etion suivante)@*
@*
@item Tout caract@`ere
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
@*
@item Entr@'ee
@*
@item Tout caract@`ere
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
@*
@item Entr@'ee
Ex@'ecuter la commande ou envoyer le message@*
@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item PageUp / PageDown
@*
@item Fl@`eche haut / Fl@`eche bas
Rappeler les derni@`eres commandes/messages@*
@*
@item PageUp / PageDown
Afficher l'historique du tampon@*
@*
@item F5 / F6
@*
@item F5 / F6
Aller au tampon pr@'ec@'edent / suivant@*
@*
@item F7 / F8
@@ -671,10 +698,13 @@ Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@item F11 / F12
Faire d@'efiler la liste des pseudos@*
@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
Identique @`a F5 / F6@*
@*
@item Alt + A
@@ -695,6 +725,9 @@ Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal
@item Alt + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@*
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
Faire d@'efiler la liste des pseudos@*
@*
@end table
@node Commandes WeeChat, Tube FIFO, Raccourcis clavier, Utilisation
@@ -703,7 +736,6 @@ Sauter au tampon avec ce num@'ero@*
Commandes internes WeeChat :@*
@table @kbd
@item alias [nom_alias [commande [param@`etres]]
@*
cr@'eer un alias pour une commande@*
@@ -753,20 +785,29 @@ afficher l'aide sur les commandes@*
@*
commande: nom d'une commande WeeChat ou IRC@*
@*
@item perl [load fichier] | [autoload] | [unload]
@item perl [load fichier] | [autoload] | [reload] | [unload]
@*
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 server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@item python [load fichier] | [autoload] | [reload] | [unload]
@*
liste/charge/d@'echarge des scripts Python@*
@*
fichier: script Python (fichier) @`a charger@*
Sans param@`etre, la commande /python liste tous les scripts Python charg@'es.@*
@*
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-ipv6] [-ssl] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@*
liste, ajoute ou retire des serveurs@*
@*
nom_serveur: nom du serveur, pour usage interne et affichage@*
nom/IP: nom ou adresse IP du serveur@*
port: port pour le serveur (nombre entier)@*
ipv6: utiliser le protocole IPv6@*
ssl: utiliser le protocole SSL@*
mot_de_passe: mot de passe pour le serveur@*
pseudo1: premier pseudo pour le serveur@*
pseudo2: pseudo alternatif pour le serveur@*
@@ -802,13 +843,11 @@ splith: @'eclate la fen@^etre en deux horizontalement@*
splitv: @'eclate la fen@^etre en deux verticalement@*
merge: fusionne la fen@^etre avec une autre@*
@*
@end table
Commandes IRC :@*
@table @kbd
@item admin [cible]
@*
trouver les informations sur l'administrateur du serveur@*
@@ -983,11 +1022,12 @@ lister les utilisateurs sur des canaux@*
@*
canal: nom du canal@*
@*
@item nick pseudo
@item nick [-all] pseudo
@*
changer le pseudo courant@*
@*
pseudo: nouveau pseudo pour le serveur IRC courant@*
-all: d@'efinir le nouveau pseudo sur tous les serveurs connect@'es@*
pseudo: nouveau pseudo@*
@*
@item notice pseudo texte
@*
@@ -1174,7 +1214,6 @@ pseudo: pseudo @`a chercher@*
nombre: nombre de r@'eponses @`a retourner (recherche compl@`ete si nombre n@'egatif)@*
cible: la r@'eponse doit correspondre @`a ce masque@*
@*
@end table
@node Tube FIFO, , Commandes WeeChat, Utilisation
@@ -1254,7 +1293,7 @@ Lister les scripts Perl charg@'es : @kbd{/perl}@*
@itemize @bullet
@item
@command{IRC::register ( nom, version, fonction_de_fin, description );}@*
@command{weechat::register ( nom, version, fonction_de_fin, description );}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Perl.@*
Tout script Perl pour WeeChat doit appeler cette fonction.@*
@@ -1271,42 +1310,29 @@ de fonction @`a appeler)
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@code{weechat::register ("essai", "1.0", "fin_essai", "Script d'essai !");}@*
@*
@item
@command{IRC::print ( message );}@*
@*
Affiche un message dans la fen@^etre courante (canal ou serveur).@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::print ("message");}@*
@*
@item
@command{IRC::print_with_channel ( canal, [serveur,] message );}@*
@command{weechat::print ( message, [canal, [serveur]] );}@*
@*
Affiche un message dans un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemples :}@*
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
@code{IRC::print_with_channel ("#weechat", "message");}@*
@emph{Exemple :}@*
@code{weechat::print ("message");}@*
@code{weechat::print ("message", "#weechat");}@*
@code{weechat::print ("message", "#weechat", "freenode");}@*
@*
@item
@command{IRC::print_infobar ( d@'elai, message );}@*
@command{weechat::print_infobar ( d@'elai, message );}@*
@*
Affiche un message dans la barre d'infos.@*
@@ -1318,11 +1344,11 @@ Affiche un message dans la barre d'infos.@*
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::print_infobar (5, "message");}@*
@code{weechat::print_infobar (5, "message");}@*
@*
@item
@command{IRC::add_message_handler ( nom, fonction );}@*
@command{weechat::add_message_handler ( nom, fonction );}@*
@*
Attache une fonction Perl @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@@ -1338,18 +1364,18 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::add_message_handler ("privmsg", ma_fonction);}@*
@code{weechat::add_message_handler ("privmsg", ma_fonction);}@*
@code{sub ma_fonction}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ weechat::print ("serveur=$_[0]\n");}@*
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
@code{@ @ @ @ IRC::print ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@ @ @ @ weechat::print ("masque=$masque, canal=$canal, message=$message\n");}@*
@code{@} }@*
@*
@item
@command{IRC::add_command_handler ( nom, fonction );}@*
@command{weechat::add_command_handler ( nom, fonction );}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Perl.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@@ -1364,23 +1390,41 @@ ne seront plus accessibles tant que le script Perl sera charg@'e.
@end itemize
@*
@emph{Exemple :}@*
@code{IRC::add_command_handler ("commande", ma_commande);}@*
@code{weechat::add_command_handler ("commande", ma_commande);}@*
@code{sub ma_commande}@*
@code{@{ }@*
@code{@ @ @ @ IRC::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ weechat::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
@code{@ @ @ @ return 0;}@*
@code{@} }@*
@*
@item
@command{IRC::get_info ( [serveur,] nom );}@*
@command{weechat::command ( commande, [canal, [serveur]] );}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal)
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemples :}@*
@code{weechat::command ("bonjour tout le monde !");}@*
@code{weechat::command ("/kick toto merci de quitter ce canal", "#weechat");}@*
@code{weechat::command ("/nick newnick", "", "freenode");}@*
@*
@item
@command{weechat::get_info ( nom, [serveur] );}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{serveur}: nom interne du serveur
@item @option{nom}: nom de l'info @`a obtenir :
@item @option{serveur}: nom interne du serveur
@itemize @minus
@item @option{0 ou version}: obtenir la version de WeeChat
@item @option{1 ou nick}: obtenir le pseudo
@@ -1393,7 +1437,7 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@*
@emph{Exemples :}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@code{$nick = get_info("nick", "freenode");}@*
@*
@end itemize
@@ -1401,7 +1445,167 @@ Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@node Scripts Python, Scripts Ruby, Scripts Perl, Extensions
@section Scripts Python
Non d@'evelopp@'e !
@subsection Charger/d@'echarger des scripts Python
Les scripts Python sont charg@'es et d@'echarg@'es avec la commande @command{/python}
(tapez @kbd{/help python} dans WeeChat pour obtenir de l'aide sur la commande).@*
@emph{Exemples :}@*
@itemize @bullet
@item
Charger un script Python : @kbd{/python load /tmp/essai.py}@*
@item D@'echarger tous les scripts Python : @kbd{/python unload}@*
@item
Lister les scripts Python charg@'es : @kbd{/python}@*
@end itemize
@subsection Interface WeeChat / Python
@itemize @bullet
@item
@command{weechat.register ( nom, version, fonction_de_fin, description )}@*
@*
C'est la premi@`ere fonction @`a appeler dans le script Python.@*
Tout script Python pour WeeChat doit appeler cette fonction.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom unique pour identifier le script (chaque script doit
avoir un nom diff@'erent)
@item @option{version}: version du script
@item @option{fonction_de_fin}: fonction Python appel@'ee quand le script est
d@'echarg@'e (param@`etre facultatif, une cha@^ine vide signifiant qu'il n'y a pas
de fonction @`a appeler)
@item @option{description}: description br@`eve du script.
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.register ("essai", "1.0", "fin_essai", "Script d'essai !")}@*
@*
@item
@command{weechat.prnt ( message, [canal, [serveur]] )}@*
@*
Affiche un message dans un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{message}: message @`a afficher
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.prnt ("message")}@*
@code{weechat.prnt ("message", "#weechat")}@*
@code{weechat.prnt ("message", "#weechat", "freenode")}@*
@*
@item
@command{weechat.print_infobar ( d@'elai, message )}@*
@*
Affiche un message dans la barre d'infos.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{d@'elai}: d@'elai (en secondes) pendant lequel le message est affich@'e
(si 0, le message ne sera pas effac@'e).
@item @option{message}: message @`a afficher
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.print_infobar (5, "message")}@*
@*
@item
@command{weechat.add_message_handler ( nom, fonction )}@*
@*
Attache une fonction Python @`a un message IRC particulier.@*
La fonction sera appel@'ee @`a chaque fois que le message IRC sera re@,{c}u.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom du message IRC pour lequel la fonction est appel@'ee@*
Pour conna@^itre la liste des messages IRC disponibles, merci de consulter les
RFC 1459 et/ou 2812 :@*
RFC 1459 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
@item @option{fonction}: fonction Python appel@'ee lorsque le message est re@,{c}u
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_message_handler ("privmsg", ma_fonction)}@*
@code{def ma_fonction(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur="+serveur)}@*
@code{@ @ @ @ null, canal, message = string.split(args, ":", 2)}@*
@code{@ @ @ @ masque, null, canal = string.split(string.strip(canal), " ", 2)}@*
@code{@ @ @ @ weechat.prnt("masque="+masque+", canal="+canal+", message="+message)}@*
@*
@item
@command{weechat.add_command_handler ( nom, fonction )}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction Python.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande par @kbd{/nom}.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom de la nouvelle commande@*
Il peut s'agir d'une commande existante, auquel cas celle-ci est @'ecras@'ee par
la fonction Python. Soyez prudent en @'ecrasant les commandes WeeChat, car elles
ne seront plus accessibles tant que le script Python sera charg@'e.
@item @option{fonction}: fonction Python associ@'ee @`a la commande
@end itemize
@*
@emph{Exemple :}@*
@code{weechat.add_command_handler ("commande", ma_commande)}@*
@code{def ma_commande(serveur, args):}@*
@code{@ @ @ @ weechat.prnt("serveur:"+serveur+" param@`etres:"+args)}@*
@*
@item
@command{weechat.command ( commande, [canal, [serveur]] )}@*
@*
Ex@'ecute une commande ou envoie un message @'a un canal.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{commande}: commande @'a ex@'ecuter (ou message @'a envoyer au canal)
@item @option{canal}: nom du canal
@item @option{serveur}: nom interne du serveur
@end itemize
@*
@emph{Exemples :}@*
@code{weechat.command ("bonjour tout le monde !")}@*
@code{weechat.command ("/kick toto merci de quitter ce canal", "#weechat")}@*
@code{weechat.command ("/nick newnick", "", "freenode")}@*
@*
@item
@command{weechat.get_info ( nom, [serveur] )}@*
@*
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
@emph{Param@`etres :}
@itemize @minus
@item @option{nom}: nom de l'info @`a obtenir :
@item @option{serveur}: nom interne du serveur
@itemize @minus
@item @option{0 ou version}: obtenir la version de WeeChat
@item @option{1 ou nick}: obtenir le pseudo
@item @option{2 ou channel}: obtenir le nom du canal
@item @option{3 ou server}: obtenir le nom du serveur
@item @option{4 ou weechatdir}: obtenir le r@'epertoire maison de WeeChat
@item @option{5 ou away}: obtenir le drapeau "away" du serveur
@end itemize
@end itemize
@*
@emph{Exemples :}@*
@code{$version = weechat.get_info("version")}@*
@code{$nick = weechat.get_info("nick", "freenode")}@*
@*
@end itemize
@node Scripts Ruby, , Scripts Python, Extensions
@section Scripts Ruby
File diff suppressed because it is too large Load Diff
+2
View File
@@ -9,6 +9,8 @@
./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/plugins.c
./src/plugins/plugins.h
./src/gui/curses/gui-input.c
+985 -764
View File
File diff suppressed because it is too large Load Diff
+999 -765
View File
File diff suppressed because it is too large Load Diff
+993 -774
View File
File diff suppressed because it is too large Load Diff
+209 -23
View File
@@ -73,19 +73,26 @@ t_weechat_command weechat_commands[] =
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
0, 1, weechat_cmd_help, NULL },
{ "perl", N_("list/load/unload Perl scripts"),
N_("[load filename] | [autoload] | [unload]"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: Perl script (file) to load\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"
"Without argument, /python command lists all loaded Python scripts."),
0, 2, weechat_cmd_python, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 "
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
"[nick2 [nick3]]] [-username username] [-realname realname] "
"[-command command] [-autojoin channel[,channel]] ] | "
"[del servername]"),
N_("servername: server name, for internal & display use\n"
"hostname: name or IP address of server\n"
"port: port for server (integer)\n"
"ipv6: use IPv6 protocol\n"
"ssl: use SSL protocol\n"
"password: password for server\n"
"nick1: first nick for server\n"
"nick2: alternate nick for server\n"
@@ -652,6 +659,8 @@ void
user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
{
t_irc_nick *ptr_nick;
int plugin_args_length;
char *plugin_args;
if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n'))
return;
@@ -677,7 +686,7 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
else
server_sendf (server, "PRIVMSG %s :%s\r\n",
CHANNEL(buffer)->name, command);
if (CHANNEL(buffer)->type == CHAT_PRIVATE)
{
gui_printf_type_color (CHANNEL(buffer)->buffer,
@@ -699,7 +708,7 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
ptr_nick = nick_search (CHANNEL(buffer), server->nick);
if (ptr_nick)
{
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick,
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick, NULL,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_color (CHANNEL(buffer)->buffer,
COLOR_WIN_CHAT, "%s\n", command);
@@ -712,6 +721,27 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
WEECHAT_ERROR);
}
}
/* sending a copy of the message as PRIVMSG to plugins because irc server doesn't */
plugin_args_length = strlen ("localhost PRIVMSG :") +
strlen (CHANNEL(buffer)->name) + strlen(command) + 16;
plugin_args = (char *) malloc (plugin_args_length * sizeof (*plugin_args));
if (plugin_args)
{
snprintf (plugin_args, plugin_args_length,
"localhost PRIVMSG %s :%s",
CHANNEL(buffer)->name, command);
plugin_event_msg ("privmsg", server->name, plugin_args);
free (plugin_args);
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s unable to call handler for message (not enough memory)\n"),
WEECHAT_ERROR);
}
}
else
{
@@ -967,7 +997,8 @@ weechat_cmd_buffer (int argc, char **argv)
(ptr_buffer->dcc) ? "DCC" :
((BUFFER_IS_SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
CHANNEL(ptr_buffer)->name));
if (ptr_buffer->dcc)
if ((!BUFFER_IS_CHANNEL(ptr_buffer))
&& (!BUFFER_IS_PRIVATE(ptr_buffer)))
gui_printf (NULL, "-");
else
gui_printf (NULL, "%d", ptr_buffer->notify_level);
@@ -982,22 +1013,34 @@ weechat_cmd_buffer (int argc, char **argv)
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0'))
{
if ((number < 0) || (number > 3))
if ((number < NOTIFY_LEVEL_MIN) || (number > NOTIFY_LEVEL_MAX))
{
/* invalid highlight level */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
return -1;
}
if ((!BUFFER_IS_CHANNEL(gui_current_window->buffer))
&& (!BUFFER_IS_PRIVATE(gui_current_window->buffer)))
{
/* invalid buffer type (only ok on channel or private) */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect buffer for notify (must be channel or private)\n"),
WEECHAT_ERROR);
return -1;
}
gui_current_window->buffer->notify_level = number;
channel_set_notify_level (SERVER(gui_current_window->buffer),
CHANNEL(gui_current_window->buffer),
number);
}
else
{
/* invalid number */
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
WEECHAT_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
return -1;
}
}
@@ -1286,19 +1329,18 @@ weechat_cmd_help (int argc, char **argv)
int
weechat_cmd_perl (int argc, char **argv)
{
#ifdef PLUGINS
#ifdef PLUGIN_PERL
t_plugin_script *ptr_plugin_script;
t_plugin_handler *ptr_plugin_handler;
int handler_found, path_length;
char *path_script;
#ifdef PLUGIN_PERL
switch (argc)
{
case 0:
/* list registered Perl scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered Perl scripts:\n"));
gui_printf (NULL, _("Registered %s scripts:\n"), "Perl");
if (perl_scripts)
{
for (ptr_plugin_script = perl_scripts; ptr_plugin_script;
@@ -1320,7 +1362,7 @@ weechat_cmd_perl (int argc, char **argv)
/* list Perl message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Perl message handlers:\n"));
gui_printf (NULL, _("%s message handlers:\n"), "Perl");
handler_found = 0;
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
@@ -1329,8 +1371,9 @@ weechat_cmd_perl (int argc, char **argv)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => Perl(%s)\n"),
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Perl",
ptr_plugin_handler->function_name);
}
}
@@ -1342,7 +1385,7 @@ weechat_cmd_perl (int argc, char **argv)
/* list Perl command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Perl command handlers:\n"));
gui_printf (NULL, _("%s command handlers:\n"), "Perl");
handler_found = 0;
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
ptr_plugin_handler = ptr_plugin_handler->next_handler)
@@ -1351,8 +1394,9 @@ weechat_cmd_perl (int argc, char **argv)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => Perl(%s)\n"),
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Perl",
ptr_plugin_handler->function_name);
}
}
@@ -1366,13 +1410,13 @@ weechat_cmd_perl (int argc, char **argv)
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
if (strcasecmp (argv[0], "unload") == 0)
else if (strcasecmp (argv[0], "reload") == 0)
{
/* unload all Perl scripts */
plugin_unload (PLUGIN_TYPE_PERL, NULL);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Perl scripts unloaded\n"));
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
}
else if (strcasecmp (argv[0], "unload") == 0)
plugin_unload (PLUGIN_TYPE_PERL, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
@@ -1418,11 +1462,148 @@ weechat_cmd_perl (int argc, char **argv)
(void) argv;
#endif /* PLUGIN_PERL */
return 0;
}
/*
* weechat_cmd_python: list/load/unload Python scripts
*/
int
weechat_cmd_python (int argc, char **argv)
{
#ifdef PLUGIN_PYTHON
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 Python scripts */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Registered %s scripts:\n"), "Python");
if (python_scripts)
{
for (ptr_plugin_script = python_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 Python message handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s message handlers:\n"), "Python");
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_PYTHON)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s) => %s(%s)\n"),
ptr_plugin_handler->name,
"Python",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
/* list Python command handlers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s command handlers:\n"), "Python");
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_PYTHON)
{
handler_found = 1;
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" Command /%s => %s(%s)\n"),
ptr_plugin_handler->name,
"Python",
ptr_plugin_handler->function_name);
}
}
if (!handler_found)
{
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _(" (none)\n"));
}
break;
case 1:
if (strcasecmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
else if (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)
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
break;
case 2:
if (strcasecmp (argv[0], "load") == 0)
{
/* load Python 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, "python",
DIR_SEPARATOR, argv[1]);
}
plugin_load (PLUGIN_TYPE_PYTHON,
(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, "python");
}
break;
default:
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "python");
}
#else
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("WeeChat was build without Python support.\n"
"Please rebuild WeeChat with "
"\"--enable-python\" option for ./configure script\n"));
/* make gcc happy */
(void) argc;
(void) argv;
#endif /* PLUGINS */
#endif /* PLUGIN_PYTHON */
return 0;
}
@@ -1585,6 +1766,10 @@ weechat_cmd_server (int argc, char **argv)
server.autoconnect = 1;
if (strcasecmp (argv[i], "-noauto") == 0)
server.autoconnect = 0;
if (strcasecmp (argv[i], "-ipv6") == 0)
server.ipv6 = 1;
if (strcasecmp (argv[i], "-ssl") == 0)
server.ssl = 1;
if (strcasecmp (argv[i], "-pwd") == 0)
{
if (i == (argc - 1))
@@ -1672,10 +1857,11 @@ weechat_cmd_server (int argc, char **argv)
new_server = server_new (server.name, server.autoconnect,
server.autoreconnect,
server.autoreconnect_delay,
0, server.address, server.port, server.password,
0, server.address, server.port, server.ipv6,
server.ssl, server.password,
server.nick1, server.nick2, server.nick3,
server.username, server.realname,
server.command, 1, server.autojoin, 1);
server.command, 1, server.autojoin, 1, NULL);
if (new_server)
{
irc_display_prefix (NULL, PREFIX_INFO);
+1
View File
@@ -70,6 +70,7 @@ extern int weechat_cmd_debug (int, char **);
extern int weechat_cmd_disconnect (int, char **);
extern int weechat_cmd_help (int, char **);
extern int weechat_cmd_perl (int, char **);
extern int weechat_cmd_python (int, char **);
extern int weechat_cmd_save (int, char **);
extern int weechat_cmd_server (int, char **);
extern int weechat_cmd_set (char *);
+96 -17
View File
@@ -47,6 +47,7 @@ completion_init (t_completion *completion)
completion->base_command_arg = 0;
completion->position = -1;
completion->base_word = NULL;
completion->args = NULL;
completion->completion_list = NULL;
completion->last_completion = NULL;
@@ -67,6 +68,10 @@ completion_free (t_completion *completion)
free (completion->base_word);
completion->base_word = NULL;
if (completion->args)
free (completion->args);
completion->args = NULL;
while (completion->completion_list)
weelist_remove (&completion->completion_list,
&completion->last_completion,
@@ -97,8 +102,11 @@ completion_build_list (t_completion *completion, void *channel)
int i, j;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
char option_name[256];
char *pos, option_name[256];
t_weechat_alias *ptr_alias;
t_config_option *option;
void *option_value;
char option_string[2048];
/* WeeChat internal commands */
@@ -193,7 +201,8 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
if ((strcasecmp (completion->base_command, "perl") == 0)
if (((strcasecmp (completion->base_command, "perl") == 0)
|| (strcasecmp (completion->base_command, "python") == 0))
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
@@ -202,37 +211,100 @@ completion_build_list (t_completion *completion, void *channel)
weelist_add (&completion->completion_list,
&completion->last_completion,
"autoload");
weelist_add (&completion->completion_list,
&completion->last_completion,
"reload");
weelist_add (&completion->completion_list,
&completion->last_completion,
"unload");
return;
}
if ((strcasecmp (completion->base_command, "set") == 0)
&& (completion->base_command_arg == 1))
if (strcasecmp (completion->base_command, "set") == 0)
{
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
if (completion->base_command_arg == 1)
{
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
for (j = 0; weechat_options[i][j].option_name; j++)
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
}
}
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
option_name);
}
}
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
else if (completion->base_command_arg == 3)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
if (completion->args)
{
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_name);
pos = strchr (completion->args, ' ');
if (pos)
pos[0] = '\0';
option = NULL;
option_value = NULL;
config_option_search_option_value (completion->args, &option, &option_value);
if (option && option_value)
{
switch (option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (option_value && (*((int *)(option_value))))
weelist_add (&completion->completion_list,
&completion->last_completion,
"on");
else
weelist_add (&completion->completion_list,
&completion->last_completion,
"off");
break;
case OPTION_TYPE_INT:
snprintf (option_string, sizeof (option_string) - 1,
"%d", (option_value) ? *((int *)(option_value)) : option->default_int);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_string);
break;
case OPTION_TYPE_INT_WITH_STRING:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
option->array_values[*((int *)(option_value))] :
option->array_values[option->default_int]);
break;
case OPTION_TYPE_COLOR:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
gui_get_color_by_value (*((int *)(option_value))) :
option->default_string);
break;
case OPTION_TYPE_STRING:
weelist_add (&completion->completion_list,
&completion->last_completion,
(option_value) ?
*((char **)(option_value)) :
option->default_string);
break;
}
}
if (pos)
pos[0] = ' ';
}
}
return;
@@ -392,6 +464,11 @@ completion_build_list (t_completion *completion, void *channel)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "me") == 0)
{
completion->context = COMPLETION_NICK;
return;
}
if (strcasecmp (completion->base_command, "notice") == 0)
{
if (completion->base_command_arg != 1)
@@ -462,6 +539,8 @@ completion_find_context (t_completion *completion, void *channel, char *buffer,
command_arg++;
i++;
while ((i < pos) && (buffer[i] == ' ')) i++;
if (!completion->args)
completion->args = strdup (buffer + i);
}
else
i++;
+1
View File
@@ -39,6 +39,7 @@ struct t_completion
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
char *args; /* command line args (including base word) */
/* for command argument completion */
t_weelist *completion_list; /* data list for completion */
+39 -8
View File
@@ -48,11 +48,17 @@
#include <time.h>
#include <signal.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
#include "weechat.h"
#include "weeconfig.h"
@@ -68,9 +74,13 @@ int sigsegv = 0; /* SIGSEGV received?
char *weechat_home = NULL; /* WeeChat home dir. (example: /home/toto/.weechat) */
FILE *weechat_log_file = NULL; /* WeeChat log file (~/.weechat/weechat.log) */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1 */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1 */
int server_cmd_line; /* at least one server on WeeChat command line */
int server_cmd_line; /* at least one server on WeeChat command line */
#ifdef HAVE_GNUTLS
gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
#endif
/*
@@ -115,8 +125,10 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
#ifdef HAVE_ICONV
iconv_t cd;
char *inbuf, *ptr_inbuf, *ptr_outbuf;
int inbytesleft, outbytesleft;
char *inbuf;
ICONV_CONST char *ptr_inbuf;
char *ptr_outbuf;
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (strcasecmp(from_code, to_code) != 0))
@@ -352,7 +364,7 @@ wee_parse_args (int argc, char *argv[])
wee_display_commands (1, 0);
wee_shutdown (EXIT_SUCCESS);
}
else if ((strncasecmp (argv[i], "irc://", 6) == 0))
else if ((strncasecmp (argv[i], "irc", 3) == 0))
{
if (server_init_with_url (argv[i], &server_tmp) < 0)
{
@@ -365,9 +377,10 @@ wee_parse_args (int argc, char *argv[])
server_tmp.autoreconnect,
server_tmp.autoreconnect_delay,
1, server_tmp.address, server_tmp.port,
server_tmp.ipv6, server_tmp.ssl,
server_tmp.password, server_tmp.nick1,
server_tmp.nick2, server_tmp.nick3,
NULL, NULL, NULL, 0, server_tmp.autojoin, 1))
NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL))
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
WEECHAT_WARNING, argv[i]);
server_destroy (&server_tmp);
@@ -512,6 +525,13 @@ wee_init_vars ()
/* init received messages queue */
recv_msgq = NULL;
msgq_last_msg = NULL;
/* init gnutls */
#ifdef HAVE_GNUTLS
gnutls_global_init ();
gnutls_certificate_allocate_credentials (&gnutls_xcred);
gnutls_certificate_set_x509_trust_file (gnutls_xcred, "ca.pem", GNUTLS_X509_FMT_PEM);
#endif
}
/*
@@ -573,6 +593,9 @@ weechat_welcome_message ()
cfg_look_startup_version)
gui_printf_color (NULL, COLOR_WIN_CHAT_PREFIX1,
"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
wee_log_printf ("%s (%s %s %s)\n",
PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
}
/*
@@ -602,6 +625,12 @@ wee_shutdown (int return_code)
if (local_charset)
free (local_charset);
alias_free_all ();
#ifdef HAVE_GNUTLS
gnutls_certificate_free_credentials (gnutls_xcred);
gnutls_global_deinit();
#endif
exit (return_code);
}
@@ -625,7 +654,7 @@ wee_dump (int crash)
if (crash)
{
sigsegv = 1;
wee_log_printf ("very bad, WeeChat is crashing (SIGSEGV received)...\n");
wee_log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)...\n");
}
wee_log_printf ("\n");
@@ -734,7 +763,9 @@ main (int argc, char *argv[])
textdomain (PACKAGE);
#endif
#ifdef HAVE_LANGINFO_CODESET
local_charset = strdup (nl_langinfo (CODESET));
#endif
signal (SIGINT, my_sigint); /* ignore SIGINT signal */
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */
@@ -761,8 +792,8 @@ main (int argc, char *argv[])
}
gui_init (); /* init WeeChat interface */
plugin_init (); /* init plugin interface(s) */
weechat_welcome_message (); /* display WeeChat welcome message */
plugin_init (); /* init plugin interface(s) */
/* auto-connect to servers */
server_auto_connect (server_cmd_line);
fifo_create (); /* create FIFO pipe for remote control */
+14 -2
View File
@@ -28,9 +28,17 @@
#include <stdio.h>
#include <sys/time.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#if defined(ENABLE_NLS) && !defined(_)
#include <locale.h>
#include <libintl.h>
#ifdef HAVE_LIBINTL_H
#include <libintl.h>
#else
#include "../../intl/libintl.h"
#endif
#define _(x) gettext(x)
#ifdef gettext_noop
#define N_(string) gettext_noop (string)
@@ -78,7 +86,7 @@
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
"Usage: %s [options ...]\n" \
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
" or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]\n\n"
#define WEE_USAGE2 \
" -c, --config display config file options\n" \
@@ -104,6 +112,10 @@ extern int quit_weechat;
extern char *weechat_home;
extern char *local_charset;
#ifdef HAVE_GNUTLS
extern gnutls_certificate_credentials gnutls_xcred;
#endif
extern void wee_log_printf (char *, ...);
extern void wee_dump (int);
extern char *weechat_convert_encoding (char *, char *, char *);
+149 -18
View File
@@ -66,6 +66,7 @@ char *cfg_look_weechat_slogan;
char *cfg_look_charset_decode;
char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks;
int cfg_look_color_actions;
int cfg_look_remove_colors_from_msgs;
@@ -112,6 +113,10 @@ t_config_option weechat_options_look[] =
N_("internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"ISO-8859-1", NULL, NULL, &cfg_look_charset_internal, config_change_buffer_content },
{ "look_buffer_timestamp", N_("timestamp for buffers"),
N_("timestamp for buffers"),
OPTION_TYPE_STRING, 0, 0, 0,
"[%H:%M:%S]", NULL, NULL, &cfg_look_buffer_timestamp, config_change_buffer_content },
{ "look_color_nicks", N_("display nick names with different colors"),
N_("display nick names with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -210,6 +215,7 @@ int cfg_col_nick_chanadmin;
int cfg_col_nick_op;
int cfg_col_nick_halfop;
int cfg_col_nick_voice;
int cfg_col_nick_more;
int cfg_col_nick_sep;
int cfg_col_nick_self;
int cfg_col_nick_private;
@@ -370,6 +376,10 @@ t_config_option weechat_options_colors[] =
N_("color for voice symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_nick_voice, NULL, &config_change_color },
{ "col_nick_more", N_("color for '+' when scrolling nicks"),
N_("color for '+' when scrolling nicks"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightmagenta", NULL, &cfg_col_nick_more, NULL, &config_change_color },
{ "col_nick_sep", N_("color for nick separator"),
N_("color for nick separator"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -504,7 +514,7 @@ t_config_option weechat_options_irc[] =
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
{ "irc_default_msg_quit", N_("default quit message"),
N_("default quit message ('%v' will be replaced by WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -587,8 +597,13 @@ t_config_option weechat_options_dcc[] =
/* config, proxy section */
int cfg_proxy_use;
int cfg_proxy_type;
int cfg_proxy_ipv6;
char *cfg_proxy_type_values[] =
{ "http", "socks4", "socks5", NULL };
char *cfg_proxy_address;
int cfg_proxy_port;
char *cfg_proxy_username;
char *cfg_proxy_password;
t_config_option weechat_options_proxy[] =
@@ -596,14 +611,26 @@ t_config_option weechat_options_proxy[] =
N_("use a proxy server to connect to irc server"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_proxy_use, NULL, config_change_noop },
{ "proxy_type", N_("proxy type"),
N_("proxy type (http (default), socks4, socks5)"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"http", cfg_proxy_type_values, &cfg_proxy_type, NULL, config_change_noop },
{ "proxy_ipv6", N_("use ipv6 proxy"),
N_("connect to proxy in ipv6"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_proxy_ipv6, NULL, config_change_noop },
{ "proxy_address", N_("proxy address"),
N_("proxy server address (IP or hostname)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_address, config_change_noop },
{ "proxy_port", N_("port for proxy"),
N_("port for connecting to proxy server"),
OPTION_TYPE_INT, 0, 65535, 1080,
OPTION_TYPE_INT, 0, 65535, 3128,
NULL, NULL, &cfg_proxy_port, NULL, config_change_noop },
{ "proxy_username", N_("proxy username"),
N_("username for proxy server"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_username, config_change_noop },
{ "proxy_password", N_("proxy password"),
N_("password for proxy server"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -640,6 +667,14 @@ t_config_option weechat_options_server[] =
N_("port for connecting to server"),
OPTION_TYPE_INT, 0, 65535, 6667,
NULL, NULL, &(cfg_server.port), NULL, NULL },
{ "server_ipv6", N_("use IPv6 protocol for server communication"),
N_("use IPv6 protocol for server communication"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &(cfg_server.ipv6), NULL, NULL },
{ "server_ssl", N_("use SSL for server communication"),
N_("use SSL for server communication"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &(cfg_server.ssl), NULL, NULL },
{ "server_password", N_("server password"),
N_("password for IRC server"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -680,6 +715,10 @@ t_config_option weechat_options_server[] =
N_("automatically rejoin channels when kicked"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &(cfg_server.autorejoin), NULL, NULL },
{ "server_notify_levels", N_("notify levels for channels of this server"),
N_("comma separated list of notify levels for channels of this server (format: #channel:1,..)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.notify_levels), config_change_notify_levels },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -824,6 +863,23 @@ config_change_fifo_pipe ()
}
}
/*
* config_change_notify_levels: called when notify levels is changed for a server
*/
void
config_change_notify_levels ()
{
t_gui_buffer *ptr_buffer;
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (BUFFER_IS_CHANNEL(ptr_buffer) || BUFFER_IS_PRIVATE(ptr_buffer))
ptr_buffer->notify_level =
channel_get_notify_level (SERVER(ptr_buffer), CHANNEL(ptr_buffer));
}
}
/*
* config_option_set_value: set new value for an option
* return: 0 if success
@@ -889,6 +945,10 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
return (void *)(&server->address);
if (strcasecmp (option_name, "server_port") == 0)
return (void *)(&server->port);
if (strcasecmp (option_name, "server_ipv6") == 0)
return (void *)(&server->ipv6);
if (strcasecmp (option_name, "server_ssl") == 0)
return (void *)(&server->ssl);
if (strcasecmp (option_name, "server_password") == 0)
return (void *)(&server->password);
if (strcasecmp (option_name, "server_nick1") == 0)
@@ -909,6 +969,8 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
return (void *)(&server->autojoin);
if (strcasecmp (option_name, "server_autorejoin") == 0)
return (void *)(&server->autorejoin);
if (strcasecmp (option_name, "server_notify_levels") == 0)
return (void *)(&server->notify_levels);
/* option not found */
return NULL;
}
@@ -978,6 +1040,8 @@ config_set_server_value (t_irc_server *server, char *option_name,
*((char **)ptr_data) = strdup (value);
break;
}
if (ptr_option->handler_change != NULL)
(void) (ptr_option->handler_change());
return 0;
}
@@ -1007,6 +1071,72 @@ config_option_search (char *option_name)
return NULL;
}
/*
* config_option_search_option_value: look for type and value of an option
* (including server options)
* if option is not found, NULL is returned
*/
void
config_option_search_option_value (char *option_name, t_config_option **option,
void **option_value)
{
t_config_option *ptr_option;
t_irc_server *ptr_server;
int i;
void *ptr_value;
char *pos;
ptr_option = NULL;
ptr_value = NULL;
ptr_option = config_option_search (option_name);
if (!ptr_option)
{
pos = strchr (option_name, '.');
if (pos)
{
pos[0] = '\0';
ptr_server = server_search (option_name);
if (ptr_server)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
if (strcmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name,
pos + 1) == 0)
{
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
ptr_value = config_get_server_option_ptr (ptr_server, pos + 1);
break;
}
}
}
pos[0] = '.';
}
}
else
{
switch (ptr_option->option_type)
{
case OPTION_TYPE_BOOLEAN:
case OPTION_TYPE_INT:
case OPTION_TYPE_INT_WITH_STRING:
case OPTION_TYPE_COLOR:
ptr_value = (void *)(ptr_option->ptr_int);
break;
case OPTION_TYPE_STRING:
ptr_value = (void *)(ptr_option->ptr_string);
break;
}
}
if (ptr_option)
{
*option = ptr_option;
*option_value = ptr_value;
}
}
/*
* config_set_value: set new value for an option (found by name)
* return: 0 if success
@@ -1058,12 +1188,13 @@ config_allocate_server (char *filename, int line_number)
return 0;
}
if (!server_new (cfg_server.name,
cfg_server.autoconnect, cfg_server.autoreconnect,
cfg_server.autoreconnect_delay, 0, cfg_server.address, cfg_server.port,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin))
cfg_server.autoconnect, cfg_server.autoreconnect,
cfg_server.autoreconnect_delay, 0, cfg_server.address,
cfg_server.port, cfg_server.ipv6, cfg_server.ssl,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin, cfg_server.notify_levels))
{
server_free_all ();
gui_printf (NULL,
@@ -1379,7 +1510,7 @@ config_create_default ()
}
printf (_("%s: creating default config file...\n"), PACKAGE_NAME);
wee_log_printf (_("creating default config file\n"));
wee_log_printf (_("Creating default config file\n"));
current_time = time (NULL);
fprintf (file, _("#\n# %s configuration file, created by "
@@ -1392,10 +1523,6 @@ config_create_default ()
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
{
switch (weechat_options[i][j].option_type)
@@ -1461,6 +1588,8 @@ config_create_default ()
fprintf (file, "server_autoreconnect_delay=30\n");
fprintf (file, "server_address=irc.freenode.net\n");
fprintf (file, "server_port=6667\n");
fprintf (file, "server_ipv6=off\n");
fprintf (file, "server_ssl=off\n");
fprintf (file, "server_password=\n");
/* Get the user's name from /etc/passwd */
@@ -1551,7 +1680,7 @@ config_write (char *config_name)
return -1;
}
wee_log_printf (_("saving config to disk\n"));
wee_log_printf (_("Saving config to disk\n"));
current_time = time (NULL);
fprintf (file, _("#\n# %s configuration file, created by "
@@ -1564,10 +1693,6 @@ config_write (char *config_name)
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
for (j = 0; weechat_options[i][j].option_name; j++)
{
switch (weechat_options[i][j].option_type)
@@ -1637,6 +1762,10 @@ config_write (char *config_name)
ptr_server->autoreconnect_delay);
fprintf (file, "server_address=%s\n", ptr_server->address);
fprintf (file, "server_port=%d\n", ptr_server->port);
fprintf (file, "server_ipv6=%s\n",
(ptr_server->ipv6) ? "on" : "off");
fprintf (file, "server_ssl=%s\n",
(ptr_server->ssl) ? "on" : "off");
fprintf (file, "server_password=%s\n",
(ptr_server->password) ? ptr_server->password : "");
fprintf (file, "server_nick1=%s\n", ptr_server->nick1);
@@ -1651,6 +1780,8 @@ config_write (char *config_name)
(ptr_server->autojoin) ? ptr_server->autojoin : "");
fprintf (file, "server_autorejoin=%s\n",
(ptr_server->autorejoin) ? "on" : "off");
fprintf (file, "server_notify_levels=%s\n",
(ptr_server->notify_levels) ? ptr_server->notify_levels : "");
}
}
+8
View File
@@ -83,6 +83,7 @@ extern char *cfg_look_weechat_slogan;
extern char *cfg_look_charset_decode;
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_actions;
extern int cfg_look_remove_colors_from_msgs;
@@ -132,6 +133,7 @@ extern int cfg_col_nick_chanadmin;
extern int cfg_col_nick_op;
extern int cfg_col_nick_halfop;
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_private;
@@ -176,8 +178,12 @@ extern int cfg_dcc_auto_rename;
extern int cfg_dcc_auto_resume;
extern int cfg_proxy_use;
extern int cfg_proxy_type;
extern char *cfg_proxy_type_values[];
extern int cfg_proxy_ipv6;
extern char *cfg_proxy_address;
extern int cfg_proxy_port;
extern char *cfg_proxy_username;
extern char *cfg_proxy_password;
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
@@ -191,8 +197,10 @@ extern void config_change_buffer_content ();
extern void config_change_color ();
extern void config_change_away_check ();
extern void config_change_fifo_pipe ();
extern void config_change_notify_levels ();
extern int config_option_set_value (t_config_option *, char *);
extern t_config_option *config_option_search (char *);
extern void config_option_search_option_value (char *, t_config_option **, void **);
extern int config_set_value (char *, char *);
extern void *config_get_server_option_ptr (t_irc_server *, char *);
extern int config_set_server_value (t_irc_server *, char *, char *);
+12 -1
View File
@@ -15,10 +15,21 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
noinst_LIBRARIES = lib_weechat_gui_common.a
lib_weechat_gui_common_a_SOURCES = gui-common.c \
gui.h
if GUI_NCURSES
curses_dir=curses
endif
if GUI_WXWIDGETS
wxwidgets_dir=wxwidgets
endif
if GUI_GTK
gtk_dir=gtk
endif
@@ -27,4 +38,4 @@ if GUI_QT
qt_dir=qt
endif
SUBDIRS = $(curses_dir) $(gtk_dir) $(qt_dir)
SUBDIRS = . $(curses_dir) $(wxwidgets_dir) $(gtk_dir) $(qt_dir)
+5 -5
View File
@@ -19,12 +19,12 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
bin_PROGRAMS = weechat-curses
weechat_curses_LDADD = ../../common/lib_weechat_main.a \
weechat_curses_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(NCURSES_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS) \
$(GNUTLS_LIBS)
weechat_curses_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
weechat_curses_SOURCES = gui-display.c \
gui-input.c
+313 -126
View File
@@ -30,6 +30,7 @@
#include <string.h>
#include <signal.h>
#include <time.h>
#include <ctype.h>
#include <ncurses.h>
#include "../../common/weechat.h"
@@ -65,6 +66,7 @@ char *nicks_colors[COLOR_WIN_NICK_NUMBER] =
int color_attr[NUM_COLORS];
/*
* gui_assign_color: assign a color (read from config)
*/
@@ -141,7 +143,7 @@ gui_get_color_by_value (int color_value)
void
gui_window_set_color (WINDOW *window, int num_color)
{
if (has_colors)
if (has_colors ())
{
if (color_attr[num_color - 1] & A_BOLD)
wattron (window, COLOR_PAIR (num_color) | A_BOLD);
@@ -763,6 +765,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
wprintw (ptr_win->win_chat, ">");
for (j = 0; j < 10 - num_bars; j++)
wprintw (ptr_win->win_chat, " ");
if (ptr_dcc->size < 1024*10)
num_unit = 0;
else if (ptr_dcc->size < 1024*1024)
@@ -777,20 +780,31 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
unit_format[num_unit],
unit_format[num_unit]);
wprintw (ptr_win->win_chat, format,
((long double) ptr_dcc->pos) / ((long double)(unit_divide[num_unit])),
((long double)(ptr_dcc->pos)) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit],
((long double) ptr_dcc->size) / ((long double)(unit_divide[num_unit])),
((long double)(ptr_dcc->size)) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
if (ptr_dcc->bytes_per_sec < 1024*1024)
num_unit = 1;
else if (ptr_dcc->bytes_per_sec < 1024*1024*1024)
num_unit = 2;
else
num_unit = 3;
sprintf (format, " (%s %%s/s)", unit_format[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]);
wclrtoeol (ptr_win->win_chat);
}
else
{
date_tmp = localtime (&(ptr_dcc->start_time));
strftime (date, sizeof (date) - 1, "%a, %d %b %Y %H:%M:%S", date_tmp);
wprintw (ptr_win->win_chat, " %s", date);
wclrtoeol (ptr_win->win_chat);
}
wclrtoeol (ptr_win->win_chat);
ptr_win->dcc_last_displayed = ptr_dcc;
i += 2;
}
@@ -860,7 +874,7 @@ void
gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
int i, x, y, column, max_length;
int i, j, x, y, column, max_length, nicks_displayed;
char format[32], format_empty[32];
t_irc_nick *ptr_nick;
@@ -943,71 +957,103 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
x = 0;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0;
column = 0;
for (ptr_nick = CHANNEL(buffer)->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_height - 1);
else
nicks_displayed = ptr_win->win_nick_height;
ptr_nick = CHANNEL(buffer)->nicks;
for (i = 0; i < ptr_win->win_nick_start; i++)
{
switch (cfg_look_nicklist_position)
if (!ptr_nick)
break;
ptr_nick = ptr_nick->next_nick;
}
if (ptr_nick)
{
for (i = 0; i < nicks_displayed; i++)
{
case CFG_LOOK_NICKLIST_LEFT:
x = 0;
break;
case CFG_LOOK_NICKLIST_RIGHT:
x = 1;
break;
case CFG_LOOK_NICKLIST_TOP:
case CFG_LOOK_NICKLIST_BOTTOM:
x = column;
break;
}
if (ptr_nick->is_chanowner)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANOWNER);
mvwprintw (ptr_win->win_nick, y, x, "~");
x++;
}
else if (ptr_nick->is_chanadmin)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANADMIN);
mvwprintw (ptr_win->win_nick, y, x, "&");
x++;
}
else if (ptr_nick->is_op)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_OP);
mvwprintw (ptr_win->win_nick, y, x, "@");
x++;
}
else if (ptr_nick->is_halfop)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_HALFOP);
mvwprintw (ptr_win->win_nick, y, x, "%%");
x++;
}
else if (ptr_nick->has_voice)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_VOICE);
mvwprintw (ptr_win->win_nick, y, x, "+");
x++;
}
else
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, " ");
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
y++;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
{
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
switch (cfg_look_nicklist_position)
{
column += max_length + 2;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
0 : 1;
case CFG_LOOK_NICKLIST_LEFT:
x = 0;
break;
case CFG_LOOK_NICKLIST_RIGHT:
x = 1;
break;
case CFG_LOOK_NICKLIST_TOP:
case CFG_LOOK_NICKLIST_BOTTOM:
x = column;
break;
}
if ( ((i == 0) && (ptr_win->win_nick_start > 0))
|| ((i == nicks_displayed - 1) && (ptr_nick->next_nick)) )
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_MORE);
j = (max_length + 1) >= 4 ? 4 : max_length + 1;
for (x = 1; x <= j; x++)
mvwprintw (ptr_win->win_nick, y, x, "+");
}
else
{
if (ptr_nick->is_chanowner)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANOWNER);
mvwprintw (ptr_win->win_nick, y, x, "~");
x++;
}
else if (ptr_nick->is_chanadmin)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_CHANADMIN);
mvwprintw (ptr_win->win_nick, y, x, "&");
x++;
}
else if (ptr_nick->is_op)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_OP);
mvwprintw (ptr_win->win_nick, y, x, "@");
x++;
}
else if (ptr_nick->is_halfop)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_HALFOP);
mvwprintw (ptr_win->win_nick, y, x, "%%");
x++;
}
else if (ptr_nick->has_voice)
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK_VOICE);
mvwprintw (ptr_win->win_nick, y, x, "+");
x++;
}
else
{
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, " ");
x++;
}
gui_window_set_color (ptr_win->win_nick,
(ptr_nick->is_away) ?
COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
mvwprintw (ptr_win->win_nick, y, x, format, ptr_nick->nick);
ptr_nick = ptr_nick->next_nick;
if (!ptr_nick)
break;
}
y++;
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
{
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
{
column += max_length + 2;
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
0 : 1;
}
}
}
}
@@ -1269,7 +1315,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
x = ptr_win->win_width - strlen (str_nicks) - 4;
}
else
x = ptr_win->win_width;
x = ptr_win->win_width - 2;
string = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
@@ -1282,7 +1328,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
mvwprintw (ptr_win->win_status, 0, x, "%s", string);
else
{
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", strlen (string));
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", (int)(strlen (string)));
mvwprintw (ptr_win->win_status, 0, x, format_more, " ");
}
if (gui_buffer_has_nicklist (ptr_win->buffer))
@@ -1313,7 +1359,7 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
t_gui_window *ptr_win;
time_t time_seconds;
struct tm *local_time;
char text[1024 + 1];
char text_time[1024 + 1];
/* make gcc happy */
(void) buffer;
@@ -1338,9 +1384,9 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
local_time = localtime (&time_seconds);
if (local_time)
{
strftime (text, 1024, cfg_look_infobar_timestamp, local_time);
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
wprintw (ptr_win->win_infobar, "%s", text);
wprintw (ptr_win->win_infobar, "%s", text_time);
}
if (gui_infobar)
{
@@ -1552,6 +1598,7 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
gui_current_window->buffer->num_displayed--;
window->buffer = buffer;
window->win_nick_start = 0;
gui_calculate_pos_size (window);
/* destroy Curses windows */
@@ -1800,6 +1847,100 @@ gui_move_page_down (t_gui_window *window)
}
}
/*
* gui_nick_move_beginning: go to beginning of nicklist
*/
void
gui_nick_move_beginning (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if (window->win_nick_start > 0)
{
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_end: go to the end of nicklist
*/
void
gui_nick_move_end (t_gui_window *window)
{
int new_start;
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
new_start = 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 != window->win_nick_start)
{
window->win_nick_start = new_start;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_page_up: scroll one page up in nicklist
*/
void
gui_nick_move_page_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if (window->win_nick_start > 0)
{
window->win_nick_start -= (window->win_nick_height - 1);
if (window->win_nick_start <= 1)
window->win_nick_start = 0;
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_nick_move_page_down: scroll one page down in nicklist
*/
void
gui_nick_move_page_down (t_gui_window *window)
{
if (!gui_ok)
return;
if (gui_buffer_has_nicklist (window->buffer))
{
if ((CHANNEL(window->buffer)->nicks_count > window->win_nick_height)
&& (window->win_nick_start + window->win_nick_height - 1 < CHANNEL(window->buffer)->nicks_count))
{
if (window->win_nick_start == 0)
window->win_nick_start += (window->win_nick_height - 1);
else
window->win_nick_start += (window->win_nick_height - 2);
gui_draw_buffer_nick (window->buffer, 1);
}
}
}
/*
* gui_window_init_subviews: init subviews for a WeeChat window
*/
@@ -2130,91 +2271,93 @@ gui_init_colors ()
use_default_colors ();
init_pair (COLOR_WIN_TITLE,
cfg_col_title & A_CHARTEXT, cfg_col_title_bg);
cfg_col_title, cfg_col_title_bg);
init_pair (COLOR_WIN_CHAT,
cfg_col_chat & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_TIME,
cfg_col_chat_time & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_time, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_TIME_SEP,
cfg_col_chat_time_sep & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_time_sep, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX1,
cfg_col_chat_prefix1 & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_prefix1, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_PREFIX2,
cfg_col_chat_prefix2 & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_prefix2, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_NICK,
cfg_col_chat_nick & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_nick, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HOST,
cfg_col_chat_host & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_host, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_CHANNEL,
cfg_col_chat_channel & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_channel, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_DARK,
cfg_col_chat_dark & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_dark, cfg_col_chat_bg);
init_pair (COLOR_WIN_CHAT_HIGHLIGHT,
cfg_col_chat_highlight & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_chat_highlight, cfg_col_chat_bg);
init_pair (COLOR_WIN_STATUS,
cfg_col_status & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DELIMITERS,
cfg_col_status_delimiters & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_delimiters, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_MSG,
cfg_col_status_data_msg & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_msg, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_HIGHLIGHT,
cfg_col_status_data_highlight & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_highlight, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_DATA_OTHER,
cfg_col_status_data_other & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_data_other, cfg_col_status_bg);
init_pair (COLOR_WIN_STATUS_MORE,
cfg_col_status_more & A_CHARTEXT, cfg_col_status_bg);
cfg_col_status_more, cfg_col_status_bg);
init_pair (COLOR_WIN_INFOBAR,
cfg_col_infobar & A_CHARTEXT, cfg_col_infobar_bg);
cfg_col_infobar, cfg_col_infobar_bg);
init_pair (COLOR_WIN_INFOBAR_HIGHLIGHT,
cfg_col_infobar_highlight & A_CHARTEXT, cfg_col_infobar_bg);
cfg_col_infobar_highlight, cfg_col_infobar_bg);
init_pair (COLOR_WIN_INPUT,
cfg_col_input & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input, cfg_col_input_bg);
init_pair (COLOR_WIN_INPUT_CHANNEL,
cfg_col_input_channel & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input_channel, cfg_col_input_bg);
init_pair (COLOR_WIN_INPUT_NICK,
cfg_col_input_nick & A_CHARTEXT, cfg_col_input_bg);
cfg_col_input_nick, cfg_col_input_bg);
init_pair (COLOR_WIN_NICK,
cfg_col_nick & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_AWAY,
cfg_col_nick_away & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_away, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_CHANOWNER,
cfg_col_nick_chanowner & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_chanowner, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_CHANADMIN,
cfg_col_nick_chanadmin & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_chanadmin, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_OP,
cfg_col_nick_op & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_op, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_HALFOP,
cfg_col_nick_halfop & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_halfop, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_VOICE,
cfg_col_nick_voice & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_voice, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_MORE,
cfg_col_nick_more, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SEP,
cfg_col_nick_sep & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_sep, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_SELF,
cfg_col_nick_self & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_self, cfg_col_nick_bg);
init_pair (COLOR_WIN_NICK_PRIVATE,
cfg_col_nick_private & A_CHARTEXT, cfg_col_nick_bg);
cfg_col_nick_private, cfg_col_nick_bg);
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
{
gui_assign_color (&color, nicks_colors[i]);
init_pair (COLOR_WIN_NICK_FIRST + i, color & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_WIN_NICK_FIRST + i, color, cfg_col_chat_bg);
color_attr[COLOR_WIN_NICK_FIRST + i - 1] = (color >= 0) ? color & A_BOLD : 0;
}
init_pair (COLOR_DCC_SELECTED,
cfg_col_dcc_selected & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_selected, cfg_col_chat_bg);
init_pair (COLOR_DCC_WAITING,
cfg_col_dcc_waiting & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_waiting, cfg_col_chat_bg);
init_pair (COLOR_DCC_CONNECTING,
cfg_col_dcc_connecting & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_connecting, cfg_col_chat_bg);
init_pair (COLOR_DCC_ACTIVE,
cfg_col_dcc_active & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_active, cfg_col_chat_bg);
init_pair (COLOR_DCC_DONE,
cfg_col_dcc_done & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_done, cfg_col_chat_bg);
init_pair (COLOR_DCC_FAILED,
cfg_col_dcc_failed & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_failed, cfg_col_chat_bg);
init_pair (COLOR_DCC_ABORTED,
cfg_col_dcc_aborted & A_CHARTEXT, cfg_col_chat_bg);
cfg_col_dcc_aborted, cfg_col_chat_bg);
color_attr[COLOR_WIN_TITLE - 1] = (cfg_col_title >= 0) ? cfg_col_title & A_BOLD : 0;
color_attr[COLOR_WIN_CHAT - 1] = (cfg_col_chat >= 0) ? cfg_col_chat & A_BOLD : 0;
@@ -2246,6 +2389,7 @@ gui_init_colors ()
color_attr[COLOR_WIN_NICK_OP - 1] = (cfg_col_nick_op >= 0) ? cfg_col_nick_op & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_HALFOP - 1] = (cfg_col_nick_halfop >= 0) ? cfg_col_nick_halfop & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_VOICE - 1] = (cfg_col_nick_voice >= 0) ? cfg_col_nick_voice & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_MORE - 1] = (cfg_col_nick_more >= 0) ? cfg_col_nick_more & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_SEP - 1] = 0;
color_attr[COLOR_WIN_NICK_SELF - 1] = (cfg_col_nick_self >= 0) ? cfg_col_nick_self & A_BOLD : 0;
color_attr[COLOR_WIN_NICK_PRIVATE - 1] = (cfg_col_nick_private >= 0) ? cfg_col_nick_private & A_BOLD : 0;
@@ -2398,7 +2542,7 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
pos[0] = '\n';
if (buffer->num_displayed > 0)
gui_draw_buffer_chat (buffer, 0);
if (buffer->num_displayed == 0)
if (gui_add_hotlist && (buffer->num_displayed == 0))
{
if (3 - buffer->last_line->line_with_message -
buffer->last_line->line_with_highlight <=
@@ -2423,7 +2567,11 @@ void
gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message, ...)
{
static char buf[8192];
char timestamp[16];
char text_time[1024 + 1];
char text_time_char[2];
time_t time_seconds;
struct tm *local_time;
int time_first_digit, time_last_digit;
char *pos, *buf2, *buf3;
int i, j;
va_list argptr;
@@ -2452,6 +2600,12 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
wee_log_printf ("gui_printf without buffer! this is a bug, please send to developers - thanks\n");
return;
}
if (buffer->dcc)
buffer = gui_buffers;
if (buffer->dcc)
return;
}
va_start (argptr, message);
@@ -2502,19 +2656,52 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
pos = buf3 - 1;
while (pos)
{
/* TODO: read timestamp format from config! */
if ((!buffer->last_line) || (buffer->line_complete))
{
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "[");
snprintf (timestamp, 16, "%02d", date_tmp->tm_hour);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
snprintf (timestamp, 16, "%02d", date_tmp->tm_min);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
snprintf (timestamp, 16, "%02d", date_tmp->tm_sec);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "] ");
time_seconds = time (NULL);
local_time = localtime (&time_seconds);
strftime (text_time, 1024, cfg_look_buffer_timestamp, local_time);
time_first_digit = -1;
time_last_digit = -1;
i = 0;
while (text_time[i])
{
if (isdigit (text_time[i]))
{
if (time_first_digit == -1)
time_first_digit = i;
time_last_digit = i;
}
i++;
}
text_time_char[1] = '\0';
i = 0;
while (text_time[i])
{
text_time_char[0] = text_time[i];
if (time_first_digit < 0)
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
text_time_char);
else
{
if ((i < time_first_digit) || (i > time_last_digit))
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK,
text_time_char);
else
{
if (isdigit (text_time[i]))
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
text_time_char);
else
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP,
text_time_char);
}
}
i++;
}
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, " ");
}
gui_add_message (buffer, type, color, pos + 1);
pos = strchr (pos + 1, '\n');
+65 -39
View File
@@ -53,7 +53,7 @@ gui_read_keyb ()
int key, i;
t_gui_buffer *ptr_buffer;
t_irc_server *ptr_server;
t_irc_dcc *ptr_dcc;
t_irc_dcc *ptr_dcc, *ptr_dcc_next;
char new_char[3], *decoded_string;
t_irc_dcc *dcc_selected;
@@ -72,8 +72,6 @@ gui_read_keyb ()
case KEY_F(3):
case KEY_F(4):
case KEY_F(9):
case KEY_F(11):
case KEY_F(12):
break;
/* previous buffer in window */
case KEY_F(5):
@@ -96,6 +94,12 @@ gui_read_keyb ()
gui_infobar_remove ();
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
break;
case KEY_F(11):
gui_nick_move_page_up (gui_current_window);
break;
case KEY_F(12):
gui_nick_move_page_down (gui_current_window);
break;
/* cursor up */
case KEY_UP:
if (gui_current_window->buffer->dcc)
@@ -416,25 +420,38 @@ gui_read_keyb ()
case KEY_RIGHT:
gui_switch_to_next_buffer (gui_current_window);
break;
/* Alt + home */
case KEY_HOME:
gui_nick_move_beginning (gui_current_window);
break;
/* Alt + end */
case KEY_END:
gui_nick_move_end (gui_current_window);
break;
/* Alt + page up */
case KEY_PPAGE:
gui_nick_move_page_up (gui_current_window);
break;
/* Alt + page down */
case KEY_NPAGE:
gui_nick_move_page_down (gui_current_window);
break;
case 79:
/* TODO: replace 79 by constant name! */
if (key == 79)
if ((key = getch()) != ERR)
{
if ((key = getch()) != ERR)
switch (key)
{
switch (key)
{
/* Control + Right */
case 99:
if (!gui_current_window->buffer->dcc)
gui_move_next_word (gui_current_window->buffer);
break;
/* Control + Left */
case 100:
if (!gui_current_window->buffer->dcc)
gui_move_previous_word (gui_current_window->buffer);
break;
}
/* Control + Right */
case 99:
if (!gui_current_window->buffer->dcc)
gui_move_next_word (gui_current_window->buffer);
break;
/* Control + Left */
case 100:
if (!gui_current_window->buffer->dcc)
gui_move_previous_word (gui_current_window->buffer);
break;
}
}
break;
@@ -502,33 +519,39 @@ gui_read_keyb ()
/* Alt-S: jump to server buffer */
case 's':
case 'S':
if (SERVER(gui_current_window->buffer)->buffer !=
gui_current_window->buffer)
if (!gui_current_window->buffer->dcc)
{
gui_switch_to_buffer (gui_current_window,
SERVER(gui_current_window->buffer)->buffer);
gui_redraw_buffer (gui_current_window->buffer);
if (SERVER(gui_current_window->buffer)->buffer !=
gui_current_window->buffer)
{
gui_switch_to_buffer (gui_current_window,
SERVER(gui_current_window->buffer)->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
break;
/* Alt-X: jump to first channel/private of next server */
case 'x':
case 'X':
ptr_server = SERVER(gui_current_window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
while (ptr_server != SERVER(gui_current_window->buffer))
if (!gui_current_window->buffer->dcc)
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
if (ptr_server != SERVER(gui_current_window->buffer))
{
ptr_buffer = (ptr_server->channels) ?
ptr_server->channels->buffer : ptr_server->buffer;
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (gui_current_window->buffer);
ptr_server = SERVER(gui_current_window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
while (ptr_server != SERVER(gui_current_window->buffer))
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
if (ptr_server != SERVER(gui_current_window->buffer))
{
ptr_buffer = (ptr_server->channels) ?
ptr_server->channels->buffer : ptr_server->buffer;
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
break;
}
@@ -591,10 +614,13 @@ gui_read_keyb ()
case 'p':
case 'P':
gui_current_window->dcc_selected = NULL;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
ptr_dcc = dcc_list;
while (ptr_dcc)
{
ptr_dcc_next = ptr_dcc->next_dcc;
if (DCC_ENDED(ptr_dcc->status))
dcc_free (ptr_dcc);
ptr_dcc = ptr_dcc_next;
}
gui_redraw_buffer (gui_current_window->buffer);
break;
+3 -4
View File
@@ -19,12 +19,11 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GTK_CFLAGS)
bin_PROGRAMS = weechat-gtk
weechat_gtk_LDADD = ../../common/lib_weechat_main.a \
weechat_gtk_LDADD = ../lib_weechat_gui_common.a \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(GTK_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_gtk_SOURCES = ../gui.h \
../gui-common.c \
gui-display.c \
weechat_gtk_SOURCES = gui-display.c \
gui-input.c
+10 -7
View File
@@ -43,6 +43,8 @@
int gui_init_ok = 0; /* = 1 if GUI is initialized */
int gui_ok = 0; /* = 1 if GUI is ok */
/* (0 when term size too small) */
int gui_add_hotlist = 1; /* 0 is for temporarly disable */
/* hotlist add for all buffers */
t_gui_window *gui_windows = NULL; /* pointer to first window */
t_gui_window *last_gui_window = NULL; /* pointer to last window */
@@ -64,7 +66,7 @@ gui_window_new (int x, int y, int width, int height)
t_gui_window *new_window;
#ifdef DEBUG
wee_log_printf ("creating new window (x:%d, y:%d, width:%d, height:%d)\n",
wee_log_printf ("Creating new window (x:%d, y:%d, width:%d, height:%d)\n",
x, y, width, height);
#endif
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
@@ -85,6 +87,7 @@ gui_window_new (int x, int y, int width, int height)
new_window->win_nick_y = 0;
new_window->win_nick_width = 0;
new_window->win_nick_height = 0;
new_window->win_nick_start = 0;
new_window->win_title = NULL;
new_window->win_chat = NULL;
@@ -135,7 +138,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
t_gui_buffer *new_buffer;
#ifdef DEBUG
wee_log_printf ("creating new buffer\n");
wee_log_printf ("Creating new buffer\n");
#endif
/* use first buffer if no server was assigned to this buffer */
@@ -183,7 +186,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
new_buffer->line_complete = 1;
/* notify level */
new_buffer->notify_level = 3;
new_buffer->notify_level = channel_get_notify_level (server, channel);
/* create/append to log file */
new_buffer->log_filename = NULL;
@@ -324,8 +327,7 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
else
wee_log_printf (_("%s not enough memory for infobar message\n"),
WEECHAT_ERROR);
wee_log_printf (_("Not enough memory for infobar message\n"));
free (buf2);
}
@@ -500,7 +502,7 @@ gui_new_line (t_gui_buffer *buffer)
}
else
{
wee_log_printf (_("%s not enough memory for new line!\n"));
wee_log_printf (_("Not enough memory for new line\n"));
return NULL;
}
@@ -543,7 +545,7 @@ gui_new_message (t_gui_buffer *buffer)
}
else
{
wee_log_printf (_("not enough memory!\n"));
wee_log_printf (_("Not enough memory for new message\n"));
return NULL;
}
return new_message;
@@ -840,6 +842,7 @@ gui_window_print_log (t_gui_window *window)
wee_log_printf (" win_nick_y. . . . . : %d\n", window->win_nick_y);
wee_log_printf (" win_nick_width. . . : %d\n", window->win_nick_width);
wee_log_printf (" win_nick_height . . : %d\n", window->win_nick_height);
wee_log_printf (" win_nick_start. . . : %d\n", window->win_nick_start);
wee_log_printf (" win_title . . . . . : 0x%X\n", window->win_title);
wee_log_printf (" win_chat. . . . . . : 0x%X\n", window->win_chat);
wee_log_printf (" win_nick. . . . . . : 0x%X\n", window->win_nick);

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