mirror of
https://github.com/weechat/weechat.git
synced 2026-06-22 19:06:37 +02:00
Compare commits
140 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 89b955c79e | |||
| 3d724fb634 | |||
| 29d0225e4a | |||
| 8416212077 | |||
| c36f08d7d7 | |||
| 1230735c5f | |||
| 77d7b703de | |||
| 60db73c19a | |||
| a9ca2987bb | |||
| 220308e1fa | |||
| 8166d15235 | |||
| 575525d965 | |||
| 6271304832 | |||
| bdf9eadf43 | |||
| 15ea11b57b | |||
| f3390da5e3 | |||
| eeff957278 | |||
| 1eac6d8fdd | |||
| 23696b44da | |||
| 63ffae72af | |||
| 376c8a29d6 | |||
| 8b1e3b9890 | |||
| 1b2c5571e6 | |||
| 4c6c367557 | |||
| 99ad719ab9 | |||
| a68a1f8192 | |||
| 930c40eae1 | |||
| 9238a37351 | |||
| a7c4c7237c | |||
| a9912cd266 | |||
| 1d07964d17 | |||
| 06bd0f9f0e | |||
| 4b1679900a | |||
| 99f03cd2a3 | |||
| 3d41a3fa2f | |||
| 089b167573 | |||
| fc2d9732e5 | |||
| 94a3b5e1ae | |||
| 6b12f19083 | |||
| 8a6d35cf12 | |||
| d286f3922c | |||
| 505b43d15b | |||
| 07a820ced6 | |||
| df6a41566b | |||
| 263606fffb | |||
| d4d065253e | |||
| 673e7680af | |||
| ad1120c84c | |||
| f2a78ebc16 | |||
| fef0932c1d | |||
| 96bd473887 | |||
| 89d107c1a9 | |||
| 54d4fc12a6 | |||
| 55125beee4 | |||
| a724278215 | |||
| e3799797ef | |||
| b738f4c8aa | |||
| 6f3b6d9e50 | |||
| def35c5a66 | |||
| da4ee1a6ee | |||
| 7c31dd9189 | |||
| dbad2a0206 | |||
| ec1d57063c | |||
| 5bd56f86c6 | |||
| 2fab4da03d | |||
| c69c77507c | |||
| b330ec3dae | |||
| ae8f8a5700 | |||
| 5e8b47f187 | |||
| f4abd0bf59 | |||
| abe7e08147 | |||
| 4e9193a943 | |||
| bbd373c44d | |||
| 6b011234cf | |||
| 71a76ada48 | |||
| a7ddb89076 | |||
| 6fe262c131 | |||
| 0a32bc5326 | |||
| 70fe8e9472 | |||
| b0310b6e78 | |||
| 8218316502 | |||
| d00c99f292 | |||
| f72e5952f2 | |||
| ebf5f9e66d | |||
| 7330dc862a | |||
| 9eb1422bb7 | |||
| d86a783b6a | |||
| 5b3f96dace | |||
| 821c2e87c8 | |||
| 1de7b52aa2 | |||
| 4d4a667094 | |||
| 0eb3d45582 | |||
| 7c63a73999 | |||
| 2ab3467c05 | |||
| 37d74c4941 | |||
| 01186c6c8b | |||
| 29ffe7e0d8 | |||
| a8619181b7 | |||
| 5a90270a79 | |||
| 3900a0f5ae | |||
| 5f46617b11 | |||
| 68ec2acbb3 | |||
| e7041a467b | |||
| ee2121b917 | |||
| bff5f95056 | |||
| 2b178c73fa | |||
| 13d8a4f093 | |||
| b935a02ceb | |||
| e7c899014c | |||
| f88b75b241 | |||
| c8ad30020b | |||
| c6fc8bd147 | |||
| eda55fbdb4 | |||
| dca4064502 | |||
| 8a3d30b03a | |||
| 40d02fdffd | |||
| 7cc2635652 | |||
| df2f164ffc | |||
| eb0b722ee5 | |||
| 04d6257224 | |||
| 73c69d2d71 | |||
| 2f9f37bed6 | |||
| d90587c443 | |||
| 992632857f | |||
| 5ebab583f6 | |||
| ca117dbb24 | |||
| 40c348df7a | |||
| 0b781f96f7 | |||
| 5090689a76 | |||
| a92ca4961b | |||
| ae8a4633ef | |||
| 38505d02dd | |||
| 20dcc4f56e | |||
| 36b2e10497 | |||
| cec88e0047 | |||
| 3198879ff2 | |||
| 88a6fc7f16 | |||
| fbcd5b3673 | |||
| 7fe5afe3cb | |||
| 212ca071c6 |
@@ -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.
|
||||
|
||||
|
||||
@@ -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,12 +1,9 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2005-02-12
|
||||
WeeChat known bugs, 2005-07-30
|
||||
|
||||
- ./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
|
||||
|
||||
@@ -1,9 +1,68 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-03-20
|
||||
ChangeLog - 2005-07-30
|
||||
|
||||
|
||||
Version 0.1.4 (2005-07-30):
|
||||
* join and part/quit prefixes (arrows) now displayed with different colors
|
||||
* added "irc_highlight" setting, to get highlight with any word
|
||||
* fixed auto-rejoin for channels with key
|
||||
* fixed /ctcp command (now any command/data allowed)
|
||||
* added /amsg command (send text to all channels of all connected servers)
|
||||
* fixed SIGSEGV handler (now write a core file by aborting program)
|
||||
* fixed statusbar & infobar background refresh problem with some systems
|
||||
* added color for private in hotlist (different than color for highlight)
|
||||
* added DCC resume and timeout
|
||||
* added function for Perl/Python to get DCC list
|
||||
* fixed FIFO pipe (command now authorized on a buffer not connected
|
||||
to an IRC server)
|
||||
* topic completion now decodes UTF-8 string
|
||||
* fixed bug with IRC URL on command line (irc://)
|
||||
* new keyboard management: keys are setup in config file, new command
|
||||
/key was added and some new default keys were added, alt-k key is
|
||||
used to grab key (useful for /key command)
|
||||
* added seconds in infobar time (optional thanks to new setting)
|
||||
* fixed some curses refreshs
|
||||
* channels auto-prefixed by "#" (if no prefix found) for /join command
|
||||
|
||||
Version 0.1.3 (2005-07-02):
|
||||
* proxy support (http, socks4, socks5) with authentification (http, socks5)
|
||||
and ipv6 support (client to proxy)
|
||||
* completion added for config option (with /set command)
|
||||
* commands from users outside channel now authorized (if special user or
|
||||
channel without "n" flag)
|
||||
* added IPv6 support
|
||||
* kill command now received and displayed
|
||||
* added SSL support
|
||||
* channel notify levels are saved in config file (new option
|
||||
"server_notify_levels" for server sections)
|
||||
* part message now accepts %v (replaced by WeeChat version), like quit message
|
||||
* errors while loading perl scripts are now displayed in server buffer
|
||||
(instead of current buffer)
|
||||
* in python scripts, all messages written in stdin and stderr are redirected
|
||||
in server buffer
|
||||
* fix a filename error while loading a python script manually
|
||||
* fixed plugins "print" and "prnt" functions: now ok for writing on server
|
||||
buffers
|
||||
* fixed color problem with new libcurses version
|
||||
* fixed crash when using Alt-S or Alt-X on DCC buffer (Alt-D)
|
||||
* fixed startup crash when config file (~/.weechat/weechat.rc) is not found
|
||||
* improved Perl/Python libs detection for ./configure script
|
||||
|
||||
Version 0.1.2 (2005-05-21):
|
||||
* added Python plugin support, improved Perl interface (and now Perl/Python
|
||||
libraries are checked by configure script)
|
||||
* 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-02-06
|
||||
WeeChat FAQ, 2005-07-30
|
||||
=======================
|
||||
|
||||
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,18 @@ 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),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* many GUI (Curses, Gtk, wxWidgets, Qt)
|
||||
* nicklist available in all GUI
|
||||
* extensible with scripts (Perl, Python, Ruby)
|
||||
* horizontal and vertical window split
|
||||
* infobar highlight
|
||||
* FIFO pipe for remote control
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
This is the "geekest" IRC client ;)
|
||||
|
||||
More info on this page: http://weechat.flashtux.org/features.php
|
||||
|
||||
|
||||
2.2
|
||||
@@ -61,6 +69,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
|
||||
@@ -78,7 +87,9 @@ A: You have to setup charset used for decoding, encoding, and internal WeeChat
|
||||
================================================================================
|
||||
Q: How can I customize key bindings?
|
||||
|
||||
A: Today you can't do that. This is planed for a future version.
|
||||
A: Key bindings are customizable with /key command.
|
||||
Default key Meta-k (usually Alt-k) lets you grab key code and insert it
|
||||
in input zone.
|
||||
|
||||
|
||||
2.5
|
||||
@@ -86,19 +97,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 +163,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 +191,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 :)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-02-06
|
||||
WeeChat FAQ, 2005-07-30
|
||||
=======================
|
||||
|
||||
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,18 @@ 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),
|
||||
* extensible par des scripts (Perl, Python, Ruby),
|
||||
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt)
|
||||
* liste des pseudos disponible dans toutes les interfaces
|
||||
* extensible par des scripts (Perl, Python, Ruby)
|
||||
* découpage de la fenêtre horizontalement et verticalement
|
||||
* highlight dans la barre d'infos
|
||||
* tube FIFO pour contrôle à distance
|
||||
* développé à partir de zéro (non basé sur un quelconque client IRC)
|
||||
* multi-platformes
|
||||
* 100% GPL et libre
|
||||
C'est le client IRC le plus "geek" ;)
|
||||
|
||||
Plus d'infos sur cette page: http://weechat.flashtux.org/features.php
|
||||
|
||||
|
||||
2.2
|
||||
@@ -66,6 +73,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
|
||||
@@ -83,8 +91,9 @@ R: Il faut configurer le charset utilis
|
||||
================================================================================
|
||||
Q: Comment puis-je configurer les raccourcis clavier ?
|
||||
|
||||
R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
|
||||
version future.
|
||||
R: Les raccourcis clavier sont modifiables avec la commande /key.
|
||||
La touche par défaut Meta-k (souvent Alt-k) permet de capturer le code
|
||||
d'une touche et de l'inclure dans la zone de saisie.
|
||||
|
||||
|
||||
2.5
|
||||
@@ -92,20 +101,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 +173,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 +202,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
-4
@@ -15,14 +15,14 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
SUBDIRS = po intl src
|
||||
SUBDIRS = po doc intl src
|
||||
|
||||
EXTRA_DIST = weechat-curses.1 BUGS FAQ FAQ.fr \
|
||||
EXTRA_DIST = config.rpath 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
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2005-07-30
|
||||
|
||||
WeeChat 0.1.4 released.
|
||||
|
||||
* FlashCode, 2005-07-02
|
||||
|
||||
WeeChat 0.1.3 released.
|
||||
|
||||
* FlashCode, 2005-05-21
|
||||
|
||||
WeeChat 0.1.2 released.
|
||||
|
||||
* FlashCode, 2005-03-20
|
||||
|
||||
WeeChat 0.1.1 released.
|
||||
|
||||
@@ -14,7 +14,7 @@ Features
|
||||
* small, fast and very light
|
||||
* customizable and extensible with scripts (Perl, Python, Ruby) (2)
|
||||
* compliant with RFC 1459,2810,2811,2812,2813
|
||||
* developed from scratch (not based on any other IRC client, except for look ;)
|
||||
* developed from scratch
|
||||
* multi-platform (GNU/Linux, *BSD, Windows & other) (3)
|
||||
* 100% GPL & free
|
||||
|
||||
@@ -44,5 +44,5 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---
|
||||
(1) only Curses interface is available today
|
||||
(2) only Perl interface is available today
|
||||
(3) only GNU/Linux version is available today
|
||||
(2) only Perl and Python interfaces are available today
|
||||
(3) only GNU/Linux and *BSD versions are available today
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2005-03-20
|
||||
TODO - 2005-07-20
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -10,31 +10,38 @@ Legend:
|
||||
? is this really necessary?
|
||||
|
||||
|
||||
v0.1.1:
|
||||
v0.1.4:
|
||||
------
|
||||
|
||||
* 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)
|
||||
|
||||
* WeeChat commands
|
||||
- be able to bind a key on more than one command
|
||||
- be able to make an alias running more than one command
|
||||
|
||||
* Configuration:
|
||||
# irc_highlight setting to highlight custom words
|
||||
# save buffer notify levels
|
||||
# add key bindings to config file, and create /key command
|
||||
|
||||
|
||||
Future versions:
|
||||
---------------
|
||||
|
||||
* IRC protocol:
|
||||
- customizable CTCP version reply
|
||||
- complete "/list" command: add regexp search, display only channels that
|
||||
match regexp
|
||||
- "/ignore" and "/unignore" commands: hide all that is write by a given
|
||||
@@ -45,16 +52,10 @@ Future versions:
|
||||
nick/host connect to the given irc network
|
||||
|
||||
* WeeChat commands:
|
||||
- "/reload" command: reload the WeeChat's config file
|
||||
- "/highlight" command: highlight a given word when it appears on
|
||||
channels/privates
|
||||
- "/completion" command: do shortcuts (for example when we type "u"
|
||||
in the text bar it send it to the server as "you")
|
||||
- "/exec" command: execute a command as if we was in shell
|
||||
and show us the output on the current window. An option to exec
|
||||
like -o could send the output to the server, on the current
|
||||
channel/private
|
||||
- "/last": command to look for text in previous messages
|
||||
- completion system for scripts arguments
|
||||
|
||||
* Interface:
|
||||
- color for nicks (except own nick) when nick colors are disabled
|
||||
@@ -62,16 +63,6 @@ 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
|
||||
|
||||
* Configuration:
|
||||
- add key bindings to config file
|
||||
|
||||
+13
-53
@@ -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
|
||||
|
||||
+168
-15
@@ -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.4, 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.4])
|
||||
|
||||
# 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,21 @@ if test "x$debug" = "x2" ; then
|
||||
AC_DEFINE(DEBUG)
|
||||
fi
|
||||
|
||||
dnl For FreeBSD
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
CFLAGS="$CFLAGS $CPPFLAGS"
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
doc/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 +287,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 +298,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 +319,7 @@ echo Build with Plugin support..... : $enable_plugins
|
||||
echo Build with Perl support....... : $enable_perl
|
||||
echo Build with Python support..... : $enable_python
|
||||
echo Build with Ruby support....... : $enable_ruby
|
||||
echo Build with GNUtls support..... : $enable_gnutls
|
||||
echo
|
||||
echo Compile with debug info....... : $msg_debug_compiler
|
||||
echo Print debugging messages...... : $msg_debug_verbose
|
||||
|
||||
Vendored
+41
-1
@@ -1,6 +1,46 @@
|
||||
weechat (0.1.3-2) unstable; urgency=low
|
||||
|
||||
* Update config.{guess,sub} to fix FTBFS on k*BSD (Closes: #316791)
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Fri, 8 Jul 2005 21:30:38 +0200
|
||||
|
||||
weechat (0.1.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sat, 2 Jul 2005 20:06:29 +0200
|
||||
|
||||
weechat (0.1.2-3) unstable; urgency=low
|
||||
|
||||
* Apply patch against gui-display.c to fix curses color bug.
|
||||
* remove dh_install --sourcedir to allow builds on woody.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sun, 19 Jun 2005 22:37:11 +0200
|
||||
|
||||
weechat (0.1.2-2) unstable; urgency=low
|
||||
|
||||
* Patch src/gui/curse/gui-display.c to fix segfault
|
||||
when config file does not exists (Closes: #310589).
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Tue, 24 May 2005 20:55:02 +0200
|
||||
|
||||
weechat (0.1.2-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.1.2, see ChangeLog for detail.
|
||||
|
||||
-- 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
|
||||
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
4
|
||||
Vendored
+4
-3
@@ -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
|
||||
Standards-Version: 3.6.1
|
||||
Uploaders: Julien Louis <ptitlouis@sysif.net>
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev, libgnutls11-dev
|
||||
Standards-Version: 3.6.2.1
|
||||
|
||||
Package: weechat
|
||||
Architecture: all
|
||||
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.
|
||||
|
||||
Vendored
+1
-1
@@ -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
|
||||
|
||||
|
||||
Vendored
+5
-5
@@ -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
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ install: build
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/weechat
|
||||
dh_install --sourcedir=debian/weechat
|
||||
install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
|
||||
dh_install
|
||||
# install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
# install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ binary-arch: build install
|
||||
dh_testroot -a
|
||||
# dh_installchangelogs -a
|
||||
# dh_installdocs -a
|
||||
dh_installman weechat-curses.1 -pweechat-curses
|
||||
dh_installman doc/weechat-curses.1 -pweechat-curses
|
||||
dh_link -a usr/share/doc/weechat-common usr/share/doc/weechat-curses
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
version=2
|
||||
http://weechat.flashtux.org/download/weechat-(\d.*)\.tar\.bz2
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
usr/share/locale
|
||||
debian/tmp/usr/share/locale/
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
usr/bin/weechat-curses
|
||||
debian/tmp/usr/bin/weechat-curses
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
all: weechat_doc_fr.texi weechat_doc_en.texi weechat_doc_pt.texi weechat_doc_es.texi
|
||||
export LANG=fr_FR && makeinfo --html --no-split --number-sections weechat_doc_fr.texi
|
||||
export LANG=fr_FR && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_fr.texi >weechat_doc_fr.txt
|
||||
export LANG=en_EN && makeinfo --html --no-split --number-sections weechat_doc_en.texi
|
||||
export LANG=en_EN && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_en.texi >weechat_doc_en.txt
|
||||
export LANG=es_ES && makeinfo --html --no-split --number-sections weechat_doc_es.texi
|
||||
export LANG=es_ES && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_es.texi >weechat_doc_es.txt
|
||||
export LANG=pt_PT && makeinfo --html --no-split --number-sections weechat_doc_pt.texi
|
||||
export LANG=pt_PT && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_pt.texi >weechat_doc_pt.txt
|
||||
export LANG=fr_FR && texi2pdf weechat_doc_fr.texi
|
||||
export LANG=en_EN && texi2pdf weechat_doc_en.texi
|
||||
export LANG=es_ES && texi2pdf weechat_doc_es.texi
|
||||
export LANG=pt_PT && texi2pdf weechat_doc_pt.texi
|
||||
|
||||
clean:
|
||||
rm -rf weechat_doc_*.aux weechat_doc_*.cp weechat_doc_*.fn \
|
||||
weechat_doc_*.html weechat_doc_*.ky weechat_doc_*.log \
|
||||
weechat_doc_*.pdf weechat_doc_*.pg weechat_doc_*.toc \
|
||||
weechat_doc_*.tp weechat_doc_*.txt weechat_doc_*.vr
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
info_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
#weechat_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
# weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
AM_MAKEINFOHTMLFLAGS = --no-split --number-sections
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH WEECHAT 1 "February 2005" "FlashCode"
|
||||
.TH WEECHAT 1 "July 2005" "FlashCode"
|
||||
|
||||
.SH NAME
|
||||
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
|
||||
@@ -23,10 +23,22 @@ It is compliant with RFCs 1459, 2810, 2811, 2812, and 2813.
|
||||
.br
|
||||
display config file help (list of options)
|
||||
.TP
|
||||
.B \-f, \-\-key\-functions
|
||||
.br
|
||||
display internal functions for keys
|
||||
.TP
|
||||
.B \-h, \-\-help
|
||||
.br
|
||||
display summary of options
|
||||
.TP
|
||||
.B \-i, \-\-irc\-commands
|
||||
.br
|
||||
display IRC commands
|
||||
.TP
|
||||
.B \-k, \-\-keys
|
||||
.br
|
||||
display default keys
|
||||
.TP
|
||||
.B \-l, \-\-license
|
||||
.br
|
||||
display program license
|
||||
@@ -34,12 +46,16 @@ display program license
|
||||
.B \-v, \-\-version
|
||||
.br
|
||||
display WeeChat version
|
||||
.TP
|
||||
.B \-w, \-\-weechat\-commands
|
||||
.br
|
||||
display WeeChat commands
|
||||
|
||||
.SH URL
|
||||
WeeChat can use an URL (Uniform Resource Locator) to automatically connect
|
||||
to an IRC server. These are in the following form:
|
||||
.TP
|
||||
.B irc://[[nickname][:password]@]server[:port][/[#&+!]channel]
|
||||
.B irc[6][s]://[[nickname][:password]@]server[:port][/[#&+!]channel[,channel...]]
|
||||
.TP
|
||||
Exemple to join WeeChat channel support with nick "FlashCode":
|
||||
irc://FlashCode@irc.freenode.net/weechat
|
||||
@@ -53,11 +69,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
|
||||
+479
-159
@@ -35,9 +35,7 @@
|
||||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentation for WeeChat v0.1.4-cvs - July, 16 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -84,27 +82,27 @@ version 2 or higher.
|
||||
@node Description, Pre-requisites, Introduction, Introduction
|
||||
@section Description
|
||||
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
|
||||
designed for many operating systems.@*
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
|
||||
designed for many operating systems.@*
|
||||
@*
|
||||
Main features are:
|
||||
Main features are:
|
||||
@itemize @minus
|
||||
@item
|
||||
multi-servers connection
|
||||
@item
|
||||
many GUI (Graphical User Interface): Curses, Gtk and Qt
|
||||
@item
|
||||
small, fast and light
|
||||
@item
|
||||
customizable and extensible with scripts
|
||||
@item
|
||||
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
|
||||
@item
|
||||
multi-platform (Gnu/Linux, *BSD, Windows and other)
|
||||
@item
|
||||
@item
|
||||
multi-servers connection (with SSL, IPv6, proxy)
|
||||
@item
|
||||
many GUI: Curses, wxWidgets, Gtk and Qt
|
||||
@item
|
||||
small, fast and light
|
||||
@item
|
||||
customizable and extensible with scripts
|
||||
@item
|
||||
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
|
||||
@item
|
||||
multi-platform (Gnu/Linux, *BSD, MacOS X, Windows and other)
|
||||
@item
|
||||
100% GPL, free software
|
||||
@end itemize
|
||||
|
||||
@end itemize
|
||||
|
||||
@*
|
||||
WeeChat homepage is here:@*
|
||||
@uref{http://weechat.flashtux.org}@*
|
||||
@@ -116,20 +114,20 @@ In order to install WeeChat, you @b{need}:@*
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
A running Gnu/Linux system (with compiler tools for source package)
|
||||
A running Gnu/Linux system (with compiler tools for source package)
|
||||
@item
|
||||
"root" privileges (to install WeeChat)
|
||||
@item
|
||||
According to GUI, one of the following libraries:
|
||||
@itemize @minus
|
||||
@item
|
||||
Curses: ncurses library,
|
||||
@item
|
||||
Gtk: *** GUI not developed ***,
|
||||
@item
|
||||
Qt: *** GUI not developed ***,
|
||||
According to GUI, one of the following libraries:
|
||||
@itemize @minus
|
||||
@item
|
||||
Curses: ncurses library,
|
||||
@item
|
||||
Gtk: *** GUI not developed ***,
|
||||
@item
|
||||
Qt: *** GUI not developed ***,
|
||||
@end itemize
|
||||
@end itemize
|
||||
@end itemize
|
||||
|
||||
|
||||
@c ******************************* Installation *******************************
|
||||
@@ -139,31 +137,31 @@ Qt: *** GUI not developed ***,
|
||||
|
||||
@menu
|
||||
* Binary package::
|
||||
* Source package::
|
||||
* Source package::
|
||||
* CVS sources::
|
||||
@end menu
|
||||
|
||||
@node Binary package, Source package, Installation, Installation
|
||||
@section Binary package
|
||||
|
||||
Binary packages are available for these distributions:
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (or any Debian compatible distribution)@*
|
||||
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
|
||||
@item
|
||||
Mandrake/Redhat (or any RPM compatible distribution)@*
|
||||
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
To install: @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (not available!)
|
||||
@item
|
||||
Slackware (not available!)
|
||||
@item
|
||||
Windows (not available!)
|
||||
@end itemize
|
||||
Binary packages are available for these distributions:
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (or any Debian compatible distribution)@*
|
||||
To install: @kbd{apt-get install weechat-curses}
|
||||
@item
|
||||
Mandriva/Redhat (or any RPM compatible distribution)@*
|
||||
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
To install: @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (not available!)
|
||||
@item
|
||||
Slackware (not available!)
|
||||
@item
|
||||
Windows (not available!)
|
||||
@end itemize
|
||||
|
||||
where x.y.z is the version (for example 0.0.1)
|
||||
@*
|
||||
@@ -176,27 +174,27 @@ All you have to do is to run in a console or a terminal:@*
|
||||
@kbd{make}@*
|
||||
Nota: to build only some interfaces, you can give parameters
|
||||
to ./configure, type @kbd{./configure --help} for help about options.@*
|
||||
|
||||
Then get root privileges and install WeeChat:@*
|
||||
@kbd{su}@*
|
||||
(enter root password)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
|
||||
Then get root privileges and install WeeChat:@*
|
||||
@kbd{su}@*
|
||||
(enter root password)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@node CVS sources, , Source package, Installation
|
||||
@section CVS sources
|
||||
|
||||
Warning: CVS sources are for advanced users: it may not compile or not be stable.
|
||||
You're warned!@*
|
||||
|
||||
To get CVS sources, issue these commands:@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
|
||||
(when prompted for a password, just press Enter key)@*
|
||||
|
||||
Warning: CVS sources are for advanced users: it may not compile or not be stable.
|
||||
You're warned!@*
|
||||
|
||||
To get CVS sources, issue these commands:@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
|
||||
(when prompted for a password, just press Enter key)@*
|
||||
|
||||
Execute this script:@*
|
||||
@kbd{./autogen.sh}@*
|
||||
|
||||
Then follow instructions for source package - @xref{Source package}.
|
||||
|
||||
Then follow instructions for source package - @xref{Source package}.
|
||||
|
||||
|
||||
@c ********************************** Usage ***********************************
|
||||
@@ -206,40 +204,47 @@ Then follow instructions for source package - @xref{Source package}.
|
||||
|
||||
@menu
|
||||
* Run WeeChat::
|
||||
* Config file::
|
||||
* Key bindings::
|
||||
* Config file::
|
||||
* Key bindings::
|
||||
* WeeChat commands::
|
||||
* FIFO pipe::
|
||||
@end menu
|
||||
|
||||
@node Run WeeChat, Config file, Usage, Usage
|
||||
@section Run WeeChat
|
||||
|
||||
@subsection Command line parameters
|
||||
|
||||
|
||||
@subsection Command line parameters
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Display config file help (list of options)@*
|
||||
@item -f, --key-functions
|
||||
Display WeeChat internal functions for keys@*
|
||||
@item -h, --help
|
||||
Display help screen@*
|
||||
@item -i, --irc-commands
|
||||
Display IRC commands list@*
|
||||
@item -l, --license
|
||||
Display WeeChat license@*
|
||||
@item -v, --version
|
||||
@item -v, --version
|
||||
Display WeeChat version@*
|
||||
@end table
|
||||
|
||||
@subsection Run WeeChat
|
||||
|
||||
Just issue this command to run WeeChat:@*
|
||||
@item -w, --weechat-commands
|
||||
Display WeeChat commands list@*
|
||||
@end table
|
||||
|
||||
@subsection Run WeeChat
|
||||
|
||||
Just issue this command to run WeeChat:@*
|
||||
@kbd{weechat-curses} (for Curses front-end)@*
|
||||
or @kbd{weechat-wxwidgets} (for wxWidgets front-end)@*
|
||||
or @kbd{weechat-gtk} (for Gtk front-end)@*
|
||||
or @kbd{weechat-qt} (for Qt front-end)@*
|
||||
|
||||
When you run WeeChat for the first time, a default configuration file is
|
||||
created, with default options.@*
|
||||
The default configuration file is: ~/.weechat/weechat.rc@*
|
||||
|
||||
You can edit this file at your convenience to configure WeeChat, or you can
|
||||
or @kbd{weechat-qt} (for Qt front-end)@*
|
||||
|
||||
When you run WeeChat for the first time, a default configuration file is
|
||||
created, with default options.@*
|
||||
The default configuration file is: ~/.weechat/weechat.rc@*
|
||||
|
||||
You can edit this file at your convenience to configure WeeChat, or you can
|
||||
set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
|
||||
|
||||
@node Config file, Key bindings, Run WeeChat, Usage
|
||||
@@ -248,7 +253,6 @@ set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
|
||||
List of options for config file:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item look_set_title
|
||||
Set title for window (terminal for Curses GUI) with name & version@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@@ -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'@*
|
||||
@@ -308,7 +315,10 @@ Enable info bar@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Timestamp for time in infobar@*
|
||||
Type: string (any string), default value: '%B, %A %d %Y - %H:%M'@*
|
||||
Type: string (any string), default value: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Display seconds in infobar time@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Delay (in seconds) for highlight messages in infobar (0 = disable highlight notifications in infobar)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 7@*
|
||||
@@ -375,6 +385,9 @@ Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar
|
||||
Color for info bar text@*
|
||||
Type: color (Curses or Gtk color), default value: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Color for infobar delimiters@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Color for info bar highlight notification@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@@ -414,6 +427,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 +498,7 @@ Default message when away@*
|
||||
Type: string (any string), default value: 'away'@*
|
||||
@item irc_default_msg_part
|
||||
Default part message (leaving channel)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
Type: string (any string), default value: 'WeeChat %v'@*
|
||||
@item irc_default_msg_quit
|
||||
Default quit message ('%v' will be replaced by WeeChat version in string)@*
|
||||
Type: string (any string), default value: 'WeeChat %v'@*
|
||||
@@ -498,6 +514,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 +547,21 @@ Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item proxy_use
|
||||
Use a proxy server to connect to irc server@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item proxy_type
|
||||
Proxy type (http (default), socks4, socks5)@*
|
||||
Type: string (values: 'http', 'socks4', 'socks5'), default value: 'http'@*
|
||||
@item proxy_ipv6
|
||||
Connect to proxy in ipv6@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item proxy_address
|
||||
Proxy server address (IP or hostname)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item proxy_port
|
||||
Port for connecting to proxy server@*
|
||||
Type: integer (values: between 0 and 65535), default value: 1080@*
|
||||
Type: integer (values: between 0 and 65535), default value: 3128@*
|
||||
@item proxy_username
|
||||
Username for proxy server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item proxy_password
|
||||
Password for proxy server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@@ -555,6 +583,12 @@ Type: string (any string), default value: ''@*
|
||||
@item server_port
|
||||
Port for connecting to server@*
|
||||
Type: integer (values: between 0 and 65535), default value: 6667@*
|
||||
@item server_ipv6
|
||||
Use IPv6 protocol for server communication@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item server_ssl
|
||||
Use SSL for server communication@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item server_password
|
||||
Password for IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@@ -585,7 +619,9 @@ Type: string (any string), default value: ''@*
|
||||
@item server_autorejoin
|
||||
Automatically rejoin channels when kicked@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
|
||||
@item server_notify_levels
|
||||
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@end table
|
||||
|
||||
Colors for Curses GUI are:@*
|
||||
@@ -624,11 +660,11 @@ Colors for Curses GUI are:@*
|
||||
|
||||
@node Key bindings, WeeChat commands, Config file, Usage
|
||||
@section Key bindings
|
||||
|
||||
|
||||
@table @kbd
|
||||
@item Left arrow / Right arrow
|
||||
Go to previous / next char in command line@*
|
||||
@*
|
||||
@*
|
||||
@item Ctrl + left arrow / Ctrl + right arrow
|
||||
Go to previous / next word in command line@*
|
||||
@*
|
||||
@@ -638,28 +674,37 @@ Go to the beginning of command line@*
|
||||
@item End / Ctrl + E
|
||||
Go to the end of command line@*
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Erase previous / next char of command line@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
@item Ctrl + K
|
||||
Delete until end of line@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Redraw whole window@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Delete until beginning of line@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Erase previous word of command line@*
|
||||
@*
|
||||
@item Tab
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Erase previous / next char of command line@*
|
||||
@*
|
||||
@item Tab
|
||||
Complete command or nick (@kbd{Tab} again: find next completion)@*
|
||||
@*
|
||||
@item Any char
|
||||
Insert char to cursor position in the command line@*
|
||||
@*
|
||||
@item Enter
|
||||
@*
|
||||
@item Any char
|
||||
Insert char to cursor position in the command line@*
|
||||
@*
|
||||
@item Enter
|
||||
Execute command or send message@*
|
||||
@*
|
||||
@item Up arrow / Down arrow
|
||||
Call again last commands/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
@*
|
||||
@item Up arrow / Down arrow
|
||||
Call again last commands/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Show buffer history@*
|
||||
@*
|
||||
@item F5 / F6
|
||||
@item F5 / F6
|
||||
Switch to previous / next buffer@*
|
||||
@*
|
||||
@item F7 / F8
|
||||
@@ -668,30 +713,54 @@ Switch to previous / next window@*
|
||||
@item F10
|
||||
Remove last infobar message@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Redraw whole window@*
|
||||
@*
|
||||
@item Alt + left arrow / Alt + right arrow
|
||||
@item F11 / F12
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@item Alt + left arrow / Alt + right arrow
|
||||
Same as F5 / F6@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Switch to next buffer with activity (with priority: highlight, message, other)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Display current DCC@*
|
||||
@item Alt + B
|
||||
Go to previous word@*
|
||||
@*
|
||||
@item Alt + R
|
||||
@item Alt + D
|
||||
Delete next word@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Go to next word@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Clear hotlist (activity notification on other buffers)@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J then Alt + D
|
||||
Display current DCC@*
|
||||
@*
|
||||
@item Alt + J then Alt + L
|
||||
Switch to last buffer@*
|
||||
@*
|
||||
@item Alt + J then Alt + S
|
||||
Switch to server buffer@*
|
||||
@*
|
||||
@item Alt + X
|
||||
@item Alt + J then Alt + X
|
||||
Switch to first channel of next server (or server buffer if no channel is opened)@*
|
||||
@*
|
||||
@item Alt + digit (1-9)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item Alt + J then number (01-99)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Grab a key
|
||||
@*
|
||||
@item Alt + R
|
||||
Delete entire line@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node WeeChat commands, FIFO pipe, Key bindings, Usage
|
||||
@@ -700,7 +769,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 +818,38 @@ display help about commands@*
|
||||
@*
|
||||
command: name of a WeeChat or IRC command@*
|
||||
@*
|
||||
@item perl [load filename] | [autoload] | [unload]
|
||||
@item key [key function/command] [unbind key] [functions] [reset -yes]
|
||||
@*
|
||||
bind/unbind keys@*
|
||||
@*
|
||||
key: bind this key to an internal function or a command (beginning by "/")@*
|
||||
unbind: unbind a key (if "all", default bindings are restored)@*
|
||||
functions: list internal functions for key bindings@*
|
||||
reset: restore bindings to the default values and delete ALL personal binding (use carefully!)@*
|
||||
@*
|
||||
@item perl [load filename] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
list/load/unload Perl scripts@*
|
||||
@*
|
||||
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 +885,11 @@ splith: split current window horizontally@*
|
||||
splitv: split current window vertically@*
|
||||
merge: merge window with another@*
|
||||
@*
|
||||
|
||||
@end table
|
||||
|
||||
IRC commands:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item admin [target]
|
||||
@*
|
||||
find information about the administrator of the server@*
|
||||
@@ -980,11 +1064,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 +1256,73 @@ nickname: nickname to search@*
|
||||
count: number of replies to return (full search if negative number)@*
|
||||
target: reply should match this mask@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
Internal functions for keys:@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminate line@*
|
||||
@item tab
|
||||
complete word@*
|
||||
@item backspace
|
||||
delete previous char@*
|
||||
@item delete
|
||||
delete next char@*
|
||||
@item delete_end_line
|
||||
delete until end of line@*
|
||||
@item delete_beginning_line
|
||||
delete until beginning of line@*
|
||||
@item delete_line
|
||||
delete entire line@*
|
||||
@item delete_previous_word
|
||||
delete previous word@*
|
||||
@item delete_next_word
|
||||
delete next word@*
|
||||
@item home
|
||||
go to beginning of line@*
|
||||
@item end
|
||||
go to end of line@*
|
||||
@item left
|
||||
move one char left@*
|
||||
@item previous_word
|
||||
move to previous word@*
|
||||
@item right
|
||||
move one char right@*
|
||||
@item next_word
|
||||
move to next word@*
|
||||
@item up
|
||||
call previous command in history@*
|
||||
@item down
|
||||
call next command in history@*
|
||||
@item page_up
|
||||
scroll one page up@*
|
||||
@item page_down
|
||||
scroll one page down@*
|
||||
@item infobar_clear
|
||||
clear infobar@*
|
||||
@item nick_page_up
|
||||
scroll nicklist one page up@*
|
||||
@item nick_page_down
|
||||
scroll nicklist one page down@*
|
||||
@item nick_beginning
|
||||
display beginning of nicklist@*
|
||||
@item nick_end
|
||||
display end of nicklist@*
|
||||
@item refresh
|
||||
refresh screen@*
|
||||
@item jump_smart
|
||||
jump to buffer with activity@*
|
||||
@item jump_dcc
|
||||
jump to DCC buffer@*
|
||||
@item jump_server
|
||||
jump to server buffer@*
|
||||
@item jump_next_server
|
||||
jump to next server@*
|
||||
@item hotlist_clear
|
||||
clear hotlist@*
|
||||
@item grab_key
|
||||
grab a key@*
|
||||
@end table
|
||||
|
||||
@node FIFO pipe, , WeeChat commands, Usage
|
||||
@@ -1192,15 +1343,19 @@ Some examples:
|
||||
@item @bullet{} change your nick on freenode to "mynick|out":
|
||||
@*
|
||||
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} display text on #weechat channel:
|
||||
@*
|
||||
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
|
||||
@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
|
||||
@*
|
||||
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1251,7 +1406,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 +1422,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 +1456,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 +1475,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 +1501,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 +1548,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 +1556,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 +1792,7 @@ Look for WeeChat support page for detail:@*
|
||||
@node Copyright, , Get support, Authors / Support
|
||||
@section Copyright
|
||||
|
||||
This manual documents WeeChat IRC client, it is part of WeeChat.@*
|
||||
This manual documents WeeChat IRC client, it is part of WeeChat.@*
|
||||
|
||||
Copyright @copyright{} 2005 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
|
||||
+445
-126
@@ -30,14 +30,13 @@
|
||||
@c end tex
|
||||
|
||||
@documentlanguage es
|
||||
@documentencoding ISO-8859-1
|
||||
|
||||
@titlepage
|
||||
|
||||
@title WeeChat - Gui@'on de usuario.
|
||||
@subtitle Cliente IRC r@'apido, peque@~no y extensible
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.1 - 20 de marzo de 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.4-cvs - 16 de Julio de 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -90,9 +89,9 @@ dise@~nado para diferentes sistemas operativos.@*
|
||||
Las caracter@'isticas principales son las siguientes:
|
||||
@itemize @minus
|
||||
@item
|
||||
conexi@'on multi-servidores
|
||||
conexi@'on multi-servidores (con SSL, IPv6, proxy)
|
||||
@item
|
||||
m@'ultiples interfaces: Curses, Gtk y Qt
|
||||
m@'ultiples interfaces: Curses, wxWidgets, Gtk y Qt
|
||||
@item
|
||||
peque@~no, r@'apido y ligero.
|
||||
@item
|
||||
@@ -100,7 +99,7 @@ parametrizable y extensible mediante guiones (scripts)
|
||||
@item
|
||||
conforme a las RFCs 1459, 2810, 2811, 2812, y 2813
|
||||
@item
|
||||
multi-plataforma (Gnu/Linux, *BSD, Windows y otros sistemas operativos)
|
||||
multi-plataforma (Gnu/Linux, *BSD, MacOS X, Windows y otros sistemas operativos)
|
||||
@item
|
||||
100% GPL, con Licencia Libre
|
||||
@end itemize
|
||||
@@ -150,7 +149,7 @@ Los paquetes binarios est@'an disponibles para las siguientes distribuciones:
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (o compatible con Debian)@*
|
||||
Para instalar WeeChat: @kbd{dpkg -i /direccion/weechat_x.y.z-1_i386.deb}
|
||||
Para instalar WeeChat: @kbd{apt-get install weechat-curses}
|
||||
@item
|
||||
Mandrake/Redhat (o cualquier distribuci@'on compatible con los paquetes RPM)@*
|
||||
Para instalar WeeChat: @kbd{rpm -i /direccion/weechat-x.y.z-1.i386.rpm}
|
||||
@@ -187,7 +186,7 @@ Adquiere los derechos de root e instala WeeChat:@*
|
||||
|
||||
Atenci@'on: Las fuentes CVS est@'an reservadas para usuarios con experiencia: Es posible que WeeChat no
|
||||
se instale o que se sea bastante inestable.
|
||||
¡Ya te he avisado!@*
|
||||
@exclamdown{}Ya te he avisado!@*
|
||||
|
||||
Para recuperar las fuentes CVS, escribe las l@'ineas siguientes:@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@@ -210,7 +209,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
|
||||
@@ -221,18 +220,25 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Obtener la ayuda del fichero de configuraci@'on (lista de opciones)@*
|
||||
@item -f, --key-functions
|
||||
Display WeeChat internal functions for keys@*
|
||||
@item -h, --help
|
||||
Obtener la ayuda@*
|
||||
@item -i, --irc-commands
|
||||
Display IRC commands list@*
|
||||
@item -l, --license
|
||||
Obtener la licencia de WeeChat@*
|
||||
@item -v, --version
|
||||
Obtener la versi@'on de WeeChat@*
|
||||
@item -w, --weechat-commands
|
||||
Display WeeChat commands list@*
|
||||
@end table
|
||||
|
||||
@subsection Lanzar WeeChat
|
||||
|
||||
Para ejecutar WeeChat, basta escribir la l@'inea siguiente:@*
|
||||
@kbd{weechat-curses} (para el interfaz con Curses)@*
|
||||
o @kbd{weechat-wxwidgets} (para el interfaz con wxWidgets)@*
|
||||
o @kbd{weechat-gtk} (para el interfaz con Gtk)@*
|
||||
o @kbd{weechat-qt} (para el interfaz con Qt)@*
|
||||
|
||||
@@ -247,7 +253,6 @@ Puedes editarlo para configurar WeeChat con las opciones deseadas, o tambi@'en p
|
||||
Enumeraci@'on de las opciones del fichero de configuraci@'on:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item look_set_title
|
||||
Define el t@'itulo de la ventana (el terminal para la interfaz Curses) con el nombre y la versi@'on@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@@ -269,6 +274,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@'ufers@*
|
||||
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'@*
|
||||
@@ -307,7 +315,10 @@ Activa la barra de informaci@'on@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Fecha y hora para las conversaciones guardadas@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y - %H:%M'@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Display seconds in infobar time@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Retraso (en segundos) para la notificaci@'on de mensajes en la barra de informaci@'on (0 = desactivar las notificaciones en la barra de informaci@'on)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 7@*
|
||||
@@ -374,6 +385,9 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
|
||||
@item col_infobar
|
||||
Color para el texto de la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Color para los delimitadores de la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Color para la notificaci@'on en la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'white'@*
|
||||
@@ -413,6 +427,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'@*
|
||||
@@ -447,10 +464,10 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
|
||||
Color para el estado dcc "abortado"@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
|
||||
@item history_max_lines
|
||||
Número m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
|
||||
N@'umero m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 4096@*
|
||||
@item history_max_commands
|
||||
Número m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
|
||||
N@'umero m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 100@*
|
||||
@item log_auto_server
|
||||
Registrar autom@'aticamente los mensajes de servidor@*
|
||||
@@ -481,7 +498,7 @@ Mensaje por defecto para el estado ausente@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'away'@*
|
||||
@item irc_default_msg_part
|
||||
Mensaje por defecto de salida (saliendo de un canal)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
|
||||
@item irc_default_msg_quit
|
||||
Mensaje de fin por defecto ('%v' ser@'a reemplazado por la versi@'on de WeeChat en la cadena)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
|
||||
@@ -498,13 +515,13 @@ 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@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_auto_accept_chats
|
||||
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (¡utilizar con precauci@'on!)@*
|
||||
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (@exclamdown{}utilizar con precauci@'on!)@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_timeout
|
||||
Tiempo de espera para la petici@'on dcc (en segundos)@*
|
||||
@@ -530,12 +547,21 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item proxy_use
|
||||
Utilizar un proxy para conectarse al servidor irc@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item proxy_type
|
||||
Proxy type (http (default), socks4, socks5)@*
|
||||
Typo: cadena (valores: 'http', 'socks4', 'socks5'), valor por defecto: 'http'@*
|
||||
@item proxy_ipv6
|
||||
Connect to proxy in ipv6@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item proxy_address
|
||||
Direcci@'on del servidor proxy (IP o nombre de m@'aquina)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item proxy_port
|
||||
Puerto para conectarse al servidor proxy@*
|
||||
Typo: entero (valores: entre 0 y 65535), valor por defecto: 1080@*
|
||||
Typo: entero (valores: entre 0 y 65535), valor por defecto: 3128@*
|
||||
@item proxy_username
|
||||
Username for proxy server@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item proxy_password
|
||||
Contrase@~na para el servidor proxy@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@@ -557,6 +583,12 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item server_port
|
||||
Puerto para conectarse al servidor@*
|
||||
Typo: entero (valores: entre 0 y 65535), valor por defecto: 6667@*
|
||||
@item server_ipv6
|
||||
Use IPv6 protocol for server communication@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item server_ssl
|
||||
Use SSL for server communication@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item server_password
|
||||
Contrase@~na para el servidor IRC@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@@ -587,7 +619,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item server_autorejoin
|
||||
Unirse de nuevo autom@'aticamente a los canales cuando sea expulsado@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
|
||||
@item server_notify_levels
|
||||
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@end table
|
||||
|
||||
Los colores para el interfaz Curses son:@*
|
||||
@@ -624,7 +658,6 @@ Los colores para el interfaz Curses son:@*
|
||||
@kbd{white}: blanco
|
||||
@end itemize
|
||||
|
||||
|
||||
@node Atajos de teclado, Comandos WeeChat, Ficheros de configuracion, Uso
|
||||
@section Atajos de teclado
|
||||
|
||||
@@ -641,12 +674,21 @@ Ir al inicio de la l@'inea de comandos@*
|
||||
@item Fin / Ctrl + E
|
||||
Ir al final de la l@'inea de comandos@*
|
||||
@*
|
||||
@item Ctrl + K
|
||||
Delete until end of line@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Refrescar toda la ventana@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Delete until beginning of line@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Borrar la palabra anterior en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Backspace / Supr
|
||||
Borrar el caracter anterior / siguiente en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
Borrar la palabra anterior en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Tab
|
||||
Completar el comando o el seud@'onimo (@kbd{Tab} de nuevo: encontrar la pr@'oxima autocompletaci@'on)@*
|
||||
@*
|
||||
@@ -671,8 +713,8 @@ Ir a la ventana anterior / siguiente@*
|
||||
@item F10
|
||||
Borrar el @'ultimo mensaje en la barra de informaciones@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Refrescar toda la ventana@*
|
||||
@item F11 / F12
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@item Alt + flecha izquierda / Alt + flecha derecha
|
||||
Como F5 / F6@*
|
||||
@@ -680,30 +722,53 @@ Como F5 / F6@*
|
||||
@item Alt + A
|
||||
Ir a la memoria temporal donde hay actividad (con el orden de prioridad siguiente: resaltado, mensaje, otros)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Obtener la lista de DCC actual@*
|
||||
@item Alt + B
|
||||
Go to previous word@*
|
||||
@*
|
||||
@item Alt + R
|
||||
@item Alt + D
|
||||
Delete next word@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Go to next word@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Borrar la 'hotlist' (notificaci@'on de actividad en otras memorias temporales)@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J then Alt + D
|
||||
Obtener la lista de DCC actual@*
|
||||
@*
|
||||
@item Alt + J then Alt + L
|
||||
Switch to last buffer@*
|
||||
@*
|
||||
@item Alt + J then Alt + S
|
||||
Ir a la memoria temporal del servidor@*
|
||||
@*
|
||||
@item Alt + X
|
||||
@item Alt + J then Alt + X
|
||||
Ir al primer canal del servidor siguiente (o a la memoria temporal del servidor si ning@'un canal est@'a abierto)@*
|
||||
@*
|
||||
@item Alt + (1-9)
|
||||
Saltar a la memoria temporal con ese n@'umero@*
|
||||
@*
|
||||
@item Alt + J then number (01-99)
|
||||
Saltar a la memoria temporal con ese n@'umero@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Grab a key
|
||||
@*
|
||||
@item Alt + R
|
||||
Delete entire line@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@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@*
|
||||
@@ -712,16 +777,16 @@ nombre_alias: nombre del seud@'onimo@*
|
||||
comando: nombre del comando (comando WeeChat @'o IRC, sin el primer '/')@*
|
||||
argumentos: par@'ametros para el comando@*
|
||||
@*
|
||||
@item buffer [acci@'on | número]
|
||||
@item buffer [acci@'on | n@'umero]
|
||||
@*
|
||||
gestionar los búfers@*
|
||||
gestionar los b@'ufers@*
|
||||
@*
|
||||
acci@'on: acci@'on a efectuar:@*
|
||||
move: desplaza el búfer en la lista (puede ser relativo, por ejemplo, -1)@*
|
||||
close: cierra el búfer (para un canal equivale a /part sin el mensaje de fin)@*
|
||||
list: lista los búfers abiertos (si no hay par@'ametros se supone esta lista)@*
|
||||
move: desplaza el b@'ufer en la lista (puede ser relativo, por ejemplo, -1)@*
|
||||
close: cierra el b@'ufer (para un canal equivale a /part sin el mensaje de fin)@*
|
||||
list: lista los b@'ufers abiertos (si no hay par@'ametros se supone esta lista)@*
|
||||
notify: fija el nivel de notificaci@'on (0=nunca, 1=highlight, 2=1+msg, 3=2+join/part)@*
|
||||
número: saltar al búfer por número@*
|
||||
n@'umero: saltar al b@'ufer por n@'umero@*
|
||||
@*
|
||||
@item clear [-all]
|
||||
@*
|
||||
@@ -743,9 +808,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 +818,44 @@ mostrar ayuda sobre los comandos@*
|
||||
@*
|
||||
comando: nombre de un comando de Weechat @'o de IRC@*
|
||||
@*
|
||||
@item perl [load fichero] | [autoload] | [unload]
|
||||
@item key [key function/command] [unbind key] [functions] [reset -yes]
|
||||
@*
|
||||
bind/unbind keys@*
|
||||
@*
|
||||
key: bind this key to an internal function or a command (beginning by "/")@*
|
||||
unbind: unbind a key (if "all", default bindings are restored)@*
|
||||
functions: list internal functions for key bindings@*
|
||||
reset: restore bindings to the default values and delete ALL personal binding (use carefully!)@*
|
||||
@*
|
||||
@item perl [load fichero] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
lista/carga/descarga de los Perl scripts@*
|
||||
@*
|
||||
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 +885,11 @@ splith: dividir la ventana actual horizontalmente@*
|
||||
splitv: dividir la ventana actual verticalmente@*
|
||||
merge: fusionar una ventana con otra@*
|
||||
@*
|
||||
|
||||
@end table
|
||||
|
||||
Comandos IRC:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item admin [target]
|
||||
@*
|
||||
encontrar informaci@'on sobre el administrador del servidor@*
|
||||
@@ -820,14 +901,14 @@ target: servidor objetivo@*
|
||||
revertir el estado ausente@*
|
||||
@*
|
||||
-all: revertir el estado ausente en todos los servidores conectados@*
|
||||
mensaje: mensaje para el estado ausente (si no se da ningún mensaje, se elimina el estado ausente)@*
|
||||
mensaje: mensaje para el estado ausente (si no se da ning@'un mensaje, se elimina el estado ausente)@*
|
||||
@*
|
||||
@item ban [canal] [usariio [usuario ...]]
|
||||
@*
|
||||
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 +981,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
|
||||
@*
|
||||
@@ -951,7 +1032,7 @@ modos del canal:@*
|
||||
s: indicador de canal secreto@*
|
||||
i: indicador de canal s@'olo con invitaci@'on@*
|
||||
t: indicador de tema s@'olo modificable por operador de canal@*
|
||||
n: ningún mensaje al canal desde el exterior@*
|
||||
n: ning@'un mensaje al canal desde el exterior@*
|
||||
m: canal moderado@*
|
||||
l: fijar el l@'imite de usuarios para el canal@*
|
||||
b: establecer una m@'ascara de baneo para mantener fuera a usuarios@*
|
||||
@@ -983,11 +1064,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 +1200,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 ...]
|
||||
@*
|
||||
@@ -1166,48 +1248,121 @@ pedir informaci@'on sobre el/los usuario(s)@*
|
||||
servidor: nombre del servidor@*
|
||||
usuario: nombre de usuario (puede que sea una m@'ascara)@*
|
||||
@*
|
||||
@item whowas usuario [,usuario [,usuario ...]] [número [destinatario]]
|
||||
@item whowas usuario [,usuario [,usuario ...]] [n@'umero [destinatario]]
|
||||
@*
|
||||
pedir informaci@'on sobre un usuario que ya no existe@*
|
||||
@*
|
||||
usuario: nombre de usuario a buscar@*
|
||||
número: número de respuestas a devolver (búsqueda completa si el número es negativo)@*
|
||||
n@'umero: n@'umero de respuestas a devolver (b@'usqueda completa si el n@'umero es negativo)@*
|
||||
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
|
||||
@*
|
||||
|
||||
@end table
|
||||
|
||||
@node FIFO pipe, , Comandos WeeChat, Uso
|
||||
@section FIFO pipe
|
||||
Internal functions for keys:@*
|
||||
|
||||
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.@*
|
||||
@table @kbd
|
||||
@item return
|
||||
terminate line@*
|
||||
@item tab
|
||||
complete word@*
|
||||
@item backspace
|
||||
delete previous char@*
|
||||
@item delete
|
||||
delete next char@*
|
||||
@item delete_end_line
|
||||
delete until end of line@*
|
||||
@item delete_beginning_line
|
||||
delete until beginning of line@*
|
||||
@item delete_line
|
||||
delete entire line@*
|
||||
@item delete_previous_word
|
||||
delete previous word@*
|
||||
@item delete_next_word
|
||||
delete next word@*
|
||||
@item home
|
||||
go to beginning of line@*
|
||||
@item end
|
||||
go to end of line@*
|
||||
@item left
|
||||
move one char left@*
|
||||
@item previous_word
|
||||
move to previous word@*
|
||||
@item right
|
||||
move one char right@*
|
||||
@item next_word
|
||||
move to next word@*
|
||||
@item up
|
||||
call previous command in history@*
|
||||
@item down
|
||||
call next command in history@*
|
||||
@item page_up
|
||||
scroll one page up@*
|
||||
@item page_down
|
||||
scroll one page down@*
|
||||
@item infobar_clear
|
||||
clear infobar@*
|
||||
@item nick_page_up
|
||||
scroll nicklist one page up@*
|
||||
@item nick_page_down
|
||||
scroll nicklist one page down@*
|
||||
@item nick_beginning
|
||||
display beginning of nicklist@*
|
||||
@item nick_end
|
||||
display end of nicklist@*
|
||||
@item refresh
|
||||
refresh screen@*
|
||||
@item jump_smart
|
||||
jump to buffer with activity@*
|
||||
@item jump_dcc
|
||||
jump to DCC buffer@*
|
||||
@item jump_server
|
||||
jump to server buffer@*
|
||||
@item jump_next_server
|
||||
jump to next server@*
|
||||
@item hotlist_clear
|
||||
clear hotlist@*
|
||||
@item grab_key
|
||||
grab a key@*
|
||||
@end table
|
||||
|
||||
@node Canal FIFO, , Comandos WeeChat, Uso
|
||||
@section Canal FIFO
|
||||
|
||||
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:
|
||||
@*
|
||||
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
|
||||
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
|
||||
@item @bullet{} escribir texto en el canal #weechat:
|
||||
@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
|
||||
@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 "*@exclamdown{}Hola!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Advertencia:} esto es peligroso y no deber@'ias hacerlo.. salvo si lo que est@'as haciendo.
|
||||
@*
|
||||
@item @bullet{} enviar dos comandos para descargar y recargar los scripts Perl (tienes que separarlos con un \n):
|
||||
@*
|
||||
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
|
||||
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
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 +1372,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 +1408,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 +1424,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 +1458,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 +1478,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 ("masc=$mascara, canal=$canal, msj=$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 +1504,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 +1550,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,12 +1559,171 @@ 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("masc="+mascara+", canal="+canal+", msj="+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
|
||||
|
||||
¡No desarrollado!
|
||||
@exclamdown{}No desarrollado!
|
||||
|
||||
@c **************************** Autores / Soporte *****************************
|
||||
|
||||
|
||||
+481
-160
@@ -30,14 +30,13 @@
|
||||
@c end tex
|
||||
|
||||
@documentlanguage fr
|
||||
@documentencoding ISO-8859-1
|
||||
|
||||
@titlepage
|
||||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentation pour WeeChat v0.1.4-cvs - 16 Juillet 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -83,27 +82,27 @@ License version 2 ou plus.
|
||||
@node Description, Pre-requis, Introduction, Introduction
|
||||
@section Description
|
||||
|
||||
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
|
||||
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
|
||||
concu pour diff@'erents syst@`emes d'exploitation.@*
|
||||
@*
|
||||
Ses principales caract@'eristiques sont les suivantes :
|
||||
@*
|
||||
Ses principales caract@'eristiques sont les suivantes :
|
||||
@itemize @minus
|
||||
@item
|
||||
connexion multi-serveurs
|
||||
@item
|
||||
plusieurs interfaces : Curses, Gtk et Qt
|
||||
@item
|
||||
petit, rapide et l@'eger
|
||||
@item
|
||||
param@'etrable et extensible avec des scripts
|
||||
@item
|
||||
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
|
||||
@item
|
||||
multi-plateformes (Gnu/Linux, *BSD, Windows et d'autres syst@`emes)
|
||||
@item
|
||||
@item
|
||||
connexion multi-serveurs (avec SSL, IPv6, proxy)
|
||||
@item
|
||||
plusieurs interfaces : Curses, wxWidgets, Gtk et Qt
|
||||
@item
|
||||
petit, rapide et l@'eger
|
||||
@item
|
||||
param@'etrable et extensible avec des scripts
|
||||
@item
|
||||
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
|
||||
@item
|
||||
multi-plateformes (Gnu/Linux, *BSD, MacOS X, Windows et d'autres syst@`emes)
|
||||
@item
|
||||
100% GPL, logiciel libre
|
||||
@end itemize
|
||||
|
||||
@end itemize
|
||||
|
||||
@*
|
||||
La page d'accueil de WeeChat est ici :@*
|
||||
@uref{http://weechat.flashtux.org}@*
|
||||
@@ -115,20 +114,20 @@ Pour installer WeeChat, vous @b{devez} avoir :@*
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
|
||||
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
|
||||
@item
|
||||
Droits "root" (pour installer WeeChat)
|
||||
@item
|
||||
Selon l'interface, une des biblioth@`eques suivantes :
|
||||
@itemize @minus
|
||||
@item
|
||||
Curses: la librairie ncurses,
|
||||
@item
|
||||
Gtk: *** interface non d@'evelopp@'ee ***,
|
||||
@item
|
||||
Qt: *** interface non d@'evelopp@'ee ***,
|
||||
Selon l'interface, une des biblioth@`eques suivantes :
|
||||
@itemize @minus
|
||||
@item
|
||||
Curses: la librairie ncurses,
|
||||
@item
|
||||
Gtk: *** interface non d@'evelopp@'ee ***,
|
||||
@item
|
||||
Qt: *** interface non d@'evelopp@'ee ***,
|
||||
@end itemize
|
||||
@end itemize
|
||||
@end itemize
|
||||
|
||||
|
||||
@c ******************************* Installation *******************************
|
||||
@@ -138,31 +137,31 @@ Qt: *** interface non d@'evelopp@'ee ***,
|
||||
|
||||
@menu
|
||||
* Paquet binaire::
|
||||
* Paquet source::
|
||||
* Paquet source::
|
||||
* Sources CVS::
|
||||
@end menu
|
||||
|
||||
@node Paquet binaire, Paquet source, Installation, Installation
|
||||
@section Paquet binaire
|
||||
|
||||
Les paquets binaires sont disponibles pour les distributions suivantes :
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (ou toute distribution compatible Debian)@*
|
||||
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
|
||||
@item
|
||||
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
|
||||
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
Pour installer : @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (non disponible !)
|
||||
@item
|
||||
Slackware (non disponible !)
|
||||
@item
|
||||
Windows (non disponible !)
|
||||
@end itemize
|
||||
Les paquets binaires sont disponibles pour les distributions suivantes :
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (ou toute distribution compatible Debian)@*
|
||||
Pour installer : @kbd{apt-get install weechat-curses}
|
||||
@item
|
||||
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
|
||||
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
Pour installer : @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (non disponible !)
|
||||
@item
|
||||
Slackware (non disponible !)
|
||||
@item
|
||||
Windows (non disponible !)
|
||||
@end itemize
|
||||
|
||||
o@`u x.y.z est la version (par exemple 0.0.1)
|
||||
@*
|
||||
@@ -175,28 +174,28 @@ Tapez simplement dans une console ou un terminal :@*
|
||||
@kbd{make}@*
|
||||
Note: pour ne construire que certaines interfaces, vous pouvez passer des param@`etres
|
||||
@`a ./configure, tapez @kbd{./configure --help} pour de l'aide sur ces options.@*
|
||||
|
||||
Obtenez les droits root et installez WeeChat :@*
|
||||
@kbd{su}@*
|
||||
(entrez le mot de passe de root)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
|
||||
Obtenez les droits root et installez WeeChat :@*
|
||||
@kbd{su}@*
|
||||
(entrez le mot de passe de root)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@node Sources CVS, , Paquet source, Installation
|
||||
@section Sources CVS
|
||||
|
||||
@section Sources CVS
|
||||
|
||||
Attention: les sources CVS sont r@'eserv@'es aux utilisateurs avanc@'es : il se peut
|
||||
que WeeChat ne compile pas et qu'il soit tr@`s instable.
|
||||
Vous @^etes pr@'evenus !@*
|
||||
|
||||
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
|
||||
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
|
||||
que WeeChat ne compile pas et qu'il soit tr@`s instable.
|
||||
Vous @^etes pr@'evenus !@*
|
||||
|
||||
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
|
||||
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
|
||||
|
||||
Ex@'ecutez ce script :@*
|
||||
@kbd{./autogen.sh}@*
|
||||
|
||||
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
|
||||
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
|
||||
|
||||
|
||||
@c ******************************* Utilisation ********************************
|
||||
@@ -206,40 +205,47 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
|
||||
|
||||
@menu
|
||||
* Lancer WeeChat::
|
||||
* Fichier de configuration::
|
||||
* Raccourcis clavier::
|
||||
* Fichier de configuration::
|
||||
* Raccourcis clavier::
|
||||
* Commandes WeeChat::
|
||||
* Tube FIFO::
|
||||
@end menu
|
||||
|
||||
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
|
||||
@section Lancer WeeChat
|
||||
|
||||
@subsection Param@`etres de ligne de commande
|
||||
|
||||
|
||||
@subsection Param@`etres de ligne de commande
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Afficher l'aide sur le fichier de config (liste des options)@*
|
||||
@item -h, --help
|
||||
Afficher l'aide@*
|
||||
@item -f, --key-functions
|
||||
Afficher la liste des fonctions internes WeeChat pour les touches@*
|
||||
@item -i, --irc-commands
|
||||
Afficher la liste des commandes IRC@*
|
||||
@item -l, --license
|
||||
Afficher la licence de WeeChat@*
|
||||
@item -v, --version
|
||||
@item -v, --version
|
||||
Afficher la version de WeeChat@*
|
||||
@end table
|
||||
|
||||
@subsection Lancer WeeChat
|
||||
|
||||
Tapez simplement cette commande pour lancer WeeChat :@*
|
||||
@item -w, --weechat-commands
|
||||
Afficher la liste des commandes WeeChat@*
|
||||
@end table
|
||||
|
||||
@subsection Lancer WeeChat
|
||||
|
||||
Tapez simplement cette commande pour lancer WeeChat :@*
|
||||
@kbd{weechat-curses} (pour l'interface Curses)@*
|
||||
ou @kbd{weechat-wxwidgets} (pour l'interface wxWidgets)@*
|
||||
ou @kbd{weechat-gtk} (pour l'interface Gtk)@*
|
||||
ou @kbd{weechat-qt} (pour l'interface Qt)@*
|
||||
|
||||
ou @kbd{weechat-qt} (pour l'interface Qt)@*
|
||||
|
||||
Lorsque vous lancez WeeChat pour la premi@`ere fois, un fichier de configuration
|
||||
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
|
||||
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
|
||||
|
||||
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
|
||||
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
|
||||
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
|
||||
|
||||
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
|
||||
vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} - @xref{Commandes WeeChat}.
|
||||
|
||||
@node Fichier de configuration, Raccourcis clavier, Lancer WeeChat, Utilisation
|
||||
@@ -248,7 +254,6 @@ vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} -
|
||||
Liste des options du fichier de configuration :@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item look_set_title
|
||||
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@@ -270,6 +275,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'@*
|
||||
@@ -308,7 +316,10 @@ Active la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Horodatage pour les conversations sauvegard@'ees@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y - %H:%M'@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Afficher les secondes pour l'heure dans la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
D@'elai (en secondes) pour la notification des messages dans la barre d'infos (0 = d@'esactiver les notifications dans la barre d'infos)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 7@*
|
||||
@@ -375,6 +386,9 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar
|
||||
Couleur pour la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Couleur pour les d@'elimiteurs de la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Couleur pour la notification dans la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@@ -414,6 +428,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 +499,7 @@ Message par d@'efaut pour l'absence@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'away'@*
|
||||
@item irc_default_msg_part
|
||||
Message par d@'efaut pour le part (quitte un canal)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
|
||||
@item irc_default_msg_quit
|
||||
Message de fin par d@'efaut ('%v' sera remplac@'e par la version de WeeChat dans la cha@^ine)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
|
||||
@@ -531,12 +548,21 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item proxy_use
|
||||
Utiliser un proxy pour se connecter au serveur irc@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item proxy_type
|
||||
Type de proxy (http (d@'efaut), socks4, socks5)@*
|
||||
Type: cha@^ine (valeurs: 'http', 'socks4', 'socks5'), valeur par d@'efaut: 'http'@*
|
||||
@item proxy_ipv6
|
||||
Se connecter au proxy en ipv6@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item proxy_address
|
||||
Adresse du serveur proxy (IP ou nom)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item proxy_port
|
||||
Port pour se connecter au serveur proxy@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 1080@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 3128@*
|
||||
@item proxy_username
|
||||
Nom d'utilisateur pour le serveur proxy@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item proxy_password
|
||||
Mot de passe pour le serveur proxy@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@@ -558,6 +584,12 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_port
|
||||
Port pour se connecter au serveur@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 6667@*
|
||||
@item server_ipv6
|
||||
Utiliser le protocole IPv6 pour la communication avec le serveur@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item server_ssl
|
||||
Utiliser SSL pour la communication avec le serveur@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item server_password
|
||||
Mot de passe pour le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@@ -588,7 +620,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_autorejoin
|
||||
Rejoindre automatiquement les canaux quand mis dehors@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
|
||||
@item server_notify_levels
|
||||
Liste des niveaux de notifications (s@'epar@'es par des virgules) pour les canaux de ce serveur (format: #canal:1,..)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@end table
|
||||
|
||||
Les couleurs pour l'interface Curses sont :@*
|
||||
@@ -627,11 +661,11 @@ Les couleurs pour l'interface Curses sont :@*
|
||||
|
||||
@node Raccourcis clavier, Commandes WeeChat, Fichier de configuration, Utilisation
|
||||
@section Raccourcis clavier
|
||||
|
||||
|
||||
@table @kbd
|
||||
@item Fl@`eche gauche / Fl@`eche droite
|
||||
Aller au caract@`ere pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@*
|
||||
@item Ctrl + fl@`eche gauche / Ctrl + fl@`eche droite
|
||||
Aller au mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@@ -641,28 +675,37 @@ Aller au d@'ebut de la ligne de commande@*
|
||||
@item End / Ctrl + E
|
||||
Aller @`a la fin de la ligne de commande@*
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
@item Ctrl + K
|
||||
Efface jusqu'@`a la fin de la ligne@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
R@'eaffiche toute la fen@^etre@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Efface jusqu'au d@'ebut de la ligne@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
|
||||
@*
|
||||
@item Tab
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@item Tab
|
||||
Compl@'eter la commande ou le pseudo (@kbd{Tab} @`a nouveau : trouver la compl@'etion suivante)@*
|
||||
@*
|
||||
@item Tout caract@`ere
|
||||
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
|
||||
@*
|
||||
@item Entr@'ee
|
||||
@*
|
||||
@item Tout caract@`ere
|
||||
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
|
||||
@*
|
||||
@item Entr@'ee
|
||||
Ex@'ecuter la commande ou envoyer le message@*
|
||||
@*
|
||||
@item Fl@`eche haut / Fl@`eche bas
|
||||
Rappeler les derni@`eres commandes/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
@*
|
||||
@item Fl@`eche haut / Fl@`eche bas
|
||||
Rappeler les derni@`eres commandes/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Afficher l'historique du tampon@*
|
||||
@*
|
||||
@item F5 / F6
|
||||
@*
|
||||
@item F5 / F6
|
||||
Aller au tampon pr@'ec@'edent / suivant@*
|
||||
@*
|
||||
@item F7 / F8
|
||||
@@ -671,30 +714,54 @@ Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
|
||||
@item F10
|
||||
Effacer le dernier message de la barre d'infos@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
R@'eaffiche toute la fen@^etre@*
|
||||
@item F11 / F12
|
||||
Faire d@'efiler la liste des pseudos@*
|
||||
@*
|
||||
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
|
||||
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
|
||||
Identique @`a F5 / F6@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
|
||||
@*
|
||||
@item Alt + B
|
||||
Aller au mot pr@'ec@'edent@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Effacer le mot suivant@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Aller au mot suivant@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Vide la hotlist (notification d'activit@'e sur les autres tampons)@*
|
||||
@*
|
||||
@item Alt + J puis Alt + D
|
||||
Afficher les DCC en cours@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Vide la hotlist (notification d'activité sur les autres tampons)@*
|
||||
@item Alt + J puis Alt + L
|
||||
Sauter au dernier tampon@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J puis Alt + S
|
||||
Sauter au tampon du serveur@*
|
||||
@*
|
||||
@item Alt + X
|
||||
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
|
||||
@*
|
||||
@item Alt + chiffre (1-9)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item Alt + J then Alt + X
|
||||
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Capturer une touche
|
||||
@*
|
||||
@item Alt + J puis nombre (01-99)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Effacer la ligne enti@`ere@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Faire d@'efiler la liste des pseudos@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node Commandes WeeChat, Tube FIFO, Raccourcis clavier, Utilisation
|
||||
@@ -703,7 +770,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 +819,38 @@ afficher l'aide sur les commandes@*
|
||||
@*
|
||||
commande: nom d'une commande WeeChat ou IRC@*
|
||||
@*
|
||||
@item perl [load fichier] | [autoload] | [unload]
|
||||
@item key [touche fonction/commande] [unbind touche] [functions] [reset -yes]
|
||||
@*
|
||||
associer/lib@'erer des touches@*
|
||||
@*
|
||||
touche: associer cette touche @`a une fonction interne ou une commande (commen@,{c}ant par "/")@*
|
||||
unbind: supprimer l'association @`a une touche (si "all", toutes les associations de touches par d@'efaut sont restaur@'ees)@*
|
||||
functions: lister la liste des fonctions internes pour les associations de touches@*
|
||||
reset: restaur les touches aux valeurs par d@'efaut et supprime TOUTES les touches personnelles (utiliser avec pr@'ecaution !)@*
|
||||
@*
|
||||
@item perl [load fichier] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
liste/charge/d@'echarge des scripts Perl@*
|
||||
@*
|
||||
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 +886,11 @@ splith: @'eclate la fen@^etre en deux horizontalement@*
|
||||
splitv: @'eclate la fen@^etre en deux verticalement@*
|
||||
merge: fusionne la fen@^etre avec une autre@*
|
||||
@*
|
||||
|
||||
@end table
|
||||
|
||||
Commandes IRC :@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item admin [cible]
|
||||
@*
|
||||
trouver les informations sur l'administrateur du serveur@*
|
||||
@@ -983,11 +1065,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 +1257,73 @@ pseudo: pseudo @`a chercher@*
|
||||
nombre: nombre de r@'eponses @`a retourner (recherche compl@`ete si nombre n@'egatif)@*
|
||||
cible: la r@'eponse doit correspondre @`a ce masque@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
Fonctions internes pour les touches :@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminer la ligne@*
|
||||
@item tab
|
||||
compl@'eter le mot@*
|
||||
@item backspace
|
||||
effacer le caract@`ere pr@'ec@'edent@*
|
||||
@item delete
|
||||
effacer le caract@`ere suivant@*
|
||||
@item delete_end_line
|
||||
effacer jusqu'@`a la fin de la ligne@*
|
||||
@item delete_beginning_line
|
||||
effacer jusqu'au d@'ebut de la ligne@*
|
||||
@item delete_line
|
||||
effacer la ligne enti@`ere@*
|
||||
@item delete_previous_word
|
||||
effacer le mot pr@'ec@'edent@*
|
||||
@item delete_next_word
|
||||
effacer le mot suivant@*
|
||||
@item home
|
||||
aller au d@'ebut de la ligne@*
|
||||
@item end
|
||||
aller @`a la fin de la ligne@*
|
||||
@item left
|
||||
se d@'eplacer d'un caract@`ere @`a gauche@*
|
||||
@item previous_word
|
||||
se d@'eplacer au mot pr@'ec@'edent@*
|
||||
@item right
|
||||
se d@'eplacer d'un caract@`ere @`a droite@*
|
||||
@item next_word
|
||||
se d@'eplacer au mot suivant@*
|
||||
@item up
|
||||
appeler la commande pr@'ec@'edente dans l'historique@*
|
||||
@item down
|
||||
appeler la commande suivante dans l'historique@*
|
||||
@item page_up
|
||||
faire d@'efiler d'une page vers le haut@*
|
||||
@item page_down
|
||||
faire d@'efiler d'une page vers le bas@*
|
||||
@item infobar_clear
|
||||
effacer la barre d'infos@*
|
||||
@item nick_page_up
|
||||
faire d@'efiler la liste des pseudos d'une page vers le haut@*
|
||||
@item nick_page_down
|
||||
faire d@'efiler la liste des pseudos d'une page vers le bas@*
|
||||
@item nick_beginning
|
||||
afficher le d@'ebut de la liste des pseudos@*
|
||||
@item nick_end
|
||||
afficher la fin de la liste des pseudos@*
|
||||
@item refresh
|
||||
rafraichir l'@'ecran@*
|
||||
@item jump_smart
|
||||
sauter au tampon avec de l'activit@'e@*
|
||||
@item jump_dcc
|
||||
sauter au tampon DCC@*
|
||||
@item jump_server
|
||||
sauter au tampon du serveur@*
|
||||
@item jump_next_server
|
||||
sauter au prochain serveur@*
|
||||
@item hotlist_clear
|
||||
effacer la liste d'activit@'e@*
|
||||
@item grab_key
|
||||
capturer une touche@*
|
||||
@end table
|
||||
|
||||
@node Tube FIFO, , Commandes WeeChat, Utilisation
|
||||
@@ -1196,14 +1345,21 @@ serveur doit l'@^etre aussi.@*
|
||||
Quelques exemples :
|
||||
@table @asis
|
||||
@item @bullet{} changement du pseudo sur freenode en "pseudo|absent":
|
||||
@*
|
||||
@command{echo "freenode */nick pseudo|absent" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} affichage de texte sur le canal #weechat :
|
||||
@*
|
||||
@command{echo "freenode,#weechat *bonjour tout le monde !" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} affichage de texte sur le canal courant (le tampon affich@'e par WeeChat):
|
||||
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}@*
|
||||
@*
|
||||
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Attention :} ceci est dangereux et vous ne devriez pas le faire sauf si vous savez ce que vous faites !
|
||||
@item @bullet{} envoyer deux commandes pour décharger/recharger les scripts Perl (vous devez les séparer par \n):
|
||||
@*
|
||||
@item @bullet{} envoyer deux commandes pour d@'echarger/recharger les scripts Perl (vous devez les s@'eparer par \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1254,7 +1410,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 +1427,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 +1461,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 +1481,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, msg=$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 +1507,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 +1554,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 +1562,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
|
||||
|
||||
+1226
-54
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -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
|
||||
@@ -16,6 +18,7 @@
|
||||
./src/gui/gtk/gui-display.c
|
||||
./src/gui/gtk/gui-input.c
|
||||
./src/gui/gui-common.c
|
||||
./src/gui/gui-keyboard.c
|
||||
./src/gui/gui.h
|
||||
./src/common/command.c
|
||||
./src/common/command.h
|
||||
|
||||
+1367
-879
File diff suppressed because it is too large
Load Diff
+416
-68
@@ -47,11 +47,11 @@ t_weechat_command weechat_commands[] =
|
||||
{ "buffer", N_("manage buffers"),
|
||||
N_("[action | number]"),
|
||||
N_("action: action to do:\n"
|
||||
" move: move buffer in the list (may be relative, for example -1)\n"
|
||||
" close: close buffer (for channel: same as /part without part message)\n"
|
||||
" list: list opened buffers (no parameter implies this list)\n"
|
||||
" notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
|
||||
"number: jump to buffer by number"),
|
||||
" move: move buffer in the list (may be relative, for example -1)\n"
|
||||
" close: close buffer (for channel: same as /part without part message)\n"
|
||||
" list: list opened buffers (no parameter implies this list)\n"
|
||||
" notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
|
||||
"number: jump to buffer by number"),
|
||||
0, MAX_ARGS, weechat_cmd_buffer, NULL },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
@@ -72,26 +72,40 @@ t_weechat_command weechat_commands[] =
|
||||
{ "help", N_("display help about commands"),
|
||||
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
|
||||
0, 1, weechat_cmd_help, NULL },
|
||||
{ "key", N_("bind/unbind keys"),
|
||||
N_("[key function/command] [unbind key] [functions] [reset -yes]"),
|
||||
N_("key: bind this key to an internal function or a command (beginning by \"/\")\n"
|
||||
"unbind: unbind a key (if \"all\", default bindings are restored)\n"
|
||||
"functions: list internal functions for key bindings\n"
|
||||
"reset: restore bindings to the default values and delete ALL personal binding (use carefully!)"),
|
||||
0, MAX_ARGS, NULL, weechat_cmd_key },
|
||||
{ "perl", N_("list/load/unload Perl scripts"),
|
||||
N_("[load filename] | [autoload] | [unload]"),
|
||||
N_("[load filename] | [autoload] | [reload] | [unload]"),
|
||||
N_("filename: Perl script (file) to load\n"
|
||||
"Without argument, /perl command lists all loaded Perl scripts."),
|
||||
"Without argument, /perl command lists all loaded Perl scripts."),
|
||||
0, 2, weechat_cmd_perl, NULL },
|
||||
{ "python", N_("list/load/unload Python scripts"),
|
||||
N_("[load filename] | [autoload] | [reload] | [unload]"),
|
||||
N_("filename: Python script (file) to load\n"
|
||||
"Without argument, /python command lists all loaded Python scripts."),
|
||||
0, 2, weechat_cmd_python, NULL },
|
||||
{ "server", N_("list, add or remove servers"),
|
||||
N_("[servername] | "
|
||||
"[servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 "
|
||||
"[nick2 [nick3]]] [-username username] [-realname realname] "
|
||||
"[-command command] [-autojoin channel[,channel]] ] | "
|
||||
"[del servername]"),
|
||||
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
|
||||
"[nick2 [nick3]]] [-username username] [-realname realname] "
|
||||
"[-command command] [-autojoin channel[,channel]] ] | "
|
||||
"[del servername]"),
|
||||
N_("servername: server name, for internal & display use\n"
|
||||
"hostname: name or IP address of server\n"
|
||||
"port: port for server (integer)\n"
|
||||
"password: password for server\n"
|
||||
"nick1: first nick for server\n"
|
||||
"nick2: alternate nick for server\n"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user"),
|
||||
"hostname: name or IP address of server\n"
|
||||
"port: port for server (integer)\n"
|
||||
"ipv6: use IPv6 protocol\n"
|
||||
"ssl: use SSL protocol\n"
|
||||
"password: password for server\n"
|
||||
"nick1: first nick for server\n"
|
||||
"nick2: alternate nick for server\n"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user"),
|
||||
0, MAX_ARGS, weechat_cmd_server, NULL },
|
||||
{ "save", N_("save config to disk"),
|
||||
N_("[file]"), N_("file: filename for writing config"),
|
||||
@@ -104,11 +118,10 @@ t_weechat_command weechat_commands[] =
|
||||
1, 1, NULL, weechat_cmd_unalias },
|
||||
{ "window", N_("manage windows"),
|
||||
N_("[list | splith | splitv | [merge [down | up | left | right | all]]]"),
|
||||
N_(
|
||||
"list: list opened windows (no parameter implies this list)\n"
|
||||
"splith: split current window horizontally\n"
|
||||
"splitv: split current window vertically\n"
|
||||
"merge: merge window with another"),
|
||||
N_("list: list opened windows (no parameter implies this list)\n"
|
||||
"splith: split current window horizontally\n"
|
||||
"splitv: split current window vertically\n"
|
||||
"merge: merge window with another"),
|
||||
0, 2, weechat_cmd_window, NULL },
|
||||
{ NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
|
||||
};
|
||||
@@ -652,6 +665,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 +692,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 +714,7 @@ user_command (t_irc_server *server, t_gui_buffer *buffer, char *command)
|
||||
ptr_nick = nick_search (CHANNEL(buffer), server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick,
|
||||
irc_display_nick (CHANNEL(buffer)->buffer, ptr_nick, NULL,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_color (CHANNEL(buffer)->buffer,
|
||||
COLOR_WIN_CHAT, "%s\n", command);
|
||||
@@ -712,6 +727,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
|
||||
{
|
||||
@@ -847,6 +883,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
t_irc_channel *ptr_channel;
|
||||
long number;
|
||||
char *error;
|
||||
int target_buffer;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
@@ -934,7 +971,9 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
if (SERVER(gui_current_window->buffer))
|
||||
{
|
||||
if (SERVER(gui_current_window->buffer)->is_connected)
|
||||
if (SERVER(gui_current_window->buffer)->is_connected
|
||||
&& CHANNEL(gui_current_window->buffer)
|
||||
&& CHANNEL(gui_current_window->buffer)->nicks)
|
||||
irc_cmd_send_part (SERVER(gui_current_window->buffer), NULL);
|
||||
else
|
||||
{
|
||||
@@ -967,7 +1006,8 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
(ptr_buffer->dcc) ? "DCC" :
|
||||
((BUFFER_IS_SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
|
||||
CHANNEL(ptr_buffer)->name));
|
||||
if (ptr_buffer->dcc)
|
||||
if ((!BUFFER_IS_CHANNEL(ptr_buffer))
|
||||
&& (!BUFFER_IS_PRIVATE(ptr_buffer)))
|
||||
gui_printf (NULL, "-");
|
||||
else
|
||||
gui_printf (NULL, "%d", ptr_buffer->notify_level);
|
||||
@@ -982,22 +1022,34 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
number = strtol (argv[1], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
if ((number < 0) || (number > 3))
|
||||
if ((number < NOTIFY_LEVEL_MIN) || (number > NOTIFY_LEVEL_MAX))
|
||||
{
|
||||
/* invalid highlight level */
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
|
||||
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
|
||||
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
|
||||
return -1;
|
||||
}
|
||||
if ((!BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
&& (!BUFFER_IS_PRIVATE(gui_current_window->buffer)))
|
||||
{
|
||||
/* invalid buffer type (only ok on channel or private) */
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s incorrect buffer for notify (must be channel or private)\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
gui_current_window->buffer->notify_level = number;
|
||||
channel_set_notify_level (SERVER(gui_current_window->buffer),
|
||||
CHANNEL(gui_current_window->buffer),
|
||||
number);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
|
||||
WEECHAT_ERROR);
|
||||
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
|
||||
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1006,26 +1058,41 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
/* jump to buffer by number */
|
||||
|
||||
error = NULL;
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
if (argv[0][0] == '-')
|
||||
{
|
||||
if (!gui_switch_to_buffer_by_number (gui_current_window, (int) number))
|
||||
/* relative jump '-' */
|
||||
error = NULL;
|
||||
number = strtol (argv[0] + 1, &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s buffer \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[0], "buffer");
|
||||
return -1;
|
||||
target_buffer = gui_current_window->buffer->number - (int) number;
|
||||
if (target_buffer < 1)
|
||||
target_buffer = (last_gui_buffer) ? last_gui_buffer->number + target_buffer : 1;
|
||||
gui_switch_to_buffer_by_number (gui_current_window,
|
||||
target_buffer);
|
||||
}
|
||||
}
|
||||
else if (argv[0][0] == '+')
|
||||
{
|
||||
/* relative jump '+' */
|
||||
error = NULL;
|
||||
number = strtol (argv[0] + 1, &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
target_buffer = gui_current_window->buffer->number + (int) number;
|
||||
if (last_gui_buffer && target_buffer > last_gui_buffer->number)
|
||||
target_buffer -= last_gui_buffer->number;
|
||||
gui_switch_to_buffer_by_number (gui_current_window,
|
||||
target_buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s incorrect buffer number\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
/* absolute jump by number */
|
||||
error = NULL;
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
gui_switch_to_buffer_by_number (gui_current_window, (int) number);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1135,7 +1202,7 @@ weechat_cmd_debug (int argc, char **argv)
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "perl");
|
||||
WEECHAT_ERROR, "debug");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1279,6 +1346,139 @@ weechat_cmd_help (int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_key_display: display a key binding
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_cmd_key_display (t_gui_key *key, int new_key)
|
||||
{
|
||||
char *expanded_name;
|
||||
|
||||
expanded_name = gui_key_get_expanded_name (key->key);
|
||||
if (new_key)
|
||||
{
|
||||
gui_printf (NULL, _("New key binding:\n"));
|
||||
gui_printf (NULL, " %s", (expanded_name) ? expanded_name : key->key);
|
||||
}
|
||||
else
|
||||
gui_printf (NULL, " %20s", (expanded_name) ? expanded_name : key->key);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, " => ");
|
||||
gui_printf (NULL, "%s\n",
|
||||
(key->function) ?
|
||||
gui_key_function_search_by_ptr (key->function) : key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_key: bind/unbind keys
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_key (char *arguments)
|
||||
{
|
||||
char *pos;
|
||||
int i;
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
if (arguments)
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
}
|
||||
|
||||
if (!arguments || (arguments[0] == '\0'))
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("Key bindings:\n"));
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
weechat_cmd_key_display (ptr_key, 0);
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "unbind ", 7) == 0)
|
||||
{
|
||||
arguments += 7;
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (gui_key_unbind (arguments))
|
||||
gui_printf (NULL, _("Key \"%s\" unbinded\n"), arguments);
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to unbind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, arguments);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp (arguments, "functions") == 0)
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("Internal key functions:\n"));
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
gui_printf (NULL, "%25s %s\n",
|
||||
gui_key_functions[i].function_name,
|
||||
_(gui_key_functions[i].description));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "reset", 5) == 0)
|
||||
{
|
||||
arguments += 5;
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (strcasecmp (arguments, "-yes") == 0)
|
||||
{
|
||||
gui_key_free_all ();
|
||||
gui_key_init ();
|
||||
gui_printf (NULL, _("Default key bindings restored\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s \"-yes\" argument is required for keys reset (securuty reason)\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
pos = strchr (arguments, ' ');
|
||||
if (!pos)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s wrong argument count for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "key");
|
||||
return -1;
|
||||
}
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
ptr_key = gui_key_bind (arguments, pos);
|
||||
if (ptr_key)
|
||||
weechat_cmd_key_display (ptr_key, 1);
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to bind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, arguments);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_perl: list/load/unload Perl scripts
|
||||
*/
|
||||
@@ -1286,19 +1486,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 +1519,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 +1528,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 +1542,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 +1551,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 +1567,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 +1619,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 +1923,10 @@ weechat_cmd_server (int argc, char **argv)
|
||||
server.autoconnect = 1;
|
||||
if (strcasecmp (argv[i], "-noauto") == 0)
|
||||
server.autoconnect = 0;
|
||||
if (strcasecmp (argv[i], "-ipv6") == 0)
|
||||
server.ipv6 = 1;
|
||||
if (strcasecmp (argv[i], "-ssl") == 0)
|
||||
server.ssl = 1;
|
||||
if (strcasecmp (argv[i], "-pwd") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
@@ -1672,10 +2014,11 @@ weechat_cmd_server (int argc, char **argv)
|
||||
new_server = server_new (server.name, server.autoconnect,
|
||||
server.autoreconnect,
|
||||
server.autoreconnect_delay,
|
||||
0, server.address, server.port, server.password,
|
||||
0, server.address, server.port, server.ipv6,
|
||||
server.ssl, server.password,
|
||||
server.nick1, server.nick2, server.nick3,
|
||||
server.username, server.realname,
|
||||
server.command, 1, server.autojoin, 1);
|
||||
server.command, 1, server.autojoin, 1, NULL);
|
||||
if (new_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
@@ -1706,11 +2049,11 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_set_cmd_display_option: display config option
|
||||
* weechat_cmd_set_display_option: display config option
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_set_cmd_display_option (t_config_option *option, char *prefix, void *value)
|
||||
weechat_cmd_set_display_option (t_config_option *option, char *prefix, void *value)
|
||||
{
|
||||
char *color_name, *pos_nickserv, *pos_pwd, *value2;
|
||||
|
||||
@@ -1853,7 +2196,7 @@ weechat_cmd_set (char *arguments)
|
||||
{
|
||||
ptr_option_value = config_get_server_option_ptr (ptr_server,
|
||||
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
|
||||
weechat_set_cmd_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
weechat_cmd_set_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
ptr_server->name,
|
||||
ptr_option_value);
|
||||
}
|
||||
@@ -1894,7 +2237,7 @@ weechat_cmd_set (char *arguments)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s", config_get_section (ptr_option));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "]\n");
|
||||
weechat_set_cmd_display_option (ptr_option, NULL, NULL);
|
||||
weechat_cmd_set_display_option (ptr_option, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1918,7 +2261,8 @@ weechat_cmd_set (char *arguments)
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
section_displayed = 0;
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -1936,7 +2280,7 @@ weechat_cmd_set (char *arguments)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "]\n");
|
||||
section_displayed = 1;
|
||||
}
|
||||
weechat_set_cmd_display_option (&weechat_options[i][j], NULL, NULL);
|
||||
weechat_cmd_set_display_option (&weechat_options[i][j], NULL, NULL);
|
||||
number_found++;
|
||||
}
|
||||
}
|
||||
@@ -1969,7 +2313,7 @@ weechat_cmd_set (char *arguments)
|
||||
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
|
||||
if (ptr_option_value)
|
||||
{
|
||||
weechat_set_cmd_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
weechat_cmd_set_display_option (&weechat_options[CONFIG_SECTION_SERVER][i],
|
||||
ptr_server->name,
|
||||
ptr_option_value);
|
||||
number_found++;
|
||||
@@ -2102,6 +2446,10 @@ weechat_cmd_window (int argc, char **argv)
|
||||
else
|
||||
gui_window_merge_auto (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "-1") == 0)
|
||||
gui_switch_to_previous_window ();
|
||||
else if (strcasecmp (argv[0], "+1") == 0)
|
||||
gui_switch_to_next_window ();
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
|
||||
@@ -69,7 +69,9 @@ extern int weechat_cmd_connect (int, char **);
|
||||
extern int weechat_cmd_debug (int, char **);
|
||||
extern int weechat_cmd_disconnect (int, char **);
|
||||
extern int weechat_cmd_help (int, char **);
|
||||
extern int weechat_cmd_key (char *);
|
||||
extern int weechat_cmd_perl (int, char **);
|
||||
extern int weechat_cmd_python (int, char **);
|
||||
extern int weechat_cmd_save (int, char **);
|
||||
extern int weechat_cmd_server (int, char **);
|
||||
extern int weechat_cmd_set (char *);
|
||||
|
||||
+124
-18
@@ -47,6 +47,7 @@ completion_init (t_completion *completion)
|
||||
completion->base_command_arg = 0;
|
||||
completion->position = -1;
|
||||
completion->base_word = NULL;
|
||||
completion->args = NULL;
|
||||
|
||||
completion->completion_list = NULL;
|
||||
completion->last_completion = NULL;
|
||||
@@ -67,6 +68,10 @@ completion_free (t_completion *completion)
|
||||
free (completion->base_word);
|
||||
completion->base_word = NULL;
|
||||
|
||||
if (completion->args)
|
||||
free (completion->args);
|
||||
completion->args = NULL;
|
||||
|
||||
while (completion->completion_list)
|
||||
weelist_remove (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
@@ -97,8 +102,11 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
int i, j;
|
||||
t_irc_server *ptr_server;
|
||||
t_irc_channel *ptr_channel;
|
||||
char option_name[256];
|
||||
char *pos, option_name[256], *string;
|
||||
t_weechat_alias *ptr_alias;
|
||||
t_config_option *option;
|
||||
void *option_value;
|
||||
char option_string[2048];
|
||||
|
||||
/* WeeChat internal commands */
|
||||
|
||||
@@ -193,7 +201,22 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "perl") == 0)
|
||||
if ((strcasecmp (completion->base_command, "key") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"unbind");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"functions");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"reset");
|
||||
return;
|
||||
}
|
||||
if (((strcasecmp (completion->base_command, "perl") == 0)
|
||||
|| (strcasecmp (completion->base_command, "python") == 0))
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -202,39 +225,105 @@ 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_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
weechat_options[i][j].option_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
|
||||
{
|
||||
snprintf (option_name, sizeof (option_name), "%s.%s",
|
||||
ptr_server->name,
|
||||
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
weechat_options[i][j].option_name);
|
||||
option_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
else if (completion->base_command_arg == 3)
|
||||
{
|
||||
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
|
||||
if (completion->args)
|
||||
{
|
||||
snprintf (option_name, sizeof (option_name), "%s.%s",
|
||||
ptr_server->name,
|
||||
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
option_name);
|
||||
pos = strchr (completion->args, ' ');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
option = NULL;
|
||||
option_value = NULL;
|
||||
config_option_search_option_value (completion->args, &option, &option_value);
|
||||
if (option && option_value)
|
||||
{
|
||||
switch (option->option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if (option_value && (*((int *)(option_value))))
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"on");
|
||||
else
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
snprintf (option_string, sizeof (option_string) - 1,
|
||||
"%d", (option_value) ? *((int *)(option_value)) : option->default_int);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
option_string);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
(option_value) ?
|
||||
option->array_values[*((int *)(option_value))] :
|
||||
option->array_values[option->default_int]);
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
(option_value) ?
|
||||
gui_get_color_by_value (*((int *)(option_value))) :
|
||||
option->default_string);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
(option_value) ?
|
||||
*((char **)(option_value)) :
|
||||
option->default_string);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (pos)
|
||||
pos[0] = ' ';
|
||||
}
|
||||
}
|
||||
else
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "unalias") == 0)
|
||||
@@ -335,6 +424,9 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"action");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"ping");
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
"version");
|
||||
@@ -392,6 +484,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)
|
||||
@@ -430,9 +527,16 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
|| !((t_irc_channel *)channel)->topic[0])
|
||||
completion_stop (completion);
|
||||
else
|
||||
{
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
((t_irc_channel *)channel)->topic);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
((t_irc_channel *)channel)->topic);
|
||||
string);
|
||||
free (string);
|
||||
}
|
||||
}
|
||||
else
|
||||
completion_stop (completion);
|
||||
@@ -462,6 +566,8 @@ completion_find_context (t_completion *completion, void *channel, char *buffer,
|
||||
command_arg++;
|
||||
i++;
|
||||
while ((i < pos) && (buffer[i] == ' ')) i++;
|
||||
if (!completion->args)
|
||||
completion->args = strdup (buffer + i);
|
||||
}
|
||||
else
|
||||
i++;
|
||||
|
||||
@@ -39,6 +39,7 @@ struct t_completion
|
||||
char *base_word; /* word to complete (when Tab was pressed) */
|
||||
int base_word_pos; /* beggining of base word */
|
||||
int position; /* position where Tab was pressed */
|
||||
char *args; /* command line args (including base word) */
|
||||
|
||||
/* for command argument completion */
|
||||
t_weelist *completion_list; /* data list for completion */
|
||||
|
||||
+3
-19
@@ -112,16 +112,8 @@ fifo_exec (char *text)
|
||||
if (text[0] == '*')
|
||||
{
|
||||
pos_msg = text + 1;
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
ptr_buffer = gui_current_window->buffer;
|
||||
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s invalid buffer for displaying text via FIFO pipe\n"),
|
||||
WEECHAT_WARNING);
|
||||
return;
|
||||
}
|
||||
ptr_buffer = (gui_current_window->buffer->has_input) ? gui_current_window->buffer : gui_buffers;
|
||||
ptr_server = SERVER(ptr_buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -172,20 +164,12 @@ fifo_exec (char *text)
|
||||
}
|
||||
}
|
||||
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s invalid text received on FIFO pipe\n"),
|
||||
WEECHAT_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ptr_buffer)
|
||||
{
|
||||
if (ptr_channel)
|
||||
ptr_buffer = ptr_channel->buffer;
|
||||
else
|
||||
ptr_buffer = ptr_server->buffer;
|
||||
ptr_buffer = gui_buffers;
|
||||
}
|
||||
|
||||
user_command (ptr_server, ptr_buffer, pos_msg);
|
||||
|
||||
@@ -23,12 +23,17 @@
|
||||
|
||||
#include "../irc/irc.h"
|
||||
|
||||
#define HOTLIST_LOW 0
|
||||
#define HOTLIST_MSG 1
|
||||
#define HOTLIST_PRIVATE 2
|
||||
#define HOTLIST_HIGHLIGHT 3
|
||||
|
||||
typedef struct t_weechat_hotlist t_weechat_hotlist;
|
||||
|
||||
struct t_weechat_hotlist
|
||||
{
|
||||
int priority; /* 0=crappy msg (join/part), 1=msg, */
|
||||
/* 2=nick highlight */
|
||||
/* 2=pv, 3=nick highlight */
|
||||
t_gui_buffer *buffer; /* associated buffer */
|
||||
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
|
||||
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
|
||||
|
||||
+113
-35
@@ -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))
|
||||
@@ -301,6 +313,48 @@ void wee_display_commands (int weechat_cmd, int irc_cmd)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_key_functions: display WeeChat key functions
|
||||
*/
|
||||
|
||||
void wee_display_key_functions ()
|
||||
{
|
||||
int i;
|
||||
|
||||
printf (_("Internal key functions:\n"));
|
||||
printf ("\n");
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
printf ("* %s: %s\n",
|
||||
gui_key_functions[i].function_name,
|
||||
_(gui_key_functions[i].description));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_keys: display WeeChat default keys
|
||||
*/
|
||||
|
||||
void wee_display_keys ()
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name;
|
||||
|
||||
printf (_("%s default keys:\n"), PACKAGE_NAME);
|
||||
printf ("\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
printf ("* %s => %s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
(ptr_key->function) ? gui_key_function_search_by_ptr (ptr_key->function) : ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_parse_args: parse command line args
|
||||
*/
|
||||
@@ -319,40 +373,52 @@ wee_parse_args (int argc, char *argv[])
|
||||
|| (strcmp (argv[i], "--config") == 0))
|
||||
{
|
||||
wee_display_config_options ();
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-f") == 0)
|
||||
|| (strcmp (argv[i], "--key-functions") == 0))
|
||||
{
|
||||
wee_display_key_functions ();
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-h") == 0)
|
||||
|| (strcmp (argv[i], "--help") == 0))
|
||||
{
|
||||
printf ("\n" WEE_USAGE1, argv[0], argv[0]);
|
||||
printf ("%s", WEE_USAGE2);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
if ((strcmp (argv[i], "-i") == 0)
|
||||
else if ((strcmp (argv[i], "-i") == 0)
|
||||
|| (strcmp (argv[i], "--irc-commands") == 0))
|
||||
{
|
||||
wee_display_commands (0, 1);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-k") == 0)
|
||||
|| (strcmp (argv[i], "--keys") == 0))
|
||||
{
|
||||
wee_display_keys ();
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-l") == 0)
|
||||
|| (strcmp (argv[i], "--license") == 0))
|
||||
{
|
||||
printf ("\n%s%s", WEE_LICENSE);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-v") == 0)
|
||||
|| (strcmp (argv[i], "--version") == 0))
|
||||
{
|
||||
printf (PACKAGE_VERSION "\n");
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
if ((strcmp (argv[i], "-w") == 0)
|
||||
else if ((strcmp (argv[i], "-w") == 0)
|
||||
|| (strcmp (argv[i], "--weechat-commands") == 0))
|
||||
{
|
||||
wee_display_commands (1, 0);
|
||||
wee_shutdown (EXIT_SUCCESS);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strncasecmp (argv[i], "irc://", 6) == 0))
|
||||
else if ((strncasecmp (argv[i], "irc", 3) == 0))
|
||||
{
|
||||
if (server_init_with_url (argv[i], &server_tmp) < 0)
|
||||
{
|
||||
@@ -365,9 +431,10 @@ wee_parse_args (int argc, char *argv[])
|
||||
server_tmp.autoreconnect,
|
||||
server_tmp.autoreconnect_delay,
|
||||
1, server_tmp.address, server_tmp.port,
|
||||
server_tmp.ipv6, server_tmp.ssl,
|
||||
server_tmp.password, server_tmp.nick1,
|
||||
server_tmp.nick2, server_tmp.nick3,
|
||||
NULL, NULL, NULL, 0, server_tmp.autojoin, 1))
|
||||
NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL))
|
||||
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
server_destroy (&server_tmp);
|
||||
@@ -425,7 +492,7 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s unable to get HOME directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
dir_length = strlen (ptr_home) + 10;
|
||||
weechat_home =
|
||||
@@ -434,7 +501,7 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s not enough memory for home directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
DIR_SEPARATOR);
|
||||
@@ -444,7 +511,7 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create ~/.weechat directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
|
||||
dir_length = strlen (weechat_home) + 64;
|
||||
@@ -512,6 +579,13 @@ wee_init_vars ()
|
||||
/* init received messages queue */
|
||||
recv_msgq = NULL;
|
||||
msgq_last_msg = NULL;
|
||||
|
||||
/* init gnutls */
|
||||
#ifdef HAVE_GNUTLS
|
||||
gnutls_global_init ();
|
||||
gnutls_certificate_allocate_credentials (&gnutls_xcred);
|
||||
gnutls_certificate_set_x509_trust_file (gnutls_xcred, "ca.pem", GNUTLS_X509_FMT_PEM);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -573,6 +647,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__);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -592,7 +669,7 @@ wee_gui_shutdown ()
|
||||
*/
|
||||
|
||||
void
|
||||
wee_shutdown (int return_code)
|
||||
wee_shutdown (int return_code, int crash)
|
||||
{
|
||||
fifo_remove ();
|
||||
if (weechat_home)
|
||||
@@ -602,7 +679,16 @@ wee_shutdown (int return_code)
|
||||
if (local_charset)
|
||||
free (local_charset);
|
||||
alias_free_all ();
|
||||
exit (return_code);
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
gnutls_certificate_free_credentials (gnutls_xcred);
|
||||
gnutls_global_deinit();
|
||||
#endif
|
||||
|
||||
if (crash)
|
||||
abort();
|
||||
else
|
||||
exit (return_code);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -625,7 +711,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");
|
||||
@@ -692,17 +778,6 @@ wee_dump (int crash)
|
||||
wee_log_printf ("\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* my_sigint: SIGINT handler, do nothing (just ignore this signal)
|
||||
* Prevents user for exiting with Ctrl-C
|
||||
*/
|
||||
|
||||
void
|
||||
my_sigint ()
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
/*
|
||||
* my_sigsegv: SIGSEGV handler: save crash log to ~/.weechat/weechat.log and exit
|
||||
*/
|
||||
@@ -718,7 +793,7 @@ my_sigsegv ()
|
||||
fprintf (stderr, "*** Please send this file to WeeChat developers.\n");
|
||||
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
|
||||
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
|
||||
wee_shutdown (EXIT_FAILURE);
|
||||
wee_shutdown (EXIT_FAILURE, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -734,12 +809,15 @@ 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 (SIGINT, SIG_IGN); /* ignore SIGINT signal */
|
||||
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */
|
||||
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */
|
||||
wee_init_vars (); /* initialize some variables */
|
||||
gui_key_init (); /* init keyboard (default key bindings) */
|
||||
wee_parse_args (argc, argv); /* parse command line args */
|
||||
wee_create_home_dirs (); /* create WeeChat directories */
|
||||
wee_init_log (); /* init log file */
|
||||
@@ -761,8 +839,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 */
|
||||
@@ -774,7 +852,7 @@ main (int argc, char *argv[])
|
||||
(void) config_write (NULL); /* save config file */
|
||||
command_index_free (); /* free commands index */
|
||||
wee_gui_shutdown (); /* shut down WeeChat GUI */
|
||||
wee_shutdown (EXIT_SUCCESS); /* quit WeeChat (oh no, why?) */
|
||||
wee_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */
|
||||
|
||||
return EXIT_SUCCESS; /* make gcc happy (never executed) */
|
||||
}
|
||||
|
||||
+18
-4
@@ -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,12 +86,14 @@
|
||||
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
|
||||
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
|
||||
"Usage: %s [options ...]\n" \
|
||||
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
|
||||
" or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]\n\n"
|
||||
|
||||
#define WEE_USAGE2 \
|
||||
" -c, --config display config file options\n" \
|
||||
" -h, --help this help screen\n" \
|
||||
" -f, --key-functions display WeeChat internal functions for keys\n" \
|
||||
" -h, --help this help\n" \
|
||||
" -i, --irc-commands display IRC commands\n" \
|
||||
" -k, --keys display WeeChat default keys\n" \
|
||||
" -l, --license display WeeChat license\n" \
|
||||
" -v, --version display WeeChat version\n" \
|
||||
" -w, --weechat-commands display WeeChat commands\n\n"
|
||||
@@ -104,10 +114,14 @@ extern int quit_weechat;
|
||||
extern char *weechat_home;
|
||||
extern char *local_charset;
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
extern gnutls_certificate_credentials gnutls_xcred;
|
||||
#endif
|
||||
|
||||
extern void wee_log_printf (char *, ...);
|
||||
extern void wee_dump (int);
|
||||
extern char *weechat_convert_encoding (char *, char *, char *);
|
||||
extern long get_timeval_diff (struct timeval *, struct timeval *);
|
||||
extern void wee_shutdown (int);
|
||||
extern void wee_shutdown (int, int);
|
||||
|
||||
#endif /* weechat.h */
|
||||
|
||||
+258
-31
@@ -53,6 +53,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
|
||||
{ CONFIG_SECTION_IRC, "irc" },
|
||||
{ CONFIG_SECTION_DCC, "dcc" },
|
||||
{ CONFIG_SECTION_PROXY, "proxy" },
|
||||
{ CONFIG_SECTION_KEYS, "keys" },
|
||||
{ CONFIG_SECTION_ALIAS, "alias" },
|
||||
{ CONFIG_SECTION_SERVER, "server" }
|
||||
};
|
||||
@@ -66,6 +67,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;
|
||||
@@ -81,6 +83,7 @@ char *cfg_look_no_nickname;
|
||||
char *cfg_look_completor;
|
||||
int cfg_look_infobar;
|
||||
char *cfg_look_infobar_timestamp;
|
||||
int cfg_look_infobar_seconds;
|
||||
int cfg_look_infobar_delay_highlight;
|
||||
|
||||
t_config_option weechat_options_look[] =
|
||||
@@ -112,6 +115,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,
|
||||
@@ -165,7 +172,11 @@ t_config_option weechat_options_look[] =
|
||||
{ "look_infobar_timestamp", N_("timestamp for time in infobar"),
|
||||
N_("timestamp for time in infobar"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"%B, %A %d %Y - %H:%M", NULL, NULL, &cfg_look_infobar_timestamp, config_change_buffer_content },
|
||||
"%B, %A %d %Y", NULL, NULL, &cfg_look_infobar_timestamp, config_change_buffer_content },
|
||||
{ "look_infobar_seconds", N_("display seconds in infobar time"),
|
||||
N_("display seconds in infobar time"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_infobar_seconds, NULL, config_change_buffer_content },
|
||||
{ "look_infobar_delay_highlight", N_("delay (in seconds) for highlight messages in infobar"),
|
||||
N_("delay (in seconds) for highlight messages in infobar "
|
||||
"(0 = disable highlight notifications in infobar)"),
|
||||
@@ -183,6 +194,8 @@ int cfg_col_chat_time;
|
||||
int cfg_col_chat_time_sep;
|
||||
int cfg_col_chat_prefix1;
|
||||
int cfg_col_chat_prefix2;
|
||||
int cfg_col_chat_join;
|
||||
int cfg_col_chat_part;
|
||||
int cfg_col_chat_nick;
|
||||
int cfg_col_chat_host;
|
||||
int cfg_col_chat_channel;
|
||||
@@ -192,11 +205,13 @@ int cfg_col_chat_bg;
|
||||
int cfg_col_status;
|
||||
int cfg_col_status_delimiters;
|
||||
int cfg_col_status_data_msg;
|
||||
int cfg_col_status_data_private;
|
||||
int cfg_col_status_data_highlight;
|
||||
int cfg_col_status_data_other;
|
||||
int cfg_col_status_more;
|
||||
int cfg_col_status_bg;
|
||||
int cfg_col_infobar;
|
||||
int cfg_col_infobar_delimiters;
|
||||
int cfg_col_infobar_highlight;
|
||||
int cfg_col_infobar_bg;
|
||||
int cfg_col_input;
|
||||
@@ -210,6 +225,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;
|
||||
@@ -254,6 +270,14 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for middle char of prefix"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"white", NULL, &cfg_col_chat_prefix2, NULL, &config_change_color },
|
||||
{ "col_chat_join", N_("color for join arrow (prefix)"),
|
||||
N_("color for join arrow (prefix)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightgreen", NULL, &cfg_col_chat_join, NULL, &config_change_color },
|
||||
{ "col_chat_part", N_("color for part/quit arrow (prefix)"),
|
||||
N_("color for part/quit arrow (prefix)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightred", NULL, &cfg_col_chat_part, NULL, &config_change_color },
|
||||
{ "col_chat_nick", N_("color for nicks in actions"),
|
||||
N_("color for nicks in actions (chat window)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -292,10 +316,14 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for window with new messages (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"yellow", NULL, &cfg_col_status_data_msg, NULL, &config_change_color },
|
||||
{ "col_status_private", N_("color for window with private message"),
|
||||
N_("color for window with private message (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightmagenta", NULL, &cfg_col_status_data_private, NULL, &config_change_color },
|
||||
{ "col_status_highlight", N_("color for window with highlight"),
|
||||
N_("color for window with highlight (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightmagenta", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
|
||||
"lightred", NULL, &cfg_col_status_data_highlight, NULL, &config_change_color },
|
||||
{ "col_status_data_other", N_("color for window with new data (not messages)"),
|
||||
N_("color for window with new data (not messages) (status bar)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -314,6 +342,10 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for info bar text"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"black", NULL, &cfg_col_infobar, NULL, &config_change_color },
|
||||
{ "col_infobar_delimiters", N_("color for infobar delimiters"),
|
||||
N_("color for infobar delimiters"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"blue", NULL, &cfg_col_infobar_delimiters, NULL, &config_change_color },
|
||||
{ "col_infobar_highlight", N_("color for info bar highlight notification"),
|
||||
N_("color for info bar highlight notification"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -370,6 +402,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,
|
||||
@@ -491,6 +527,7 @@ int cfg_irc_lag_check;
|
||||
int cfg_irc_lag_min_show;
|
||||
int cfg_irc_lag_disconnect;
|
||||
int cfg_irc_fifo_pipe;
|
||||
char *cfg_irc_highlight;
|
||||
|
||||
t_config_option weechat_options_irc[] =
|
||||
{ { "irc_display_away", N_("display message to all channels when away"),
|
||||
@@ -504,7 +541,7 @@ t_config_option weechat_options_irc[] =
|
||||
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
|
||||
N_("default part message (leaving channel)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
|
||||
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
|
||||
{ "irc_default_msg_quit", N_("default quit message"),
|
||||
N_("default quit message ('%v' will be replaced by WeeChat version in string)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
@@ -529,6 +566,10 @@ t_config_option weechat_options_irc[] =
|
||||
N_("create a FIFO pipe for remote control"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &cfg_irc_fifo_pipe, NULL, config_change_fifo_pipe },
|
||||
{ "irc_highlight", N_("list of words to highlight"),
|
||||
N_("comma separated list of words to highlight (case insensitive comparison)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_irc_highlight, config_change_noop },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -587,8 +628,13 @@ t_config_option weechat_options_dcc[] =
|
||||
/* config, proxy section */
|
||||
|
||||
int cfg_proxy_use;
|
||||
int cfg_proxy_type;
|
||||
int cfg_proxy_ipv6;
|
||||
char *cfg_proxy_type_values[] =
|
||||
{ "http", "socks4", "socks5", NULL };
|
||||
char *cfg_proxy_address;
|
||||
int cfg_proxy_port;
|
||||
char *cfg_proxy_username;
|
||||
char *cfg_proxy_password;
|
||||
|
||||
t_config_option weechat_options_proxy[] =
|
||||
@@ -596,14 +642,26 @@ t_config_option weechat_options_proxy[] =
|
||||
N_("use a proxy server to connect to irc server"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &cfg_proxy_use, NULL, config_change_noop },
|
||||
{ "proxy_type", N_("proxy type"),
|
||||
N_("proxy type (http (default), socks4, socks5)"),
|
||||
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
|
||||
"http", cfg_proxy_type_values, &cfg_proxy_type, NULL, config_change_noop },
|
||||
{ "proxy_ipv6", N_("use ipv6 proxy"),
|
||||
N_("connect to proxy in ipv6"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &cfg_proxy_ipv6, NULL, config_change_noop },
|
||||
{ "proxy_address", N_("proxy address"),
|
||||
N_("proxy server address (IP or hostname)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_proxy_address, config_change_noop },
|
||||
{ "proxy_port", N_("port for proxy"),
|
||||
N_("port for connecting to proxy server"),
|
||||
OPTION_TYPE_INT, 0, 65535, 1080,
|
||||
OPTION_TYPE_INT, 0, 65535, 3128,
|
||||
NULL, NULL, &cfg_proxy_port, NULL, config_change_noop },
|
||||
{ "proxy_username", N_("proxy username"),
|
||||
N_("username for proxy server"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_proxy_username, config_change_noop },
|
||||
{ "proxy_password", N_("proxy password"),
|
||||
N_("password for proxy server"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
@@ -640,6 +698,14 @@ t_config_option weechat_options_server[] =
|
||||
N_("port for connecting to server"),
|
||||
OPTION_TYPE_INT, 0, 65535, 6667,
|
||||
NULL, NULL, &(cfg_server.port), NULL, NULL },
|
||||
{ "server_ipv6", N_("use IPv6 protocol for server communication"),
|
||||
N_("use IPv6 protocol for server communication"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &(cfg_server.ipv6), NULL, NULL },
|
||||
{ "server_ssl", N_("use SSL for server communication"),
|
||||
N_("use SSL for server communication"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &(cfg_server.ssl), NULL, NULL },
|
||||
{ "server_password", N_("server password"),
|
||||
N_("password for IRC server"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
@@ -680,6 +746,10 @@ t_config_option weechat_options_server[] =
|
||||
N_("automatically rejoin channels when kicked"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &(cfg_server.autorejoin), NULL, NULL },
|
||||
{ "server_notify_levels", N_("notify levels for channels of this server"),
|
||||
N_("comma separated list of notify levels for channels of this server (format: #channel:1,..)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.notify_levels), config_change_notify_levels },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -688,7 +758,7 @@ t_config_option weechat_options_server[] =
|
||||
t_config_option *weechat_options[CONFIG_NUMBER_SECTIONS] =
|
||||
{ weechat_options_look, weechat_options_colors, weechat_options_history,
|
||||
weechat_options_log, weechat_options_irc, weechat_options_dcc,
|
||||
weechat_options_proxy, NULL, weechat_options_server
|
||||
weechat_options_proxy, NULL, NULL, weechat_options_server
|
||||
};
|
||||
|
||||
|
||||
@@ -724,7 +794,8 @@ config_get_section (t_config_option *ptr_option)
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -824,6 +895,23 @@ config_change_fifo_pipe ()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* config_change_notify_levels: called when notify levels is changed for a server
|
||||
*/
|
||||
|
||||
void
|
||||
config_change_notify_levels ()
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL(ptr_buffer) || BUFFER_IS_PRIVATE(ptr_buffer))
|
||||
ptr_buffer->notify_level =
|
||||
channel_get_notify_level (SERVER(ptr_buffer), CHANNEL(ptr_buffer));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* config_option_set_value: set new value for an option
|
||||
* return: 0 if success
|
||||
@@ -889,6 +977,10 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
|
||||
return (void *)(&server->address);
|
||||
if (strcasecmp (option_name, "server_port") == 0)
|
||||
return (void *)(&server->port);
|
||||
if (strcasecmp (option_name, "server_ipv6") == 0)
|
||||
return (void *)(&server->ipv6);
|
||||
if (strcasecmp (option_name, "server_ssl") == 0)
|
||||
return (void *)(&server->ssl);
|
||||
if (strcasecmp (option_name, "server_password") == 0)
|
||||
return (void *)(&server->password);
|
||||
if (strcasecmp (option_name, "server_nick1") == 0)
|
||||
@@ -909,6 +1001,8 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
|
||||
return (void *)(&server->autojoin);
|
||||
if (strcasecmp (option_name, "server_autorejoin") == 0)
|
||||
return (void *)(&server->autorejoin);
|
||||
if (strcasecmp (option_name, "server_notify_levels") == 0)
|
||||
return (void *)(&server->notify_levels);
|
||||
/* option not found */
|
||||
return NULL;
|
||||
}
|
||||
@@ -978,6 +1072,8 @@ config_set_server_value (t_irc_server *server, char *option_name,
|
||||
*((char **)ptr_data) = strdup (value);
|
||||
break;
|
||||
}
|
||||
if (ptr_option->handler_change != NULL)
|
||||
(void) (ptr_option->handler_change());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -993,7 +1089,8 @@ config_option_search (char *option_name)
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -1007,6 +1104,72 @@ config_option_search (char *option_name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* config_option_search_option_value: look for type and value of an option
|
||||
* (including server options)
|
||||
* if option is not found, NULL is returned
|
||||
*/
|
||||
|
||||
void
|
||||
config_option_search_option_value (char *option_name, t_config_option **option,
|
||||
void **option_value)
|
||||
{
|
||||
t_config_option *ptr_option;
|
||||
t_irc_server *ptr_server;
|
||||
int i;
|
||||
void *ptr_value;
|
||||
char *pos;
|
||||
|
||||
ptr_option = NULL;
|
||||
ptr_value = NULL;
|
||||
|
||||
ptr_option = config_option_search (option_name);
|
||||
if (!ptr_option)
|
||||
{
|
||||
pos = strchr (option_name, '.');
|
||||
if (pos)
|
||||
{
|
||||
pos[0] = '\0';
|
||||
ptr_server = server_search (option_name);
|
||||
if (ptr_server)
|
||||
{
|
||||
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
|
||||
{
|
||||
if (strcmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name,
|
||||
pos + 1) == 0)
|
||||
{
|
||||
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
|
||||
ptr_value = config_get_server_option_ptr (ptr_server, pos + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
pos[0] = '.';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ptr_option->option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
case OPTION_TYPE_INT:
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
case OPTION_TYPE_COLOR:
|
||||
ptr_value = (void *)(ptr_option->ptr_int);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
ptr_value = (void *)(ptr_option->ptr_string);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ptr_option)
|
||||
{
|
||||
*option = ptr_option;
|
||||
*option_value = ptr_value;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* config_set_value: set new value for an option (found by name)
|
||||
* return: 0 if success
|
||||
@@ -1058,12 +1221,13 @@ config_allocate_server (char *filename, int line_number)
|
||||
return 0;
|
||||
}
|
||||
if (!server_new (cfg_server.name,
|
||||
cfg_server.autoconnect, cfg_server.autoreconnect,
|
||||
cfg_server.autoreconnect_delay, 0, cfg_server.address, cfg_server.port,
|
||||
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
|
||||
cfg_server.nick3, cfg_server.username, cfg_server.realname,
|
||||
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
|
||||
cfg_server.autorejoin))
|
||||
cfg_server.autoconnect, cfg_server.autoreconnect,
|
||||
cfg_server.autoreconnect_delay, 0, cfg_server.address,
|
||||
cfg_server.port, cfg_server.ipv6, cfg_server.ssl,
|
||||
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
|
||||
cfg_server.nick3, cfg_server.username, cfg_server.realname,
|
||||
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
|
||||
cfg_server.autorejoin, cfg_server.notify_levels))
|
||||
{
|
||||
server_free_all ();
|
||||
gui_printf (NULL,
|
||||
@@ -1089,7 +1253,8 @@ config_default_values ()
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
@@ -1244,8 +1409,22 @@ config_read ()
|
||||
if (pos2 != NULL)
|
||||
pos2[0] = '\0';
|
||||
|
||||
if (section == CONFIG_SECTION_ALIAS)
|
||||
if (section == CONFIG_SECTION_KEYS)
|
||||
{
|
||||
if (pos[0])
|
||||
{
|
||||
/* bind key (overwrite any binding with same key) */
|
||||
gui_key_bind (line, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* unbin key if no value given */
|
||||
gui_key_unbind (line);
|
||||
}
|
||||
}
|
||||
else if (section == CONFIG_SECTION_ALIAS)
|
||||
{
|
||||
/* create new alias */
|
||||
if (alias_new (line, pos))
|
||||
weelist_add (&index_commands, &last_index_command, line);
|
||||
}
|
||||
@@ -1362,6 +1541,8 @@ config_create_default ()
|
||||
time_t current_time;
|
||||
struct passwd *my_passwd;
|
||||
char *realname, *pos;
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name, *function_name;
|
||||
|
||||
filename_length = strlen (weechat_home) + 64;
|
||||
filename =
|
||||
@@ -1379,7 +1560,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 "
|
||||
@@ -1389,13 +1570,10 @@ config_create_default ()
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
|
||||
if (i == CONFIG_SECTION_PROXY)
|
||||
fprintf (file,
|
||||
"# WARNING!!! Options for section \"%s\" are not developed!\n",
|
||||
config_sections[i].section_name);
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
switch (weechat_options[i][j].option_type)
|
||||
@@ -1423,6 +1601,27 @@ config_create_default ()
|
||||
}
|
||||
}
|
||||
|
||||
/* default key bindings */
|
||||
fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
if (ptr_key->function)
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
}
|
||||
else
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/* default aliases */
|
||||
/* TODO: remove comments when missing commands will be ok */
|
||||
fprintf (file, "\n[alias]\n");
|
||||
@@ -1433,20 +1632,20 @@ config_create_default ()
|
||||
fprintf (file, "C=clear\n");
|
||||
fprintf (file, "CL=clear\n");
|
||||
fprintf (file, "CLOSE=buffer close\n");
|
||||
fprintf (file, "# CHAT=dcc chat\n");
|
||||
fprintf (file, "CHAT=dcc chat\n");
|
||||
fprintf (file, "# GET=dcc get\n");
|
||||
fprintf (file, "# IG=ignore\n");
|
||||
fprintf (file, "J=join\n");
|
||||
fprintf (file, "K=kick\n");
|
||||
fprintf (file, "# KB=kickban\n");
|
||||
fprintf (file, "KB=kickban\n");
|
||||
fprintf (file, "# KN=knockout\n");
|
||||
fprintf (file, "LEAVE=part\n");
|
||||
fprintf (file, "M=msg\n");
|
||||
fprintf (file, "# MUB=unban *\n");
|
||||
fprintf (file, "MUB=unban *\n");
|
||||
fprintf (file, "N=names\n");
|
||||
fprintf (file, "Q=query\n");
|
||||
fprintf (file, "T=topic\n");
|
||||
fprintf (file, "# UB=unban\n");
|
||||
fprintf (file, "UB=unban\n");
|
||||
fprintf (file, "# UNIG=unignore\n");
|
||||
fprintf (file, "W=who\n");
|
||||
fprintf (file, "WC=part\n");
|
||||
@@ -1461,6 +1660,8 @@ config_create_default ()
|
||||
fprintf (file, "server_autoreconnect_delay=30\n");
|
||||
fprintf (file, "server_address=irc.freenode.net\n");
|
||||
fprintf (file, "server_port=6667\n");
|
||||
fprintf (file, "server_ipv6=off\n");
|
||||
fprintf (file, "server_ssl=off\n");
|
||||
fprintf (file, "server_password=\n");
|
||||
|
||||
/* Get the user's name from /etc/passwd */
|
||||
@@ -1529,6 +1730,8 @@ config_write (char *config_name)
|
||||
time_t current_time;
|
||||
t_irc_server *ptr_server;
|
||||
t_weechat_alias *ptr_alias;
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name, *function_name;
|
||||
|
||||
if (config_name)
|
||||
filename = strdup (config_name);
|
||||
@@ -1551,7 +1754,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 "
|
||||
@@ -1561,13 +1764,10 @@ config_write (char *config_name)
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
|
||||
if (i == CONFIG_SECTION_PROXY)
|
||||
fprintf (file,
|
||||
"# WARNING!!! Options for section \"%s\" are not developed!\n",
|
||||
config_sections[i].section_name);
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
switch (weechat_options[i][j].option_type)
|
||||
@@ -1612,6 +1812,27 @@ config_write (char *config_name)
|
||||
}
|
||||
}
|
||||
|
||||
/* keys section */
|
||||
fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_key_get_expanded_name (ptr_key->key);
|
||||
if (ptr_key->function)
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
}
|
||||
else
|
||||
fprintf (file, "%s=%s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/* alias section */
|
||||
fprintf (file, "\n[alias]\n");
|
||||
for (ptr_alias = weechat_alias; ptr_alias;
|
||||
@@ -1637,6 +1858,10 @@ config_write (char *config_name)
|
||||
ptr_server->autoreconnect_delay);
|
||||
fprintf (file, "server_address=%s\n", ptr_server->address);
|
||||
fprintf (file, "server_port=%d\n", ptr_server->port);
|
||||
fprintf (file, "server_ipv6=%s\n",
|
||||
(ptr_server->ipv6) ? "on" : "off");
|
||||
fprintf (file, "server_ssl=%s\n",
|
||||
(ptr_server->ssl) ? "on" : "off");
|
||||
fprintf (file, "server_password=%s\n",
|
||||
(ptr_server->password) ? ptr_server->password : "");
|
||||
fprintf (file, "server_nick1=%s\n", ptr_server->nick1);
|
||||
@@ -1651,6 +1876,8 @@ config_write (char *config_name)
|
||||
(ptr_server->autojoin) ? ptr_server->autojoin : "");
|
||||
fprintf (file, "server_autorejoin=%s\n",
|
||||
(ptr_server->autorejoin) ? "on" : "off");
|
||||
fprintf (file, "server_notify_levels=%s\n",
|
||||
(ptr_server->notify_levels) ? ptr_server->notify_levels : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+18
-3
@@ -33,9 +33,10 @@
|
||||
#define CONFIG_SECTION_IRC 4
|
||||
#define CONFIG_SECTION_DCC 5
|
||||
#define CONFIG_SECTION_PROXY 6
|
||||
#define CONFIG_SECTION_ALIAS 7
|
||||
#define CONFIG_SECTION_SERVER 8
|
||||
#define CONFIG_NUMBER_SECTIONS 9
|
||||
#define CONFIG_SECTION_KEYS 7
|
||||
#define CONFIG_SECTION_ALIAS 8
|
||||
#define CONFIG_SECTION_SERVER 9
|
||||
#define CONFIG_NUMBER_SECTIONS 10
|
||||
|
||||
#define OPTION_TYPE_BOOLEAN 1 /* values: on/off */
|
||||
#define OPTION_TYPE_INT 2 /* values: from min to max */
|
||||
@@ -83,6 +84,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;
|
||||
@@ -96,6 +98,7 @@ extern char *cfg_look_no_nickname;
|
||||
extern char *cfg_look_completor;
|
||||
extern int cfg_look_infobar;
|
||||
extern char *cfg_look_infobar_timestamp;
|
||||
extern int cfg_look_infobar_seconds;
|
||||
extern int cfg_look_infobar_delay_highlight;
|
||||
|
||||
extern int cfg_col_title;
|
||||
@@ -105,6 +108,8 @@ extern int cfg_col_chat_time;
|
||||
extern int cfg_col_chat_time_sep;
|
||||
extern int cfg_col_chat_prefix1;
|
||||
extern int cfg_col_chat_prefix2;
|
||||
extern int cfg_col_chat_join;
|
||||
extern int cfg_col_chat_part;
|
||||
extern int cfg_col_chat_nick;
|
||||
extern int cfg_col_chat_host;
|
||||
extern int cfg_col_chat_channel;
|
||||
@@ -114,11 +119,13 @@ extern int cfg_col_chat_bg;
|
||||
extern int cfg_col_status;
|
||||
extern int cfg_col_status_delimiters;
|
||||
extern int cfg_col_status_data_msg;
|
||||
extern int cfg_col_status_data_private;
|
||||
extern int cfg_col_status_data_highlight;
|
||||
extern int cfg_col_status_data_other;
|
||||
extern int cfg_col_status_more;
|
||||
extern int cfg_col_status_bg;
|
||||
extern int cfg_col_infobar;
|
||||
extern int cfg_col_infobar_delimiters;
|
||||
extern int cfg_col_infobar_highlight;
|
||||
extern int cfg_col_infobar_bg;
|
||||
extern int cfg_col_input;
|
||||
@@ -132,6 +139,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;
|
||||
@@ -164,6 +172,7 @@ extern int cfg_irc_lag_check;
|
||||
extern int cfg_irc_lag_min_show;
|
||||
extern int cfg_irc_lag_disconnect;
|
||||
extern int cfg_irc_fifo_pipe;
|
||||
extern char *cfg_irc_highlight;
|
||||
|
||||
extern int cfg_dcc_auto_accept_files;
|
||||
extern int cfg_dcc_auto_accept_chats;
|
||||
@@ -176,8 +185,12 @@ extern int cfg_dcc_auto_rename;
|
||||
extern int cfg_dcc_auto_resume;
|
||||
|
||||
extern int cfg_proxy_use;
|
||||
extern int cfg_proxy_type;
|
||||
extern char *cfg_proxy_type_values[];
|
||||
extern int cfg_proxy_ipv6;
|
||||
extern char *cfg_proxy_address;
|
||||
extern int cfg_proxy_port;
|
||||
extern char *cfg_proxy_username;
|
||||
extern char *cfg_proxy_password;
|
||||
|
||||
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
|
||||
@@ -191,8 +204,10 @@ extern void config_change_buffer_content ();
|
||||
extern void config_change_color ();
|
||||
extern void config_change_away_check ();
|
||||
extern void config_change_fifo_pipe ();
|
||||
extern void config_change_notify_levels ();
|
||||
extern int config_option_set_value (t_config_option *, char *);
|
||||
extern t_config_option *config_option_search (char *);
|
||||
extern void config_option_search_option_value (char *, t_config_option **, void **);
|
||||
extern int config_set_value (char *, char *);
|
||||
extern void *config_get_server_option_ptr (t_irc_server *, char *);
|
||||
extern int config_set_server_value (t_irc_server *, char *, char *);
|
||||
|
||||
+13
-1
@@ -15,10 +15,22 @@
|
||||
# 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-keyboard.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 +39,4 @@ if GUI_QT
|
||||
qt_dir=qt
|
||||
endif
|
||||
|
||||
SUBDIRS = $(curses_dir) $(gtk_dir) $(qt_dir)
|
||||
SUBDIRS = . $(curses_dir) $(wxwidgets_dir) $(gtk_dir) $(qt_dir)
|
||||
|
||||
@@ -19,12 +19,12 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
bin_PROGRAMS = weechat-curses
|
||||
|
||||
weechat_curses_LDADD = ../../common/lib_weechat_main.a \
|
||||
weechat_curses_LDADD = ../gui-common.o ../gui-keyboard.o \
|
||||
../../common/lib_weechat_main.a \
|
||||
../../irc/lib_weechat_irc.a \
|
||||
$(NCURSES_LIBS) \
|
||||
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
|
||||
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS) \
|
||||
$(GNUTLS_LIBS)
|
||||
|
||||
weechat_curses_SOURCES = ../gui.h \
|
||||
../gui-common.c \
|
||||
gui-display.c \
|
||||
gui-input.c
|
||||
weechat_curses_SOURCES = gui-display.c \
|
||||
gui-input.c
|
||||
|
||||
+532
-353
File diff suppressed because it is too large
Load Diff
+184
-608
@@ -41,623 +41,191 @@
|
||||
#include "../../common/fifo.h"
|
||||
#include "../../irc/irc.h"
|
||||
|
||||
#define KEY_ESCAPE 27
|
||||
|
||||
/*
|
||||
* gui_read_keyb: read keyboard line
|
||||
* gui_input_default_key_bindings: create default key bindings
|
||||
*/
|
||||
|
||||
void
|
||||
gui_read_keyb ()
|
||||
gui_input_default_key_bindings ()
|
||||
{
|
||||
int i;
|
||||
char key_str[32], command[32];
|
||||
|
||||
/* keys binded with internal functions */
|
||||
gui_key_bind ( /* RC */ "ctrl-M", "return");
|
||||
gui_key_bind ( /* RC */ "ctrl-J", "return");
|
||||
gui_key_bind ( /* tab */ "ctrl-I", "tab");
|
||||
gui_key_bind ( /* basckp */ "ctrl-H", "backspace");
|
||||
gui_key_bind ( /* basckp */ "ctrl-?", "backspace");
|
||||
gui_key_bind ( /* del */ "meta2-3~", "delete");
|
||||
gui_key_bind ( /* ^K */ "ctrl-K", "delete_end_line");
|
||||
gui_key_bind ( /* ^U */ "ctrl-U", "delete_beginning_line");
|
||||
gui_key_bind ( /* ^W */ "ctrl-W", "delete_previous_word");
|
||||
gui_key_bind ( /* ^Y */ "ctrl-Y", "clipboard_paste");
|
||||
gui_key_bind ( /* ^T */ "ctrl-T", "transpose_chars");
|
||||
gui_key_bind ( /* home */ "meta2-1~", "home");
|
||||
gui_key_bind ( /* home */ "meta2-H", "home");
|
||||
gui_key_bind ( /* home */ "meta2-7~", "home");
|
||||
gui_key_bind ( /* ^A */ "ctrl-A", "home");
|
||||
gui_key_bind ( /* end */ "meta2-4~", "end");
|
||||
gui_key_bind ( /* end */ "meta2-F", "end");
|
||||
gui_key_bind ( /* end */ "meta2-8~", "end");
|
||||
gui_key_bind ( /* ^E */ "ctrl-E", "end");
|
||||
gui_key_bind ( /* left */ "meta2-D", "left");
|
||||
gui_key_bind ( /* right */ "meta2-C", "right");
|
||||
gui_key_bind ( /* up */ "meta2-A", "up");
|
||||
gui_key_bind ( /* down */ "meta2-B", "down");
|
||||
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
|
||||
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
|
||||
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
|
||||
gui_key_bind ( /* F11 */ "meta2-23~", "nick_page_up");
|
||||
gui_key_bind ( /* F12 */ "meta2-24~", "nick_page_down");
|
||||
gui_key_bind ( /* m-F11 */ "meta-meta2-1~", "nick_beginning");
|
||||
gui_key_bind ( /* m-F12 */ "meta-meta2-4~", "nick_end");
|
||||
gui_key_bind ( /* ^L */ "ctrl-L", "refresh");
|
||||
gui_key_bind ( /* m-a */ "meta-a", "jump_smart");
|
||||
gui_key_bind ( /* m-b */ "meta-b", "previous_word");
|
||||
gui_key_bind ( /* ^left */ "meta-Od", "previous_word");
|
||||
gui_key_bind ( /* m-d */ "meta-d", "delete_next_word");
|
||||
gui_key_bind ( /* m-f */ "meta-f", "next_word");
|
||||
gui_key_bind ( /* ^right */ "meta-Oc", "next_word");
|
||||
gui_key_bind ( /* m-h */ "meta-h", "hotlist_clear");
|
||||
gui_key_bind ( /* m-j,m-d */ "meta-jmeta-d", "jump_dcc");
|
||||
gui_key_bind ( /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer");
|
||||
gui_key_bind ( /* m-j,m-s */ "meta-jmeta-s", "jump_server");
|
||||
gui_key_bind ( /* m-j,m-x */ "meta-jmeta-x", "jump_next_server");
|
||||
gui_key_bind ( /* m-k */ "meta-k", "grab_key");
|
||||
gui_key_bind ( /* m-r */ "meta-r", "delete_line");
|
||||
|
||||
/* keys binded with commands */
|
||||
gui_key_bind ( /* m-left */ "meta-meta2-D", "/buffer -1");
|
||||
gui_key_bind ( /* F5 */ "meta2-15~", "/buffer -1");
|
||||
gui_key_bind ( /* m-right */ "meta-meta2-C", "/buffer +1");
|
||||
gui_key_bind ( /* F6 */ "meta2-17~", "/buffer +1");
|
||||
gui_key_bind ( /* F7 */ "meta2-18~", "/window -1");
|
||||
gui_key_bind ( /* F8 */ "meta2-19~", "/window +1");
|
||||
gui_key_bind ( /* m-0 */ "meta-0", "/buffer 10");
|
||||
gui_key_bind ( /* m-1 */ "meta-1", "/buffer 1");
|
||||
gui_key_bind ( /* m-2 */ "meta-2", "/buffer 2");
|
||||
gui_key_bind ( /* m-3 */ "meta-3", "/buffer 3");
|
||||
gui_key_bind ( /* m-4 */ "meta-4", "/buffer 4");
|
||||
gui_key_bind ( /* m-5 */ "meta-5", "/buffer 5");
|
||||
gui_key_bind ( /* m-6 */ "meta-6", "/buffer 6");
|
||||
gui_key_bind ( /* m-7 */ "meta-7", "/buffer 7");
|
||||
gui_key_bind ( /* m-8 */ "meta-8", "/buffer 8");
|
||||
gui_key_bind ( /* m-9 */ "meta-9", "/buffer 9");
|
||||
|
||||
/* bind meta-j + {01..99} to switch to buffers # > 10 */
|
||||
for (i = 1; i < 100; i++)
|
||||
{
|
||||
sprintf (key_str, "meta-j%02d", i);
|
||||
sprintf (command, "/buffer %d", i);
|
||||
gui_key_bind (key_str, command);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_grab_end: insert grabbed key in input buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_input_grab_end ()
|
||||
{
|
||||
char *expanded_key;
|
||||
|
||||
/* get expanded name (for example: ^U => ctrl-u) */
|
||||
expanded_key = gui_key_get_expanded_name (gui_key_buffer);
|
||||
|
||||
if (expanded_key)
|
||||
{
|
||||
if (gui_current_window->buffer->has_input)
|
||||
{
|
||||
gui_input_insert_string (expanded_key, -1);
|
||||
gui_current_window->buffer->input_buffer_pos += strlen (expanded_key);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
free (expanded_key);
|
||||
}
|
||||
|
||||
/* end grab mode */
|
||||
gui_key_grab = 0;
|
||||
gui_key_grab_count = 0;
|
||||
gui_key_buffer[0] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_read: read keyboard chars
|
||||
*/
|
||||
|
||||
void
|
||||
gui_input_read ()
|
||||
{
|
||||
int key, i;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
t_irc_server *ptr_server;
|
||||
t_irc_dcc *ptr_dcc;
|
||||
char new_char[3], *decoded_string;
|
||||
t_irc_dcc *dcc_selected;
|
||||
|
||||
key = getch ();
|
||||
if (key != ERR)
|
||||
char key_str[32];
|
||||
|
||||
i = 0;
|
||||
/* do not loop too much here (for example when big paste was made),
|
||||
to read also socket & co */
|
||||
while (i < 8)
|
||||
{
|
||||
switch (key)
|
||||
if (gui_key_grab && (gui_key_grab_count > 10))
|
||||
gui_input_grab_end ();
|
||||
|
||||
key = getch ();
|
||||
|
||||
if (key == ERR)
|
||||
{
|
||||
/* resize event */
|
||||
case KEY_RESIZE:
|
||||
gui_curses_resize_handler ();
|
||||
break;
|
||||
/* inactive function keys */
|
||||
case KEY_F(1):
|
||||
case KEY_F(2):
|
||||
case KEY_F(3):
|
||||
case KEY_F(4):
|
||||
case KEY_F(9):
|
||||
case KEY_F(11):
|
||||
case KEY_F(12):
|
||||
break;
|
||||
/* previous buffer in window */
|
||||
case KEY_F(5):
|
||||
gui_switch_to_previous_buffer (gui_current_window);
|
||||
break;
|
||||
/* next buffer in window */
|
||||
case KEY_F(6):
|
||||
gui_switch_to_next_buffer (gui_current_window);
|
||||
break;
|
||||
/* previous window */
|
||||
case KEY_F(7):
|
||||
gui_switch_to_previous_window (gui_current_window);
|
||||
break;
|
||||
/* next window */
|
||||
case KEY_F(8):
|
||||
gui_switch_to_next_window (gui_current_window);
|
||||
break;
|
||||
/* remove last infobar message */
|
||||
case KEY_F(10):
|
||||
gui_infobar_remove ();
|
||||
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
|
||||
break;
|
||||
/* cursor up */
|
||||
case KEY_UP:
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (dcc_list)
|
||||
{
|
||||
if (gui_current_window->dcc_selected
|
||||
&& ((t_irc_dcc *)(gui_current_window->dcc_selected))->prev_dcc)
|
||||
{
|
||||
if (gui_current_window->dcc_selected ==
|
||||
gui_current_window->dcc_first)
|
||||
gui_current_window->dcc_first =
|
||||
((t_irc_dcc *)(gui_current_window->dcc_first))->prev_dcc;
|
||||
gui_current_window->dcc_selected =
|
||||
((t_irc_dcc *)(gui_current_window->dcc_selected))->prev_dcc;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 1);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->ptr_history->next_history;
|
||||
if (!gui_current_window->buffer->ptr_history)
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->history;
|
||||
}
|
||||
else
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->history;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_size =
|
||||
strlen (gui_current_window->buffer->ptr_history->text);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
strcpy (gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->ptr_history->text);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor down */
|
||||
case KEY_DOWN:
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (dcc_list)
|
||||
{
|
||||
if (!gui_current_window->dcc_selected
|
||||
|| ((t_irc_dcc *)(gui_current_window->dcc_selected))->next_dcc)
|
||||
{
|
||||
if (gui_current_window->dcc_last_displayed
|
||||
&& (gui_current_window->dcc_selected ==
|
||||
gui_current_window->dcc_last_displayed))
|
||||
{
|
||||
if (gui_current_window->dcc_first)
|
||||
gui_current_window->dcc_first =
|
||||
((t_irc_dcc *)(gui_current_window->dcc_first))->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_first =
|
||||
dcc_list->next_dcc;
|
||||
}
|
||||
if (gui_current_window->dcc_selected)
|
||||
gui_current_window->dcc_selected =
|
||||
((t_irc_dcc *)(gui_current_window->dcc_selected))->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_selected =
|
||||
dcc_list->next_dcc;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 1);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->ptr_history->prev_history;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
gui_current_window->buffer->input_buffer_size =
|
||||
strlen (gui_current_window->buffer->ptr_history->text);
|
||||
else
|
||||
gui_current_window->buffer->input_buffer_size = 0;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
strcpy (gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->ptr_history->text);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor left */
|
||||
case KEY_LEFT:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos--;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor right */
|
||||
case KEY_RIGHT:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* home key or Control + A */
|
||||
case KEY_HOME:
|
||||
case 0x01:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos = 0;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* end key or Control + E */
|
||||
case KEY_END:
|
||||
case 0x05:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* page up */
|
||||
case KEY_PPAGE:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_page_up (gui_current_window);
|
||||
break;
|
||||
/* page down */
|
||||
case KEY_NPAGE:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_page_down (gui_current_window);
|
||||
break;
|
||||
/* erase before cursor and move cursor to the left */
|
||||
case 127:
|
||||
case KEY_BACKSPACE:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
i = gui_current_window->buffer->input_buffer_pos-1;
|
||||
while (gui_current_window->buffer->input_buffer[i])
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i+1];
|
||||
i++;
|
||||
}
|
||||
gui_current_window->buffer->input_buffer_size--;
|
||||
gui_current_window->buffer->input_buffer_pos--;
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Control + Backspace or Control + W */
|
||||
case 0x08:
|
||||
case 0x17:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_delete_previous_word (gui_current_window->buffer);
|
||||
break;
|
||||
/* Control + L */
|
||||
case 0x0C:
|
||||
gui_curses_resize_handler ();
|
||||
break;
|
||||
/* erase char under cursor */
|
||||
case KEY_DC:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
i = gui_current_window->buffer->input_buffer_pos;
|
||||
while (gui_current_window->buffer->input_buffer[i])
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i+1];
|
||||
i++;
|
||||
}
|
||||
gui_current_window->buffer->input_buffer_size--;
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Tab : completion */
|
||||
case '\t':
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
completion_search (&(gui_current_window->buffer->completion),
|
||||
CHANNEL(gui_current_window->buffer),
|
||||
gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->input_buffer_size,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
|
||||
if (gui_current_window->buffer->completion.word_found)
|
||||
{
|
||||
/* replace word with new completed word into input buffer */
|
||||
if (gui_current_window->buffer->completion.diff_size > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_size +=
|
||||
gui_current_window->buffer->completion.diff_size;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
for (i = gui_current_window->buffer->input_buffer_size - 1;
|
||||
i >= gui_current_window->buffer->completion.position_replace +
|
||||
(int)strlen (gui_current_window->buffer->completion.word_found); i--)
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i -
|
||||
gui_current_window->buffer->completion.diff_size];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = gui_current_window->buffer->completion.position_replace +
|
||||
strlen (gui_current_window->buffer->completion.word_found);
|
||||
i < gui_current_window->buffer->input_buffer_size; i++)
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i -
|
||||
gui_current_window->buffer->completion.diff_size];
|
||||
gui_current_window->buffer->input_buffer_size +=
|
||||
gui_current_window->buffer->completion.diff_size;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
}
|
||||
|
||||
strncpy (gui_current_window->buffer->input_buffer + gui_current_window->buffer->completion.position_replace,
|
||||
gui_current_window->buffer->completion.word_found,
|
||||
strlen (gui_current_window->buffer->completion.word_found));
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->completion.position_replace +
|
||||
strlen (gui_current_window->buffer->completion.word_found);
|
||||
|
||||
/* position is < 0 this means only one word was found to complete,
|
||||
so reinit to stop completion */
|
||||
if (gui_current_window->buffer->completion.position >= 0)
|
||||
gui_current_window->buffer->completion.position =
|
||||
gui_current_window->buffer->input_buffer_pos;
|
||||
|
||||
/* add space or completor to the end of completion, if needed */
|
||||
if ((gui_current_window->buffer->completion.context == COMPLETION_COMMAND)
|
||||
|| (gui_current_window->buffer->completion.context == COMPLETION_COMMAND_ARG))
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
" ",
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
if (gui_current_window->buffer->completion.position >= 0)
|
||||
gui_current_window->buffer->completion.position++;
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* add nick completor if position 0 and completing nick */
|
||||
if ((gui_current_window->buffer->completion.base_word_pos == 0)
|
||||
&& (gui_current_window->buffer->completion.context == COMPLETION_NICK))
|
||||
{
|
||||
if (strncmp (gui_current_window->buffer->input_buffer + gui_current_window->buffer->input_buffer_pos,
|
||||
cfg_look_completor, strlen (cfg_look_completor)) != 0)
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
cfg_look_completor,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
if (gui_current_window->buffer->completion.position >= 0)
|
||||
gui_current_window->buffer->completion.position += strlen (cfg_look_completor);
|
||||
gui_current_window->buffer->input_buffer_pos += strlen (cfg_look_completor);
|
||||
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
" ",
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
if (gui_current_window->buffer->completion.position >= 0)
|
||||
gui_current_window->buffer->completion.position++;
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
}
|
||||
}
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* escape code (for control-key) */
|
||||
case KEY_ESCAPE:
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
switch (key)
|
||||
{
|
||||
/* Alt + left arrow */
|
||||
case KEY_LEFT:
|
||||
gui_switch_to_previous_buffer (gui_current_window);
|
||||
break;
|
||||
/* Alt + right arrow */
|
||||
case KEY_RIGHT:
|
||||
gui_switch_to_next_buffer (gui_current_window);
|
||||
break;
|
||||
case 79:
|
||||
/* TODO: replace 79 by constant name! */
|
||||
if (key == 79)
|
||||
{
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
/* Control + Right */
|
||||
case 99:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_next_word (gui_current_window->buffer);
|
||||
break;
|
||||
/* Control + Left */
|
||||
case 100:
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_previous_word (gui_current_window->buffer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-number: jump to window by number */
|
||||
case 48: /* Alt-0 */
|
||||
case 49: /* Alt-1 */
|
||||
case 50: /* Alt-2 */
|
||||
case 51: /* Alt-3 */
|
||||
case 52: /* Alt-4 */
|
||||
case 53: /* Alt-5 */
|
||||
case 54: /* Alt-6 */
|
||||
case 55: /* Alt-7 */
|
||||
case 56: /* Alt-8 */
|
||||
case 57: /* Alt-9 */
|
||||
gui_switch_to_buffer_by_number (gui_current_window, (key == 48) ? 10 : key - 48);
|
||||
break;
|
||||
/* Alt-A: jump to buffer with activity */
|
||||
case 'a':
|
||||
case 'A':
|
||||
if (hotlist)
|
||||
{
|
||||
if (!hotlist_initial_buffer)
|
||||
hotlist_initial_buffer = gui_current_window->buffer;
|
||||
gui_switch_to_buffer (gui_current_window, hotlist->buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hotlist_initial_buffer)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window, hotlist_initial_buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
hotlist_initial_buffer = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-D: jump to DCC buffer */
|
||||
case 'd':
|
||||
case 'D':
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (buffer_before_dcc)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window,
|
||||
buffer_before_dcc);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_before_dcc = gui_current_window->buffer;
|
||||
gui_switch_to_dcc_buffer ();
|
||||
}
|
||||
break;
|
||||
/* Alt-R: clear hotlist */
|
||||
case 'r':
|
||||
case 'R':
|
||||
if (hotlist)
|
||||
{
|
||||
hotlist_free_all ();
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
hotlist_initial_buffer = gui_current_window->buffer;
|
||||
break;
|
||||
/* Alt-S: jump to server buffer */
|
||||
case 's':
|
||||
case 'S':
|
||||
if (SERVER(gui_current_window->buffer)->buffer !=
|
||||
gui_current_window->buffer)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window,
|
||||
SERVER(gui_current_window->buffer)->buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
/* Alt-X: jump to first channel/private of next server */
|
||||
case 'x':
|
||||
case 'X':
|
||||
ptr_server = SERVER(gui_current_window->buffer)->next_server;
|
||||
if (!ptr_server)
|
||||
ptr_server = irc_servers;
|
||||
while (ptr_server != SERVER(gui_current_window->buffer))
|
||||
{
|
||||
if (ptr_server->buffer)
|
||||
break;
|
||||
ptr_server = (ptr_server->next_server) ?
|
||||
ptr_server->next_server : irc_servers;
|
||||
}
|
||||
if (ptr_server != SERVER(gui_current_window->buffer))
|
||||
{
|
||||
ptr_buffer = (ptr_server->channels) ?
|
||||
ptr_server->channels->buffer : ptr_server->buffer;
|
||||
gui_switch_to_buffer (gui_current_window, ptr_buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* send command/message */
|
||||
case '\n':
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer_size > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
history_add (gui_current_window->buffer, gui_current_window->buffer->input_buffer);
|
||||
gui_current_window->buffer->input_buffer_size = 0;
|
||||
gui_current_window->buffer->input_buffer_pos = 0;
|
||||
gui_current_window->buffer->input_buffer_1st_display = 0;
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
gui_current_window->buffer->ptr_history = NULL;
|
||||
ptr_buffer = gui_current_window->buffer;
|
||||
user_command (SERVER(gui_current_window->buffer),
|
||||
gui_current_window->buffer,
|
||||
gui_current_window->buffer->input_buffer);
|
||||
if (ptr_buffer == gui_current_window->buffer)
|
||||
{
|
||||
ptr_buffer->input_buffer[0] = '\0';
|
||||
gui_draw_buffer_input (ptr_buffer, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* other key => add to input buffer */
|
||||
default:
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
dcc_selected = (gui_current_window->dcc_selected) ?
|
||||
(t_irc_dcc *) gui_current_window->dcc_selected : dcc_list;
|
||||
switch (key)
|
||||
{
|
||||
/* accept DCC */
|
||||
case 'a':
|
||||
case 'A':
|
||||
if (dcc_selected
|
||||
&& (DCC_IS_RECV(dcc_selected->status))
|
||||
&& (dcc_selected->status == DCC_WAITING))
|
||||
{
|
||||
dcc_accept (dcc_selected);
|
||||
}
|
||||
break;
|
||||
/* cancel DCC */
|
||||
case 'c':
|
||||
case 'C':
|
||||
if (dcc_selected
|
||||
&& (!DCC_ENDED(dcc_selected->status)))
|
||||
{
|
||||
dcc_close (dcc_selected, DCC_ABORTED);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
/* purge old DCC */
|
||||
case 'p':
|
||||
case 'P':
|
||||
gui_current_window->dcc_selected = NULL;
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
if (DCC_ENDED(ptr_dcc->status))
|
||||
dcc_free (ptr_dcc);
|
||||
}
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
break;
|
||||
/* close DCC window */
|
||||
case 'q':
|
||||
case 'Q':
|
||||
if (buffer_before_dcc)
|
||||
{
|
||||
gui_buffer_free (gui_current_window->buffer, 1);
|
||||
gui_switch_to_buffer (gui_current_window,
|
||||
buffer_before_dcc);
|
||||
}
|
||||
else
|
||||
gui_buffer_free (gui_current_window->buffer, 1);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
break;
|
||||
/* remove from DCC list */
|
||||
case 'r':
|
||||
case 'R':
|
||||
if (dcc_selected
|
||||
&& (DCC_ENDED(dcc_selected->status)))
|
||||
{
|
||||
if (dcc_selected->next_dcc)
|
||||
gui_current_window->dcc_selected = dcc_selected->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_selected = NULL;
|
||||
dcc_free (dcc_selected);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
new_char[0] = key;
|
||||
new_char[1] = '\0';
|
||||
decoded_string = NULL;
|
||||
|
||||
/* UTF-8 input */
|
||||
if (key == 0xC3)
|
||||
{
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
new_char[1] = key;
|
||||
new_char[2] = '\0';
|
||||
decoded_string = weechat_convert_encoding (local_charset, cfg_look_charset_internal, new_char);
|
||||
}
|
||||
}
|
||||
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
(decoded_string) ? decoded_string : new_char,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
|
||||
if (decoded_string)
|
||||
free (decoded_string);
|
||||
}
|
||||
break;
|
||||
if (gui_key_grab && (gui_key_grab_count > 0))
|
||||
gui_input_grab_end ();
|
||||
break;
|
||||
}
|
||||
|
||||
if (key == KEY_RESIZE)
|
||||
{
|
||||
gui_curses_resize_handler ();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key < 32)
|
||||
{
|
||||
key_str[0] = '^';
|
||||
key_str[1] = (char) key + '@';
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
else if (key == 127)
|
||||
{
|
||||
key_str[0] = '^';
|
||||
key_str[1] = '?';
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (key > 0xff)
|
||||
{
|
||||
key_str[0] = (char) (key >> 8);
|
||||
key_str[1] = (char) (key & 0xff);
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
key_str[0] = (char) key;
|
||||
key_str[1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp (key_str, "^") == 0)
|
||||
{
|
||||
key_str[1] = '^';
|
||||
key_str[2] = '\0';
|
||||
}
|
||||
|
||||
/*gui_printf (gui_current_window->buffer, "gui_input_read: key = %s (%d)\n", key_str, key);*/
|
||||
|
||||
if (gui_key_pressed (key_str) != 0)
|
||||
gui_input_insert_char (key);
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -697,6 +265,14 @@ gui_main_loop ()
|
||||
{
|
||||
old_sec = local_time->tm_sec;
|
||||
|
||||
if (cfg_look_infobar_seconds)
|
||||
{
|
||||
gui_draw_buffer_infobar_time (gui_current_window->buffer);
|
||||
wmove (gui_current_window->win_input,
|
||||
0, gui_current_window->win_input_x);
|
||||
wrefresh (gui_current_window->win_input);
|
||||
}
|
||||
|
||||
/* infobar count down */
|
||||
if (gui_infobar && gui_infobar->remaining_time > 0)
|
||||
{
|
||||
@@ -781,7 +357,7 @@ gui_main_loop ()
|
||||
{
|
||||
if (FD_ISSET (STDIN_FILENO, &read_fd))
|
||||
{
|
||||
gui_read_keyb ();
|
||||
gui_input_read ();
|
||||
}
|
||||
if ((weechat_fifo != -1) && (FD_ISSET (weechat_fifo, &read_fd)))
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
+1046
-107
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,559 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* gui-keyboard: keyboard functions (GUI independant) */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "../common/weechat.h"
|
||||
#include "gui.h"
|
||||
#include "../common/command.h"
|
||||
|
||||
|
||||
t_gui_key *gui_keys = NULL;
|
||||
t_gui_key *last_gui_key = NULL;
|
||||
|
||||
char gui_key_buffer[128];
|
||||
int gui_key_grab = 0;
|
||||
int gui_key_grab_count = 0;
|
||||
|
||||
t_gui_key_function gui_key_functions[] =
|
||||
{ { "return", gui_input_return,
|
||||
N_("terminate line") },
|
||||
{ "tab", gui_input_tab,
|
||||
N_("complete word") },
|
||||
{ "backspace", gui_input_backspace,
|
||||
N_("delete previous char") },
|
||||
{ "delete", gui_input_delete,
|
||||
N_("delete next char") },
|
||||
{ "delete_end_line", gui_input_delete_end_of_line,
|
||||
N_("delete until end of line") },
|
||||
{ "delete_beginning_line", gui_input_delete_begin_of_line,
|
||||
N_("delete until beginning of line") },
|
||||
{ "delete_line", gui_input_delete_line,
|
||||
N_("delete entire line") },
|
||||
{ "delete_previous_word", gui_input_delete_previous_word,
|
||||
N_("delete previous word") },
|
||||
{ "delete_next_word", gui_input_delete_next_word,
|
||||
N_("delete next word") },
|
||||
{ "clipboard_paste", gui_input_clipboard_paste,
|
||||
N_("paste current clipboard content") },
|
||||
{ "transpose_chars", gui_input_transpose_chars,
|
||||
N_("transpose chars") },
|
||||
{ "home", gui_input_home,
|
||||
N_("go to beginning of line") },
|
||||
{ "end", gui_input_end,
|
||||
N_("go to end of line") },
|
||||
{ "left", gui_input_left,
|
||||
N_("move one char left") },
|
||||
{ "previous_word", gui_input_previous_word,
|
||||
N_("move to previous word") },
|
||||
{ "right", gui_input_right,
|
||||
N_("move one char right") },
|
||||
{ "next_word", gui_input_next_word,
|
||||
N_("move to next word") },
|
||||
{ "up", gui_input_up,
|
||||
N_("call previous command in history") },
|
||||
{ "down", gui_input_down,
|
||||
N_("call next command in history") },
|
||||
{ "page_up", gui_input_page_up,
|
||||
N_("scroll one page up") },
|
||||
{ "page_down", gui_input_page_down,
|
||||
N_("scroll one page down") },
|
||||
{ "infobar_clear", gui_input_infobar_clear,
|
||||
N_("clear infobar") },
|
||||
{ "nick_page_up", gui_input_nick_page_up,
|
||||
N_("scroll nicklist one page up") },
|
||||
{ "nick_page_down", gui_input_nick_page_down,
|
||||
N_("scroll nicklist one page down") },
|
||||
{ "nick_beginning", gui_input_nick_beginning,
|
||||
N_("display beginning of nicklist") },
|
||||
{ "nick_end", gui_input_nick_end,
|
||||
N_("display end of nicklist") },
|
||||
{ "refresh", gui_curses_resize_handler,
|
||||
N_("refresh screen") },
|
||||
{ "jump_smart", gui_input_jump_smart,
|
||||
N_("jump to buffer with activity") },
|
||||
{ "jump_dcc", gui_input_jump_dcc,
|
||||
N_("jump to DCC buffer") },
|
||||
{ "jump_last_buffer", gui_input_jump_last_buffer,
|
||||
N_("jump to last buffer") },
|
||||
{ "jump_server", gui_input_jump_server,
|
||||
N_("jump to server buffer") },
|
||||
{ "jump_next_server", gui_input_jump_next_server,
|
||||
N_("jump to next server") },
|
||||
{ "hotlist_clear", gui_input_hotlist_clear,
|
||||
N_("clear hotlist") },
|
||||
{ "grab_key", gui_input_grab_key,
|
||||
N_("grab a key") },
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* gui_key_init: init keyboard (create default key bindings)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_init ()
|
||||
{
|
||||
gui_key_buffer[0] = '\0';
|
||||
gui_key_grab = 0;
|
||||
gui_key_grab_count = 0;
|
||||
|
||||
gui_input_default_key_bindings ();
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_init_show: init "show mode"
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_init_grab ()
|
||||
{
|
||||
gui_key_grab = 1;
|
||||
gui_key_grab_count = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_get_internal_code: get internal code from user key name
|
||||
* for example: return "^R" for "ctrl-R"
|
||||
*/
|
||||
|
||||
char *
|
||||
gui_key_get_internal_code (char *key)
|
||||
{
|
||||
char *result;
|
||||
|
||||
if ((result = (char *) malloc (strlen (key) + 1)))
|
||||
{
|
||||
result[0] = '\0';
|
||||
while (key[0])
|
||||
{
|
||||
if (strncasecmp (key, "meta2-", 6) == 0)
|
||||
{
|
||||
strcat (result, "^[[");
|
||||
key += 6;
|
||||
}
|
||||
if (strncasecmp (key, "meta-", 5) == 0)
|
||||
{
|
||||
strcat (result, "^[");
|
||||
key += 5;
|
||||
}
|
||||
else if (strncasecmp (key, "ctrl-", 5) == 0)
|
||||
{
|
||||
strcat (result, "^");
|
||||
key += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncat (result, key, 1);
|
||||
key++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_get_expanded_name: get expanded name from internal key code
|
||||
* for example: return "ctrl-R" for "^R"
|
||||
*/
|
||||
|
||||
char *
|
||||
gui_key_get_expanded_name (char *key)
|
||||
{
|
||||
char *result;
|
||||
|
||||
if ((result = (char *) malloc ((strlen (key) * 5) + 1)))
|
||||
{
|
||||
result[0] = '\0';
|
||||
while (key[0])
|
||||
{
|
||||
if (strncasecmp (key, "^[[", 3) == 0)
|
||||
{
|
||||
strcat (result, "meta2-");
|
||||
key += 3;
|
||||
}
|
||||
if (strncasecmp (key, "^[", 2) == 0)
|
||||
{
|
||||
strcat (result, "meta-");
|
||||
key += 2;
|
||||
}
|
||||
else if ((key[0] == '^') && (key[1]))
|
||||
{
|
||||
strcat (result, "ctrl-");
|
||||
key++;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncat (result, key, 1);
|
||||
key++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_find_pos: find position for a key (for sorting keys list)
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_find_pos (t_gui_key *key)
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (strcasecmp (key->key, ptr_key->key) < 0)
|
||||
return ptr_key;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_insert_sorted: insert key into sorted list
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_insert_sorted (t_gui_key *key)
|
||||
{
|
||||
t_gui_key *pos_key;
|
||||
|
||||
if (gui_keys)
|
||||
{
|
||||
pos_key = gui_key_find_pos (key);
|
||||
|
||||
if (pos_key)
|
||||
{
|
||||
/* insert key into the list (before key found) */
|
||||
key->prev_key = pos_key->prev_key;
|
||||
key->next_key = pos_key;
|
||||
if (pos_key->prev_key)
|
||||
pos_key->prev_key->next_key = key;
|
||||
else
|
||||
gui_keys = key;
|
||||
pos_key->prev_key = key;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* add key to the end */
|
||||
key->prev_key = last_gui_key;
|
||||
key->next_key = NULL;
|
||||
last_gui_key->next_key = key;
|
||||
last_gui_key = key;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
key->prev_key = NULL;
|
||||
key->next_key = NULL;
|
||||
gui_keys = key;
|
||||
last_gui_key = key;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_new: add a new key in keys list
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_new (char *key, char *command, void *function)
|
||||
{
|
||||
t_gui_key *new_key;
|
||||
char *internal_code;
|
||||
|
||||
if ((new_key = (t_gui_key *) malloc (sizeof (t_gui_key))))
|
||||
{
|
||||
internal_code = gui_key_get_internal_code (key);
|
||||
new_key->key = (internal_code) ? strdup (internal_code) : strdup (key);
|
||||
if (internal_code)
|
||||
free (internal_code);
|
||||
new_key->command = (command) ? strdup (command) : NULL;
|
||||
new_key->function = function;
|
||||
gui_key_insert_sorted (new_key);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return new_key;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_search: search a key
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_search (char *key)
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (strcasecmp (ptr_key->key, key) == 0)
|
||||
return ptr_key;
|
||||
}
|
||||
|
||||
/* key not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_cmp: compares 2 keys
|
||||
*/
|
||||
|
||||
int
|
||||
gui_key_cmp (char *key, char *search)
|
||||
{
|
||||
while (search[0])
|
||||
{
|
||||
if (toupper(key[0]) != toupper(search[0]))
|
||||
return search[0] - key[0];
|
||||
key++;
|
||||
search++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_search_part: search a key (maybe part of string)
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_search_part (char *key)
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (gui_key_cmp (ptr_key->key, key) == 0)
|
||||
return ptr_key;
|
||||
}
|
||||
|
||||
/* key not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_function_search_by_name: search a function by name
|
||||
*/
|
||||
|
||||
void *
|
||||
gui_key_function_search_by_name (char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
if (strcasecmp (gui_key_functions[i].function_name, name) == 0)
|
||||
return gui_key_functions[i].function;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* function not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_function_search_by_ptr: search a function by pointer
|
||||
*/
|
||||
|
||||
char *
|
||||
gui_key_function_search_by_ptr (void *function)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
if (gui_key_functions[i].function == function)
|
||||
return gui_key_functions[i].function_name;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* function not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_bind: bind a key to a function (command or special function)
|
||||
*/
|
||||
|
||||
t_gui_key *
|
||||
gui_key_bind (char *key, char *command)
|
||||
{
|
||||
t_gui_key_function *ptr_function;
|
||||
t_gui_key *new_key;
|
||||
|
||||
if (!key || !command)
|
||||
{
|
||||
wee_log_printf (_("%s unable to bind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, key);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr_function = NULL;
|
||||
if (command[0] != '/')
|
||||
{
|
||||
ptr_function = gui_key_function_search_by_name (command);
|
||||
if (!ptr_function)
|
||||
{
|
||||
wee_log_printf (_("%s unable to bind key \"%s\" (invalid function name: \"%s\")\n"),
|
||||
WEECHAT_ERROR, key, command);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
gui_key_unbind (key);
|
||||
|
||||
new_key = gui_key_new (key,
|
||||
(ptr_function) ? NULL : command,
|
||||
ptr_function);
|
||||
if (!new_key)
|
||||
{
|
||||
wee_log_printf (_("%s not enough memory for key binding\n"),
|
||||
WEECHAT_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return new_key;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_unbind: remove a key binding
|
||||
*/
|
||||
|
||||
int
|
||||
gui_key_unbind (char *key)
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
char *internal_code;
|
||||
|
||||
internal_code = gui_key_get_internal_code (key);
|
||||
|
||||
ptr_key = gui_key_search ((internal_code) ? internal_code : key);
|
||||
if (ptr_key)
|
||||
gui_key_free (ptr_key);
|
||||
|
||||
if (internal_code)
|
||||
free (internal_code);
|
||||
|
||||
return (ptr_key != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_pressed: treat new key pressed
|
||||
* return: 1 if key should be added to input buffer
|
||||
* 0 otherwise
|
||||
*/
|
||||
|
||||
int
|
||||
gui_key_pressed (char *key_str)
|
||||
{
|
||||
int first_key;
|
||||
t_gui_key *ptr_key;
|
||||
|
||||
/* add key to buffer */
|
||||
first_key = (gui_key_buffer[0] == '\0');
|
||||
strcat (gui_key_buffer, key_str);
|
||||
|
||||
/* if we are in "show mode", increase counter and return */
|
||||
if (gui_key_grab)
|
||||
{
|
||||
gui_key_grab_count++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* look for key combo in key table */
|
||||
ptr_key = gui_key_search_part (gui_key_buffer);
|
||||
if (ptr_key)
|
||||
{
|
||||
if (strcasecmp (ptr_key->key, gui_key_buffer) == 0)
|
||||
{
|
||||
/* exact combo found => execute function or command */
|
||||
gui_key_buffer[0] = '\0';
|
||||
if (ptr_key->command)
|
||||
user_command (SERVER(gui_current_window->buffer),
|
||||
gui_current_window->buffer,
|
||||
ptr_key->command);
|
||||
else
|
||||
(void)(ptr_key->function)();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
gui_key_buffer[0] = '\0';
|
||||
|
||||
/* if this is first key and not found (even partial) => return 1
|
||||
else return 0 (= silently discard sequence of bad keys) */
|
||||
return first_key;
|
||||
}
|
||||
|
||||
/*
|
||||
* key_free: delete a key binding
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_free (t_gui_key *key)
|
||||
{
|
||||
/* free memory */
|
||||
if (key->key)
|
||||
free (key->key);
|
||||
if (key->command)
|
||||
free (key->command);
|
||||
|
||||
/* remove key from keys list */
|
||||
if (key->prev_key)
|
||||
key->prev_key->next_key = key->next_key;
|
||||
if (key->next_key)
|
||||
key->next_key->prev_key = key->prev_key;
|
||||
if (gui_keys == key)
|
||||
gui_keys = key->next_key;
|
||||
if (last_gui_key == key)
|
||||
last_gui_key = key->prev_key;
|
||||
|
||||
free (key);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_key_free_all: delete all key bindings
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_free_all ()
|
||||
{
|
||||
while (gui_keys)
|
||||
gui_key_free (gui_keys);
|
||||
}
|
||||
+143
-53
@@ -26,49 +26,54 @@
|
||||
|
||||
#define INPUT_BUFFER_BLOCK_SIZE 256
|
||||
|
||||
#define NUM_COLORS 49
|
||||
#define NUM_COLORS 54
|
||||
#define COLOR_WIN_TITLE 1
|
||||
#define COLOR_WIN_CHAT 2
|
||||
#define COLOR_WIN_CHAT_TIME 3
|
||||
#define COLOR_WIN_CHAT_TIME_SEP 4
|
||||
#define COLOR_WIN_CHAT_PREFIX1 5
|
||||
#define COLOR_WIN_CHAT_PREFIX2 6
|
||||
#define COLOR_WIN_CHAT_NICK 7
|
||||
#define COLOR_WIN_CHAT_HOST 8
|
||||
#define COLOR_WIN_CHAT_CHANNEL 9
|
||||
#define COLOR_WIN_CHAT_DARK 10
|
||||
#define COLOR_WIN_CHAT_HIGHLIGHT 11
|
||||
#define COLOR_WIN_STATUS 12
|
||||
#define COLOR_WIN_STATUS_DELIMITERS 13
|
||||
#define COLOR_WIN_STATUS_DATA_MSG 14
|
||||
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 15
|
||||
#define COLOR_WIN_STATUS_DATA_OTHER 16
|
||||
#define COLOR_WIN_STATUS_MORE 17
|
||||
#define COLOR_WIN_INFOBAR 18
|
||||
#define COLOR_WIN_INFOBAR_HIGHLIGHT 19
|
||||
#define COLOR_WIN_INPUT 20
|
||||
#define COLOR_WIN_INPUT_CHANNEL 21
|
||||
#define COLOR_WIN_INPUT_NICK 22
|
||||
#define COLOR_WIN_NICK 23
|
||||
#define COLOR_WIN_NICK_AWAY 24
|
||||
#define COLOR_WIN_NICK_CHANOWNER 25
|
||||
#define COLOR_WIN_NICK_CHANADMIN 26
|
||||
#define COLOR_WIN_NICK_OP 27
|
||||
#define COLOR_WIN_NICK_HALFOP 28
|
||||
#define COLOR_WIN_NICK_VOICE 29
|
||||
#define COLOR_WIN_NICK_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_CHAT_JOIN 7
|
||||
#define COLOR_WIN_CHAT_PART 8
|
||||
#define COLOR_WIN_CHAT_NICK 9
|
||||
#define COLOR_WIN_CHAT_HOST 10
|
||||
#define COLOR_WIN_CHAT_CHANNEL 11
|
||||
#define COLOR_WIN_CHAT_DARK 12
|
||||
#define COLOR_WIN_CHAT_HIGHLIGHT 13
|
||||
#define COLOR_WIN_STATUS 14
|
||||
#define COLOR_WIN_STATUS_DELIMITERS 15
|
||||
#define COLOR_WIN_STATUS_DATA_MSG 16
|
||||
#define COLOR_WIN_STATUS_DATA_PRIVATE 17
|
||||
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 18
|
||||
#define COLOR_WIN_STATUS_DATA_OTHER 19
|
||||
#define COLOR_WIN_STATUS_MORE 20
|
||||
#define COLOR_WIN_INFOBAR 21
|
||||
#define COLOR_WIN_INFOBAR_DELIMITERS 22
|
||||
#define COLOR_WIN_INFOBAR_HIGHLIGHT 23
|
||||
#define COLOR_WIN_INPUT 24
|
||||
#define COLOR_WIN_INPUT_CHANNEL 25
|
||||
#define COLOR_WIN_INPUT_NICK 26
|
||||
#define COLOR_WIN_NICK 27
|
||||
#define COLOR_WIN_NICK_AWAY 28
|
||||
#define COLOR_WIN_NICK_CHANOWNER 29
|
||||
#define COLOR_WIN_NICK_CHANADMIN 30
|
||||
#define COLOR_WIN_NICK_OP 31
|
||||
#define COLOR_WIN_NICK_HALFOP 32
|
||||
#define COLOR_WIN_NICK_VOICE 33
|
||||
#define COLOR_WIN_NICK_MORE 34
|
||||
#define COLOR_WIN_NICK_SEP 35
|
||||
#define COLOR_WIN_NICK_SELF 36
|
||||
#define COLOR_WIN_NICK_PRIVATE 37
|
||||
#define COLOR_WIN_NICK_FIRST 38
|
||||
#define COLOR_WIN_NICK_LAST 47
|
||||
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
|
||||
#define COLOR_DCC_SELECTED 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 48
|
||||
#define COLOR_DCC_WAITING 49
|
||||
#define COLOR_DCC_CONNECTING 50
|
||||
#define COLOR_DCC_ACTIVE 51
|
||||
#define COLOR_DCC_DONE 52
|
||||
#define COLOR_DCC_FAILED 53
|
||||
#define COLOR_DCC_ABORTED 54
|
||||
|
||||
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
|
||||
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
|
||||
@@ -97,6 +102,13 @@
|
||||
#define gui_printf_nolog(buffer, fmt, argz...) \
|
||||
gui_printf_type_color(buffer, MSG_TYPE_INFO | MSG_TYPE_NOLOG, -1, fmt, ##argz)
|
||||
|
||||
#define NOTIFY_LEVEL_MIN 0
|
||||
#define NOTIFY_LEVEL_MAX 3
|
||||
#define NOTIFY_LEVEL_DEFAULT NOTIFY_LEVEL_MAX
|
||||
|
||||
#define KEY_SHOW_MODE_DISPLAY 1
|
||||
#define KEY_SHOW_MODE_BIND 2
|
||||
|
||||
typedef struct t_gui_message t_gui_message;
|
||||
|
||||
struct t_gui_message
|
||||
@@ -173,6 +185,7 @@ struct t_gui_buffer
|
||||
FILE *log_file; /* for logging buffer to file */
|
||||
|
||||
/* inupt buffer */
|
||||
int has_input; /* = 1 if buffer has input (DCC has not)*/
|
||||
char *input_buffer; /* input buffer */
|
||||
int input_buffer_alloc; /* input buffer: allocated size in mem */
|
||||
int input_buffer_size; /* buffer size (user input length) */
|
||||
@@ -209,9 +222,13 @@ 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) */
|
||||
|
||||
/* input window settings */
|
||||
int win_input_x; /* position of cursor in input window */
|
||||
|
||||
/* windows for Curses GUI */
|
||||
void *win_title; /* title window */
|
||||
@@ -246,10 +263,31 @@ struct t_gui_window
|
||||
t_gui_window *next_window; /* link to next window */
|
||||
};
|
||||
|
||||
typedef struct t_gui_key t_gui_key;
|
||||
|
||||
struct t_gui_key
|
||||
{
|
||||
char *key; /* key combo (ex: a, ^W, ^W^C, meta-a) */
|
||||
char *command; /* associated command (may be NULL) */
|
||||
void (*function)(); /* associated function (if cmd is NULL) */
|
||||
t_gui_key *prev_key; /* link to previous key */
|
||||
t_gui_key *next_key; /* link to next key */
|
||||
};
|
||||
|
||||
typedef struct t_gui_key_function t_gui_key_function;
|
||||
|
||||
struct t_gui_key_function
|
||||
{
|
||||
char *function_name; /* name of function */
|
||||
void (*function)(); /* associated function */
|
||||
char *description; /* description of function */
|
||||
};
|
||||
|
||||
/* variables */
|
||||
|
||||
extern int gui_init_ok;
|
||||
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;
|
||||
@@ -257,8 +295,15 @@ extern t_gui_buffer *gui_buffers;
|
||||
extern t_gui_buffer *last_gui_buffer;
|
||||
extern t_gui_buffer *buffer_before_dcc;
|
||||
extern t_gui_infobar *gui_infobar;
|
||||
extern t_gui_key *gui_keys;
|
||||
extern t_gui_key *last_gui_key;
|
||||
extern t_gui_key_function gui_key_functions[];
|
||||
extern char gui_key_buffer[128];
|
||||
extern int gui_key_grab;
|
||||
extern int gui_key_grab_count;
|
||||
extern char *gui_input_clipboard;
|
||||
|
||||
/* GUI independent functions */
|
||||
/* GUI independent functions: windows & buffers */
|
||||
|
||||
extern t_gui_window *gui_window_new (int, int, int, int);
|
||||
extern t_gui_buffer *gui_buffer_new (t_gui_window *, void *, void *, int, int);
|
||||
@@ -270,17 +315,61 @@ extern void gui_infobar_remove ();
|
||||
extern void gui_buffer_free (t_gui_buffer *, int);
|
||||
extern t_gui_line *gui_new_line (t_gui_buffer *);
|
||||
extern t_gui_message *gui_new_message (t_gui_buffer *);
|
||||
extern void gui_optimize_input_buffer_size (t_gui_buffer *);
|
||||
extern void gui_delete_previous_word (t_gui_buffer *);
|
||||
extern void gui_move_previous_word (t_gui_buffer *);
|
||||
extern void gui_move_next_word (t_gui_buffer *);
|
||||
extern void gui_buffer_insert_string (t_gui_buffer *, char *, int);
|
||||
extern void gui_input_clipboard_copy (char *, int);
|
||||
extern void gui_input_clipboard_paste ();
|
||||
extern void gui_input_insert_string (char *, int);
|
||||
extern void gui_input_insert_char ();
|
||||
extern void gui_input_return ();
|
||||
extern void gui_input_tab ();
|
||||
extern void gui_input_backspace ();
|
||||
extern void gui_input_delete ();
|
||||
extern void gui_input_delete_previous_word ();
|
||||
extern void gui_input_delete_next_word ();
|
||||
extern void gui_input_delete_begin_of_line ();
|
||||
extern void gui_input_delete_end_of_line ();
|
||||
extern void gui_input_delete_line ();
|
||||
extern void gui_input_transpose_chars ();
|
||||
extern void gui_input_home ();
|
||||
extern void gui_input_end ();
|
||||
extern void gui_input_left ();
|
||||
extern void gui_input_previous_word ();
|
||||
extern void gui_input_right ();
|
||||
extern void gui_input_next_word ();
|
||||
extern void gui_input_up ();
|
||||
extern void gui_input_down ();
|
||||
extern void gui_input_jump_smart ();
|
||||
extern void gui_input_jump_dcc ();
|
||||
extern void gui_input_jump_last_buffer ();
|
||||
extern void gui_input_jump_server ();
|
||||
extern void gui_input_jump_next_server ();
|
||||
extern void gui_input_hotlist_clear ();
|
||||
extern void gui_input_infobar_clear ();
|
||||
extern void gui_input_grab_key ();
|
||||
extern void gui_switch_to_previous_buffer ();
|
||||
extern void gui_switch_to_next_buffer ();
|
||||
extern void gui_switch_to_previous_window ();
|
||||
extern void gui_switch_to_next_window ();
|
||||
extern void gui_switch_to_dcc_buffer ();
|
||||
extern t_gui_buffer *gui_switch_to_buffer_by_number (t_gui_window *, int);
|
||||
extern void gui_move_buffer_to_number (t_gui_window *, int);
|
||||
extern void gui_window_print_log (t_gui_window *);
|
||||
extern void gui_buffer_print_log (t_gui_buffer *);
|
||||
|
||||
/* GUI dependant functions */
|
||||
/* GUI independent functions: keys */
|
||||
|
||||
extern void gui_key_init ();
|
||||
extern void gui_key_init_grab ();
|
||||
extern char *gui_key_get_internal_code (char *);
|
||||
extern char *gui_key_get_expanded_name (char *);
|
||||
extern void *gui_key_function_search_by_name (char *);
|
||||
extern char *gui_key_function_search_by_ptr (void *);
|
||||
extern t_gui_key *gui_key_bind (char *, char *);
|
||||
extern int gui_key_unbind (char *);
|
||||
extern int gui_key_pressed (char *);
|
||||
extern void gui_key_free (t_gui_key *);
|
||||
extern void gui_key_free_all ();
|
||||
|
||||
/* GUI dependant functions: display */
|
||||
|
||||
extern int gui_assign_color (int *, char *);
|
||||
extern int gui_get_color_by_name (char *);
|
||||
@@ -291,18 +380,18 @@ extern void gui_draw_buffer_title (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_chat (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_nick (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_status (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_infobar_time (t_gui_buffer *);
|
||||
extern void gui_draw_buffer_infobar (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_input (t_gui_buffer *, int);
|
||||
extern void gui_redraw_buffer (t_gui_buffer *);
|
||||
extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *);
|
||||
extern t_gui_buffer *gui_get_dcc_buffer ();
|
||||
extern void gui_switch_to_dcc_buffer ();
|
||||
extern void gui_switch_to_previous_buffer (t_gui_window *);
|
||||
extern void gui_switch_to_next_buffer (t_gui_window *);
|
||||
extern void gui_switch_to_previous_window (t_gui_window *);
|
||||
extern void gui_switch_to_next_window (t_gui_window *);
|
||||
extern void gui_move_page_up ();
|
||||
extern void gui_move_page_down ();
|
||||
extern void gui_input_page_up ();
|
||||
extern void gui_input_page_down ();
|
||||
extern void gui_input_nick_beginning ();
|
||||
extern void gui_input_nick_end ();
|
||||
extern void gui_input_nick_page_up ();
|
||||
extern void gui_input_nick_page_down ();
|
||||
extern void gui_curses_resize_handler ();
|
||||
extern void gui_window_init_subwindows (t_gui_window *);
|
||||
extern void gui_window_split_horiz (t_gui_window *);
|
||||
@@ -319,6 +408,7 @@ extern void gui_set_window_title ();
|
||||
extern void gui_init ();
|
||||
extern void gui_end ();
|
||||
extern void gui_printf_type_color (/*@null@*/ t_gui_buffer *, int, int, char *, ...);
|
||||
extern void gui_input_default_key_bindings ();
|
||||
extern void gui_main_loop ();
|
||||
|
||||
#endif /* gui.h */
|
||||
|
||||
@@ -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
|
||||
@@ -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 */
|
||||
@@ -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 */
|
||||
+140
-9
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "../common/weechat.h"
|
||||
#include "irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
char *channel_modes = "iklmnst";
|
||||
@@ -89,7 +90,15 @@ void
|
||||
channel_free (t_irc_server *server, t_irc_channel *channel)
|
||||
{
|
||||
t_irc_channel *new_channels;
|
||||
|
||||
|
||||
/* close DCC CHAT */
|
||||
if ((t_irc_dcc *)(channel->dcc_chat) &&
|
||||
(!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status)))
|
||||
{
|
||||
dcc_close ((t_irc_dcc *)(channel->dcc_chat), DCC_ABORTED);
|
||||
dcc_redraw (1);
|
||||
}
|
||||
|
||||
/* remove channel from queue */
|
||||
if (server->last_channel == channel)
|
||||
server->last_channel = channel->prev_channel;
|
||||
@@ -103,14 +112,6 @@ channel_free (t_irc_server *server, t_irc_channel *channel)
|
||||
|
||||
if (channel->next_channel)
|
||||
(channel->next_channel)->prev_channel = channel->prev_channel;
|
||||
|
||||
/* close DCC CHAT */
|
||||
if ((t_irc_dcc *)(channel->dcc_chat) &&
|
||||
(!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status)))
|
||||
{
|
||||
dcc_close ((t_irc_dcc *)(channel->dcc_chat), DCC_ABORTED);
|
||||
dcc_redraw (1);
|
||||
}
|
||||
|
||||
/* free data */
|
||||
if (channel->name)
|
||||
@@ -262,6 +263,136 @@ channel_remove_dcc (t_irc_dcc *ptr_dcc)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* channel_get_notify_level: get channel notify level
|
||||
*/
|
||||
|
||||
int
|
||||
channel_get_notify_level (t_irc_server *server, t_irc_channel *channel)
|
||||
{
|
||||
char *name, *pos, *pos2, notify;
|
||||
|
||||
if ((!server) || (!channel))
|
||||
return NOTIFY_LEVEL_DEFAULT;
|
||||
|
||||
if ((!server->notify_levels) || (!server->notify_levels[0]))
|
||||
return NOTIFY_LEVEL_DEFAULT;
|
||||
|
||||
name = (char *) malloc (strlen (channel->name) + 2);
|
||||
strcpy (name, channel->name);
|
||||
strcat (name, ":");
|
||||
pos = strstr (server->notify_levels, name);
|
||||
free (name);
|
||||
if (!pos)
|
||||
return NOTIFY_LEVEL_DEFAULT;
|
||||
|
||||
pos2 = pos + strlen (channel->name);
|
||||
if (pos2[0] != ':')
|
||||
return NOTIFY_LEVEL_DEFAULT;
|
||||
pos2++;
|
||||
if (!pos2[0])
|
||||
return NOTIFY_LEVEL_DEFAULT;
|
||||
|
||||
notify = (int)(pos2[0] - '0');
|
||||
if ((notify < NOTIFY_LEVEL_MIN) || (notify > NOTIFY_LEVEL_MAX))
|
||||
return NOTIFY_LEVEL_DEFAULT;
|
||||
else
|
||||
return notify;
|
||||
}
|
||||
|
||||
/*
|
||||
* server_remove_notify_level: remove channel notify from list
|
||||
*/
|
||||
|
||||
void
|
||||
channel_remove_notify_level (t_irc_server *server, t_irc_channel *channel)
|
||||
{
|
||||
char *name, *pos, *pos2;
|
||||
|
||||
if ((!server) || (!channel))
|
||||
return;
|
||||
|
||||
name = (char *) malloc (strlen (channel->name) + 2);
|
||||
strcpy (name, channel->name);
|
||||
strcat (name, ":");
|
||||
pos = strstr (server->notify_levels, name);
|
||||
free (name);
|
||||
if (pos)
|
||||
{
|
||||
pos2 = pos + strlen (channel->name);
|
||||
if (pos2[0] == ':')
|
||||
{
|
||||
pos2++;
|
||||
if (pos2[0])
|
||||
{
|
||||
pos2++;
|
||||
if (pos2[0] == ',')
|
||||
pos2++;
|
||||
if (!pos2[0] && (pos != server->notify_levels))
|
||||
pos--;
|
||||
strcpy (pos, pos2);
|
||||
server->notify_levels = (char *) realloc (server->notify_levels,
|
||||
strlen (server->notify_levels) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* server_set_notify_level: set channel notify level
|
||||
*/
|
||||
|
||||
void
|
||||
channel_set_notify_level (t_irc_server *server, t_irc_channel *channel, int notify)
|
||||
{
|
||||
char *name, *pos, *pos2, level_string[2];
|
||||
|
||||
if ((!server) || (!channel))
|
||||
return;
|
||||
|
||||
if (notify == NOTIFY_LEVEL_DEFAULT)
|
||||
{
|
||||
channel_remove_notify_level (server, channel);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!server->notify_levels)
|
||||
{
|
||||
server->notify_levels = (char *) malloc (strlen (channel->name) + 3);
|
||||
server->notify_levels[0] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
name = (char *) malloc (strlen (channel->name) + 2);
|
||||
strcpy (name, channel->name);
|
||||
strcat (name, ":");
|
||||
pos = strstr (server->notify_levels, name);
|
||||
free (name);
|
||||
if (pos)
|
||||
{
|
||||
pos2 = pos + strlen (channel->name) + 1;
|
||||
if (pos2[0])
|
||||
{
|
||||
pos2[0] = '0' + notify;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* realloc notify list to add channel */
|
||||
server->notify_levels = (char *) realloc (server->notify_levels,
|
||||
strlen (server->notify_levels) + 1 +
|
||||
strlen (channel->name) + 2 + 1);
|
||||
}
|
||||
|
||||
/* channel not in notify list => add it */
|
||||
if (server->notify_levels[0])
|
||||
strcat (server->notify_levels, ",");
|
||||
strcat (server->notify_levels, channel->name);
|
||||
strcat (server->notify_levels, ":");
|
||||
level_string[0] = notify + '0';
|
||||
level_string[1] = '\0';
|
||||
strcat (server->notify_levels, level_string);
|
||||
}
|
||||
|
||||
/*
|
||||
* channel_print_log: print channel infos in log (usually for crash dump)
|
||||
*/
|
||||
|
||||
+142
-106
@@ -35,6 +35,10 @@ t_irc_command irc_commands[] =
|
||||
N_("[target]"),
|
||||
N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_admin, NULL },
|
||||
{ "amsg", N_("send message to all channels of all connected servers"),
|
||||
N_("text"),
|
||||
N_("text: text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_amsg, NULL },
|
||||
{ "away", N_("toggle away status"),
|
||||
N_("[-all] [message]"),
|
||||
N_("-all: toggle away status on all connected servers\n"
|
||||
@@ -42,11 +46,14 @@ t_irc_command irc_commands[] =
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
|
||||
{ "ban", N_("bans nicks or hosts"),
|
||||
N_("[channel] [nickname [nickname ...]]"),
|
||||
N_("channel: channel for ban\nnickname: user or host to ban"),
|
||||
N_("channel: channel for ban\n"
|
||||
"nickname: user or host to ban"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_ban, NULL },
|
||||
{ "ctcp", N_("send a ctcp message"),
|
||||
N_("nickname type"),
|
||||
N_("nickname: user to send ctcp to\ntype: \"action\" or \"version\""),
|
||||
{ "ctcp", N_("send a CTCP message (Client-To-Client Protocol)"),
|
||||
N_("nickname type [arguments]"),
|
||||
N_("nickname: user to send CTCP to\n"
|
||||
"type: CTCP type (examples: \"version\", \"ping\", ..)\n"
|
||||
"arguments: arguments for CTCP"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_ctcp, NULL },
|
||||
{ "dcc", N_("starts DCC (file or chat) or close chat"),
|
||||
N_("action [nickname [file]]"),
|
||||
@@ -55,28 +62,29 @@ t_irc_command irc_commands[] =
|
||||
"file: filename (on local host)"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_dcc, NULL },
|
||||
{ "dehalfop", N_("removes half channel operator status from nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
|
||||
{ "deop", N_("removes channel operator status from nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
|
||||
{ "devoice", N_("removes voice from nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
|
||||
{ "die", N_("shutdown the server"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, irc_cmd_send_die, NULL },
|
||||
{ "error", N_("error received from IRC server"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "halfop", N_("gives half channel operator status to nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
|
||||
{ "info", N_("get information describing the server"),
|
||||
N_("[target]"),
|
||||
N_("target: server name"),
|
||||
0, 1, 1, NULL, irc_cmd_send_info, NULL },
|
||||
{ "invite", N_("invite a nick on a channel"),
|
||||
N_("nickname channel"),
|
||||
N_("nickname: nick to invite\nchannel: channel to invite"),
|
||||
N_("nickname: nick to invite\n"
|
||||
"channel: channel to invite"),
|
||||
1, 2, 1, irc_cmd_send_invite, NULL, irc_cmd_recv_invite },
|
||||
{ "ison", N_("check if a nickname is currently on IRC"),
|
||||
N_("nickname [nickname ...]"),
|
||||
@@ -84,20 +92,26 @@ t_irc_command irc_commands[] =
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
|
||||
{ "join", N_("join a channel"),
|
||||
N_("channel[,channel] [key[,key]]"),
|
||||
N_("channel: channel name to join\nkey: key to join the channel"),
|
||||
N_("channel: channel name to join\n"
|
||||
"key: key to join the channel"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_join, irc_cmd_recv_join },
|
||||
{ "kick", N_("forcibly remove a user from a channel"),
|
||||
N_("[channel] nickname [comment]"),
|
||||
N_("channel: channel where user is\nnickname: nickname to kick\ncomment: comment for kick"),
|
||||
N_("channel: channel where user is\n"
|
||||
"nickname: nickname to kick\n"
|
||||
"comment: comment for kick"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_kick, irc_cmd_recv_kick },
|
||||
{ "kickban", N_("kicks and bans a nick from a channel"),
|
||||
N_("[channel] nickname [comment]"),
|
||||
N_("channel: channel where user is\nnickname: nickname to kick and ban\ncomment: comment for kick"),
|
||||
N_("channel: channel where user is\n"
|
||||
"nickname: nickname to kick and ban\n"
|
||||
"comment: comment for kick"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_kickban, NULL },
|
||||
{ "kill", N_("close client-server connection"),
|
||||
N_("nickname comment"),
|
||||
N_("nickname: nickname\ncomment: comment for kill"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, NULL },
|
||||
N_("nickname: nickname\n"
|
||||
"comment: comment for kill"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
|
||||
{ "links", N_("list all servernames which are known by the server answering the query"),
|
||||
N_("[[server] server_mask]"),
|
||||
N_("server: this server should answer the query\n"
|
||||
@@ -145,15 +159,17 @@ t_irc_command irc_commands[] =
|
||||
0, 1, 1, NULL, irc_cmd_send_motd, NULL },
|
||||
{ "msg", N_("send message to a nick or channel"),
|
||||
N_("receiver[,receiver] text"),
|
||||
N_("receiver: nick or channel (may be mask, '*' = current channel)"
|
||||
"\ntext: text to send"),
|
||||
N_("receiver: nick or channel (may be mask, '*' = current channel)\n"
|
||||
"text: text to send"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
|
||||
{ "names", N_("list nicknames on channels"),
|
||||
N_("[channel[,channel]]"), N_("channel: channel name"),
|
||||
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 },
|
||||
@@ -165,24 +181,26 @@ t_irc_command irc_commands[] =
|
||||
N_("user/password: used to get privileges on current IRC server"),
|
||||
2, 2, 1, NULL, irc_cmd_send_oper, NULL },
|
||||
{ "part", N_("leave a channel"),
|
||||
N_("[channel[,channel]] [part_message]"), N_("channel: channel name to leave\n"
|
||||
"part_message: part message (displayed to other users)"),
|
||||
N_("[channel[,channel]] [part_message]"),
|
||||
N_("channel: channel name to leave\n"
|
||||
"part_message: part message (displayed to other users)"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_part, irc_cmd_recv_part },
|
||||
{ "ping", N_("ping server"),
|
||||
N_("server1 [server2]"),
|
||||
N_("server1: server to ping\nserver2: forward ping to this server"),
|
||||
1, 2, 1, NULL, irc_cmd_send_ping, irc_cmd_recv_ping },
|
||||
{ "pong", N_("answer to a ping message"),
|
||||
N_("daemon [daemon2]"), N_("daemon: daemon who has responded to Ping message\n"
|
||||
"daemon2: forward message to this daemon"),
|
||||
N_("daemon [daemon2]"),
|
||||
N_("daemon: daemon who has responded to Ping message\n"
|
||||
"daemon2: forward message to this daemon"),
|
||||
1, 2, 1, NULL, irc_cmd_send_pong, irc_cmd_recv_pong },
|
||||
{ "privmsg", N_("message received"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
|
||||
{ "query", N_("send a private message to a nick"),
|
||||
N_("nickname [text]"),
|
||||
N_("nickname: nickname for private conversation"
|
||||
"\ntext: text to send"),
|
||||
N_("nickname: nickname for private conversation\n"
|
||||
"text: text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_query, NULL },
|
||||
{ "quit", N_("close all connections & quit"),
|
||||
N_("[quit_message]"),
|
||||
@@ -204,14 +222,17 @@ t_irc_command irc_commands[] =
|
||||
"type: reserved for future usage"),
|
||||
6, 6, 1, NULL, irc_cmd_send_service, NULL },
|
||||
{ "servlist", N_("list services currently connected to the network"),
|
||||
N_("[mask [type]]"), N_("mask: list only services matching this mask\n"
|
||||
"type: list only services of this type"),
|
||||
N_("[mask [type]]"),
|
||||
N_("mask: list only services matching this mask\n"
|
||||
"type: list only services of this type"),
|
||||
0, 2, 1, NULL, irc_cmd_send_servlist, NULL },
|
||||
{ "squery", N_("deliver a message to a service"),
|
||||
N_("service text"), N_("service: name of service\ntext: text to send"),
|
||||
N_("service text"),
|
||||
N_("service: name of service\ntext: text to send"),
|
||||
2, 2, 1, NULL, irc_cmd_send_squery, NULL },
|
||||
{ "squit", N_("disconnect server links"),
|
||||
N_("server comment"), N_("server: server name\ncomment: comment for quit"),
|
||||
N_("server comment"),
|
||||
N_("server: server name\ncomment: comment for quit"),
|
||||
2, 2, 1, NULL, irc_cmd_send_squit, NULL },
|
||||
{ "stats", N_("query statistics about server"),
|
||||
N_("[query [server]]"),
|
||||
@@ -220,21 +241,24 @@ t_irc_command irc_commands[] =
|
||||
{ "summon", N_("give users who are on a host running an IRC server a message "
|
||||
"asking them to please join IRC"),
|
||||
N_("user [target [channel]]"),
|
||||
N_("user: username\ntarget: server name\nchannel: channel name"),
|
||||
N_("user: username\ntarget: server name\n"
|
||||
"channel: channel name"),
|
||||
1, 3, 1, NULL, irc_cmd_send_summon, NULL },
|
||||
{ "time", N_("query local time from server"),
|
||||
N_("[target]"), N_("target: query time from specified server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_time, NULL },
|
||||
{ "topic", N_("get/set channel topic"),
|
||||
N_("[channel] [topic]"), N_("channel: channel name\ntopic: new topic for channel "
|
||||
"(if topic is \"-delete\" then topic is deleted)"),
|
||||
N_("[channel] [topic]"),
|
||||
N_("channel: channel name\ntopic: new topic for channel "
|
||||
"(if topic is \"-delete\" then topic is deleted)"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
|
||||
{ "trace", N_("find the route to specific server"),
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_trace, NULL },
|
||||
{ "unban", N_("unbans nicks or hosts"),
|
||||
N_("[channel] nickname [nickname ...]"),
|
||||
N_("channel: channel for unban\nnickname: user or host to unban"),
|
||||
N_("channel: channel for unban\n"
|
||||
"nickname: user or host to unban"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_unban, NULL },
|
||||
{ "userhost", N_("return a list of information about nicknames"),
|
||||
N_("nickname [nickname ...]"), N_("nickname: nickname"),
|
||||
@@ -243,102 +267,110 @@ t_irc_command irc_commands[] =
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_users, NULL },
|
||||
{ "version", N_("gives the version info of nick or server (current or specified)"),
|
||||
N_("[server | nickname]"), N_("server: server name\nnickname: nickname"),
|
||||
N_("[server | nickname]"),
|
||||
N_("server: server name\n"
|
||||
"nickname: nickname"),
|
||||
0, 1, 1, NULL, irc_cmd_send_version, NULL },
|
||||
{ "voice", N_("gives voice to nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
|
||||
{ "wallops", N_("send a message to all currently connected users who have "
|
||||
"set the 'w' user mode for themselves"),
|
||||
N_("text"), N_("text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
|
||||
{ "who", N_("generate a query which returns a list of information"),
|
||||
N_("[mask [\"o\"]]"), N_("mask: only information which match this mask\n"
|
||||
"o: only operators are returned according to the mask supplied"),
|
||||
N_("[mask [\"o\"]]"),
|
||||
N_("mask: only information which match this mask\n"
|
||||
"o: only operators are returned according to the mask supplied"),
|
||||
0, 2, 1, NULL, irc_cmd_send_who, NULL },
|
||||
{ "whois", N_("query information about user(s)"),
|
||||
N_("[server] nickname[,nickname]"), N_("server: server name\n"
|
||||
"nickname: nickname (may be a mask)"),
|
||||
N_("[server] nickname[,nickname]"),
|
||||
N_("server: server name\n"
|
||||
"nickname: nickname (may be a mask)"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_whois, NULL },
|
||||
{ "whowas", N_("ask for information about a nickname which no longer exists"),
|
||||
N_("nickname [,nickname [,nickname ...]] [count [target]]"),
|
||||
N_("nickname: nickname to search\ncount: number of replies to return "
|
||||
"(full search if negative number)\n"
|
||||
"target: reply should match this mask"),
|
||||
N_("nickname: nickname to search\n"
|
||||
"count: number of replies to return (full search if negative number)\n"
|
||||
"target: reply should match this mask"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_whowas, NULL },
|
||||
{ "001", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "002", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "003", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "004", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
|
||||
{ "005", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "212", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "219", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "250", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "251", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "252", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "253", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "254", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "255", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "256", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "257", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "258", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "259", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "260", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "261", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "262", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "263", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "264", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "265", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "266", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "267", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "268", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "269", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "301", N_("away message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
|
||||
{ "302", N_("userhost"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
|
||||
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
|
||||
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
|
||||
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
|
||||
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
|
||||
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
|
||||
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
|
||||
{ "314", N_("whowas"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
|
||||
{ "315", N_("end of /who list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
|
||||
{ "317", N_("whois (idle)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
|
||||
{ "318", N_("whois (end)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
|
||||
{ "319", N_("whois (channels)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
|
||||
{ "001", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "002", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "003", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "004", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
|
||||
{ "005", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "212", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "219", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "250", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "251", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "252", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "253", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "254", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "255", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "256", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "257", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "258", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "259", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "260", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "261", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "262", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "263", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "264", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "265", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "266", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "267", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "268", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "269", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "301", N_("away message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
|
||||
{ "302", N_("userhost"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
|
||||
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
|
||||
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
|
||||
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
|
||||
{ "307", N_("whois (registered nick)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
|
||||
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
|
||||
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
|
||||
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
|
||||
{ "314", N_("whowas"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
|
||||
{ "315", N_("end of /who list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
|
||||
{ "317", N_("whois (idle)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
|
||||
{ "318", N_("whois (end)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
|
||||
{ "319", N_("whois (channels)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
|
||||
{ "320", N_("whois (identified user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
|
||||
{ "321", N_("/list start"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
|
||||
{ "322", N_("channel (for /list)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
|
||||
{ "323", N_("/list end"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
|
||||
{ "324", N_("channel mode"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
|
||||
{ "329", "???", "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
|
||||
{ "331", N_("no topic for channel"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
|
||||
{ "321", N_("/list start"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
|
||||
{ "322", N_("channel (for /list)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
|
||||
{ "323", N_("/list end"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
|
||||
{ "324", N_("channel mode"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
|
||||
{ "329", "???", "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
|
||||
{ "331", N_("no topic for channel"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
|
||||
{ "332", N_("topic of channel"),
|
||||
N_("channel :topic"),
|
||||
N_("channel: name of channel\ntopic: topic of the channel"),
|
||||
N_("channel: name of channel\n"
|
||||
"topic: topic of the channel"),
|
||||
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 },
|
||||
{ "333", N_("infos about topic (nick & date changed)"),
|
||||
"", "",
|
||||
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"),
|
||||
N_("channel :[[@|+]nick ...]"),
|
||||
N_("channel: name of channel\nnick: nick on the channel"),
|
||||
N_("channel: name of channel\n"
|
||||
"nick: nick on the channel"),
|
||||
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_353 },
|
||||
{ "364", N_("links"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "365", N_("end of /links list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "366", N_("end of /names list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
|
||||
{ "367", N_("banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
|
||||
{ "368", N_("end of banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
|
||||
{ "364", N_("links"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "365", N_("end of /links list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "366", N_("end of /names list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
|
||||
{ "367", N_("banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
|
||||
{ "368", N_("end of banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
|
||||
{ "369", N_("end of /whowas list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "371", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "372", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "373", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "374", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "375", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "376", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "391", N_("server local time"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "371", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "372", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "373", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "374", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "375", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "376", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "391", N_("server local time"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "401", N_("no such nick/channel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "402", N_("no such server"),
|
||||
@@ -431,11 +463,15 @@ 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 }
|
||||
};
|
||||
|
||||
+384
-115
@@ -63,6 +63,168 @@ dcc_redraw (int highlight)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_search: search a DCC
|
||||
*/
|
||||
|
||||
t_irc_dcc *
|
||||
dcc_search (t_irc_server *server, int type, int status, int port)
|
||||
{
|
||||
t_irc_dcc *ptr_dcc;
|
||||
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
if ((ptr_dcc->server == server)
|
||||
&& (ptr_dcc->type == type)
|
||||
&& (ptr_dcc->status = status)
|
||||
&& (ptr_dcc->port == port))
|
||||
return ptr_dcc;
|
||||
}
|
||||
|
||||
/* DCC not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_file_is_resumable: check if a file can be used for resuming a download
|
||||
*/
|
||||
|
||||
int
|
||||
dcc_file_is_resumable (t_irc_dcc *ptr_dcc, char *filename)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (!cfg_dcc_auto_resume)
|
||||
return 0;
|
||||
|
||||
if (access (filename, W_OK) == 0)
|
||||
{
|
||||
if (stat (filename, &st) != -1)
|
||||
{
|
||||
if ((unsigned long) st.st_size < ptr_dcc->size)
|
||||
{
|
||||
ptr_dcc->start_resume = (unsigned long) st.st_size;
|
||||
ptr_dcc->pos = st.st_size;
|
||||
ptr_dcc->last_check_pos = st.st_size;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* not resumable */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_find_filename: find local filename for a DCC
|
||||
* if type if file/recv, add a suffix (like .1) if needed
|
||||
* if download is resumable, set "start_resume" to good value
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_find_filename (t_irc_dcc *ptr_dcc)
|
||||
{
|
||||
char *ptr_home, *filename2;
|
||||
|
||||
ptr_home = getenv ("HOME");
|
||||
ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) +
|
||||
strlen (ptr_dcc->nick) +
|
||||
strlen (ptr_dcc->filename) +
|
||||
((cfg_dcc_download_path[0] == '~') ?
|
||||
strlen (ptr_home) : 0) +
|
||||
4);
|
||||
if (!ptr_dcc->local_filename)
|
||||
return;
|
||||
|
||||
if (cfg_dcc_download_path[0] == '~')
|
||||
{
|
||||
strcpy (ptr_dcc->local_filename, ptr_home);
|
||||
strcat (ptr_dcc->local_filename, cfg_dcc_download_path + 1);
|
||||
}
|
||||
else
|
||||
strcpy (ptr_dcc->local_filename, cfg_dcc_download_path);
|
||||
if (ptr_dcc->local_filename[strlen (ptr_dcc->local_filename) - 1] != DIR_SEPARATOR_CHAR)
|
||||
strcat (ptr_dcc->local_filename, DIR_SEPARATOR);
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->nick);
|
||||
strcat (ptr_dcc->local_filename, ".");
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->filename);
|
||||
|
||||
/* file already exists? */
|
||||
if (access (ptr_dcc->local_filename, F_OK) == 0)
|
||||
{
|
||||
if (dcc_file_is_resumable (ptr_dcc, ptr_dcc->local_filename))
|
||||
return;
|
||||
|
||||
/* if auto rename is not set, then abort DCC */
|
||||
if (!cfg_dcc_auto_rename)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
filename2 = (char *) malloc (strlen (ptr_dcc->local_filename) + 16);
|
||||
if (!filename2)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return;
|
||||
}
|
||||
ptr_dcc->filename_suffix = 0;
|
||||
do
|
||||
{
|
||||
ptr_dcc->filename_suffix++;
|
||||
sprintf (filename2, "%s.%d",
|
||||
ptr_dcc->local_filename,
|
||||
ptr_dcc->filename_suffix);
|
||||
if (access (filename2, F_OK) == 0)
|
||||
{
|
||||
if (dcc_file_is_resumable (ptr_dcc, filename2))
|
||||
break;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
while (1);
|
||||
|
||||
free (ptr_dcc->local_filename);
|
||||
ptr_dcc->local_filename = strdup (filename2);
|
||||
free (filename2);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_calculate_speed: calculate DCC speed (for files only)
|
||||
*/
|
||||
|
||||
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 - ptr_dcc->start_resume) / 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
|
||||
*/
|
||||
@@ -150,7 +312,7 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
|
||||
|
||||
ptr_dcc->status = status;
|
||||
|
||||
if (status == DCC_DONE)
|
||||
if ((status == DCC_DONE) || (status == DCC_ABORTED) || (status == DCC_FAILED))
|
||||
{
|
||||
if (DCC_IS_FILE(ptr_dcc->type))
|
||||
{
|
||||
@@ -160,20 +322,25 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
ptr_dcc->filename);
|
||||
gui_printf (ptr_dcc->server->buffer, _(" (local filename: "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
ptr_dcc->local_filename);
|
||||
if (ptr_dcc->local_filename)
|
||||
{
|
||||
gui_printf (ptr_dcc->server->buffer, _(" (local filename: "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
ptr_dcc->local_filename);
|
||||
gui_printf (ptr_dcc->server->buffer, ")");
|
||||
}
|
||||
if (ptr_dcc->type == DCC_FILE_SEND)
|
||||
gui_printf (ptr_dcc->server->buffer, _(") sent to "));
|
||||
gui_printf (ptr_dcc->server->buffer, _(" sent to "));
|
||||
else
|
||||
gui_printf (ptr_dcc->server->buffer, _(") received from "));
|
||||
gui_printf (ptr_dcc->server->buffer, _(" received from "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_NICK,
|
||||
"%s",
|
||||
ptr_dcc->nick);
|
||||
gui_printf (ptr_dcc->server->buffer, _(": ok!\n"));
|
||||
gui_printf (ptr_dcc->server->buffer,
|
||||
(status == DCC_DONE) ? _(": ok!\n") : _(": FAILED\n"));
|
||||
}
|
||||
}
|
||||
if (status == DCC_ABORTED)
|
||||
@@ -197,9 +364,20 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
|
||||
}
|
||||
}
|
||||
|
||||
/* remove empty file if received file failed and nothing was transfered */
|
||||
if (((status == DCC_FAILED) || (status == DCC_ABORTED))
|
||||
&& DCC_IS_FILE(ptr_dcc->type)
|
||||
&& DCC_IS_RECV(ptr_dcc->type)
|
||||
&& ptr_dcc->local_filename
|
||||
&& ptr_dcc->pos == 0)
|
||||
unlink (ptr_dcc->local_filename);
|
||||
|
||||
if (DCC_IS_CHAT(ptr_dcc->type))
|
||||
channel_remove_dcc (ptr_dcc);
|
||||
|
||||
if (DCC_IS_FILE(ptr_dcc->type))
|
||||
dcc_calculate_speed (ptr_dcc, 1);
|
||||
|
||||
if (ptr_dcc->sock != -1)
|
||||
{
|
||||
close (ptr_dcc->sock);
|
||||
@@ -227,7 +405,7 @@ dcc_channel_for_chat (t_irc_dcc *ptr_dcc)
|
||||
"(maybe private buffer has already DCC CHAT?)\n"),
|
||||
WEECHAT_ERROR);
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -246,18 +424,16 @@ dcc_channel_for_chat (t_irc_dcc *ptr_dcc)
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_accept: accepts a DCC file or chat request
|
||||
* dcc_recv_connect_init: connect to sender and init file or chat
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_accept (t_irc_dcc *ptr_dcc)
|
||||
dcc_recv_connect_init (t_irc_dcc *ptr_dcc)
|
||||
{
|
||||
char *ptr_home, *filename2;
|
||||
|
||||
if (!dcc_connect (ptr_dcc))
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -266,67 +442,15 @@ dcc_accept (t_irc_dcc *ptr_dcc)
|
||||
/* DCC file => look for local filename and open it in writing mode */
|
||||
if (DCC_IS_FILE(ptr_dcc->type))
|
||||
{
|
||||
ptr_home = getenv ("HOME");
|
||||
ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) +
|
||||
strlen (ptr_dcc->nick) +
|
||||
strlen (ptr_dcc->filename) +
|
||||
((cfg_dcc_download_path[0] == '~') ?
|
||||
strlen (ptr_home) : 0) +
|
||||
4);
|
||||
if (!ptr_dcc->local_filename)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
if (cfg_dcc_download_path[0] == '~')
|
||||
{
|
||||
strcpy (ptr_dcc->local_filename, ptr_home);
|
||||
strcat (ptr_dcc->local_filename, cfg_dcc_download_path + 1);
|
||||
}
|
||||
if (ptr_dcc->start_resume > 0)
|
||||
ptr_dcc->file = open (ptr_dcc->local_filename,
|
||||
O_APPEND | O_WRONLY | O_NONBLOCK);
|
||||
else
|
||||
strcpy (ptr_dcc->local_filename, cfg_dcc_download_path);
|
||||
if (ptr_dcc->local_filename[strlen (ptr_dcc->local_filename) - 1] != DIR_SEPARATOR_CHAR)
|
||||
strcat (ptr_dcc->local_filename, DIR_SEPARATOR);
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->nick);
|
||||
strcat (ptr_dcc->local_filename, ".");
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->filename);
|
||||
|
||||
/* file already exists? */
|
||||
if (access (ptr_dcc->local_filename, F_OK) == 0)
|
||||
{
|
||||
/* if auto rename is not set, then abort DCC */
|
||||
if (!cfg_dcc_auto_rename)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
|
||||
filename2 = (char *) malloc (strlen (ptr_dcc->local_filename) + 16);
|
||||
if (!filename2)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
ptr_dcc->filename_suffix = 0;
|
||||
do
|
||||
{
|
||||
ptr_dcc->filename_suffix++;
|
||||
sprintf (filename2, "%s.%d",
|
||||
ptr_dcc->local_filename,
|
||||
ptr_dcc->filename_suffix);
|
||||
}
|
||||
while (access (filename2, F_OK) == 0);
|
||||
|
||||
free (ptr_dcc->local_filename);
|
||||
ptr_dcc->local_filename = strdup (filename2);
|
||||
free (filename2);
|
||||
}
|
||||
ptr_dcc->file = open (ptr_dcc->local_filename,
|
||||
O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK,
|
||||
0644);
|
||||
ptr_dcc->file = open (ptr_dcc->local_filename,
|
||||
O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK,
|
||||
0644);
|
||||
ptr_dcc->start_transfer = time (NULL);
|
||||
ptr_dcc->last_check_time = time (NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -334,7 +458,94 @@ dcc_accept (t_irc_dcc *ptr_dcc)
|
||||
dcc_channel_for_chat (ptr_dcc);
|
||||
}
|
||||
}
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_accept: accepts a DCC file or chat request
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_accept (t_irc_dcc *ptr_dcc)
|
||||
{
|
||||
if (DCC_IS_FILE(ptr_dcc->type) && (ptr_dcc->start_resume > 0))
|
||||
{
|
||||
ptr_dcc->status = DCC_CONNECTING;
|
||||
server_sendf (ptr_dcc->server,
|
||||
(strchr (ptr_dcc->filename, ' ')) ?
|
||||
"PRIVMSG %s :\01DCC RESUME \"%s\" %d %u\01\r\n" :
|
||||
"PRIVMSG %s :\01DCC RESUME %s %d %u\01\r\n",
|
||||
ptr_dcc->nick, ptr_dcc->filename,
|
||||
ptr_dcc->port, ptr_dcc->start_resume);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
else
|
||||
dcc_recv_connect_init (ptr_dcc);
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_accept_resume: accepts a resume and inform the receiver
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_accept_resume (t_irc_server *server, char *filename, int port,
|
||||
unsigned long pos_start)
|
||||
{
|
||||
t_irc_dcc *ptr_dcc;
|
||||
|
||||
ptr_dcc = dcc_search (server, DCC_FILE_SEND, DCC_CONNECTING, port);
|
||||
if (ptr_dcc)
|
||||
{
|
||||
ptr_dcc->pos = pos_start;
|
||||
ptr_dcc->ack = pos_start;
|
||||
ptr_dcc->start_resume = pos_start;
|
||||
ptr_dcc->last_check_pos = pos_start;
|
||||
server_sendf (ptr_dcc->server,
|
||||
(strchr (ptr_dcc->filename, ' ')) ?
|
||||
"PRIVMSG %s :\01DCC ACCEPT \"%s\" %d %u\01\r\n" :
|
||||
"PRIVMSG %s :\01DCC ACCEPT %s %d %u\01\r\n",
|
||||
ptr_dcc->nick, ptr_dcc->filename,
|
||||
ptr_dcc->port, ptr_dcc->start_resume);
|
||||
|
||||
irc_display_prefix (ptr_dcc->server->buffer, PREFIX_INFO);
|
||||
gui_printf (ptr_dcc->server->buffer, _("DCC: file "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s ",
|
||||
ptr_dcc->filename);
|
||||
gui_printf (ptr_dcc->server->buffer, _("resumed at position %u\n"),
|
||||
ptr_dcc->start_resume);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
else
|
||||
gui_printf (server->buffer,
|
||||
_("%s can't resume file \"%s\" (port: %d, start position: %u): DCC not found or ended\n"),
|
||||
WEECHAT_ERROR, filename, port, pos_start);
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_start_resume: called when "DCC ACCEPT" is received (resume accepted by sender)
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_start_resume (t_irc_server *server, char *filename, int port,
|
||||
unsigned long pos_start)
|
||||
{
|
||||
t_irc_dcc *ptr_dcc;
|
||||
|
||||
ptr_dcc = dcc_search (server, DCC_FILE_RECV, DCC_CONNECTING, port);
|
||||
if (ptr_dcc)
|
||||
{
|
||||
ptr_dcc->pos = pos_start;
|
||||
ptr_dcc->ack = pos_start;
|
||||
ptr_dcc->start_resume = pos_start;
|
||||
ptr_dcc->last_check_pos = pos_start;
|
||||
dcc_recv_connect_init (ptr_dcc);
|
||||
}
|
||||
else
|
||||
gui_printf (server->buffer,
|
||||
_("%s can't resume file \"%s\" (port: %d, start position: %u): DCC not found or ended\n"),
|
||||
WEECHAT_ERROR, filename, port, pos_start);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -363,6 +574,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);
|
||||
@@ -373,11 +585,20 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
new_dcc->filename = strdup (_("DCC chat"));
|
||||
else
|
||||
new_dcc->filename = (filename) ? strdup (filename) : NULL;
|
||||
new_dcc->local_filename = (local_filename) ? strdup (local_filename) : NULL;
|
||||
new_dcc->local_filename = NULL;
|
||||
new_dcc->filename_suffix = -1;
|
||||
new_dcc->size = size;
|
||||
new_dcc->pos = 0;
|
||||
new_dcc->ack = 0;
|
||||
new_dcc->start_resume = 0;
|
||||
new_dcc->last_check_time = time (NULL);
|
||||
new_dcc->last_check_pos = 0;
|
||||
new_dcc->bytes_per_sec = 0;
|
||||
new_dcc->last_activity = time (NULL);
|
||||
if (local_filename)
|
||||
new_dcc->local_filename = strdup (local_filename);
|
||||
else
|
||||
dcc_find_filename (new_dcc);
|
||||
new_dcc->prev_dcc = NULL;
|
||||
new_dcc->next_dcc = dcc_list;
|
||||
if (dcc_list)
|
||||
@@ -403,6 +624,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
gui_printf (server->buffer, ", ");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%lu", size);
|
||||
gui_printf (server->buffer, _(" bytes\n"));
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
if (type == DCC_FILE_SEND)
|
||||
{
|
||||
@@ -416,6 +638,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
gui_printf (server->buffer, "), ");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%lu", size);
|
||||
gui_printf (server->buffer, _(" bytes\n"));
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
if (type == DCC_CHAT_RECV)
|
||||
{
|
||||
@@ -427,12 +650,40 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
"%d.%d.%d.%d",
|
||||
addr >> 24, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, ")\n");
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
if (type == DCC_CHAT_SEND)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_INFO);
|
||||
gui_printf (server->buffer, _("Sending DCC chat request to "));
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, "%s\n", nick);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
|
||||
if (DCC_IS_FILE(type) && (!new_dcc->local_filename))
|
||||
{
|
||||
dcc_close (new_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (DCC_IS_FILE(type) && (new_dcc->start_resume > 0))
|
||||
{
|
||||
irc_display_prefix (new_dcc->server->buffer, PREFIX_INFO);
|
||||
gui_printf (new_dcc->server->buffer, _("DCC: file "));
|
||||
gui_printf_color (new_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
new_dcc->filename);
|
||||
gui_printf (new_dcc->server->buffer, _(" (local filename: "));
|
||||
gui_printf_color (new_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
new_dcc->local_filename);
|
||||
gui_printf (new_dcc->server->buffer, ") ");
|
||||
gui_printf (new_dcc->server->buffer, _("will be resumed at position %u\n"),
|
||||
new_dcc->start_resume);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
|
||||
/* connect if needed and redraw DCC buffer */
|
||||
@@ -441,6 +692,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
if (!dcc_connect (new_dcc))
|
||||
{
|
||||
dcc_close (new_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -449,7 +701,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
|| ( (type == DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) )
|
||||
dcc_accept (new_dcc);
|
||||
else
|
||||
dcc_redraw (2);
|
||||
dcc_redraw (HOTLIST_PRIVATE);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 0);
|
||||
|
||||
return new_dcc;
|
||||
@@ -478,9 +730,9 @@ dcc_send_request (t_irc_server *server, int type, char *nick, char *filename)
|
||||
if (type == DCC_FILE_SEND)
|
||||
{
|
||||
/* add home if filename not beginning with '/' (not for Win32) */
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
filename2 = strdup (filename);
|
||||
#else
|
||||
#else
|
||||
if (filename[0] == '/')
|
||||
filename2 = strdup (filename);
|
||||
else
|
||||
@@ -510,7 +762,7 @@ dcc_send_request (t_irc_server *server, int type, char *nick, char *filename)
|
||||
strcat (filename2, DIR_SEPARATOR);
|
||||
strcat (filename2, filename);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* check if file exists */
|
||||
if (stat (filename2, &st) == -1)
|
||||
@@ -665,11 +917,11 @@ dcc_chat_sendf (t_irc_dcc *ptr_dcc, char *fmt, ...)
|
||||
buffer[sizeof (buffer) - 1] = '\0';
|
||||
if ((size_buf < 0) || (size_buf > (int) (sizeof (buffer) - 1)))
|
||||
size_buf = strlen (buffer);
|
||||
#ifdef DEBUG
|
||||
#ifdef DEBUG
|
||||
buffer[size_buf - 2] = '\0';
|
||||
gui_printf (ptr_dcc->server->buffer, "[DEBUG] Sending to remote host (DCC CHAT) >>> %s\n", buffer);
|
||||
buffer[size_buf - 2] = '\r';
|
||||
#endif
|
||||
#endif
|
||||
buf2 = weechat_convert_encoding ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
cfg_look_charset_encode,
|
||||
@@ -746,7 +998,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
|
||||
gui_printf_type_color (ptr_dcc->channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (strstr (ptr_buf, ptr_dcc->server->nick))
|
||||
if (irc_is_highlight (ptr_buf, ptr_dcc->server->nick))
|
||||
{
|
||||
gui_printf_type_color (ptr_dcc->channel->buffer,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
@@ -781,12 +1033,12 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
|
||||
else
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_ABORTED);
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_handle: receive/send data for each active DCC (files only)
|
||||
* dcc_handle: receive/send data for all active DCC
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -804,6 +1056,17 @@ dcc_handle ()
|
||||
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
/* check DCC timeout */
|
||||
if (DCC_IS_FILE(ptr_dcc->type) && !DCC_ENDED(ptr_dcc->status))
|
||||
{
|
||||
if ((cfg_dcc_timeout != 0) && (time (NULL) > ptr_dcc->last_activity + cfg_dcc_timeout))
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (ptr_dcc->status == DCC_CONNECTING)
|
||||
{
|
||||
if (ptr_dcc->type == DCC_FILE_SEND)
|
||||
@@ -818,6 +1081,7 @@ dcc_handle ()
|
||||
{
|
||||
if (FD_ISSET (ptr_dcc->sock, &read_fd))
|
||||
{
|
||||
ptr_dcc->last_activity = time (NULL);
|
||||
length = sizeof (addr);
|
||||
sock = accept (ptr_dcc->sock, (struct sockaddr *) &addr, &length);
|
||||
close (ptr_dcc->sock);
|
||||
@@ -825,20 +1089,21 @@ dcc_handle ()
|
||||
if (sock < 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->sock = sock;
|
||||
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
|
||||
ptr_dcc->status = DCC_ACTIVE;
|
||||
ptr_dcc->file = open (ptr_dcc->local_filename, O_RDONLY | O_NONBLOCK, 0644);
|
||||
dcc_redraw (1);
|
||||
ptr_dcc->start_transfer = time (NULL);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -865,19 +1130,19 @@ dcc_handle ()
|
||||
if (sock < 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->sock = sock;
|
||||
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
|
||||
ptr_dcc->status = DCC_ACTIVE;
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
dcc_channel_for_chat (ptr_dcc);
|
||||
}
|
||||
}
|
||||
@@ -908,26 +1173,28 @@ dcc_handle ()
|
||||
if (num_read == 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (write (ptr_dcc->file, buffer, num_read) == -1)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->last_activity = time (NULL);
|
||||
ptr_dcc->pos += (unsigned long) num_read;
|
||||
pos = htonl (ptr_dcc->pos);
|
||||
send (ptr_dcc->sock, (char *) &pos, 4, 0);
|
||||
dcc_calculate_speed (ptr_dcc, 0);
|
||||
if (ptr_dcc->pos >= ptr_dcc->size)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_DONE);
|
||||
dcc_redraw (1);
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
}
|
||||
else
|
||||
dcc_redraw (0);
|
||||
dcc_redraw (HOTLIST_LOW);
|
||||
}
|
||||
}
|
||||
if (ptr_dcc->type == DCC_FILE_SEND)
|
||||
@@ -940,8 +1207,8 @@ dcc_handle ()
|
||||
"max is %d.\n"),
|
||||
sizeof (buffer));
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
if (ptr_dcc->pos > ptr_dcc->ack)
|
||||
{
|
||||
@@ -952,11 +1219,11 @@ dcc_handle ()
|
||||
if (num_read == 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
if (num_read < 4)
|
||||
return;
|
||||
continue;
|
||||
recv (ptr_dcc->sock, (char *) &pos, 4, 0);
|
||||
ptr_dcc->ack = ntohl (pos);
|
||||
|
||||
@@ -964,8 +1231,8 @@ dcc_handle ()
|
||||
&& (ptr_dcc->ack >= ptr_dcc->size))
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_DONE);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -976,18 +1243,20 @@ dcc_handle ()
|
||||
if (num_read < 1)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
num_sent = send (ptr_dcc->sock, buffer, num_read, 0);
|
||||
if (num_sent < 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
dcc_redraw (HOTLIST_MSG);
|
||||
continue;
|
||||
}
|
||||
ptr_dcc->last_activity = time (NULL);
|
||||
ptr_dcc->pos += (unsigned long) num_sent;
|
||||
dcc_redraw (0);
|
||||
dcc_calculate_speed (ptr_dcc, 0);
|
||||
dcc_redraw (HOTLIST_LOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1008,7 +1277,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);
|
||||
}
|
||||
|
||||
+28
-9
@@ -57,7 +57,14 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
|
||||
gui_printf_type_color (buffer, type, COLOR_WIN_CHAT_PREFIX1, "%c ", prefix[2]);
|
||||
}
|
||||
else
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
|
||||
{
|
||||
if (strcmp (prefix, PREFIX_JOIN) == 0)
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_JOIN, "%s ", prefix);
|
||||
else if (strcmp (prefix, PREFIX_PART) == 0)
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PART, "%s ", prefix);
|
||||
else
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -66,13 +73,14 @@ irc_display_prefix (t_gui_buffer *buffer, char *prefix)
|
||||
*/
|
||||
|
||||
void
|
||||
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
|
||||
int display_around, int color_nick, int no_nickmode)
|
||||
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
|
||||
int message_type, int display_around, int color_nick, int no_nickmode)
|
||||
{
|
||||
if (display_around)
|
||||
gui_printf_type_color (buffer,
|
||||
message_type, COLOR_WIN_CHAT_DARK, "<");
|
||||
if (cfg_look_nickmode)
|
||||
message_type, COLOR_WIN_CHAT_DARK,
|
||||
(nick) ? "<" : ">");
|
||||
if (nick && cfg_look_nickmode)
|
||||
{
|
||||
if (nick->is_chanowner)
|
||||
gui_printf_type_color (buffer,
|
||||
@@ -104,19 +112,20 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
|
||||
gui_printf_type_color (buffer,
|
||||
message_type,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", nick->nick);
|
||||
"%s", (nick) ? nick->nick : nickname);
|
||||
else
|
||||
gui_printf_type_color (buffer,
|
||||
message_type,
|
||||
(color_nick) ?
|
||||
(nick && color_nick) ?
|
||||
((cfg_look_color_nicks) ?
|
||||
nick->color : COLOR_WIN_CHAT) :
|
||||
COLOR_WIN_CHAT,
|
||||
"%s", nick->nick);
|
||||
"%s", (nick) ? nick->nick : nickname);
|
||||
|
||||
if (display_around)
|
||||
gui_printf_type_color (buffer,
|
||||
message_type, COLOR_WIN_CHAT_DARK, "> ");
|
||||
message_type, COLOR_WIN_CHAT_DARK,
|
||||
(nick) ? "> " : "< ");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -175,6 +184,12 @@ irc_display_server (t_irc_server *server)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT,
|
||||
" server_port . . . . . . .: %d\n",
|
||||
server->port);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT,
|
||||
" server_ipv6 . . . . . . .: %s\n",
|
||||
(server->ipv6) ? _("yes") : _("no"));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT,
|
||||
" server_ssl . . . . . . . .: %s\n",
|
||||
(server->ssl) ? _("yes") : _("no"));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT,
|
||||
" server_password . . . . .: %s\n",
|
||||
(server->password && server->password[0]) ?
|
||||
@@ -202,4 +217,8 @@ irc_display_server (t_irc_server *server)
|
||||
" server_autojoin . . . . .: %s\n",
|
||||
(server->autojoin && server->autojoin[0]) ?
|
||||
server->autojoin : "");
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT,
|
||||
" server_notify_levels . . .: %s\n",
|
||||
(server->notify_levels && server->notify_levels[0]) ?
|
||||
server->notify_levels : "");
|
||||
}
|
||||
|
||||
+22
-4
@@ -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)
|
||||
|
||||
+658
-94
@@ -29,6 +29,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <sys/utsname.h>
|
||||
@@ -42,6 +43,92 @@
|
||||
#include "../plugins/plugins.h"
|
||||
|
||||
|
||||
/*
|
||||
* irc_is_highlight: returns 1 if given message contains highlight (with given nick
|
||||
* or at least one of string in "irc_higlight" setting
|
||||
*/
|
||||
|
||||
int
|
||||
irc_is_highlight (char *message, char *nick)
|
||||
{
|
||||
char *msg, *highlight, *pos, *pos_end;
|
||||
int end, length;
|
||||
|
||||
/* empty message ? */
|
||||
if (!message || !message[0])
|
||||
return 0;
|
||||
|
||||
/* highlight by nickname */
|
||||
if (strstr (message, nick))
|
||||
return 1;
|
||||
|
||||
/* no highlight by nickname and "irc_highlight" is empty */
|
||||
if (!cfg_irc_highlight || !cfg_irc_highlight[0])
|
||||
return 0;
|
||||
|
||||
/* convert both strings to lower case */
|
||||
if ((msg = strdup (message)) == NULL)
|
||||
return 0;
|
||||
if ((highlight = strdup (cfg_irc_highlight)) == NULL)
|
||||
{
|
||||
free (msg);
|
||||
return 0;
|
||||
}
|
||||
pos = msg;
|
||||
while (pos[0])
|
||||
{
|
||||
pos[0] = tolower (pos[0]);
|
||||
pos++;
|
||||
}
|
||||
pos = highlight;
|
||||
while (pos[0])
|
||||
{
|
||||
pos[0] = tolower (pos[0]);
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* look in "irc_highlight" for highlight */
|
||||
pos = highlight;
|
||||
end = 0;
|
||||
while (!end)
|
||||
{
|
||||
pos_end = strchr (pos, ',');
|
||||
if (!pos_end)
|
||||
{
|
||||
pos_end = strchr (pos, '\0');
|
||||
end = 1;
|
||||
}
|
||||
/* error parsing string! */
|
||||
if (!pos_end)
|
||||
{
|
||||
free (msg);
|
||||
free (highlight);
|
||||
return 0;
|
||||
}
|
||||
|
||||
length = pos_end - pos;
|
||||
pos_end[0] = '\0';
|
||||
if (length > 0)
|
||||
{
|
||||
/* highlight found! */
|
||||
if (strstr (msg, pos))
|
||||
{
|
||||
free (msg);
|
||||
free (highlight);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!end)
|
||||
pos = pos_end + 1;
|
||||
}
|
||||
|
||||
/* no highlight found with "irc_highlight" list */
|
||||
free (msg);
|
||||
free (highlight);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_recv_command: executes action when receiving IRC command
|
||||
* returns: 0 = all ok, command executed
|
||||
@@ -185,7 +272,7 @@ irc_cmd_recv_invite (t_irc_server *server, char *host, char *arguments)
|
||||
gui_printf (server->buffer, _("by"));
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
|
||||
" %s\n", host);
|
||||
hotlist_add (2, server->buffer);
|
||||
hotlist_add (HOTLIST_HIGHLIGHT, server->buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
else
|
||||
@@ -345,6 +432,76 @@ irc_cmd_recv_kick (t_irc_server *server, char *host, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_recv_kill: 'kill' message received
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_recv_kill (t_irc_server *server, char *host, char *arguments)
|
||||
{
|
||||
char *pos, *pos_host2, *pos_comment;
|
||||
t_irc_channel *ptr_channel;
|
||||
|
||||
pos = strchr (host, '!');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
|
||||
pos_host2 = strchr (arguments, ' ');
|
||||
if (pos_host2)
|
||||
{
|
||||
pos_host2[0] = '\0';
|
||||
pos_host2++;
|
||||
while (pos_host2[0] == ' ')
|
||||
pos_host2++;
|
||||
|
||||
pos_comment = strchr (pos_host2, ' ');
|
||||
if (pos_comment)
|
||||
{
|
||||
pos_comment[0] = '\0';
|
||||
pos_comment++;
|
||||
while (pos_comment[0] == ' ')
|
||||
pos_comment++;
|
||||
if (pos_comment[0] == ':')
|
||||
pos_comment++;
|
||||
}
|
||||
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_PART);
|
||||
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK,
|
||||
"%s", host);
|
||||
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
|
||||
_(" has killed "));
|
||||
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK,
|
||||
"%s", arguments);
|
||||
if (pos_comment)
|
||||
{
|
||||
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
|
||||
_(" from server"));
|
||||
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK,
|
||||
" (");
|
||||
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
|
||||
"%s", pos_comment);
|
||||
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK,
|
||||
")\n");
|
||||
}
|
||||
else
|
||||
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT,
|
||||
_(" from server\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s host \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "", "kill");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_get_channel_modes: get channel modes
|
||||
*/
|
||||
@@ -567,6 +724,31 @@ void irc_get_channel_modes (t_irc_channel *ptr_channel, char *channel_name,
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_SECRET);
|
||||
break;
|
||||
case 'q':
|
||||
pos = NULL;
|
||||
if (parm)
|
||||
{
|
||||
pos = strchr (parm, ' ');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
}
|
||||
if (nick_host)
|
||||
irc_display_mode (ptr_channel->buffer,
|
||||
channel_name, set_flag, "q", nick_host,
|
||||
(set_flag == '+') ?
|
||||
_("sets quiet on") :
|
||||
_("removes quiet on"),
|
||||
(parm) ? parm : NULL);
|
||||
|
||||
/* look for next parameter */
|
||||
if (parm && pos)
|
||||
{
|
||||
pos++;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
parm = pos;
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
if (nick_host)
|
||||
irc_display_mode (ptr_channel->buffer,
|
||||
@@ -740,29 +922,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 +969,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -924,7 +1108,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *arguments)
|
||||
(strcasecmp (host, "chanserv") != 0) &&
|
||||
(strcasecmp (host, "memoserv") != 0))
|
||||
{
|
||||
hotlist_add (2, server->buffer);
|
||||
hotlist_add (HOTLIST_PRIVATE, server->buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
@@ -1087,7 +1271,7 @@ int
|
||||
irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
{
|
||||
char *pos, *pos2, *host2;
|
||||
char *pos_file, *pos_addr, *pos_port, *pos_size; /* for DCC */
|
||||
char *pos_file, *pos_addr, *pos_port, *pos_size, *pos_start_resume; /* for DCC */
|
||||
t_irc_channel *ptr_channel;
|
||||
t_irc_nick *ptr_nick;
|
||||
struct utsname *buf;
|
||||
@@ -1135,7 +1319,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME);
|
||||
if (strstr (pos, server->nick))
|
||||
if (irc_is_highlight (pos, server->nick))
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
|
||||
@@ -1156,56 +1340,110 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
COLOR_WIN_CHAT_NICK, "%s", host);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, " %s\n", pos);
|
||||
return 0;
|
||||
}
|
||||
else if (strncmp (pos, "\01SOUND ", 7) == 0)
|
||||
if (strncmp (pos, "\01SOUND ", 7) == 0)
|
||||
{
|
||||
pos += 7;
|
||||
pos2 = strchr (pos, '\01');
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_INFO);
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_SERVER);
|
||||
gui_printf (ptr_channel->buffer,
|
||||
_("Received a CTCP SOUND \"%s\" from "),
|
||||
pos);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_NICK,
|
||||
"%s\n", host);
|
||||
return 0;
|
||||
}
|
||||
if (strncmp (pos, "\01PING", 5) == 0)
|
||||
{
|
||||
pos += 5;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
pos2 = strchr (pos, '\01');
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
else
|
||||
pos = NULL;
|
||||
if (pos && !pos[0])
|
||||
pos = NULL;
|
||||
if (pos)
|
||||
server_sendf (server, "NOTICE %s :\01PING %s\01\r\n",
|
||||
host, pos);
|
||||
else
|
||||
server_sendf (server, "NOTICE %s :\01PING\01\r\n",
|
||||
host);
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, "CTCP ");
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, "PING ");
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s\n", host);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* unknown CTCP ? */
|
||||
pos2 = strchr (pos + 1, '\01');
|
||||
if ((pos[0] == '\01') && pos2 && (pos2[1] == '\0'))
|
||||
{
|
||||
pos++;
|
||||
pos2[0] = '\0';
|
||||
pos2 = strchr (pos, ' ');
|
||||
if (pos2)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2++;
|
||||
if (!pos2[0])
|
||||
pos2 = NULL;
|
||||
}
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, _("Unknown CTCP "));
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, "%s ", pos);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s", host);
|
||||
if (pos2)
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, ": %s\n", pos2);
|
||||
else
|
||||
gui_printf (ptr_channel->buffer, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* other message */
|
||||
ptr_nick = nick_search (ptr_channel, host);
|
||||
if (irc_is_highlight (pos, server->nick))
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
(ptr_nick) ? NULL : host,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
1, -1, 0);
|
||||
if ( (cfg_look_infobar)
|
||||
&& (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("On %s: %s> %s"),
|
||||
ptr_channel->name,
|
||||
host, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_nick = nick_search (ptr_channel, host);
|
||||
if (ptr_nick)
|
||||
{
|
||||
if (strstr (pos, server->nick))
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
1, -1, 0);
|
||||
if ( (cfg_look_infobar)
|
||||
&& (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("On %s: %s> %s"),
|
||||
ptr_channel->name,
|
||||
host, pos);
|
||||
}
|
||||
else
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s nick \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, host, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
(ptr_nick) ? NULL : host,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1234,8 +1472,19 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
pos++;
|
||||
|
||||
/* version asked by another user => answer with WeeChat version */
|
||||
if (strcmp (pos, "\01VERSION\01") == 0)
|
||||
if (strncmp (pos, "\01VERSION", 8) == 0)
|
||||
{
|
||||
pos2 = strchr (pos + 8, ' ');
|
||||
if (pos2)
|
||||
{
|
||||
while (pos2[0] == ' ')
|
||||
pos2++;
|
||||
if (pos2[0] == '\01')
|
||||
pos2 = NULL;
|
||||
else if (!pos2[0])
|
||||
pos2 = NULL;
|
||||
}
|
||||
|
||||
buf = (struct utsname *) malloc (sizeof (struct utsname));
|
||||
if (buf && (uname (buf) == 0))
|
||||
{
|
||||
@@ -1254,15 +1503,20 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
" compiled on %s%s",
|
||||
host, "\01", PACKAGE_NAME, PACKAGE_VERSION, __DATE__,
|
||||
"\01\r\n");
|
||||
irc_display_prefix (server->buffer, PREFIX_INFO);
|
||||
irc_display_prefix (server->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("Received a "));
|
||||
COLOR_WIN_CHAT, "CTCP ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, _("CTCP VERSION "));
|
||||
COLOR_WIN_CHAT_CHANNEL, "VERSION ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("from"));
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s\n", host);
|
||||
COLOR_WIN_CHAT_NICK, " %s", host);
|
||||
if (pos2)
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, ": %s\n", pos2);
|
||||
else
|
||||
gui_printf (server->buffer, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1285,6 +1539,15 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
else
|
||||
server_sendf (server, "NOTICE %s :\01PING\01\r\n",
|
||||
host);
|
||||
irc_display_prefix (server->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, "CTCP ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, "PING ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s\n", host);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1356,9 +1619,123 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
dcc_add (server, DCC_FILE_RECV, (unsigned long) atol (pos_addr),
|
||||
dcc_add (server, DCC_FILE_RECV, strtoul (pos_addr, NULL, 10),
|
||||
atoi (pos_port), host, -1, pos_file, NULL,
|
||||
(unsigned long) atol (pos_size));
|
||||
strtoul (pos_size, NULL, 10));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* incoming DCC RESUME (asked by receiver) */
|
||||
if (strncmp (pos, "\01DCC RESUME", 11) == 0)
|
||||
{
|
||||
/* check if DCC RESUME is ok, i.e. with 0x01 at end */
|
||||
pos2 = strchr (pos + 1, '\01');
|
||||
if (!pos2)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2[0] = '\0';
|
||||
|
||||
/* DCC filename */
|
||||
pos_file = pos + 11;
|
||||
while (pos_file[0] == ' ')
|
||||
pos_file++;
|
||||
|
||||
/* look for resume start position */
|
||||
pos_start_resume = strrchr (pos_file, ' ');
|
||||
if (!pos_start_resume)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2 = pos_start_resume;
|
||||
pos_start_resume++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
/* look for DCC port */
|
||||
pos_port = strrchr (pos_file, ' ');
|
||||
if (!pos_port)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2 = pos_port;
|
||||
pos_port++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
dcc_accept_resume (server, pos_file, atoi (pos_port),
|
||||
strtoul (pos_start_resume, NULL, 10));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* incoming DCC ACCEPT (resume accepted by sender) */
|
||||
if (strncmp (pos, "\01DCC ACCEPT", 11) == 0)
|
||||
{
|
||||
/* check if DCC ACCEPT is ok, i.e. with 0x01 at end */
|
||||
pos2 = strchr (pos + 1, '\01');
|
||||
if (!pos2)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2[0] = '\0';
|
||||
|
||||
/* DCC filename */
|
||||
pos_file = pos + 11;
|
||||
while (pos_file[0] == ' ')
|
||||
pos_file++;
|
||||
|
||||
/* look for resume start position */
|
||||
pos_start_resume = strrchr (pos_file, ' ');
|
||||
if (!pos_start_resume)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2 = pos_start_resume;
|
||||
pos_start_resume++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
/* look for DCC port */
|
||||
pos_port = strrchr (pos_file, ' ');
|
||||
if (!pos_port)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot parse \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "privmsg");
|
||||
return -1;
|
||||
}
|
||||
pos2 = pos_port;
|
||||
pos_port++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2--;
|
||||
pos2[1] = '\0';
|
||||
|
||||
dcc_start_resume (server, pos_file, atoi (pos_port),
|
||||
strtoul (pos_start_resume, NULL, 10));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1424,7 +1801,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
return -1;
|
||||
}
|
||||
|
||||
dcc_add (server, DCC_CHAT_RECV, (unsigned long) atol (pos_addr),
|
||||
dcc_add (server, DCC_CHAT_RECV, strtoul (pos_addr, NULL, 10),
|
||||
atoi (pos_port), host, -1, NULL, NULL, 0);
|
||||
|
||||
return 0;
|
||||
@@ -1454,7 +1831,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
if (pos2)
|
||||
pos2[0] = '\0';
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME);
|
||||
if (strstr (pos, server->nick))
|
||||
if (irc_is_highlight (pos, server->nick))
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
|
||||
@@ -1478,33 +1855,68 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (strstr (pos, server->nick))
|
||||
/* unknown CTCP ? */
|
||||
pos2 = strchr (pos + 1, '\01');
|
||||
if ((pos[0] == '\01') && pos2 && (pos2[1] == '\0'))
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", host);
|
||||
if ( (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("Private %s> %s"),
|
||||
host, pos);
|
||||
pos++;
|
||||
pos2[0] = '\0';
|
||||
pos2 = strchr (pos, ' ');
|
||||
if (pos2)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2++;
|
||||
if (!pos2[0])
|
||||
pos2 = NULL;
|
||||
}
|
||||
irc_display_prefix (server->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("Unknown CTCP "));
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL, "%s ", pos);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, _("received from"));
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_NICK, " %s", host);
|
||||
if (pos2)
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, ": %s\n", pos2);
|
||||
else
|
||||
gui_printf (server->buffer, "\n");
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_PRIVATE,
|
||||
"%s", host);
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
if (irc_is_highlight (pos, server->nick))
|
||||
{
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", host);
|
||||
if ( (cfg_look_infobar_delay_highlight > 0)
|
||||
&& (ptr_channel->buffer != gui_current_window->buffer) )
|
||||
gui_infobar_printf (cfg_look_infobar_delay_highlight,
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("Private %s> %s"),
|
||||
host, pos);
|
||||
}
|
||||
else
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_PRIVATE,
|
||||
"%s", host);
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1792,7 +2204,14 @@ irc_cmd_recv_004 (t_irc_server *server, char *host, char *arguments)
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
server_sendf (server, "JOIN %s\r\n", ptr_channel->name);
|
||||
{
|
||||
if (ptr_channel->key)
|
||||
server_sendf (server, "JOIN %s %s\r\n",
|
||||
ptr_channel->name, ptr_channel->key);
|
||||
else
|
||||
server_sendf (server, "JOIN %s\r\n",
|
||||
ptr_channel->name);
|
||||
}
|
||||
}
|
||||
server->reconnect_join = 0;
|
||||
}
|
||||
@@ -1994,6 +2413,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 +3308,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 +3493,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 +3683,7 @@ irc_cmd_recv_366 (t_irc_server *server, char *host, char *arguments)
|
||||
|
||||
for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
|
||||
MSG_TYPE_MSG, 0, 0, 1);
|
||||
if (ptr_nick != ptr_channel->last_nick)
|
||||
gui_printf (ptr_channel->buffer, " ");
|
||||
@@ -3511,3 +4034,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;
|
||||
}
|
||||
|
||||
+203
-62
@@ -29,6 +29,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <sys/utsname.h>
|
||||
@@ -81,6 +82,61 @@ irc_cmd_send_admin (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_amsg: send message to all channels of all connected servers
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_amsg (t_irc_server *server, char *arguments)
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
t_irc_channel *ptr_channel;
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) server;
|
||||
|
||||
if (arguments)
|
||||
{
|
||||
gui_add_hotlist = 0;
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (ptr_server->is_connected)
|
||||
{
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
{
|
||||
server_sendf (ptr_server, "PRIVMSG %s :%s\r\n",
|
||||
ptr_channel->name, arguments);
|
||||
ptr_nick = nick_search (ptr_channel, ptr_server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_color (ptr_channel->buffer,
|
||||
COLOR_WIN_CHAT, "%s\n", arguments);
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (ptr_server->buffer, PREFIX_ERROR);
|
||||
gui_printf (ptr_server->buffer,
|
||||
_("%s cannot find nick for sending message\n"),
|
||||
WEECHAT_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
gui_add_hotlist = 1;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_away: toggle away status
|
||||
*/
|
||||
@@ -94,6 +150,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 +176,9 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer),
|
||||
"is back (gone %.2ld:%.2ld:%.2ld)",
|
||||
elapsed / 3600,
|
||||
(elapsed / 60) % 60,
|
||||
elapsed % 60);
|
||||
(long int)(elapsed / 3600),
|
||||
(long int)((elapsed / 60) % 60),
|
||||
(long int)(elapsed % 60));
|
||||
irc_send_me_all_channels (ptr_server, buffer);
|
||||
}
|
||||
}
|
||||
@@ -159,9 +216,9 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer),
|
||||
"is back (gone %.2ld:%.2ld:%.2ld)",
|
||||
elapsed / 3600,
|
||||
(elapsed / 60) % 60,
|
||||
elapsed % 60);
|
||||
(long int)(elapsed / 3600),
|
||||
(long int)((elapsed / 60) % 60),
|
||||
(long int)(elapsed % 60));
|
||||
irc_send_me_all_channels (server, buffer);
|
||||
}
|
||||
}
|
||||
@@ -184,6 +241,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;
|
||||
}
|
||||
|
||||
@@ -272,53 +330,67 @@ irc_cmd_send_ban (t_irc_server *server, char *arguments)
|
||||
int
|
||||
irc_cmd_send_ctcp (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *pos, *pos2;
|
||||
char *pos_type, *pos_args, *pos;
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
|
||||
pos = strchr (arguments, ' ');
|
||||
if (pos)
|
||||
pos_type = strchr (arguments, ' ');
|
||||
if (pos_type)
|
||||
{
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
pos2 = strchr (pos, ' ');
|
||||
if (pos2)
|
||||
pos_type[0] = '\0';
|
||||
pos_type++;
|
||||
while (pos_type[0] == ' ')
|
||||
pos_type++;
|
||||
pos_args = strchr (pos_type, ' ');
|
||||
if (pos_args)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2++;
|
||||
while (pos2[0] == ' ')
|
||||
pos2++;
|
||||
pos_args[0] = '\0';
|
||||
pos_args++;
|
||||
while (pos_args[0] == ' ')
|
||||
pos_args++;
|
||||
}
|
||||
else
|
||||
pos2 = NULL;
|
||||
pos_args = NULL;
|
||||
|
||||
if (strcasecmp (pos, "version") == 0)
|
||||
pos = pos_type;
|
||||
while (pos[0])
|
||||
{
|
||||
if (pos2)
|
||||
server_sendf (server, "PRIVMSG %s :\01VERSION %s\01\r\n",
|
||||
arguments, pos2);
|
||||
else
|
||||
server_sendf (server, "PRIVMSG %s :\01VERSION\01\r\n",
|
||||
arguments);
|
||||
pos[0] = toupper (pos[0]);
|
||||
pos++;
|
||||
}
|
||||
if (strcasecmp (pos, "action") == 0)
|
||||
{
|
||||
if (pos2)
|
||||
server_sendf (server, "PRIVMSG %s :\01ACTION %s\01\r\n",
|
||||
arguments, pos2);
|
||||
else
|
||||
server_sendf (server, "PRIVMSG %s :\01ACTION\01\r\n",
|
||||
arguments);
|
||||
}
|
||||
if (strcasecmp (pos, "ping") == 0)
|
||||
|
||||
irc_display_prefix (server->buffer, PREFIX_SERVER);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT, "CTCP");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, "(");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, "%s", arguments);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, ")");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT, ": ");
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%s", pos_type);
|
||||
|
||||
if ((strcasecmp (pos_type, "ping") == 0) && (!pos_args))
|
||||
{
|
||||
gettimeofday (&tv, &tz);
|
||||
server_sendf (server, "PRIVMSG %s :\01PING %d %d\01\r\n",
|
||||
arguments, tv.tv_sec, tv.tv_usec);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT, " %d %d\n",
|
||||
tv.tv_sec, tv.tv_usec);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pos_args)
|
||||
{
|
||||
server_sendf (server, "PRIVMSG %s :\01%s %s\01\r\n",
|
||||
arguments, pos_type, pos_args);
|
||||
gui_printf_color (server->buffer, COLOR_WIN_CHAT, " %s\n",
|
||||
pos_args);
|
||||
}
|
||||
else
|
||||
{
|
||||
server_sendf (server, "PRIVMSG %s :\01%s\01\r\n",
|
||||
arguments, pos_type);
|
||||
gui_printf (server->buffer, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -412,10 +484,17 @@ irc_cmd_send_dehalfop (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s -h %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s -h %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -438,10 +517,17 @@ irc_cmd_send_deop (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s -o %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s -o %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -464,10 +550,17 @@ irc_cmd_send_devoice (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s -v %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s -v %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -505,10 +598,17 @@ irc_cmd_send_halfop (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s +h %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s +h %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -578,7 +678,10 @@ irc_cmd_send_ison (t_irc_server *server, char *arguments)
|
||||
int
|
||||
irc_cmd_send_join (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "JOIN %s\r\n", arguments);
|
||||
if (string_is_channel (arguments))
|
||||
server_sendf (server, "JOIN %s\r\n", arguments);
|
||||
else
|
||||
server_sendf (server, "JOIN #%s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -874,7 +977,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
ptr_nick = nick_search (ptr_channel, server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
@@ -899,7 +1002,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
ptr_nick = nick_search (ptr_channel, server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_type_color (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
@@ -1031,9 +1134,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 +1239,7 @@ irc_cmd_send_oper (t_irc_server *server, char *arguments)
|
||||
int
|
||||
irc_cmd_send_part (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *channel_name, *pos_args;
|
||||
char *channel_name, *pos_args, *ptr_arg, *pos, buffer[4096];
|
||||
t_irc_channel *ptr_channel;
|
||||
|
||||
if (arguments)
|
||||
@@ -1171,16 +1293,28 @@ irc_cmd_send_part (t_irc_server *server, char *arguments)
|
||||
pos_args = NULL;
|
||||
}
|
||||
|
||||
if (pos_args)
|
||||
server_sendf (server, "PART %s :%s\r\n", channel_name, pos_args);
|
||||
else
|
||||
ptr_arg = (pos_args) ? pos_args :
|
||||
(cfg_irc_default_msg_part && cfg_irc_default_msg_part[0]) ?
|
||||
cfg_irc_default_msg_part : NULL;
|
||||
|
||||
if (ptr_arg)
|
||||
{
|
||||
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
|
||||
server_sendf (server, "PART %s :%s\r\n",
|
||||
channel_name, cfg_irc_default_msg_part);
|
||||
pos = strstr (ptr_arg, "%v");
|
||||
if (pos)
|
||||
{
|
||||
pos[0] = '\0';
|
||||
snprintf (buffer, sizeof (buffer), "%s%s%s",
|
||||
ptr_arg, PACKAGE_VERSION, pos + 2);
|
||||
pos[0] = '%';
|
||||
}
|
||||
else
|
||||
server_sendf (server, "PART %s\r\n", channel_name);
|
||||
snprintf (buffer, sizeof (buffer), "%s",
|
||||
ptr_arg);
|
||||
server_sendf (server, "PART %s :%s\r\n",
|
||||
channel_name, buffer);
|
||||
}
|
||||
else
|
||||
server_sendf (server, "PART %s\r\n", channel_name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1657,10 +1791,17 @@ irc_cmd_send_voice (t_irc_server *server, int argc, char **argv)
|
||||
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argc == 0)
|
||||
server_sendf (server, "MODE %s +v %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
server->nick);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s +v %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+641
-70
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* irc-server.c: (dis)connection and communication with irc server */
|
||||
/* irc-server.c: connection and communication with IRC server */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -39,6 +39,10 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
#include <gnutls/gnutls.h>
|
||||
#endif
|
||||
|
||||
#include "../common/weechat.h"
|
||||
#include "irc.h"
|
||||
#include "../common/weeconfig.h"
|
||||
@@ -67,6 +71,8 @@ server_init (t_irc_server *server)
|
||||
server->command_line = 0;
|
||||
server->address = NULL;
|
||||
server->port = -1;
|
||||
server->ipv6 = 0;
|
||||
server->ssl = 0;
|
||||
server->password = NULL;
|
||||
server->nick1 = NULL;
|
||||
server->nick2 = NULL;
|
||||
@@ -77,6 +83,7 @@ server_init (t_irc_server *server)
|
||||
server->command_delay = 1;
|
||||
server->autojoin = NULL;
|
||||
server->autorejoin = 0;
|
||||
server->notify_levels = NULL;
|
||||
|
||||
/* internal vars */
|
||||
server->child_pid = 0;
|
||||
@@ -84,6 +91,9 @@ server_init (t_irc_server *server)
|
||||
server->child_write = -1;
|
||||
server->sock = -1;
|
||||
server->is_connected = 0;
|
||||
#ifdef HAVE_GNUTLS
|
||||
server->ssl_connected = 0;
|
||||
#endif
|
||||
server->unterminated_message = NULL;
|
||||
server->nick = NULL;
|
||||
server->reconnect_start = 0;
|
||||
@@ -110,30 +120,54 @@ int
|
||||
server_init_with_url (char *irc_url, t_irc_server *server)
|
||||
{
|
||||
char *url, *pos_server, *pos_channel, *pos, *pos2;
|
||||
int ipv6, ssl;
|
||||
struct passwd *my_passwd;
|
||||
|
||||
server_init (server);
|
||||
if (strncasecmp (irc_url, "irc://", 6) != 0)
|
||||
ipv6 = 0;
|
||||
ssl = 0;
|
||||
if (strncasecmp (irc_url, "irc6://", 7) == 0)
|
||||
{
|
||||
pos = irc_url + 7;
|
||||
ipv6 = 1;
|
||||
}
|
||||
else if (strncasecmp (irc_url, "ircs://", 7) == 0)
|
||||
{
|
||||
pos = irc_url + 7;
|
||||
ssl = 1;
|
||||
}
|
||||
else if ((strncasecmp (irc_url, "irc6s://", 8) == 0)
|
||||
|| (strncasecmp (irc_url, "ircs6://", 8) == 0))
|
||||
{
|
||||
pos = irc_url + 8;
|
||||
ipv6 = 1;
|
||||
ssl = 1;
|
||||
}
|
||||
else if (strncasecmp (irc_url, "irc://", 6) == 0)
|
||||
{
|
||||
pos = irc_url + 6;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
url = strdup (irc_url);
|
||||
|
||||
url = strdup (pos);
|
||||
pos_server = strchr (url, '@');
|
||||
if (pos_server)
|
||||
{
|
||||
pos_server[0] = '\0';
|
||||
pos_server++;
|
||||
pos = url + 6;
|
||||
if (!pos[0])
|
||||
{
|
||||
free (url);
|
||||
return -1;
|
||||
}
|
||||
pos2 = strchr (pos, ':');
|
||||
pos2 = strchr (url, ':');
|
||||
if (pos2)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
server->password = strdup (pos2 + 1);
|
||||
}
|
||||
server->nick1 = strdup (pos);
|
||||
server->nick1 = strdup (url);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -148,7 +182,7 @@ server_init_with_url (char *irc_url, t_irc_server *server)
|
||||
free (url);
|
||||
return -1;
|
||||
}
|
||||
pos_server = url + 6;
|
||||
pos_server = url;
|
||||
}
|
||||
if (!pos_server[0])
|
||||
{
|
||||
@@ -183,6 +217,9 @@ server_init_with_url (char *irc_url, t_irc_server *server)
|
||||
|
||||
free (url);
|
||||
|
||||
server->ipv6 = ipv6;
|
||||
server->ssl = ssl;
|
||||
|
||||
/* some default values */
|
||||
if (server->port < 0)
|
||||
server->port = DEFAULT_IRC_PORT;
|
||||
@@ -256,6 +293,10 @@ server_destroy (t_irc_server *server)
|
||||
free (server->command);
|
||||
if (server->autojoin)
|
||||
free (server->autojoin);
|
||||
if (server->notify_levels)
|
||||
free (server->notify_levels);
|
||||
if (server->unterminated_message)
|
||||
free (server->unterminated_message);
|
||||
if (server->nick)
|
||||
free (server->nick);
|
||||
if (server->channels)
|
||||
@@ -312,26 +353,26 @@ server_free_all ()
|
||||
|
||||
t_irc_server *
|
||||
server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_delay,
|
||||
int command_line, char *address, int port, char *password,
|
||||
int command_line, char *address, int port, int ipv6, int ssl, char *password,
|
||||
char *nick1, char *nick2, char *nick3, char *username,
|
||||
char *realname, char *command, int command_delay, char *autojoin,
|
||||
int autorejoin)
|
||||
int autorejoin, char *notify_levels)
|
||||
{
|
||||
t_irc_server *new_server;
|
||||
|
||||
if (!name || !address || (port < 0))
|
||||
return NULL;
|
||||
|
||||
#ifdef DEBUG
|
||||
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);
|
||||
|
||||
+50
-7
@@ -21,9 +21,18 @@
|
||||
#ifndef __WEECHAT_IRC_H
|
||||
#define __WEECHAT_IRC_H 1
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
#include <gnutls/gnutls.h>
|
||||
#endif
|
||||
|
||||
#include "../gui/gui.h"
|
||||
|
||||
/* prefixes for chat window */
|
||||
@@ -89,7 +98,7 @@ struct t_irc_nick
|
||||
int is_chanowner; /* chan owner? (specific to unrealircd) */
|
||||
int is_chanadmin; /* chan admin? (specific to unrealircd) */
|
||||
int is_op; /* operator privileges? */
|
||||
int is_halfop; /* half operaor privileges? */
|
||||
int is_halfop; /* half operator privileges? */
|
||||
int has_voice; /* nick has voice? */
|
||||
int is_away; /* = 1 if nick is away, otherwise 0 */
|
||||
int color; /* color for nickname in chat window */
|
||||
@@ -137,23 +146,31 @@ struct t_irc_server
|
||||
int command_line; /* server was given on command line */
|
||||
char *address; /* address of server (IP or name) */
|
||||
int port; /* port for server (6667 by default) */
|
||||
int ipv6; /* use IPv6 protocol */
|
||||
int ssl; /* SSL protocol */
|
||||
char *password; /* password for server */
|
||||
char *nick1; /* first nickname for the server */
|
||||
char *nick2; /* alternate nickname */
|
||||
char *nick3; /* 2nd alternate nickname */
|
||||
char *username; /* user name */
|
||||
char *realname; /* real name */
|
||||
char *command; /* command to run once connected */
|
||||
char *command; /* command to run once connected */
|
||||
int command_delay; /* delay after execution of command */
|
||||
char *autojoin; /* channels to automatically join */
|
||||
char *autojoin; /* channels to automatically join */
|
||||
int autorejoin; /* auto rejoin channels when kicked */
|
||||
char *notify_levels; /* channels notify levels */
|
||||
|
||||
/* internal vars */
|
||||
pid_t child_pid; /* pid of child process (connecting) */
|
||||
int child_read; /* to read into child pipe */
|
||||
int child_write; /* to write into child pipe */
|
||||
int sock; /* socket for server */
|
||||
int sock; /* socket for server (IPv4 or IPv6) */
|
||||
int is_connected; /* 1 if WeeChat is connected to server */
|
||||
#ifdef HAVE_GNUTLS
|
||||
int ssl_connected; /* = 1 if connected with SSL */
|
||||
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
|
||||
#endif
|
||||
|
||||
char *unterminated_message; /* beginning of a message in input buf */
|
||||
char *nick; /* current nickname */
|
||||
time_t reconnect_start; /* this time + delay = reconnect time */
|
||||
@@ -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,11 @@ struct t_irc_dcc
|
||||
unsigned long size; /* file size */
|
||||
unsigned long pos; /* number of bytes received/sent */
|
||||
unsigned long ack; /* number of bytes received OK */
|
||||
unsigned long start_resume; /* start of resume (in bytes) */
|
||||
time_t last_check_time; /* last time we looked at bytes sent/rcv*/
|
||||
unsigned long last_check_pos; /* bytes sent/recv at last check */
|
||||
unsigned long bytes_per_sec; /* bytes per second */
|
||||
time_t last_activity; /* time of last byte received/sent */
|
||||
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
|
||||
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
|
||||
};
|
||||
@@ -244,9 +267,9 @@ extern t_irc_server *server_alloc ();
|
||||
extern void server_destroy (t_irc_server *);
|
||||
extern void server_free (t_irc_server *);
|
||||
extern void server_free_all ();
|
||||
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, char *,
|
||||
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, int, int,
|
||||
char *, char *, char *, char *, char *, char *,
|
||||
int, char *, int);
|
||||
char *, int, char *, int, char *);
|
||||
extern int server_send (t_irc_server *, char *, int);
|
||||
extern void server_sendf (t_irc_server *, char *, ...);
|
||||
extern void server_recv (t_irc_server *);
|
||||
@@ -264,6 +287,15 @@ extern void server_check_away ();
|
||||
extern void server_set_away (t_irc_server *, char *, int);
|
||||
extern void server_print_log (t_irc_server *);
|
||||
|
||||
/* proxy functions (irc-server.c) */
|
||||
extern void convbase64_8x3_to_6x4(char *from, char* to);
|
||||
extern void base64encode(char *from, char *to);
|
||||
extern int pass_httpproxy(t_irc_server *server);
|
||||
extern int resolve(char *hostname, char *ip, int *version);
|
||||
extern int pass_socks4proxy(t_irc_server *server);
|
||||
extern int pass_socks5proxy(t_irc_server *server);
|
||||
extern int pass_proxy(t_irc_server *server);
|
||||
|
||||
/* channel functions (irc-channel.c) */
|
||||
|
||||
extern t_irc_channel *channel_new (t_irc_server *, int, char *, int);
|
||||
@@ -276,6 +308,9 @@ extern void channel_check_away (t_irc_server *, t_irc_channel *);
|
||||
extern void channel_set_away (t_irc_channel *, char *, int);
|
||||
extern int channel_create_dcc (t_irc_dcc *);
|
||||
extern void channel_remove_dcc (t_irc_dcc *);
|
||||
extern int channel_get_notify_level (t_irc_server *, t_irc_channel *);
|
||||
extern void channel_remove_notify_level (t_irc_server *, t_irc_channel *);
|
||||
extern void channel_set_notify_level (t_irc_server *, t_irc_channel *, int);
|
||||
extern void channel_print_log (t_irc_channel *);
|
||||
|
||||
/* nick functions (irc-nick.c) */
|
||||
@@ -297,6 +332,8 @@ extern void dcc_redraw (int);
|
||||
extern void dcc_free (t_irc_dcc *);
|
||||
extern void dcc_close (t_irc_dcc *, int);
|
||||
extern void dcc_accept (t_irc_dcc *);
|
||||
extern void dcc_accept_resume (t_irc_server *, char *, int, unsigned long);
|
||||
extern void dcc_start_resume (t_irc_server *, char *, int, unsigned long);
|
||||
extern t_irc_dcc *dcc_add (t_irc_server *, int, unsigned long, int, char *, int,
|
||||
char *, char *, unsigned long);
|
||||
extern void dcc_send_request (t_irc_server *, int, char *, char *);
|
||||
@@ -307,17 +344,19 @@ extern void dcc_end ();
|
||||
/* IRC display (irc-diplay.c) */
|
||||
|
||||
extern void irc_display_prefix (/*@null@*/ t_gui_buffer *, char *);
|
||||
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, int, int, int, int);
|
||||
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, char *, int, int, int, int);
|
||||
extern void irc_display_mode (t_gui_buffer *, char *, char, char *, char *,
|
||||
char *, char *);
|
||||
extern void irc_display_server (t_irc_server *ptr_server);
|
||||
|
||||
/* IRC protocol (irc-commands.c) */
|
||||
|
||||
extern int irc_is_highlight (char *, char *);
|
||||
extern int irc_recv_command (t_irc_server *, char *, char *, char *, char *);
|
||||
extern void irc_login (t_irc_server *);
|
||||
/* IRC commands issued by user */
|
||||
extern int irc_cmd_send_admin (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_amsg (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_away (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ban (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ctcp (t_irc_server *, char *);
|
||||
@@ -379,6 +418,7 @@ extern int irc_cmd_recv_error (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_invite (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_join (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_kick (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_kill (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_mode (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_nick (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_notice (t_irc_server *, char *, char *);
|
||||
@@ -397,6 +437,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 +455,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 +465,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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+443
-35
@@ -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,9 +350,11 @@ 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;
|
||||
char *arg, *info = NULL, *server_name;
|
||||
t_irc_server *ptr_server;
|
||||
int integer;
|
||||
dXSARGS;
|
||||
@@ -344,18 +364,15 @@ static XS (XS_IRC_get_info)
|
||||
|
||||
if (items == 2)
|
||||
{
|
||||
server = SvPV (ST (0), integer);
|
||||
server_name = SvPV (ST (0), integer);
|
||||
arg = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
ptr_server = server_search (server_name);
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
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
|
||||
@@ -364,14 +381,13 @@ static XS (XS_IRC_get_info)
|
||||
arg = SvPV (ST (0), integer);
|
||||
}
|
||||
|
||||
if (ptr_server && arg)
|
||||
if (arg)
|
||||
{
|
||||
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) ) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
@@ -381,7 +397,7 @@ static XS (XS_IRC_get_info)
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) ) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
@@ -390,7 +406,7 @@ static XS (XS_IRC_get_info)
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
|
||||
{
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
@@ -406,6 +422,383 @@ 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);
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s error: server not found for \"%s\" function\n"),
|
||||
"Perl", "get_info");
|
||||
XSRETURN_NO;
|
||||
}
|
||||
}
|
||||
else
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
|
||||
arg = SvPV (ST (0), integer);
|
||||
if (arg)
|
||||
{
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( ptr_server && ( (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 ( ptr_server && ( (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 ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
|
||||
{
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
return;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "100") == 0) || (strcasecmp (arg, "dccs") == 0) )
|
||||
{
|
||||
int nItems = 0;
|
||||
t_irc_dcc *p = dcc_list;
|
||||
|
||||
POPs;
|
||||
if (items == 2)
|
||||
POPs;
|
||||
|
||||
for(; p; p = p->next_dcc)
|
||||
{
|
||||
HV *infohash = (HV *) sv_2mortal((SV *) newHV());
|
||||
hv_store (infohash, "address32", 9, newSViv(p->addr), 0);
|
||||
hv_store (infohash, "cps", 3, newSViv(p->bytes_per_sec), 0);
|
||||
hv_store (infohash, "remote_file", 11, newSVpv(p->filename, 0), 0);
|
||||
hv_store (infohash, "local_file", 10, newSVpv(p->local_filename, 0), 0);
|
||||
hv_store (infohash, "nick", 4, newSVpv(p->nick, 0), 0);
|
||||
hv_store (infohash, "port", 4, newSViv(p->port), 0);
|
||||
hv_store (infohash, "pos", 3, newSVnv(p->pos), 0);
|
||||
hv_store (infohash, "size", 4, newSVnv(p->size), 0);
|
||||
hv_store (infohash, "status", 6, newSViv(p->status), 0);
|
||||
hv_store (infohash, "type", 4, newSViv(p->type), 0);
|
||||
|
||||
XPUSHs(newRV((SV *) infohash));
|
||||
++nItems;
|
||||
}
|
||||
XSRETURN(nItems);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info)
|
||||
XST_mPV (0, info);
|
||||
else
|
||||
XST_mPV (0, "");
|
||||
}
|
||||
|
||||
XSRETURN (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* xs_init: initialize subroutines
|
||||
*/
|
||||
@@ -414,6 +807,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 +817,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 +837,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 +855,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 +929,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 +939,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 +961,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 +1012,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 +1029,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
@@ -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
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,736 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
else if ( (strcasecmp (arg, "100") == 0) || (strcasecmp (arg, "dccs") == 0) )
|
||||
{
|
||||
t_irc_dcc *p = dcc_list;
|
||||
int nbdccs = 0;
|
||||
|
||||
for(; p; p = p->next_dcc)
|
||||
nbdccs++;
|
||||
|
||||
if (nbdccs == 0)
|
||||
return Py_None;
|
||||
|
||||
PyObject *list = PyList_New(nbdccs);
|
||||
|
||||
if (!list)
|
||||
return Py_None;
|
||||
|
||||
PyObject *listvalue;
|
||||
|
||||
int pos = 0;
|
||||
for(; p; p = p->next_dcc)
|
||||
{
|
||||
listvalue = Py_BuildValue("{s:k,s:k,s:s,s:s,s:s,s:i,s:k,s:k,s:i,s:i}",
|
||||
"address32", p->addr,
|
||||
"cps", p->bytes_per_sec,
|
||||
"remote_file", p->filename,
|
||||
"local_file", p->local_filename,
|
||||
"nick", p->nick,
|
||||
"port", p->port,
|
||||
"pos", p->pos,
|
||||
"size", p->size,
|
||||
"status", p->status,
|
||||
"type", p->type);
|
||||
if (listvalue)
|
||||
{
|
||||
if (PyList_SetItem(list, pos, listvalue) != 0)
|
||||
{
|
||||
PyMem_Free(listvalue);
|
||||
PyMem_Free(list);
|
||||
return Py_None;
|
||||
}
|
||||
}
|
||||
else
|
||||
return Py_None;
|
||||
pos++;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
if (info)
|
||||
return Py_BuildValue ("s", info);
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -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 */
|
||||
+12
-6
@@ -1,5 +1,5 @@
|
||||
%define name weechat
|
||||
%define version 0.1.1
|
||||
%define version 0.1.4
|
||||
%define release 1
|
||||
|
||||
Name: %{name}
|
||||
@@ -10,7 +10,7 @@ Source: http://weechat.flashtux.org/download/%{name}-%{version}.tar.gz
|
||||
URL: http://weechat.flashtux.org
|
||||
Group: Networking/IRC
|
||||
BuildRoot: %{_tmppath}/%{name}-buildroot
|
||||
Requires: perl
|
||||
Requires: perl, python, libgnutls
|
||||
License: GPL
|
||||
|
||||
%description
|
||||
@@ -23,15 +23,15 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure --enable-perl
|
||||
./configure --enable-perl --enable-python
|
||||
make DESTDIR="$RPM_BUILD_ROOT" LOCALRPM="local"
|
||||
|
||||
%install
|
||||
%install
|
||||
make DESTDIR="$RPM_BUILD_ROOT" LOCALRPM="local" install
|
||||
|
||||
%find_lang %name
|
||||
|
||||
%clean
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f %{name}.lang
|
||||
@@ -40,7 +40,13 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/local/man/man1/weechat-curses.1*
|
||||
/usr/local/bin/weechat-curses
|
||||
|
||||
%changelog
|
||||
%changelog
|
||||
* Sat Jul 30 2005 FlashCode <flashcode@flashtux.org> 0.1.4-1
|
||||
- Released version 0.1.4
|
||||
* Sat Jul 02 2005 FlashCode <flashcode@flashtux.org> 0.1.3-1
|
||||
- Released version 0.1.3
|
||||
* Sat May 21 2005 FlashCode <flashcode@flashtux.org> 0.1.2-1
|
||||
- Released version 0.1.2
|
||||
* Sat Mar 20 2005 FlashCode <flashcode@flashtux.org> 0.1.1-1
|
||||
- Released version 0.1.1
|
||||
* Sat Feb 12 2005 FlashCode <flashcode@flashtux.org> 0.1.0-1
|
||||
|
||||
@@ -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
@@ -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
@@ -1,12 +1,9 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2005-02-12
|
||||
WeeChat known bugs, 2005-07-30
|
||||
|
||||
- ./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
|
||||
|
||||
+60
-1
@@ -1,9 +1,68 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-03-20
|
||||
ChangeLog - 2005-07-30
|
||||
|
||||
|
||||
Version 0.1.4 (2005-07-30):
|
||||
* join and part/quit prefixes (arrows) now displayed with different colors
|
||||
* added "irc_highlight" setting, to get highlight with any word
|
||||
* fixed auto-rejoin for channels with key
|
||||
* fixed /ctcp command (now any command/data allowed)
|
||||
* added /amsg command (send text to all channels of all connected servers)
|
||||
* fixed SIGSEGV handler (now write a core file by aborting program)
|
||||
* fixed statusbar & infobar background refresh problem with some systems
|
||||
* added color for private in hotlist (different than color for highlight)
|
||||
* added DCC resume and timeout
|
||||
* added function for Perl/Python to get DCC list
|
||||
* fixed FIFO pipe (command now authorized on a buffer not connected
|
||||
to an IRC server)
|
||||
* topic completion now decodes UTF-8 string
|
||||
* fixed bug with IRC URL on command line (irc://)
|
||||
* new keyboard management: keys are setup in config file, new command
|
||||
/key was added and some new default keys were added, alt-k key is
|
||||
used to grab key (useful for /key command)
|
||||
* added seconds in infobar time (optional thanks to new setting)
|
||||
* fixed some curses refreshs
|
||||
* channels auto-prefixed by "#" (if no prefix found) for /join command
|
||||
|
||||
Version 0.1.3 (2005-07-02):
|
||||
* proxy support (http, socks4, socks5) with authentification (http, socks5)
|
||||
and ipv6 support (client to proxy)
|
||||
* completion added for config option (with /set command)
|
||||
* commands from users outside channel now authorized (if special user or
|
||||
channel without "n" flag)
|
||||
* added IPv6 support
|
||||
* kill command now received and displayed
|
||||
* added SSL support
|
||||
* channel notify levels are saved in config file (new option
|
||||
"server_notify_levels" for server sections)
|
||||
* part message now accepts %v (replaced by WeeChat version), like quit message
|
||||
* errors while loading perl scripts are now displayed in server buffer
|
||||
(instead of current buffer)
|
||||
* in python scripts, all messages written in stdin and stderr are redirected
|
||||
in server buffer
|
||||
* fix a filename error while loading a python script manually
|
||||
* fixed plugins "print" and "prnt" functions: now ok for writing on server
|
||||
buffers
|
||||
* fixed color problem with new libcurses version
|
||||
* fixed crash when using Alt-S or Alt-X on DCC buffer (Alt-D)
|
||||
* fixed startup crash when config file (~/.weechat/weechat.rc) is not found
|
||||
* improved Perl/Python libs detection for ./configure script
|
||||
|
||||
Version 0.1.2 (2005-05-21):
|
||||
* added Python plugin support, improved Perl interface (and now Perl/Python
|
||||
libraries are checked by configure script)
|
||||
* 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
|
||||
|
||||
+45
-15
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-02-06
|
||||
WeeChat FAQ, 2005-07-30
|
||||
=======================
|
||||
|
||||
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,18 @@ 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),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* many GUI (Curses, Gtk, wxWidgets, Qt)
|
||||
* nicklist available in all GUI
|
||||
* extensible with scripts (Perl, Python, Ruby)
|
||||
* horizontal and vertical window split
|
||||
* infobar highlight
|
||||
* FIFO pipe for remote control
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
This is the "geekest" IRC client ;)
|
||||
|
||||
More info on this page: http://weechat.flashtux.org/features.php
|
||||
|
||||
|
||||
2.2
|
||||
@@ -61,6 +69,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
|
||||
@@ -78,7 +87,9 @@ A: You have to setup charset used for decoding, encoding, and internal WeeChat
|
||||
================================================================================
|
||||
Q: How can I customize key bindings?
|
||||
|
||||
A: Today you can't do that. This is planed for a future version.
|
||||
A: Key bindings are customizable with /key command.
|
||||
Default key Meta-k (usually Alt-k) lets you grab key code and insert it
|
||||
in input zone.
|
||||
|
||||
|
||||
2.5
|
||||
@@ -86,19 +97,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 +163,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 +191,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 :)
|
||||
|
||||
+46
-18
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-02-06
|
||||
WeeChat FAQ, 2005-07-30
|
||||
=======================
|
||||
|
||||
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,18 @@ 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),
|
||||
* extensible par des scripts (Perl, Python, Ruby),
|
||||
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt)
|
||||
* liste des pseudos disponible dans toutes les interfaces
|
||||
* extensible par des scripts (Perl, Python, Ruby)
|
||||
* découpage de la fenêtre horizontalement et verticalement
|
||||
* highlight dans la barre d'infos
|
||||
* tube FIFO pour contrôle à distance
|
||||
* développé à partir de zéro (non basé sur un quelconque client IRC)
|
||||
* multi-platformes
|
||||
* 100% GPL et libre
|
||||
C'est le client IRC le plus "geek" ;)
|
||||
|
||||
Plus d'infos sur cette page: http://weechat.flashtux.org/features.php
|
||||
|
||||
|
||||
2.2
|
||||
@@ -66,6 +73,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
|
||||
@@ -83,8 +91,9 @@ R: Il faut configurer le charset utilis
|
||||
================================================================================
|
||||
Q: Comment puis-je configurer les raccourcis clavier ?
|
||||
|
||||
R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
|
||||
version future.
|
||||
R: Les raccourcis clavier sont modifiables avec la commande /key.
|
||||
La touche par défaut Meta-k (souvent Alt-k) permet de capturer le code
|
||||
d'une touche et de l'inclure dans la zone de saisie.
|
||||
|
||||
|
||||
2.5
|
||||
@@ -92,20 +101,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 +173,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 +202,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
-4
@@ -15,14 +15,14 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
SUBDIRS = po intl src
|
||||
SUBDIRS = po doc intl src
|
||||
|
||||
EXTRA_DIST = weechat-curses.1 BUGS FAQ FAQ.fr \
|
||||
EXTRA_DIST = config.rpath 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
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2005-07-30
|
||||
|
||||
WeeChat 0.1.4 released.
|
||||
|
||||
* FlashCode, 2005-07-02
|
||||
|
||||
WeeChat 0.1.3 released.
|
||||
|
||||
* FlashCode, 2005-05-21
|
||||
|
||||
WeeChat 0.1.2 released.
|
||||
|
||||
* FlashCode, 2005-03-20
|
||||
|
||||
WeeChat 0.1.1 released.
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@ Features
|
||||
* small, fast and very light
|
||||
* customizable and extensible with scripts (Perl, Python, Ruby) (2)
|
||||
* compliant with RFC 1459,2810,2811,2812,2813
|
||||
* developed from scratch (not based on any other IRC client, except for look ;)
|
||||
* developed from scratch
|
||||
* multi-platform (GNU/Linux, *BSD, Windows & other) (3)
|
||||
* 100% GPL & free
|
||||
|
||||
@@ -44,5 +44,5 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---
|
||||
(1) only Curses interface is available today
|
||||
(2) only Perl interface is available today
|
||||
(3) only GNU/Linux version is available today
|
||||
(2) only Perl and Python interfaces are available today
|
||||
(3) only GNU/Linux and *BSD versions are available today
|
||||
|
||||
+17
-26
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2005-03-20
|
||||
TODO - 2005-07-20
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -10,31 +10,38 @@ Legend:
|
||||
? is this really necessary?
|
||||
|
||||
|
||||
v0.1.1:
|
||||
v0.1.4:
|
||||
------
|
||||
|
||||
* 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)
|
||||
|
||||
* WeeChat commands
|
||||
- be able to bind a key on more than one command
|
||||
- be able to make an alias running more than one command
|
||||
|
||||
* Configuration:
|
||||
# irc_highlight setting to highlight custom words
|
||||
# save buffer notify levels
|
||||
# add key bindings to config file, and create /key command
|
||||
|
||||
|
||||
Future versions:
|
||||
---------------
|
||||
|
||||
* IRC protocol:
|
||||
- customizable CTCP version reply
|
||||
- complete "/list" command: add regexp search, display only channels that
|
||||
match regexp
|
||||
- "/ignore" and "/unignore" commands: hide all that is write by a given
|
||||
@@ -45,16 +52,10 @@ Future versions:
|
||||
nick/host connect to the given irc network
|
||||
|
||||
* WeeChat commands:
|
||||
- "/reload" command: reload the WeeChat's config file
|
||||
- "/highlight" command: highlight a given word when it appears on
|
||||
channels/privates
|
||||
- "/completion" command: do shortcuts (for example when we type "u"
|
||||
in the text bar it send it to the server as "you")
|
||||
- "/exec" command: execute a command as if we was in shell
|
||||
and show us the output on the current window. An option to exec
|
||||
like -o could send the output to the server, on the current
|
||||
channel/private
|
||||
- "/last": command to look for text in previous messages
|
||||
- completion system for scripts arguments
|
||||
|
||||
* Interface:
|
||||
- color for nicks (except own nick) when nick colors are disabled
|
||||
@@ -62,16 +63,6 @@ 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
|
||||
|
||||
* Configuration:
|
||||
- add key bindings to config file
|
||||
|
||||
+13
-53
@@ -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
|
||||
|
||||
+168
-15
@@ -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.4, 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.4])
|
||||
|
||||
# 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,21 @@ if test "x$debug" = "x2" ; then
|
||||
AC_DEFINE(DEBUG)
|
||||
fi
|
||||
|
||||
dnl For FreeBSD
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
CFLAGS="$CFLAGS $CPPFLAGS"
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
doc/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 +287,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 +298,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 +319,7 @@ echo Build with Plugin support..... : $enable_plugins
|
||||
echo Build with Perl support....... : $enable_perl
|
||||
echo Build with Python support..... : $enable_python
|
||||
echo Build with Ruby support....... : $enable_ruby
|
||||
echo Build with GNUtls support..... : $enable_gnutls
|
||||
echo
|
||||
echo Compile with debug info....... : $msg_debug_compiler
|
||||
echo Print debugging messages...... : $msg_debug_verbose
|
||||
|
||||
@@ -1,6 +1,46 @@
|
||||
weechat (0.1.3-2) unstable; urgency=low
|
||||
|
||||
* Update config.{guess,sub} to fix FTBFS on k*BSD (Closes: #316791)
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Fri, 8 Jul 2005 21:30:38 +0200
|
||||
|
||||
weechat (0.1.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sat, 2 Jul 2005 20:06:29 +0200
|
||||
|
||||
weechat (0.1.2-3) unstable; urgency=low
|
||||
|
||||
* Apply patch against gui-display.c to fix curses color bug.
|
||||
* remove dh_install --sourcedir to allow builds on woody.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sun, 19 Jun 2005 22:37:11 +0200
|
||||
|
||||
weechat (0.1.2-2) unstable; urgency=low
|
||||
|
||||
* Patch src/gui/curse/gui-display.c to fix segfault
|
||||
when config file does not exists (Closes: #310589).
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Tue, 24 May 2005 20:55:02 +0200
|
||||
|
||||
weechat (0.1.2-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.1.2, see ChangeLog for detail.
|
||||
|
||||
-- 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
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
4
|
||||
@@ -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
|
||||
Standards-Version: 3.6.1
|
||||
Uploaders: Julien Louis <ptitlouis@sysif.net>
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev, libgnutls11-dev
|
||||
Standards-Version: 3.6.2.1
|
||||
|
||||
Package: weechat
|
||||
Architecture: all
|
||||
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,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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ install: build
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/weechat
|
||||
dh_install --sourcedir=debian/weechat
|
||||
install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
|
||||
dh_install
|
||||
# install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
# install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ binary-arch: build install
|
||||
dh_testroot -a
|
||||
# dh_installchangelogs -a
|
||||
# dh_installdocs -a
|
||||
dh_installman weechat-curses.1 -pweechat-curses
|
||||
dh_installman doc/weechat-curses.1 -pweechat-curses
|
||||
dh_link -a usr/share/doc/weechat-common usr/share/doc/weechat-curses
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
version=2
|
||||
http://weechat.flashtux.org/download/weechat-(\d.*)\.tar\.bz2
|
||||
@@ -1 +1 @@
|
||||
usr/share/locale
|
||||
debian/tmp/usr/share/locale/
|
||||
|
||||
@@ -1 +1 @@
|
||||
usr/bin/weechat-curses
|
||||
debian/tmp/usr/bin/weechat-curses
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
all: weechat_doc_fr.texi weechat_doc_en.texi weechat_doc_pt.texi weechat_doc_es.texi
|
||||
export LANG=fr_FR && makeinfo --html --no-split --number-sections weechat_doc_fr.texi
|
||||
export LANG=fr_FR && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_fr.texi >weechat_doc_fr.txt
|
||||
export LANG=en_EN && makeinfo --html --no-split --number-sections weechat_doc_en.texi
|
||||
export LANG=en_EN && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_en.texi >weechat_doc_en.txt
|
||||
export LANG=es_ES && makeinfo --html --no-split --number-sections weechat_doc_es.texi
|
||||
export LANG=es_ES && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_es.texi >weechat_doc_es.txt
|
||||
export LANG=pt_PT && makeinfo --html --no-split --number-sections weechat_doc_pt.texi
|
||||
export LANG=pt_PT && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_pt.texi >weechat_doc_pt.txt
|
||||
export LANG=fr_FR && texi2pdf weechat_doc_fr.texi
|
||||
export LANG=en_EN && texi2pdf weechat_doc_en.texi
|
||||
export LANG=es_ES && texi2pdf weechat_doc_es.texi
|
||||
export LANG=pt_PT && texi2pdf weechat_doc_pt.texi
|
||||
|
||||
clean:
|
||||
rm -rf weechat_doc_*.aux weechat_doc_*.cp weechat_doc_*.fn \
|
||||
weechat_doc_*.html weechat_doc_*.ky weechat_doc_*.log \
|
||||
weechat_doc_*.pdf weechat_doc_*.pg weechat_doc_*.toc \
|
||||
weechat_doc_*.tp weechat_doc_*.txt weechat_doc_*.vr
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
info_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
#weechat_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
# weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
AM_MAKEINFOHTMLFLAGS = --no-split --number-sections
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH WEECHAT 1 "February 2005" "FlashCode"
|
||||
.TH WEECHAT 1 "July 2005" "FlashCode"
|
||||
|
||||
.SH NAME
|
||||
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
|
||||
@@ -23,10 +23,22 @@ It is compliant with RFCs 1459, 2810, 2811, 2812, and 2813.
|
||||
.br
|
||||
display config file help (list of options)
|
||||
.TP
|
||||
.B \-f, \-\-key\-functions
|
||||
.br
|
||||
display internal functions for keys
|
||||
.TP
|
||||
.B \-h, \-\-help
|
||||
.br
|
||||
display summary of options
|
||||
.TP
|
||||
.B \-i, \-\-irc\-commands
|
||||
.br
|
||||
display IRC commands
|
||||
.TP
|
||||
.B \-k, \-\-keys
|
||||
.br
|
||||
display default keys
|
||||
.TP
|
||||
.B \-l, \-\-license
|
||||
.br
|
||||
display program license
|
||||
@@ -34,12 +46,16 @@ display program license
|
||||
.B \-v, \-\-version
|
||||
.br
|
||||
display WeeChat version
|
||||
.TP
|
||||
.B \-w, \-\-weechat\-commands
|
||||
.br
|
||||
display WeeChat commands
|
||||
|
||||
.SH URL
|
||||
WeeChat can use an URL (Uniform Resource Locator) to automatically connect
|
||||
to an IRC server. These are in the following form:
|
||||
.TP
|
||||
.B irc://[[nickname][:password]@]server[:port][/[#&+!]channel]
|
||||
.B irc[6][s]://[[nickname][:password]@]server[:port][/[#&+!]channel[,channel...]]
|
||||
.TP
|
||||
Exemple to join WeeChat channel support with nick "FlashCode":
|
||||
irc://FlashCode@irc.freenode.net/weechat
|
||||
@@ -53,11 +69,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
|
||||
+479
-159
@@ -35,9 +35,7 @@
|
||||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentation for WeeChat v0.1.4-cvs - July, 16 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -84,27 +82,27 @@ version 2 or higher.
|
||||
@node Description, Pre-requisites, Introduction, Introduction
|
||||
@section Description
|
||||
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
|
||||
designed for many operating systems.@*
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light,
|
||||
designed for many operating systems.@*
|
||||
@*
|
||||
Main features are:
|
||||
Main features are:
|
||||
@itemize @minus
|
||||
@item
|
||||
multi-servers connection
|
||||
@item
|
||||
many GUI (Graphical User Interface): Curses, Gtk and Qt
|
||||
@item
|
||||
small, fast and light
|
||||
@item
|
||||
customizable and extensible with scripts
|
||||
@item
|
||||
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
|
||||
@item
|
||||
multi-platform (Gnu/Linux, *BSD, Windows and other)
|
||||
@item
|
||||
@item
|
||||
multi-servers connection (with SSL, IPv6, proxy)
|
||||
@item
|
||||
many GUI: Curses, wxWidgets, Gtk and Qt
|
||||
@item
|
||||
small, fast and light
|
||||
@item
|
||||
customizable and extensible with scripts
|
||||
@item
|
||||
compliant with RFCs 1459, 2810, 2811, 2812, and 2813
|
||||
@item
|
||||
multi-platform (Gnu/Linux, *BSD, MacOS X, Windows and other)
|
||||
@item
|
||||
100% GPL, free software
|
||||
@end itemize
|
||||
|
||||
@end itemize
|
||||
|
||||
@*
|
||||
WeeChat homepage is here:@*
|
||||
@uref{http://weechat.flashtux.org}@*
|
||||
@@ -116,20 +114,20 @@ In order to install WeeChat, you @b{need}:@*
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
A running Gnu/Linux system (with compiler tools for source package)
|
||||
A running Gnu/Linux system (with compiler tools for source package)
|
||||
@item
|
||||
"root" privileges (to install WeeChat)
|
||||
@item
|
||||
According to GUI, one of the following libraries:
|
||||
@itemize @minus
|
||||
@item
|
||||
Curses: ncurses library,
|
||||
@item
|
||||
Gtk: *** GUI not developed ***,
|
||||
@item
|
||||
Qt: *** GUI not developed ***,
|
||||
According to GUI, one of the following libraries:
|
||||
@itemize @minus
|
||||
@item
|
||||
Curses: ncurses library,
|
||||
@item
|
||||
Gtk: *** GUI not developed ***,
|
||||
@item
|
||||
Qt: *** GUI not developed ***,
|
||||
@end itemize
|
||||
@end itemize
|
||||
@end itemize
|
||||
|
||||
|
||||
@c ******************************* Installation *******************************
|
||||
@@ -139,31 +137,31 @@ Qt: *** GUI not developed ***,
|
||||
|
||||
@menu
|
||||
* Binary package::
|
||||
* Source package::
|
||||
* Source package::
|
||||
* CVS sources::
|
||||
@end menu
|
||||
|
||||
@node Binary package, Source package, Installation, Installation
|
||||
@section Binary package
|
||||
|
||||
Binary packages are available for these distributions:
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (or any Debian compatible distribution)@*
|
||||
To install: @kbd{dpkg -i /path/weechat_x.y.z-1_i386.deb}
|
||||
@item
|
||||
Mandrake/Redhat (or any RPM compatible distribution)@*
|
||||
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
To install: @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (not available!)
|
||||
@item
|
||||
Slackware (not available!)
|
||||
@item
|
||||
Windows (not available!)
|
||||
@end itemize
|
||||
Binary packages are available for these distributions:
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (or any Debian compatible distribution)@*
|
||||
To install: @kbd{apt-get install weechat-curses}
|
||||
@item
|
||||
Mandriva/Redhat (or any RPM compatible distribution)@*
|
||||
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
To install: @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (not available!)
|
||||
@item
|
||||
Slackware (not available!)
|
||||
@item
|
||||
Windows (not available!)
|
||||
@end itemize
|
||||
|
||||
where x.y.z is the version (for example 0.0.1)
|
||||
@*
|
||||
@@ -176,27 +174,27 @@ All you have to do is to run in a console or a terminal:@*
|
||||
@kbd{make}@*
|
||||
Nota: to build only some interfaces, you can give parameters
|
||||
to ./configure, type @kbd{./configure --help} for help about options.@*
|
||||
|
||||
Then get root privileges and install WeeChat:@*
|
||||
@kbd{su}@*
|
||||
(enter root password)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
|
||||
Then get root privileges and install WeeChat:@*
|
||||
@kbd{su}@*
|
||||
(enter root password)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@node CVS sources, , Source package, Installation
|
||||
@section CVS sources
|
||||
|
||||
Warning: CVS sources are for advanced users: it may not compile or not be stable.
|
||||
You're warned!@*
|
||||
|
||||
To get CVS sources, issue these commands:@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
|
||||
(when prompted for a password, just press Enter key)@*
|
||||
|
||||
Warning: CVS sources are for advanced users: it may not compile or not be stable.
|
||||
You're warned!@*
|
||||
|
||||
To get CVS sources, issue these commands:@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
|
||||
(when prompted for a password, just press Enter key)@*
|
||||
|
||||
Execute this script:@*
|
||||
@kbd{./autogen.sh}@*
|
||||
|
||||
Then follow instructions for source package - @xref{Source package}.
|
||||
|
||||
Then follow instructions for source package - @xref{Source package}.
|
||||
|
||||
|
||||
@c ********************************** Usage ***********************************
|
||||
@@ -206,40 +204,47 @@ Then follow instructions for source package - @xref{Source package}.
|
||||
|
||||
@menu
|
||||
* Run WeeChat::
|
||||
* Config file::
|
||||
* Key bindings::
|
||||
* Config file::
|
||||
* Key bindings::
|
||||
* WeeChat commands::
|
||||
* FIFO pipe::
|
||||
@end menu
|
||||
|
||||
@node Run WeeChat, Config file, Usage, Usage
|
||||
@section Run WeeChat
|
||||
|
||||
@subsection Command line parameters
|
||||
|
||||
|
||||
@subsection Command line parameters
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Display config file help (list of options)@*
|
||||
@item -f, --key-functions
|
||||
Display WeeChat internal functions for keys@*
|
||||
@item -h, --help
|
||||
Display help screen@*
|
||||
@item -i, --irc-commands
|
||||
Display IRC commands list@*
|
||||
@item -l, --license
|
||||
Display WeeChat license@*
|
||||
@item -v, --version
|
||||
@item -v, --version
|
||||
Display WeeChat version@*
|
||||
@end table
|
||||
|
||||
@subsection Run WeeChat
|
||||
|
||||
Just issue this command to run WeeChat:@*
|
||||
@item -w, --weechat-commands
|
||||
Display WeeChat commands list@*
|
||||
@end table
|
||||
|
||||
@subsection Run WeeChat
|
||||
|
||||
Just issue this command to run WeeChat:@*
|
||||
@kbd{weechat-curses} (for Curses front-end)@*
|
||||
or @kbd{weechat-wxwidgets} (for wxWidgets front-end)@*
|
||||
or @kbd{weechat-gtk} (for Gtk front-end)@*
|
||||
or @kbd{weechat-qt} (for Qt front-end)@*
|
||||
|
||||
When you run WeeChat for the first time, a default configuration file is
|
||||
created, with default options.@*
|
||||
The default configuration file is: ~/.weechat/weechat.rc@*
|
||||
|
||||
You can edit this file at your convenience to configure WeeChat, or you can
|
||||
or @kbd{weechat-qt} (for Qt front-end)@*
|
||||
|
||||
When you run WeeChat for the first time, a default configuration file is
|
||||
created, with default options.@*
|
||||
The default configuration file is: ~/.weechat/weechat.rc@*
|
||||
|
||||
You can edit this file at your convenience to configure WeeChat, or you can
|
||||
set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
|
||||
|
||||
@node Config file, Key bindings, Run WeeChat, Usage
|
||||
@@ -248,7 +253,6 @@ set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
|
||||
List of options for config file:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item look_set_title
|
||||
Set title for window (terminal for Curses GUI) with name & version@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@@ -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'@*
|
||||
@@ -308,7 +315,10 @@ Enable info bar@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Timestamp for time in infobar@*
|
||||
Type: string (any string), default value: '%B, %A %d %Y - %H:%M'@*
|
||||
Type: string (any string), default value: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Display seconds in infobar time@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Delay (in seconds) for highlight messages in infobar (0 = disable highlight notifications in infobar)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 7@*
|
||||
@@ -375,6 +385,9 @@ Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar
|
||||
Color for info bar text@*
|
||||
Type: color (Curses or Gtk color), default value: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Color for infobar delimiters@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Color for info bar highlight notification@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@@ -414,6 +427,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 +498,7 @@ Default message when away@*
|
||||
Type: string (any string), default value: 'away'@*
|
||||
@item irc_default_msg_part
|
||||
Default part message (leaving channel)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
Type: string (any string), default value: 'WeeChat %v'@*
|
||||
@item irc_default_msg_quit
|
||||
Default quit message ('%v' will be replaced by WeeChat version in string)@*
|
||||
Type: string (any string), default value: 'WeeChat %v'@*
|
||||
@@ -498,6 +514,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 +547,21 @@ Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item proxy_use
|
||||
Use a proxy server to connect to irc server@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item proxy_type
|
||||
Proxy type (http (default), socks4, socks5)@*
|
||||
Type: string (values: 'http', 'socks4', 'socks5'), default value: 'http'@*
|
||||
@item proxy_ipv6
|
||||
Connect to proxy in ipv6@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item proxy_address
|
||||
Proxy server address (IP or hostname)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item proxy_port
|
||||
Port for connecting to proxy server@*
|
||||
Type: integer (values: between 0 and 65535), default value: 1080@*
|
||||
Type: integer (values: between 0 and 65535), default value: 3128@*
|
||||
@item proxy_username
|
||||
Username for proxy server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item proxy_password
|
||||
Password for proxy server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@@ -555,6 +583,12 @@ Type: string (any string), default value: ''@*
|
||||
@item server_port
|
||||
Port for connecting to server@*
|
||||
Type: integer (values: between 0 and 65535), default value: 6667@*
|
||||
@item server_ipv6
|
||||
Use IPv6 protocol for server communication@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item server_ssl
|
||||
Use SSL for server communication@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item server_password
|
||||
Password for IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@@ -585,7 +619,9 @@ Type: string (any string), default value: ''@*
|
||||
@item server_autorejoin
|
||||
Automatically rejoin channels when kicked@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
|
||||
@item server_notify_levels
|
||||
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@end table
|
||||
|
||||
Colors for Curses GUI are:@*
|
||||
@@ -624,11 +660,11 @@ Colors for Curses GUI are:@*
|
||||
|
||||
@node Key bindings, WeeChat commands, Config file, Usage
|
||||
@section Key bindings
|
||||
|
||||
|
||||
@table @kbd
|
||||
@item Left arrow / Right arrow
|
||||
Go to previous / next char in command line@*
|
||||
@*
|
||||
@*
|
||||
@item Ctrl + left arrow / Ctrl + right arrow
|
||||
Go to previous / next word in command line@*
|
||||
@*
|
||||
@@ -638,28 +674,37 @@ Go to the beginning of command line@*
|
||||
@item End / Ctrl + E
|
||||
Go to the end of command line@*
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Erase previous / next char of command line@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
@item Ctrl + K
|
||||
Delete until end of line@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Redraw whole window@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Delete until beginning of line@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Erase previous word of command line@*
|
||||
@*
|
||||
@item Tab
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Erase previous / next char of command line@*
|
||||
@*
|
||||
@item Tab
|
||||
Complete command or nick (@kbd{Tab} again: find next completion)@*
|
||||
@*
|
||||
@item Any char
|
||||
Insert char to cursor position in the command line@*
|
||||
@*
|
||||
@item Enter
|
||||
@*
|
||||
@item Any char
|
||||
Insert char to cursor position in the command line@*
|
||||
@*
|
||||
@item Enter
|
||||
Execute command or send message@*
|
||||
@*
|
||||
@item Up arrow / Down arrow
|
||||
Call again last commands/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
@*
|
||||
@item Up arrow / Down arrow
|
||||
Call again last commands/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Show buffer history@*
|
||||
@*
|
||||
@item F5 / F6
|
||||
@item F5 / F6
|
||||
Switch to previous / next buffer@*
|
||||
@*
|
||||
@item F7 / F8
|
||||
@@ -668,30 +713,54 @@ Switch to previous / next window@*
|
||||
@item F10
|
||||
Remove last infobar message@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Redraw whole window@*
|
||||
@*
|
||||
@item Alt + left arrow / Alt + right arrow
|
||||
@item F11 / F12
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@item Alt + left arrow / Alt + right arrow
|
||||
Same as F5 / F6@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Switch to next buffer with activity (with priority: highlight, message, other)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Display current DCC@*
|
||||
@item Alt + B
|
||||
Go to previous word@*
|
||||
@*
|
||||
@item Alt + R
|
||||
@item Alt + D
|
||||
Delete next word@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Go to next word@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Clear hotlist (activity notification on other buffers)@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J then Alt + D
|
||||
Display current DCC@*
|
||||
@*
|
||||
@item Alt + J then Alt + L
|
||||
Switch to last buffer@*
|
||||
@*
|
||||
@item Alt + J then Alt + S
|
||||
Switch to server buffer@*
|
||||
@*
|
||||
@item Alt + X
|
||||
@item Alt + J then Alt + X
|
||||
Switch to first channel of next server (or server buffer if no channel is opened)@*
|
||||
@*
|
||||
@item Alt + digit (1-9)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item Alt + J then number (01-99)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Grab a key
|
||||
@*
|
||||
@item Alt + R
|
||||
Delete entire line@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node WeeChat commands, FIFO pipe, Key bindings, Usage
|
||||
@@ -700,7 +769,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 +818,38 @@ display help about commands@*
|
||||
@*
|
||||
command: name of a WeeChat or IRC command@*
|
||||
@*
|
||||
@item perl [load filename] | [autoload] | [unload]
|
||||
@item key [key function/command] [unbind key] [functions] [reset -yes]
|
||||
@*
|
||||
bind/unbind keys@*
|
||||
@*
|
||||
key: bind this key to an internal function or a command (beginning by "/")@*
|
||||
unbind: unbind a key (if "all", default bindings are restored)@*
|
||||
functions: list internal functions for key bindings@*
|
||||
reset: restore bindings to the default values and delete ALL personal binding (use carefully!)@*
|
||||
@*
|
||||
@item perl [load filename] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
list/load/unload Perl scripts@*
|
||||
@*
|
||||
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 +885,11 @@ splith: split current window horizontally@*
|
||||
splitv: split current window vertically@*
|
||||
merge: merge window with another@*
|
||||
@*
|
||||
|
||||
@end table
|
||||
|
||||
IRC commands:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item admin [target]
|
||||
@*
|
||||
find information about the administrator of the server@*
|
||||
@@ -980,11 +1064,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 +1256,73 @@ nickname: nickname to search@*
|
||||
count: number of replies to return (full search if negative number)@*
|
||||
target: reply should match this mask@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
Internal functions for keys:@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminate line@*
|
||||
@item tab
|
||||
complete word@*
|
||||
@item backspace
|
||||
delete previous char@*
|
||||
@item delete
|
||||
delete next char@*
|
||||
@item delete_end_line
|
||||
delete until end of line@*
|
||||
@item delete_beginning_line
|
||||
delete until beginning of line@*
|
||||
@item delete_line
|
||||
delete entire line@*
|
||||
@item delete_previous_word
|
||||
delete previous word@*
|
||||
@item delete_next_word
|
||||
delete next word@*
|
||||
@item home
|
||||
go to beginning of line@*
|
||||
@item end
|
||||
go to end of line@*
|
||||
@item left
|
||||
move one char left@*
|
||||
@item previous_word
|
||||
move to previous word@*
|
||||
@item right
|
||||
move one char right@*
|
||||
@item next_word
|
||||
move to next word@*
|
||||
@item up
|
||||
call previous command in history@*
|
||||
@item down
|
||||
call next command in history@*
|
||||
@item page_up
|
||||
scroll one page up@*
|
||||
@item page_down
|
||||
scroll one page down@*
|
||||
@item infobar_clear
|
||||
clear infobar@*
|
||||
@item nick_page_up
|
||||
scroll nicklist one page up@*
|
||||
@item nick_page_down
|
||||
scroll nicklist one page down@*
|
||||
@item nick_beginning
|
||||
display beginning of nicklist@*
|
||||
@item nick_end
|
||||
display end of nicklist@*
|
||||
@item refresh
|
||||
refresh screen@*
|
||||
@item jump_smart
|
||||
jump to buffer with activity@*
|
||||
@item jump_dcc
|
||||
jump to DCC buffer@*
|
||||
@item jump_server
|
||||
jump to server buffer@*
|
||||
@item jump_next_server
|
||||
jump to next server@*
|
||||
@item hotlist_clear
|
||||
clear hotlist@*
|
||||
@item grab_key
|
||||
grab a key@*
|
||||
@end table
|
||||
|
||||
@node FIFO pipe, , WeeChat commands, Usage
|
||||
@@ -1192,15 +1343,19 @@ Some examples:
|
||||
@item @bullet{} change your nick on freenode to "mynick|out":
|
||||
@*
|
||||
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} display text on #weechat channel:
|
||||
@*
|
||||
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
|
||||
@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
|
||||
@*
|
||||
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1251,7 +1406,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 +1422,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 +1456,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 +1475,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 +1501,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 +1548,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 +1556,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 +1792,7 @@ Look for WeeChat support page for detail:@*
|
||||
@node Copyright, , Get support, Authors / Support
|
||||
@section Copyright
|
||||
|
||||
This manual documents WeeChat IRC client, it is part of WeeChat.@*
|
||||
This manual documents WeeChat IRC client, it is part of WeeChat.@*
|
||||
|
||||
Copyright @copyright{} 2005 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
|
||||
+445
-126
@@ -30,14 +30,13 @@
|
||||
@c end tex
|
||||
|
||||
@documentlanguage es
|
||||
@documentencoding ISO-8859-1
|
||||
|
||||
@titlepage
|
||||
|
||||
@title WeeChat - Gui@'on de usuario.
|
||||
@subtitle Cliente IRC r@'apido, peque@~no y extensible
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.1 - 20 de marzo de 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.4-cvs - 16 de Julio de 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -90,9 +89,9 @@ dise@~nado para diferentes sistemas operativos.@*
|
||||
Las caracter@'isticas principales son las siguientes:
|
||||
@itemize @minus
|
||||
@item
|
||||
conexi@'on multi-servidores
|
||||
conexi@'on multi-servidores (con SSL, IPv6, proxy)
|
||||
@item
|
||||
m@'ultiples interfaces: Curses, Gtk y Qt
|
||||
m@'ultiples interfaces: Curses, wxWidgets, Gtk y Qt
|
||||
@item
|
||||
peque@~no, r@'apido y ligero.
|
||||
@item
|
||||
@@ -100,7 +99,7 @@ parametrizable y extensible mediante guiones (scripts)
|
||||
@item
|
||||
conforme a las RFCs 1459, 2810, 2811, 2812, y 2813
|
||||
@item
|
||||
multi-plataforma (Gnu/Linux, *BSD, Windows y otros sistemas operativos)
|
||||
multi-plataforma (Gnu/Linux, *BSD, MacOS X, Windows y otros sistemas operativos)
|
||||
@item
|
||||
100% GPL, con Licencia Libre
|
||||
@end itemize
|
||||
@@ -150,7 +149,7 @@ Los paquetes binarios est@'an disponibles para las siguientes distribuciones:
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (o compatible con Debian)@*
|
||||
Para instalar WeeChat: @kbd{dpkg -i /direccion/weechat_x.y.z-1_i386.deb}
|
||||
Para instalar WeeChat: @kbd{apt-get install weechat-curses}
|
||||
@item
|
||||
Mandrake/Redhat (o cualquier distribuci@'on compatible con los paquetes RPM)@*
|
||||
Para instalar WeeChat: @kbd{rpm -i /direccion/weechat-x.y.z-1.i386.rpm}
|
||||
@@ -187,7 +186,7 @@ Adquiere los derechos de root e instala WeeChat:@*
|
||||
|
||||
Atenci@'on: Las fuentes CVS est@'an reservadas para usuarios con experiencia: Es posible que WeeChat no
|
||||
se instale o que se sea bastante inestable.
|
||||
︳a te he avisado!@*
|
||||
@exclamdown{}Ya te he avisado!@*
|
||||
|
||||
Para recuperar las fuentes CVS, escribe las l@'ineas siguientes:@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@@ -210,7 +209,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
|
||||
@@ -221,18 +220,25 @@ Luego, lee las instructiones para Paquetes de fuentes - @xref{Paquetes de fuente
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Obtener la ayuda del fichero de configuraci@'on (lista de opciones)@*
|
||||
@item -f, --key-functions
|
||||
Display WeeChat internal functions for keys@*
|
||||
@item -h, --help
|
||||
Obtener la ayuda@*
|
||||
@item -i, --irc-commands
|
||||
Display IRC commands list@*
|
||||
@item -l, --license
|
||||
Obtener la licencia de WeeChat@*
|
||||
@item -v, --version
|
||||
Obtener la versi@'on de WeeChat@*
|
||||
@item -w, --weechat-commands
|
||||
Display WeeChat commands list@*
|
||||
@end table
|
||||
|
||||
@subsection Lanzar WeeChat
|
||||
|
||||
Para ejecutar WeeChat, basta escribir la l@'inea siguiente:@*
|
||||
@kbd{weechat-curses} (para el interfaz con Curses)@*
|
||||
o @kbd{weechat-wxwidgets} (para el interfaz con wxWidgets)@*
|
||||
o @kbd{weechat-gtk} (para el interfaz con Gtk)@*
|
||||
o @kbd{weechat-qt} (para el interfaz con Qt)@*
|
||||
|
||||
@@ -247,7 +253,6 @@ Puedes editarlo para configurar WeeChat con las opciones deseadas, o tambi@'en p
|
||||
Enumeraci@'on de las opciones del fichero de configuraci@'on:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item look_set_title
|
||||
Define el t@'itulo de la ventana (el terminal para la interfaz Curses) con el nombre y la versi@'on@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@@ -269,6 +274,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@'ufers@*
|
||||
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'@*
|
||||
@@ -307,7 +315,10 @@ Activa la barra de informaci@'on@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Fecha y hora para las conversaciones guardadas@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y - %H:%M'@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Display seconds in infobar time@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Retraso (en segundos) para la notificaci@'on de mensajes en la barra de informaci@'on (0 = desactivar las notificaciones en la barra de informaci@'on)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 7@*
|
||||
@@ -374,6 +385,9 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
|
||||
@item col_infobar
|
||||
Color para el texto de la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Color para los delimitadores de la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Color para la notificaci@'on en la barra de informaci@'on@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'white'@*
|
||||
@@ -413,6 +427,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'@*
|
||||
@@ -447,10 +464,10 @@ Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
|
||||
Color para el estado dcc "abortado"@*
|
||||
Typo: color (color Curses @'o Gtk), valor por defecto: 'lightred'@*
|
||||
@item history_max_lines
|
||||
N𤦤ero m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
|
||||
N@'umero m@'aximo de l@'ineas en el hist@'orico para un servidor/canal/privado (0 = ilimitado)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 4096@*
|
||||
@item history_max_commands
|
||||
N𤦤ero m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
|
||||
N@'umero m@'aximo de comandos de usuario en el hist@'orico (0 = ilimitado)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 100@*
|
||||
@item log_auto_server
|
||||
Registrar autom@'aticamente los mensajes de servidor@*
|
||||
@@ -481,7 +498,7 @@ Mensaje por defecto para el estado ausente@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'away'@*
|
||||
@item irc_default_msg_part
|
||||
Mensaje por defecto de salida (saliendo de un canal)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
|
||||
@item irc_default_msg_quit
|
||||
Mensaje de fin por defecto ('%v' ser@'a reemplazado por la versi@'on de WeeChat en la cadena)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'WeeChat %v'@*
|
||||
@@ -498,13 +515,13 @@ 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@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_auto_accept_chats
|
||||
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (「tilizar con precauci@'on!)@*
|
||||
Aceptar autom@'aticamente las peticiones de conversaci@'on dcc (@exclamdown{}utilizar con precauci@'on!)@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_timeout
|
||||
Tiempo de espera para la petici@'on dcc (en segundos)@*
|
||||
@@ -530,12 +547,21 @@ Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@item proxy_use
|
||||
Utilizar un proxy para conectarse al servidor irc@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item proxy_type
|
||||
Proxy type (http (default), socks4, socks5)@*
|
||||
Typo: cadena (valores: 'http', 'socks4', 'socks5'), valor por defecto: 'http'@*
|
||||
@item proxy_ipv6
|
||||
Connect to proxy in ipv6@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item proxy_address
|
||||
Direcci@'on del servidor proxy (IP o nombre de m@'aquina)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item proxy_port
|
||||
Puerto para conectarse al servidor proxy@*
|
||||
Typo: entero (valores: entre 0 y 65535), valor por defecto: 1080@*
|
||||
Typo: entero (valores: entre 0 y 65535), valor por defecto: 3128@*
|
||||
@item proxy_username
|
||||
Username for proxy server@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item proxy_password
|
||||
Contrase@~na para el servidor proxy@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@@ -557,6 +583,12 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item server_port
|
||||
Puerto para conectarse al servidor@*
|
||||
Typo: entero (valores: entre 0 y 65535), valor por defecto: 6667@*
|
||||
@item server_ipv6
|
||||
Use IPv6 protocol for server communication@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item server_ssl
|
||||
Use SSL for server communication@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item server_password
|
||||
Contrase@~na para el servidor IRC@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@@ -587,7 +619,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item server_autorejoin
|
||||
Unirse de nuevo autom@'aticamente a los canales cuando sea expulsado@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
|
||||
@item server_notify_levels
|
||||
Comma separated list of notify levels for channels of this server (format: #channel:1,..)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@end table
|
||||
|
||||
Los colores para el interfaz Curses son:@*
|
||||
@@ -624,7 +658,6 @@ Los colores para el interfaz Curses son:@*
|
||||
@kbd{white}: blanco
|
||||
@end itemize
|
||||
|
||||
|
||||
@node Atajos de teclado, Comandos WeeChat, Ficheros de configuracion, Uso
|
||||
@section Atajos de teclado
|
||||
|
||||
@@ -641,12 +674,21 @@ Ir al inicio de la l@'inea de comandos@*
|
||||
@item Fin / Ctrl + E
|
||||
Ir al final de la l@'inea de comandos@*
|
||||
@*
|
||||
@item Ctrl + K
|
||||
Delete until end of line@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Refrescar toda la ventana@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Delete until beginning of line@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Borrar la palabra anterior en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Backspace / Supr
|
||||
Borrar el caracter anterior / siguiente en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
Borrar la palabra anterior en la l@'inea de comandos@*
|
||||
@*
|
||||
@item Tab
|
||||
Completar el comando o el seud@'onimo (@kbd{Tab} de nuevo: encontrar la pr@'oxima autocompletaci@'on)@*
|
||||
@*
|
||||
@@ -671,8 +713,8 @@ Ir a la ventana anterior / siguiente@*
|
||||
@item F10
|
||||
Borrar el @'ultimo mensaje en la barra de informaciones@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
Refrescar toda la ventana@*
|
||||
@item F11 / F12
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@item Alt + flecha izquierda / Alt + flecha derecha
|
||||
Como F5 / F6@*
|
||||
@@ -680,30 +722,53 @@ Como F5 / F6@*
|
||||
@item Alt + A
|
||||
Ir a la memoria temporal donde hay actividad (con el orden de prioridad siguiente: resaltado, mensaje, otros)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Obtener la lista de DCC actual@*
|
||||
@item Alt + B
|
||||
Go to previous word@*
|
||||
@*
|
||||
@item Alt + R
|
||||
@item Alt + D
|
||||
Delete next word@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Go to next word@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Borrar la 'hotlist' (notificaci@'on de actividad en otras memorias temporales)@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J then Alt + D
|
||||
Obtener la lista de DCC actual@*
|
||||
@*
|
||||
@item Alt + J then Alt + L
|
||||
Switch to last buffer@*
|
||||
@*
|
||||
@item Alt + J then Alt + S
|
||||
Ir a la memoria temporal del servidor@*
|
||||
@*
|
||||
@item Alt + X
|
||||
@item Alt + J then Alt + X
|
||||
Ir al primer canal del servidor siguiente (o a la memoria temporal del servidor si ning@'un canal est@'a abierto)@*
|
||||
@*
|
||||
@item Alt + (1-9)
|
||||
Saltar a la memoria temporal con ese n@'umero@*
|
||||
@*
|
||||
@item Alt + J then number (01-99)
|
||||
Saltar a la memoria temporal con ese n@'umero@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Grab a key
|
||||
@*
|
||||
@item Alt + R
|
||||
Delete entire line@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Scroll nicklist@*
|
||||
@*
|
||||
@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@*
|
||||
@@ -712,16 +777,16 @@ nombre_alias: nombre del seud@'onimo@*
|
||||
comando: nombre del comando (comando WeeChat @'o IRC, sin el primer '/')@*
|
||||
argumentos: par@'ametros para el comando@*
|
||||
@*
|
||||
@item buffer [acci@'on | n𤦤ero]
|
||||
@item buffer [acci@'on | n@'umero]
|
||||
@*
|
||||
gestionar los b偽ers@*
|
||||
gestionar los b@'ufers@*
|
||||
@*
|
||||
acci@'on: acci@'on a efectuar:@*
|
||||
move: desplaza el b偽er en la lista (puede ser relativo, por ejemplo, -1)@*
|
||||
close: cierra el b偽er (para un canal equivale a /part sin el mensaje de fin)@*
|
||||
list: lista los b偽ers abiertos (si no hay par@'ametros se supone esta lista)@*
|
||||
move: desplaza el b@'ufer en la lista (puede ser relativo, por ejemplo, -1)@*
|
||||
close: cierra el b@'ufer (para un canal equivale a /part sin el mensaje de fin)@*
|
||||
list: lista los b@'ufers abiertos (si no hay par@'ametros se supone esta lista)@*
|
||||
notify: fija el nivel de notificaci@'on (0=nunca, 1=highlight, 2=1+msg, 3=2+join/part)@*
|
||||
n𤦤ero: saltar al b偽er por n𤦤ero@*
|
||||
n@'umero: saltar al b@'ufer por n@'umero@*
|
||||
@*
|
||||
@item clear [-all]
|
||||
@*
|
||||
@@ -743,9 +808,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 +818,44 @@ mostrar ayuda sobre los comandos@*
|
||||
@*
|
||||
comando: nombre de un comando de Weechat @'o de IRC@*
|
||||
@*
|
||||
@item perl [load fichero] | [autoload] | [unload]
|
||||
@item key [key function/command] [unbind key] [functions] [reset -yes]
|
||||
@*
|
||||
bind/unbind keys@*
|
||||
@*
|
||||
key: bind this key to an internal function or a command (beginning by "/")@*
|
||||
unbind: unbind a key (if "all", default bindings are restored)@*
|
||||
functions: list internal functions for key bindings@*
|
||||
reset: restore bindings to the default values and delete ALL personal binding (use carefully!)@*
|
||||
@*
|
||||
@item perl [load fichero] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
lista/carga/descarga de los Perl scripts@*
|
||||
@*
|
||||
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𤦤ero 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 +885,11 @@ splith: dividir la ventana actual horizontalmente@*
|
||||
splitv: dividir la ventana actual verticalmente@*
|
||||
merge: fusionar una ventana con otra@*
|
||||
@*
|
||||
|
||||
@end table
|
||||
|
||||
Comandos IRC:@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item admin [target]
|
||||
@*
|
||||
encontrar informaci@'on sobre el administrador del servidor@*
|
||||
@@ -820,14 +901,14 @@ target: servidor objetivo@*
|
||||
revertir el estado ausente@*
|
||||
@*
|
||||
-all: revertir el estado ausente en todos los servidores conectados@*
|
||||
mensaje: mensaje para el estado ausente (si no se da ning𠒇 mensaje, se elimina el estado ausente)@*
|
||||
mensaje: mensaje para el estado ausente (si no se da ning@'un mensaje, se elimina el estado ausente)@*
|
||||
@*
|
||||
@item ban [canal] [usariio [usuario ...]]
|
||||
@*
|
||||
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 +981,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
|
||||
@*
|
||||
@@ -951,7 +1032,7 @@ modos del canal:@*
|
||||
s: indicador de canal secreto@*
|
||||
i: indicador de canal s@'olo con invitaci@'on@*
|
||||
t: indicador de tema s@'olo modificable por operador de canal@*
|
||||
n: ning𠒇 mensaje al canal desde el exterior@*
|
||||
n: ning@'un mensaje al canal desde el exterior@*
|
||||
m: canal moderado@*
|
||||
l: fijar el l@'imite de usuarios para el canal@*
|
||||
b: establecer una m@'ascara de baneo para mantener fuera a usuarios@*
|
||||
@@ -983,11 +1064,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 +1200,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 ...]
|
||||
@*
|
||||
@@ -1166,48 +1248,121 @@ pedir informaci@'on sobre el/los usuario(s)@*
|
||||
servidor: nombre del servidor@*
|
||||
usuario: nombre de usuario (puede que sea una m@'ascara)@*
|
||||
@*
|
||||
@item whowas usuario [,usuario [,usuario ...]] [n𤦤ero [destinatario]]
|
||||
@item whowas usuario [,usuario [,usuario ...]] [n@'umero [destinatario]]
|
||||
@*
|
||||
pedir informaci@'on sobre un usuario que ya no existe@*
|
||||
@*
|
||||
usuario: nombre de usuario a buscar@*
|
||||
n𤦤ero: n𤦤ero de respuestas a devolver (b𢃼queda completa si el n𤦤ero es negativo)@*
|
||||
n@'umero: n@'umero de respuestas a devolver (b@'usqueda completa si el n@'umero es negativo)@*
|
||||
destinatario: la respuesta deber@'ia concordar con esta m@'ascara@*
|
||||
@*
|
||||
|
||||
@end table
|
||||
|
||||
@node FIFO pipe, , Comandos WeeChat, Uso
|
||||
@section FIFO pipe
|
||||
Internal functions for keys:@*
|
||||
|
||||
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.@*
|
||||
@table @kbd
|
||||
@item return
|
||||
terminate line@*
|
||||
@item tab
|
||||
complete word@*
|
||||
@item backspace
|
||||
delete previous char@*
|
||||
@item delete
|
||||
delete next char@*
|
||||
@item delete_end_line
|
||||
delete until end of line@*
|
||||
@item delete_beginning_line
|
||||
delete until beginning of line@*
|
||||
@item delete_line
|
||||
delete entire line@*
|
||||
@item delete_previous_word
|
||||
delete previous word@*
|
||||
@item delete_next_word
|
||||
delete next word@*
|
||||
@item home
|
||||
go to beginning of line@*
|
||||
@item end
|
||||
go to end of line@*
|
||||
@item left
|
||||
move one char left@*
|
||||
@item previous_word
|
||||
move to previous word@*
|
||||
@item right
|
||||
move one char right@*
|
||||
@item next_word
|
||||
move to next word@*
|
||||
@item up
|
||||
call previous command in history@*
|
||||
@item down
|
||||
call next command in history@*
|
||||
@item page_up
|
||||
scroll one page up@*
|
||||
@item page_down
|
||||
scroll one page down@*
|
||||
@item infobar_clear
|
||||
clear infobar@*
|
||||
@item nick_page_up
|
||||
scroll nicklist one page up@*
|
||||
@item nick_page_down
|
||||
scroll nicklist one page down@*
|
||||
@item nick_beginning
|
||||
display beginning of nicklist@*
|
||||
@item nick_end
|
||||
display end of nicklist@*
|
||||
@item refresh
|
||||
refresh screen@*
|
||||
@item jump_smart
|
||||
jump to buffer with activity@*
|
||||
@item jump_dcc
|
||||
jump to DCC buffer@*
|
||||
@item jump_server
|
||||
jump to server buffer@*
|
||||
@item jump_next_server
|
||||
jump to next server@*
|
||||
@item hotlist_clear
|
||||
clear hotlist@*
|
||||
@item grab_key
|
||||
grab a key@*
|
||||
@end table
|
||||
|
||||
@node Canal FIFO, , Comandos WeeChat, Uso
|
||||
@section Canal FIFO
|
||||
|
||||
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:
|
||||
@*
|
||||
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
|
||||
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
|
||||
@item @bullet{} escribir texto en el canal #weechat:
|
||||
@*
|
||||
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
|
||||
@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 "*@exclamdown{}Hola!" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Advertencia:} esto es peligroso y no deber@'ias hacerlo.. salvo si lo que est@'as haciendo.
|
||||
@*
|
||||
@item @bullet{} enviar dos comandos para descargar y recargar los scripts Perl (tienes que separarlos con un \n):
|
||||
@*
|
||||
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
|
||||
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
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 +1372,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 +1408,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 +1424,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 +1458,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 +1478,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 ("masc=$mascara, canal=$canal, msj=$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 +1504,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 +1550,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,12 +1559,171 @@ Obtener informaciones distintas sobre WeeChat, el servidor o el usuario.@*
|
||||
@node Programas Python, Programas Ruby, Programas Perl, Extensiones
|
||||
@section Programas Python
|
||||
|
||||
﹑o 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("masc="+mascara+", canal="+canal+", msj="+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
|
||||
|
||||
﹑o desarrollado!
|
||||
@exclamdown{}No desarrollado!
|
||||
|
||||
@c **************************** Autores / Soporte *****************************
|
||||
|
||||
|
||||
+481
-160
@@ -30,14 +30,13 @@
|
||||
@c end tex
|
||||
|
||||
@documentlanguage fr
|
||||
@documentencoding ISO-8859-1
|
||||
|
||||
@titlepage
|
||||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
|
||||
|
||||
@image{weechat_image}
|
||||
@subtitle Documentation pour WeeChat v0.1.4-cvs - 16 Juillet 2005
|
||||
|
||||
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
|
||||
|
||||
@@ -83,27 +82,27 @@ License version 2 ou plus.
|
||||
@node Description, Pre-requis, Introduction, Introduction
|
||||
@section Description
|
||||
|
||||
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
|
||||
WeeChat (Wee Enhanced Environment for Chat) est un client IRC libre, rapide et l@'eger,
|
||||
concu pour diff@'erents syst@`emes d'exploitation.@*
|
||||
@*
|
||||
Ses principales caract@'eristiques sont les suivantes :
|
||||
@*
|
||||
Ses principales caract@'eristiques sont les suivantes :
|
||||
@itemize @minus
|
||||
@item
|
||||
connexion multi-serveurs
|
||||
@item
|
||||
plusieurs interfaces : Curses, Gtk et Qt
|
||||
@item
|
||||
petit, rapide et l@'eger
|
||||
@item
|
||||
param@'etrable et extensible avec des scripts
|
||||
@item
|
||||
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
|
||||
@item
|
||||
multi-plateformes (Gnu/Linux, *BSD, Windows et d'autres syst@`emes)
|
||||
@item
|
||||
@item
|
||||
connexion multi-serveurs (avec SSL, IPv6, proxy)
|
||||
@item
|
||||
plusieurs interfaces : Curses, wxWidgets, Gtk et Qt
|
||||
@item
|
||||
petit, rapide et l@'eger
|
||||
@item
|
||||
param@'etrable et extensible avec des scripts
|
||||
@item
|
||||
conforme aux RFCs 1459, 2810, 2811, 2812, et 2813
|
||||
@item
|
||||
multi-plateformes (Gnu/Linux, *BSD, MacOS X, Windows et d'autres syst@`emes)
|
||||
@item
|
||||
100% GPL, logiciel libre
|
||||
@end itemize
|
||||
|
||||
@end itemize
|
||||
|
||||
@*
|
||||
La page d'accueil de WeeChat est ici :@*
|
||||
@uref{http://weechat.flashtux.org}@*
|
||||
@@ -115,20 +114,20 @@ Pour installer WeeChat, vous @b{devez} avoir :@*
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
|
||||
Un syst@`eme Gnu/Linux (avec le compilateur et les outils associ@'es pour le paquet des sources)
|
||||
@item
|
||||
Droits "root" (pour installer WeeChat)
|
||||
@item
|
||||
Selon l'interface, une des biblioth@`eques suivantes :
|
||||
@itemize @minus
|
||||
@item
|
||||
Curses: la librairie ncurses,
|
||||
@item
|
||||
Gtk: *** interface non d@'evelopp@'ee ***,
|
||||
@item
|
||||
Qt: *** interface non d@'evelopp@'ee ***,
|
||||
Selon l'interface, une des biblioth@`eques suivantes :
|
||||
@itemize @minus
|
||||
@item
|
||||
Curses: la librairie ncurses,
|
||||
@item
|
||||
Gtk: *** interface non d@'evelopp@'ee ***,
|
||||
@item
|
||||
Qt: *** interface non d@'evelopp@'ee ***,
|
||||
@end itemize
|
||||
@end itemize
|
||||
@end itemize
|
||||
|
||||
|
||||
@c ******************************* Installation *******************************
|
||||
@@ -138,31 +137,31 @@ Qt: *** interface non d@'evelopp@'ee ***,
|
||||
|
||||
@menu
|
||||
* Paquet binaire::
|
||||
* Paquet source::
|
||||
* Paquet source::
|
||||
* Sources CVS::
|
||||
@end menu
|
||||
|
||||
@node Paquet binaire, Paquet source, Installation, Installation
|
||||
@section Paquet binaire
|
||||
|
||||
Les paquets binaires sont disponibles pour les distributions suivantes :
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (ou toute distribution compatible Debian)@*
|
||||
Pour installer : @kbd{dpkg -i /chemin/weechat_x.y.z-1_i386.deb}
|
||||
@item
|
||||
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
|
||||
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
Pour installer : @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (non disponible !)
|
||||
@item
|
||||
Slackware (non disponible !)
|
||||
@item
|
||||
Windows (non disponible !)
|
||||
@end itemize
|
||||
Les paquets binaires sont disponibles pour les distributions suivantes :
|
||||
@itemize @bullet
|
||||
@item
|
||||
Debian (ou toute distribution compatible Debian)@*
|
||||
Pour installer : @kbd{apt-get install weechat-curses}
|
||||
@item
|
||||
Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
|
||||
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
Pour installer : @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (non disponible !)
|
||||
@item
|
||||
Slackware (non disponible !)
|
||||
@item
|
||||
Windows (non disponible !)
|
||||
@end itemize
|
||||
|
||||
o@`u x.y.z est la version (par exemple 0.0.1)
|
||||
@*
|
||||
@@ -175,28 +174,28 @@ Tapez simplement dans une console ou un terminal :@*
|
||||
@kbd{make}@*
|
||||
Note: pour ne construire que certaines interfaces, vous pouvez passer des param@`etres
|
||||
@`a ./configure, tapez @kbd{./configure --help} pour de l'aide sur ces options.@*
|
||||
|
||||
Obtenez les droits root et installez WeeChat :@*
|
||||
@kbd{su}@*
|
||||
(entrez le mot de passe de root)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
|
||||
Obtenez les droits root et installez WeeChat :@*
|
||||
@kbd{su}@*
|
||||
(entrez le mot de passe de root)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@node Sources CVS, , Paquet source, Installation
|
||||
@section Sources CVS
|
||||
|
||||
@section Sources CVS
|
||||
|
||||
Attention: les sources CVS sont r@'eserv@'es aux utilisateurs avanc@'es : il se peut
|
||||
que WeeChat ne compile pas et qu'il soit tr@`s instable.
|
||||
Vous @^etes pr@'evenus !@*
|
||||
|
||||
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
|
||||
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
|
||||
que WeeChat ne compile pas et qu'il soit tr@`s instable.
|
||||
Vous @^etes pr@'evenus !@*
|
||||
|
||||
Pour r@'ecup@'erer les sources CVS, tapez ces commandes :@*
|
||||
@kbd{cvs -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat login}@*
|
||||
@kbd{cvs -z3 -d:pserver:anoncvs@@subversions.gnu.org:/cvsroot/weechat co weechat}@*
|
||||
(lorsqu'un mot de passe est demand@'e, tapez simplement sur Entr@'ee)@*
|
||||
|
||||
Ex@'ecutez ce script :@*
|
||||
@kbd{./autogen.sh}@*
|
||||
|
||||
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
|
||||
Suivez alors les instructions du paquet sources - @xref{Paquet source}.
|
||||
|
||||
|
||||
@c ******************************* Utilisation ********************************
|
||||
@@ -206,40 +205,47 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
|
||||
|
||||
@menu
|
||||
* Lancer WeeChat::
|
||||
* Fichier de configuration::
|
||||
* Raccourcis clavier::
|
||||
* Fichier de configuration::
|
||||
* Raccourcis clavier::
|
||||
* Commandes WeeChat::
|
||||
* Tube FIFO::
|
||||
@end menu
|
||||
|
||||
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
|
||||
@section Lancer WeeChat
|
||||
|
||||
@subsection Param@`etres de ligne de commande
|
||||
|
||||
|
||||
@subsection Param@`etres de ligne de commande
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Afficher l'aide sur le fichier de config (liste des options)@*
|
||||
@item -h, --help
|
||||
Afficher l'aide@*
|
||||
@item -f, --key-functions
|
||||
Afficher la liste des fonctions internes WeeChat pour les touches@*
|
||||
@item -i, --irc-commands
|
||||
Afficher la liste des commandes IRC@*
|
||||
@item -l, --license
|
||||
Afficher la licence de WeeChat@*
|
||||
@item -v, --version
|
||||
@item -v, --version
|
||||
Afficher la version de WeeChat@*
|
||||
@end table
|
||||
|
||||
@subsection Lancer WeeChat
|
||||
|
||||
Tapez simplement cette commande pour lancer WeeChat :@*
|
||||
@item -w, --weechat-commands
|
||||
Afficher la liste des commandes WeeChat@*
|
||||
@end table
|
||||
|
||||
@subsection Lancer WeeChat
|
||||
|
||||
Tapez simplement cette commande pour lancer WeeChat :@*
|
||||
@kbd{weechat-curses} (pour l'interface Curses)@*
|
||||
ou @kbd{weechat-wxwidgets} (pour l'interface wxWidgets)@*
|
||||
ou @kbd{weechat-gtk} (pour l'interface Gtk)@*
|
||||
ou @kbd{weechat-qt} (pour l'interface Qt)@*
|
||||
|
||||
ou @kbd{weechat-qt} (pour l'interface Qt)@*
|
||||
|
||||
Lorsque vous lancez WeeChat pour la premi@`ere fois, un fichier de configuration
|
||||
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
|
||||
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
|
||||
|
||||
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
|
||||
par d@'efaut est cr@'e@'e, avec les options par d@'efaut.@*
|
||||
Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
|
||||
|
||||
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
|
||||
vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} - @xref{Commandes WeeChat}.
|
||||
|
||||
@node Fichier de configuration, Raccourcis clavier, Lancer WeeChat, Utilisation
|
||||
@@ -248,7 +254,6 @@ vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} -
|
||||
Liste des options du fichier de configuration :@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item look_set_title
|
||||
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@@ -270,6 +275,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'@*
|
||||
@@ -308,7 +316,10 @@ Active la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Horodatage pour les conversations sauvegard@'ees@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y - %H:%M'@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y'@*
|
||||
@item look_infobar_seconds
|
||||
Afficher les secondes pour l'heure dans la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_delay_highlight
|
||||
D@'elai (en secondes) pour la notification des messages dans la barre d'infos (0 = d@'esactiver les notifications dans la barre d'infos)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 7@*
|
||||
@@ -375,6 +386,9 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar
|
||||
Couleur pour la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'black'@*
|
||||
@item col_infobar_delimiters
|
||||
Couleur pour les d@'elimiteurs de la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar_highlight
|
||||
Couleur pour la notification dans la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@@ -414,6 +428,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 +499,7 @@ Message par d@'efaut pour l'absence@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'away'@*
|
||||
@item irc_default_msg_part
|
||||
Message par d@'efaut pour le part (quitte un canal)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
|
||||
@item irc_default_msg_quit
|
||||
Message de fin par d@'efaut ('%v' sera remplac@'e par la version de WeeChat dans la cha@^ine)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
|
||||
@@ -531,12 +548,21 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item proxy_use
|
||||
Utiliser un proxy pour se connecter au serveur irc@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item proxy_type
|
||||
Type de proxy (http (d@'efaut), socks4, socks5)@*
|
||||
Type: cha@^ine (valeurs: 'http', 'socks4', 'socks5'), valeur par d@'efaut: 'http'@*
|
||||
@item proxy_ipv6
|
||||
Se connecter au proxy en ipv6@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item proxy_address
|
||||
Adresse du serveur proxy (IP ou nom)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item proxy_port
|
||||
Port pour se connecter au serveur proxy@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 1080@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 3128@*
|
||||
@item proxy_username
|
||||
Nom d'utilisateur pour le serveur proxy@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item proxy_password
|
||||
Mot de passe pour le serveur proxy@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@@ -558,6 +584,12 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_port
|
||||
Port pour se connecter au serveur@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 6667@*
|
||||
@item server_ipv6
|
||||
Utiliser le protocole IPv6 pour la communication avec le serveur@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item server_ssl
|
||||
Utiliser SSL pour la communication avec le serveur@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item server_password
|
||||
Mot de passe pour le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@@ -588,7 +620,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_autorejoin
|
||||
Rejoindre automatiquement les canaux quand mis dehors@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
|
||||
@item server_notify_levels
|
||||
Liste des niveaux de notifications (s@'epar@'es par des virgules) pour les canaux de ce serveur (format: #canal:1,..)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@end table
|
||||
|
||||
Les couleurs pour l'interface Curses sont :@*
|
||||
@@ -627,11 +661,11 @@ Les couleurs pour l'interface Curses sont :@*
|
||||
|
||||
@node Raccourcis clavier, Commandes WeeChat, Fichier de configuration, Utilisation
|
||||
@section Raccourcis clavier
|
||||
|
||||
|
||||
@table @kbd
|
||||
@item Fl@`eche gauche / Fl@`eche droite
|
||||
Aller au caract@`ere pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@*
|
||||
@item Ctrl + fl@`eche gauche / Ctrl + fl@`eche droite
|
||||
Aller au mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@@ -641,28 +675,37 @@ Aller au d@'ebut de la ligne de commande@*
|
||||
@item End / Ctrl + E
|
||||
Aller @`a la fin de la ligne de commande@*
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@item Ctrl + Backspace / Ctrl + W
|
||||
@item Ctrl + K
|
||||
Efface jusqu'@`a la fin de la ligne@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
R@'eaffiche toute la fen@^etre@*
|
||||
@*
|
||||
@item Ctrl + U
|
||||
Efface jusqu'au d@'ebut de la ligne@*
|
||||
@*
|
||||
@item Ctrl + W
|
||||
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
|
||||
@*
|
||||
@item Tab
|
||||
@*
|
||||
@item Backspace / Delete
|
||||
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
|
||||
@*
|
||||
@item Tab
|
||||
Compl@'eter la commande ou le pseudo (@kbd{Tab} @`a nouveau : trouver la compl@'etion suivante)@*
|
||||
@*
|
||||
@item Tout caract@`ere
|
||||
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
|
||||
@*
|
||||
@item Entr@'ee
|
||||
@*
|
||||
@item Tout caract@`ere
|
||||
Ins@'erer le caract@`ere @`a la position du curseur sur la ligne de commande@*
|
||||
@*
|
||||
@item Entr@'ee
|
||||
Ex@'ecuter la commande ou envoyer le message@*
|
||||
@*
|
||||
@item Fl@`eche haut / Fl@`eche bas
|
||||
Rappeler les derni@`eres commandes/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
@*
|
||||
@item Fl@`eche haut / Fl@`eche bas
|
||||
Rappeler les derni@`eres commandes/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Afficher l'historique du tampon@*
|
||||
@*
|
||||
@item F5 / F6
|
||||
@*
|
||||
@item F5 / F6
|
||||
Aller au tampon pr@'ec@'edent / suivant@*
|
||||
@*
|
||||
@item F7 / F8
|
||||
@@ -671,30 +714,54 @@ Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
|
||||
@item F10
|
||||
Effacer le dernier message de la barre d'infos@*
|
||||
@*
|
||||
@item Ctrl + L
|
||||
R@'eaffiche toute la fen@^etre@*
|
||||
@item F11 / F12
|
||||
Faire d@'efiler la liste des pseudos@*
|
||||
@*
|
||||
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
|
||||
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
|
||||
Identique @`a F5 / F6@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
|
||||
@*
|
||||
@item Alt + B
|
||||
Aller au mot pr@'ec@'edent@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Effacer le mot suivant@*
|
||||
@*
|
||||
@item Alt + F
|
||||
Aller au mot suivant@*
|
||||
@*
|
||||
@item Alt + H
|
||||
Vide la hotlist (notification d'activit@'e sur les autres tampons)@*
|
||||
@*
|
||||
@item Alt + J puis Alt + D
|
||||
Afficher les DCC en cours@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Vide la hotlist (notification d'activité sur les autres tampons)@*
|
||||
@item Alt + J puis Alt + L
|
||||
Sauter au dernier tampon@*
|
||||
@*
|
||||
@item Alt + S
|
||||
@item Alt + J puis Alt + S
|
||||
Sauter au tampon du serveur@*
|
||||
@*
|
||||
@item Alt + X
|
||||
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
|
||||
@*
|
||||
@item Alt + chiffre (1-9)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item Alt + J then Alt + X
|
||||
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
|
||||
@*
|
||||
@item Alt + K
|
||||
Capturer une touche
|
||||
@*
|
||||
@item Alt + J puis nombre (01-99)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Effacer la ligne enti@`ere@*
|
||||
@*
|
||||
@item Alt + PageUp / Alt + PageDown / Alt + Home / Alt + End
|
||||
Faire d@'efiler la liste des pseudos@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node Commandes WeeChat, Tube FIFO, Raccourcis clavier, Utilisation
|
||||
@@ -703,7 +770,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 +819,38 @@ afficher l'aide sur les commandes@*
|
||||
@*
|
||||
commande: nom d'une commande WeeChat ou IRC@*
|
||||
@*
|
||||
@item perl [load fichier] | [autoload] | [unload]
|
||||
@item key [touche fonction/commande] [unbind touche] [functions] [reset -yes]
|
||||
@*
|
||||
associer/lib@'erer des touches@*
|
||||
@*
|
||||
touche: associer cette touche @`a une fonction interne ou une commande (commen@,{c}ant par "/")@*
|
||||
unbind: supprimer l'association @`a une touche (si "all", toutes les associations de touches par d@'efaut sont restaur@'ees)@*
|
||||
functions: lister la liste des fonctions internes pour les associations de touches@*
|
||||
reset: restaur les touches aux valeurs par d@'efaut et supprime TOUTES les touches personnelles (utiliser avec pr@'ecaution !)@*
|
||||
@*
|
||||
@item perl [load fichier] | [autoload] | [reload] | [unload]
|
||||
@*
|
||||
liste/charge/d@'echarge des scripts Perl@*
|
||||
@*
|
||||
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 +886,11 @@ splith: @'eclate la fen@^etre en deux horizontalement@*
|
||||
splitv: @'eclate la fen@^etre en deux verticalement@*
|
||||
merge: fusionne la fen@^etre avec une autre@*
|
||||
@*
|
||||
|
||||
@end table
|
||||
|
||||
Commandes IRC :@*
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item admin [cible]
|
||||
@*
|
||||
trouver les informations sur l'administrateur du serveur@*
|
||||
@@ -983,11 +1065,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 +1257,73 @@ pseudo: pseudo @`a chercher@*
|
||||
nombre: nombre de r@'eponses @`a retourner (recherche compl@`ete si nombre n@'egatif)@*
|
||||
cible: la r@'eponse doit correspondre @`a ce masque@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
Fonctions internes pour les touches :@*
|
||||
|
||||
@table @kbd
|
||||
@item return
|
||||
terminer la ligne@*
|
||||
@item tab
|
||||
compl@'eter le mot@*
|
||||
@item backspace
|
||||
effacer le caract@`ere pr@'ec@'edent@*
|
||||
@item delete
|
||||
effacer le caract@`ere suivant@*
|
||||
@item delete_end_line
|
||||
effacer jusqu'@`a la fin de la ligne@*
|
||||
@item delete_beginning_line
|
||||
effacer jusqu'au d@'ebut de la ligne@*
|
||||
@item delete_line
|
||||
effacer la ligne enti@`ere@*
|
||||
@item delete_previous_word
|
||||
effacer le mot pr@'ec@'edent@*
|
||||
@item delete_next_word
|
||||
effacer le mot suivant@*
|
||||
@item home
|
||||
aller au d@'ebut de la ligne@*
|
||||
@item end
|
||||
aller @`a la fin de la ligne@*
|
||||
@item left
|
||||
se d@'eplacer d'un caract@`ere @`a gauche@*
|
||||
@item previous_word
|
||||
se d@'eplacer au mot pr@'ec@'edent@*
|
||||
@item right
|
||||
se d@'eplacer d'un caract@`ere @`a droite@*
|
||||
@item next_word
|
||||
se d@'eplacer au mot suivant@*
|
||||
@item up
|
||||
appeler la commande pr@'ec@'edente dans l'historique@*
|
||||
@item down
|
||||
appeler la commande suivante dans l'historique@*
|
||||
@item page_up
|
||||
faire d@'efiler d'une page vers le haut@*
|
||||
@item page_down
|
||||
faire d@'efiler d'une page vers le bas@*
|
||||
@item infobar_clear
|
||||
effacer la barre d'infos@*
|
||||
@item nick_page_up
|
||||
faire d@'efiler la liste des pseudos d'une page vers le haut@*
|
||||
@item nick_page_down
|
||||
faire d@'efiler la liste des pseudos d'une page vers le bas@*
|
||||
@item nick_beginning
|
||||
afficher le d@'ebut de la liste des pseudos@*
|
||||
@item nick_end
|
||||
afficher la fin de la liste des pseudos@*
|
||||
@item refresh
|
||||
rafraichir l'@'ecran@*
|
||||
@item jump_smart
|
||||
sauter au tampon avec de l'activit@'e@*
|
||||
@item jump_dcc
|
||||
sauter au tampon DCC@*
|
||||
@item jump_server
|
||||
sauter au tampon du serveur@*
|
||||
@item jump_next_server
|
||||
sauter au prochain serveur@*
|
||||
@item hotlist_clear
|
||||
effacer la liste d'activit@'e@*
|
||||
@item grab_key
|
||||
capturer une touche@*
|
||||
@end table
|
||||
|
||||
@node Tube FIFO, , Commandes WeeChat, Utilisation
|
||||
@@ -1196,14 +1345,21 @@ serveur doit l'@^etre aussi.@*
|
||||
Quelques exemples :
|
||||
@table @asis
|
||||
@item @bullet{} changement du pseudo sur freenode en "pseudo|absent":
|
||||
@*
|
||||
@command{echo "freenode */nick pseudo|absent" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} affichage de texte sur le canal #weechat :
|
||||
@*
|
||||
@command{echo "freenode,#weechat *bonjour tout le monde !" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@item @bullet{} affichage de texte sur le canal courant (le tampon affich@'e par WeeChat):
|
||||
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}@*
|
||||
@*
|
||||
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}
|
||||
@*
|
||||
@b{Attention :} ceci est dangereux et vous ne devriez pas le faire sauf si vous savez ce que vous faites !
|
||||
@item @bullet{} envoyer deux commandes pour décharger/recharger les scripts Perl (vous devez les séparer par \n):
|
||||
@*
|
||||
@item @bullet{} envoyer deux commandes pour d@'echarger/recharger les scripts Perl (vous devez les s@'eparer par \n):
|
||||
@*
|
||||
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
|
||||
@end table
|
||||
@*
|
||||
@@ -1254,7 +1410,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 +1427,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 +1461,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 +1481,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, msg=$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 +1507,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 +1554,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 +1562,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
|
||||
|
||||
+1226
-54
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -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
|
||||
@@ -16,6 +18,7 @@
|
||||
./src/gui/gtk/gui-display.c
|
||||
./src/gui/gtk/gui-input.c
|
||||
./src/gui/gui-common.c
|
||||
./src/gui/gui-keyboard.c
|
||||
./src/gui/gui.h
|
||||
./src/common/command.c
|
||||
./src/common/command.h
|
||||
|
||||
+1405
-893
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user