mirror of
https://github.com/weechat/weechat.git
synced 2026-06-16 16:14:46 +02:00
Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ba67bdd0c | |||
| 632d451f62 | |||
| 216b68b682 | |||
| 3e2349481c | |||
| 37e4e1f011 | |||
| 412ffa632e | |||
| e0a50e4d9a | |||
| 00613ece06 | |||
| 8c1c01e58e | |||
| 59158c48d3 | |||
| a1bc5ce60f | |||
| 10ab4b0a20 | |||
| c774d9eb00 | |||
| 22f255afbb | |||
| 78accc74a3 | |||
| fe1e7bdce6 | |||
| 9208800f22 | |||
| b712ce9ac4 | |||
| 015a9d0a22 | |||
| 875d1e5fee | |||
| ac52a1d607 | |||
| d1d41da7ad | |||
| 3ba99d6d71 | |||
| 8ffbfe4b2c | |||
| 7ce144e875 | |||
| 59a0d27668 | |||
| f1dbe04c20 | |||
| c7d9ebd5c4 | |||
| e03df08e0a | |||
| 670c05554c | |||
| 7aabd15b4f | |||
| 7d5878e4d6 | |||
| 0ea530127b | |||
| f4c01bc785 | |||
| 4061f34127 | |||
| cad95b8f32 | |||
| 71ac31fcdd | |||
| 7d29001f9d | |||
| 3e4db5f7c1 | |||
| 5a915f6974 | |||
| 6729d8d6f2 | |||
| 045ceb961f | |||
| ef039c99da | |||
| 48f526b55a | |||
| 3dcea50073 | |||
| 855997623d | |||
| 2aeb867fb8 | |||
| d6a85fd553 | |||
| c20ce83d20 | |||
| b5a7d8e99e | |||
| 101e623b75 | |||
| eadfd18117 | |||
| 844a16a3c5 | |||
| b786cdafe6 | |||
| b99273387b | |||
| 6961bcb05a | |||
| 0eae5234a1 | |||
| 3fb24d37f8 | |||
| b3b516e023 | |||
| 07dc0c85df | |||
| 9d96e3ad33 | |||
| 812ed965e9 | |||
| b84f75eba6 | |||
| 7772bcfd33 | |||
| 5473b39986 | |||
| ac297214e0 | |||
| 463d4638c1 | |||
| 17a52d0020 | |||
| 4dd93fd6d3 | |||
| ffd4b7c254 | |||
| 1386c9218d | |||
| ac3a3d365f | |||
| 2273e47d81 | |||
| b789f39702 | |||
| 189d06624e | |||
| 0ff3acf6e4 | |||
| e9939cf574 | |||
| 81aff59e4e | |||
| ff2e38a006 | |||
| 655150875b | |||
| dfa9ed31d4 | |||
| 1e81591803 | |||
| a9b3e2efae | |||
| 2ee57a4af5 | |||
| a3878a522c | |||
| 06c4cf4144 | |||
| 0f07b69688 | |||
| def08461d4 | |||
| 8dcb59fd0b | |||
| 9b91c91577 | |||
| 481e6f8e7f | |||
| e4ad664010 | |||
| 5a82d5a246 | |||
| 8c29d36461 | |||
| 14751f721d | |||
| 5d70f20c27 | |||
| 71d5c65e28 | |||
| b49ed70af4 | |||
| 9753571988 | |||
| c12b23382e | |||
| 232e5a27f0 | |||
| ebf5b78fce | |||
| 3bedad8622 |
@@ -9,17 +9,11 @@ Developers:
|
||||
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
|
||||
|
||||
* Scripts plugins
|
||||
|
||||
Kolter <kolter@openics.org>
|
||||
Web : http://kolter.free.fr
|
||||
kolter <kolter@openics.org>
|
||||
IRC : nick is "kolter" @ irc.freenode.net
|
||||
Jabber: kolter@im.openics.org
|
||||
|
||||
|
||||
Debian packager:
|
||||
@@ -47,7 +41,7 @@ Pavel Shevchuk, IRC: "Stalwart"
|
||||
=====
|
||||
|
||||
Whole team is connected to IRC:
|
||||
server: irc.freenode.net, channel: #weechat
|
||||
server: irc.freenode.net, channels: #weechat and #weechat-fr (french)
|
||||
|
||||
|
||||
See README file for licence detail.
|
||||
|
||||
@@ -1,9 +1,50 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2006-10-01
|
||||
ChangeLog - 2007-01-06
|
||||
|
||||
|
||||
Version 0.2.2 (2007-01-06):
|
||||
* fixed bug with status bar (missing refresh) when closing a buffer
|
||||
* fixed bug with use of first buffer for a channel if not connected
|
||||
to server (now allowed only for a server buffer)
|
||||
* fixed refresh bug with private buffer title
|
||||
* fixed bug with nick completion in command args (now uses option
|
||||
look_nick_completion_ignore)
|
||||
* fixed display bug with color for first line on screen (bug #17719)
|
||||
* added anti-flood option (irc_anti_flood) (task #5442)
|
||||
* fixed bug with "set_config" function in plugins API (bug #18448)
|
||||
* plugins: "add_message_handler" now accepts "*" for all IRC messages
|
||||
* added keys (F9/F10) to scroll topic (task #6030)
|
||||
* added auto completion with channels and filenames (task #5423)
|
||||
* fixed memleak in keyboard input
|
||||
* fixed refresh bug when changing config options if window is splited
|
||||
* added space between chat and nicklist when position is "right" (bug #17852)
|
||||
* added option "look_nicklist_separator" (task #5437)
|
||||
* fixed bug with DCC SEND when filename begins with '~'
|
||||
* added "irc_send_unknown_commands" option to send unknown commands to
|
||||
IRC server (OFF by default) (task #5947)
|
||||
* /charset command and charset conversions now made by "charset" plugin
|
||||
* fixed display bug in status bar, wrong length when using UTF-8
|
||||
* fixed bug with ignore: now any IRC command is allowed
|
||||
* fixed crash with Ctrl-T (transpose) and one char on line (bug #18153)
|
||||
* added filename completion (task #5425)
|
||||
* added "modifier" in plugins API
|
||||
* improved /plugin command
|
||||
* fixed bug on ignore with "mode" IRC command (bug #18058)
|
||||
* fixed crash when loading ruby script if file does not exist, with
|
||||
Ruby >= 1.9 only (bug #18064)
|
||||
* added date in plugin function get_buffer_data()
|
||||
* fixed some portability bugs (patch #5271)
|
||||
* fixed iconv detection for BSD (patch #5456)
|
||||
* fixed typo in configure.in (bash specific test) (patch #5450)
|
||||
* mode changes with /op, /deop, /voice, /devoice, /halfop, /dehalfop are
|
||||
now sent in one mode command to server (task #5968)
|
||||
* added more values for config boolean values: y/true/t/1 and n/false/f/0
|
||||
* fixed bug with /alias and arguments (like $1), now text after
|
||||
argument(s) is used (bug #17944)
|
||||
* fixed minor display bug with special chars on some arch like PPC
|
||||
|
||||
Version 0.2.1 (2006-10-01):
|
||||
* fixed crash for DCC receiver when resuming a file (bug #17885)
|
||||
* fixed DCC error for sender when receiver cancels DCC (bug #17838)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2006-10-01
|
||||
WeeChat FAQ, 2007-01-06
|
||||
=======================
|
||||
|
||||
Intended audience:
|
||||
@@ -75,15 +75,25 @@ A: For help you can type /help. For help about a command, type /help command.
|
||||
|
||||
2.3
|
||||
================================================================================
|
||||
Q: I heard about "buffers" and "windows", what's the difference?
|
||||
|
||||
A: A window is used when you split screen vertically or horizontally.
|
||||
A buffer is a "view" for a window. Each window displays a buffer, and
|
||||
many windows may display same buffer.
|
||||
Examples of buffers: server messages, channel, DCC list, ..
|
||||
|
||||
|
||||
2.4
|
||||
================================================================================
|
||||
Q: I don't see some chars with accents, what can I do?
|
||||
|
||||
A: You have to setup charset used for decoding (ISO and UTF), encoding, and
|
||||
internal WeeChat charset.
|
||||
Internal charset should be empty value, except if WeeChat failed to
|
||||
detect your locale (WeeChat looks for "UTF-8" in your locale name).
|
||||
detect your locale.
|
||||
|
||||
|
||||
2.4
|
||||
2.5
|
||||
================================================================================
|
||||
Q: How can I customize key bindings?
|
||||
|
||||
@@ -92,7 +102,7 @@ A: Key bindings are customizable with /key command.
|
||||
in input zone.
|
||||
|
||||
|
||||
2.5
|
||||
2.6
|
||||
================================================================================
|
||||
Q: How can I load Perl scripts?
|
||||
Are Perl scripts compatible with other IRC clients ?
|
||||
@@ -104,7 +114,7 @@ A: You can use /perl command to load scripts (default path is
|
||||
Perl scripts are not compatible with other IRC clients.
|
||||
|
||||
|
||||
2.6
|
||||
2.7
|
||||
================================================================================
|
||||
Q: How can I load Python scripts?
|
||||
Are Python scripts compatible with other IRC clients ?
|
||||
@@ -116,7 +126,7 @@ A: You can use /python command to load scripts (default path is
|
||||
Python scripts are not compatible with other IRC clients.
|
||||
|
||||
|
||||
2.7
|
||||
2.8
|
||||
================================================================================
|
||||
Q: How can I load Ruby scripts?
|
||||
Are Ruby scripts compatible with other IRC clients ?
|
||||
@@ -128,7 +138,7 @@ A: You can use /ruby command to load scripts (default path is
|
||||
Ruby scripts are not compatible with other IRC clients.
|
||||
|
||||
|
||||
2.8
|
||||
2.9
|
||||
================================================================================
|
||||
Q: How can I load Lua scripts?
|
||||
Are Lua scripts compatible with other IRC clients ?
|
||||
@@ -140,7 +150,7 @@ A: You can use /lua command to load scripts (default path is
|
||||
Lua scripts are not compatible with other IRC clients.
|
||||
|
||||
|
||||
2.9
|
||||
2.10
|
||||
================================================================================
|
||||
Q: When I'm using weechat under screen, I have weird chars, when I switch
|
||||
window for example, how to fix that?
|
||||
@@ -150,6 +160,19 @@ A: This may be caused by bad value of TERM variable (look at echo $TERM).
|
||||
is ok (like many other values).
|
||||
|
||||
|
||||
2.11
|
||||
================================================================================
|
||||
Q: I want to change language used by WeeChat for messages, but without
|
||||
exiting WeeChat, is it possible?
|
||||
|
||||
A: Yes, you have to use python script shell.py (available on WeeChat
|
||||
website) and issue these commands when script is loaded:
|
||||
/shell setenv LANG=en_US.UTF-8
|
||||
/upgrade
|
||||
(to have english messages with UTF-8 encoding for terminal, for ISO
|
||||
users, you can issue: /shell setenv LANG=en_US)
|
||||
|
||||
|
||||
3.1
|
||||
================================================================================
|
||||
Q: How should I report bugs?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2006-10-01
|
||||
WeeChat FAQ, 2007-01-06
|
||||
=======================
|
||||
|
||||
Public concerné :
|
||||
@@ -79,16 +79,28 @@ R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
|
||||
|
||||
2.3
|
||||
================================================================================
|
||||
Q: J'ai entendu parler de "buffers" et "windows", quelle est la
|
||||
différence ?
|
||||
|
||||
R: Une fenêtre ("window") est utilisée quand vous partagez l'écran
|
||||
verticalement ou horizontalement.
|
||||
Un tampon ("buffer") est une "vue" pour une fenĂŞtre. Chaque fenĂŞtre
|
||||
affiche un tampon, et plusieurs fenĂŞtres peuvent afficher le mĂŞme
|
||||
tampon.
|
||||
Exemples de tampons: messages serveur, canal, liste des DCC, etc...
|
||||
|
||||
|
||||
2.4
|
||||
================================================================================
|
||||
Q: Je ne vois pas bien certains accents dans WeeChat, que faire ?
|
||||
|
||||
R: Il faut configurer le charset utilisé pour le décodage (ISO et UTF),
|
||||
l'encodage ainsi que le charset interne Ă WeeChat.
|
||||
Le charset interne Ă WeeChat doit ĂŞtre une valeur vide, sauf si WeeChat
|
||||
n'arrive pas à déterminer votre locale (WeeChat recherche "UTF-8" dans
|
||||
le nom de la locale).
|
||||
n'arrive pas à déterminer votre locale.
|
||||
|
||||
|
||||
2.4
|
||||
2.5
|
||||
================================================================================
|
||||
Q: Comment puis-je configurer les raccourcis clavier ?
|
||||
|
||||
@@ -97,7 +109,7 @@ R: Les raccourcis clavier sont modifiables avec la commande /key.
|
||||
d'une touche et de l'inclure dans la zone de saisie.
|
||||
|
||||
|
||||
2.5
|
||||
2.6
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Perl ?
|
||||
Les scripts Perl sont-ils compatibles avec d'autres clients IRC ?
|
||||
@@ -109,7 +121,7 @@ R: La commande /perl permet de charger les scripts Perl (le chemin par d
|
||||
Les scripts Perl ne sont pas compatibles avec d'autres clients IRC.
|
||||
|
||||
|
||||
2.6
|
||||
2.7
|
||||
================================================================================
|
||||
Q: Comment puis-je charger les scripts Python ?
|
||||
Les scripts Python sont-ils compatibles avec d'autres clients IRC ?
|
||||
@@ -121,7 +133,7 @@ R: La commande /python permet de charger les scripts Python (le chemin par
|
||||
Les scripts Python ne sont pas compatibles avec d'autres clients IRC.
|
||||
|
||||
|
||||
2.7
|
||||
2.8
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Ruby ?
|
||||
Les scripts Ruby sont-ils compatibles avec d'autres clients IRC ?
|
||||
@@ -133,7 +145,7 @@ R: La commande /ruby permet de charger les scripts Ruby (le chemin par
|
||||
Les scripts Ruby ne sont pas compatibles avec d'autres clients IRC.
|
||||
|
||||
|
||||
2.8
|
||||
2.9
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Lua ?
|
||||
Les scripts Lua sont-ils compatibles avec d'autres clients IRC ?
|
||||
@@ -145,7 +157,7 @@ R: La commande /lua permet de charger les scripts Lua (le chemin par
|
||||
Les scripts Lua ne sont pas compatibles avec d'autres clients IRC.
|
||||
|
||||
|
||||
2.9
|
||||
2.10
|
||||
================================================================================
|
||||
Q: Quand j'utilise weechat sous screen, j'ai des caractères bizarres
|
||||
notamment en changeant de fenêtre, comment corriger ça ?
|
||||
@@ -155,6 +167,20 @@ R: Cela peut
|
||||
problèmes, utilisez "xterm" qui est ok (comme plein d'autres valeurs).
|
||||
|
||||
|
||||
2.11
|
||||
================================================================================
|
||||
Q: Je souhaite changer la langue des messages affichés par WeeChat, mais
|
||||
sans quitter WeeChat, est-ce possible ?
|
||||
|
||||
R: Oui, il faut utiliser le script python shell.py (disponible sur le site
|
||||
de WeeChat) et taper ces commandes une fois le script chargé :
|
||||
/shell setenv LANG=en_US.UTF-8
|
||||
/upgrade
|
||||
(pour avoir des messages anglais avec encodage UTF-8 pour le terminal,
|
||||
pour les utilisateurs en ISO, vous pouvez taper:
|
||||
/shell setenv LANG=en_US)
|
||||
|
||||
|
||||
3.1
|
||||
================================================================================
|
||||
Q: Comment dois-je reporter les bugs ?
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
@@ -21,6 +21,7 @@ EXTRA_DIST = config.rpath BUGS FAQ FAQ.fr \
|
||||
debian/changelog debian/control \
|
||||
debian/copyright debian/compat \
|
||||
debian/rules debian/weechat-common.docs \
|
||||
debian/lintian-override \
|
||||
debian/weechat-common.install debian/weechat-curses.dirs \
|
||||
debian/weechat-curses.install debian/weechat-plugins.install \
|
||||
debian/weechat-curses.menu debian/NEWS debian/weechat.xpm \
|
||||
|
||||
@@ -1,6 +1,33 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2007-01-06
|
||||
|
||||
WeeChat 0.2.2 released.
|
||||
|
||||
Important release notes:
|
||||
|
||||
- new charset plugin:
|
||||
- for users of any previous version, all your charset settings
|
||||
in weechat.rc will be LOST! You should save your weechat.rc
|
||||
to keep your values and set them again with new "charset" plugin.
|
||||
- for ISO users: history of channels may be without accents
|
||||
(after /upgrade), this is not recoverable, but this is not a bug.
|
||||
All new messages should be ok.
|
||||
- be careful, now default encode is UTF-8 for all channels (before
|
||||
it was terminal charset). If you still want to send messages as
|
||||
ISO-8859-1, you should send either global encode or server specific
|
||||
encode to ISO-8859-1.
|
||||
For global encode: /setp charset.global.encode = "ISO-8859-1"
|
||||
For server encode: (on server buffer) /charset encode ISO-8859-1
|
||||
- new keys for topic scroll:
|
||||
- new keys for scrolling topic: F9/F10
|
||||
- key F10 was used for "infobar_clear" in previous WeeChat versions,
|
||||
you have to manually rebind this key (except for new WeeChat users):
|
||||
/key <press alt-k then F10> scroll_topic_right
|
||||
which gives something like this:
|
||||
/key meta2-21~ scroll_topic_right
|
||||
|
||||
* FlashCode, 2006-10-01
|
||||
|
||||
WeeChat 0.2.1 released.
|
||||
|
||||
@@ -22,7 +22,7 @@ Features
|
||||
Copyright
|
||||
---------
|
||||
|
||||
WeeChat (c) Copyright 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
WeeChat (c) Copyright 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
(see AUTHORS file if you want to contact authors)
|
||||
|
||||
WeeChat is distributed under GPL licence (see COPYING file for complete license):
|
||||
|
||||
+61
-18
@@ -1,20 +1,63 @@
|
||||
#!/bin/sh
|
||||
|
||||
# gettextize updates Makefile.am, configure.in
|
||||
cp configure.in configure.in.old
|
||||
cp Makefile.am Makefile.am.old
|
||||
if test "$1" = "--auto" ; then
|
||||
grep -v 'read dummy < /dev/tty' $(which gettextize) | /bin/sh -s -- --copy --force --intl --no-changelog
|
||||
else
|
||||
gettextize --copy --force --intl --no-changelog
|
||||
fi
|
||||
mv Makefile.am.old Makefile.am
|
||||
mv configure.in.old configure.in
|
||||
libtoolize --automake --force --copy
|
||||
aclocal
|
||||
# autoheader creates config.h.in needed by autoconf
|
||||
autoheader
|
||||
# autoconf creates configure
|
||||
autoconf
|
||||
# automake creates Makefile.in
|
||||
automake --add-missing --copy --gnu
|
||||
###
|
||||
### common stuff
|
||||
###
|
||||
OK="\\033[70G[\\033[1;32mOK\\033[1;00m]"
|
||||
FAIL="\\033[70G[\\033[1;31mFAILED\\033[1;00m]"
|
||||
|
||||
AUTOGEN_LOG=autogen.log
|
||||
|
||||
err ()
|
||||
{
|
||||
echo "-------"
|
||||
echo "Error :"
|
||||
echo "---8<-----------------------------------"
|
||||
cat $AUTOGEN_LOG
|
||||
echo "----------------------------------->8---"
|
||||
exit 1
|
||||
}
|
||||
|
||||
run ()
|
||||
{
|
||||
echo -n "Running \"$@\""
|
||||
eval $@ >$AUTOGEN_LOG 2>&1
|
||||
if [ $? = 0 ] ; then
|
||||
echo -e $OK
|
||||
else
|
||||
echo -e $FAIL
|
||||
err
|
||||
fi
|
||||
}
|
||||
|
||||
###
|
||||
### cleanning part
|
||||
###
|
||||
# remove autotools stuff
|
||||
run "rm -rf config"
|
||||
run "rm -f config.h.in"
|
||||
run "rm -f aclocal.m4 configure config.log config.status"
|
||||
run "rm -rf autom4te*.cache"
|
||||
# remove libtool stuff
|
||||
run "rm -f libtool"
|
||||
# remove gettext stuff
|
||||
run "rm -f ABOUT-NLS"
|
||||
run "rm -rf intl"
|
||||
|
||||
###
|
||||
### configuration part
|
||||
###
|
||||
# create the config directory
|
||||
run "mkdir -p config/m4"
|
||||
run "mkdir intl"
|
||||
|
||||
# execute autotools cmds
|
||||
run "autopoint -f"
|
||||
run "libtoolize --automake --force --copy"
|
||||
run "aclocal --force -I config/m4"
|
||||
run "autoheader"
|
||||
run "autoconf"
|
||||
run "automake --add-missing --copy --gnu"
|
||||
|
||||
# ending
|
||||
rm -f $AUTOGEN_LOG
|
||||
|
||||
+96
-25
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
@@ -19,16 +19,17 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.56)
|
||||
AC_INIT(WeeChat, 0.2.1, flashcode@flashtux.org)
|
||||
AC_INIT(WeeChat, 0.2.2, flashcode@flashtux.org)
|
||||
AC_CONFIG_SRCDIR([src/common/weechat.c])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE([weechat], [0.2.1])
|
||||
AM_INIT_AUTOMAKE([weechat], [0.2.2])
|
||||
|
||||
# Checks for programs
|
||||
AC_PROG_CC
|
||||
AC_PROG_MAKE_SET
|
||||
AC_GNU_SOURCE
|
||||
AM_PROG_LIBTOOL
|
||||
AC_CHECK_PROG(DBLATEX_FOUND, "dblatex", "yes")
|
||||
|
||||
# Add some flags for some OS
|
||||
case "$host_os" in
|
||||
@@ -49,7 +50,8 @@ esac
|
||||
|
||||
# Gettext
|
||||
ALL_LINGUAS="fr es cs hu de ru"
|
||||
AM_GNU_GETTEXT
|
||||
AM_GNU_GETTEXT([use-libtool])
|
||||
AM_GNU_GETTEXT_VERSION([0.15])
|
||||
|
||||
# Checks for libraries
|
||||
AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
|
||||
@@ -85,7 +87,7 @@ AC_MSG_RESULT($ac_cv_type_socklen_t)
|
||||
# Checks for library functions.
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname regexec])
|
||||
AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strndup strncasecmp strpbrk strrchr strstr uname regexec])
|
||||
|
||||
# Variables in config.h
|
||||
|
||||
@@ -98,6 +100,7 @@ AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
|
||||
AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
|
||||
AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
|
||||
AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
|
||||
AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET])
|
||||
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
|
||||
AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
|
||||
AH_VERBATIM([DEBUG], [#undef DEBUG])
|
||||
@@ -108,6 +111,7 @@ AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interf
|
||||
AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=no wxwidgets)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
|
||||
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=no Gtk)],enable_gtk=$enableval,enable_gtk=no)
|
||||
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no Qt)],enable_qt=$enableval,enable_qt=no)
|
||||
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
|
||||
AC_ARG_ENABLE(plugins, [ --disable-plugins Turn off plugins support (default=plugins enabled)],enable_plugins=$enableval,enable_plugins=yes)
|
||||
AC_ARG_ENABLE(perl, [ --disable-perl Turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes)
|
||||
AC_ARG_ENABLE(python, [ --disable-python Turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes)
|
||||
@@ -117,7 +121,7 @@ AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, Lua include files are i
|
||||
AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, Lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='')
|
||||
AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG Lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='')
|
||||
AC_ARG_ENABLE(aspell, [ --disable-aspell Turn off Aspell plugin (default=compiled if found)],enable_aspell=$enableval,enable_aspell=yes)
|
||||
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
|
||||
AC_ARG_ENABLE(charset, [ --disable-charset Turn off Charset plugin (default=compiled if found)],enable_charset=$enableval,enable_charset=yes)
|
||||
AC_ARG_WITH(doc_xsl_prefix, [ --with-doc-xsl-prefix=DIR Docbook html/chunk.xsl is in DIR (default=autodetect)],doc_xsl_prefix=$withval,doc_xsl_prefix='')
|
||||
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
|
||||
|
||||
@@ -194,12 +198,17 @@ fi
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
iconv_found="no"
|
||||
ICONV_LFLAGS=""
|
||||
|
||||
AC_CHECK_HEADER(iconv.h,ac_found_iconv_header="yes",ac_found_iconv_header="no")
|
||||
if test "x$ac_found_iconv_header" = "xyes" ; then
|
||||
AC_CHECK_LIB(iconv,iconv_open,ac_found_iconv_lib="yes",ac_found_iconv_lib="no")
|
||||
if test "x$ac_found_iconv_lib" = "xno" ; then
|
||||
AC_CHECK_LIB(iconv,libiconv_open,ac_found_iconv_lib="yes",ac_found_iconv_lib="no")
|
||||
fi
|
||||
if test "x$ac_found_iconv_lib" = "xyes" ; then
|
||||
LIBS="$LIBS -liconv"
|
||||
ICONV_LFLAGS="-liconv"
|
||||
LIBS="$LIBS $ICONV_LFLAGS"
|
||||
fi
|
||||
AC_MSG_CHECKING(for iconv usability in programs)
|
||||
AC_TRY_RUN([
|
||||
@@ -238,9 +247,11 @@ if test "x$enable_plugins" != "xyes" ; then
|
||||
enable_ruby="no"
|
||||
enable_lua="no"
|
||||
enable_aspell="no"
|
||||
enable_charset="no"
|
||||
fi
|
||||
|
||||
# ---------------------------------- perl --------------------------------------
|
||||
PERL_VERSION=
|
||||
|
||||
if test "x$enable_perl" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
@@ -254,6 +265,7 @@ if test "x$enable_perl" = "xyes" ; then
|
||||
enable_perl="no"
|
||||
not_found="$not_found perl"
|
||||
else
|
||||
PERL_VERSION=`perl -V:version | sed "s/version='\(.*\)';/\1/"`
|
||||
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`
|
||||
@@ -263,7 +275,7 @@ if test "x$enable_perl" = "xyes" ; then
|
||||
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
|
||||
if test "x$PERL_LIB_TEST" = "x0" ; then
|
||||
PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
@@ -292,11 +304,12 @@ if test "x$enable_perl" = "xyes" ; then
|
||||
fi
|
||||
|
||||
# --------------------------------- python -------------------------------------
|
||||
PYTHON_VERSION=
|
||||
|
||||
if test "x$enable_python" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
|
||||
AC_PATH_PROGS(PYTHON, python python2.4 python2.3 python2.2)
|
||||
AC_PATH_PROGS(PYTHON, python python2.5 python2.4 python2.3 python2.2)
|
||||
if test -z $PYTHON ; then
|
||||
AC_MSG_WARN([
|
||||
*** Python must be installed on your system but python interpreter couldn't be found in path.
|
||||
@@ -351,6 +364,7 @@ if test "x$enable_python" = "xyes" ; then
|
||||
fi
|
||||
|
||||
# ---------------------------------- ruby --------------------------------------
|
||||
RUBY_VERSION=
|
||||
|
||||
if test "x$enable_ruby" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
@@ -364,6 +378,7 @@ if test "x$enable_ruby" = "xyes" ; then
|
||||
enable_ruby="no"
|
||||
not_found="$not_found ruby"
|
||||
else
|
||||
RUBY_VERSION=`$RUBY -rrbconfig -e "puts Config::CONFIG[['ruby_version']]"`
|
||||
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
|
||||
AC_MSG_CHECKING(for Ruby header files)
|
||||
if test -r "$RUBY_INCLUDE/ruby.h"; then
|
||||
@@ -388,6 +403,7 @@ if test "x$enable_ruby" = "xyes" ; then
|
||||
fi
|
||||
|
||||
# ---------------------------------- lua --------------------------------------
|
||||
LUA_VERSION=
|
||||
|
||||
if test "x$enable_lua" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
@@ -413,13 +429,18 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
if test "x$PKGCONFIG" != "x"; then
|
||||
AC_MSG_CHECKING(for Lua headers and librairies with pkg-config)
|
||||
echo
|
||||
for l in "$lua_suffix" "" "50" "5.0" "51" "5.1" ; do
|
||||
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l 2>/dev/null && $PKGCONFIG --exists lualib$l 2>/dev/null`
|
||||
for l in "$lua_suffix" "" "51" "5.1" "50" "5.0" ; do
|
||||
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l 2>/dev/null`
|
||||
if test "x$?" = "x0" ; then
|
||||
LUA_VERSION=`$PKGCONFIG --modversion lua$l`
|
||||
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lua$l`
|
||||
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
|
||||
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lua$l`
|
||||
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lualib$l`
|
||||
|
||||
pkgconfig_lualib_found=`$PKGCONFIG --exists lualib$l 2>/dev/null`
|
||||
if test "x$?" = "x0"; then
|
||||
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
|
||||
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lualib$l`
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
@@ -428,12 +449,13 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
|
||||
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
||||
LUACONFIG=""
|
||||
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config50 lua-config5.0 lua-config51 lua-config5.1)
|
||||
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config51 lua-config5.1 lua-config50 lua-config5.0)
|
||||
if test "x$LUACONFIG" != "x" ; then
|
||||
AC_MSG_CHECKING(for Lua headers and librairies with lua-config)
|
||||
echo
|
||||
LUA_CFLAGS=`$LUACONFIG --include`
|
||||
LUA_LFLAGS=`$LUACONFIG --libs`
|
||||
LUA_VERSION="5.0.x"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -445,9 +467,11 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then
|
||||
LUA_CFLAGS="$CFLAGS"
|
||||
fi
|
||||
for l in "$lua_suffix" "" "50" "5.0" "51" "5.1" ; do
|
||||
for l in "$lua_suffix" "" "51" "5.1" "50" "5.0" ; do
|
||||
AC_CHECK_LIB(lua$l,lua_call,ac_found_lua_lib="yes",ac_found_lua_lib="no")
|
||||
if test "x$ac_found_lua_lib" = "xyes" ; then
|
||||
LUA_VERSION=">=5.1.0"
|
||||
|
||||
LUA_LFLAGS="$LDFLAGS -llua$l -lm"
|
||||
|
||||
ac2_save_LDFLAGS="$LDFLAGS"
|
||||
@@ -459,6 +483,8 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
|
||||
AC_CHECK_LIB(lualib$l,luaL_openlib,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
|
||||
if test "x$ac_found_liblua_lib" = "xyes" ; then
|
||||
LUA_VERSION="5.0.x"
|
||||
|
||||
LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
|
||||
|
||||
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
|
||||
@@ -471,7 +497,7 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
AC_MSG_CHECKING(for Lua compiling and linking)
|
||||
LUA_TEST=`LT=luatest.c ; echo "#include <lua.h>" > $LT; echo "#include <lualib.h>" >> $LT; echo "int main() { luaopen_base((lua_State *)lua_open()); return 0; }" >> $LT ; $CC -Wall $LT -o $LT.out $LUA_CFLAGS $LUA_LFLAGS $CFLAGS $LDFLAGS 1>/dev/null 2>&1 ; echo $?; rm -f $LT $LT.out 1>/dev/null 2>&1`
|
||||
if test "x$LUA_TEST" != "x0" ; then
|
||||
@@ -529,6 +555,19 @@ if test "x$enable_aspell" = "xyes" ; then
|
||||
AC_DEFINE(PLUGIN_ASPELL)
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# charset
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
if test "x$enable_charset" = "xyes" ; then
|
||||
CHARSET_CFLAGS=""
|
||||
CHARSET_LFLAGS=""
|
||||
CHARSET_LFLAGS="$CHARSET_LFLAGS $ICONV_LFLAGS"
|
||||
AC_SUBST(CHARSET_CFLAGS)
|
||||
AC_SUBST(CHARSET_LFLAGS)
|
||||
AC_DEFINE(PLUGIN_CHARSET)
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# dynamic loader
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -552,6 +591,7 @@ if test "x$enable_plugins" = "xyes" ; then
|
||||
enable_ruby="no"
|
||||
enable_lua="no"
|
||||
enable_aspell="no"
|
||||
enable_charset="no"
|
||||
not_found="$not_found plugins"
|
||||
fi
|
||||
fi
|
||||
@@ -618,6 +658,12 @@ fi
|
||||
# documentation
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
msg_doc=""
|
||||
|
||||
if test "x$DBLATEX_FOUND" = "xyes"; then
|
||||
msg_doc="pdf $msg_doc"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for html/chunk.xsl)
|
||||
DOC_XSL_PREFIX=""
|
||||
|
||||
@@ -634,9 +680,8 @@ for p in $doc_xsl_prefix_path; do
|
||||
fi
|
||||
done
|
||||
|
||||
if test "x$DOC_XSL_PREFIX" == "x"; then
|
||||
if test "x$DOC_XSL_PREFIX" = "x"; then
|
||||
AC_MSG_RESULT(no)
|
||||
enable_doc="no"
|
||||
AC_MSG_WARN([
|
||||
*** Docbook XSL files not found
|
||||
*** WeeChat will be built without documentation.
|
||||
@@ -644,7 +689,7 @@ if test "x$DOC_XSL_PREFIX" == "x"; then
|
||||
else
|
||||
AC_MSG_RESULT($DOC_XSL_PREFIX)
|
||||
AC_SUBST(DOC_XSL_PREFIX)
|
||||
enable_doc="yes"
|
||||
msg_doc="html $msg_doc"
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -737,8 +782,10 @@ AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_CHARSET, test "$enable_charset" = "yes")
|
||||
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
|
||||
AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes")
|
||||
AM_CONDITIONAL(DBLATEX_FOUND, test "$DBLATEX_FOUND" = "yes")
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
doc/Makefile
|
||||
@@ -757,7 +804,8 @@ AC_OUTPUT([Makefile
|
||||
src/plugins/scripts/python/Makefile
|
||||
src/plugins/scripts/ruby/Makefile
|
||||
src/plugins/scripts/lua/Makefile
|
||||
src/plugins/aspell/Makefile
|
||||
src/plugins/aspell/Makefile
|
||||
src/plugins/charset/Makefile
|
||||
src/gui/Makefile
|
||||
src/gui/curses/Makefile
|
||||
src/gui/wxwidgets/Makefile
|
||||
@@ -805,19 +853,42 @@ if test "x$debug" = "x2" ; then
|
||||
msg_debug_verbose="yes"
|
||||
fi
|
||||
|
||||
# plugin status
|
||||
PERL_STATUS=
|
||||
if test "x$enable_perl" = "xyes"; then
|
||||
PERL_STATUS="($PERL_VERSION)"
|
||||
fi
|
||||
|
||||
PYTHON_STATUS=
|
||||
if test "x$enable_python" = "xyes"; then
|
||||
PYTHON_STATUS="($PYTHON_VERSION)"
|
||||
fi
|
||||
|
||||
RUBY_STATUS=
|
||||
if test "x$enable_ruby" = "xyes"; then
|
||||
RUBY_STATUS="($RUBY_VERSION)"
|
||||
fi
|
||||
|
||||
LUA_STATUS=
|
||||
if test "x$enable_lua" = "xyes"; then
|
||||
LUA_STATUS="($LUA_VERSION)"
|
||||
fi
|
||||
|
||||
|
||||
echo ""
|
||||
echo "Interfaces........................ :$listgui"
|
||||
echo "Build with GNUtls support......... : $enable_gnutls"
|
||||
echo "Build with flock support.......... : $enable_flock"
|
||||
echo "Build with Plugin support......... : $enable_plugins"
|
||||
echo " Perl plugin......... : $enable_perl"
|
||||
echo " Python plugin....... : $enable_python"
|
||||
echo " Ruby plugin......... : $enable_ruby"
|
||||
echo " Lua plugin.......... : $enable_lua"
|
||||
echo " Perl plugin......... : $enable_perl $PERL_STATUS"
|
||||
echo " Python plugin....... : $enable_python $PYTHON_STATUS"
|
||||
echo " Ruby plugin......... : $enable_ruby $RUBY_STATUS"
|
||||
echo " Lua plugin.......... : $enable_lua $LUA_STATUS"
|
||||
echo " Aspell plugin....... : $enable_aspell"
|
||||
echo " Charset plugin...... : $enable_charset"
|
||||
echo "Compile with debug info........... : $msg_debug_compiler"
|
||||
echo " Backtrace........... : $enable_backtrace"
|
||||
echo "Build doc..........................: $enable_doc"
|
||||
echo "Build doc..........................: $msg_doc"
|
||||
echo "Print debugging messages.......... : $msg_debug_verbose"
|
||||
echo ""
|
||||
eval echo "WeeChat will be installed in $bindir."
|
||||
|
||||
Vendored
+21
@@ -1,3 +1,24 @@
|
||||
weechat (0.2.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* Overrive lintian menu-icon-missing warning
|
||||
since the icon is in the weechat-common package.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Mon, 2 Oct 2006 15:30:06 +0200
|
||||
|
||||
weechat (0.2.0-2) unstable; urgency=low
|
||||
|
||||
* Add libaspell-dev to Build-Depends. This enables the aspell plugin built.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Mon, 25 Sep 2006 23:56:16 +0200
|
||||
|
||||
weechat (0.2.0-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* Rebuild against new default python version (Closes: #380985).
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sat, 19 Aug 2006 17:10:59 +0200
|
||||
|
||||
weechat (0.1.9-3) unstable; urgency=low
|
||||
|
||||
* Remove gnutls Build-Depends introduced in the previous upload
|
||||
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@ Priority: optional
|
||||
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
|
||||
Uploaders: Julien Louis <ptitlouis@sysif.net>
|
||||
Build-Depends-Indep: xsltproc, docbook-xsl, docbook-xml
|
||||
Build-Depends: cdbs, debhelper (>= 5), libncursesw5-dev, ruby, ruby1.8-dev, libperl-dev, python-dev, liblualib50-dev, libgnutls-dev, libtool, dpkg-dev (>= 1.13.19)
|
||||
Build-Depends: cdbs, debhelper (>= 5), libncursesw5-dev, ruby, ruby1.8-dev, libperl-dev, python-dev, libaspell-dev, liblualib50-dev, libgnutls-dev, libtool, dpkg-dev (>= 1.13.19)
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
Package: weechat
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
weechat-curses: menu-icon-missing /usr/share/pixmaps/weechat.xpm
|
||||
Vendored
+3
@@ -32,3 +32,6 @@ include /usr/share/cdbs/1/rules/debhelper.mk
|
||||
|
||||
install/weechat-common::
|
||||
install -D -o root -g root -m 644 debian/weechat.xpm $(CURDIR)/debian/weechat-common/usr/share/pixmaps/weechat.xpm
|
||||
|
||||
install/weechat-curses::
|
||||
install -D -o root -g root -m 644 debian/lintian-override $(CURDIR)/debian/weechat-curses/usr/share/lintian/overrides/weechat-curses
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
@@ -19,7 +19,7 @@ SUBDIRS = . en fr de ru pl cs
|
||||
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS) weechat-doc.css weechat-html-one.xsl.in weechat-html.xsl.in
|
||||
EXTRA_DIST = $(man_MANS) weechat-doc.css weechat-html-one.xsl.in weechat-html.xsl.in weechat-pdf.xsl dblatex.conf
|
||||
|
||||
all-local: weechat-html.xsl weechat-html-one.xsl
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
XslParam: weechat-pdf.xsl
|
||||
+19
-3
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
@@ -22,9 +22,13 @@ QUICKSTART = weechat_quickstart.$(LANGCODE).txt
|
||||
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
|
||||
|
||||
if DBLATEX_FOUND
|
||||
PDF = pdf-stamp
|
||||
endif
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
all-local: html-stamp
|
||||
all-local: html-stamp $(PDF)
|
||||
|
||||
# HTML output with chunks (many pages)
|
||||
|
||||
@@ -48,16 +52,28 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
|
||||
cp ../weechat-doc.css html1/
|
||||
touch html1-stamp
|
||||
|
||||
# PDF output
|
||||
|
||||
pdf: pdf-stamp
|
||||
|
||||
pdf-stamp: $(BOOK).xml $(BOOK_INCLUDE)
|
||||
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
|
||||
dblatex -c ../dblatex.conf $(BOOK).xml || true
|
||||
touch pdf-stamp
|
||||
|
||||
# install docs
|
||||
|
||||
install-data-hook:
|
||||
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
|
||||
if DBLATEX_FOUND
|
||||
$(INSTALL_DATA) $(BOOK).pdf $(DESTDIR)$(docdir)/
|
||||
endif
|
||||
|
||||
# clean
|
||||
|
||||
clean-local:
|
||||
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
|
||||
-rm -rf html/ html1/
|
||||
-rm -f html-stamp html1-stamp
|
||||
-rm -f html-stamp html1-stamp pdf-stamp
|
||||
|
||||
+31
-52
@@ -40,34 +40,6 @@
|
||||
<entry>'the geekest IRC client!'</entry>
|
||||
<entry>WeeChat-Slogan (wenn leer, wird keiner benutzt)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_decode_iso</option></entry>
|
||||
<entry>Zeichenfolge</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>'ISO-8859-1'</entry>
|
||||
<entry>ISO-Zeichensatz zum Dekodieren von Nachrichten vom Server (wird nur benutzt, wenn UTF-8 als Locale eingestellt ist; wenn nichts angegeben wird und die Locale UTF-8 ist, findet keine Konvertierung statt)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_decode_utf</option></entry>
|
||||
<entry>Zeichenfolge</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>'UTF-8'</entry>
|
||||
<entry>UTF-Zeichensatz zum Dekodieren von Nachrichten vom Server (wird nur benutzt, wenn die Locale nicht UTF-8 ist; wenn nichts angegeben wird und die Locale nicht UTF-8 ist, findet keine Konvertierung statt)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_encode</option></entry>
|
||||
<entry>Zeichenfolge</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Zeichensatz zum Enkodieren von Nachrichten zum Server, wie zum Beispiel: UTF-8, ISO-8859-1 (wenn nichts angegeben wird, findet keine Konversion statt)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_internal</option></entry>
|
||||
<entry>Zeichenfolge</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Erzwingt internen WeeChat-Zeichensatz (sollte normalerweise leer sein, dadurch wird der erkannte Zeichensatz benutzt)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_one_server_buffer</option></entry>
|
||||
<entry>Boolean</entry>
|
||||
@@ -138,6 +110,13 @@
|
||||
<entry>0</entry>
|
||||
<entry>Maximale Größe der Nicklist (Breite oder Höhe, je nach look_nicklist_position (0: kein Maximum); Wenn min == max > 0, ist die Größe fest.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nicklist_separator</option></entry>
|
||||
<entry>Boolean</entry>
|
||||
<entry>zwischen 0 und 100</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Trennzeichen zwischen Chatfenster und Nickliste</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_no_nickname</option></entry>
|
||||
<entry>Zeichenfolge</entry>
|
||||
@@ -320,6 +299,13 @@
|
||||
<entry>'default'</entry>
|
||||
<entry>Textfarbe der Titelleiste</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_title_more</option></entry>
|
||||
<entry>Farbe</entry>
|
||||
<entry>Curses- oder Gtk-Farben</entry>
|
||||
<entry>'lightmagenta'</entry>
|
||||
<entry>Color for '+' when scrolling topic</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_title_bg</option></entry>
|
||||
<entry>Farbe</entry>
|
||||
@@ -915,10 +901,17 @@
|
||||
<entry>5</entry>
|
||||
<entry>Maximal-Lag bis zum Trennen der Verbindung (in Minuten - 0: nie trennen)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_anti_flood</option></entry>
|
||||
<entry>Ganzzahl</entry>
|
||||
<entry>zwischen 0 und 5</entry>
|
||||
<entry>2</entry>
|
||||
<entry>Anti-flood: # seconds between two user messages (0 = no anti-flood)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_fifo_pipe</option></entry>
|
||||
<entry>Boolean</entry>
|
||||
<entry>zwischen 0 und 2147483647</entry>
|
||||
<entry>zwischen 0 und 5</entry>
|
||||
<entry>'off'</entry>
|
||||
<entry>Einen FIFO zur Fernsteuerung des Clients von anderen Prozessen öffnen</entry>
|
||||
</row>
|
||||
@@ -943,6 +936,13 @@
|
||||
<entry>'on'</entry>
|
||||
<entry>Erlaube Benutzern, spezielle Codes zu versenden (%B=fett, %Cxx,yy=Farbe, %U=unterstrichen, %R=reverse/umgekehrt)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_send_unknown_commands</option></entry>
|
||||
<entry>Boolean</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>'off'</entry>
|
||||
<entry>Sende unbekannte Befehle an den IRC-Server</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>dcc_auto_accept_files</option></entry>
|
||||
<entry>Boolean</entry>
|
||||
@@ -1207,7 +1207,7 @@
|
||||
<entry>Zeichenfolge</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Command(s) to run when connected to server (many commands should be separated by ';', use '\;' for a semicolon, special variables $nick, $channel and $server are replaced by their value)</entry>
|
||||
<entry>Befehle, die nach der Verbindung zum Server ausgefĂĽhrt werden sollen (mehrere Befehle mĂĽssen mit einem Semikolon getrennt werden, um ein Semikolon zu schreiben, muss man '\;' verwenden, die spezielllen Variablen $nick, $channel und $server werden dabei durch den jeweiligen Wert ersetzt)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_command_delay</option></entry>
|
||||
@@ -1235,26 +1235,5 @@
|
||||
<entry>Zeichenfolge</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Comma separated list of notify levels for channels of this server (format: #channel:1,..), a channel name '*' is reserved for server default notify level</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_charset_decode_iso</option></entry>
|
||||
<entry>Zeichenfolge</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Durch Kommata getrennte Liste der Zeichensätze für den Server und die Channels, um ISO-Nachrichten zu dekodieren (Format: Server:Zeichensatz,#Channel:Zeichensatz)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_charset_decode_utf</option></entry>
|
||||
<entry>Zeichenfolge</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Durch Kommata getrennte Liste der Zeichensätze für Server und Channels, um UTF zu dekodieren (Format: Server:Zeichensatz,#Channel:Zeichensatz,..)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_charset_encode</option></entry>
|
||||
<entry>Zeichenfolge</entry>
|
||||
<entry>eine beliebige Zeichenfolge</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Durch Kommata getrennte Liste der Zeichensätze, um Nachrichten vom Server und aus Channels zu dekodieren (Format: Server:Zeichensatz,#Channel:Zeichensatz,..)</entry>
|
||||
<entry>Durch Kommata getrennte Liste der Notify-Levels fĂĽr die Channels auf diesem Server (Format: #channel:1,...), der Channelname '*' ist fĂĽr den Default-Server-Notify-Level</entry>
|
||||
</row>
|
||||
|
||||
@@ -42,12 +42,12 @@ Nicknames oder Hosts sperren/verbannen
|
||||
Nickname: zu sperrender User oder Host
|
||||
|
||||
</programlisting>
|
||||
<command>ctcp Nickname Typ [Argumente]</command>
|
||||
<command>ctcp Empfänger Typ [Argumente]</command>
|
||||
<programlisting>
|
||||
CTCP-Nachricht verschicken
|
||||
|
||||
Nickname: User, an den die CTCP-Nachricht geschickt werden soll
|
||||
Typ: Typ der CTCP-Nachricht (z.B. "version", "ping", ...)
|
||||
Empfänger: User, an den die CTCP-Nachricht geschickt werden soll
|
||||
Typ: Typ der CTCP-Nachricht (z.B. "version", "ping", ..)
|
||||
Argumente: Argumente fĂĽr CTCP
|
||||
|
||||
</programlisting>
|
||||
|
||||
@@ -117,6 +117,14 @@
|
||||
<entry><literal>scroll_bottom</literal></entry>
|
||||
<entry>nach ganz unten scrollen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_topic_left</literal></entry>
|
||||
<entry>scroll left topic</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_topic_right</literal></entry>
|
||||
<entry>scroll right topic</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_beginning</literal></entry>
|
||||
<entry>zum Anfang der Nicklist gehen</entry>
|
||||
|
||||
+684
-47
@@ -4,7 +4,7 @@
|
||||
|
||||
WeeChat documentation (german version)
|
||||
|
||||
Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
|
||||
This manual is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
<bookinfo>
|
||||
|
||||
<title>WeeChat 0.2.1 - User guide</title>
|
||||
<title>WeeChat 0.2.2 - User guide</title>
|
||||
<subtitle>Schneller, leichter und erweiterbarer IRC Client</subtitle>
|
||||
|
||||
<author>
|
||||
@@ -512,6 +512,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Fenster neu aufbauen
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Strg + T</entry>
|
||||
<entry>
|
||||
Zeichen transponieren
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Strg + U</entry>
|
||||
<entry>
|
||||
@@ -525,19 +531,25 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry> RĂĽckschritt </entry>
|
||||
<entry>Strg + Y</entry>
|
||||
<entry>
|
||||
Inhalt der Zwischenablage einfĂĽgen
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>RĂĽckschritt / Strg + H</entry>
|
||||
<entry>
|
||||
Lösche das vorhergehende Zeichen in der Kommandozeile
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry> Entfernen </entry>
|
||||
<entry>Entfernen</entry>
|
||||
<entry>
|
||||
Lösche das nächste Zeichen in der Kommandozeile
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry> Tabulator </entry>
|
||||
<entry>Tabulator / Shift + Tabulator</entry>
|
||||
<entry>
|
||||
Vervollständige ein Kommando oder Nick
|
||||
(wiederhole: finde nächste Vervollständigung)
|
||||
@@ -550,7 +562,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Eingabe</entry>
|
||||
<entry>Eingabe / Strg + J / Strg + M</entry>
|
||||
<entry>
|
||||
FĂĽhre ein Kommando aus oder sende eine Nachricht
|
||||
</entry>
|
||||
@@ -593,7 +605,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry> F6 / Alt + Rechts </entry>
|
||||
<entry>F6 / Alt + Rechts</entry>
|
||||
<entry>
|
||||
Gehe zum nächsten Puffer
|
||||
</entry>
|
||||
@@ -611,9 +623,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>F10</entry>
|
||||
<entry>F9 / F10</entry>
|
||||
<entry>
|
||||
Entferne den letzten Hinweis in der Infobar
|
||||
Blättere in der Topic
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@@ -660,6 +672,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
(Aktivitätsanzeige für andere Puffer)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Alt + I</entry>
|
||||
<entry>
|
||||
Entferne den letzten Hinweis in der Infobar
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Alt + J dann Alt + D</entry>
|
||||
<entry>
|
||||
@@ -992,7 +1010,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
<para>
|
||||
Liste der Optionen fĂĽr die Konfigurationsdatei:
|
||||
<informaltable colsep="0" frame="none">
|
||||
<tgroup cols="2">
|
||||
<tgroup cols="5">
|
||||
<thead>
|
||||
<row>
|
||||
<entry> Option </entry>
|
||||
@@ -1262,6 +1280,129 @@ fi
|
||||
|
||||
<section id="secAPIFunctions">
|
||||
<title>API Funktionen</title>
|
||||
|
||||
<section id="secAPI_set_charset">
|
||||
<title>set_charset</title>
|
||||
|
||||
<para>
|
||||
Prototyp:
|
||||
<command>
|
||||
void set_charset (t_weechat_plugin *plugin, char *charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Legt neuen Zeichensatz fĂĽr ein Plugin fest.
|
||||
</para>
|
||||
<para>
|
||||
Argumente:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: Zeiger auf Plugin-Struktur
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: neuer Zeichensatz, der benutzt werden soll
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Beispiel:
|
||||
<screen>plugin->set_charset (plugin, "ISO-8859-1");</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_iconv_to_internal">
|
||||
<title>iconv_to_internal</title>
|
||||
|
||||
<para>
|
||||
Prototyp:
|
||||
<command>
|
||||
void iconv_to_internal (t_weechat_plugin *plugin, char *charset,
|
||||
char *string)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Konvertiert eine Zeichenkette in das interne Format von WeeChat (UTF-8).
|
||||
</para>
|
||||
<para>
|
||||
Argumente:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: Zeiger auf Plugin-Struktur
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: ursprĂĽnglicher Zeichensatz, von dem konvertiert werden soll
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>string</option>: zu konvertierende Zeichenkette
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
RĂĽckgabewert: konvertierte Zeichenkette
|
||||
</para>
|
||||
<para>
|
||||
Anmerkung: der Speicher, der durch das Ergebnis belegt wird, muss mit free() wieder freigegeben werden.
|
||||
</para>
|
||||
<para>
|
||||
Beispiel:
|
||||
<screen>char *str = plugin->iconv_to_internal (plugin, "ISO-8859-1", "iso string: Ă© Ă ");</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_iconv_from_internal">
|
||||
<title>iconv_from_internal</title>
|
||||
|
||||
<para>
|
||||
Prototyp:
|
||||
<command>
|
||||
void iconv_from_internal (t_weechat_plugin *plugin, char *charset,
|
||||
char *string)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Konvertiert eine Zeichenkette von dem internen WeeChat-Zeichensatz (UTF-8) in einen anderen.
|
||||
</para>
|
||||
<para>
|
||||
Argumente:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: Zeiger auf Plugin-Struktur
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: Ziel-Zeichensatz
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>string</option>: zu konvertierende Zeichenkette
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
RĂĽckgabewert: konvertierte Zeichenkette
|
||||
</para>
|
||||
<para>
|
||||
Anmerkung: der Speicher, der durch das Ergebnis belegt wird, muss mit free() wieder freigegeben werden.
|
||||
</para>
|
||||
<para>
|
||||
Beispiel:
|
||||
<screen>char *str = plugin->iconv_from_internal (plugin, "ISO-8859-1", "utf-8 string: Ă© Ă ");</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_ascii_strcasecmp">
|
||||
<title>ascii_strcasecmp</title>
|
||||
@@ -1789,7 +1930,8 @@ plugin->log (plugin, "freenode", "#weechat", "test");
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option>: Name (Typ) der IRC-Nachricht.
|
||||
<option>message</option>: Name (Typ) der IRC-Nachricht ("*" fĂĽr alle
|
||||
Nachrichten).
|
||||
Eine Liste der bekannten IRC-Nachrichten ist in den
|
||||
<acronym>RFC</acronym>s
|
||||
<ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink> und
|
||||
@@ -1917,7 +2059,9 @@ int msg_kick (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);
|
||||
t_plugin_handler *msg_handler;
|
||||
msg_handler = plugin->msg_handler_add (plugin, "KICK",
|
||||
&msg_kick, NULL, NULL);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2011,10 +2155,10 @@ plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);
|
||||
<entry><literal>%C</literal></entry>
|
||||
<entry>Channels des gegenwärtigen Servers</entry>
|
||||
</row>
|
||||
<!-- <row>
|
||||
<entry><literal>%f</literal></entry>
|
||||
<entry>file name</entry>
|
||||
</row> -->
|
||||
<row>
|
||||
<entry><literal>%f</literal></entry>
|
||||
<entry>Dateiname</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>%h</literal></entry>
|
||||
<entry>Plugin Kommandos</entry>
|
||||
@@ -2158,9 +2302,10 @@ int cmd_test (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->cmd_handler_add (plugin, "test", "Test command",
|
||||
"[nick]", "nick: nick of channel",
|
||||
"%n", &cmd_test, NULL, NULL);
|
||||
t_plugin_handler *cmd_handler;
|
||||
cmd_handler = plugin->cmd_handler_add (plugin, "test", "Test command",
|
||||
"[nick]", "nick: nick of channel",
|
||||
"%n", &cmd_test, NULL, NULL);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2249,7 +2394,8 @@ int my_timer (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->timer_handler_add (plugin, 60, &my_timer);
|
||||
t_plugin_handler *timer_handler;
|
||||
timer_handler = plugin->timer_handler_add (plugin, 60, &my_timer);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2345,8 +2491,8 @@ plugin->timer_handler_add (plugin, 60, &my_timer);
|
||||
<para>
|
||||
Beispiel:
|
||||
<screen>
|
||||
int keyb_handler (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
char *handler_args, void *handler_pointer)
|
||||
int my_keyb (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
char *handler_args, void *handler_pointer)
|
||||
{
|
||||
if (argc == 2)
|
||||
{
|
||||
@@ -2359,7 +2505,8 @@ int keyb_handler (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->keyboard_handler_add (plugin, &keyb_handler);
|
||||
t_plugin_handler *keyb_handler;
|
||||
keyb_handler = plugin->keyboard_handler_add (plugin, &my_keyb);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2431,6 +2578,213 @@ plugin->keyboard_handler_add (plugin, &keyb_handler);
|
||||
<screen>plugin->handler_remove_all (plugin);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_modifier_add">
|
||||
<title>modifier_add</title>
|
||||
|
||||
<para>
|
||||
Prototyp:
|
||||
<command>
|
||||
t_plugin_modifier *modifier_add (t_weechat_plugin *plugin,
|
||||
char *type, char *message, t_plugin_modifier_func *function,
|
||||
char *modifier_args, void *modifier_pointer)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
FĂĽge einen Nachrichtenmodifikator hinzu.
|
||||
</para>
|
||||
<para>
|
||||
Argumente:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: Zeiger auf Plugin-Struktur
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>type</option>: Modifikatorart:
|
||||
<informaltable colsep="0" frame="none">
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Art</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>irc_in</literal></entry>
|
||||
<entry>wird bei eingehenden IRC-Nachrichten aufgerufen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_user</literal></entry>
|
||||
<entry>
|
||||
wird bei jeder Benutzernachricht (oder Befehl) aufgerufen
|
||||
(bevor WeeChat die Nachricht parst)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_out</literal></entry>
|
||||
<entry>
|
||||
wird unmittelbar vor dem Abschicken einer ausgehenden
|
||||
Nachricht an den IRC-Server aufgerufen (auch bei
|
||||
Nachrichten, die WeeChat automatisch an den Server
|
||||
sendet)
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option>: Name der IRC-Nachricht (wird nur bei den Arten
|
||||
"irc_in" and "irc_out" benutzt)
|
||||
Um eine Liste der IRC-Nachrichten zu erhalten, lies bitte folgende Dokumente:
|
||||
<acronym>RFC</acronym>s
|
||||
<ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink> and
|
||||
<ulink url="http://www.ietf.org/rfc/rfc2812.txt">2812</ulink>.
|
||||
AuĂźerdem gibt es den Wert "*", der alle Nachrichten anspricht (ohne Filter).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>function</option>: aufgerufene Funktion
|
||||
</para>
|
||||
<para>
|
||||
Folgender Prototyp wird dafĂĽr benutzt:
|
||||
<command>
|
||||
int my_function (t_weechat_plugin *plugin,
|
||||
int argc, char **argv,
|
||||
char *modifier_args, void *modifier_pointer)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Argument argc hat den Wert 2, folgende Werte sind in dem
|
||||
argv-Array:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>argv[0] = Servername</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>argv[1] = Nachricht</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>modifier_args</option>: an die Funktion ĂĽbergebene Werte
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>modifier_pointer</option>: an die Funktion ĂĽbergebener Zeiger
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
RĂĽckgabewert: Zeiger auf den neuen Nachrichtenmodifikator
|
||||
</para>
|
||||
<para>
|
||||
Anmerkung: Die Funktion muss die veränderte Zeichenkette oder NULL
|
||||
(wenn keine Änderungen erfolgten) zurückgeben.
|
||||
Wenn die Funktion eine leere Zeichenkette zurĂĽckgibt, wird die
|
||||
Nachricht komplett verworfen und nicht weiter von WeeChat
|
||||
verarbeitet. (Seien Sie vorsichtig mit dem Verwerfen von Nachrichten!)
|
||||
Die zurĂĽckgegebene Zeichenkette muss mit malloc() zugewiesen worden sein und
|
||||
wird von WeeChat nach Gebrauch automatisch mit free() wieder freigegeben.
|
||||
</para>
|
||||
<para>
|
||||
Beispiel:
|
||||
<screen>
|
||||
char *adder (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
char *modifier_args, void *modifier_pointer)
|
||||
{
|
||||
char *string;
|
||||
string = (char *)malloc (strlen (argv[1]) + 16);
|
||||
strcpy (string, argv[1]);
|
||||
strcat (string, "test");
|
||||
return string;
|
||||
}
|
||||
...
|
||||
t_plugin_modifier *modifier;
|
||||
modifier = plugin->modifier_add (plugin, "irc_in", "privmsg",
|
||||
&adder, NULL, NULL);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_modifier_remove">
|
||||
<title>modifier_remove</title>
|
||||
|
||||
<para>
|
||||
Prototyp:
|
||||
<command>
|
||||
void modifier_remove (t_weechat_plugin *plugin,
|
||||
t_plugin_modifier *modifier)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Entfernt einen Nachrichtenmodifikator.
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: Zeiger auf Plugin-Struktur
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>modifier</option>: zu entfernender Modifikator
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
RĂĽckgabewert: keiner
|
||||
</para>
|
||||
<para>
|
||||
Beispiel:
|
||||
<screen>plugin->modifier_remove (plugin, my_modifier);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_modifier_remove_all">
|
||||
<title>modifier_remove_all</title>
|
||||
|
||||
<para>
|
||||
Prototyp:
|
||||
<command>
|
||||
void modifier_remove_all (t_weechat_plugin *plugin)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Entfernt alle Modifikatoren fĂĽr ein Plugin.
|
||||
</para>
|
||||
<para>
|
||||
Argumente:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: Zeiger auf Plugin-Struktur
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
RĂĽckgabewert: keiner
|
||||
</para>
|
||||
<para>
|
||||
Beispiel:
|
||||
<screen>plugin->modifier_remove_all (plugin);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_exec_command">
|
||||
<title>exec_command</title>
|
||||
@@ -4076,6 +4430,11 @@ else
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>time_t</entry>
|
||||
<entry><literal>date</literal></entry>
|
||||
<entry>Datum/Zeit</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>char *</entry>
|
||||
<entry><literal>nick</literal></entry>
|
||||
@@ -4108,13 +4467,16 @@ else
|
||||
Example:
|
||||
<screen>
|
||||
t_plugin_buffer_line *buffer_line, *ptr_line;
|
||||
char text_time[256];
|
||||
|
||||
buffer_line = plugin->get_buffer_data (plugin);
|
||||
if (buffer_line)
|
||||
{
|
||||
for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
|
||||
{
|
||||
plugin->print (plugin, NULL, NULL, "nick: %s, data: %s", ptr_line->nick, ptr_line->data);
|
||||
strftime (text_time, sizeof (text_time), "%x %X", localtime (&(ptr_line->date)));
|
||||
plugin->print (plugin, NULL, NULL, "date: %s, nick: %s, data: %s",
|
||||
text_time, ptr_line->nick, ptr_line->data);
|
||||
}
|
||||
plugin->free_buffer_data (plugin, buffer_line);
|
||||
}
|
||||
@@ -4414,25 +4776,25 @@ end
|
||||
<para>
|
||||
Perl-Prototyp:
|
||||
<command>
|
||||
weechat::register(name, version, end_function, description);
|
||||
weechat::register(name, version, end_function, description, [charset]);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python-Prototyp:
|
||||
<command>
|
||||
weechat.register(name, version, end_function, description)
|
||||
weechat.register(name, version, end_function, description, [charset])
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby-Prototyp:
|
||||
<command>
|
||||
Weechat.register(name, version, end_function, description)
|
||||
Weechat.register(name, version, end_function, description, [charset])
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua-Prototyp:
|
||||
<command>
|
||||
weechat.register(name, version, end_function, description)
|
||||
weechat.register(name, version, end_function, description, [charset])
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
@@ -4465,6 +4827,12 @@ end
|
||||
<option>description</option>: eine kurze Beschreibung des Skripts
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: Zeichensatz, der von dem Script benutzt wird, sollten Sie
|
||||
setzen, wenn das Script nicht in UTF-8 geschrieben ist
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -4474,16 +4842,77 @@ end
|
||||
Beispiele:
|
||||
<screen>
|
||||
# perl
|
||||
weechat::register("test", "1.0", "end_test", "Test script!");
|
||||
weechat::register("test", "1.0", "end_test", "Test script!", "ISO-8859-1");
|
||||
|
||||
# python
|
||||
weechat.register("test", "1.0", "end_test", "Test script!")
|
||||
weechat.register("test", "1.0", "end_test", "Test script!", "ISO-8859-1")
|
||||
|
||||
# ruby
|
||||
Weechat.register("test", "1.0", "end_test", "Test script!")
|
||||
Weechat.register("test", "1.0", "end_test", "Test script!", "ISO-8859-1")
|
||||
|
||||
-- lua
|
||||
weechat.register("test", "1.0", "end_test", "Test script!")
|
||||
weechat.register("test", "1.0", "end_test", "Test script!", "ISO-8859-1")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_set_charset">
|
||||
<title>set_charset</title>
|
||||
|
||||
<para>
|
||||
Perl-Prototyp:
|
||||
<command>
|
||||
weechat::set_charset(charset);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python-Prototyp:
|
||||
<command>
|
||||
weechat.set_charset(charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby-Prototyp:
|
||||
<command>
|
||||
Weechat.set_charset(charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua-Prototyp:
|
||||
<command>
|
||||
weechat.set_charset(charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Legt einen neuen Script-Zeichensatz fest.
|
||||
</para>
|
||||
<para>
|
||||
Argumente:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: neuer Script-Zeichensatz
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
RĂĽckgabewert: 1, wenn der Zeichensatz erfolgreich gesetzt wurd, 0, wenn ein Fehler aufgetreten ist
|
||||
</para>
|
||||
<para>
|
||||
Beispiele:
|
||||
<screen>
|
||||
# perl
|
||||
weechat::set_charset("ISO-8859-1");
|
||||
|
||||
# python
|
||||
weechat.set_charset("ISO-8859-1")
|
||||
|
||||
# ruby
|
||||
Weechat.set_charset("ISO-8859-1")
|
||||
|
||||
-- lua
|
||||
weechat.set_charset("ISO-8859-1")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -5036,25 +5465,25 @@ end
|
||||
<para>
|
||||
Perl-Prototyp:
|
||||
<command>
|
||||
weechat::add_timer_handler(message, function);
|
||||
weechat::add_timer_handler(interval, function);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python-Prototyp:
|
||||
<command>
|
||||
weechat.add_timer_handler(message, function)
|
||||
weechat.add_timer_handler(interval, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby-Prototyp:
|
||||
<command>
|
||||
Weechat.add_timer_handler(message, function)
|
||||
Weechat.add_timer_handler(interval, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua-Prototyp:
|
||||
<command>
|
||||
weechat.add_timer_handler(message, function)
|
||||
weechat.add_timer_handler(interval, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
@@ -5106,7 +5535,7 @@ end
|
||||
-- lua
|
||||
weechat.add_timer_handler(60, "my_timer")
|
||||
function my_timer()
|
||||
weechat.print("this is timer handler)
|
||||
weechat.print("this is timer handler")
|
||||
return weechat.PLUGIN_RC_OK()
|
||||
end
|
||||
</screen>
|
||||
@@ -5138,25 +5567,25 @@ end
|
||||
<para>
|
||||
Perl-Prototyp:
|
||||
<command>
|
||||
weechat::add_keyboard_handler(message, function);
|
||||
weechat::add_keyboard_handler(function);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python-Prototyp:
|
||||
<command>
|
||||
weechat.add_keyboard_handler(message, function)
|
||||
weechat.add_keyboard_handler(function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby-Prototyp:
|
||||
<command>
|
||||
Weechat.add_keyboard_handler(message, function)
|
||||
Weechat.add_keyboard_handler(function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua-Prototyp:
|
||||
<command>
|
||||
weechat.add_keyboard_handler(message, function)
|
||||
weechat.add_keyboard_handler(function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
@@ -5423,6 +5852,214 @@ weechat.remove_keyboard_handler("my_keyboard")
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_add_modifier">
|
||||
<title>add_modifier</title>
|
||||
|
||||
<para>
|
||||
Perl-Prototyp:
|
||||
<command>
|
||||
weechat::add_modifier(type, message, function);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python-Prototyp:
|
||||
<command>
|
||||
weechat.add_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby-Prototyp:
|
||||
<command>
|
||||
Weechat.add_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua-Prototyp:
|
||||
<command>
|
||||
weechat.add_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
FĂĽgt einen Nachrichtenmodifikator hinzu.
|
||||
</para>
|
||||
<para>
|
||||
Argumente:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>type</option>: Modifikatorart:
|
||||
<informaltable colsep="0" frame="none">
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Art</entry>
|
||||
<entry>Beschreibung</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>irc_in</literal></entry>
|
||||
<entry>wird bei eingehenden IRC-Nachrichten aufgerufen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_user</literal></entry>
|
||||
<entry>
|
||||
wird bei jeder Benutzernachricht (oder Befehl) aufgerufen
|
||||
(bevor WeeChat die Nachricht parst)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_out</literal></entry>
|
||||
<entry>
|
||||
wird unmittelbar vor dem Abschicken einer ausgehenden
|
||||
Nachricht an den IRC-Server aufgerufen (auch bei
|
||||
Nachrichten, die WeeChat automatisch an den Server
|
||||
sendet)
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option>:Name der IRC-Nachricht (wird nur bei den Arten
|
||||
"irc_in" and "irc_out" benutzt)
|
||||
Um eine Liste der IRC-Nachrichten zu erhalten, lies bitte folgende Dokumente:
|
||||
<acronym>RFC</acronym>s
|
||||
<ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink> and
|
||||
<ulink url="http://www.ietf.org/rfc/rfc2812.txt">2812</ulink>.
|
||||
AuĂźerdem gibt es den Wert "*", der alle Nachrichten anspricht (ohne Filter).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>function</option>: aufgerufene Funktion
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
RĂĽckgabewert: 1 bei Erfolg, 0 bei einem aufgetretenem Fehler
|
||||
</para>
|
||||
<para>
|
||||
Beispiele:
|
||||
<screen>
|
||||
# perl
|
||||
weechat::add_modifier("irc_in", "privmsg", "mod_in");
|
||||
weechat::add_modifier("irc_out", "privmsg", "mod_out");
|
||||
sub mod_in
|
||||
{
|
||||
return "$_[1] [modifier IN]";
|
||||
}
|
||||
sub mod_out
|
||||
{
|
||||
return "$_[1] [modifier OUT]";
|
||||
}
|
||||
|
||||
# python
|
||||
weechat.add_modifier("irc_in", "privmsg", "mod_in")
|
||||
weechat.add_modifier("irc_out", "privmsg", "mod_out")
|
||||
def mod_in(server, args):
|
||||
return args + " [modifier IN]"
|
||||
def mod_out(server, args):
|
||||
return args + " [modifier OUT]"
|
||||
|
||||
# ruby
|
||||
Weechat.add_modifier("irc_in", "privmsg", "mod_in")
|
||||
Weechat.add_modifier("irc_out", "privmsg", "mod_out")
|
||||
def mod_in(server, args)
|
||||
return args + " [modifier IN]"
|
||||
end
|
||||
def mod_out(server, args)
|
||||
return args + " [modifier OUT]"
|
||||
end
|
||||
|
||||
-- lua
|
||||
weechat.add_modifier("irc_in", "privmsg", "mod_in")
|
||||
weechat.add_modifier("irc_out", "privmsg", "mod_out")
|
||||
function mod_in(server, args)
|
||||
return args .. " [modifier IN]"
|
||||
end
|
||||
function mod_out(server, args)
|
||||
return args .. " [modifier OUT]"
|
||||
end
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_remove_modifier">
|
||||
<title>remove_modifier</title>
|
||||
|
||||
<para>
|
||||
Perl-Prototyp:
|
||||
<command>
|
||||
weechat::remove_modifier(type, message, function);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python-Prototyp:
|
||||
<command>
|
||||
weechat.remove_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby-Prototyp:
|
||||
<command>
|
||||
Weechat.remove_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua-Prototyp:
|
||||
<command>
|
||||
weechat.remove_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Entfernt einen Nachrichtenmodifikator.
|
||||
</para>
|
||||
<para>
|
||||
Argumente:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>type</option>: Modifikatorart
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option>: Nachrichtenart, die der Modifikator verwaltet
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>function</option>: Funktion
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
RĂĽckgabewert: 1 bei Erfolg, 0 bei einem aufgetretenem Fehler
|
||||
</para>
|
||||
<para>
|
||||
Beispiele:
|
||||
<screen>
|
||||
# perl
|
||||
weechat::remove_modifier("irc_in", "privmsg", "mod_in");
|
||||
|
||||
# python
|
||||
weechat.remove_modifier("irc_in", "privmsg", "mod_in")
|
||||
|
||||
# ruby
|
||||
Weechat.remove_modifier("irc_in", "privmsg", "mod_in")
|
||||
|
||||
-- lua
|
||||
weechat.remove_modifier("irc_in", "privmsg", "mod_in")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_command">
|
||||
<title>command</title>
|
||||
|
||||
@@ -6113,19 +6750,19 @@ value2 = weechat.get_config("freenode.server_autojoin")
|
||||
<screen>
|
||||
# perl
|
||||
weechat::set_config("look_nicklist", "off");
|
||||
weechat::set_config("freenode.server_autojoin, "#weechat");
|
||||
weechat::set_config("freenode.server_autojoin", "#weechat");
|
||||
|
||||
# python
|
||||
weechat.set_config("look_nicklist", "off")
|
||||
weechat.set_config("freenode.server_autojoin, "#weechat")
|
||||
weechat.set_config("freenode.server_autojoin", "#weechat")
|
||||
|
||||
# ruby
|
||||
Weechat.set_config("look_nicklist", "off")
|
||||
Weechat.set_config("freenode.server_autojoin, "#weechat")
|
||||
Weechat.set_config("freenode.server_autojoin", "#weechat")
|
||||
|
||||
-- lua
|
||||
weechat.set_config("look_nicklist", "off")
|
||||
weechat.set_config("freenode.server_autojoin, "#weechat")
|
||||
weechat.set_config("freenode.server_autojoin", "#weechat")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -6709,8 +7346,8 @@ end
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Kolter</emphasis>
|
||||
<email>kolter AT free.fr</email> -
|
||||
<emphasis>kolter (Emmanuel Bouthenot)</emphasis>
|
||||
<email>kolter AT openics.org</email> -
|
||||
Entwickler
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
+23
-28
@@ -9,27 +9,27 @@
|
||||
<programlisting>
|
||||
einen Alias fĂĽr einen Befehl anlegen
|
||||
|
||||
alias_name: name of alias
|
||||
command: command name (WeeChat or IRC command, many commands can be separated by semicolons)
|
||||
arguments: arguments for command
|
||||
Aliasname: Name des Alias
|
||||
Befehl: Befehlsname (WeeChat- oder IRC-Befehl ohne führenden '/', mehrere Befehle können durch Semikola getrennt werden)
|
||||
Argumente: Argumente fĂĽr den Befehl
|
||||
|
||||
</programlisting>
|
||||
<command>is replaced by all arguments.</command>
|
||||
<command>wird durch alle Argumente ersetzt.</command>
|
||||
<programlisting>
|
||||
</programlisting>
|
||||
<command>buffer [Aktion [Argumente] | Nummer | [[Server] [Channel]]]</command>
|
||||
<programlisting>
|
||||
Puffer verwalten
|
||||
|
||||
action: action to do:
|
||||
move: move buffer in the list (may be relative, for example -1)
|
||||
close: close buffer (optional arg is part message, for a channel)
|
||||
list: list open buffers (no parameter implies this list)
|
||||
notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)
|
||||
(when executed on server buffer, this sets default notify level for whole server)
|
||||
server,
|
||||
channel: jump to buffer by server and/or channel name
|
||||
number: jump to buffer by number
|
||||
Aktion: Pufferaktion:
|
||||
move: Puffer in der Liste bewegen (kann auch relativ sein, wie -1)
|
||||
close: Puffer schlieĂźen (eine Part-Message kann optional angegeben werden)
|
||||
list: alle offenen Puffer auflisten (Standardaktion)
|
||||
notify: Notify-Level für Puffer festlegen (0=nie, 1=bei hervorgehobenen Nachrichten, 2=1+persönliche Nachricht, 3=2+join/part)
|
||||
(wenn der Befehl in einem Server Puffer ausgefĂĽhrt wird, setzt er den Default-Notify-Level fĂĽr den ganzen Server)
|
||||
Server
|
||||
Channel: gehe zum Puffer mit Servernamen oder Channelnamen
|
||||
Nummer: gehe zu Puffer mit dieser Nummer
|
||||
|
||||
</programlisting>
|
||||
<command>builtin Befehl</command>
|
||||
@@ -39,16 +39,6 @@ starte eingebauten WeeChat/IRC-Befehl (ohne Plugin-Handler oder Aliase)
|
||||
Befehl: auszufĂĽhrender Befehl (falls nicht vorhanden wird automatisch ein '/' vorangestellt)
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>charset [(decode_iso | decode_utf | encode) Zeichensatz]</command>
|
||||
<programlisting>
|
||||
ändere Zeichensatz für den Server oder Channel
|
||||
|
||||
decode_iso: Zeichensatz um ISO zu decoden
|
||||
decode_utf: Zeichensatz um UTF zu decoden
|
||||
encode: der zum encoden benutzte Zeichensatz
|
||||
Zeichensatz: Zeichensatz, der benutzt werden soll (zum Beispiel: ISO-8859-15, UTF-8,..)
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all]</command>
|
||||
<programlisting>
|
||||
@@ -118,23 +108,28 @@ Bei jedem Argument steht '*' f
|
||||
Ohne Argumente listet /ignore alle definierten /ignore-Regeln auf.
|
||||
|
||||
</programlisting>
|
||||
<command>key [Taste Funktion/Befehl] [unbind Taste] [functions] [reset -yes]</command>
|
||||
<command>key [Taste [Funktion/Befehl]] [unbind Taste] [functions] [reset -yes]</command>
|
||||
<programlisting>
|
||||
belegen/freigeben von Tasten
|
||||
|
||||
Taste: diese Taste mit einer internen Funktion oder einem Befehl, beginnend mit "/", belegen
|
||||
unbind: Tastenbelegung aufheben
|
||||
functions: interne Funktionen fĂĽr Tastenbelegungen auflisten
|
||||
reset: Standardbelegung wiederherstellen und entferne alle eigenen Belegungen (Vorsicht!)
|
||||
reset: Standardbelegung wiederherstellen und entferne ALLE eigenen Belegungen (Vorsicht!)
|
||||
|
||||
</programlisting>
|
||||
<command>plugin [load Dateiname] | [autoload] | [reload] | [unload]</command>
|
||||
<command>plugin [list [Name]] | [listfull [Name]] | [load Dateiname] | [autoload] | [reload [Name]] | [unload [Name]]</command>
|
||||
<programlisting>
|
||||
auflisten/laden/entladen von Plugins
|
||||
|
||||
Dateiname: zu ladendes Plugin
|
||||
list: geladene Plugins auflisten
|
||||
listfull: geladene Plugins mit Details fĂĽr jedes Plugin auflisten
|
||||
load: lade ein Plugin
|
||||
autoload: lade automatisch alle Plugins im System- oder Benutzerverzeichnis
|
||||
reload: lade ein Plugin erneut (wenn kein Name vorgegeben ist, werden alle Plugins entladen und autolade die Plugins)
|
||||
unload: entlade eines oder alle Plugins
|
||||
|
||||
Ohne Argumente werden alle geladenen Plugins aufgelistet.
|
||||
Ohne Argument, listet /plugin alle geladenen Plugins auf.
|
||||
|
||||
</programlisting>
|
||||
<command>server [Servername] | [Servername Hostname Port [-auto | -noauto] [-ipv6] [-ssl] [-pwd Passwort] [-nicks Nick1 Nick2 Nick3] [-username Benutzername] [-realname Name] [-command Befehl] [-autojoin Channel[,Channel]] ] | [del Servername]</command>
|
||||
|
||||
+19
-3
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
@@ -22,9 +22,13 @@ QUICKSTART = weechat_quickstart.$(LANGCODE).txt
|
||||
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
|
||||
|
||||
if DBLATEX_FOUND
|
||||
PDF = pdf-stamp
|
||||
endif
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
all-local: html-stamp
|
||||
all-local: html-stamp $(PDF)
|
||||
|
||||
# HTML output with chunks (many pages)
|
||||
|
||||
@@ -48,16 +52,28 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
|
||||
cp ../weechat-doc.css html1/
|
||||
touch html1-stamp
|
||||
|
||||
# PDF output
|
||||
|
||||
pdf: pdf-stamp
|
||||
|
||||
pdf-stamp: $(BOOK).xml $(BOOK_INCLUDE)
|
||||
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
|
||||
dblatex -c ../dblatex.conf $(BOOK).xml || true
|
||||
touch pdf-stamp
|
||||
|
||||
# install docs
|
||||
|
||||
install-data-hook:
|
||||
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
|
||||
if DBLATEX_FOUND
|
||||
$(INSTALL_DATA) $(BOOK).pdf $(DESTDIR)$(docdir)/
|
||||
endif
|
||||
|
||||
# clean
|
||||
|
||||
clean-local:
|
||||
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
|
||||
-rm -rf html/ html1/
|
||||
-rm -f html-stamp html1-stamp
|
||||
-rm -f html-stamp html1-stamp pdf-stamp
|
||||
|
||||
+28
-49
@@ -40,34 +40,6 @@
|
||||
<entry>'the geekest IRC client!'</entry>
|
||||
<entry>WeeChat slogan (if empty, slogan is not used)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_decode_iso</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>'ISO-8859-1'</entry>
|
||||
<entry>ISO charset for decoding messages from server (used only if locale is UTF-8) (if empty, messages are not converted if locale is UTF-8)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_decode_utf</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>'UTF-8'</entry>
|
||||
<entry>UTF charset for decoding messages from server (used only if locale is not UTF-8) (if empty, messages are not converted if locale is not UTF-8)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_encode</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Charset for encoding messages sent to server, examples: UTF-8, ISO-8859-1 (if empty, messages are not converted)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_internal</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Forces internal WeeChat charset (should be empty in most cases, that means detected charset is used)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_one_server_buffer</option></entry>
|
||||
<entry>boolean</entry>
|
||||
@@ -138,6 +110,13 @@
|
||||
<entry>0</entry>
|
||||
<entry>Max size for nicklist (width or height, depending on look_nicklist_position (0 = no max size; if min == max and > 0, then size is fixed))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nicklist_separator</option></entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>'on' or 'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Separator between chat and nicklist</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_no_nickname</option></entry>
|
||||
<entry>string</entry>
|
||||
@@ -320,6 +299,13 @@
|
||||
<entry>'default'</entry>
|
||||
<entry>Color for title bar</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_title_more</option></entry>
|
||||
<entry>color</entry>
|
||||
<entry>Curses or Gtk color</entry>
|
||||
<entry>'lightmagenta'</entry>
|
||||
<entry>Color for '+' when scrolling topic</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_title_bg</option></entry>
|
||||
<entry>color</entry>
|
||||
@@ -915,6 +901,13 @@
|
||||
<entry>5</entry>
|
||||
<entry>Disconnect after important lag (in minutes, 0 = never disconnect)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_anti_flood</option></entry>
|
||||
<entry>integer</entry>
|
||||
<entry>between 0 and 5</entry>
|
||||
<entry>2</entry>
|
||||
<entry>Anti-flood: # seconds between two user messages (0 = no anti-flood)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_fifo_pipe</option></entry>
|
||||
<entry>boolean</entry>
|
||||
@@ -943,6 +936,13 @@
|
||||
<entry>'on'</entry>
|
||||
<entry>Allow user to send colors with special codes (%B=bold, %Cxx,yy=color, %U=underline, %R=reverse)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_send_unknown_commands</option></entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>'on' or 'off'</entry>
|
||||
<entry>'off'</entry>
|
||||
<entry>Send unknown commands to IRC server</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>dcc_auto_accept_files</option></entry>
|
||||
<entry>boolean</entry>
|
||||
@@ -1237,24 +1237,3 @@
|
||||
<entry>''</entry>
|
||||
<entry>Comma separated list of notify levels for channels of this server (format: #channel:1,..), a channel name '*' is reserved for server default notify level</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_charset_decode_iso</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Comma separated list of charsets for server and channels, to decode ISO (format: server:charset,#channel:charset,..)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_charset_decode_utf</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Comma separated list of charsets for server and channels, to decode UTF (format: server:charset,#channel:charset,..)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_charset_encode</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Comma separated list of charsets for server and channels, to encode messages (format: server:charset,#channel:charset,..)</entry>
|
||||
</row>
|
||||
|
||||
@@ -42,11 +42,11 @@ bans nicks or hosts
|
||||
nickname: user or host to ban
|
||||
|
||||
</programlisting>
|
||||
<command>ctcp nickname type [arguments]</command>
|
||||
<command>ctcp receiver type [arguments]</command>
|
||||
<programlisting>
|
||||
send a CTCP message (Client-To-Client Protocol)
|
||||
|
||||
nickname: user to send CTCP to
|
||||
receiver: nick or channel to send CTCP to
|
||||
type: CTCP type (examples: "version", "ping", ..)
|
||||
arguments: arguments for CTCP
|
||||
|
||||
|
||||
@@ -117,6 +117,14 @@
|
||||
<entry><literal>scroll_bottom</literal></entry>
|
||||
<entry>scroll to bottom of buffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_topic_left</literal></entry>
|
||||
<entry>scroll left topic</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_topic_right</literal></entry>
|
||||
<entry>scroll right topic</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_beginning</literal></entry>
|
||||
<entry>display beginning of nicklist</entry>
|
||||
|
||||
+681
-44
@@ -4,7 +4,7 @@
|
||||
|
||||
WeeChat documentation (english version)
|
||||
|
||||
Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
|
||||
This manual is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
<bookinfo>
|
||||
|
||||
<title>WeeChat 0.2.1 - User guide</title>
|
||||
<title>WeeChat 0.2.2 - User guide</title>
|
||||
<subtitle>Fast, light and extensible IRC client</subtitle>
|
||||
|
||||
<author>
|
||||
@@ -508,6 +508,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Redraw whole window
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Ctrl + T</entry>
|
||||
<entry>
|
||||
Transpose chars
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Ctrl + U</entry>
|
||||
<entry>
|
||||
@@ -521,7 +527,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Backspace</entry>
|
||||
<entry>Ctrl + Y</entry>
|
||||
<entry>
|
||||
Paste clipboard content
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Backspace / Ctrl + H</entry>
|
||||
<entry>
|
||||
Delete previous char in command line
|
||||
</entry>
|
||||
@@ -533,7 +545,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Tab</entry>
|
||||
<entry>Tab / Shift + Tab</entry>
|
||||
<entry>
|
||||
Complete command or nick
|
||||
(Tab again: find next completion)
|
||||
@@ -546,7 +558,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Enter</entry>
|
||||
<entry>Enter / Ctrl + J / Ctrl + M</entry>
|
||||
<entry>
|
||||
Execute command or send message
|
||||
</entry>
|
||||
@@ -607,9 +619,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>F10</entry>
|
||||
<entry>F9 / F10</entry>
|
||||
<entry>
|
||||
Remove last infobar message
|
||||
Scroll topic
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@@ -656,6 +668,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
(activity notification on other buffers)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Alt + I</entry>
|
||||
<entry>
|
||||
Remove last infobar message
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Alt + J then Alt + D</entry>
|
||||
<entry>
|
||||
@@ -987,7 +1005,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
<para>
|
||||
List of options for config file:
|
||||
<informaltable colsep="0" frame="none">
|
||||
<tgroup cols="2">
|
||||
<tgroup cols="5">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Option</entry>
|
||||
@@ -1260,6 +1278,129 @@ fi
|
||||
<section id="secAPIFunctions">
|
||||
<title>API functions</title>
|
||||
|
||||
<section id="secAPI_set_charset">
|
||||
<title>set_charset</title>
|
||||
|
||||
<para>
|
||||
Prototype:
|
||||
<command>
|
||||
void set_charset (t_weechat_plugin *plugin, char *charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Set new plugin charset.
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: pointer to plugin structure
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: new charset to use
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Example:
|
||||
<screen>plugin->set_charset (plugin, "ISO-8859-1");</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_iconv_to_internal">
|
||||
<title>iconv_to_internal</title>
|
||||
|
||||
<para>
|
||||
Prototype:
|
||||
<command>
|
||||
void iconv_to_internal (t_weechat_plugin *plugin, char *charset,
|
||||
char *string)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Convert string to WeeChat internal charset (UTF-8).
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: pointer to plugin structure
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: charset to convert
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>string</option>: string to convert
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Return value: converted string.
|
||||
</para>
|
||||
<para>
|
||||
Note: result has to be free by a call to "free" after use.
|
||||
</para>
|
||||
<para>
|
||||
Example:
|
||||
<screen>char *str = plugin->iconv_to_internal (plugin, "ISO-8859-1", "iso string: Ă© Ă ");</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_iconv_from_internal">
|
||||
<title>iconv_from_internal</title>
|
||||
|
||||
<para>
|
||||
Prototype:
|
||||
<command>
|
||||
void iconv_from_internal (t_weechat_plugin *plugin, char *charset,
|
||||
char *string)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Convert string from internal WeeChat charset (UTF-8) to another.
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: pointer to plugin structure
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: target charset
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>string</option>: string to convert
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Return value: converted string.
|
||||
</para>
|
||||
<para>
|
||||
Note: result has to be free by a call to "free" after use.
|
||||
</para>
|
||||
<para>
|
||||
Example:
|
||||
<screen>char *str = plugin->iconv_from_internal (plugin, "ISO-8859-1", "utf-8 string: Ă© Ă ");</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_ascii_strcasecmp">
|
||||
<title>ascii_strcasecmp</title>
|
||||
|
||||
@@ -1796,7 +1937,8 @@ plugin->log (plugin, "freenode", "#weechat", "test");
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option>: name of IRC message.
|
||||
<option>message</option>: name of IRC message ("*" for all
|
||||
messages).
|
||||
To know list of IRC messages, please consult
|
||||
<acronym>RFC</acronym>s
|
||||
<ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink> and
|
||||
@@ -1930,7 +2072,9 @@ int msg_kick (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);
|
||||
t_plugin_handler *msg_handler;
|
||||
msg_handler = plugin->msg_handler_add (plugin, "KICK",
|
||||
&msg_kick, NULL, NULL);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2028,10 +2172,10 @@ plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);
|
||||
<entry><literal>%C</literal></entry>
|
||||
<entry>channels of current server</entry>
|
||||
</row>
|
||||
<!-- <row>
|
||||
<row>
|
||||
<entry><literal>%f</literal></entry>
|
||||
<entry>file name</entry>
|
||||
</row> -->
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>%h</literal></entry>
|
||||
<entry>plugins commands</entry>
|
||||
@@ -2180,9 +2324,10 @@ int cmd_test (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->cmd_handler_add (plugin, "test", "Test command",
|
||||
"[nick]", "nick: nick of channel",
|
||||
"%n", &cmd_test, NULL, NULL);
|
||||
t_plugin_handler *cmd_handler;
|
||||
cmd_handler = plugin->cmd_handler_add (plugin, "test", "Test command",
|
||||
"[nick]", "nick: nick of channel",
|
||||
"%n", &cmd_test, NULL, NULL);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2274,7 +2419,8 @@ int my_timer (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->timer_handler_add (plugin, 60, &my_timer);
|
||||
t_plugin_handler *timer_handler;
|
||||
timer_handler = plugin->timer_handler_add (plugin, 60, &my_timer);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2372,8 +2518,8 @@ plugin->timer_handler_add (plugin, 60, &my_timer);
|
||||
<para>
|
||||
Example:
|
||||
<screen>
|
||||
int keyb_handler (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
char *handler_args, void *handler_pointer)
|
||||
int my_keyb (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
char *handler_args, void *handler_pointer)
|
||||
{
|
||||
if (argc == 2)
|
||||
{
|
||||
@@ -2386,7 +2532,8 @@ int keyb_handler (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->keyboard_handler_add (plugin, &keyb_handler);
|
||||
t_plugin_handler *keyb_handler;
|
||||
keyb_handler = plugin->keyboard_handler_add (plugin, &my_keyb);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2459,6 +2606,214 @@ plugin->keyboard_handler_add (plugin, &keyb_handler);
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_modifier_add">
|
||||
<title>modifier_add</title>
|
||||
|
||||
<para>
|
||||
Prototype:
|
||||
<command>
|
||||
t_plugin_modifier *modifier_add (t_weechat_plugin *plugin,
|
||||
char *type, char *message, t_plugin_modifier_func *function,
|
||||
char *modifier_args, void *modifier_pointer)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Add a message modifier.
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: pointer to plugin structure
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>type</option>: modifier type:
|
||||
<informaltable colsep="0" frame="none">
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Type</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>irc_in</literal></entry>
|
||||
<entry>called for incoming IRC messages</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_user</literal></entry>
|
||||
<entry>
|
||||
called for each user message (or command) (before
|
||||
WeeChat parses message)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_out</literal></entry>
|
||||
<entry>
|
||||
called for outgoing messages, immediately before
|
||||
sending it to IRC server (this includes messages
|
||||
sent automatically by WeeChat to server)
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option>: name of IRC message (used only for
|
||||
types "irc_in" and "irc_out").
|
||||
To know list of IRC messages, please consult
|
||||
<acronym>RFC</acronym>s
|
||||
<ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink> and
|
||||
<ulink url="http://www.ietf.org/rfc/rfc2812.txt">2812</ulink>.
|
||||
Moreover, special value "*" means all messages (no filter).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>function</option>: function called
|
||||
</para>
|
||||
<para>
|
||||
It uses following prototype:
|
||||
<command>
|
||||
int my_function (t_weechat_plugin *plugin,
|
||||
int argc, char **argv,
|
||||
char *modifier_args, void *modifier_pointer)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Argument argc is set to 2, following values are set in
|
||||
argv array:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>argv[0] = server name</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>argv[1] = message</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>modifier_args</option>: arguments given to function
|
||||
when called
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>modifier_pointer</option>: pointer given to function
|
||||
when called
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Return value: pointer to new message modifier.
|
||||
</para>
|
||||
<para>
|
||||
Note: function has to return modified string, or NULL if no
|
||||
changes are made to message.
|
||||
If function returns empty string, then message is dropped and
|
||||
will not be read at all by WeeChat (be careful when dropping
|
||||
messages!).
|
||||
Returned string must have been allocated by malloc() and will
|
||||
be freed (with call to free()) automatically by WeeChat after use.
|
||||
</para>
|
||||
<para>
|
||||
Example:
|
||||
<screen>
|
||||
char *adder (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
char *modifier_args, void *modifier_pointer)
|
||||
{
|
||||
char *string;
|
||||
string = (char *)malloc (strlen (argv[1]) + 16);
|
||||
strcpy (string, argv[1]);
|
||||
strcat (string, "test");
|
||||
return string;
|
||||
}
|
||||
...
|
||||
t_plugin_modifier *modifier;
|
||||
modifier = plugin->modifier_add (plugin, "irc_in", "privmsg",
|
||||
&adder, NULL, NULL);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_modifier_remove">
|
||||
<title>modifier_remove</title>
|
||||
|
||||
<para>
|
||||
Prototype:
|
||||
<command>
|
||||
void modifier_remove (t_weechat_plugin *plugin,
|
||||
t_plugin_modifier *modifier)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Remove a message modifier.
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: pointer to plugin structure
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>modifier</option>: modifier to remove
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Return value: none.
|
||||
</para>
|
||||
<para>
|
||||
Example:
|
||||
<screen>plugin->modifier_remove (plugin, my_modifier);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_modifier_remove_all">
|
||||
<title>modifier_remove_all</title>
|
||||
|
||||
<para>
|
||||
Prototype:
|
||||
<command>
|
||||
void modifier_remove_all (t_weechat_plugin *plugin)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Remove all modifiers for a plugin.
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option>: pointer to plugin structure
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Return value: none.
|
||||
</para>
|
||||
<para>
|
||||
Example:
|
||||
<screen>plugin->modifier_remove_all (plugin);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_exec_command">
|
||||
<title>exec_command</title>
|
||||
|
||||
@@ -4110,6 +4465,11 @@ else
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>time_t</entry>
|
||||
<entry><literal>date</literal></entry>
|
||||
<entry>date and time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>char *</entry>
|
||||
<entry><literal>nick</literal></entry>
|
||||
@@ -4142,13 +4502,16 @@ else
|
||||
Example:
|
||||
<screen>
|
||||
t_plugin_buffer_line *buffer_line, *ptr_line;
|
||||
char text_time[256];
|
||||
|
||||
buffer_line = plugin->get_buffer_data (plugin);
|
||||
if (buffer_line)
|
||||
{
|
||||
for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
|
||||
{
|
||||
plugin->print (plugin, NULL, NULL, "nick: %s, data: %s", ptr_line->nick, ptr_line->data);
|
||||
strftime (text_time, sizeof (text_time), "%x %X", localtime (&(ptr_line->date)));
|
||||
plugin->print (plugin, NULL, NULL, "date: %s, nick: %s, data: %s",
|
||||
text_time, ptr_line->nick, ptr_line->data);
|
||||
}
|
||||
plugin->free_buffer_data (plugin, buffer_line);
|
||||
}
|
||||
@@ -4449,25 +4812,25 @@ end
|
||||
<para>
|
||||
Perl prototype:
|
||||
<command>
|
||||
weechat::register(name, version, end_function, description);
|
||||
weechat::register(name, version, end_function, description, [charset]);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python prototype:
|
||||
<command>
|
||||
weechat.register(name, version, end_function, description)
|
||||
weechat.register(name, version, end_function, description, [charset])
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby prototype:
|
||||
<command>
|
||||
Weechat.register(name, version, end_function, description)
|
||||
Weechat.register(name, version, end_function, description, [charset])
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua prototype:
|
||||
<command>
|
||||
weechat.register(name, version, end_function, description)
|
||||
weechat.register(name, version, end_function, description, [charset])
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
@@ -4500,6 +4863,12 @@ end
|
||||
<option>description</option>: short description of script
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: charset used by script, you should
|
||||
set this if script is not written with UTF-8
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -4509,16 +4878,77 @@ end
|
||||
Examples:
|
||||
<screen>
|
||||
# perl
|
||||
weechat::register("test", "1.0", "end_test", "Test script!");
|
||||
weechat::register("test", "1.0", "end_test", "Test script!", "ISO-8859-1");
|
||||
|
||||
# python
|
||||
weechat.register("test", "1.0", "end_test", "Test script!")
|
||||
weechat.register("test", "1.0", "end_test", "Test script!", "ISO-8859-1")
|
||||
|
||||
# ruby
|
||||
Weechat.register("test", "1.0", "end_test", "Test script!")
|
||||
Weechat.register("test", "1.0", "end_test", "Test script!", "ISO-8859-1")
|
||||
|
||||
-- lua
|
||||
weechat.register("test", "1.0", "end_test", "Test script!")
|
||||
weechat.register("test", "1.0", "end_test", "Test script!", "ISO-8859-1")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_set_charset">
|
||||
<title>set_charset</title>
|
||||
|
||||
<para>
|
||||
Perl prototype:
|
||||
<command>
|
||||
weechat::set_charset(charset);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python prototype:
|
||||
<command>
|
||||
weechat.set_charset(charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby prototype:
|
||||
<command>
|
||||
Weechat.set_charset(charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua prototype:
|
||||
<command>
|
||||
weechat.set_charset(charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Set new script charset.
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option>: new script charset
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Return value: 1 if new charset was set, 0 if an error occured.
|
||||
</para>
|
||||
<para>
|
||||
Examples:
|
||||
<screen>
|
||||
# perl
|
||||
weechat::set_charset("ISO-8859-1");
|
||||
|
||||
# python
|
||||
weechat.set_charset("ISO-8859-1")
|
||||
|
||||
# ruby
|
||||
Weechat.set_charset("ISO-8859-1")
|
||||
|
||||
-- lua
|
||||
weechat.set_charset("ISO-8859-1")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -5076,25 +5506,25 @@ end
|
||||
<para>
|
||||
Perl prototype:
|
||||
<command>
|
||||
weechat::add_timer_handler(message, function);
|
||||
weechat::add_timer_handler(interval, function);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python prototype:
|
||||
<command>
|
||||
weechat.add_timer_handler(message, function)
|
||||
weechat.add_timer_handler(interval, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby prototype:
|
||||
<command>
|
||||
Weechat.add_timer_handler(message, function)
|
||||
Weechat.add_timer_handler(interval, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua prototype:
|
||||
<command>
|
||||
weechat.add_timer_handler(message, function)
|
||||
weechat.add_timer_handler(interval, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
@@ -5146,7 +5576,7 @@ end
|
||||
-- lua
|
||||
weechat.add_timer_handler(60, "my_timer")
|
||||
function my_timer()
|
||||
weechat.print("this is timer handler)
|
||||
weechat.print("this is timer handler")
|
||||
return weechat.PLUGIN_RC_OK()
|
||||
end
|
||||
</screen>
|
||||
@@ -5175,25 +5605,25 @@ end
|
||||
<para>
|
||||
Perl prototype:
|
||||
<command>
|
||||
weechat::add_keyboard_handler(message, function);
|
||||
weechat::add_keyboard_handler(function);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python prototype:
|
||||
<command>
|
||||
weechat.add_keyboard_handler(message, function)
|
||||
weechat.add_keyboard_handler(function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby prototype:
|
||||
<command>
|
||||
Weechat.add_keyboard_handler(message, function)
|
||||
Weechat.add_keyboard_handler(function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua prototype:
|
||||
<command>
|
||||
weechat.add_keyboard_handler(message, function)
|
||||
weechat.add_keyboard_handler(function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
@@ -5273,7 +5703,7 @@ end
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_remode_handler">
|
||||
<section id="secScript_remove_handler">
|
||||
<title>remove_handler</title>
|
||||
|
||||
<para>
|
||||
@@ -5461,6 +5891,213 @@ weechat.remove_keyboard_handler("my_keyboard")
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_add_modifier">
|
||||
<title>add_modifier</title>
|
||||
|
||||
<para>
|
||||
Perl prototype:
|
||||
<command>
|
||||
weechat::add_modifier(type, message, function);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python prototype:
|
||||
<command>
|
||||
weechat.add_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby prototype:
|
||||
<command>
|
||||
Weechat.add_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua prototype:
|
||||
<command>
|
||||
weechat.add_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Add a message modifier.
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>type</option>: modifier type:
|
||||
<informaltable colsep="0" frame="none">
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Type</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>irc_in</literal></entry>
|
||||
<entry>called for incoming IRC messages</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_user</literal></entry>
|
||||
<entry>
|
||||
called for each user message (or command) (before
|
||||
WeeChat parses message)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_out</literal></entry>
|
||||
<entry>
|
||||
called for outgoing messages, immediately before
|
||||
sending it to IRC server (this includes messages
|
||||
sent automatically by WeeChat to server)
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option>: name of IRC message (used only for
|
||||
types "irc_in" and "irc_out").
|
||||
To know list of IRC messages, please consult
|
||||
<acronym>RFC</acronym>s
|
||||
<ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink> and
|
||||
<ulink url="http://www.ietf.org/rfc/rfc2812.txt">2812</ulink>.
|
||||
Moreover, special value "*" means all messages (no filter).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>function</option>: function called
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Return value: 1 if success, 0 if an error occurred.
|
||||
</para>
|
||||
<para>
|
||||
Examples:
|
||||
<screen>
|
||||
# perl
|
||||
weechat::add_modifier("irc_in", "privmsg", "mod_in");
|
||||
weechat::add_modifier("irc_out", "privmsg", "mod_out");
|
||||
sub mod_in
|
||||
{
|
||||
return "$_[1] [modifier IN]";
|
||||
}
|
||||
sub mod_out
|
||||
{
|
||||
return "$_[1] [modifier OUT]";
|
||||
}
|
||||
|
||||
# python
|
||||
weechat.add_modifier("irc_in", "privmsg", "mod_in")
|
||||
weechat.add_modifier("irc_out", "privmsg", "mod_out")
|
||||
def mod_in(serveur, args):
|
||||
return args + " [modifier IN]"
|
||||
def mod_out(serveur, args):
|
||||
return args + " [modifier OUT]"
|
||||
|
||||
# ruby
|
||||
Weechat.add_modifier("irc_in", "privmsg", "mod_in")
|
||||
Weechat.add_modifier("irc_out", "privmsg", "mod_out")
|
||||
def mod_in(server, args)
|
||||
return args + " [modifier IN]"
|
||||
end
|
||||
def mod_out(server, args)
|
||||
return args + " [modifier OUT]"
|
||||
end
|
||||
|
||||
-- lua
|
||||
weechat.add_modifier("irc_in", "privmsg", "mod_in")
|
||||
weechat.add_modifier("irc_out", "privmsg", "mod_out")
|
||||
function mod_in(server, args)
|
||||
return args .. " [modifier IN]"
|
||||
end
|
||||
function mod_out(server, args)
|
||||
return args .. " [modifier OUT]"
|
||||
end
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_remove_modifier">
|
||||
<title>remove_modifier</title>
|
||||
|
||||
<para>
|
||||
Perl prototype:
|
||||
<command>
|
||||
weechat::remove_modifier(type, message, function);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Python prototype:
|
||||
<command>
|
||||
weechat.remove_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ruby prototype:
|
||||
<command>
|
||||
Weechat.remove_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Lua prototype:
|
||||
<command>
|
||||
weechat.remove_modifier(type, message, function)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Remove a message modifier.
|
||||
</para>
|
||||
<para>
|
||||
Arguments:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>type</option>: modifier type
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option>: message managed by modifier
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>function</option>: function
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Return value: 1 if success, 0 if an error occurred.
|
||||
</para>
|
||||
<para>
|
||||
Examples:
|
||||
<screen>
|
||||
# perl
|
||||
weechat::remove_modifier("irc_in", "privmsg", "mod_in");
|
||||
|
||||
# python
|
||||
weechat.remove_modifier("irc_in", "privmsg", "mod_in")
|
||||
|
||||
# ruby
|
||||
Weechat.remove_modifier("irc_in", "privmsg", "mod_in")
|
||||
|
||||
-- lua
|
||||
weechat.remove_modifier("irc_in", "privmsg", "mod_in")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_command">
|
||||
<title>command</title>
|
||||
|
||||
@@ -6154,19 +6791,19 @@ value2 = weechat.get_config("freenode.server_autojoin")
|
||||
<screen>
|
||||
# perl
|
||||
weechat::set_config("look_nicklist", "off");
|
||||
weechat::set_config("freenode.server_autojoin, "#weechat");
|
||||
weechat::set_config("freenode.server_autojoin", "#weechat");
|
||||
|
||||
# python
|
||||
weechat.set_config("look_nicklist", "off")
|
||||
weechat.set_config("freenode.server_autojoin, "#weechat")
|
||||
weechat.set_config("freenode.server_autojoin", "#weechat")
|
||||
|
||||
# ruby
|
||||
Weechat.set_config("look_nicklist", "off")
|
||||
Weechat.set_config("freenode.server_autojoin, "#weechat")
|
||||
Weechat.set_config("freenode.server_autojoin", "#weechat")
|
||||
|
||||
-- lua
|
||||
weechat.set_config("look_nicklist", "off")
|
||||
weechat.set_config("freenode.server_autojoin, "#weechat")
|
||||
weechat.set_config("freenode.server_autojoin", "#weechat")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -6750,8 +7387,8 @@ end
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Kolter</emphasis>
|
||||
<email>kolter AT free.fr</email> -
|
||||
<emphasis>kolter (Emmanuel Bouthenot)</emphasis>
|
||||
<email>kolter AT openics.org</email> -
|
||||
developer
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
+10
-15
@@ -39,16 +39,6 @@ launch WeeChat/IRC builtin command (do not look at plugins handlers or aliases)
|
||||
command: command to execute (a '/' is automatically added if not found at beginning of command)
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>charset [(decode_iso | decode_utf | encode) charset]</command>
|
||||
<programlisting>
|
||||
change charset for server or channel
|
||||
|
||||
decode_iso: charset used for decoding ISO
|
||||
decode_utf: charset used for decoding UTF
|
||||
encode: charset used for encoding messages
|
||||
charset: charset to use (for example: ISO-8859-15, UTF-8,..)
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all]</command>
|
||||
<programlisting>
|
||||
@@ -117,23 +107,28 @@ For each argument, '*' means all.
|
||||
Without argument, /ignore command lists all defined ignore.
|
||||
|
||||
</programlisting>
|
||||
<command>key [key function/command] [unbind key] [functions] [reset -yes]</command>
|
||||
<command>key [key [function/command]] [unbind key] [functions] [reset -yes]</command>
|
||||
<programlisting>
|
||||
bind/unbind keys
|
||||
|
||||
key: bind this key to an internal function or a command (beginning by "/")
|
||||
key: display or bind this key to an internal function or a command (beginning by "/")
|
||||
unbind: unbind a key
|
||||
functions: list internal functions for key bindings
|
||||
reset: restore bindings to the default values and delete ALL personal bindings (use carefully!)
|
||||
|
||||
</programlisting>
|
||||
<command>plugin [load filename] | [autoload] | [reload] | [unload]</command>
|
||||
<command>plugin [list [name]] | [listfull [name]] | [load filename] | [autoload] | [reload [name]] | [unload [name]]</command>
|
||||
<programlisting>
|
||||
list/load/unload plugins
|
||||
|
||||
filename: WeeChat plugin (file) to load
|
||||
list: list loaded plugins
|
||||
listfull: list loaded plugins with detailed info for each plugin
|
||||
load: load a plugin
|
||||
autoload: autoload plugins in system or user directory
|
||||
reload: reload one plugin (if no name given, unload all plugins, then autoload plugins)
|
||||
unload: unload one or all plugins
|
||||
|
||||
Without argument, /plugin command lists all loaded plugins.
|
||||
Without argument, /plugin command lists loaded plugins.
|
||||
|
||||
</programlisting>
|
||||
<command>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]</command>
|
||||
|
||||
+19
-3
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
@@ -22,9 +22,13 @@ QUICKSTART = weechat_quickstart.$(LANGCODE).txt
|
||||
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
|
||||
|
||||
if DBLATEX_FOUND
|
||||
PDF = pdf-stamp
|
||||
endif
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
all-local: html-stamp
|
||||
all-local: html-stamp $(PDF)
|
||||
|
||||
# HTML output with chunks (many pages)
|
||||
|
||||
@@ -48,16 +52,28 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
|
||||
cp ../weechat-doc.css html1/
|
||||
touch html1-stamp
|
||||
|
||||
# PDF output
|
||||
|
||||
pdf: pdf-stamp
|
||||
|
||||
pdf-stamp: $(BOOK).xml $(BOOK_INCLUDE)
|
||||
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
|
||||
dblatex -c ../dblatex.conf $(BOOK).xml || true
|
||||
touch pdf-stamp
|
||||
|
||||
# install docs
|
||||
|
||||
install-data-hook:
|
||||
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
|
||||
if DBLATEX_FOUND
|
||||
$(INSTALL_DATA) $(BOOK).pdf $(DESTDIR)$(docdir)/
|
||||
endif
|
||||
|
||||
# clean
|
||||
|
||||
clean-local:
|
||||
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
|
||||
-rm -rf html/ html1/
|
||||
-rm -f html-stamp html1-stamp
|
||||
-rm -f html-stamp html1-stamp pdf-stamp
|
||||
|
||||
+28
-49
@@ -40,34 +40,6 @@
|
||||
<entry>'the geekest IRC client!'</entry>
|
||||
<entry>Slogan WeeChat (si vide, le slogan ne sera pas utilisé)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_decode_iso</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>'ISO-8859-1'</entry>
|
||||
<entry>Jeu de caractères ISO pour décoder les messages du serveur (utilisé seulement si la locale est UTF-8) (si non renseigné, les messages ne sont pas convertis si la locale est UTF-8)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_decode_utf</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>'UTF-8'</entry>
|
||||
<entry>Jeu de caractères UTF pour décoder les messages du serveur (utilisé seulement si la locale n'est pas UTF-8) (si non renseigné, les messages ne sont pas convertis si la locale n'est pas UTF-8)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_encode</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Jeu de caractères pour encoder les messages envoyés au serveur, exemples: UTF-8, ISO-8859-1 (si non renseigné, les messages ne sont pas convertis)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_charset_internal</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Force le jeu de caractères interne à WeeChat (doit être vide dans la plupart des cas, ce qui signifie que le jeu de caractères détecté est utilisé)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_one_server_buffer</option></entry>
|
||||
<entry>booléen</entry>
|
||||
@@ -138,6 +110,13 @@
|
||||
<entry>0</entry>
|
||||
<entry>Taille maximum pour la fenĂŞtre d'utilisateurs (largeur ou hauteur, selon look_nicklist_position (0 = pas de taille maximum; si min == max et > 0, alors la taille est fixe))</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nicklist_separator</option></entry>
|
||||
<entry>booléen</entry>
|
||||
<entry>'on' ou 'off'</entry>
|
||||
<entry>'on'</entry>
|
||||
<entry>Séparateur entre la discussion et la liste de pseudos</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_no_nickname</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
@@ -320,6 +299,13 @@
|
||||
<entry>'default'</entry>
|
||||
<entry>Couleur pour la barre de titre</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_title_more</option></entry>
|
||||
<entry>couleur</entry>
|
||||
<entry>couleur Curses ou Gtk</entry>
|
||||
<entry>'lightmagenta'</entry>
|
||||
<entry>Couleur pour les '+' lors du scroll sur le titre</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>col_title_bg</option></entry>
|
||||
<entry>couleur</entry>
|
||||
@@ -915,6 +901,13 @@
|
||||
<entry>5</entry>
|
||||
<entry>Déconnexion après un lag important (en minutes, 0 = ne jamais se déconnecter)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_anti_flood</option></entry>
|
||||
<entry>entier</entry>
|
||||
<entry>entre 0 et 5</entry>
|
||||
<entry>2</entry>
|
||||
<entry>Anti-flood: nombre de secondes entre deux messages utilisateur (0 = pas d'anti-flood)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_fifo_pipe</option></entry>
|
||||
<entry>booléen</entry>
|
||||
@@ -943,6 +936,13 @@
|
||||
<entry>'on'</entry>
|
||||
<entry>Autorise l'utilisateur à envoyer des couleurs avec des codes spéciaux (%B=gras, %Cxx,yy=couleur, %U=souligné, %R=inversé)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>irc_send_unknown_commands</option></entry>
|
||||
<entry>booléen</entry>
|
||||
<entry>'on' ou 'off'</entry>
|
||||
<entry>'off'</entry>
|
||||
<entry>Envoie les commandes inconnues au serveur IRC</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>dcc_auto_accept_files</option></entry>
|
||||
<entry>booléen</entry>
|
||||
@@ -1237,24 +1237,3 @@
|
||||
<entry>''</entry>
|
||||
<entry>Liste des niveaux de notifications (séparés par des virgules) pour les canaux de ce serveur (format: #canal:1,..), un nom de canal '*' est réservé pour la notification par défaut du serveur</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_charset_decode_iso</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Liste des jeux de caractères (séparés par des virgules) pour le serveur et les canaux, pour décoder l'ISO (format: server:charset,#canal:charset,..)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_charset_decode_utf</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Liste des jeux de caractères (séparés par des virgules) pour le serveur et les canaux, pour décoder l'UTF (format: server:charset,#canal:charset,..)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>server_charset_encode</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>''</entry>
|
||||
<entry>Liste des jeux de caractères (séparés par des virgules) pour le serveur et les canaux, pour encoder les messages (format: server:charset,#canal:charset,..)</entry>
|
||||
</row>
|
||||
|
||||
@@ -42,11 +42,11 @@ bannit des pseudos ou masques
|
||||
pseudo: pseudo ou masque pour le bannissement
|
||||
|
||||
</programlisting>
|
||||
<command>ctcp pseudo type [arguments]</command>
|
||||
<command>ctcp cible type [arguments]</command>
|
||||
<programlisting>
|
||||
envoyer un message CTCP (Client-To-Client Protocol)
|
||||
|
||||
pseudo: utilisateur Ă qui envoyer le CTCP
|
||||
cible: utilisateur Ă qui envoyer le CTCP
|
||||
type: type de CTCP (exemples: "version", "ping", etc...)
|
||||
arguments: arguments pour le CTCP
|
||||
|
||||
|
||||
@@ -117,6 +117,14 @@
|
||||
<entry><literal>scroll_bottom</literal></entry>
|
||||
<entry>faire défiler jusqu'à la fin du tampon</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_topic_left</literal></entry>
|
||||
<entry>faire défiler le titre vers la gauche</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_topic_right</literal></entry>
|
||||
<entry>faire défiler le titre vers la droite</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_beginning</literal></entry>
|
||||
<entry>afficher le début de la liste des pseudos</entry>
|
||||
|
||||
+692
-38
@@ -4,7 +4,7 @@
|
||||
|
||||
WeeChat documentation (french version)
|
||||
|
||||
Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
Copyright (c) 2003-2007 by FlashCode <flashcode@flashtux.org>
|
||||
|
||||
This manual is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
<bookinfo>
|
||||
|
||||
<title>WeeChat 0.2.1 - Guide utilisateur</title>
|
||||
<title>WeeChat 0.2.2 - Guide utilisateur</title>
|
||||
<subtitle>Client IRC rapide, léger et extensible</subtitle>
|
||||
|
||||
<author>
|
||||
@@ -517,6 +517,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Réafficher toute la fenêtre
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Ctrl + T</entry>
|
||||
<entry>
|
||||
Inverser deux caractères
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Ctrl + U</entry>
|
||||
<entry>
|
||||
@@ -530,7 +536,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Backspace</entry>
|
||||
<entry>Ctrl + Y</entry>
|
||||
<entry>
|
||||
Coller le contenu du presse-papiers
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Backspace / Ctrl + H</entry>
|
||||
<entry>
|
||||
Effacer le caractère précédent sur la ligne de commande
|
||||
</entry>
|
||||
@@ -542,7 +554,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Tab</entry>
|
||||
<entry>Tab / Shift + Tab</entry>
|
||||
<entry>
|
||||
Compléter la commande ou le pseudo
|
||||
(Tab de nouveau: trouver la complétion suivante)
|
||||
@@ -556,7 +568,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Entrée</entry>
|
||||
<entry>Entrée / Ctrl + J / Ctrl + M</entry>
|
||||
<entry>
|
||||
Exécuter la commande ou envoyer le message
|
||||
</entry>
|
||||
@@ -618,9 +630,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>F10</entry>
|
||||
<entry>F9 / F10</entry>
|
||||
<entry>
|
||||
Effacer le dernier message de la barre d'informations
|
||||
Faire défiler le titre du canal
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@@ -667,6 +679,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
(notification d'activité sur les autres tampons)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Alt + I</entry>
|
||||
<entry>
|
||||
Effacer le dernier message de la barre d'informations
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Alt + J puis Alt + D</entry>
|
||||
<entry>
|
||||
@@ -1001,7 +1019,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
<para>
|
||||
Liste des options du fichier de configuration :
|
||||
<informaltable colsep="0" frame="none">
|
||||
<tgroup cols="2">
|
||||
<tgroup cols="5">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Option</entry>
|
||||
@@ -1276,6 +1294,136 @@ fi
|
||||
|
||||
<section id="secFonctionsInterface">
|
||||
<title>Fonctions de l'interface (API)</title>
|
||||
|
||||
<section id="secAPI_set_charset">
|
||||
<title>set_charset</title>
|
||||
|
||||
<para>
|
||||
Prototype :
|
||||
<command>
|
||||
void set_charset (t_weechat_plugin *plugin, char *charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Change le jeu de caractères de l'extension.
|
||||
</para>
|
||||
<para>
|
||||
Paramètres :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option> : pointeur vers la structure
|
||||
de l'extension
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option> : nouveau jeu de caractères à utiliser
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Exemple :
|
||||
<screen>plugin->set_charset (plugin, "ISO-8859-1");</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_iconv_to_internal">
|
||||
<title>iconv_to_internal</title>
|
||||
|
||||
<para>
|
||||
Prototype :
|
||||
<command>
|
||||
void iconv_to_internal (t_weechat_plugin *plugin, char *charset,
|
||||
char *string)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Convertit une chaîne de caractères vers le jeu de caractères
|
||||
interne WeeChat (UTF-8).
|
||||
</para>
|
||||
<para>
|
||||
Paramètres :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option> : pointeur vers la structure
|
||||
de l'extension
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option> : le jeu de caractères de départ
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>string</option> : la chaîne à convertir
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Valeur renvoyée : la chaîne convertie.
|
||||
</para>
|
||||
<para>
|
||||
Note : le résultat doit être libéré par un appel à la fonction
|
||||
"free" après utilisation.
|
||||
</para>
|
||||
<para>
|
||||
Exemple :
|
||||
<screen>char *str = plugin->iconv_to_internal (plugin, "ISO-8859-1", "chaine iso: Ă© Ă ");</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_iconv_from_internal">
|
||||
<title>iconv_from_internal</title>
|
||||
|
||||
<para>
|
||||
Prototype :
|
||||
<command>
|
||||
void iconv_from_internal (t_weechat_plugin *plugin, char *charset,
|
||||
char *string)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Convertit une chaîne de caractères depuis le jeu de caractères
|
||||
interne WeeChat (UTF-8) vers un autre.
|
||||
</para>
|
||||
<para>
|
||||
Paramètres :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option> : pointeur vers la structure
|
||||
de l'extension
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option> : le jeu de caractères voulu
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>string</option> : la chaîne à convertir
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Valeur renvoyée : la chaîne convertie.
|
||||
</para>
|
||||
<para>
|
||||
Note : le résultat doit être libéré par un appel à la fonction
|
||||
"free" après utilisation.
|
||||
</para>
|
||||
<para>
|
||||
Exemple :
|
||||
<screen>char *str = plugin->iconv_from_internal (plugin, "ISO-8859-1", "chaine utf-8: Ă© Ă ");</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_ascii_strcasecmp">
|
||||
<title>ascii_strcasecmp</title>
|
||||
@@ -1834,7 +1982,7 @@ plugin->log (plugin, "freenode", "#weechat", "test");
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option> : nom du message IRC pour lequel la
|
||||
fonction est appelée.
|
||||
fonction est appelée ("*" pour tous les messages).
|
||||
Pour connaître la liste des messages IRC disponibles, merci
|
||||
de consulter les <acronym>RFC</acronym>s
|
||||
<ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink> et
|
||||
@@ -1969,7 +2117,9 @@ int msg_kick (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);
|
||||
t_plugin_handler *msg_handler;
|
||||
msg_handler = plugin->msg_handler_add (plugin, "KICK",
|
||||
&msg_kick, NULL, NULL);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2070,10 +2220,10 @@ plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);
|
||||
<entry><literal>%C</literal></entry>
|
||||
<entry>canaux du serveur courant</entry>
|
||||
</row>
|
||||
<!-- <row>
|
||||
<row>
|
||||
<entry><literal>%f</literal></entry>
|
||||
<entry>nom de fichier</entry>
|
||||
</row> -->
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>%h</literal></entry>
|
||||
<entry>commandes définies par des extensions</entry>
|
||||
@@ -2225,9 +2375,10 @@ int cmd_test (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->cmd_handler_add (plugin, "test", "Commande test",
|
||||
"[pesudo]", "pseudo: un pseudo du canal",
|
||||
"%n", &cmd_test, NULL, NULL);
|
||||
t_plugin_handler *cmd_handler;
|
||||
cmd_handler = plugin->cmd_handler_add (plugin, "test", "Commande test",
|
||||
"[pesudo]", "pseudo: un pseudo du canal",
|
||||
"%n", &cmd_test, NULL, NULL);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2322,7 +2473,8 @@ int mon_timer (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->timer_handler_add (plugin, 60, &mon_timer);
|
||||
t_plugin_handler *timer_handler;
|
||||
timer_handler = plugin->timer_handler_add (plugin, 60, &mon_timer);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2425,8 +2577,8 @@ plugin->timer_handler_add (plugin, 60, &mon_timer);
|
||||
<para>
|
||||
Exemple :
|
||||
<screen>
|
||||
int keyb_handler (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
char *handler_args, void *handler_pointer)
|
||||
int mon_keyb (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
char *handler_args, void *handler_pointer)
|
||||
{
|
||||
if (argc == 2)
|
||||
{
|
||||
@@ -2439,7 +2591,8 @@ int keyb_handler (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
return PLUGIN_RC_OK;
|
||||
}
|
||||
...
|
||||
plugin->keyboard_handler_add (plugin, &keyb_handler);
|
||||
t_plugin_handler *keyb_handler;
|
||||
keyb_handler = plugin->keyboard_handler_add (plugin, &mon_keyb);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -2514,6 +2667,221 @@ plugin->keyboard_handler_add (plugin, &keyb_handler);
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_modifier_add">
|
||||
<title>modifier_add</title>
|
||||
|
||||
<para>
|
||||
Prototype :
|
||||
<command>
|
||||
t_plugin_modifier *modifier_add (t_weechat_plugin *plugin,
|
||||
char *type, char *message, t_plugin_modifier_func *fonction,
|
||||
char *modifier_args, void *modifier_pointer)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ajoute un modifieur de message.
|
||||
</para>
|
||||
<para>
|
||||
Paramètres :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option> : pointeur vers la structure
|
||||
de l'extension
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>type</option> : type de modifieur :
|
||||
<informaltable colsep="0" frame="none">
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Type</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>irc_in</literal></entry>
|
||||
<entry>appelé pour chaque message IRC reçu</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_user</literal></entry>
|
||||
<entry>
|
||||
appelé pour chaque message (ou commande) envoyé par
|
||||
l'utilisateur (avant traitement et affichage par
|
||||
WeeChat)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_out</literal></entry>
|
||||
<entry>
|
||||
appelé pour chaque message sortant juste avant
|
||||
envoi au serveur IRC (y compris pour les messages
|
||||
envoyés automatiquement et de manière transparente
|
||||
par WeeChat)
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option> : nom du message IRC pour lequel la
|
||||
fonction est appelée (utilisé uniquement pour les types
|
||||
"irc_in" et "irc_out").
|
||||
Pour connaître la liste des messages IRC disponibles, merci
|
||||
de consulter les <acronym>RFC</acronym>s
|
||||
<ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink> et
|
||||
<ulink url="http://www.ietf.org/rfc/rfc2812.txt">2812</ulink>.
|
||||
La valeur spéciale "*" signifie tous les messages (pas de filtre).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>fonction</option> : fonction appelée
|
||||
</para>
|
||||
<para>
|
||||
Elle a le prototype suivant :
|
||||
<command>
|
||||
char *ma_fonction (t_weechat_plugin *plugin,
|
||||
int argc, char **argv,
|
||||
char *modifier_args, void *modifier_pointer)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Le paramètre argc vaut 2 et les arguments suivants sont
|
||||
passés dans le tableau argv :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>argv[0] = nom du serveur</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>argv[1] = message</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>modifier_args</option> : paramètres passés à la
|
||||
fonction appelée
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>modifier_pointer</option> : pointeur passé à la
|
||||
fonction appelée
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Valeur renvoyée : le pointeur vers le nouveau modifieur de message.
|
||||
</para>
|
||||
<para>
|
||||
Note : la fonction doit retourner une chaîne modifiée, ou NULL si
|
||||
elle ne souhaite pas modifier le message.
|
||||
Si elle retourne une chaine vide, alors le message est supprimé et
|
||||
ne sera pas traité du tout par WeeChat (soyez prudent en supprimant
|
||||
des messages !).
|
||||
La chaîne renvoyée doit avoir été allouée par malloc() et sera
|
||||
libérée (par appel à free()) automatiquement par WeeChat après
|
||||
utilisation.
|
||||
</para>
|
||||
<para>
|
||||
Exemple :
|
||||
<screen>
|
||||
char *adder (t_weechat_plugin *plugin, int argc, char **argv,
|
||||
char *modifier_args, void *modifier_pointer)
|
||||
{
|
||||
char *string;
|
||||
string = (char *)malloc (strlen (argv[1]) + 16);
|
||||
strcpy (string, argv[1]);
|
||||
strcat (string, "test");
|
||||
return string;
|
||||
}
|
||||
...
|
||||
t_plugin_modifier *modifier;
|
||||
modifier = plugin->modifier_add (plugin, "irc_in", "privmsg",
|
||||
&adder, NULL, NULL);
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_modifier_remove">
|
||||
<title>modifier_remove</title>
|
||||
|
||||
<para>
|
||||
Prototype :
|
||||
<command>
|
||||
void modifier_remove (t_weechat_plugin *plugin,
|
||||
t_plugin_modifier *modifier)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Supprime un modifieur de message.
|
||||
</para>
|
||||
<para>
|
||||
Paramètres :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option> : pointeur vers la structure
|
||||
de l'extension
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>modifier</option> : le modifieur Ă supprimer
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Valeur renvoyée : aucune.
|
||||
</para>
|
||||
<para>
|
||||
Exemple :
|
||||
<screen>plugin->modifier_remove (plugin, mon_modifier);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_modifier_remove_all">
|
||||
<title>modifier_remove_all</title>
|
||||
|
||||
<para>
|
||||
Prototype :
|
||||
<command>
|
||||
void modifier_remove_all (t_weechat_plugin *plugin)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Supprime tous les modifieurs d'une extension.
|
||||
</para>
|
||||
<para>
|
||||
Paramètres :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>plugin</option> : pointeur vers la structure
|
||||
de l'extension
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Valeur renvoyée : aucune.
|
||||
</para>
|
||||
<para>
|
||||
Exemple :
|
||||
<screen>plugin->modifier_remove_all (plugin);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secAPI_exec_command">
|
||||
<title>exec_command</title>
|
||||
|
||||
@@ -4207,6 +4575,11 @@ else
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>time_t</entry>
|
||||
<entry><literal>date</literal></entry>
|
||||
<entry>date et heure</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>char *</entry>
|
||||
<entry><literal>nick</literal></entry>
|
||||
@@ -4242,13 +4615,16 @@ else
|
||||
Exemple :
|
||||
<screen>
|
||||
t_plugin_buffer_line *buffer_line, *ptr_line;
|
||||
char text_time[256];
|
||||
|
||||
buffer_line = plugin->get_buffer_data (plugin);
|
||||
if (buffer_line)
|
||||
{
|
||||
for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
|
||||
{
|
||||
plugin->print (plugin, NULL, NULL, "pseudo: %s, données: %s", ptr_line->nick, ptr_line->data);
|
||||
strftime (text_time, sizeof (text_time), "%x %X", localtime (&(ptr_line->date)));
|
||||
plugin->print (plugin, NULL, NULL, "date: %s, pseudo: %s, données: %s",
|
||||
text_time, ptr_line->nick, ptr_line->data);
|
||||
}
|
||||
plugin->free_buffer_data (plugin, buffer_line);
|
||||
}
|
||||
@@ -4554,25 +4930,25 @@ end
|
||||
<para>
|
||||
Prototype Perl :
|
||||
<command>
|
||||
weechat::register(nom, version, fonction_de_fin, description);
|
||||
weechat::register(nom, version, fonction_de_fin, description, [charset]);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Python :
|
||||
<command>
|
||||
weechat.register(nom, version, fonction_de_fin, description)
|
||||
weechat.register(nom, version, fonction_de_fin, description, [charset])
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Ruby :
|
||||
<command>
|
||||
Weechat.register(nom, version, fonction_de_fin, description)
|
||||
Weechat.register(nom, version, fonction_de_fin, description, [charset])
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Lua :
|
||||
<command>
|
||||
weechat.register(nom, version, fonction_de_fin, description)
|
||||
weechat.register(nom, version, fonction_de_fin, description, [charset])
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
@@ -4605,6 +4981,12 @@ end
|
||||
<option>description</option> : brève description du script
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option> : jeu de caractères du script, Ă
|
||||
préciser si le script n'est pas écrit en UTF-8
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -4615,20 +4997,82 @@ end
|
||||
Exemples :
|
||||
<screen>
|
||||
# perl
|
||||
weechat::register("essai", "1.0", "fin_essai", "Script d'essai !");
|
||||
weechat::register("essai", "1.0", "fin_essai", "Script d'essai !", "ISO-8859-1");
|
||||
|
||||
# python
|
||||
weechat.register("essai", "1.0", "fin_essai", "Script d'essai !")
|
||||
weechat.register("essai", "1.0", "fin_essai", "Script d'essai !", "ISO-8859-1")
|
||||
|
||||
# ruby
|
||||
Weechat.register("essai", "1.0", "fin_essai", "Script d'essai !")
|
||||
Weechat.register("essai", "1.0", "fin_essai", "Script d'essai !", "ISO-8859-1")
|
||||
|
||||
-- lua
|
||||
weechat.register("essai", "1.0", "fin_essai", "Script d'essai !")
|
||||
weechat.register("essai", "1.0", "fin_essai", "Script d'essai !", "ISO-8859-1")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="sec_script_set_charset">
|
||||
<title>set_charset</title>
|
||||
|
||||
<para>
|
||||
Prototype Perl :
|
||||
<command>
|
||||
weechat::set_charset(charset);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Python :
|
||||
<command>
|
||||
weechat.set_charset(charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Ruby :
|
||||
<command>
|
||||
Weechat.set_charsetr(charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Lua :
|
||||
<command>
|
||||
weechat.set_charset(charset)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Change le jeu de caractères du script.
|
||||
</para>
|
||||
<para>
|
||||
Paramètres :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>charset</option> : nouveau jeu de caractères
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Valeur renvoyée : 1 si le nouveau jeu de caractères a été
|
||||
mis en place, 0 si une erreur s'est produite.
|
||||
</para>
|
||||
<para>
|
||||
Exemples :
|
||||
<screen>
|
||||
# perl
|
||||
weechat::set_charset("ISO-8859-1");
|
||||
|
||||
# python
|
||||
weechat.set_charset("ISO-8859-1")
|
||||
|
||||
# ruby
|
||||
Weechat.set_charset("ISO-8859-1")
|
||||
|
||||
-- lua
|
||||
weechat.set_charset("ISO-8859-1")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_print">
|
||||
<title>print</title>
|
||||
|
||||
@@ -5004,7 +5448,7 @@ def ma_fonction(server, args)
|
||||
end
|
||||
|
||||
-- lua
|
||||
weechat.add_message_handler ("privmsg", "ma_fonction")
|
||||
weechat.add_message_handler("privmsg", "ma_fonction")
|
||||
function ma_fonction(server, args)
|
||||
weechat.print("serveur=" .. server .. ", args=" .. args)
|
||||
return weechat.PLUGIN_RC_OK()
|
||||
@@ -5154,7 +5598,7 @@ def ma_commande(server, args)
|
||||
end
|
||||
|
||||
-- lua
|
||||
weechat.add_command_handler ("commande", "ma_commande")
|
||||
weechat.add_command_handler("commande", "ma_commande")
|
||||
def my_command(server, args)
|
||||
weechat.print("serveur="..server..", args="..args)
|
||||
return weechat.PLUGIN_RC_OK()
|
||||
@@ -5348,7 +5792,7 @@ def mon_clavier(key, input_before, input_after):
|
||||
return weechat.PLUGIN_RC_OK
|
||||
|
||||
# ruby
|
||||
Weechat.add_clavier_handler("mon_clavier")
|
||||
Weechat.add_keyboard_handler("mon_clavier")
|
||||
def mon_clavier(server, input_before, input_after)
|
||||
Weechat.print("gestionnaire clavier: touche = '#{key}', " \
|
||||
"entrée avant = '#{input_before}' " \
|
||||
@@ -5357,7 +5801,7 @@ def mon_clavier(server, input_before, input_after)
|
||||
end
|
||||
|
||||
-- lua
|
||||
weechat.add_clavier_handler("mon_clavier")
|
||||
weechat.add_keyboard_handler("mon_clavier")
|
||||
function mon_clavier(server, input_before, input_after)
|
||||
weechat.print("gestionnaire clavier: touche = '"..key..
|
||||
"', entrée avant = '"..input_before..
|
||||
@@ -5572,6 +6016,216 @@ weechat.remove_keyboard_handler("mon_clavier")
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_add_modifier">
|
||||
<title>add_modifier</title>
|
||||
|
||||
<para>
|
||||
Prototype Perl :
|
||||
<command>
|
||||
weechat::add_modifier(type, message, fonction);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Python :
|
||||
<command>
|
||||
weechat.add_modifier(type, message, fonction)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Ruby :
|
||||
<command>
|
||||
Weechat.add_modifier(type, message, fonction)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Lua :
|
||||
<command>
|
||||
weechat.add_modifier(type, message, fonction)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Ajoute un modifieur de messages.
|
||||
</para>
|
||||
<para>
|
||||
Paramètres :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>type</option> : type de modifieur :
|
||||
<informaltable colsep="0" frame="none">
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Type</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>irc_in</literal></entry>
|
||||
<entry>appelé pour chaque message IRC reçu</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_user</literal></entry>
|
||||
<entry>
|
||||
appelé pour chaque message (ou commande) envoyé par
|
||||
l'utilisateur (avant traitement et affichage par
|
||||
WeeChat)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>irc_out</literal></entry>
|
||||
<entry>
|
||||
appelé pour chaque message sortant juste avant
|
||||
envoi au serveur IRC (y compris pour les messages
|
||||
envoyés automatiquement et de manière transparente
|
||||
par WeeChat)
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option> : nom du message IRC pour lequel la
|
||||
fonction est appelée (utilisé uniquement pour les types
|
||||
"irc_in" et "irc_out").
|
||||
Pour connaître la liste des messages IRC disponibles, merci
|
||||
de consulter les <acronym>RFC</acronym>s
|
||||
<ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink> et
|
||||
<ulink url="http://www.ietf.org/rfc/rfc2812.txt">2812</ulink>.
|
||||
La valeur spéciale "*" signifie tous les messages (pas de filtre).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>fonction</option> : fonction appelée
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Valeur renvoyée : 1 si succès, 0 si une erreur s'est produite.
|
||||
</para>
|
||||
<para>
|
||||
Exemples :
|
||||
<screen>
|
||||
# perl
|
||||
weechat::add_modifier("irc_in", "privmsg", "mod_in");
|
||||
weechat::add_modifier("irc_out", "privmsg", "mod_out");
|
||||
sub mod_in
|
||||
{
|
||||
return "$_[1] [modifier IN]";
|
||||
}
|
||||
sub mod_out
|
||||
{
|
||||
return "$_[1] [modifier OUT]";
|
||||
}
|
||||
|
||||
# python
|
||||
weechat.add_modifier("irc_in", "privmsg", "mod_in")
|
||||
weechat.add_modifier("irc_out", "privmsg", "mod_out")
|
||||
def mod_in(serveur, args):
|
||||
return args + " [modifier IN]"
|
||||
def mod_out(serveur, args):
|
||||
return args + " [modifier OUT]"
|
||||
|
||||
# ruby
|
||||
Weechat.add_modifier("irc_in", "privmsg", "mod_in")
|
||||
Weechat.add_modifier("irc_out", "privmsg", "mod_out")
|
||||
def mod_in(server, args)
|
||||
return args + " [modifier IN]"
|
||||
end
|
||||
def mod_out(server, args)
|
||||
return args + " [modifier OUT]"
|
||||
end
|
||||
|
||||
-- lua
|
||||
weechat.add_modifier("irc_in", "privmsg", "mod_in")
|
||||
weechat.add_modifier("irc_out", "privmsg", "mod_out")
|
||||
function mod_in(server, args)
|
||||
return args .. " [modifier IN]"
|
||||
end
|
||||
function mod_out(server, args)
|
||||
return args .. " [modifier OUT]"
|
||||
end
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_remove_modifier">
|
||||
<title>remove_modifier</title>
|
||||
|
||||
<para>
|
||||
Prototype Perl :
|
||||
<command>
|
||||
weechat::remove_modifier(type, message, fonction);
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Python :
|
||||
<command>
|
||||
weechat.remove_handler(type, message, fonction)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Ruby :
|
||||
<command>
|
||||
Weechat.remove_handler(type, message, fonction)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Prototype Lua :
|
||||
<command>
|
||||
weechat.remove_handler(type, message, fonction)
|
||||
</command>
|
||||
</para>
|
||||
<para>
|
||||
Supprime un modifieur de messages.
|
||||
</para>
|
||||
<para>
|
||||
Paramètres :
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>type</option> : type de modifieur
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>message</option> : message traité par le modifieur
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>fonction</option> : fonction associée
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Valeur renvoyée : 1 si succès, 0 si une erreur s'est produite.
|
||||
</para>
|
||||
<para>
|
||||
Exemples :
|
||||
<screen>
|
||||
# perl
|
||||
weechat::remove_modifier("irc_in", "privmsg", "mod_in");
|
||||
|
||||
# python
|
||||
weechat.remove_modifier("irc_in", "privmsg", "mod_in")
|
||||
|
||||
# ruby
|
||||
Weechat.remove_modifier("irc_in", "privmsg", "mod_in")
|
||||
|
||||
-- lua
|
||||
weechat.remove_modifier("irc_in", "privmsg", "mod_in")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="secScript_command">
|
||||
<title>command</title>
|
||||
|
||||
@@ -6267,19 +6921,19 @@ valeur2 = weechat.get_config("freenode.server_autojoin")
|
||||
<screen>
|
||||
# perl
|
||||
weechat::set_config("look_nicklist", "off");
|
||||
weechat::set_config("freenode.server_autojoin, "#weechat");
|
||||
weechat::set_config("freenode.server_autojoin", "#weechat");
|
||||
|
||||
# python
|
||||
weechat.set_config("look_nicklist", "off")
|
||||
weechat.set_config("freenode.server_autojoin, "#weechat")
|
||||
weechat.set_config("freenode.server_autojoin", "#weechat")
|
||||
|
||||
# ruby
|
||||
Weechat.set_config("look_nicklist", "off")
|
||||
Weechat.set_config("freenode.server_autojoin, "#weechat")
|
||||
Weechat.set_config("freenode.server_autojoin", "#weechat")
|
||||
|
||||
-- lua
|
||||
weechat.set_config("look_nicklist", "off")
|
||||
weechat.set_config("freenode.server_autojoin, "#weechat")
|
||||
weechat.set_config("freenode.server_autojoin", "#weechat")
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
@@ -6871,8 +7525,8 @@ end
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Kolter</emphasis>
|
||||
<email>kolter AT free.fr</email> -
|
||||
<emphasis>kolter (Emmanuel Bouthenot)</emphasis>
|
||||
<email>kolter AT openics.org</email> -
|
||||
développeur
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
+11
-16
@@ -39,16 +39,6 @@ lance une commande WeeChat/IRC interne (sans regarder les gestionnaires de comma
|
||||
commande: commande à exécuter (un '/' est automatiquement ajouté s'il n'est pas trouvé au début de la commande)
|
||||
|
||||
|
||||
</programlisting>
|
||||
<command>charset [(decode_iso | decode_utf | encode) charset]</command>
|
||||
<programlisting>
|
||||
changer le jeu de caractères pour le serveur ou le canal
|
||||
|
||||
decode_iso: jeu de caractères utilisé pour décoder l'ISO
|
||||
decode_utf: jeu de caractères utilisé pour décoder l'UTF
|
||||
encode: jeu de caractères utilisé pour encoder les messages
|
||||
charset: jeu de caractères à utiliser (par exemple: ISO-8859-15, UTF-8,..)
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all]</command>
|
||||
<programlisting>
|
||||
@@ -117,23 +107,28 @@ Pour chaque param
|
||||
Sans paramètres, la commande /ignore liste les ignore définis.
|
||||
|
||||
</programlisting>
|
||||
<command>key [touche fonction/commande] [unbind touche] [functions] [reset -yes]</command>
|
||||
<command>key [touche [fonction/commande]] [unbind touche] [functions] [reset -yes]</command>
|
||||
<programlisting>
|
||||
associer/libérer des touches
|
||||
|
||||
touche: associer cette touche à une fonction interne ou une commande (commençant par "/")
|
||||
touche: voir ou associer cette touche à une fonction interne ou une commande (commençant par "/")
|
||||
unbind: supprimer l'association Ă une touche
|
||||
functions: lister la liste des fonctions internes pour les associations de touches
|
||||
reset: restaure les touches aux valeurs par défaut et supprime TOUTES les touches personnelles (utiliser avec précaution !)
|
||||
|
||||
</programlisting>
|
||||
<command>plugin [load fichier] | [autoload] | [reload] | [unload]</command>
|
||||
<command>plugin [list [nom]] | [listfull [nom]] | [load fichier] | [autoload] | [reload [nom]] | [unload [nom]]</command>
|
||||
<programlisting>
|
||||
liste/charge/décharge des extensions
|
||||
|
||||
fichier: extension WeeChat (fichier) Ă charger
|
||||
list: lister les extensions chargées
|
||||
listfull: lister les extensions chargées avec de l'info détaillée pour chaque extension
|
||||
load: charger une extension
|
||||
autoload: charger automatiquement les extensions dans un répertoire système ou utilisateur
|
||||
reload: recharger une extension (si pas de nom donné, décharger toutes les extensions, puis puis recharger automatiquement les extensions)
|
||||
unload: décharger une ou plusieurs exteneions
|
||||
|
||||
Sans paramètre, la commande /plugin liste toutes les extensions chargées.
|
||||
Sans paramètre, la commande /plugin liste les extensions chargées.
|
||||
|
||||
</programlisting>
|
||||
<command>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éel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]</command>
|
||||
@@ -223,7 +218,7 @@ gestion des fen
|
||||
list: liste les fenêtres ouvertes (pas de paramètre affiche cette liste)
|
||||
-1: saute à la fenêtre précédente
|
||||
+1: saute Ă la fenĂŞtre suivante
|
||||
b#: saute à la fenêtre affichant le tampon n°#
|
||||
b#: saute Ă la fenĂŞtre affichant le tampon #
|
||||
up: saute Ă la fenĂŞtre au dessus
|
||||
down: saute Ă la fenĂŞtre au dessous
|
||||
left: saute Ă la fenĂŞtre Ă gauche
|
||||
|
||||
@@ -93,7 +93,7 @@ Guide de d
|
||||
Les extensions sont automatiquement chargées lorsqu'elles sont trouvées.
|
||||
Plusieurs extensions/scripts sont disponibles pour WeeChat, voir ici :
|
||||
http://weechat.flashtux.org/plugins.php
|
||||
Merci de regarder la documentation WeeChat pour charger/décharget des
|
||||
Merci de regarder la documentation WeeChat pour charger/décharger des
|
||||
extensions ou des scripts.
|
||||
|
||||
10. Plus de documentation
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH WEECHAT 1 "October 2006" "FlashCode"
|
||||
.TH WEECHAT 1 "January 2007" "FlashCode"
|
||||
|
||||
.SH NAME
|
||||
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
|
||||
|
||||
+15
-9
@@ -25,8 +25,10 @@ a:hover {
|
||||
}
|
||||
|
||||
.navheader {
|
||||
background-color: #E8E8FF;
|
||||
border: solid 1px #B5B5CC;
|
||||
background-color: #E0E0FF;
|
||||
border: solid 1px #A7A7C4;
|
||||
margin: -10px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.navheader hr {
|
||||
@@ -34,8 +36,10 @@ a:hover {
|
||||
}
|
||||
|
||||
.navfooter {
|
||||
background-color: #E8E8FF;
|
||||
border: solid 1px #B5B5CC;
|
||||
background-color: #E0E0FF;
|
||||
border: solid 1px #A7A7C4;
|
||||
margin: 20px -10px -10px -10px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.navfooter hr {
|
||||
@@ -43,9 +47,11 @@ a:hover {
|
||||
}
|
||||
|
||||
.title {
|
||||
background-color: #E5FFE5;
|
||||
border: solid 1px #CCDDCC;
|
||||
padding: 3px;
|
||||
background-color: #EBEBEB;
|
||||
border: solid 1px #CACACA;
|
||||
margin-top: 25px;
|
||||
padding: 6px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.informaltable table {
|
||||
@@ -79,8 +85,8 @@ a:hover {
|
||||
|
||||
pre.screen {
|
||||
font-size: 11px;
|
||||
background-color: #F5F5F5;
|
||||
border: solid 1px #CCCCCC;
|
||||
background-color: #FAFAFA;
|
||||
border: dotted 1px #CCCCCC;
|
||||
padding: 4px;
|
||||
margin: 0 40px 0 40px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:param name="latex.hyperparam">colorlinks,linkcolor=blue</xsl:param>
|
||||
</xsl:stylesheet>
|
||||
|
||||
+873
-937
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# Copyright (c) 2006 by DeltaS4 <deltas4@gmail.com>
|
||||
#
|
||||
# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
#
|
||||
# Changelog:
|
||||
# 0.1: first version
|
||||
# 0.2: now you don't need the Song Change plugin enabled because
|
||||
# it uses audtool --current-song to get the music name as nenolod
|
||||
# suggested (http://boards.nenolod.net/index.php?showtopic=147). :)
|
||||
#
|
||||
|
||||
#
|
||||
# /setp perl.audacious.msg = "<msg that u want before the song>"
|
||||
# example: "is playing" * YourNick is playing Artist - Title
|
||||
# "now playing:" * YourNick now playing: Artist - Title
|
||||
# "at" * YourNick at Artist - Title
|
||||
#
|
||||
|
||||
weechat::register ("audacious", "0.2", "", "audacious-weechat current song script (usage: /music)");
|
||||
weechat::add_command_handler ("music", audtool);
|
||||
|
||||
$msg = weechat::get_plugin_config("msg");
|
||||
if ($msg eq $null) { weechat::set_plugin_config("msg", "is playing"); }
|
||||
|
||||
sub audtool {
|
||||
$cs = `audtool --current-song`; chomp($cs);
|
||||
$msg = weechat::get_plugin_config("msg");
|
||||
|
||||
weechat::command("/me $msg $cs");
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
#
|
||||
# Copyright (c) 2006 by 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
#
|
||||
# Save current buffer to a file.
|
||||
#
|
||||
# History:
|
||||
#
|
||||
# 2006-10-27, FlashCode <flashcode@flashtux.org>:
|
||||
# initial release
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
my $version = "0.1";
|
||||
|
||||
weechat::register("bufsave", $version, "", "Save buffer content to a file");
|
||||
weechat::add_command_handler("bufsave", "bufsave_cmd",
|
||||
"save current buffer to a file",
|
||||
"filename",
|
||||
"filename: target file (must not exist)",
|
||||
"");
|
||||
|
||||
sub bufsave_cmd
|
||||
{
|
||||
if ($#_ == 1)
|
||||
{
|
||||
my $server = shift;
|
||||
my $filename = shift;
|
||||
|
||||
return weechat::PLUGIN_RC_OK if (! $filename);
|
||||
|
||||
if (-e $filename)
|
||||
{
|
||||
weechat::print("Error: target file already exists!");
|
||||
return weechat::PLUGIN_RC_KO;
|
||||
}
|
||||
|
||||
my $channel = weechat::get_info("channel");
|
||||
my @bc = weechat::get_buffer_data($server, $channel);
|
||||
if (@bc)
|
||||
{
|
||||
if (! open(FILE, ">$filename"))
|
||||
{
|
||||
weechat::print("Error writing to target file!");
|
||||
return weechat::PLUGIN_RC_KO;
|
||||
}
|
||||
foreach my $line (reverse(@bc))
|
||||
{
|
||||
my %l = %$line;
|
||||
print FILE "$l{date} " if ($l{date});
|
||||
print FILE "\<$l{nick}\> " if ($l{nick});
|
||||
print FILE "$l{data}\n";
|
||||
}
|
||||
close(FILE);
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat::print("Error: no buffer data");
|
||||
return weechat::PLUGIN_RC_KO;
|
||||
}
|
||||
}
|
||||
return weechat::PLUGIN_RC_OK;
|
||||
}
|
||||
@@ -19,7 +19,9 @@
|
||||
# --------------------------------------------------------------------
|
||||
# This script automatically op and voice some nicks
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# 2006-12-14, FlashCode <flashcode@flashtux.org>:
|
||||
# fixed message split (for servers like quakenet with no ":" after "JOIN")
|
||||
|
||||
import weechat
|
||||
import re
|
||||
@@ -40,8 +42,10 @@ def auto_op(server, args):
|
||||
chans = U_OP[server]
|
||||
try:
|
||||
# find nick and channel
|
||||
nothing, user, channel = args.split(":")
|
||||
user, channel = args.split(" JOIN ")
|
||||
nick, next = user.split("!")
|
||||
if channel.startswith(':'):
|
||||
channel = channel[1:]
|
||||
except ValueError:
|
||||
result = weechat.PLUGIN_RC_KO
|
||||
else:
|
||||
@@ -59,8 +63,10 @@ def auto_op(server, args):
|
||||
chans = C_VOICE[server]
|
||||
try:
|
||||
# find nick and channel
|
||||
nothing, user, channel = args.split(":")
|
||||
user, channel = args.split(" JOIN ")
|
||||
nick, next = user.split("!")
|
||||
if channel.startswith(':'):
|
||||
channel = channel[1:]
|
||||
except ValueError:
|
||||
result = weechat.PLUGIN_RC_KO
|
||||
else:
|
||||
@@ -74,7 +80,7 @@ def auto_op(server, args):
|
||||
|
||||
|
||||
# register and add function to weechat
|
||||
weechat.register("auto_op", "0.2", "", "auto op plug-in for weechat")
|
||||
weechat.register("auto_op", "0.3", "", "auto op plug-in for weechat")
|
||||
weechat.add_message_handler ("join", "auto_op")
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
#
|
||||
# Copyright (c) 2006 by SpideR <spider312@free.fr> http://spiderou.net
|
||||
#
|
||||
# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
# WeeChat clone scanner
|
||||
# Scans clones on a chan when you ask it to do (/clones)
|
||||
# Able to scan for a nick's clones on each join, if you ask it to do (/autoclones)
|
||||
|
||||
import weechat
|
||||
|
||||
SCRIPT_NAME="clonescan"
|
||||
SCRIPT_VERSION="0.1"
|
||||
SCRIPT_DESC="clonescan script for weechat"
|
||||
SCRIPT_DISP=SCRIPT_NAME+" v"+SCRIPT_VERSION
|
||||
|
||||
# Register, Handlers, config check/creation
|
||||
if weechat.register(SCRIPT_NAME, SCRIPT_VERSION, "unload", SCRIPT_DESC):
|
||||
weechat.add_command_handler("clones","scanchan",
|
||||
"Scans clones on specified or current chan",
|
||||
"[#chan]")
|
||||
weechat.add_command_handler("autoclones","toggleauto",
|
||||
"Manage auto clone-scanning",
|
||||
"[enable|disable|show]")
|
||||
weechat.add_message_handler ("join", "scanjoin")
|
||||
autoscan = weechat.get_plugin_config("autoscan")
|
||||
if ( ( autoscan != "true" ) and ( autoscan != "false" ) ):
|
||||
weechat.set_plugin_config("autoscan","false")
|
||||
weechat.prnt("Unconfigured autoscan set to 'disabled', to enable : /autoclones enable")
|
||||
weechat.prnt(SCRIPT_DISP+" loaded")
|
||||
else:
|
||||
weechat.prnt(SCRIPT_DISP+" not loaded")
|
||||
|
||||
# Unload handler
|
||||
def unload():
|
||||
weechat.prnt("starting "+SCRIPT_DISP+" unload ...")
|
||||
return 0
|
||||
|
||||
# Auto scan on JOIN
|
||||
def scanjoin(server,args):
|
||||
result = weechat.PLUGIN_RC_OK
|
||||
if ( weechat.get_plugin_config("autoscan") == "true" ):
|
||||
try: # Cut args because it contains nick, host and chan
|
||||
nothing, user, chan = args.split(":") # :Mag!Magali@RS2I-35243B84.ipt.aol.com JOIN :#bringue
|
||||
nick, next = user.split("!") # Mag!Magali@RS2I-35243B84.ipt.aol.com JOIN
|
||||
userathost, nothing = next.split(" JOIN ") # Magali@RS2I-35243B84.ipt.aol.com JOIN
|
||||
host = removeuser(userathost) # Magali@RS2I-35243B84.ipt.aol.com
|
||||
# Problems with IPv6 hosts' ":" :
|
||||
# [:higuita!n=higuita@2001:b18:400f:0:211:d8ff:fe82:b10e JOIN :#weechat]
|
||||
except ValueError:
|
||||
result = weechat.PLUGIN_RC_KO
|
||||
weechat.prnt("Eror parsing args : ["+args+"]",server,server)
|
||||
else:
|
||||
clones = scannick(server,chan,nick,host) # Scan for that user's clones
|
||||
if ( len(clones) > 0):
|
||||
disp = "Clone sur "+chan+"@"+server+" : "+dispclones(nick,clones,host)
|
||||
weechat.print_infobar(5,disp) # Display on infobar
|
||||
weechat.prnt(disp) # Display on current buffer
|
||||
weechat.prnt(disp,server,server) # Display on server buffer
|
||||
return result
|
||||
|
||||
# Config auto scan
|
||||
def toggleauto(server,args):
|
||||
# Get current value
|
||||
autoscan = weechat.get_plugin_config("autoscan")
|
||||
# Testing / repairing
|
||||
if ( autoscan == "true" ):
|
||||
auto = True
|
||||
elif ( autoscan == "false" ):
|
||||
auto = False
|
||||
else:
|
||||
weechat.prnt("Unknown value ["+autoscan+"], disabling")
|
||||
weechat.set_plugin_config("autoscan","false")
|
||||
auto = False
|
||||
# managing arg
|
||||
if ( args == "enable" ):
|
||||
if auto:
|
||||
weechat.prnt("Auto clone scanning remain enabled")
|
||||
else:
|
||||
weechat.set_plugin_config("autoscan","true")
|
||||
weechat.prnt("Auto clone scanning is now enabled")
|
||||
elif ( args == "disable" ):
|
||||
if auto:
|
||||
weechat.set_plugin_config("autoscan","false")
|
||||
weechat.prnt("Auto clone scanning is now disabled")
|
||||
else:
|
||||
weechat.prnt("Auto clone scanning remain disabled")
|
||||
elif ( args == "break" ):
|
||||
weechat.set_plugin_config("autoscan","blah")
|
||||
else:
|
||||
if auto:
|
||||
weechat.prnt("Auto clone scanning enabled")
|
||||
else:
|
||||
weechat.prnt("Auto clone scanning disabled")
|
||||
return weechat.PLUGIN_RC_OK
|
||||
|
||||
# Manual channel scan
|
||||
def scanchan(server,args):
|
||||
# Defining chan to scan (contained in args, current chan otherwise)
|
||||
if ( args == "" ):
|
||||
chan = weechat.get_info("channel",server)
|
||||
else:
|
||||
chan = args
|
||||
# Scan
|
||||
if ( chan != "" ):
|
||||
nicks = weechat.get_nick_info(server,chan)
|
||||
allclones = [] # List containing all detected clones, for not to re-scan them
|
||||
nbclones = 0 # number of clones
|
||||
if nicks != None:
|
||||
if nicks != {}:
|
||||
weechat.prnt("Scanning "+chan+" ...")
|
||||
for nick in nicks:
|
||||
if nick not in allclones:
|
||||
host = removeuser(nicks[nick]["host"])
|
||||
clones = scannick(server,chan,nick,host)
|
||||
if ( len(clones) > 0 ):
|
||||
allclones = allclones + clones
|
||||
nbclones = nbclones+1
|
||||
weechat.prnt(" - "+dispclones(nick,clones,host))
|
||||
weechat.prnt(str(nbclones)+" clones found")
|
||||
else:
|
||||
weechat.prnt("Nobody on "+chan+", are you sure it's a chan and you are present on it ?")
|
||||
else:
|
||||
weechat.prnt("Eror reading nick list")
|
||||
else:
|
||||
weechat.prnt("Not on a chan")
|
||||
return weechat.PLUGIN_RC_OK
|
||||
|
||||
# Scan of a nick
|
||||
# Returns list of nick clones (not containing nick himself)
|
||||
def scannick(server,chan,nick,host):
|
||||
cloneof = []
|
||||
compares = weechat.get_nick_info(server,chan)
|
||||
if compares != None:
|
||||
if compares != {}:
|
||||
for compare in compares:
|
||||
if ( ( nick != compare ) and ( host == removeuser(compares[compare]["host"])) ):
|
||||
cloneof.append(compare)
|
||||
else:
|
||||
weechat.prnt("pas de pseudo")
|
||||
|
||||
else:
|
||||
weechat.prnt("erreur de lecture des pseudos")
|
||||
return cloneof
|
||||
|
||||
# Display of one clone line
|
||||
def dispclones(nick,clones,host):
|
||||
clones.append(nick)
|
||||
clones.sort()
|
||||
return str(clones)+" ("+host+")"
|
||||
|
||||
# Return host by user@host
|
||||
def removeuser(userathost):
|
||||
splitted = userathost.split("@")
|
||||
return splitted[1]
|
||||
@@ -0,0 +1,62 @@
|
||||
"""
|
||||
PyExec: Python code execution script for WeeChat
|
||||
Author: Christian Taylor <cht@chello.at>
|
||||
License: GPL version 2 or later
|
||||
"""
|
||||
|
||||
version = "0.2"
|
||||
helptext = """ The WeeChat script-API is imported into the global namespace, you can
|
||||
call all API functions (for instance "get_info") directly. The modules
|
||||
"sys", "os" and "math" are imported by default.
|
||||
Any occurance of ";; " is treated as a newline.
|
||||
|
||||
For automatic argument conversion to string, use:
|
||||
"send" instead of "command"
|
||||
"echo" instead of "prnt" (prints only to current buffer)
|
||||
(also provided: "echo_server", "echo_infobar")
|
||||
|
||||
Additional shortcut functions:
|
||||
"nicks()" returns a dictionary of nicknames for the current channel.
|
||||
It takes a channelname and a servername as optional arguments.
|
||||
|
||||
Examples:
|
||||
/pyexec for i in range(3): send(i+1);; echo("Done")
|
||||
/pyexec for nick in nicks(): send("/voice " + nick)
|
||||
/pyexec echo(2**64)
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import division
|
||||
import sys, os, math
|
||||
from weechat import *
|
||||
|
||||
register("PyExec", version, "", "Run Python code in WeeChat")
|
||||
add_command_handler("pyexec", "pyexec", " Runs Python code directly from the WeeChat command line.", "[Python code]", helptext)
|
||||
|
||||
def echo(text):
|
||||
return prnt(str(text))
|
||||
|
||||
def echo_server(text):
|
||||
return print_server(str(text))
|
||||
|
||||
def echo_infobar(time, text):
|
||||
return print_infobar(time, str(text))
|
||||
|
||||
def send(text):
|
||||
return command(str(text))
|
||||
|
||||
def nicks(channel=None, server=None):
|
||||
if not server:
|
||||
server = get_info("server")
|
||||
if not channel:
|
||||
channel = get_info("channel")
|
||||
return get_nick_info(server, channel)
|
||||
|
||||
def pyexec(server, pycode):
|
||||
try:
|
||||
exec pycode.replace(";; ", "\n")
|
||||
except:
|
||||
(e_type, e_value, e_trace) = sys.exc_info()
|
||||
prnt("PyExec: %s: %s" % (str(e_type).replace("exceptions.", ""), e_value))
|
||||
|
||||
return PLUGIN_RC_OK
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
|
||||
+17
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -223,12 +223,13 @@ char *
|
||||
alias_replace_args (char *alias_args, char *user_args)
|
||||
{
|
||||
char **argv, *start, *pos, *res;
|
||||
int argc, length_res;
|
||||
|
||||
int argc, length_res, args_count;
|
||||
|
||||
argv = explode_string (user_args, " ", 0, &argc);
|
||||
|
||||
res = NULL;
|
||||
length_res = 0;
|
||||
args_count = 0;
|
||||
start = alias_args;
|
||||
pos = start;
|
||||
while (pos && pos[0])
|
||||
@@ -248,6 +249,7 @@ alias_replace_args (char *alias_args, char *user_args)
|
||||
{
|
||||
if (pos[1] == '*')
|
||||
{
|
||||
args_count++;
|
||||
pos[0] = '\0';
|
||||
alias_add_word (&res, &length_res, start);
|
||||
alias_add_word (&res, &length_res, user_args);
|
||||
@@ -259,6 +261,7 @@ alias_replace_args (char *alias_args, char *user_args)
|
||||
{
|
||||
if ((pos[1] >= '1') && (pos[1] <= '9'))
|
||||
{
|
||||
args_count++;
|
||||
pos[0] = '\0';
|
||||
alias_add_word (&res, &length_res, start);
|
||||
if (pos[1] - '0' <= argc)
|
||||
@@ -275,8 +278,19 @@ alias_replace_args (char *alias_args, char *user_args)
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
if (start < pos)
|
||||
alias_add_word (&res, &length_res, start);
|
||||
|
||||
if ((args_count == 0) && user_args && user_args[0])
|
||||
{
|
||||
alias_add_word (&res, &length_res, " ");
|
||||
alias_add_word (&res, &length_res, user_args);
|
||||
}
|
||||
|
||||
if (argv)
|
||||
free_exploded_string (argv);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -42,10 +42,11 @@
|
||||
#include "weechat.h"
|
||||
#include "backtrace.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
|
||||
/*
|
||||
* weechat_backtrace_printf: display a backtrage line (on stderr and in WeeChat log)
|
||||
* weechat_backtrace_printf: display a backtrace line (on stderr and in WeeChat log)
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -58,7 +59,7 @@ weechat_backtrace_printf (char *message, ...)
|
||||
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
fprintf (stderr, "%s", buffer);
|
||||
weechat_iconv_fprintf (stderr, "%s", buffer);
|
||||
weechat_log_printf ("%s", buffer);
|
||||
}
|
||||
|
||||
@@ -88,7 +89,7 @@ weechat_backtrace_addr2line (int number, void *address, char *symbol)
|
||||
|
||||
addr = address;
|
||||
if (info.dli_fbase >= (const void *) 0x40000000)
|
||||
addr = (const char *) addr - (unsigned int) info.dli_fbase;
|
||||
addr = (void *)((unsigned long)((const char *) addr) - (unsigned long) info.dli_fbase);
|
||||
|
||||
snprintf (cmd_line, sizeof (cmd_line),
|
||||
"addr2line --functions --demangle -e $(which %s) %p",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
+249
-381
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -74,13 +74,6 @@ t_weechat_command weechat_commands[] =
|
||||
N_("command"),
|
||||
N_("command: command to execute (a '/' is automatically added if not found at beginning of command)\n"),
|
||||
"%w|%i", 0, MAX_ARGS, 1, NULL, weechat_cmd_builtin },
|
||||
{ "charset", N_("change charset for server or channel"),
|
||||
N_("[(decode_iso | decode_utf | encode) charset]"),
|
||||
N_("decode_iso: charset used for decoding ISO\n"
|
||||
"decode_utf: charset used for decoding UTF\n"
|
||||
" encode: charset used for encoding messages\n"
|
||||
" charset: charset to use (for example: ISO-8859-15, UTF-8,..)"),
|
||||
"decode_iso|decode_utf|encode", 0, 2, 0, weechat_cmd_charset, NULL },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
N_("-all: clear all windows"),
|
||||
@@ -143,10 +136,15 @@ t_weechat_command weechat_commands[] =
|
||||
"list|add|close|move global|local top|bottom|left|right",
|
||||
0, MAX_ARGS, 0, weechat_cmd_panel, NULL },*/
|
||||
{ "plugin", N_("list/load/unload plugins"),
|
||||
N_("[load filename] | [autoload] | [reload] | [unload]"),
|
||||
N_("filename: WeeChat plugin (file) to load\n\n"
|
||||
"Without argument, /plugin command lists all loaded plugins."),
|
||||
"load|autoload|reload|unload", 0, 2, 0, weechat_cmd_plugin, NULL },
|
||||
N_("[list [name]] | [listfull [name]] | [load filename] | [autoload] | [reload [name]] | [unload [name]]"),
|
||||
N_(" list: list loaded plugins\n"
|
||||
"listfull: list loaded plugins with detailed info for each plugin\n"
|
||||
" load: load a plugin\n"
|
||||
"autoload: autoload plugins in system or user directory\n"
|
||||
" reload: reload one plugin (if no name given, unload all plugins, then autoload plugins)\n"
|
||||
" unload: unload one or all plugins\n\n"
|
||||
"Without argument, /plugin command lists loaded plugins."),
|
||||
"list|listfull|load|autoload|reload|unload %P", 0, 2, 0, weechat_cmd_plugin, NULL },
|
||||
{ "server", N_("list, add or remove servers"),
|
||||
N_("[servername] | "
|
||||
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
|
||||
@@ -288,10 +286,11 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
|
||||
int only_builtin)
|
||||
{
|
||||
int i, rc, argc, argc2, return_code, length1, length2;
|
||||
char *command, *pos, *ptr_args, *ptr_args2, *ptr_args3;
|
||||
char *command, *pos, *ptr_args, *ptr_args2;
|
||||
char **argv, **argv2, *alias_command;
|
||||
char **commands, **ptr_cmd, **ptr_next_cmd;
|
||||
char *args_replaced, *vars_replaced, *new_ptr_cmd;
|
||||
char *unknown_command;
|
||||
int some_args_replaced;
|
||||
t_weechat_alias *ptr_alias;
|
||||
|
||||
@@ -492,16 +491,13 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_args2 = (weechat_commands[i].conversion && ptr_args) ?
|
||||
channel_iconv_encode (server, channel, ptr_args) : NULL;
|
||||
ptr_args3 = (weechat_commands[i].conversion
|
||||
&& cfg_irc_colors_send && ptr_args) ?
|
||||
(char *)gui_color_encode ((ptr_args2) ? (unsigned char *)ptr_args2 :
|
||||
(unsigned char *)ptr_args) : NULL;
|
||||
ptr_args2 = (weechat_commands[i].conversion
|
||||
&& cfg_irc_colors_send
|
||||
&& ptr_args) ?
|
||||
(char *)gui_color_encode ((unsigned char *)ptr_args) : NULL;
|
||||
if (weechat_commands[i].cmd_function_args)
|
||||
{
|
||||
argv2 = explode_string ((ptr_args3) ? ptr_args3 :
|
||||
((ptr_args2) ? ptr_args2 : ptr_args),
|
||||
argv2 = explode_string ((ptr_args2) ? ptr_args2 : ptr_args,
|
||||
" ", 0, &argc2);
|
||||
return_code = (int) (weechat_commands[i].cmd_function_args)
|
||||
(server, channel, argc2, argv2);
|
||||
@@ -509,8 +505,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
|
||||
}
|
||||
else
|
||||
return_code = (int) (weechat_commands[i].cmd_function_1arg)
|
||||
(server, channel, (ptr_args3) ? ptr_args3 :
|
||||
((ptr_args2) ? ptr_args2 : ptr_args));
|
||||
(server, channel, (ptr_args2) ? ptr_args2 : ptr_args);
|
||||
if (return_code < 0)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
@@ -520,8 +515,6 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
|
||||
}
|
||||
if (ptr_args2)
|
||||
free (ptr_args2);
|
||||
if (ptr_args3)
|
||||
free (ptr_args3);
|
||||
}
|
||||
free_exploded_string (argv);
|
||||
free (command);
|
||||
@@ -587,16 +580,13 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
|
||||
free (command);
|
||||
return 0;
|
||||
}
|
||||
ptr_args2 = (irc_commands[i].conversion && ptr_args) ?
|
||||
channel_iconv_encode (server, channel, ptr_args) : NULL;
|
||||
ptr_args3 = (irc_commands[i].conversion
|
||||
&& cfg_irc_colors_send && ptr_args) ?
|
||||
(char *)gui_color_encode ((ptr_args2) ? (unsigned char *)ptr_args2 :
|
||||
(unsigned char *)ptr_args) : NULL;
|
||||
ptr_args2 = (irc_commands[i].conversion
|
||||
&& cfg_irc_colors_send
|
||||
&& ptr_args) ?
|
||||
(char *)gui_color_encode ((unsigned char *)ptr_args) : NULL;
|
||||
if (irc_commands[i].cmd_function_args)
|
||||
{
|
||||
argv2 = explode_string ((ptr_args3) ? ptr_args3 :
|
||||
((ptr_args2) ? ptr_args2 : ptr_args),
|
||||
argv2 = explode_string ((ptr_args2) ? ptr_args2 : ptr_args,
|
||||
" ", 0, &argc2);
|
||||
return_code = (int) (irc_commands[i].cmd_function_args)
|
||||
(server, channel, argc2, argv2);
|
||||
@@ -604,8 +594,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
|
||||
}
|
||||
else
|
||||
return_code = (int) (irc_commands[i].cmd_function_1arg)
|
||||
(server, channel, (ptr_args3) ? ptr_args3 :
|
||||
((ptr_args2) ? ptr_args2 : ptr_args));
|
||||
(server, channel, (ptr_args2) ? ptr_args2 : ptr_args);
|
||||
if (return_code < 0)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
@@ -615,19 +604,44 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
|
||||
}
|
||||
if (ptr_args2)
|
||||
free (ptr_args2);
|
||||
if (ptr_args3)
|
||||
free (ptr_args3);
|
||||
}
|
||||
free_exploded_string (argv);
|
||||
free (command);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unknown command \"%s\" (type /help for help)\n"),
|
||||
WEECHAT_ERROR,
|
||||
command + 1);
|
||||
|
||||
/* should we send unknown command to IRC server? */
|
||||
if (cfg_irc_send_unknown_commands)
|
||||
{
|
||||
if (ptr_args)
|
||||
unknown_command = (char *)malloc (strlen (command + 1) + 2 + strlen (ptr_args) + 1);
|
||||
else
|
||||
unknown_command = (char *)malloc (strlen (command + 1) + 1);
|
||||
|
||||
if (unknown_command)
|
||||
{
|
||||
strcpy (unknown_command, command + 1);
|
||||
if (ptr_args)
|
||||
{
|
||||
strcat (unknown_command, " :");
|
||||
strcat (unknown_command, ptr_args);
|
||||
}
|
||||
irc_cmd_send_quote (server, channel, unknown_command);
|
||||
free (unknown_command);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unknown command \"%s\" (type /help for help). "
|
||||
"To send unknown commands to IRC server, enable option "
|
||||
"irc_send_unknown_commands.\n"),
|
||||
WEECHAT_ERROR,
|
||||
command + 1);
|
||||
}
|
||||
|
||||
free_exploded_string (argv);
|
||||
}
|
||||
free (command);
|
||||
@@ -717,7 +731,7 @@ user_message (t_irc_server *server, t_gui_buffer *buffer, char *text)
|
||||
next = pos;
|
||||
}
|
||||
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n", CHANNEL(buffer)->name, text);
|
||||
server_sendf_queued (server, "PRIVMSG %s :%s", CHANNEL(buffer)->name, text);
|
||||
user_message_display (server, buffer, text);
|
||||
|
||||
if (next)
|
||||
@@ -736,98 +750,96 @@ void
|
||||
user_command (t_irc_server *server, t_irc_channel *channel, char *command, int only_builtin)
|
||||
{
|
||||
t_gui_buffer *buffer;
|
||||
int plugin_args_length;
|
||||
char *command_with_colors, *command_encoded;
|
||||
char *plugin_args;
|
||||
char *new_cmd, *ptr_cmd, *pos;
|
||||
char *command_with_colors;
|
||||
|
||||
if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n'))
|
||||
return;
|
||||
|
||||
irc_find_context (server, channel, NULL, &buffer);
|
||||
#ifdef PLUGINS
|
||||
new_cmd = plugin_modifier_exec (PLUGIN_MODIFIER_IRC_USER,
|
||||
(server) ? server->name : "",
|
||||
command);
|
||||
#else
|
||||
new_cmd = NULL;
|
||||
#endif
|
||||
|
||||
if ((command[0] == '/') && (command[1] != '/'))
|
||||
/* no changes in new command */
|
||||
if (new_cmd && (strcmp (command, new_cmd) == 0))
|
||||
{
|
||||
/* WeeChat internal command (or IRC command) */
|
||||
(void) exec_weechat_command (server, channel, command, only_builtin);
|
||||
free (new_cmd);
|
||||
new_cmd = NULL;
|
||||
}
|
||||
else
|
||||
|
||||
/* message not dropped? */
|
||||
if (!new_cmd || new_cmd[0])
|
||||
{
|
||||
if ((command[0] == '/') && (command[1] == '/'))
|
||||
command++;
|
||||
/* use new command (returned by plugin) */
|
||||
ptr_cmd = (new_cmd) ? new_cmd : command;
|
||||
|
||||
if (server && (!BUFFER_IS_SERVER(buffer)))
|
||||
while (ptr_cmd && ptr_cmd[0])
|
||||
{
|
||||
command_with_colors = (cfg_irc_colors_send) ?
|
||||
(char *)gui_color_encode ((unsigned char *)command) : NULL;
|
||||
pos = strchr (ptr_cmd, '\n');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
|
||||
command_encoded = channel_iconv_encode (server, channel,
|
||||
(command_with_colors) ? command_with_colors : command);
|
||||
irc_find_context (server, channel, NULL, &buffer);
|
||||
|
||||
if (CHANNEL(buffer)->dcc_chat)
|
||||
if ((ptr_cmd[0] == '/') && (ptr_cmd[1] != '/'))
|
||||
{
|
||||
if (((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat))->sock < 0)
|
||||
/* WeeChat internal command (or IRC command) */
|
||||
(void) exec_weechat_command (server, channel, ptr_cmd, only_builtin);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((ptr_cmd[0] == '/') && (ptr_cmd[1] == '/'))
|
||||
ptr_cmd++;
|
||||
|
||||
if (server && (!BUFFER_IS_SERVER(buffer)))
|
||||
{
|
||||
irc_display_prefix (server, buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (buffer, "%s DCC CHAT is closed\n",
|
||||
WEECHAT_ERROR);
|
||||
command_with_colors = (cfg_irc_colors_send) ?
|
||||
(char *)gui_color_encode ((unsigned char *)ptr_cmd) : NULL;
|
||||
|
||||
if (CHANNEL(buffer)->dcc_chat)
|
||||
{
|
||||
if (((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat))->sock < 0)
|
||||
{
|
||||
irc_display_prefix (server, buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (buffer, "%s DCC CHAT is closed\n",
|
||||
WEECHAT_ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
dcc_chat_sendf ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat),
|
||||
"%s\r\n",
|
||||
(command_with_colors) ? command_with_colors : ptr_cmd);
|
||||
user_message_display (server, buffer,
|
||||
(command_with_colors) ?
|
||||
command_with_colors : ptr_cmd);
|
||||
}
|
||||
}
|
||||
else
|
||||
user_message (server, buffer,
|
||||
(command_with_colors) ? command_with_colors : ptr_cmd);
|
||||
|
||||
if (command_with_colors)
|
||||
free (command_with_colors);
|
||||
}
|
||||
else
|
||||
{
|
||||
dcc_chat_sendf ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat),
|
||||
"%s\r\n",
|
||||
(command_encoded) ? command_encoded :
|
||||
((command_with_colors) ? command_with_colors : command));
|
||||
user_message_display (server, buffer,
|
||||
(command_with_colors) ?
|
||||
command_with_colors : command);
|
||||
irc_display_prefix (NULL, (server) ? server->buffer : NULL, PREFIX_ERROR);
|
||||
gui_printf_nolog ((server) ? server->buffer : NULL,
|
||||
_("This window is not a channel!\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
user_message (server, buffer,
|
||||
(command_encoded) ? command_encoded :
|
||||
((command_with_colors) ? command_with_colors : command));
|
||||
|
||||
if (command_with_colors)
|
||||
free (command_with_colors);
|
||||
if (command_encoded)
|
||||
free (command_encoded);
|
||||
|
||||
/* sending a copy of the message as PRIVMSG to plugins because irc server doesn't */
|
||||
|
||||
/* code commented by FlashCode, 2005-11-06: problem when a handler
|
||||
is called after a weechat::command("somethin") in perl, reetrance,
|
||||
and crash at perl script unload */
|
||||
|
||||
/* make gcc happy */
|
||||
(void) plugin_args_length;
|
||||
(void) plugin_args;
|
||||
/*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)
|
||||
|
||||
if (pos)
|
||||
{
|
||||
snprintf (plugin_args, plugin_args_length,
|
||||
"localhost PRIVMSG %s :%s",
|
||||
CHANNEL(buffer)->name, command);
|
||||
#ifdef PLUGINS
|
||||
plugin_msg_handler_exec (server->name, "privmsg", plugin_args);
|
||||
#endif
|
||||
free (plugin_args);
|
||||
pos[0] = '\n';
|
||||
ptr_cmd = pos + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to call handler for message (not enough memory)\n"),
|
||||
WEECHAT_ERROR);
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, (server) ? server->buffer : NULL, PREFIX_ERROR);
|
||||
gui_printf_nolog ((server) ? server->buffer : NULL,
|
||||
_("This window is not a channel!\n"));
|
||||
ptr_cmd = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1384,232 +1396,6 @@ weechat_cmd_builtin (t_irc_server *server, t_irc_channel *channel,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_charset_display: display charsets for a server or channel
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_cmd_charset_display (t_gui_buffer *buffer)
|
||||
{
|
||||
char *server_item = "server", *ptr_item;
|
||||
char *value, *string, *herited;
|
||||
int length;
|
||||
|
||||
if ((BUFFER_IS_SERVER(buffer) && (SERVER(buffer)))
|
||||
|| BUFFER_IS_CHANNEL(buffer)
|
||||
|| BUFFER_IS_PRIVATE(buffer))
|
||||
{
|
||||
if (BUFFER_IS_SERVER(buffer))
|
||||
{
|
||||
gui_printf_nolog (NULL, _("Charsets for server %s%s%s: "),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
SERVER(buffer)->name,
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
ptr_item = server_item;
|
||||
}
|
||||
else if (BUFFER_IS_CHANNEL(buffer))
|
||||
{
|
||||
gui_printf_nolog (NULL, _("Charsets for channel %s%s%s: "),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
CHANNEL(buffer)->name,
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
ptr_item = CHANNEL(buffer)->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf_nolog (NULL, _("Charsets for private %s%s%s: "),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
CHANNEL(buffer)->name,
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
ptr_item = CHANNEL(buffer)->name;
|
||||
}
|
||||
|
||||
/* decode ISO */
|
||||
herited = NULL;
|
||||
config_option_list_get_value (&(SERVER(buffer)->charset_decode_iso),
|
||||
ptr_item, &value, &length);
|
||||
if (value && (length > 0))
|
||||
{
|
||||
string = strdup (value);
|
||||
string[length] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
string = strdup ("");
|
||||
herited = channel_get_charset_decode_iso (SERVER(buffer),
|
||||
CHANNEL(buffer));
|
||||
}
|
||||
gui_printf (NULL, "decode_iso: \"%s%s%s\"",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_HOST),
|
||||
string,
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
if (herited)
|
||||
{
|
||||
gui_printf (NULL, _(" (inherited: \"%s%s%s\")"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_HOST),
|
||||
herited,
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
free (herited);
|
||||
}
|
||||
gui_printf (NULL, ", ");
|
||||
free (string);
|
||||
|
||||
/* decode UTF */
|
||||
herited = NULL;
|
||||
config_option_list_get_value (&(SERVER(buffer)->charset_decode_utf),
|
||||
ptr_item, &value, &length);
|
||||
if (value && (length > 0))
|
||||
{
|
||||
string = strdup (value);
|
||||
string[length] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
string = strdup ("");
|
||||
herited = channel_get_charset_decode_utf (SERVER(buffer),
|
||||
CHANNEL(buffer));
|
||||
}
|
||||
gui_printf (NULL, "decode_utf: \"%s%s%s\"",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_HOST),
|
||||
string,
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
if (herited)
|
||||
{
|
||||
gui_printf (NULL, _(" (inherited: \"%s%s%s\")"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_HOST),
|
||||
herited,
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
free (herited);
|
||||
}
|
||||
gui_printf (NULL, ", ");
|
||||
free (string);
|
||||
|
||||
/* encode */
|
||||
herited = NULL;
|
||||
config_option_list_get_value (&(SERVER(buffer)->charset_encode),
|
||||
ptr_item, &value, &length);
|
||||
if (value && (length > 0))
|
||||
{
|
||||
string = strdup (value);
|
||||
string[length] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
string = strdup ("");
|
||||
herited = channel_get_charset_encode (SERVER(buffer),
|
||||
CHANNEL(buffer));
|
||||
}
|
||||
gui_printf (NULL, "encode: \"%s%s%s\"",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_HOST),
|
||||
string,
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
if (herited)
|
||||
{
|
||||
gui_printf (NULL, _(" (inherited: \"%s%s%s\")"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_HOST),
|
||||
herited,
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
free (herited);
|
||||
}
|
||||
gui_printf (NULL, "\n");
|
||||
free (string);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_charset_set: set a charset for server or channel
|
||||
* from_internal == 1 if charset is used to encode data,
|
||||
* 0 if charset is used to decode data
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_charset_set (t_gui_buffer *buffer, char **string, char *charset,
|
||||
int from_internal)
|
||||
{
|
||||
int iconv_ok;
|
||||
|
||||
if (charset)
|
||||
{
|
||||
if (from_internal)
|
||||
iconv_ok = weechat_iconv_check (NULL, charset);
|
||||
else
|
||||
iconv_ok = weechat_iconv_check (charset, NULL);
|
||||
|
||||
if (!iconv_ok)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s charset \"%s\" is not available\n"),
|
||||
WEECHAT_ERROR, charset);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (BUFFER_IS_SERVER(buffer))
|
||||
{
|
||||
if (SERVER(buffer))
|
||||
{
|
||||
if (charset)
|
||||
config_option_list_set (string, "server", charset);
|
||||
else
|
||||
config_option_list_remove (string, "server");
|
||||
weechat_cmd_charset_display (buffer);
|
||||
}
|
||||
}
|
||||
else if (BUFFER_IS_CHANNEL(buffer) ||
|
||||
BUFFER_IS_PRIVATE(buffer))
|
||||
{
|
||||
if (charset)
|
||||
config_option_list_set (string, CHANNEL(buffer)->name, charset);
|
||||
else
|
||||
config_option_list_remove (string, CHANNEL(buffer)->name);
|
||||
weechat_cmd_charset_display (buffer);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_charset: change charset for server or channel
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_charset (t_irc_server *server, t_irc_channel *channel,
|
||||
int argc, char **argv)
|
||||
{
|
||||
t_gui_buffer *buffer;
|
||||
int rc;
|
||||
|
||||
irc_find_context (server, channel, NULL, &buffer);
|
||||
|
||||
if (argc == 0)
|
||||
weechat_cmd_charset_display (buffer);
|
||||
else
|
||||
{
|
||||
if (ascii_strcasecmp (argv[0], "decode_iso") == 0)
|
||||
rc = weechat_cmd_charset_set (buffer,
|
||||
&(SERVER(buffer)->charset_decode_iso),
|
||||
(argc > 1) ? argv[1] : NULL, 0);
|
||||
else if (ascii_strcasecmp (argv[0], "decode_utf") == 0)
|
||||
rc = weechat_cmd_charset_set (buffer,
|
||||
&(SERVER(buffer)->charset_decode_utf),
|
||||
(argc > 1) ? argv[1] : NULL, 0);
|
||||
else if (ascii_strcasecmp (argv[0], "encode") == 0)
|
||||
rc = weechat_cmd_charset_set (buffer,
|
||||
&(SERVER(buffer)->charset_encode),
|
||||
(argc > 1) ? argv[1] : NULL, 1);
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "charset");
|
||||
return -1;
|
||||
}
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_clear: display or create alias
|
||||
*/
|
||||
@@ -1830,6 +1616,8 @@ int
|
||||
weechat_cmd_debug (t_irc_server *server, t_irc_channel *channel,
|
||||
int argc, char **argv)
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) server;
|
||||
(void) channel;
|
||||
@@ -1853,6 +1641,16 @@ weechat_cmd_debug (t_irc_server *server, t_irc_channel *channel,
|
||||
gui_printf_nolog (NULL, "DEBUG: windows tree:\n");
|
||||
weechat_cmd_debug_display_windows (gui_windows_tree, 1);
|
||||
}
|
||||
else if (ascii_strcasecmp (argv[0], "deloutq") == 0)
|
||||
{
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
server_outqueue_free_all (ptr_server);
|
||||
}
|
||||
gui_printf_nolog (NULL, "\n");
|
||||
gui_printf_nolog (NULL, "DEBUG: outqueue DELETED for all servers.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
@@ -1966,7 +1764,7 @@ weechat_cmd_help (t_irc_server *server, t_irc_channel *channel,
|
||||
for (ptr_handler = ptr_plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if (ptr_handler->type == HANDLER_COMMAND)
|
||||
if (ptr_handler->type == PLUGIN_HANDLER_COMMAND)
|
||||
{
|
||||
gui_printf (NULL, " %s%s",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
@@ -2045,7 +1843,7 @@ weechat_cmd_help (t_irc_server *server, t_irc_channel *channel,
|
||||
for (ptr_handler = ptr_plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if ((ptr_handler->type == HANDLER_COMMAND)
|
||||
if ((ptr_handler->type == PLUGIN_HANDLER_COMMAND)
|
||||
&& (ascii_strcasecmp (ptr_handler->command, argv[0]) == 0))
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
@@ -2464,42 +2262,48 @@ weechat_cmd_panel (t_irc_server *server, t_irc_channel *channel,
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_plugin: list/load/unload WeeChat plugins
|
||||
* weechat_cmd_plugin_list: list loaded plugins
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
|
||||
int argc, char **argv)
|
||||
void
|
||||
weechat_cmd_plugin_list (char *name, int full)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_weechat_plugin *ptr_plugin;
|
||||
int plugins_found;
|
||||
t_plugin_handler *ptr_handler;
|
||||
int handler_found;
|
||||
t_plugin_modifier *ptr_modifier;
|
||||
int modifier_found;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) server;
|
||||
(void) channel;
|
||||
|
||||
switch (argc)
|
||||
gui_printf (NULL, "\n");
|
||||
if (!name)
|
||||
{
|
||||
case 0:
|
||||
/* list plugins */
|
||||
gui_printf (NULL, "\n");
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _("Plugins loaded:\n"));
|
||||
}
|
||||
|
||||
plugins_found = 0;
|
||||
|
||||
for (ptr_plugin = weechat_plugins; ptr_plugin;
|
||||
ptr_plugin = ptr_plugin->next_plugin)
|
||||
{
|
||||
if (!name || (ascii_strcasestr (ptr_plugin->name, name)))
|
||||
{
|
||||
plugins_found++;
|
||||
|
||||
/* plugin info */
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _("Plugins loaded:\n"));
|
||||
for (ptr_plugin = weechat_plugins; ptr_plugin;
|
||||
ptr_plugin = ptr_plugin->next_plugin)
|
||||
gui_printf (NULL, " %s%s%s v%s - %s (%s)\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
ptr_plugin->name,
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
ptr_plugin->version,
|
||||
ptr_plugin->description,
|
||||
ptr_plugin->filename);
|
||||
|
||||
if (full)
|
||||
{
|
||||
/* plugin info */
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
gui_printf (NULL, " %s%s%s v%s - %s (%s)\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
ptr_plugin->name,
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
ptr_plugin->version,
|
||||
ptr_plugin->description,
|
||||
ptr_plugin->filename);
|
||||
|
||||
/* message handlers */
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _(" message handlers:\n"));
|
||||
@@ -2507,7 +2311,7 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
|
||||
for (ptr_handler = ptr_plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if (ptr_handler->type == HANDLER_MESSAGE)
|
||||
if (ptr_handler->type == PLUGIN_HANDLER_MESSAGE)
|
||||
{
|
||||
handler_found = 1;
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
@@ -2528,7 +2332,7 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
|
||||
for (ptr_handler = ptr_plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if (ptr_handler->type == HANDLER_COMMAND)
|
||||
if (ptr_handler->type == PLUGIN_HANDLER_COMMAND)
|
||||
{
|
||||
handler_found = 1;
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
@@ -2554,7 +2358,7 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
|
||||
for (ptr_handler = ptr_plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if (ptr_handler->type == HANDLER_TIMER)
|
||||
if (ptr_handler->type == PLUGIN_HANDLER_TIMER)
|
||||
{
|
||||
handler_found = 1;
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
@@ -2575,7 +2379,7 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
|
||||
for (ptr_handler = ptr_plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if (ptr_handler->type == HANDLER_KEYBOARD)
|
||||
if (ptr_handler->type == PLUGIN_HANDLER_KEYBOARD)
|
||||
handler_found++;
|
||||
}
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
@@ -2584,15 +2388,64 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
|
||||
else
|
||||
gui_printf (NULL, _(" %d defined\n"),
|
||||
handler_found);
|
||||
}
|
||||
if (!weechat_plugins)
|
||||
{
|
||||
|
||||
/* modifiers */
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _(" (no plugin)\n"));
|
||||
gui_printf (NULL, _(" modifiers:\n"));
|
||||
modifier_found = 0;
|
||||
for (ptr_modifier = ptr_plugin->modifiers;
|
||||
ptr_modifier; ptr_modifier = ptr_modifier->next_modifier)
|
||||
{
|
||||
modifier_found++;
|
||||
}
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
if (!modifier_found)
|
||||
gui_printf (NULL, _(" (no modifier)\n"));
|
||||
else
|
||||
gui_printf (NULL, _(" %d defined\n"),
|
||||
modifier_found);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (plugins_found == 0)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
if (name)
|
||||
gui_printf (NULL, _("No plugin found.\n"));
|
||||
else
|
||||
gui_printf (NULL, _(" (no plugin)\n"));
|
||||
}
|
||||
#else
|
||||
/* make gcc happy */
|
||||
(void) name;
|
||||
(void) full;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_plugin: list/load/unload WeeChat plugins
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
|
||||
int argc, char **argv)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
/* make gcc happy */
|
||||
(void) server;
|
||||
(void) channel;
|
||||
|
||||
switch (argc)
|
||||
{
|
||||
case 0:
|
||||
weechat_cmd_plugin_list (NULL, 0);
|
||||
break;
|
||||
case 1:
|
||||
if (ascii_strcasecmp (argv[0], "autoload") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "list") == 0)
|
||||
weechat_cmd_plugin_list (NULL, 0);
|
||||
else if (ascii_strcasecmp (argv[0], "listfull") == 0)
|
||||
weechat_cmd_plugin_list (NULL, 1);
|
||||
else if (ascii_strcasecmp (argv[0], "autoload") == 0)
|
||||
plugin_auto_load ();
|
||||
else if (ascii_strcasecmp (argv[0], "reload") == 0)
|
||||
{
|
||||
@@ -2603,8 +2456,14 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
|
||||
plugin_unload_all ();
|
||||
break;
|
||||
case 2:
|
||||
if (ascii_strcasecmp (argv[0], "load") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "list") == 0)
|
||||
weechat_cmd_plugin_list (argv[1], 0);
|
||||
else if (ascii_strcasecmp (argv[0], "listfull") == 0)
|
||||
weechat_cmd_plugin_list (argv[1], 1);
|
||||
else if (ascii_strcasecmp (argv[0], "load") == 0)
|
||||
plugin_load (argv[1]);
|
||||
else if (ascii_strcasecmp (argv[0], "reload") == 0)
|
||||
plugin_reload_name (argv[1]);
|
||||
else if (ascii_strcasecmp (argv[0], "unload") == 0)
|
||||
plugin_unload_name (argv[1]);
|
||||
else
|
||||
@@ -2925,8 +2784,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
|
||||
server_tmp.nick2, server_tmp.nick3,
|
||||
server_tmp.username, server_tmp.realname,
|
||||
server_tmp.hostname,
|
||||
server_tmp.command, 1, server_tmp.autojoin, 1, NULL,
|
||||
NULL, NULL, NULL);
|
||||
server_tmp.command, 1, server_tmp.autojoin, 1, NULL);
|
||||
if (new_server)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_INFO);
|
||||
@@ -3675,6 +3533,15 @@ weechat_cmd_upgrade (t_irc_server *server, t_irc_channel *channel,
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
if (ptr_server->outqueue)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf_nolog (NULL,
|
||||
_("%s can't upgrade: anti-flood is active on "
|
||||
"at least one server (sending many lines)\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
filename_length = strlen (weechat_home) + strlen (WEECHAT_SESSION_NAME) + 2;
|
||||
@@ -3718,9 +3585,10 @@ weechat_cmd_upgrade (t_irc_server *server, t_irc_channel *channel,
|
||||
plugin_init (1);
|
||||
#endif
|
||||
|
||||
fprintf (stderr, _("%s exec failed (program: \"%s\"), exiting WeeChat\n"),
|
||||
WEECHAT_ERROR,
|
||||
exec_args[0]);
|
||||
weechat_iconv_fprintf (stderr,
|
||||
_("%s exec failed (program: \"%s\"), exiting WeeChat\n"),
|
||||
WEECHAT_ERROR,
|
||||
exec_args[0]);
|
||||
|
||||
free (exec_args[0]);
|
||||
free (exec_args[3]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -60,7 +60,6 @@ extern void user_command (t_irc_server *, t_irc_channel *, char *, int);
|
||||
extern int weechat_cmd_alias (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_buffer (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_builtin (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int weechat_cmd_charset (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_clear (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_connect (t_irc_server *, t_irc_channel *, int, char **);
|
||||
extern int weechat_cmd_dcc (t_irc_server *, t_irc_channel *, char *);
|
||||
|
||||
+144
-41
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -26,6 +26,10 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "completion.h"
|
||||
@@ -61,6 +65,7 @@ completion_init (t_completion *completion, void *server, void *channel)
|
||||
completion->position = -1;
|
||||
completion->args = NULL;
|
||||
completion->direction = 0;
|
||||
completion->add_space = 1;
|
||||
|
||||
completion->completion_list = NULL;
|
||||
completion->last_completion = NULL;
|
||||
@@ -154,7 +159,7 @@ completion_get_command_infos (t_completion *completion,
|
||||
for (ptr_handler = ptr_plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if ((ptr_handler->type == HANDLER_COMMAND)
|
||||
if ((ptr_handler->type == PLUGIN_HANDLER_COMMAND)
|
||||
&& (ascii_strcasecmp (ptr_handler->command,
|
||||
ptr_command2) == 0))
|
||||
{
|
||||
@@ -283,8 +288,90 @@ completion_list_add_server_channels (t_completion *completion)
|
||||
void
|
||||
completion_list_add_filename (t_completion *completion)
|
||||
{
|
||||
/* TODO: add filename completion */
|
||||
completion_stop (completion);
|
||||
char *path_d, *path_b, *p, *d_name;
|
||||
char *real_prefix, *prefix;
|
||||
char *buffer;
|
||||
int buffer_len;
|
||||
DIR *dp;
|
||||
struct dirent *entry;
|
||||
struct stat statbuf;
|
||||
char home[3] = { '~', DIR_SEPARATOR_CHAR, '\0' };
|
||||
|
||||
buffer_len = PATH_MAX;
|
||||
buffer = (char *) malloc (buffer_len * sizeof (char));
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
completion->add_space = 0;
|
||||
|
||||
if ((strncmp (completion->base_word, home, 2) == 0) && getenv("HOME"))
|
||||
{
|
||||
real_prefix = strdup (getenv("HOME"));
|
||||
prefix = strdup (home);
|
||||
}
|
||||
else if ((strncmp (completion->base_word, DIR_SEPARATOR, 1) != 0)
|
||||
|| (strcmp (completion->base_word, "") == 0))
|
||||
{
|
||||
real_prefix = strdup (weechat_home);
|
||||
prefix = strdup ("");
|
||||
}
|
||||
else
|
||||
{
|
||||
real_prefix = strdup (DIR_SEPARATOR);
|
||||
prefix = strdup (DIR_SEPARATOR);
|
||||
}
|
||||
|
||||
snprintf (buffer, buffer_len, "%s", completion->base_word + strlen (prefix));
|
||||
p = strrchr (buffer, DIR_SEPARATOR_CHAR);
|
||||
if (p)
|
||||
{
|
||||
*p = '\0';
|
||||
path_d = strdup (buffer);
|
||||
p++;
|
||||
path_b = strdup (p);
|
||||
}
|
||||
else {
|
||||
path_d = strdup ("");
|
||||
path_b = strdup (buffer);
|
||||
}
|
||||
|
||||
sprintf (buffer, "%s%s%s", real_prefix, DIR_SEPARATOR, path_d);
|
||||
d_name = strdup (buffer);
|
||||
dp = opendir(d_name);
|
||||
if (dp != NULL)
|
||||
{
|
||||
while((entry = readdir(dp)) != NULL)
|
||||
{
|
||||
if (strncmp (entry->d_name, path_b, strlen(path_b)) == 0) {
|
||||
|
||||
if (strcmp (entry->d_name, ".") == 0 || strcmp (entry->d_name, "..") == 0)
|
||||
continue;
|
||||
|
||||
snprintf(buffer, buffer_len, "%s%s%s",
|
||||
d_name, DIR_SEPARATOR, entry->d_name);
|
||||
if (stat(buffer, &statbuf) == -1)
|
||||
continue;
|
||||
|
||||
snprintf(buffer, buffer_len, "%s%s%s%s%s%s",
|
||||
prefix,
|
||||
((strcmp(prefix, "") == 0)
|
||||
|| strchr(prefix, DIR_SEPARATOR_CHAR)) ? "" : DIR_SEPARATOR,
|
||||
path_d,
|
||||
strcmp(path_d, "") == 0 ? "" : DIR_SEPARATOR,
|
||||
entry->d_name,
|
||||
S_ISDIR(statbuf.st_mode) ? DIR_SEPARATOR : "");
|
||||
|
||||
completion_list_add (completion, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free (d_name);
|
||||
free (prefix);
|
||||
free (real_prefix);
|
||||
free (path_d);
|
||||
free (path_b);
|
||||
free (buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -304,7 +391,7 @@ completion_list_add_plugin_cmd (t_completion *completion)
|
||||
for (ptr_handler = ptr_plugin->handlers;
|
||||
ptr_handler; ptr_handler = ptr_handler->next_handler)
|
||||
{
|
||||
if (ptr_handler->type == HANDLER_COMMAND)
|
||||
if (ptr_handler->type == PLUGIN_HANDLER_COMMAND)
|
||||
completion_list_add (completion, ptr_handler->command);
|
||||
}
|
||||
}
|
||||
@@ -582,7 +669,7 @@ completion_list_add_servers (t_completion *completion)
|
||||
void
|
||||
completion_list_add_topic (t_completion *completion)
|
||||
{
|
||||
char *string, *string2;
|
||||
char *string;
|
||||
|
||||
if (!completion->server || !completion->channel
|
||||
|| !((t_irc_channel *)(completion->channel))->topic
|
||||
@@ -594,16 +681,11 @@ completion_list_add_topic (t_completion *completion)
|
||||
string = (char *)gui_color_decode_for_user_entry ((unsigned char *)((t_irc_channel *)(completion->channel))->topic);
|
||||
else
|
||||
string = (char *)gui_color_decode ((unsigned char *)((t_irc_channel *)(completion->channel))->topic, 0);
|
||||
string2 = channel_iconv_decode ((t_irc_server *)(completion->server),
|
||||
(t_irc_channel *)(completion->channel),
|
||||
(string) ? string : ((t_irc_channel *)(completion->channel))->topic);
|
||||
completion_list_add (completion,
|
||||
(string2) ? string2 : ((string) ?
|
||||
string : ((t_irc_channel *)(completion->channel))->topic));
|
||||
(string) ?
|
||||
string : ((t_irc_channel *)(completion->channel))->topic);
|
||||
if (string)
|
||||
free (string);
|
||||
if (string2)
|
||||
free (string2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -786,6 +868,7 @@ completion_build_list_template (t_completion *completion, char *template)
|
||||
break;
|
||||
case 'n': /* channel nicks */
|
||||
completion_list_add_channel_nicks (completion);
|
||||
completion->context = COMPLETION_NICK;
|
||||
break;
|
||||
case 'N': /* channel nicks and hosts */
|
||||
completion_list_add_channel_nicks_hosts (completion);
|
||||
@@ -887,6 +970,7 @@ completion_find_context (t_completion *completion, char *buffer, int size, int p
|
||||
|
||||
/* look for context */
|
||||
completion_free (completion);
|
||||
completion_init (completion, completion->server, completion->channel);
|
||||
command = ((buffer[0] == '/') && (buffer[1] != '/')) ? 1 : 0;
|
||||
command_arg = 0;
|
||||
i = 0;
|
||||
@@ -917,12 +1001,7 @@ completion_find_context (t_completion *completion, char *buffer, int size, int p
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (completion->channel)
|
||||
completion->context = COMPLETION_NICK;
|
||||
else
|
||||
completion->context = COMPLETION_NULL;
|
||||
}
|
||||
completion->context = COMPLETION_AUTO;
|
||||
|
||||
/* look for word to complete (base word) */
|
||||
completion->base_word_pos = 0;
|
||||
@@ -995,29 +1074,14 @@ completion_find_context (t_completion *completion, char *buffer, int size, int p
|
||||
}
|
||||
}
|
||||
|
||||
/* nick completion with nothing as base word is disabled,
|
||||
/* auto completion with nothing as base word is disabled,
|
||||
in order to prevent completion when pasting messages with [tab] inside */
|
||||
if ((completion->context == COMPLETION_NICK)
|
||||
if ((completion->context == COMPLETION_AUTO)
|
||||
&& ((!completion->base_word) || (!completion->base_word[0])))
|
||||
{
|
||||
completion->context = COMPLETION_NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!completion->completion_list && completion->channel &&
|
||||
((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|
||||
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
|
||||
&& (completion->context == COMPLETION_NICK))
|
||||
{
|
||||
/* nick completion in private (only other nick and self) */
|
||||
completion->context = COMPLETION_NICK;
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
((t_irc_channel *)(completion->channel))->name);
|
||||
weelist_add (&completion->completion_list,
|
||||
&completion->last_completion,
|
||||
((t_irc_server *)(completion->server))->nick);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1240,6 +1304,8 @@ completion_nick (t_completion *completion)
|
||||
if (!completion->channel)
|
||||
return;
|
||||
|
||||
completion->context = COMPLETION_NICK;
|
||||
|
||||
if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
|
||||
|| (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
|
||||
{
|
||||
@@ -1323,6 +1389,39 @@ completion_nick (t_completion *completion)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_auto: auto complete: nick, filename or channel
|
||||
*/
|
||||
|
||||
void
|
||||
completion_auto (t_completion *completion)
|
||||
{
|
||||
/* filename completion */
|
||||
if ((completion->base_word[0] == '/')
|
||||
|| (completion->base_word[0] == '~'))
|
||||
{
|
||||
if (!completion->completion_list)
|
||||
completion_list_add_filename (completion);
|
||||
completion_command_arg (completion, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* channel completion */
|
||||
if (string_is_channel (completion->base_word))
|
||||
{
|
||||
if (!completion->completion_list)
|
||||
completion_list_add_server_channels (completion);
|
||||
completion_command_arg (completion, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* default: nick completion (if channel) */
|
||||
if (completion->channel)
|
||||
completion_nick (completion);
|
||||
else
|
||||
completion->context = COMPLETION_NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* completion_search: complete word according to context
|
||||
*/
|
||||
@@ -1350,10 +1449,7 @@ completion_search (t_completion *completion, int direction,
|
||||
/* should never be executed */
|
||||
return;
|
||||
case COMPLETION_NICK:
|
||||
if (completion->channel)
|
||||
completion_nick (completion);
|
||||
else
|
||||
return;
|
||||
completion_nick (completion);
|
||||
break;
|
||||
case COMPLETION_COMMAND:
|
||||
completion_command (completion);
|
||||
@@ -1362,7 +1458,13 @@ completion_search (t_completion *completion, int direction,
|
||||
if (completion->completion_list)
|
||||
completion_command_arg (completion, completion->arg_is_nick);
|
||||
else
|
||||
completion_nick (completion);
|
||||
{
|
||||
completion->context = COMPLETION_AUTO;
|
||||
completion_auto (completion);
|
||||
}
|
||||
break;
|
||||
case COMPLETION_AUTO:
|
||||
completion_auto (completion);
|
||||
break;
|
||||
}
|
||||
if (completion->word_found)
|
||||
@@ -1408,6 +1510,7 @@ completion_print_log (t_completion *completion)
|
||||
weechat_log_printf (" position . . . . . . . : %d\n", completion->position);
|
||||
weechat_log_printf (" args . . . . . . . . . : '%s'\n", completion->args);
|
||||
weechat_log_printf (" direction. . . . . . . : %d\n", completion->direction);
|
||||
weechat_log_printf (" add_space. . . . . . . : %d\n", completion->add_space);
|
||||
weechat_log_printf (" completion_list. . . . : 0x%X\n", completion->completion_list);
|
||||
weechat_log_printf (" last_completion. . . . : 0x%X\n", completion->last_completion);
|
||||
weechat_log_printf (" word_found . . . . . . : '%s'\n", completion->word_found);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -27,6 +27,7 @@
|
||||
#define COMPLETION_NICK 1
|
||||
#define COMPLETION_COMMAND 2
|
||||
#define COMPLETION_COMMAND_ARG 3
|
||||
#define COMPLETION_AUTO 4
|
||||
|
||||
typedef struct t_completion t_completion;
|
||||
|
||||
@@ -44,6 +45,7 @@ struct t_completion
|
||||
int position; /* position where Tab was pressed */
|
||||
char *args; /* command line args (including base word) */
|
||||
int direction; /* +1 = search next word, -1 = previous word */
|
||||
int add_space; /* add space after completion? */
|
||||
|
||||
/* for command argument completion */
|
||||
t_weelist *completion_list; /* data list for completion */
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
+19
-13
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -28,12 +28,17 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef HAVE_FLOCK
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
|
||||
char *weechat_log_filename = NULL; /* log name (~/.weechat/weechat.log) */
|
||||
@@ -95,11 +100,11 @@ weechat_log_init ()
|
||||
{
|
||||
if (!weechat_log_open (NULL, "w"))
|
||||
{
|
||||
fprintf (stderr,
|
||||
_("%s unable to create/append to log file\n"
|
||||
"If another WeeChat process is using this file, try to run WeeChat\n"
|
||||
"with another home using \"--dir\" command line option.\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_iconv_fprintf (stderr,
|
||||
_("%s unable to create/append to log file\n"
|
||||
"If another WeeChat process is using this file, try to run WeeChat\n"
|
||||
"with another home using \"--dir\" command line option.\n"),
|
||||
WEECHAT_ERROR);
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
@@ -138,12 +143,13 @@ weechat_log_printf (char *message, ...)
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
if (date_tmp)
|
||||
fprintf (weechat_log_file, "[%04d-%02d-%02d %02d:%02d:%02d] %s",
|
||||
date_tmp->tm_year + 1900, date_tmp->tm_mon + 1, date_tmp->tm_mday,
|
||||
date_tmp->tm_hour, date_tmp->tm_min, date_tmp->tm_sec,
|
||||
buffer);
|
||||
weechat_iconv_fprintf (weechat_log_file, "[%04d-%02d-%02d %02d:%02d:%02d] %s",
|
||||
date_tmp->tm_year + 1900, date_tmp->tm_mon + 1, date_tmp->tm_mday,
|
||||
date_tmp->tm_hour, date_tmp->tm_min, date_tmp->tm_sec,
|
||||
buffer);
|
||||
else
|
||||
fprintf (weechat_log_file, "%s", buffer);
|
||||
weechat_iconv_fprintf (weechat_log_file, "%s", buffer);
|
||||
|
||||
fflush (weechat_log_file);
|
||||
}
|
||||
|
||||
@@ -208,8 +214,8 @@ weechat_log_crash_rename ()
|
||||
getpid());
|
||||
if (rename (old_name, new_name) == 0)
|
||||
{
|
||||
fprintf (stderr, "*** Full crash dump was saved to %s file.\n",
|
||||
new_name);
|
||||
weechat_iconv_fprintf (stderr, "*** Full crash dump was saved to %s file.\n",
|
||||
new_name);
|
||||
weechat_log_open (new_name, "a");
|
||||
free (old_name);
|
||||
free (new_name);
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
+50
-31
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "session.h"
|
||||
#include "hotlist.h"
|
||||
#include "log.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
@@ -265,9 +267,6 @@ session_save_servers (FILE *file)
|
||||
rc = rc && (session_write_int (file, SESSION_SERV_LAG, ptr_server->lag));
|
||||
rc = rc && (session_write_buf (file, SESSION_SERV_LAG_CHECK_TIME, &(ptr_server->lag_check_time), sizeof (struct timeval)));
|
||||
rc = rc && (session_write_buf (file, SESSION_SERV_LAG_NEXT_CHECK, &(ptr_server->lag_next_check), sizeof (time_t)));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_CHARSET_DECODE_ISO, ptr_server->charset_decode_iso));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_CHARSET_DECODE_UTF, ptr_server->charset_decode_utf));
|
||||
rc = rc && (session_write_str (file, SESSION_SERV_CHARSET_ENCODE, ptr_server->charset_encode));
|
||||
rc = rc && (session_write_id (file, SESSION_SERV_END));
|
||||
|
||||
if (!rc)
|
||||
@@ -377,6 +376,7 @@ session_save_line (FILE *file, t_gui_line *line)
|
||||
rc = rc && (session_write_int (file, SESSION_LINE_OFS_AFTER_DATE, line->ofs_start_message));
|
||||
rc = rc && (session_write_int (file, SESSION_LINE_OFS_START_MESSAGE, line->ofs_start_message));
|
||||
rc = rc && (session_write_str (file, SESSION_LINE_NICK, line->nick));
|
||||
rc = rc && (session_write_buf (file, SESSION_LINE_DATE, &(line->date), sizeof (time_t)));
|
||||
rc = rc && (session_write_id (file, SESSION_LINE_END));
|
||||
return rc;
|
||||
}
|
||||
@@ -509,21 +509,21 @@ session_crash (FILE *file, char *message, ...)
|
||||
|
||||
fclose (file);
|
||||
gui_main_end ();
|
||||
fprintf (stderr, "%s %s\n",
|
||||
WEECHAT_ERROR, buffer);
|
||||
fprintf (stderr,
|
||||
_("Last operation with session file was at position %ld, "
|
||||
"read of %d bytes\n"),
|
||||
session_last_read_pos,
|
||||
session_last_read_length);
|
||||
fprintf (stderr,
|
||||
_("Please send %s/%s, %s/%s and "
|
||||
"above messages to WeeChat developers for support.\n"
|
||||
"Be careful, private info may be in these files.\n"),
|
||||
weechat_home,
|
||||
WEECHAT_LOG_NAME,
|
||||
weechat_home,
|
||||
WEECHAT_SESSION_NAME);
|
||||
weechat_iconv_fprintf (stderr, "%s %s\n",
|
||||
WEECHAT_ERROR, buffer);
|
||||
weechat_iconv_fprintf (stderr,
|
||||
_("Last operation with session file was at position %ld, "
|
||||
"read of %d bytes\n"),
|
||||
session_last_read_pos,
|
||||
session_last_read_length);
|
||||
weechat_iconv_fprintf (stderr,
|
||||
_("Please send %s/%s, %s/%s and "
|
||||
"above messages to WeeChat developers for support.\n"
|
||||
"Be careful, private info may be in these files.\n"),
|
||||
weechat_home,
|
||||
WEECHAT_LOG_NAME,
|
||||
weechat_home,
|
||||
WEECHAT_SESSION_NAME);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -617,6 +617,22 @@ session_read_str (FILE *file, char **string)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* session_read_str_utf8: read string from file, then normalize UTF-8
|
||||
*/
|
||||
|
||||
int
|
||||
session_read_str_utf8 (FILE *file, char **string)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = session_read_str (file, string);
|
||||
if (rc && *string)
|
||||
utf8_normalize (*string, '?');
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
* session_read_buf: read buffer from file
|
||||
*/
|
||||
@@ -952,7 +968,7 @@ session_load_server (FILE *file)
|
||||
gnutls_session_set_data (session_current_server->gnutls_sess, session_data, session_size);
|
||||
free (session_data);
|
||||
gnutls_transport_set_ptr (session_current_server->gnutls_sess,
|
||||
(gnutls_transport_ptr) session_current_server->sock);
|
||||
(gnutls_transport_ptr) ((unsigned long) session_current_server->sock));
|
||||
if (gnutls_handshake (session_current_server->gnutls_sess) < 0)
|
||||
{
|
||||
session_crash (file, _("gnutls handshake failed"));
|
||||
@@ -980,7 +996,7 @@ session_load_server (FILE *file)
|
||||
rc = rc && (session_read_int (file, &(session_current_server->is_away)));
|
||||
break;
|
||||
case SESSION_SERV_AWAY_MESSAGE:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->away_message)));
|
||||
rc = rc && (session_read_str (file, &(session_current_server->away_message)));
|
||||
break;
|
||||
case SESSION_SERV_AWAY_TIME:
|
||||
rc = rc && (session_read_buf (file, &(session_current_server->away_time), sizeof (time_t)));
|
||||
@@ -994,14 +1010,14 @@ session_load_server (FILE *file)
|
||||
case SESSION_SERV_LAG_NEXT_CHECK:
|
||||
rc = rc && (session_read_buf (file, &(session_current_server->lag_next_check), sizeof (time_t)));
|
||||
break;
|
||||
case SESSION_SERV_CHARSET_DECODE_ISO:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->charset_decode_iso)));
|
||||
case SESSION_SERV_CHARSET_DECODE_ISO__UNUSED:
|
||||
rc = rc && (session_read_ignore_value (file));
|
||||
break;
|
||||
case SESSION_SERV_CHARSET_DECODE_UTF:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->charset_decode_utf)));
|
||||
case SESSION_SERV_CHARSET_DECODE_UTF__UNUSED:
|
||||
rc = rc && (session_read_ignore_value (file));
|
||||
break;
|
||||
case SESSION_SERV_CHARSET_ENCODE:
|
||||
rc = rc && (session_read_str (file, &(session_current_server->charset_encode)));
|
||||
case SESSION_SERV_CHARSET_ENCODE__UNUSED:
|
||||
rc = rc && (session_read_ignore_value (file));
|
||||
break;
|
||||
default:
|
||||
weechat_log_printf (_("session: warning: ignoring value from "
|
||||
@@ -1075,7 +1091,7 @@ session_load_channel (FILE *file)
|
||||
case SESSION_CHAN_END:
|
||||
return 1;
|
||||
case SESSION_CHAN_TOPIC:
|
||||
rc = rc && (session_read_str (file, &(session_current_channel->topic)));
|
||||
rc = rc && (session_read_str_utf8 (file, &(session_current_channel->topic)));
|
||||
break;
|
||||
case SESSION_CHAN_MODES:
|
||||
rc = rc && (session_read_str (file, (char **)(&(session_current_channel->modes))));
|
||||
@@ -1384,7 +1400,7 @@ session_load_history (FILE *file)
|
||||
return 1;
|
||||
case SESSION_HIST_TEXT:
|
||||
text = NULL;
|
||||
if (!session_read_str (file, &text))
|
||||
if (!session_read_str_utf8 (file, &text))
|
||||
return 0;
|
||||
if (session_current_buffer)
|
||||
history_buffer_add (session_current_buffer, text);
|
||||
@@ -1524,7 +1540,7 @@ session_load_line (FILE *file)
|
||||
}
|
||||
|
||||
/* allocate line */
|
||||
line = gui_buffer_line_new (session_current_buffer);
|
||||
line = gui_buffer_line_new (session_current_buffer, time (NULL));
|
||||
if (!line)
|
||||
{
|
||||
session_crash (file, _("can't create new line"));
|
||||
@@ -1562,7 +1578,7 @@ session_load_line (FILE *file)
|
||||
rc = rc && (session_read_int (file, &(line->line_with_highlight)));
|
||||
break;
|
||||
case SESSION_LINE_DATA:
|
||||
rc = rc && (session_read_str (file, &(line->data)));
|
||||
rc = rc && (session_read_str_utf8 (file, &(line->data)));
|
||||
break;
|
||||
case SESSION_LINE_OFS_AFTER_DATE:
|
||||
rc = rc && (session_read_int (file, &(line->ofs_after_date)));
|
||||
@@ -1573,6 +1589,9 @@ session_load_line (FILE *file)
|
||||
case SESSION_LINE_NICK:
|
||||
rc = rc && (session_read_str (file, &(line->nick)));
|
||||
break;
|
||||
case SESSION_LINE_DATE:
|
||||
rc = rc && (session_read_buf (file, &(line->date), sizeof (time_t)));
|
||||
break;
|
||||
default:
|
||||
weechat_log_printf (_("session: warning: ignoring value from "
|
||||
"line (object id: %d)\n"),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -87,9 +87,9 @@ enum t_session_server
|
||||
SESSION_SERV_LAG,
|
||||
SESSION_SERV_LAG_CHECK_TIME,
|
||||
SESSION_SERV_LAG_NEXT_CHECK,
|
||||
SESSION_SERV_CHARSET_DECODE_ISO,
|
||||
SESSION_SERV_CHARSET_DECODE_UTF,
|
||||
SESSION_SERV_CHARSET_ENCODE,
|
||||
SESSION_SERV_CHARSET_DECODE_ISO__UNUSED,
|
||||
SESSION_SERV_CHARSET_DECODE_UTF__UNUSED,
|
||||
SESSION_SERV_CHARSET_ENCODE__UNUSED,
|
||||
SESSION_SERV_HOSTNAME,
|
||||
SESSION_SERV_NICK_MODES,
|
||||
SESSION_SERV_AWAY_MESSAGE
|
||||
@@ -179,7 +179,8 @@ enum t_session_line
|
||||
SESSION_LINE_DATA,
|
||||
SESSION_LINE_OFS_AFTER_DATE,
|
||||
SESSION_LINE_OFS_START_MESSAGE,
|
||||
SESSION_LINE_NICK
|
||||
SESSION_LINE_NICK,
|
||||
SESSION_LINE_DATE
|
||||
};
|
||||
|
||||
enum t_session_uptime
|
||||
|
||||
+45
-37
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -39,12 +39,12 @@
|
||||
|
||||
#include "weechat.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
#include "weeconfig.h"
|
||||
|
||||
|
||||
int local_utf8 = 0;
|
||||
|
||||
|
||||
/*
|
||||
* utf8_init: initializes UTF-8 in WeeChat
|
||||
*/
|
||||
@@ -52,26 +52,17 @@ int local_utf8 = 0;
|
||||
void
|
||||
utf8_init ()
|
||||
{
|
||||
local_utf8 = 0;
|
||||
|
||||
if (cfg_look_charset_internal && cfg_look_charset_internal[0])
|
||||
{
|
||||
if (strstr (cfg_look_charset_internal, "UTF-8")
|
||||
|| strstr (cfg_look_charset_internal, "utf-8"))
|
||||
local_utf8 = 1;
|
||||
}
|
||||
else if ((local_charset)
|
||||
&& ((strstr (local_charset, "UTF-8")
|
||||
|| strstr (local_charset, "utf-8"))))
|
||||
local_utf8 = 1;
|
||||
local_utf8 = (ascii_strcasecmp (local_charset, "UTF-8") == 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* utf8_is_valid: return 1 if UTF-8 string is valid, 0 otherwise
|
||||
* if error is not NULL, it's set with first non valid UTF-8
|
||||
* char in string, if any
|
||||
*/
|
||||
|
||||
int
|
||||
utf8_is_valid (char *string)
|
||||
utf8_is_valid (char *string, char **error)
|
||||
{
|
||||
while (string && string[0])
|
||||
{
|
||||
@@ -79,7 +70,11 @@ utf8_is_valid (char *string)
|
||||
if (((unsigned char)(string[0]) & 0xE0) == 0xC0)
|
||||
{
|
||||
if (!string[1] || (((unsigned char)(string[1]) & 0xC0) != 0x80))
|
||||
{
|
||||
if (error)
|
||||
*error = string;
|
||||
return 0;
|
||||
}
|
||||
string += 2;
|
||||
}
|
||||
/* UTF-8, 3 bytes, should be: 1110vvvv 10vvvvvv 10vvvvvv */
|
||||
@@ -88,7 +83,11 @@ utf8_is_valid (char *string)
|
||||
if (!string[1] || !string[2]
|
||||
|| (((unsigned char)(string[1]) & 0xC0) != 0x80)
|
||||
|| (((unsigned char)(string[2]) & 0xC0) != 0x80))
|
||||
{
|
||||
if (error)
|
||||
*error = string;
|
||||
return 0;
|
||||
}
|
||||
string += 3;
|
||||
}
|
||||
/* UTF-8, 4 bytes, should be: 11110vvv 10vvvvvv 10vvvvvv 10vvvvvv */
|
||||
@@ -98,18 +97,47 @@ utf8_is_valid (char *string)
|
||||
|| (((unsigned char)(string[1]) & 0xC0) != 0x80)
|
||||
|| (((unsigned char)(string[2]) & 0xC0) != 0x80)
|
||||
|| (((unsigned char)(string[3]) & 0xC0) != 0x80))
|
||||
{
|
||||
if (error)
|
||||
*error = string;
|
||||
return 0;
|
||||
}
|
||||
string += 4;
|
||||
}
|
||||
/* UTF-8, 1 byte, should be: 0vvvvvvv */
|
||||
else if ((unsigned char)(string[0]) >= 0x80)
|
||||
{
|
||||
if (error)
|
||||
*error = string;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
string++;
|
||||
}
|
||||
if (error)
|
||||
*error = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* utf8_normalize: normalize UTF-8 string: remove non UTF-8 chars and
|
||||
* replace them by a char
|
||||
*/
|
||||
|
||||
void
|
||||
utf8_normalize (char *string, char replacement)
|
||||
{
|
||||
char *error;
|
||||
|
||||
while (string && string[0])
|
||||
{
|
||||
if (utf8_is_valid (string, &error))
|
||||
return;
|
||||
error[0] = replacement;
|
||||
string = error + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* utf8_prev_char: return previous UTF-8 char in a string
|
||||
*/
|
||||
@@ -122,9 +150,6 @@ utf8_prev_char (char *string_start, char *string)
|
||||
|
||||
string--;
|
||||
|
||||
if (!local_utf8)
|
||||
return string;
|
||||
|
||||
if (((unsigned char)(string[0]) & 0xC0) == 0x80)
|
||||
{
|
||||
/* UTF-8, at least 2 bytes */
|
||||
@@ -164,9 +189,6 @@ utf8_next_char (char *string)
|
||||
if (!string)
|
||||
return NULL;
|
||||
|
||||
if (!local_utf8)
|
||||
return string + 1;
|
||||
|
||||
/* UTF-8, 2 bytes: 110vvvvv 10vvvvvv */
|
||||
if (((unsigned char)(string[0]) & 0xE0) == 0xC0)
|
||||
{
|
||||
@@ -223,9 +245,6 @@ utf8_strlen (char *string)
|
||||
if (!string)
|
||||
return 0;
|
||||
|
||||
if (!local_utf8)
|
||||
return strlen (string);
|
||||
|
||||
length = 0;
|
||||
while (string && string[0])
|
||||
{
|
||||
@@ -248,14 +267,6 @@ utf8_strnlen (char *string, int bytes)
|
||||
if (!string)
|
||||
return 0;
|
||||
|
||||
if (!local_utf8)
|
||||
{
|
||||
length = strlen (string);
|
||||
if (bytes > length)
|
||||
return length;
|
||||
return bytes;
|
||||
}
|
||||
|
||||
start = string;
|
||||
length = 0;
|
||||
while (string && string[0] && (string - start < bytes))
|
||||
@@ -280,7 +291,7 @@ utf8_width_screen (char *string)
|
||||
return 0;
|
||||
|
||||
if (!local_utf8)
|
||||
return strlen (string);
|
||||
return utf8_strlen (string);
|
||||
|
||||
num_char = mbstowcs (NULL, string, 0) + 1;
|
||||
wstring = (wchar_t *) malloc ((num_char + 1) * sizeof (wchar_t));
|
||||
@@ -310,9 +321,6 @@ utf8_add_offset (char *string, int offset)
|
||||
if (!string)
|
||||
return string;
|
||||
|
||||
if (!local_utf8)
|
||||
return string + offset;
|
||||
|
||||
count = 0;
|
||||
while (string && string[0] && (count < offset))
|
||||
{
|
||||
@@ -333,7 +341,7 @@ utf8_real_pos (char *string, int pos)
|
||||
int count, real_pos;
|
||||
char *next_char;
|
||||
|
||||
if (!string || !local_utf8)
|
||||
if (!string)
|
||||
return pos;
|
||||
|
||||
count = 0;
|
||||
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -24,7 +24,8 @@
|
||||
extern int local_utf8;
|
||||
|
||||
extern void utf8_init ();
|
||||
extern int utf8_is_valid (char *);
|
||||
extern int utf8_is_valid (char *, char **);
|
||||
extern void utf8_normalize (char *, char);
|
||||
extern char *utf8_prev_char (char *, char *);
|
||||
extern char *utf8_next_char (char *);
|
||||
extern int utf8_char_size (char *);
|
||||
|
||||
+127
-28
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -25,6 +25,8 @@
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
@@ -32,9 +34,34 @@
|
||||
#endif
|
||||
|
||||
#include "weechat.h"
|
||||
#include "utf8.h"
|
||||
#include "weeconfig.h"
|
||||
|
||||
|
||||
/*
|
||||
* strndup: define strndup function if not existing (FreeBSD and maybe other)
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRNDUP
|
||||
char *
|
||||
strndup (char *string, int length)
|
||||
{
|
||||
char *result;
|
||||
|
||||
if ((int)strlen (string) < length)
|
||||
return strdup (string);
|
||||
|
||||
result = (char *)malloc (length + 1);
|
||||
if (!result)
|
||||
return NULL;
|
||||
|
||||
memcpy (result, string, length);
|
||||
result[length] = '\0';
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ascii_tolower: locale independant string conversion to lower case
|
||||
*/
|
||||
@@ -174,9 +201,10 @@ weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
char *inbuf;
|
||||
int done;
|
||||
ICONV_CONST char *ptr_inbuf;
|
||||
char *ptr_outbuf;
|
||||
size_t inbytesleft, outbytesleft;
|
||||
size_t err, inbytesleft, outbytesleft;
|
||||
|
||||
if (from_code && from_code[0] && to_code && to_code[0]
|
||||
&& (ascii_strcasecmp(from_code, to_code) != 0))
|
||||
@@ -192,14 +220,30 @@ weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
outbytesleft = inbytesleft * 4;
|
||||
outbuf = (char *) malloc (outbytesleft + 2);
|
||||
ptr_outbuf = outbuf;
|
||||
iconv (cd, &ptr_inbuf, &inbytesleft, &ptr_outbuf, &outbytesleft);
|
||||
if (inbytesleft != 0)
|
||||
done = 0;
|
||||
while (!done)
|
||||
{
|
||||
free (outbuf);
|
||||
outbuf = strdup (string);
|
||||
err = iconv (cd, &ptr_inbuf, &inbytesleft,
|
||||
&ptr_outbuf, &outbytesleft);
|
||||
if (err == (size_t)(-1))
|
||||
{
|
||||
switch (errno)
|
||||
{
|
||||
case EINVAL:
|
||||
done = 1;
|
||||
break;
|
||||
case E2BIG:
|
||||
done = 1;
|
||||
break;
|
||||
case EILSEQ:
|
||||
ptr_inbuf[0] = '?';
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
done = 1;
|
||||
}
|
||||
else
|
||||
ptr_outbuf[0] = '\0';
|
||||
ptr_outbuf[0] = '\0';
|
||||
free (inbuf);
|
||||
iconv_close (cd);
|
||||
}
|
||||
@@ -217,32 +261,87 @@ weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_iconv_check: check a charset
|
||||
* if a charset is NULL, internal charset is used
|
||||
* weechat_iconv_to_internal: convert user string (input, script, ..) to
|
||||
* WeeChat internal storage charset
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_iconv_check (char *from_code, char *to_code)
|
||||
char *
|
||||
weechat_iconv_to_internal (char *charset, char *string)
|
||||
{
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
char *input, *output;
|
||||
|
||||
if (!from_code || !from_code[0])
|
||||
from_code = (cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset;
|
||||
input = strdup (string);
|
||||
|
||||
/* optimize for UTF-8: if charset is NULL => we use term charset =>
|
||||
if ths charset is already UTF-8, then no iconv needed */
|
||||
if (local_utf8 && (!charset || !charset[0]))
|
||||
return input;
|
||||
|
||||
if (input)
|
||||
{
|
||||
if (utf8_is_valid (input, NULL))
|
||||
return input;
|
||||
|
||||
output = weechat_iconv ((charset && charset[0]) ?
|
||||
charset : local_charset,
|
||||
WEECHAT_INTERNAL_CHARSET,
|
||||
input);
|
||||
utf8_normalize (output, '?');
|
||||
free (input);
|
||||
return output;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!to_code || !to_code[0])
|
||||
to_code = (cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset;
|
||||
/*
|
||||
* weechat_iconv_from_internal: convert internal string to terminal charset,
|
||||
* for display
|
||||
*/
|
||||
|
||||
cd = iconv_open (to_code, from_code);
|
||||
if (cd == (iconv_t)(-1))
|
||||
return 0;
|
||||
iconv_close (cd);
|
||||
return 1;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
char *
|
||||
weechat_iconv_from_internal (char *charset, char *string)
|
||||
{
|
||||
char *input, *output;
|
||||
|
||||
input = strdup (string);
|
||||
|
||||
/* optimize for UTF-8: if charset is NULL => we use term charset =>
|
||||
if ths charset is already UTF-8, then no iconv needed */
|
||||
if (local_utf8 && (!charset || !charset[0]))
|
||||
return input;
|
||||
|
||||
if (input)
|
||||
{
|
||||
utf8_normalize (input, '?');
|
||||
output = weechat_iconv (WEECHAT_INTERNAL_CHARSET,
|
||||
(charset && charset[0]) ?
|
||||
charset : local_charset,
|
||||
input);
|
||||
free (input);
|
||||
return output;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_iconv_fprintf: encode to terminal charset, then call fprintf on a file
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_iconv_fprintf (FILE *file, char *data, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
static char buf[4096];
|
||||
char *buf2;
|
||||
|
||||
va_start (argptr, data);
|
||||
vsnprintf (buf, sizeof (buf) - 1, data, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
buf2 = weechat_iconv_from_internal (NULL, buf);
|
||||
fprintf (file, "%s", (buf2) ? buf2 : buf);
|
||||
if (buf2)
|
||||
free (buf2);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+7
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -21,13 +21,18 @@
|
||||
#ifndef __WEECHAT_UTIL_H
|
||||
#define __WEECHAT_UTIL_H 1
|
||||
|
||||
#ifndef HAVE_STRNDUP
|
||||
extern char *strndup (char *, int);
|
||||
#endif
|
||||
extern void ascii_tolower (char *);
|
||||
extern void ascii_toupper (char *);
|
||||
extern int ascii_strcasecmp (char *, char *);
|
||||
extern int ascii_strncasecmp (char *, char *, int);
|
||||
extern char *ascii_strcasestr (char *, char *);
|
||||
extern char *weechat_iconv (char *, char *, char *);
|
||||
extern int weechat_iconv_check (char *, char *);
|
||||
extern char *weechat_iconv_to_internal (char *, char *);
|
||||
extern char *weechat_iconv_from_internal (char *, char *);
|
||||
extern void weechat_iconv_fprintf (FILE *, char *, ...);
|
||||
extern char *weechat_strreplace (char *, char *, char *);
|
||||
extern long get_timeval_diff (struct timeval *, struct timeval *);
|
||||
extern char **explode_string (char *, char *, int, int *);
|
||||
|
||||
+141
-127
@@ -14,7 +14,7 @@
|
||||
* ### ###
|
||||
* ############################################################################
|
||||
*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -98,27 +98,30 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
|
||||
void
|
||||
weechat_display_usage (char *exec_name)
|
||||
{
|
||||
printf ("\n");
|
||||
printf (_("%s (c) Copyright 2003-2006, compiled on %s %s\n"
|
||||
"Developed by FlashCode <flashcode@flashtux.org> - %s"),
|
||||
PACKAGE_STRING, __DATE__, __TIME__, WEECHAT_WEBSITE);
|
||||
printf ("\n\n");
|
||||
printf (_("Usage: %s [options ...]\n" \
|
||||
" or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]"),
|
||||
exec_name, exec_name);
|
||||
printf ("\n\n");
|
||||
printf (_(" -a, --no-connect disable auto-connect to servers at startup\n"
|
||||
" -c, --config display config file options\n"
|
||||
" -d, --dir <path> set WeeChat home directory (default: ~/.weechat)\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"
|
||||
" -p, --no-plugin don't load any plugin at startup\n"
|
||||
" -v, --version display WeeChat version\n"
|
||||
" -w, --weechat-commands display WeeChat commands\n"));
|
||||
printf("\n");
|
||||
weechat_iconv_fprintf (stdout, "\n");
|
||||
weechat_iconv_fprintf (stdout,
|
||||
_("%s (c) Copyright 2003-2007, compiled on %s %s\n"
|
||||
"Developed by FlashCode <flashcode@flashtux.org> - %s"),
|
||||
PACKAGE_STRING, __DATE__, __TIME__, WEECHAT_WEBSITE);
|
||||
weechat_iconv_fprintf (stdout, "\n\n");
|
||||
weechat_iconv_fprintf (stdout,
|
||||
_("Usage: %s [options ...]\n" \
|
||||
" or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]"),
|
||||
exec_name, exec_name);
|
||||
weechat_iconv_fprintf (stdout, "\n\n");
|
||||
weechat_iconv_fprintf (stdout,
|
||||
_(" -a, --no-connect disable auto-connect to servers at startup\n"
|
||||
" -c, --config display config file options\n"
|
||||
" -d, --dir <path> set WeeChat home directory (default: ~/.weechat)\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"
|
||||
" -p, --no-plugin don't load any plugin at startup\n"
|
||||
" -v, --version display WeeChat version\n"
|
||||
" -w, --weechat-commands display WeeChat commands\n"));
|
||||
weechat_iconv_fprintf(stdout, "\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -130,7 +133,8 @@ weechat_display_config_options ()
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
printf (_("WeeChat configuration options (<weechat_home>/weechat.rc):\n\n"));
|
||||
weechat_iconv_fprintf (stdout,
|
||||
_("WeeChat configuration options (<weechat_home>/weechat.rc):\n\n"));
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if (weechat_options[i])
|
||||
@@ -138,60 +142,61 @@ weechat_display_config_options ()
|
||||
j = 0;
|
||||
while (weechat_options[i][j].option_name)
|
||||
{
|
||||
printf ("* %s:\n",
|
||||
weechat_options[i][j].option_name);
|
||||
weechat_iconv_fprintf (stdout,
|
||||
"* %s:\n",
|
||||
weechat_options[i][j].option_name);
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
printf (_(" . type: boolean\n"));
|
||||
printf (_(" . values: 'on' or 'off'\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_int == BOOL_TRUE) ?
|
||||
"on" : "off");
|
||||
weechat_iconv_fprintf (stdout, _(" . type: boolean\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . values: 'on' or 'off'\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_int == BOOL_TRUE) ?
|
||||
"on" : "off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
printf (_(" . type: integer\n"));
|
||||
printf (_(" . values: between %d and %d\n"),
|
||||
weechat_options[i][j].min,
|
||||
weechat_options[i][j].max);
|
||||
printf (_(" . default value: %d\n"),
|
||||
weechat_options[i][j].default_int);
|
||||
weechat_iconv_fprintf (stdout, _(" . type: integer\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . values: between %d and %d\n"),
|
||||
weechat_options[i][j].min,
|
||||
weechat_options[i][j].max);
|
||||
weechat_iconv_fprintf (stdout, _(" . default value: %d\n"),
|
||||
weechat_options[i][j].default_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
printf (_(" . type: string\n"));
|
||||
printf (_(" . values: "));
|
||||
weechat_iconv_fprintf (stdout, _(" . type: string\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . values: "));
|
||||
k = 0;
|
||||
while (weechat_options[i][j].array_values[k])
|
||||
{
|
||||
printf ("'%s'",
|
||||
weechat_options[i][j].array_values[k]);
|
||||
weechat_iconv_fprintf (stdout, "'%s'",
|
||||
weechat_options[i][j].array_values[k]);
|
||||
if (weechat_options[i][j].array_values[k + 1])
|
||||
printf (", ");
|
||||
weechat_iconv_fprintf (stdout, ", ");
|
||||
k++;
|
||||
}
|
||||
printf ("\n");
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
weechat_iconv_fprintf (stdout, "\n");
|
||||
weechat_iconv_fprintf (stdout, _(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
printf (_(" . type: color\n"));
|
||||
printf (_(" . values: Curses or Gtk color\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
weechat_iconv_fprintf (stdout, _(" . type: color\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . values: Curses or Gtk color\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
printf (_(" . type: string\n"));
|
||||
printf (_(" . values: any string\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
weechat_iconv_fprintf (stdout, _(" . type: string\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . values: any string\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
break;
|
||||
}
|
||||
printf (_(" . description: %s\n"),
|
||||
_(weechat_options[i][j].long_description));
|
||||
printf ("\n");
|
||||
weechat_iconv_fprintf (stdout, _(" . description: %s\n"),
|
||||
_(weechat_options[i][j].long_description));
|
||||
weechat_iconv_fprintf (stdout, "\n");
|
||||
j++;
|
||||
}
|
||||
}
|
||||
@@ -209,43 +214,44 @@ weechat_display_commands (int weechat_cmd, int irc_cmd)
|
||||
|
||||
if (weechat_cmd)
|
||||
{
|
||||
printf (_("%s internal commands:\n"), PACKAGE_NAME);
|
||||
printf ("\n");
|
||||
weechat_iconv_fprintf (stdout,
|
||||
_("%s internal commands:\n"), PACKAGE_NAME);
|
||||
weechat_iconv_fprintf (stdout, "\n");
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
{
|
||||
printf ("* %s", weechat_commands[i].command_name);
|
||||
weechat_iconv_fprintf (stdout, "* %s", weechat_commands[i].command_name);
|
||||
if (weechat_commands[i].arguments &&
|
||||
weechat_commands[i].arguments[0])
|
||||
printf (" %s\n\n", _(weechat_commands[i].arguments));
|
||||
weechat_iconv_fprintf (stdout, " %s\n\n", _(weechat_commands[i].arguments));
|
||||
else
|
||||
printf ("\n\n");
|
||||
printf ("%s\n\n", _(weechat_commands[i].command_description));
|
||||
weechat_iconv_fprintf (stdout, "\n\n");
|
||||
weechat_iconv_fprintf (stdout, "%s\n\n", _(weechat_commands[i].command_description));
|
||||
if (weechat_commands[i].arguments_description &&
|
||||
weechat_commands[i].arguments_description[0])
|
||||
printf ("%s\n\n",
|
||||
_(weechat_commands[i].arguments_description));
|
||||
weechat_iconv_fprintf (stdout, "%s\n\n",
|
||||
_(weechat_commands[i].arguments_description));
|
||||
}
|
||||
}
|
||||
|
||||
if (irc_cmd)
|
||||
{
|
||||
printf (_("IRC commands:\n"));
|
||||
printf ("\n");
|
||||
weechat_iconv_fprintf (stdout, _("IRC commands:\n"));
|
||||
weechat_iconv_fprintf (stdout, "\n");
|
||||
for (i = 0; irc_commands[i].command_name; i++)
|
||||
{
|
||||
if (irc_commands[i].cmd_function_args ||
|
||||
irc_commands[i].cmd_function_1arg)
|
||||
{
|
||||
printf ("* %s", irc_commands[i].command_name);
|
||||
weechat_iconv_fprintf (stdout, "* %s", irc_commands[i].command_name);
|
||||
if (irc_commands[i].arguments &&
|
||||
irc_commands[i].arguments[0])
|
||||
printf (" %s\n\n", _(irc_commands[i].arguments));
|
||||
weechat_iconv_fprintf (stdout, " %s\n\n", _(irc_commands[i].arguments));
|
||||
else
|
||||
printf ("\n\n");
|
||||
printf ("%s\n\n", _(irc_commands[i].command_description));
|
||||
weechat_iconv_fprintf (stdout, "\n\n");
|
||||
weechat_iconv_fprintf (stdout, "%s\n\n", _(irc_commands[i].command_description));
|
||||
if (irc_commands[i].arguments_description &&
|
||||
irc_commands[i].arguments_description[0])
|
||||
printf ("%s\n\n",
|
||||
weechat_iconv_fprintf (stdout, "%s\n\n",
|
||||
_(irc_commands[i].arguments_description));
|
||||
}
|
||||
}
|
||||
@@ -261,14 +267,15 @@ weechat_display_key_functions ()
|
||||
{
|
||||
int i;
|
||||
|
||||
printf (_("Internal key functions:\n"));
|
||||
printf ("\n");
|
||||
weechat_iconv_fprintf (stdout, _("Internal key functions:\n"));
|
||||
weechat_iconv_fprintf (stdout, "\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));
|
||||
weechat_iconv_fprintf (stdout,
|
||||
"* %s: %s\n",
|
||||
gui_key_functions[i].function_name,
|
||||
_(gui_key_functions[i].description));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -283,14 +290,16 @@ weechat_display_keys ()
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name;
|
||||
|
||||
printf (_("%s default keys:\n"), PACKAGE_NAME);
|
||||
printf ("\n");
|
||||
weechat_iconv_fprintf (stdout,
|
||||
_("%s default keys:\n"), PACKAGE_NAME);
|
||||
weechat_iconv_fprintf (stdout, "\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
|
||||
printf ("* %s => %s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
(ptr_key->function) ? gui_keyboard_function_search_by_ptr (ptr_key->function) : ptr_key->command);
|
||||
weechat_iconv_fprintf (stdout,
|
||||
"* %s => %s\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
(ptr_key->function) ? gui_keyboard_function_search_by_ptr (ptr_key->function) : ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
@@ -331,9 +340,9 @@ weechat_parse_args (int argc, char *argv[])
|
||||
weechat_home = strdup (argv[++i]);
|
||||
else
|
||||
{
|
||||
fprintf (stderr,
|
||||
_("%s missing argument for --dir option\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_iconv_fprintf (stderr,
|
||||
_("%s missing argument for --dir option\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
}
|
||||
@@ -364,7 +373,7 @@ weechat_parse_args (int argc, char *argv[])
|
||||
else if ((strcmp (argv[i], "-l") == 0)
|
||||
|| (strcmp (argv[i], "--license") == 0))
|
||||
{
|
||||
printf ("\n%s%s", WEE_LICENSE);
|
||||
weechat_iconv_fprintf (stdout, "\n%s%s", WEE_LICENSE);
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-p") == 0)
|
||||
@@ -376,16 +385,16 @@ weechat_parse_args (int argc, char *argv[])
|
||||
weechat_session = strdup (argv[++i]);
|
||||
else
|
||||
{
|
||||
fprintf (stderr,
|
||||
_("%s missing argument for --session option\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_iconv_fprintf (stderr,
|
||||
_("%s missing argument for --session option\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
}
|
||||
else if ((strcmp (argv[i], "-v") == 0)
|
||||
|| (strcmp (argv[i], "--version") == 0))
|
||||
{
|
||||
printf (PACKAGE_VERSION "\n");
|
||||
weechat_iconv_fprintf (stdout, PACKAGE_VERSION "\n");
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-w") == 0)
|
||||
@@ -398,8 +407,9 @@ weechat_parse_args (int argc, char *argv[])
|
||||
{
|
||||
if (server_init_with_url (argv[i], &server_tmp) < 0)
|
||||
{
|
||||
fprintf (stderr, _("%s invalid syntax for IRC server ('%s'), ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
weechat_iconv_fprintf (stderr,
|
||||
_("%s invalid syntax for IRC server ('%s'), ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -411,19 +421,19 @@ weechat_parse_args (int argc, char *argv[])
|
||||
server_tmp.password, server_tmp.nick1,
|
||||
server_tmp.nick2, server_tmp.nick3,
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
server_tmp.autojoin, 1, NULL, NULL,
|
||||
NULL, NULL))
|
||||
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
server_tmp.autojoin, 1, NULL))
|
||||
weechat_iconv_fprintf (stderr,
|
||||
_("%s unable to create server ('%s'), ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
server_destroy (&server_tmp);
|
||||
server_cmd_line = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr,
|
||||
_("%s unknown parameter '%s', ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
weechat_iconv_fprintf (stderr,
|
||||
_("%s unknown parameter '%s', ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -442,8 +452,8 @@ weechat_create_dir (char *directory)
|
||||
/* exit if error (except if directory already exists) */
|
||||
if (errno != EEXIST)
|
||||
{
|
||||
fprintf (stderr, _("%s cannot create directory \"%s\"\n"),
|
||||
WEECHAT_ERROR, directory);
|
||||
weechat_iconv_fprintf (stderr, _("%s cannot create directory \"%s\"\n"),
|
||||
WEECHAT_ERROR, directory);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -466,8 +476,8 @@ weechat_create_home_dirs ()
|
||||
ptr_home = getenv ("HOME");
|
||||
if (!ptr_home)
|
||||
{
|
||||
fprintf (stderr, _("%s unable to get HOME directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_iconv_fprintf (stderr, _("%s unable to get HOME directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
dir_length = strlen (ptr_home) + 10;
|
||||
@@ -475,8 +485,8 @@ weechat_create_home_dirs ()
|
||||
(char *) malloc (dir_length * sizeof (char));
|
||||
if (!weechat_home)
|
||||
{
|
||||
fprintf (stderr, _("%s not enough memory for home directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_iconv_fprintf (stderr, _("%s not enough memory for home directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
@@ -488,8 +498,8 @@ weechat_create_home_dirs ()
|
||||
{
|
||||
if (!S_ISDIR (statinfo.st_mode))
|
||||
{
|
||||
fprintf (stderr, _("%s home (%s) is not a directory\n"),
|
||||
WEECHAT_ERROR, weechat_home);
|
||||
weechat_iconv_fprintf (stderr, _("%s home (%s) is not a directory\n"),
|
||||
WEECHAT_ERROR, weechat_home);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
}
|
||||
@@ -497,8 +507,8 @@ weechat_create_home_dirs ()
|
||||
/* create home directory; error is fatal */
|
||||
if (!weechat_create_dir (weechat_home))
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
|
||||
WEECHAT_ERROR, weechat_home);
|
||||
weechat_iconv_fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
|
||||
WEECHAT_ERROR, weechat_home);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
}
|
||||
@@ -521,8 +531,8 @@ weechat_create_config_dirs ()
|
||||
chmod (dir2, 0700);
|
||||
}
|
||||
else
|
||||
fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
|
||||
WEECHAT_WARNING, dir2);
|
||||
weechat_iconv_fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
|
||||
WEECHAT_WARNING, dir2);
|
||||
if (dir1)
|
||||
free (dir1);
|
||||
if (dir2)
|
||||
@@ -537,8 +547,8 @@ weechat_create_config_dirs ()
|
||||
chmod (dir2, 0700);
|
||||
}
|
||||
else
|
||||
fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
|
||||
WEECHAT_WARNING, dir2);
|
||||
weechat_iconv_fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
|
||||
WEECHAT_WARNING, dir2);
|
||||
if (dir1)
|
||||
free (dir1);
|
||||
if (dir2)
|
||||
@@ -774,19 +784,20 @@ weechat_sigsegv ()
|
||||
server_free_all ();
|
||||
gui_main_end ();
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
fprintf (stderr, "*** Very bad! WeeChat is crashing (SIGSEGV received)\n");
|
||||
weechat_iconv_fprintf (stderr, "\n");
|
||||
weechat_iconv_fprintf (stderr, "*** Very bad! WeeChat is crashing (SIGSEGV received)\n");
|
||||
if (!weechat_log_crash_rename ())
|
||||
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file.\n",
|
||||
weechat_home);
|
||||
fprintf (stderr, "***\n");
|
||||
fprintf (stderr, "*** Please help WeeChat developers to fix this bug:\n");
|
||||
fprintf (stderr, "*** 1. If you have a core file, please run: gdb weechat-curses core\n");
|
||||
fprintf (stderr, "*** then issue \"bt\" command and send result to developers\n");
|
||||
fprintf (stderr, "*** To enable core files with bash shell: ulimit -c 10000\n");
|
||||
fprintf (stderr, "*** 2. Otherwise send backtrace (below) and weechat.log\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");
|
||||
weechat_iconv_fprintf (stderr,
|
||||
"*** Full crash dump was saved to %s/weechat.log file.\n",
|
||||
weechat_home);
|
||||
weechat_iconv_fprintf (stderr, "***\n");
|
||||
weechat_iconv_fprintf (stderr, "*** Please help WeeChat developers to fix this bug:\n");
|
||||
weechat_iconv_fprintf (stderr, "*** 1. If you have a core file, please run: gdb weechat-curses core\n");
|
||||
weechat_iconv_fprintf (stderr, "*** then issue \"bt\" command and send result to developers\n");
|
||||
weechat_iconv_fprintf (stderr, "*** To enable core files with bash shell: ulimit -c 10000\n");
|
||||
weechat_iconv_fprintf (stderr, "*** 2. Otherwise send backtrace (below) and weechat.log\n");
|
||||
weechat_iconv_fprintf (stderr, "*** (be careful, private info may be in this file since\n");
|
||||
weechat_iconv_fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
|
||||
|
||||
weechat_backtrace ();
|
||||
|
||||
@@ -804,12 +815,16 @@ main (int argc, char *argv[])
|
||||
#ifdef ENABLE_NLS
|
||||
setlocale (LC_ALL, ""); /* initialize gettext */
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
bind_textdomain_codeset (PACKAGE, "UTF-8");
|
||||
textdomain (PACKAGE);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LANGINFO_CODESET
|
||||
local_charset = strdup (nl_langinfo (CODESET));
|
||||
#else
|
||||
local_charset = strdup ("");
|
||||
#endif
|
||||
utf8_init ();
|
||||
|
||||
signal (SIGINT, SIG_IGN); /* ignore SIGINT signal */
|
||||
signal (SIGQUIT, SIG_IGN); /* ignore SIGQUIT signal */
|
||||
@@ -824,7 +839,6 @@ main (int argc, char *argv[])
|
||||
command_index_build (); /* build cmd index for completion */
|
||||
weechat_config_read (); /* read configuration */
|
||||
weechat_create_config_dirs (); /* create config directories */
|
||||
utf8_init (); /* init UTF-8 in WeeChat */
|
||||
gui_main_init (); /* init WeeChat interface */
|
||||
fifo_create (); /* FIFO pipe for remote control */
|
||||
if (weechat_session)
|
||||
|
||||
+13
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -52,7 +52,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define WEECHAT_COPYRIGHT_DATE "(c) 2003-2006"
|
||||
#define WEECHAT_COPYRIGHT_DATE "(c) 2003-2007"
|
||||
#define WEECHAT_WEBSITE "http://weechat.flashtux.org"
|
||||
|
||||
#define WEECHAT_ERROR _("WeeChat Error:")
|
||||
@@ -65,7 +65,7 @@
|
||||
/* license */
|
||||
|
||||
#define WEE_LICENSE \
|
||||
PACKAGE_STRING " (c) Copyright 2003-2006, compiled on " __DATE__ " " __TIME__ \
|
||||
PACKAGE_STRING " (c) Copyright 2003-2007, compiled on " __DATE__ " " __TIME__ \
|
||||
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
|
||||
"This program is free software; you can redistribute it and/or modify\n" \
|
||||
"it under the terms of the GNU General Public License as published by\n" \
|
||||
@@ -92,6 +92,16 @@
|
||||
#define DIR_SEPARATOR_CHAR '/'
|
||||
#endif
|
||||
|
||||
/* some systems (like GNU/Hurd) doesn't define PATH_MAX */
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
/* internal charset */
|
||||
|
||||
#define WEECHAT_INTERNAL_CHARSET "UTF-8"
|
||||
|
||||
/* global variables and functions */
|
||||
|
||||
extern char *weechat_argv0;
|
||||
|
||||
+267
-266
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -71,10 +71,6 @@ int cfg_look_set_title;
|
||||
int cfg_look_startup_logo;
|
||||
int cfg_look_startup_version;
|
||||
char *cfg_look_weechat_slogan;
|
||||
char *cfg_look_charset_decode_iso;
|
||||
char *cfg_look_charset_decode_utf;
|
||||
char *cfg_look_charset_encode;
|
||||
char *cfg_look_charset_internal;
|
||||
int cfg_look_one_server_buffer;
|
||||
int cfg_look_scroll_amount;
|
||||
int cfg_look_open_near_server;
|
||||
@@ -87,6 +83,7 @@ char *cfg_look_nicklist_position_values[] =
|
||||
{ "left", "right", "top", "bottom", NULL };
|
||||
int cfg_look_nicklist_min_size;
|
||||
int cfg_look_nicklist_max_size;
|
||||
int cfg_look_nicklist_separator;
|
||||
int cfg_look_nickmode;
|
||||
int cfg_look_nickmode_empty;
|
||||
char *cfg_look_no_nickname;
|
||||
@@ -134,24 +131,6 @@ t_config_option weechat_options_look[] =
|
||||
N_("WeeChat slogan (if empty, slogan is not used)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"the geekest IRC client!", NULL, NULL, &cfg_look_weechat_slogan, config_change_noop },
|
||||
{ "look_charset_decode_iso", N_("ISO charset for decoding messages from server (used only if locale is UTF-8)"),
|
||||
N_("ISO charset for decoding messages from server (used only if locale is UTF-8) "
|
||||
"(if empty, messages are not converted if locale is UTF-8)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"ISO-8859-1", NULL, NULL, &cfg_look_charset_decode_iso, config_change_charset },
|
||||
{ "look_charset_decode_utf", N_("UTF charset for decoding messages from server (used only if locale is not UTF-8)"),
|
||||
N_("UTF charset for decoding messages from server (used only if locale is not UTF-8) "
|
||||
"(if empty, messages are not converted if locale is not UTF-8)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"UTF-8", NULL, NULL, &cfg_look_charset_decode_utf, config_change_charset },
|
||||
{ "look_charset_encode", N_("charset for encoding messages sent to server"),
|
||||
N_("charset for encoding messages sent to server, examples: UTF-8, ISO-8859-1 (if empty, messages are not converted)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_look_charset_encode, config_change_charset },
|
||||
{ "look_charset_internal", N_("forces internal WeeChat charset (should be empty in most cases)"),
|
||||
N_("forces internal WeeChat charset (should be empty in most cases, that means detected charset is used)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_look_charset_internal, config_change_charset },
|
||||
{ "look_one_server_buffer", N_("use same buffer for all servers"),
|
||||
N_("use same buffer for all servers"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
@@ -194,6 +173,10 @@ t_config_option weechat_options_look[] =
|
||||
"(0 = no max size; if min == max and > 0, then size is fixed))"),
|
||||
OPTION_TYPE_INT, 0, 100, 0,
|
||||
NULL, NULL, &cfg_look_nicklist_max_size, NULL, config_change_buffers },
|
||||
{ "look_nicklist_separator", N_("separator between chat and nicklist"),
|
||||
N_("separator between chat and nicklist"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_nicklist_separator, NULL, config_change_buffers },
|
||||
{ "look_no_nickname", N_("text to display instead of nick when not connected"),
|
||||
N_("text to display instead of nick when not connected"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
@@ -298,6 +281,7 @@ t_config_option weechat_options_look[] =
|
||||
int cfg_col_real_white;
|
||||
int cfg_col_separator;
|
||||
int cfg_col_title;
|
||||
int cfg_col_title_more;
|
||||
int cfg_col_title_bg;
|
||||
int cfg_col_chat;
|
||||
int cfg_col_chat_time;
|
||||
@@ -347,6 +331,7 @@ int cfg_col_nick_self;
|
||||
int cfg_col_nick_colors[COLOR_WIN_NICK_NUMBER];
|
||||
int cfg_col_nick_private;
|
||||
int cfg_col_nick_bg;
|
||||
int cfg_col_nicklist_bg;
|
||||
int cfg_col_dcc_selected;
|
||||
int cfg_col_dcc_waiting;
|
||||
int cfg_col_dcc_connecting;
|
||||
@@ -372,6 +357,10 @@ t_config_option weechat_options_colors[] =
|
||||
N_("color for title bar"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"default", NULL, &cfg_col_title, NULL, &config_change_color },
|
||||
{ "col_title_more", N_("color for '+' when scrolling topic"),
|
||||
N_("color for '+' when scrolling topic"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"lightmagenta", NULL, &cfg_col_title_more, NULL, &config_change_color },
|
||||
{ "col_title_bg", N_("background for title bar"),
|
||||
N_("background for title bar"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
@@ -728,10 +717,12 @@ int cfg_irc_away_check_max_nicks;
|
||||
int cfg_irc_lag_check;
|
||||
int cfg_irc_lag_min_show;
|
||||
int cfg_irc_lag_disconnect;
|
||||
int cfg_irc_anti_flood;
|
||||
int cfg_irc_fifo_pipe;
|
||||
char *cfg_irc_highlight;
|
||||
int cfg_irc_colors_receive;
|
||||
int cfg_irc_colors_send;
|
||||
int cfg_irc_send_unknown_commands;
|
||||
|
||||
t_config_option weechat_options_irc[] =
|
||||
{ { "irc_display_away", N_("display message for away"),
|
||||
@@ -775,6 +766,10 @@ t_config_option weechat_options_irc[] =
|
||||
N_("disconnect after important lag (in minutes, 0 = never disconnect)"),
|
||||
OPTION_TYPE_INT, 0, INT_MAX, 5,
|
||||
NULL, NULL, &cfg_irc_lag_disconnect, NULL, &config_change_noop },
|
||||
{ "irc_anti_flood", N_("anti-flood"),
|
||||
N_("anti-flood: # seconds between two user messages (0 = no anti-flood)"),
|
||||
OPTION_TYPE_INT, 0, 5, 2,
|
||||
NULL, NULL, &cfg_irc_anti_flood, NULL, &config_change_noop },
|
||||
{ "irc_fifo_pipe", N_("create a FIFO pipe for remote control"),
|
||||
N_("create a FIFO pipe for remote control"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
@@ -794,6 +789,10 @@ t_config_option weechat_options_irc[] =
|
||||
"%U=underline, %R=reverse)"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_irc_colors_send, NULL, config_change_noop },
|
||||
{ "irc_send_unknown_commands", N_("send unknown commands to IRC server"),
|
||||
N_("send unknown commands to IRC server"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &cfg_irc_send_unknown_commands, NULL, &config_change_noop },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -1031,21 +1030,6 @@ t_config_option weechat_options_server[] =
|
||||
"default notify level"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.notify_levels), config_change_notify_levels },
|
||||
{ "server_charset_decode_iso", N_("charset for decoding ISO on server and channels"),
|
||||
N_("comma separated list of charsets for server and channels, "
|
||||
"to decode ISO (format: server:charset,#channel:charset,..)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.charset_decode_iso), config_change_noop },
|
||||
{ "server_charset_decode_utf", N_("charset for decoding UTF on server and channels"),
|
||||
N_("comma separated list of charsets for server and channels, "
|
||||
"to decode UTF (format: server:charset,#channel:charset,..)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.charset_decode_utf), config_change_noop },
|
||||
{ "server_charset_encode", N_("charset for encoding messages on server and channels"),
|
||||
N_("comma separated list of charsets for server and channels, "
|
||||
"to encode messages (format: server:charset,#channel:charset,..)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.charset_encode), config_change_noop },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -1153,8 +1137,7 @@ config_change_title ()
|
||||
void
|
||||
config_change_buffers ()
|
||||
{
|
||||
gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
|
||||
gui_window_redraw_buffer (gui_current_window->buffer);
|
||||
gui_window_refresh_windows ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1180,17 +1163,6 @@ config_change_read_marker ()
|
||||
gui_window_redraw_buffer (ptr_win->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* config_change_charset: called when charset changes
|
||||
*/
|
||||
|
||||
void
|
||||
config_change_charset ()
|
||||
{
|
||||
utf8_init ();
|
||||
gui_window_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* config_change_one_server_buffer: called when the "one server buffer"
|
||||
* setting is changed
|
||||
@@ -1334,6 +1306,34 @@ config_change_log ()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* config_option_get_boolean_value: get boolean value with user text
|
||||
* return: BOOL_FALSE or BOOL_TRUE
|
||||
*/
|
||||
|
||||
int
|
||||
config_option_get_boolean_value (char *text)
|
||||
{
|
||||
if ((ascii_strcasecmp (text, "on") == 0)
|
||||
|| (ascii_strcasecmp (text, "yes") == 0)
|
||||
|| (ascii_strcasecmp (text, "y") == 0)
|
||||
|| (ascii_strcasecmp (text, "true") == 0)
|
||||
|| (ascii_strcasecmp (text, "t") == 0)
|
||||
|| (ascii_strcasecmp (text, "1") == 0))
|
||||
return BOOL_TRUE;
|
||||
|
||||
if ((ascii_strcasecmp (text, "off") == 0)
|
||||
|| (ascii_strcasecmp (text, "no") == 0)
|
||||
|| (ascii_strcasecmp (text, "n") == 0)
|
||||
|| (ascii_strcasecmp (text, "false") == 0)
|
||||
|| (ascii_strcasecmp (text, "f") == 0)
|
||||
|| (ascii_strcasecmp (text, "0") == 0))
|
||||
return BOOL_FALSE;
|
||||
|
||||
/* invalid text */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* config_option_set_value: set new value for an option
|
||||
* return: 0 if success
|
||||
@@ -1348,14 +1348,18 @@ config_option_set_value (t_config_option *option, char *value)
|
||||
switch (option->option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if ((ascii_strcasecmp (value, "on") == 0)
|
||||
|| (ascii_strcasecmp (value, "yes") == 0))
|
||||
*(option->ptr_int) = BOOL_TRUE;
|
||||
else if ((ascii_strcasecmp (value, "off") == 0)
|
||||
|| (ascii_strcasecmp (value, "no") == 0))
|
||||
*(option->ptr_int) = BOOL_FALSE;
|
||||
else
|
||||
return -1;
|
||||
int_value = config_option_get_boolean_value (value);
|
||||
switch (int_value)
|
||||
{
|
||||
case BOOL_TRUE:
|
||||
*(option->ptr_int) = BOOL_TRUE;
|
||||
break;
|
||||
case BOOL_FALSE:
|
||||
*(option->ptr_int) = BOOL_FALSE;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
int_value = atoi (value);
|
||||
@@ -1540,12 +1544,6 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
|
||||
return (void *)(&server->autorejoin);
|
||||
if (ascii_strcasecmp (option_name, "server_notify_levels") == 0)
|
||||
return (void *)(&server->notify_levels);
|
||||
if (ascii_strcasecmp (option_name, "server_charset_decode_iso") == 0)
|
||||
return (void *)(&server->charset_decode_iso);
|
||||
if (ascii_strcasecmp (option_name, "server_charset_decode_utf") == 0)
|
||||
return (void *)(&server->charset_decode_utf);
|
||||
if (ascii_strcasecmp (option_name, "server_charset_encode") == 0)
|
||||
return (void *)(&server->charset_encode);
|
||||
/* option not found */
|
||||
return NULL;
|
||||
}
|
||||
@@ -1586,12 +1584,18 @@ config_set_server_value (t_irc_server *server, char *option_name,
|
||||
switch (ptr_option->option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if (ascii_strcasecmp (value, "on") == 0)
|
||||
*((int *)(ptr_data)) = BOOL_TRUE;
|
||||
else if (ascii_strcasecmp (value, "off") == 0)
|
||||
*((int *)(ptr_data)) = BOOL_FALSE;
|
||||
else
|
||||
return -2;
|
||||
int_value = config_option_get_boolean_value (value);
|
||||
switch (int_value)
|
||||
{
|
||||
case BOOL_TRUE:
|
||||
*((int *)(ptr_data)) = BOOL_TRUE;
|
||||
break;
|
||||
case BOOL_FALSE:
|
||||
*((int *)(ptr_data)) = BOOL_FALSE;
|
||||
break;
|
||||
default:
|
||||
return -2;
|
||||
}
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
int_value = atoi (value);
|
||||
@@ -1772,9 +1776,7 @@ config_allocate_server (char *filename, int line_number)
|
||||
cfg_server.nick3, cfg_server.username, cfg_server.realname,
|
||||
cfg_server.hostname, cfg_server.command,
|
||||
cfg_server.command_delay, cfg_server.autojoin,
|
||||
cfg_server.autorejoin, cfg_server.notify_levels,
|
||||
cfg_server.charset_decode_iso, cfg_server.charset_decode_utf,
|
||||
cfg_server.charset_encode))
|
||||
cfg_server.autorejoin, cfg_server.notify_levels))
|
||||
{
|
||||
server_free_all ();
|
||||
gui_printf (NULL,
|
||||
@@ -1857,7 +1859,7 @@ config_read ()
|
||||
FILE *file;
|
||||
int section, line_number, i, option_number;
|
||||
int server_found;
|
||||
char line[1024], *ptr_line, *pos, *pos2;
|
||||
char line[1024], *ptr_line, *ptr_line2, *pos, *pos2;
|
||||
|
||||
filename_length = strlen (weechat_home) + strlen (WEECHAT_CONFIG_NAME) + 2;
|
||||
filename = (char *) malloc (filename_length * sizeof (char));
|
||||
@@ -1865,7 +1867,7 @@ config_read ()
|
||||
return -2;
|
||||
snprintf (filename, filename_length, "%s%s" WEECHAT_CONFIG_NAME,
|
||||
weechat_home, DIR_SEPARATOR);
|
||||
if ((file = fopen (filename, "rt")) == NULL)
|
||||
if ((file = fopen (filename, "r")) == NULL)
|
||||
{
|
||||
gui_printf (NULL, _("%s config file \"%s\" not found.\n"),
|
||||
WEECHAT_WARNING, filename);
|
||||
@@ -1886,6 +1888,14 @@ config_read ()
|
||||
line_number++;
|
||||
if (ptr_line)
|
||||
{
|
||||
/* encode line to internal charset */
|
||||
ptr_line2 = weechat_iconv_to_internal (NULL, ptr_line);
|
||||
if (ptr_line2)
|
||||
{
|
||||
snprintf (line, sizeof (line) - 1, "%s", ptr_line2);
|
||||
free (ptr_line2);
|
||||
}
|
||||
|
||||
/* skip spaces */
|
||||
while (ptr_line[0] == ' ')
|
||||
ptr_line++;
|
||||
@@ -2053,19 +2063,19 @@ config_read ()
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for "
|
||||
"option '%s'\n"
|
||||
"Expected: boolean value: "
|
||||
"'off' or 'on'\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line);
|
||||
_("%s %s, line %d: invalid value for "
|
||||
"option '%s'\n"
|
||||
"Expected: boolean value: "
|
||||
"'off' or 'on'\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line);
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for "
|
||||
"option '%s'\n"
|
||||
"Expected: integer between %d "
|
||||
"and %d\n"),
|
||||
"option '%s'\n"
|
||||
"Expected: integer between %d "
|
||||
"and %d\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line,
|
||||
weechat_options[section][option_number].min,
|
||||
@@ -2074,15 +2084,15 @@ config_read ()
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid value for "
|
||||
"option '%s'\n"
|
||||
"Expected: one of these strings: "),
|
||||
"option '%s'\n"
|
||||
"Expected: one of these strings: "),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number, ptr_line);
|
||||
i = 0;
|
||||
while (weechat_options[section][option_number].array_values[i])
|
||||
{
|
||||
gui_printf (NULL, "\"%s\" ",
|
||||
weechat_options[section][option_number].array_values[i]);
|
||||
weechat_options[section][option_number].array_values[i]);
|
||||
i++;
|
||||
}
|
||||
gui_printf (NULL, "\n");
|
||||
@@ -2090,7 +2100,7 @@ config_read ()
|
||||
case OPTION_TYPE_COLOR:
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid color "
|
||||
"name for option '%s'\n"),
|
||||
"name for option '%s'\n"),
|
||||
WEECHAT_WARNING, filename,
|
||||
line_number,
|
||||
ptr_line);
|
||||
@@ -2150,7 +2160,7 @@ config_create_default ()
|
||||
return -2;
|
||||
snprintf (filename, filename_length, "%s%s" WEECHAT_CONFIG_NAME,
|
||||
weechat_home, DIR_SEPARATOR);
|
||||
if ((file = fopen (filename, "wt")) == NULL)
|
||||
if ((file = fopen (filename, "w")) == NULL)
|
||||
{
|
||||
gui_printf (NULL, _("%s cannot create file \"%s\"\n"),
|
||||
WEECHAT_ERROR, filename);
|
||||
@@ -2158,48 +2168,48 @@ config_create_default ()
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf (_("%s: creating default config file...\n"), PACKAGE_NAME);
|
||||
weechat_iconv_fprintf (stdout, _("%s: creating default config file...\n"), PACKAGE_NAME);
|
||||
weechat_log_printf (_("Creating default config file\n"));
|
||||
|
||||
current_time = time (NULL);
|
||||
fprintf (file, _("#\n# %s configuration file, created by "
|
||||
"%s v%s on %s"),
|
||||
PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION,
|
||||
ctime (¤t_time));
|
||||
fprintf (file, _("# WARNING! Be careful when editing this file, "
|
||||
"WeeChat writes this file when exiting.\n#\n"));
|
||||
|
||||
weechat_iconv_fprintf (file, _("#\n# %s configuration file, created by "
|
||||
"%s v%s on %s"),
|
||||
PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION,
|
||||
ctime (¤t_time));
|
||||
weechat_iconv_fprintf (file, _("# WARNING! Be careful when editing this file, "
|
||||
"WeeChat writes this file when exiting.\n#\n"));
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
|
||||
weechat_iconv_fprintf (file, "\n[%s]\n", config_sections[i].section_name);
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].default_int) ?
|
||||
"on" : "off");
|
||||
weechat_iconv_fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].default_int) ?
|
||||
"on" : "off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
fprintf (file, "%s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].default_int);
|
||||
weechat_iconv_fprintf (file, "%s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].default_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
case OPTION_TYPE_COLOR:
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].default_string);
|
||||
weechat_iconv_fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].default_string);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].default_string);
|
||||
weechat_iconv_fprintf (file, "%s = \"%s\"\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].default_string);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2207,7 +2217,7 @@ config_create_default ()
|
||||
}
|
||||
|
||||
/* default key bindings */
|
||||
fprintf (file, "\n[keys]\n");
|
||||
weechat_iconv_fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
|
||||
@@ -2215,79 +2225,79 @@ config_create_default ()
|
||||
{
|
||||
function_name = gui_keyboard_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
weechat_iconv_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);
|
||||
weechat_iconv_fprintf (file, "%s = \"%s\"\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
ptr_key->command);
|
||||
if (expanded_name)
|
||||
free (expanded_name);
|
||||
}
|
||||
|
||||
/* default aliases */
|
||||
fprintf (file, "\n[alias]\n");
|
||||
fprintf (file, "SAY = \"msg *\"\n");
|
||||
fprintf (file, "BYE = \"quit\"\n");
|
||||
fprintf (file, "EXIT = \"quit\"\n");
|
||||
fprintf (file, "SIGNOFF = \"quit\"\n");
|
||||
fprintf (file, "C = \"clear\"\n");
|
||||
fprintf (file, "CL = \"clear\"\n");
|
||||
fprintf (file, "CLOSE = \"buffer close\"\n");
|
||||
fprintf (file, "CHAT = \"dcc chat\"\n");
|
||||
fprintf (file, "IG = \"ignore\"\n");
|
||||
fprintf (file, "J = \"join\"\n");
|
||||
fprintf (file, "K = \"kick\"\n");
|
||||
fprintf (file, "KB = \"kickban\"\n");
|
||||
fprintf (file, "LEAVE = \"part\"\n");
|
||||
fprintf (file, "M = \"msg\"\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, "UNIG = \"unignore\"\n");
|
||||
fprintf (file, "W = \"who\"\n");
|
||||
fprintf (file, "WC = \"window merge\"\n");
|
||||
fprintf (file, "WI = \"whois\"\n");
|
||||
fprintf (file, "WW = \"whowas\"\n");
|
||||
weechat_iconv_fprintf (file, "\n[alias]\n");
|
||||
weechat_iconv_fprintf (file, "SAY = \"msg *\"\n");
|
||||
weechat_iconv_fprintf (file, "BYE = \"quit\"\n");
|
||||
weechat_iconv_fprintf (file, "EXIT = \"quit\"\n");
|
||||
weechat_iconv_fprintf (file, "SIGNOFF = \"quit\"\n");
|
||||
weechat_iconv_fprintf (file, "C = \"clear\"\n");
|
||||
weechat_iconv_fprintf (file, "CL = \"clear\"\n");
|
||||
weechat_iconv_fprintf (file, "CLOSE = \"buffer close\"\n");
|
||||
weechat_iconv_fprintf (file, "CHAT = \"dcc chat\"\n");
|
||||
weechat_iconv_fprintf (file, "IG = \"ignore\"\n");
|
||||
weechat_iconv_fprintf (file, "J = \"join\"\n");
|
||||
weechat_iconv_fprintf (file, "K = \"kick\"\n");
|
||||
weechat_iconv_fprintf (file, "KB = \"kickban\"\n");
|
||||
weechat_iconv_fprintf (file, "LEAVE = \"part\"\n");
|
||||
weechat_iconv_fprintf (file, "M = \"msg\"\n");
|
||||
weechat_iconv_fprintf (file, "MUB = \"unban *\"\n");
|
||||
weechat_iconv_fprintf (file, "N = \"names\"\n");
|
||||
weechat_iconv_fprintf (file, "Q = \"query\"\n");
|
||||
weechat_iconv_fprintf (file, "T = \"topic\"\n");
|
||||
weechat_iconv_fprintf (file, "UB = \"unban\"\n");
|
||||
weechat_iconv_fprintf (file, "UNIG = \"unignore\"\n");
|
||||
weechat_iconv_fprintf (file, "W = \"who\"\n");
|
||||
weechat_iconv_fprintf (file, "WC = \"window merge\"\n");
|
||||
weechat_iconv_fprintf (file, "WI = \"whois\"\n");
|
||||
weechat_iconv_fprintf (file, "WW = \"whowas\"\n");
|
||||
|
||||
/* no ignore by default */
|
||||
|
||||
/* default server is freenode */
|
||||
fprintf (file, "\n[server]\n");
|
||||
fprintf (file, "server_name = \"freenode\"\n");
|
||||
fprintf (file, "server_autoconnect = on\n");
|
||||
fprintf (file, "server_autoreconnect = on\n");
|
||||
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");
|
||||
weechat_iconv_fprintf (file, "\n[server]\n");
|
||||
weechat_iconv_fprintf (file, "server_name = \"freenode\"\n");
|
||||
weechat_iconv_fprintf (file, "server_autoconnect = on\n");
|
||||
weechat_iconv_fprintf (file, "server_autoreconnect = on\n");
|
||||
weechat_iconv_fprintf (file, "server_autoreconnect_delay = 30\n");
|
||||
weechat_iconv_fprintf (file, "server_address = \"irc.freenode.net\"\n");
|
||||
weechat_iconv_fprintf (file, "server_port = 6667\n");
|
||||
weechat_iconv_fprintf (file, "server_ipv6 = off\n");
|
||||
weechat_iconv_fprintf (file, "server_ssl = off\n");
|
||||
weechat_iconv_fprintf (file, "server_password = \"\"\n");
|
||||
|
||||
/* Get the user's name from /etc/passwd */
|
||||
if ((my_passwd = getpwuid (geteuid ())) != NULL)
|
||||
{
|
||||
fprintf (file, "server_nick1 = \"%s\"\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_nick2 = \"%s1\"\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_nick3 = \"%s2\"\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_username = \"%s\"\n", my_passwd->pw_name);
|
||||
weechat_iconv_fprintf (file, "server_nick1 = \"%s\"\n", my_passwd->pw_name);
|
||||
weechat_iconv_fprintf (file, "server_nick2 = \"%s1\"\n", my_passwd->pw_name);
|
||||
weechat_iconv_fprintf (file, "server_nick3 = \"%s2\"\n", my_passwd->pw_name);
|
||||
weechat_iconv_fprintf (file, "server_username = \"%s\"\n", my_passwd->pw_name);
|
||||
if ((!my_passwd->pw_gecos)
|
||||
|| (my_passwd->pw_gecos[0] == '\0')
|
||||
|| (my_passwd->pw_gecos[0] == ',')
|
||||
|| (my_passwd->pw_gecos[0] == ' '))
|
||||
fprintf (file, "server_realname = \"%s\"\n", my_passwd->pw_name);
|
||||
weechat_iconv_fprintf (file, "server_realname = \"%s\"\n", my_passwd->pw_name);
|
||||
else
|
||||
{
|
||||
realname = strdup (my_passwd->pw_gecos);
|
||||
pos = strchr (realname, ',');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
fprintf (file, "server_realname = \"%s\"\n",
|
||||
realname);
|
||||
weechat_iconv_fprintf (file, "server_realname = \"%s\"\n",
|
||||
realname);
|
||||
if (pos)
|
||||
pos[0] = ',';
|
||||
free (realname);
|
||||
@@ -2296,26 +2306,23 @@ config_create_default ()
|
||||
else
|
||||
{
|
||||
/* default values if /etc/passwd can't be read */
|
||||
fprintf (stderr, "%s: %s (%s).",
|
||||
WEECHAT_WARNING,
|
||||
_("Unable to get user's name"),
|
||||
strerror (errno));
|
||||
fprintf (file, "server_nick1 = \"weechat1\"\n");
|
||||
fprintf (file, "server_nick2 = \"weechat2\"\n");
|
||||
fprintf (file, "server_nick3 = \"weechat3\"\n");
|
||||
fprintf (file, "server_username = \"weechat\"\n");
|
||||
fprintf (file, "server_realname = \"WeeChat default realname\"\n");
|
||||
weechat_iconv_fprintf (stderr, "%s: %s (%s).",
|
||||
WEECHAT_WARNING,
|
||||
_("Unable to get user's name"),
|
||||
strerror (errno));
|
||||
weechat_iconv_fprintf (file, "server_nick1 = \"weechat1\"\n");
|
||||
weechat_iconv_fprintf (file, "server_nick2 = \"weechat2\"\n");
|
||||
weechat_iconv_fprintf (file, "server_nick3 = \"weechat3\"\n");
|
||||
weechat_iconv_fprintf (file, "server_username = \"weechat\"\n");
|
||||
weechat_iconv_fprintf (file, "server_realname = \"WeeChat default realname\"\n");
|
||||
}
|
||||
|
||||
fprintf (file, "server_hostname = \"\"\n");
|
||||
fprintf (file, "server_command = \"\"\n");
|
||||
fprintf (file, "server_command_delay = 0\n");
|
||||
fprintf (file, "server_autojoin = \"\"\n");
|
||||
fprintf (file, "server_autorejoin = on\n");
|
||||
fprintf (file, "server_notify_levels = \"\"\n");
|
||||
fprintf (file, "server_charset_decode_iso = \"\"\n");
|
||||
fprintf (file, "server_charset_decode_utf = \"\"\n");
|
||||
fprintf (file, "server_charset_encode = \"\"\n");
|
||||
weechat_iconv_fprintf (file, "server_hostname = \"\"\n");
|
||||
weechat_iconv_fprintf (file, "server_command = \"\"\n");
|
||||
weechat_iconv_fprintf (file, "server_command_delay = 0\n");
|
||||
weechat_iconv_fprintf (file, "server_autojoin = \"\"\n");
|
||||
weechat_iconv_fprintf (file, "server_autorejoin = on\n");
|
||||
weechat_iconv_fprintf (file, "server_notify_levels = \"\"\n");
|
||||
|
||||
fclose (file);
|
||||
chmod (filename, 0600);
|
||||
@@ -2357,7 +2364,7 @@ config_write (char *config_name)
|
||||
weechat_home, DIR_SEPARATOR);
|
||||
}
|
||||
|
||||
if ((file = fopen (filename, "wt")) == NULL)
|
||||
if ((file = fopen (filename, "w")) == NULL)
|
||||
{
|
||||
gui_printf (NULL, _("%s cannot create file \"%s\"\n"),
|
||||
WEECHAT_ERROR, filename);
|
||||
@@ -2368,57 +2375,57 @@ config_write (char *config_name)
|
||||
weechat_log_printf (_("Saving config to disk\n"));
|
||||
|
||||
current_time = time (NULL);
|
||||
fprintf (file, _("#\n# %s configuration file, created by "
|
||||
"%s v%s on %s"),
|
||||
PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION,
|
||||
ctime (¤t_time));
|
||||
fprintf (file, _("# WARNING! Be careful when editing this file, "
|
||||
"WeeChat writes this file when exiting.\n#\n"));
|
||||
weechat_iconv_fprintf (file, _("#\n# %s configuration file, created by "
|
||||
"%s v%s on %s"),
|
||||
PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION,
|
||||
ctime (¤t_time));
|
||||
weechat_iconv_fprintf (file, _("# WARNING! Be careful when editing this file, "
|
||||
"WeeChat writes this file when exiting.\n#\n"));
|
||||
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if ((i != CONFIG_SECTION_KEYS) && (i != CONFIG_SECTION_ALIAS)
|
||||
&& (i != CONFIG_SECTION_IGNORE) && (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
|
||||
weechat_iconv_fprintf (file, "\n[%s]\n", config_sections[i].section_name);
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int &&
|
||||
*weechat_options[i][j].ptr_int) ?
|
||||
"on" : "off");
|
||||
weechat_iconv_fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int &&
|
||||
*weechat_options[i][j].ptr_int) ?
|
||||
"on" : "off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
fprintf (file, "%s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
*weechat_options[i][j].ptr_int :
|
||||
weechat_options[i][j].default_int);
|
||||
weechat_iconv_fprintf (file, "%s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
*weechat_options[i][j].ptr_int :
|
||||
weechat_options[i][j].default_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int] :
|
||||
weechat_options[i][j].array_values[weechat_options[i][j].default_int]);
|
||||
weechat_iconv_fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int] :
|
||||
weechat_options[i][j].array_values[weechat_options[i][j].default_int]);
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
gui_color_get_name (*weechat_options[i][j].ptr_int) :
|
||||
weechat_options[i][j].default_string);
|
||||
weechat_iconv_fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
gui_color_get_name (*weechat_options[i][j].ptr_int) :
|
||||
weechat_options[i][j].default_string);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_string) ?
|
||||
*weechat_options[i][j].ptr_string :
|
||||
weechat_options[i][j].default_string);
|
||||
weechat_iconv_fprintf (file, "%s = \"%s\"\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_string) ?
|
||||
*weechat_options[i][j].ptr_string :
|
||||
weechat_options[i][j].default_string);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2426,7 +2433,7 @@ config_write (char *config_name)
|
||||
}
|
||||
|
||||
/* keys section */
|
||||
fprintf (file, "\n[keys]\n");
|
||||
weechat_iconv_fprintf (file, "\n[keys]\n");
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
|
||||
@@ -2434,37 +2441,37 @@ config_write (char *config_name)
|
||||
{
|
||||
function_name = gui_keyboard_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
weechat_iconv_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);
|
||||
weechat_iconv_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");
|
||||
weechat_iconv_fprintf (file, "\n[alias]\n");
|
||||
for (ptr_alias = weechat_alias; ptr_alias;
|
||||
ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
ptr_alias->alias_name, ptr_alias->alias_command);
|
||||
weechat_iconv_fprintf (file, "%s = \"%s\"\n",
|
||||
ptr_alias->alias_name, ptr_alias->alias_command);
|
||||
}
|
||||
|
||||
/* ignore section */
|
||||
fprintf (file, "\n[ignore]\n");
|
||||
weechat_iconv_fprintf (file, "\n[ignore]\n");
|
||||
for (ptr_ignore = irc_ignore; ptr_ignore;
|
||||
ptr_ignore = ptr_ignore->next_ignore)
|
||||
{
|
||||
fprintf (file, "ignore = \"%s,%s,%s,%s\"\n",
|
||||
ptr_ignore->mask,
|
||||
ptr_ignore->type,
|
||||
ptr_ignore->channel_name,
|
||||
ptr_ignore->server_name);
|
||||
weechat_iconv_fprintf (file, "ignore = \"%s,%s,%s,%s\"\n",
|
||||
ptr_ignore->mask,
|
||||
ptr_ignore->type,
|
||||
ptr_ignore->channel_name,
|
||||
ptr_ignore->server_name);
|
||||
}
|
||||
|
||||
/* server section */
|
||||
@@ -2473,44 +2480,38 @@ config_write (char *config_name)
|
||||
{
|
||||
if (!ptr_server->command_line)
|
||||
{
|
||||
fprintf (file, "\n[server]\n");
|
||||
fprintf (file, "server_name = \"%s\"\n", ptr_server->name);
|
||||
fprintf (file, "server_autoconnect = %s\n",
|
||||
(ptr_server->autoconnect) ? "on" : "off");
|
||||
fprintf (file, "server_autoreconnect = %s\n",
|
||||
(ptr_server->autoreconnect) ? "on" : "off");
|
||||
fprintf (file, "server_autoreconnect_delay = %d\n",
|
||||
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);
|
||||
fprintf (file, "server_nick2 = \"%s\"\n", ptr_server->nick2);
|
||||
fprintf (file, "server_nick3 = \"%s\"\n", ptr_server->nick3);
|
||||
fprintf (file, "server_username = \"%s\"\n", ptr_server->username);
|
||||
fprintf (file, "server_realname = \"%s\"\n", ptr_server->realname);
|
||||
fprintf (file, "server_hostname = \"%s\"\n",
|
||||
(ptr_server->hostname) ? ptr_server->hostname : "");
|
||||
fprintf (file, "server_command = \"%s\"\n",
|
||||
(ptr_server->command) ? ptr_server->command : "");
|
||||
fprintf (file, "server_command_delay = %d\n", ptr_server->command_delay);
|
||||
fprintf (file, "server_autojoin = \"%s\"\n",
|
||||
(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 : "");
|
||||
fprintf (file, "server_charset_decode_iso = \"%s\"\n",
|
||||
(ptr_server->charset_decode_iso) ? ptr_server->charset_decode_iso : "");
|
||||
fprintf (file, "server_charset_decode_utf = \"%s\"\n",
|
||||
(ptr_server->charset_decode_utf) ? ptr_server->charset_decode_utf : "");
|
||||
fprintf (file, "server_charset_encode = \"%s\"\n",
|
||||
(ptr_server->charset_encode) ? ptr_server->charset_encode : "");
|
||||
weechat_iconv_fprintf (file, "\n[server]\n");
|
||||
weechat_iconv_fprintf (file, "server_name = \"%s\"\n", ptr_server->name);
|
||||
weechat_iconv_fprintf (file, "server_autoconnect = %s\n",
|
||||
(ptr_server->autoconnect) ? "on" : "off");
|
||||
weechat_iconv_fprintf (file, "server_autoreconnect = %s\n",
|
||||
(ptr_server->autoreconnect) ? "on" : "off");
|
||||
weechat_iconv_fprintf (file, "server_autoreconnect_delay = %d\n",
|
||||
ptr_server->autoreconnect_delay);
|
||||
weechat_iconv_fprintf (file, "server_address = \"%s\"\n", ptr_server->address);
|
||||
weechat_iconv_fprintf (file, "server_port = %d\n", ptr_server->port);
|
||||
weechat_iconv_fprintf (file, "server_ipv6 = %s\n",
|
||||
(ptr_server->ipv6) ? "on" : "off");
|
||||
weechat_iconv_fprintf (file, "server_ssl = %s\n",
|
||||
(ptr_server->ssl) ? "on" : "off");
|
||||
weechat_iconv_fprintf (file, "server_password = \"%s\"\n",
|
||||
(ptr_server->password) ? ptr_server->password : "");
|
||||
weechat_iconv_fprintf (file, "server_nick1 = \"%s\"\n", ptr_server->nick1);
|
||||
weechat_iconv_fprintf (file, "server_nick2 = \"%s\"\n", ptr_server->nick2);
|
||||
weechat_iconv_fprintf (file, "server_nick3 = \"%s\"\n", ptr_server->nick3);
|
||||
weechat_iconv_fprintf (file, "server_username = \"%s\"\n", ptr_server->username);
|
||||
weechat_iconv_fprintf (file, "server_realname = \"%s\"\n", ptr_server->realname);
|
||||
weechat_iconv_fprintf (file, "server_hostname = \"%s\"\n",
|
||||
(ptr_server->hostname) ? ptr_server->hostname : "");
|
||||
weechat_iconv_fprintf (file, "server_command = \"%s\"\n",
|
||||
(ptr_server->command) ? ptr_server->command : "");
|
||||
weechat_iconv_fprintf (file, "server_command_delay = %d\n", ptr_server->command_delay);
|
||||
weechat_iconv_fprintf (file, "server_autojoin = \"%s\"\n",
|
||||
(ptr_server->autojoin) ? ptr_server->autojoin : "");
|
||||
weechat_iconv_fprintf (file, "server_autorejoin = %s\n",
|
||||
(ptr_server->autorejoin) ? "on" : "off");
|
||||
weechat_iconv_fprintf (file, "server_notify_levels = \"%s\"\n",
|
||||
(ptr_server->notify_levels) ? ptr_server->notify_levels : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -92,10 +92,6 @@ extern int cfg_look_set_title;
|
||||
extern int cfg_look_startup_logo;
|
||||
extern int cfg_look_startup_version;
|
||||
extern char *cfg_look_weechat_slogan;
|
||||
extern char *cfg_look_charset_decode_iso;
|
||||
extern char *cfg_look_charset_decode_utf;
|
||||
extern char *cfg_look_charset_encode;
|
||||
extern char *cfg_look_charset_internal;
|
||||
extern int cfg_look_one_server_buffer;
|
||||
extern int cfg_look_open_near_server;
|
||||
extern int cfg_look_scroll_amount;
|
||||
@@ -106,6 +102,7 @@ extern int cfg_look_nicklist;
|
||||
extern int cfg_look_nicklist_position;
|
||||
extern int cfg_look_nicklist_min_size;
|
||||
extern int cfg_look_nicklist_max_size;
|
||||
extern int cfg_look_nicklist_separator;
|
||||
extern int cfg_look_nickmode;
|
||||
extern int cfg_look_nickmode_empty;
|
||||
extern char *cfg_look_no_nickname;
|
||||
@@ -133,6 +130,7 @@ extern char *cfg_look_input_format;
|
||||
extern int cfg_col_real_white;
|
||||
extern int cfg_col_separator;
|
||||
extern int cfg_col_title;
|
||||
extern int cfg_col_title_more;
|
||||
extern int cfg_col_title_bg;
|
||||
extern int cfg_col_chat;
|
||||
extern int cfg_col_chat_time;
|
||||
@@ -212,10 +210,12 @@ extern int cfg_irc_away_check_max_nicks;
|
||||
extern int cfg_irc_lag_check;
|
||||
extern int cfg_irc_lag_min_show;
|
||||
extern int cfg_irc_lag_disconnect;
|
||||
extern int cfg_irc_anti_flood;
|
||||
extern int cfg_irc_fifo_pipe;
|
||||
extern char *cfg_irc_highlight;
|
||||
extern int cfg_irc_colors_receive;
|
||||
extern int cfg_irc_colors_send;
|
||||
extern int cfg_irc_send_unknown_commands;
|
||||
|
||||
extern int cfg_dcc_auto_accept_files;
|
||||
extern int cfg_dcc_auto_accept_chats;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/utf8.h"
|
||||
#include "../../common/util.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "../../irc/irc.h"
|
||||
#include "gui-curses.h"
|
||||
@@ -167,7 +168,8 @@ void
|
||||
gui_chat_draw_title (t_gui_buffer *buffer, int erase)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
char format[32], *buf, *buf2;
|
||||
char format[32], *buf, *buf2, *ptr_topic;
|
||||
int length, width;
|
||||
|
||||
if (!gui_ok)
|
||||
return;
|
||||
@@ -179,37 +181,71 @@ gui_chat_draw_title (t_gui_buffer *buffer, int erase)
|
||||
if (erase)
|
||||
gui_window_curses_clear (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
|
||||
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
|
||||
snprintf (format, 32, "%%-%ds", ptr_win->win_title_width);
|
||||
wmove (GUI_CURSES(ptr_win)->win_title, 0, 0);
|
||||
|
||||
if (CHANNEL(buffer))
|
||||
{
|
||||
if (CHANNEL(buffer)->topic)
|
||||
{
|
||||
buf = (char *)gui_color_decode ((unsigned char *)(CHANNEL(buffer)->topic), 0);
|
||||
buf2 = channel_iconv_decode (SERVER(buffer),
|
||||
CHANNEL(buffer),
|
||||
(buf) ? buf : CHANNEL(buffer)->topic);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_title, 0, 0,
|
||||
format, (buf2) ? buf2 : CHANNEL(buffer)->topic);
|
||||
buf2 = weechat_iconv_from_internal (NULL,
|
||||
(buf) ? buf : CHANNEL(buffer)->topic);
|
||||
ptr_topic = (buf2) ? buf2 : CHANNEL(buffer)->topic;
|
||||
length = utf8_strlen (ptr_topic);
|
||||
if (ptr_win->win_title_start >= length)
|
||||
ptr_win->win_title_start = 0;
|
||||
width = (ptr_win->win_title_start == 0) ?
|
||||
ptr_win->win_width : ptr_win->win_width - 2;
|
||||
ptr_topic += ptr_win->win_title_start;
|
||||
|
||||
snprintf (format, 32, "%%-%ds", width);
|
||||
|
||||
if (ptr_win->win_title_start > 0)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title,
|
||||
COLOR_WIN_TITLE_MORE);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_title, "%s", "++");
|
||||
}
|
||||
|
||||
if (utf8_strlen (ptr_topic) > ptr_win->win_width)
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_title,
|
||||
format, ptr_topic);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title,
|
||||
COLOR_WIN_TITLE_MORE);
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_title, 0, ptr_win->win_width - 2,
|
||||
"%s", "++");
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_title, format, ptr_topic);
|
||||
}
|
||||
if (buf)
|
||||
free (buf);
|
||||
if (buf2)
|
||||
free (buf2);
|
||||
}
|
||||
else
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_title, 0, 0, format, " ");
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_title, format, " ");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
|
||||
if (buffer->type == BUFFER_TYPE_STANDARD)
|
||||
{
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_title, 0, 0,
|
||||
format,
|
||||
PACKAGE_STRING " " WEECHAT_COPYRIGHT_DATE " - "
|
||||
WEECHAT_WEBSITE);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_title,
|
||||
format,
|
||||
PACKAGE_STRING " " WEECHAT_COPYRIGHT_DATE " - "
|
||||
WEECHAT_WEBSITE);
|
||||
}
|
||||
else
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_title, 0, 0, format, " ");
|
||||
wprintw (GUI_CURSES(ptr_win)->win_title, format, " ");
|
||||
}
|
||||
wnoutrefresh (GUI_CURSES(ptr_win)->win_title);
|
||||
refresh ();
|
||||
@@ -217,6 +253,20 @@ gui_chat_draw_title (t_gui_buffer *buffer, int erase)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_chat_get_real_width: return real width: width - 1 if nicklist is at right,
|
||||
* for good copy/paste (without nicklist separator)
|
||||
*/
|
||||
|
||||
int
|
||||
gui_chat_get_real_width (t_gui_window *window)
|
||||
{
|
||||
if (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_RIGHT)
|
||||
return window->win_chat_width - 1;
|
||||
else
|
||||
return window->win_chat_width;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_chat_display_new_line: display a new line
|
||||
*/
|
||||
@@ -227,7 +277,8 @@ gui_chat_display_new_line (t_gui_window *window, int num_lines, int count,
|
||||
{
|
||||
if ((count == 0) || (*lines_displayed >= num_lines - count))
|
||||
{
|
||||
if ((!simulate) && (window->win_chat_cursor_x <= window->win_chat_width - 1))
|
||||
if ((!simulate)
|
||||
&& (window->win_chat_cursor_x <= gui_chat_get_real_width (window) - 1))
|
||||
{
|
||||
wmove (GUI_CURSES(window)->win_chat,
|
||||
window->win_chat_cursor_y,
|
||||
@@ -427,13 +478,14 @@ gui_chat_word_get_next_char (t_gui_window *window, unsigned char *string,
|
||||
*/
|
||||
|
||||
void
|
||||
gui_chat_display_word_raw (t_gui_window *window, char *string)
|
||||
gui_chat_display_word_raw (t_gui_window *window, char *string, int display)
|
||||
{
|
||||
char *prev_char, *next_char, saved_char;
|
||||
|
||||
wmove (GUI_CURSES(window)->win_chat,
|
||||
window->win_chat_cursor_y,
|
||||
window->win_chat_cursor_x);
|
||||
char *prev_char, *next_char, saved_char, *output;
|
||||
|
||||
if (display)
|
||||
wmove (GUI_CURSES(window)->win_chat,
|
||||
window->win_chat_cursor_y,
|
||||
window->win_chat_cursor_x);
|
||||
|
||||
while (string && string[0])
|
||||
{
|
||||
@@ -442,14 +494,19 @@ gui_chat_display_word_raw (t_gui_window *window, char *string)
|
||||
return;
|
||||
|
||||
prev_char = utf8_prev_char (string, next_char);
|
||||
if (prev_char)
|
||||
if (display && prev_char)
|
||||
{
|
||||
saved_char = next_char[0];
|
||||
next_char[0] = '\0';
|
||||
if ((prev_char[0] == -110) && (!prev_char[1]))
|
||||
if (((unsigned char)(prev_char[0]) == 146) && (!prev_char[1]))
|
||||
wprintw (GUI_CURSES(window)->win_chat, ".");
|
||||
else
|
||||
wprintw (GUI_CURSES(window)->win_chat, "%s", prev_char);
|
||||
{
|
||||
output = weechat_iconv_from_internal (NULL, prev_char);
|
||||
wprintw (GUI_CURSES(window)->win_chat, "%s", (output) ? output : prev_char);
|
||||
if (output)
|
||||
free (output);
|
||||
}
|
||||
next_char[0] = saved_char;
|
||||
}
|
||||
|
||||
@@ -510,24 +567,32 @@ gui_chat_display_word (t_gui_window *window,
|
||||
chars_to_display = gui_word_strlen (window, data);
|
||||
|
||||
/* too long for current line */
|
||||
if (window->win_chat_cursor_x + chars_to_display > window->win_chat_width)
|
||||
if (window->win_chat_cursor_x + chars_to_display > gui_chat_get_real_width (window))
|
||||
{
|
||||
num_displayed = window->win_chat_width - window->win_chat_cursor_x;
|
||||
num_displayed = gui_chat_get_real_width (window) - window->win_chat_cursor_x;
|
||||
pos_saved_char = gui_word_real_pos (window, data, num_displayed);
|
||||
saved_char = data[pos_saved_char];
|
||||
data[pos_saved_char] = '\0';
|
||||
if ((!simulate) &&
|
||||
((count == 0) || (*lines_displayed >= num_lines - count)))
|
||||
gui_chat_display_word_raw (window, data);
|
||||
if (!simulate)
|
||||
{
|
||||
if ((count == 0) || (*lines_displayed >= num_lines - count))
|
||||
gui_chat_display_word_raw (window, data, 1);
|
||||
else
|
||||
gui_chat_display_word_raw (window, data, 0);
|
||||
}
|
||||
data[pos_saved_char] = saved_char;
|
||||
data += pos_saved_char;
|
||||
}
|
||||
else
|
||||
{
|
||||
num_displayed = chars_to_display;
|
||||
if ((!simulate) &&
|
||||
((count == 0) || (*lines_displayed >= num_lines - count)))
|
||||
gui_chat_display_word_raw (window, data);
|
||||
if (!simulate)
|
||||
{
|
||||
if ((count == 0) || (*lines_displayed >= num_lines - count))
|
||||
gui_chat_display_word_raw (window, data, 1);
|
||||
else
|
||||
gui_chat_display_word_raw (window, data, 0);
|
||||
}
|
||||
data += strlen (data);
|
||||
}
|
||||
|
||||
@@ -537,7 +602,7 @@ gui_chat_display_word (t_gui_window *window,
|
||||
if ((data >= end_line) ||
|
||||
(((simulate) ||
|
||||
(window->win_chat_cursor_y <= window->win_chat_height - 1)) &&
|
||||
(window->win_chat_cursor_x > (window->win_chat_width - 1))))
|
||||
(window->win_chat_cursor_x > (gui_chat_get_real_width (window) - 1))))
|
||||
gui_chat_display_new_line (window, num_lines, count,
|
||||
lines_displayed, simulate);
|
||||
|
||||
@@ -681,8 +746,8 @@ gui_chat_display_line (t_gui_window *window, t_gui_line *line, int count,
|
||||
if (word_length > 0)
|
||||
{
|
||||
/* spaces + word too long for current line but ok for next line */
|
||||
if ((window->win_chat_cursor_x + word_length_with_spaces > window->win_chat_width)
|
||||
&& (word_length <= window->win_chat_width - line->length_align))
|
||||
if ((window->win_chat_cursor_x + word_length_with_spaces > gui_chat_get_real_width (window))
|
||||
&& (word_length <= gui_chat_get_real_width (window) - line->length_align))
|
||||
{
|
||||
gui_chat_display_new_line (window, num_lines, count,
|
||||
&lines_displayed, simulate);
|
||||
@@ -921,12 +986,14 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_chat, i, 0, "%s %-16s ",
|
||||
(ptr_dcc == dcc_selected) ? "***" : " ",
|
||||
ptr_dcc->nick);
|
||||
buf = channel_iconv_decode (SERVER(buffer),
|
||||
CHANNEL(buffer),
|
||||
(DCC_IS_CHAT(ptr_dcc->type)) ?
|
||||
_(ptr_dcc->filename) : ptr_dcc->filename);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_chat, "%s", buf);
|
||||
free (buf);
|
||||
buf = weechat_iconv_from_internal (NULL,
|
||||
(DCC_IS_CHAT(ptr_dcc->type)) ?
|
||||
_(ptr_dcc->filename) : ptr_dcc->filename);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_chat, "%s",
|
||||
(buf) ? buf : ((DCC_IS_CHAT(ptr_dcc->type)) ?
|
||||
_(ptr_dcc->filename) : ptr_dcc->filename));
|
||||
if (buf)
|
||||
free (buf);
|
||||
if (DCC_IS_FILE(ptr_dcc->type))
|
||||
{
|
||||
if (ptr_dcc->filename_suffix > 0)
|
||||
@@ -943,11 +1010,11 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
|
||||
(DCC_IS_RECV(ptr_dcc->type)) ? "-->>" : "<<--");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat,
|
||||
COLOR_DCC_WAITING + ptr_dcc->status);
|
||||
buf = channel_iconv_decode (SERVER(buffer),
|
||||
CHANNEL(buffer),
|
||||
_(dcc_status_string[ptr_dcc->status]));
|
||||
wprintw (GUI_CURSES(ptr_win)->win_chat, "%-10s", buf);
|
||||
free (buf);
|
||||
buf = weechat_iconv_from_internal (NULL, _(dcc_status_string[ptr_dcc->status]));
|
||||
wprintw (GUI_CURSES(ptr_win)->win_chat, "%-10s",
|
||||
(buf) ? buf : _(dcc_status_string[ptr_dcc->status]));
|
||||
if (buf)
|
||||
free (buf);
|
||||
|
||||
/* other infos */
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat,
|
||||
@@ -1016,13 +1083,12 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
|
||||
ptr_dcc->eta % 60);
|
||||
}
|
||||
sprintf (format, "%s %%s/s)", unit_format[num_unit]);
|
||||
buf = channel_iconv_decode (SERVER(buffer),
|
||||
CHANNEL(buffer),
|
||||
unit_name[num_unit]);
|
||||
buf = weechat_iconv_from_internal (NULL, unit_name[num_unit]);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_chat, format,
|
||||
((float)ptr_dcc->bytes_per_sec) / ((float)(unit_divide[num_unit])),
|
||||
buf);
|
||||
free (buf);
|
||||
(buf) ? buf : unit_name[num_unit]);
|
||||
if (buf)
|
||||
free (buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -504,6 +504,7 @@ gui_color_init_weechat ()
|
||||
|
||||
gui_color[COLOR_WIN_SEPARATOR] = gui_color_build (COLOR_WIN_SEPARATOR, cfg_col_separator, cfg_col_separator);
|
||||
gui_color[COLOR_WIN_TITLE] = gui_color_build (COLOR_WIN_TITLE, cfg_col_title, cfg_col_title_bg);
|
||||
gui_color[COLOR_WIN_TITLE_MORE] = gui_color_build (COLOR_WIN_TITLE_MORE, cfg_col_title_more, cfg_col_title_bg);
|
||||
gui_color[COLOR_WIN_CHAT] = gui_color_build (COLOR_WIN_CHAT, cfg_col_chat, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_TIME] = gui_color_build (COLOR_WIN_CHAT_TIME, cfg_col_chat_time, cfg_col_chat_bg);
|
||||
gui_color[COLOR_WIN_CHAT_TIME_SEP] = gui_color_build (COLOR_WIN_CHAT_TIME_SEP, cfg_col_chat_time_sep, cfg_col_chat_bg);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/hotlist.h"
|
||||
#include "../../common/util.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
@@ -81,7 +82,7 @@ gui_infobar_draw (t_gui_buffer *buffer, int erase)
|
||||
t_gui_window *ptr_win;
|
||||
time_t time_seconds;
|
||||
struct tm *local_time;
|
||||
char text_time[1024 + 1];
|
||||
char text_time[1024 + 1], *buf;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) buffer;
|
||||
@@ -122,7 +123,10 @@ gui_infobar_draw (t_gui_buffer *buffer, int erase)
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar, " | ");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, gui_infobar->color);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar, "%s", gui_infobar->text);
|
||||
buf = weechat_iconv_from_internal (NULL, gui_infobar->text);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_infobar, "%s", (buf) ? buf : gui_infobar->text);
|
||||
if (buf)
|
||||
free (buf);
|
||||
}
|
||||
|
||||
wnoutrefresh (GUI_CURSES(ptr_win)->win_infobar);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/utf8.h"
|
||||
#include "../../common/util.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
@@ -243,7 +244,7 @@ gui_input_draw_prompt (t_gui_window *window, char *nick)
|
||||
int
|
||||
gui_input_draw_text (t_gui_window *window, int input_width)
|
||||
{
|
||||
char *ptr_start, *ptr_next, saved_char;
|
||||
char *ptr_start, *ptr_next, saved_char, *output;
|
||||
int pos_mask, size, last_color, color, count_cursor, offset_cursor;
|
||||
|
||||
ptr_start = utf8_add_offset (window->buffer->input_buffer,
|
||||
@@ -273,7 +274,10 @@ gui_input_draw_text (t_gui_window *window, int input_width)
|
||||
gui_input_set_color (window, color);
|
||||
}
|
||||
last_color = color;
|
||||
wprintw (GUI_CURSES(window)->win_input, "%s", ptr_start);
|
||||
output = weechat_iconv_from_internal (NULL, ptr_start);
|
||||
wprintw (GUI_CURSES(window)->win_input, "%s", (output) ? output : ptr_start);
|
||||
if (output)
|
||||
free (output);
|
||||
if (count_cursor > 0)
|
||||
{
|
||||
offset_cursor += utf8_width_screen (ptr_start);
|
||||
@@ -387,22 +391,28 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
|
||||
{
|
||||
case DCC_WAITING:
|
||||
if (DCC_IS_RECV(dcc_selected->type))
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [A] Accept"));
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Cancel"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
|
||||
_(" [A] Accept"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
|
||||
_(" [C] Cancel"));
|
||||
break;
|
||||
case DCC_CONNECTING:
|
||||
case DCC_ACTIVE:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Cancel"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
|
||||
_(" [C] Cancel"));
|
||||
break;
|
||||
case DCC_DONE:
|
||||
case DCC_FAILED:
|
||||
case DCC_ABORTED:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [R] Remove"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
|
||||
_(" [R] Remove"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [P] Purge old DCC"));
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [Q] Close DCC view"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
|
||||
_(" [P] Purge old DCC"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
|
||||
_(" [Q] Close DCC view"));
|
||||
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
|
||||
ptr_win->win_input_cursor_x = 0;
|
||||
if (ptr_win == gui_current_window)
|
||||
@@ -410,8 +420,10 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
|
||||
break;
|
||||
case BUFFER_TYPE_RAW_DATA:
|
||||
wmove (GUI_CURSES(ptr_win)->win_input, 0, 0);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Clear buffer"));
|
||||
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [Q] Close raw data view"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
|
||||
_(" [C] Clear buffer"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
|
||||
_(" [Q] Close raw data view"));
|
||||
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
|
||||
ptr_win->win_input_cursor_x = 0;
|
||||
if (ptr_win == gui_current_window)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/utf8.h"
|
||||
#include "../../common/util.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
#ifdef PLUGINS
|
||||
@@ -82,7 +83,8 @@ gui_keyboard_default_bindings ()
|
||||
gui_keyboard_bind ( /* m-pgdn */ "meta-meta2-6~", "scroll_down");
|
||||
gui_keyboard_bind ( /* m-home */ "meta-meta2-1~", "scroll_top");
|
||||
gui_keyboard_bind ( /* m-end */ "meta-meta2-4~", "scroll_bottom");
|
||||
gui_keyboard_bind ( /* F10 */ "meta2-21~", "infobar_clear");
|
||||
gui_keyboard_bind ( /* F9 */ "meta2-20~", "scroll_topic_left");
|
||||
gui_keyboard_bind ( /* F10 */ "meta2-21~", "scroll_topic_right");
|
||||
gui_keyboard_bind ( /* F11 */ "meta2-23~", "nick_page_up");
|
||||
gui_keyboard_bind ( /* F12 */ "meta2-24~", "nick_page_down");
|
||||
gui_keyboard_bind ( /* m-F11 */ "meta-meta2-23~", "nick_beginning");
|
||||
@@ -95,6 +97,7 @@ gui_keyboard_default_bindings ()
|
||||
gui_keyboard_bind ( /* m-f */ "meta-f", "next_word");
|
||||
gui_keyboard_bind ( /* ^right */ "meta-Oc", "next_word");
|
||||
gui_keyboard_bind ( /* m-h */ "meta-h", "hotlist_clear");
|
||||
gui_keyboard_bind ( /* m-i */ "meta-i" , "infobar_clear");
|
||||
gui_keyboard_bind ( /* m-j,m-d */ "meta-jmeta-d", "jump_dcc");
|
||||
gui_keyboard_bind ( /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer");
|
||||
gui_keyboard_bind ( /* m-j,m-s */ "meta-jmeta-s", "jump_server");
|
||||
@@ -198,7 +201,7 @@ void
|
||||
gui_keyboard_read ()
|
||||
{
|
||||
int key, i, insert_ok;
|
||||
char key_str[32];
|
||||
char key_str[32], *key_utf;
|
||||
char *buffer_before_key;
|
||||
#ifdef PLUGINS
|
||||
char key_str2[33];
|
||||
@@ -281,6 +284,14 @@ gui_keyboard_read ()
|
||||
{
|
||||
key_str[0] = (char) key;
|
||||
key_str[1] = '\0';
|
||||
|
||||
/* convert input to UTF-8 is user is not using UTF-8 as locale */
|
||||
if (!local_utf8)
|
||||
{
|
||||
key_utf = weechat_iconv_to_internal (NULL, key_str);
|
||||
strncpy (key_str, key_utf, sizeof (key_str));
|
||||
key_str[sizeof (key_str) - 1] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,6 +324,8 @@ gui_keyboard_read ()
|
||||
buffer_before_key,
|
||||
gui_current_window->buffer->input_buffer);
|
||||
#endif
|
||||
if (buffer_before_key)
|
||||
free (buffer_before_key);
|
||||
break;
|
||||
case BUFFER_TYPE_DCC:
|
||||
gui_exec_action_dcc (gui_current_window, key_str);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -67,11 +67,10 @@ gui_main_loop ()
|
||||
{
|
||||
fd_set read_fd;
|
||||
static struct timeval timeout, tv;
|
||||
static struct timezone tz;
|
||||
t_irc_server *ptr_server;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
int old_day, old_min, old_sec, diff;
|
||||
char text_time[1024];
|
||||
char text_time[1024], *text_time2;
|
||||
time_t new_time;
|
||||
struct tm *local_time;
|
||||
|
||||
@@ -111,6 +110,7 @@ gui_main_loop ()
|
||||
{
|
||||
strftime (text_time, sizeof (text_time),
|
||||
cfg_look_day_change_timestamp, local_time);
|
||||
text_time2 = weechat_iconv_to_internal (NULL, text_time);
|
||||
gui_add_hotlist = 0;
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer;
|
||||
ptr_buffer = ptr_buffer->next_buffer)
|
||||
@@ -118,8 +118,11 @@ gui_main_loop ()
|
||||
if (ptr_buffer->type == BUFFER_TYPE_STANDARD)
|
||||
gui_printf_nolog_notime (ptr_buffer,
|
||||
_("Day changed to %s\n"),
|
||||
text_time);
|
||||
(text_time2) ?
|
||||
text_time2 : text_time);
|
||||
}
|
||||
if (text_time2)
|
||||
free (text_time2);
|
||||
gui_add_hotlist = 1;
|
||||
}
|
||||
old_day = local_time->tm_mday;
|
||||
@@ -129,7 +132,18 @@ gui_main_loop ()
|
||||
if (local_time->tm_sec != old_sec)
|
||||
{
|
||||
old_sec = local_time->tm_sec;
|
||||
|
||||
/* send queued messages */
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (ptr_server->is_connected)
|
||||
{
|
||||
server_outqueue_send (ptr_server);
|
||||
}
|
||||
}
|
||||
|
||||
/* display time in infobar (if seconds displayed) */
|
||||
if (cfg_look_infobar_seconds)
|
||||
{
|
||||
gui_infobar_draw_time (gui_current_window->buffer);
|
||||
@@ -218,15 +232,15 @@ gui_main_loop ()
|
||||
if ((ptr_server->lag_check_time.tv_sec == 0)
|
||||
&& (new_time >= ptr_server->lag_next_check))
|
||||
{
|
||||
server_sendf (ptr_server, "PING %s\r\n", ptr_server->address);
|
||||
gettimeofday (&(ptr_server->lag_check_time), &tz);
|
||||
server_sendf (ptr_server, "PING %s", ptr_server->address);
|
||||
gettimeofday (&(ptr_server->lag_check_time), NULL);
|
||||
}
|
||||
|
||||
/* lag timeout => disconnect */
|
||||
if ((ptr_server->lag_check_time.tv_sec != 0)
|
||||
&& (cfg_irc_lag_disconnect > 0))
|
||||
{
|
||||
gettimeofday (&tv, &tz);
|
||||
gettimeofday (&tv, NULL);
|
||||
diff = (int) get_timeval_diff (&(ptr_server->lag_check_time), &tv);
|
||||
if (diff / 1000 > cfg_irc_lag_disconnect * 60)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -91,7 +91,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
|
||||
&& (max_length > cfg_look_nicklist_max_size)) ?
|
||||
cfg_look_nicklist_max_size : max_length));
|
||||
|
||||
if (has_colors ())
|
||||
if (cfg_look_nicklist_separator && has_colors ())
|
||||
{
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_SEP);
|
||||
switch (cfg_look_nicklist_position)
|
||||
@@ -121,12 +121,12 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
|
||||
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
|
||||
x = 0;
|
||||
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0;
|
||||
y = (cfg_look_nicklist_separator && (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ? 1 : 0;
|
||||
column = 0;
|
||||
|
||||
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
|
||||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
|
||||
nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_nick_height - 1);
|
||||
nicks_displayed = (ptr_win->win_width / (max_length + 2)) * (ptr_win->win_nick_height - cfg_look_nicklist_separator);
|
||||
else
|
||||
nicks_displayed = ptr_win->win_nick_height;
|
||||
|
||||
@@ -147,7 +147,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
|
||||
x = 0;
|
||||
break;
|
||||
case CFG_LOOK_NICKLIST_RIGHT:
|
||||
x = 1;
|
||||
x = cfg_look_nicklist_separator;
|
||||
break;
|
||||
case CFG_LOOK_NICKLIST_TOP:
|
||||
case CFG_LOOK_NICKLIST_BOTTOM:
|
||||
@@ -214,11 +214,13 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
|
||||
if ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ||
|
||||
(cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM))
|
||||
{
|
||||
if (y - ((cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM) ? 1 : 0) >= ptr_win->win_nick_height - 1)
|
||||
if (y - ((cfg_look_nicklist_separator
|
||||
&& (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ? 1 : 0)
|
||||
>= ptr_win->win_nick_height - 1)
|
||||
{
|
||||
column += max_length + 2;
|
||||
y = (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_TOP) ?
|
||||
0 : 1;
|
||||
y = (cfg_look_nicklist_separator && (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ?
|
||||
1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "../../common/weechat.h"
|
||||
#include "../gui.h"
|
||||
#include "../../common/hotlist.h"
|
||||
#include "../../common/utf8.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
@@ -78,7 +79,7 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("<servers>"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, _("<servers>"));
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
|
||||
@@ -90,7 +91,7 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%s", SERVER(ptr_win->buffer)->name);
|
||||
if (SERVER(ptr_win->buffer)->is_away)
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("(away)"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, _("(away)"));
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
|
||||
@@ -210,13 +211,16 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
|
||||
switch (ptr_win->buffer->type)
|
||||
{
|
||||
case BUFFER_TYPE_STANDARD:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("[not connected] "));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
|
||||
_("[not connected] "));
|
||||
break;
|
||||
case BUFFER_TYPE_DCC:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "<DCC> ");
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
|
||||
"<DCC> ");
|
||||
break;
|
||||
case BUFFER_TYPE_RAW_DATA:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("<RAW_IRC> "));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
|
||||
_("<RAW_IRC> "));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -228,7 +232,7 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("Act: "));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, _("Act: "));
|
||||
|
||||
names_count = 0;
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist;
|
||||
@@ -299,7 +303,8 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "DCC");
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
|
||||
"DCC");
|
||||
break;
|
||||
case BUFFER_TYPE_RAW_DATA:
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
|
||||
@@ -309,7 +314,8 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("RAW_IRC"));
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
|
||||
_("RAW_IRC"));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -330,8 +336,9 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, _("Lag: %.1f"),
|
||||
((float)(SERVER(ptr_win->buffer)->lag)) / 1000);
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
|
||||
_("Lag: %.1f"),
|
||||
((float)(SERVER(ptr_win->buffer)->lag)) / 1000);
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (GUI_CURSES(ptr_win)->win_status, "]");
|
||||
@@ -342,21 +349,25 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
|
||||
if (BUFFER_HAS_NICKLIST(ptr_win->buffer))
|
||||
{
|
||||
snprintf (str_nicks, sizeof (str_nicks) - 1, "%d", CHANNEL(ptr_win->buffer)->nicks_count);
|
||||
x = ptr_win->win_status_width - strlen (str_nicks) - 4;
|
||||
x = ptr_win->win_status_width - utf8_strlen (str_nicks) - 4;
|
||||
}
|
||||
else
|
||||
x = ptr_win->win_status_width - 2;
|
||||
more = strdup (_("-MORE-"));
|
||||
x -= strlen (more) - 1;
|
||||
x -= utf8_strlen (more) - 1;
|
||||
if (x < 0)
|
||||
x = 0;
|
||||
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_MORE);
|
||||
if (ptr_win->scroll)
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_status, 0, x, "%s", more);
|
||||
{
|
||||
wmove (GUI_CURSES(ptr_win)->win_status, 0, x);
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, "%s", more);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf (format, sizeof (format) - 1, "%%-%ds", (int)(strlen (more)));
|
||||
mvwprintw (GUI_CURSES(ptr_win)->win_status, 0, x, format, " ");
|
||||
snprintf (format, sizeof (format) - 1, "%%-%ds", (int)(utf8_strlen (more)));
|
||||
wmove (GUI_CURSES(ptr_win)->win_status, 0, x);
|
||||
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, format, " ");
|
||||
}
|
||||
if (BUFFER_HAS_NICKLIST(ptr_win->buffer))
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -25,6 +25,7 @@
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <libgen.h>
|
||||
@@ -33,6 +34,7 @@
|
||||
#include "../gui.h"
|
||||
#include "../../common/hotlist.h"
|
||||
#include "../../common/log.h"
|
||||
#include "../../common/util.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "gui-curses.h"
|
||||
|
||||
@@ -130,6 +132,27 @@ gui_window_objects_free (t_gui_window *window, int free_separator)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_wprintw: decode then display string with wprintw
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_wprintw (WINDOW *window, char *data, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
static char buf[4096];
|
||||
char *buf2;
|
||||
|
||||
va_start (argptr, data);
|
||||
vsnprintf (buf, sizeof (buf) - 1, data, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
buf2 = weechat_iconv_from_internal (NULL, buf);
|
||||
wprintw (window, "%s", (buf2) ? buf2 : buf);
|
||||
if (buf2)
|
||||
free (buf2);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_curses_clear: clear a Curses window
|
||||
*/
|
||||
@@ -196,7 +219,7 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
|
||||
else if ((cfg_look_nicklist_max_size > 0)
|
||||
&& (max_length > cfg_look_nicklist_max_size))
|
||||
max_length = cfg_look_nicklist_max_size;
|
||||
if (!force_calculate && (window->win_nick_width == max_length + 2))
|
||||
if (!force_calculate && (window->win_nick_width == max_length + 1 + cfg_look_nicklist_separator))
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -218,19 +241,19 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
|
||||
window->win_height - add_top - add_bottom - 2 - 4;
|
||||
if (lines > max_height)
|
||||
lines = max_height;
|
||||
if (!force_calculate && (window->win_nick_height == lines + 1))
|
||||
if (!force_calculate && (window->win_nick_height == lines + cfg_look_nicklist_separator))
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (cfg_look_nicklist_position)
|
||||
{
|
||||
case CFG_LOOK_NICKLIST_LEFT:
|
||||
window->win_chat_x = window->win_x + add_left + max_length + 2;
|
||||
window->win_chat_x = window->win_x + add_left + max_length + 1 + cfg_look_nicklist_separator;
|
||||
window->win_chat_y = window->win_y + add_top + 1;
|
||||
window->win_chat_width = window->win_width - add_left - add_right - max_length - 2;
|
||||
window->win_chat_width = window->win_width - add_left - add_right - max_length - 1 - cfg_look_nicklist_separator;
|
||||
window->win_nick_x = window->win_x + add_left + 0;
|
||||
window->win_nick_y = window->win_y + add_top + 1;
|
||||
window->win_nick_width = max_length + 2;
|
||||
window->win_nick_width = max_length + 1 + cfg_look_nicklist_separator;
|
||||
if (cfg_look_infobar)
|
||||
{
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 4;
|
||||
@@ -246,10 +269,10 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
|
||||
case CFG_LOOK_NICKLIST_RIGHT:
|
||||
window->win_chat_x = window->win_x + add_left;
|
||||
window->win_chat_y = window->win_y + add_top + 1;
|
||||
window->win_chat_width = window->win_width - add_left - add_right - max_length - 2;
|
||||
window->win_nick_x = window->win_x + window->win_width - add_right - max_length - 2;
|
||||
window->win_chat_width = window->win_width - add_left - add_right - max_length - 1 - cfg_look_nicklist_separator;
|
||||
window->win_nick_x = window->win_x + window->win_width - add_right - max_length - 1 - cfg_look_nicklist_separator;
|
||||
window->win_nick_y = window->win_y + add_top + 1;
|
||||
window->win_nick_width = max_length + 2;
|
||||
window->win_nick_width = max_length + 1 + cfg_look_nicklist_separator;
|
||||
if (cfg_look_infobar)
|
||||
{
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 4;
|
||||
@@ -264,16 +287,16 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
|
||||
break;
|
||||
case CFG_LOOK_NICKLIST_TOP:
|
||||
window->win_chat_x = window->win_x + add_left;
|
||||
window->win_chat_y = window->win_y + add_top + 1 + (lines + 1);
|
||||
window->win_chat_y = window->win_y + add_top + 1 + lines + cfg_look_nicklist_separator;
|
||||
window->win_chat_width = window->win_width - add_left - add_right;
|
||||
if (cfg_look_infobar)
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1) - 1;
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator - 1;
|
||||
else
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1);
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator;
|
||||
window->win_nick_x = window->win_x + add_left;
|
||||
window->win_nick_y = window->win_y + add_top + 1;
|
||||
window->win_nick_width = window->win_width - add_left - add_right;
|
||||
window->win_nick_height = lines + 1;
|
||||
window->win_nick_height = lines + cfg_look_nicklist_separator;
|
||||
window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2));
|
||||
break;
|
||||
case CFG_LOOK_NICKLIST_BOTTOM:
|
||||
@@ -281,16 +304,16 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
|
||||
window->win_chat_y = window->win_y + add_top + 1;
|
||||
window->win_chat_width = window->win_width - add_left - add_right;
|
||||
if (cfg_look_infobar)
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1) - 1;
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator - 1;
|
||||
else
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1);
|
||||
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - lines - cfg_look_nicklist_separator;
|
||||
window->win_nick_x = window->win_x + add_left;
|
||||
if (cfg_look_infobar)
|
||||
window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - (lines + 1) - 1;
|
||||
window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - lines - cfg_look_nicklist_separator - 1;
|
||||
else
|
||||
window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - (lines + 1);
|
||||
window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - lines - cfg_look_nicklist_separator;
|
||||
window->win_nick_width = window->win_width - add_left - add_right;
|
||||
window->win_nick_height = lines + 1;
|
||||
window->win_nick_height = lines + cfg_look_nicklist_separator;
|
||||
window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2));
|
||||
break;
|
||||
}
|
||||
@@ -429,6 +452,7 @@ gui_window_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
|
||||
}
|
||||
|
||||
window->buffer = buffer;
|
||||
window->win_title_start = 0;
|
||||
window->win_nick_start = 0;
|
||||
|
||||
gui_window_calculate_pos_size (window, 1);
|
||||
@@ -646,6 +670,37 @@ gui_window_scroll_bottom (t_gui_window *window)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_scroll_topic_left: scroll left topic
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_scroll_topic_left (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (window->win_title_start > 0)
|
||||
window->win_title_start -= (window->win_width * 3) / 4;
|
||||
if (window->win_title_start < 0)
|
||||
window->win_title_start = 0;
|
||||
gui_chat_draw_title (window->buffer, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_scroll_topic_right: scroll right topic
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_scroll_topic_right (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
window->win_title_start += (window->win_width * 3) / 4;
|
||||
gui_chat_draw_title (window->buffer, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_nick_beginning: go to beginning of nicklist
|
||||
*/
|
||||
@@ -1227,8 +1282,8 @@ gui_window_set_title ()
|
||||
if (strcmp( envterm, "sun-cmd") == 0)
|
||||
printf ("\033]l%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
else if (strcmp(envterm, "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s %s", strlen(PACKAGE_NAME) +
|
||||
strlen(PACKAGE_VERSION) + 1,
|
||||
printf ("\033&f0k%dD%s %s",
|
||||
(int)(strlen(PACKAGE_NAME) + strlen(PACKAGE_VERSION) + 1),
|
||||
PACKAGE_NAME, PACKAGE_VERSION);
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (envterm, "xterm", 5) == 0
|
||||
@@ -1262,7 +1317,7 @@ gui_window_reset_title ()
|
||||
if (strcmp( envterm, "sun-cmd") == 0)
|
||||
printf ("\033]l%s\033\\", "Terminal");
|
||||
else if (strcmp( envterm, "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s", strlen("Terminal"), "Terminal");
|
||||
printf ("\033&f0k%dD%s", (int)strlen("Terminal"), "Terminal");
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (envterm, "xterm", 5) == 0
|
||||
|| strncmp (envterm, "rxvt", 4) == 0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
@@ -90,6 +90,7 @@ extern void gui_keyboard_default_bindings ();
|
||||
extern void gui_keyboard_read ();
|
||||
|
||||
/* window functions */
|
||||
extern void gui_window_wprintw (WINDOW *, char *, ...);
|
||||
extern void gui_window_curses_clear (WINDOW *, int);
|
||||
extern void gui_window_set_weechat_color (WINDOW *, int);
|
||||
extern void gui_window_refresh_screen_sigwinch ();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
|
||||
# Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
* Copyright (c) 2003-2007 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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user