mirror of
https://github.com/weechat/weechat.git
synced 2026-06-18 09:04:47 +02:00
Compare commits
120 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b96cacd51 | |||
| 45f7cdda18 | |||
| dcf0119264 | |||
| c98365803d | |||
| ebcf17c78d | |||
| 022bf4d070 | |||
| d37ec4791c | |||
| e5038b4119 | |||
| 482d327562 | |||
| cb5269404c | |||
| 76c4d4d427 | |||
| 34c6051ffc | |||
| e69afa1401 | |||
| 2a227141c4 | |||
| 7ef14b95b6 | |||
| 4e5f1698ba | |||
| 0a6945b6ed | |||
| 046452b7e0 | |||
| d79dc3233a | |||
| ce7f24ecc1 | |||
| 0f718bf2c0 | |||
| a9e05f57ee | |||
| 24508e733c | |||
| 9f5c71ca98 | |||
| 491dff4238 | |||
| 7b84ab4b71 | |||
| c656661812 | |||
| 6753591f86 | |||
| 4e8ed66a1e | |||
| 0e47caf091 | |||
| 6100af949b | |||
| 4b3d25175f | |||
| b3fd00fc23 | |||
| 1484e17ce1 | |||
| 9759d72d3d | |||
| 92eb995917 | |||
| 1425ee40f4 | |||
| c8eae742b9 | |||
| 441dd2313f | |||
| aea603b6ed | |||
| 9c6f2fcb8c | |||
| 74ee53c102 | |||
| 649fd216ed | |||
| 9278198964 | |||
| 2ff30b15f2 | |||
| c94e1204aa | |||
| 2d438492d7 | |||
| 8959ba9759 | |||
| b9e5c94032 | |||
| 4c660ad565 | |||
| ab393805fb | |||
| dea586e5f1 | |||
| e1afa31563 | |||
| 750a5cbc6d | |||
| 77fab4ae29 | |||
| 622a18fb3f | |||
| 97b34b36fc | |||
| fb21a1c7f9 | |||
| f02ba717a0 | |||
| 9e6938bdf7 | |||
| b9a40bbe21 | |||
| 062e5ea1ae | |||
| 66ff97166f | |||
| 095f296529 | |||
| 340176d635 | |||
| fed6c36d19 | |||
| 3f84a8456a | |||
| fc95f86528 | |||
| d7287a71e5 | |||
| b861403369 | |||
| d8a790e8eb | |||
| 9211a67fb4 | |||
| d0babb2896 | |||
| ad345c0bce | |||
| 3b7b459522 | |||
| a99e6f3d95 | |||
| 35d6c43f85 | |||
| db235b23fa | |||
| a4ed5069c1 | |||
| 0bd38072f2 | |||
| 81da0f41d7 | |||
| 070e1b6ec7 | |||
| 4e86ff9682 | |||
| 867b881bac | |||
| 2c31a11aeb | |||
| 1d2a83b055 | |||
| 915ea408f0 | |||
| c9a469f51b | |||
| 69cb87251e | |||
| 8bcbc3dcae | |||
| dcb3b6fc7e | |||
| 16717f8322 | |||
| dc38b59849 | |||
| 7d91cdcbb3 | |||
| 885fe7434f | |||
| 84677f2835 | |||
| c20a3fdfa4 | |||
| f97a5555ca | |||
| 59bd0b825d | |||
| 38bf163c17 | |||
| 09a36a5d8e | |||
| 10f0236ea9 | |||
| 6d7afb96c1 | |||
| 48941e3646 | |||
| 72cb070ee4 | |||
| 390a097718 | |||
| f4733b970a | |||
| b80086cfac | |||
| 984eaaf826 | |||
| 0dddf86ab7 | |||
| c057937c7b | |||
| 938cc50f5e | |||
| aac1a0a08c | |||
| b77e441dc4 | |||
| f9279df092 | |||
| d84b1fa58f | |||
| 12941227d7 | |||
| 25f79c7bba | |||
| ac3f6dfa7b | |||
| 65704c6fea |
@@ -21,8 +21,8 @@ Bounga <bounga@altern.org>
|
||||
Jabber: Bounga@jabber.org
|
||||
ICQ : 178297842
|
||||
|
||||
Xahlexx <xahlexx@tuxisland.org>
|
||||
Web : http://www.tuxisland.org
|
||||
Xahlexx <xahlexx@weeland.org>
|
||||
Web : http://www.weeland.org
|
||||
IRC : nick is "xahlexx"
|
||||
|
||||
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2004-01-01
|
||||
WeeChat known bugs, 2004-10-30
|
||||
|
||||
- ./configure does not check that Curses headers are installed
|
||||
- ./configure does not check that Gtk 2.0 libraries are installed
|
||||
- ./configure does not check that Perl headers & libraries are installed
|
||||
- too much nicks in the channel (> height of window) => display bug
|
||||
- problem when resizing terminal and that some windows are outside new term size
|
||||
- some IRC commands are marked as 'unknown' when received
|
||||
(IRC protocol is under dev!)
|
||||
- too much opened channels => display bug
|
||||
- when kicked, channel is not prefixed by '(' and sufixed by ')'
|
||||
- when function key (non used by WeeChat) is pressed, prompt is deleted
|
||||
- when quitting WeeChat term title is not restored (if look_set_title is ON)
|
||||
- command name for /server can not contain spaces
|
||||
- wrong alias is not created and not saved when quitting WeeChat
|
||||
- when many WeeChat are launched, log file is not properly written (cleared by
|
||||
each WeeChat at startup)
|
||||
- display problems with Konsole (Kde terminal)
|
||||
- display problems with old Konsole versions (Kde terminal)
|
||||
|
||||
@@ -1,9 +1,64 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2004-01-01
|
||||
ChangeLog - 2004-10-30
|
||||
|
||||
|
||||
Version 0.0.8 (2004-10-30):
|
||||
* /kick command fixed: now ok with many words as reason
|
||||
* nickserv passwords hidden (new config option: log_hide_nickserv_pwd on/off)
|
||||
* auto-rejoin channels when kicked (new config option: server_autorejoin on/off)
|
||||
* added IRC::command function for Perl scripts
|
||||
* fixed bug when adding alias with same name as other
|
||||
* /buffer command developed (buffers list, move and notify)
|
||||
* logging buffers to disk (server/channel/private according to user prefs)
|
||||
* Away now announced in channels, and config option "look_display_away" added
|
||||
to enable/disable this feature
|
||||
* Fixed crash when resizing terminal to very small size
|
||||
* "-MORE-" message is now erased when switching to another buffer
|
||||
* DCC file receive ok (Alt-D for DCC view)
|
||||
* /query command now reopens private buffer if already opened
|
||||
* added key for redrawing terminal (Ctrl-L)
|
||||
* added key for clearing hotlist (Alt-R)
|
||||
|
||||
Version 0.0.7 (2004-08-08):
|
||||
* new "col_status_delimiters" config option
|
||||
* /buffer command added, buffers ordered by number, auto-jump to active
|
||||
buffers (alt-a), jump to buffers by number (alt-number)
|
||||
* /window command added, split terminal horizontally/vertically
|
||||
* unique color for each nick (based on nickname)
|
||||
* action messages are now considered as messages, not crappy joins/parts
|
||||
* fixed display bug when nicklist is displayed at bottom of screen
|
||||
* added history limit (text buffer & commands)
|
||||
* replaced --enable-debug with --with-debug option for ./configure, which is
|
||||
now integer: 1 = compiler debug flag, 2 = same 1 with verbose debug messages
|
||||
in WeeChat (default: 0 = no debug)
|
||||
|
||||
Version 0.0.6 (2004-06-05):
|
||||
* improved channel highlight (priority to message vs join/part)
|
||||
* fixed bug when opened private win and remote user changes his nick
|
||||
* /query command added (starts private conversation)
|
||||
* IRC messages 476, 477 added
|
||||
* /mode command is now ok and channel flags are displayed in status bar
|
||||
* fixed display bug (text was blinking when scrolling)
|
||||
* CTCP Version reply is now in english only and doesn't show host (security reason)
|
||||
|
||||
Version 0.0.5 (2004-02-07):
|
||||
* /set command to modify config options when WeeChat is running
|
||||
* fixed look_nicklist config option, now enables/disables nicklist
|
||||
* secured code to prevent buffer overflows and memory leaks
|
||||
* fixed QUIT IRC command: now sent to all connected servers (not only current)
|
||||
* URL command line parameter to connect to server(s)
|
||||
* new Perl script function to display message in info bar ("IRC::print_infobar")
|
||||
* info bar highlight notifications
|
||||
* info bar timestamp is added to config ("look_infobar_timestamp")
|
||||
* added info bar (optional, "look_infobar" to enable it, "on" by default)
|
||||
* fixed crash with /oper command
|
||||
* for default config file, nick is now based on un*x username (thanks to Witukind)
|
||||
* fixed crash when config file cannot be written
|
||||
* -c (or --config) command line parameter added to see config file options
|
||||
* highlight action messages
|
||||
|
||||
Version 0.0.4 (2004-01-01):
|
||||
* Perl plugin, with auto-load
|
||||
* when private window is created (another user is talking), WeeChat does not
|
||||
|
||||
@@ -1,158 +1,157 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
WeeChat FAQ, 2004-05-31
|
||||
=======================
|
||||
|
||||
WeeChat FAQ, 2004-01-01
|
||||
Intended audience:
|
||||
All WeeChat users.
|
||||
|
||||
Before reading the following:
|
||||
the following Q/A list is *not* exhaustive.
|
||||
It is also possible that you won't find any Q/A that matches your problem.
|
||||
Please read them anyway, they may provide you help in fixing your problem
|
||||
anyway.
|
||||
And even if your problem is listed below, it is possible that the answers don't
|
||||
help you anymore to solve it. Then, please contact us, we will try to help you
|
||||
finding a solution.
|
||||
|
||||
1 - Compiling
|
||||
2 - Using WeeChat
|
||||
3 - Development
|
||||
|
||||
1.1
|
||||
================================================================================
|
||||
Q: I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
|
||||
A: Curses GUI is built by default.
|
||||
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
|
||||
--enable-gtk to enable Gtk GUI
|
||||
--enable-qt to enable Qt QUI
|
||||
Type ./configure --help to see available options.
|
||||
WARNING: only Curses GUI is ok today. Other GUI are under development!
|
||||
|
||||
|
||||
1- Compiling
|
||||
1.2
|
||||
================================================================================
|
||||
Q: I can't compile WeeChat CVS.
|
||||
|
||||
1.1 I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
1.2 I can't compile WeeChat CVS.
|
||||
|
||||
2- Using WeeChat
|
||||
|
||||
2.1 Why using WeeChat ? X-Chat and Irssi are so good...
|
||||
2.2 I've launched WeeChat, but I'm lost, what can I do?
|
||||
2.3 How can I customize key bindings?
|
||||
2.4 How can I load Perl scripts?
|
||||
Are Perl scripts compatible with X-chat or/and Irssi ?
|
||||
2.5 How can I load Python scripts?
|
||||
2.6 How can I load Ruby scripts?
|
||||
|
||||
3- Development
|
||||
|
||||
3.1 How should I report bugs?
|
||||
3.2 How should I submit patches?
|
||||
3.3 How should I submit new feature request?
|
||||
3.4 Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows?
|
||||
3.5 I want to help WeeChat developers. What can I do?
|
||||
3.6 Can I give money or other things to WeeChat developers?
|
||||
A: Check that you have latest version of autoconf and automake.
|
||||
WeeChat has been developed with autoconf version 2.56 and automake
|
||||
version 1.7.
|
||||
You should have at least these versions in order to compile WeeChat CVS.
|
||||
If you can't or don't want to install these versions, you can download and
|
||||
install "devel package", a package built almost every day, based on CVS.
|
||||
Note that this package may not correspond exactly to CVS base.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 1- Compiling |
|
||||
\------------------------------------------------------------------------------/
|
||||
2.1
|
||||
================================================================================
|
||||
Q: Why using WeeChat ? X-Chat and Irssi are so good...
|
||||
|
||||
A: Because WeeChat is very light and has new features.
|
||||
Some new features:
|
||||
* many GUI (Curses, Gtk, Qt),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
This is the "geekest Irc client" ;)
|
||||
|
||||
|
||||
1.1 I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
2.2
|
||||
================================================================================
|
||||
Q: I've launched WeeChat, but I'm lost, what can I do?
|
||||
|
||||
Curses GUI is built by default.
|
||||
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
|
||||
--enable-gtk to enable gtk GUI
|
||||
--enable-qt to enable Qt QUI
|
||||
Type ./configure --help to see available options.
|
||||
WARNING: only Curses GUI is ok today. Other GUI are under development!
|
||||
A: For help you can type /help. For help about a command, type /help command.
|
||||
|
||||
|
||||
1.2 I can't compile WeeChat CVS.
|
||||
2.3
|
||||
================================================================================
|
||||
Q: How can I customize key bindings?
|
||||
|
||||
Check that you have latest version of autoconf and automake.
|
||||
WeeChat has been developed with autoconf version 2.56 and automake version 1.7.
|
||||
You should have at least these versions in order to compile WeeChat CVS.
|
||||
If you can't or don't want to install these versions, you can download and
|
||||
install "devel package", a package built almost every day, based on CVS.
|
||||
Note that this package may not correspond exactly to CVS base.
|
||||
A: Today you can't do that. This will be available in a future version.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 2- Using WeeChat |
|
||||
\------------------------------------------------------------------------------/
|
||||
2.4
|
||||
================================================================================
|
||||
Q: How can I load Perl scripts?
|
||||
Are Perl scripts compatible with X-chat or/and Irssi ?
|
||||
|
||||
A: You can use /perl command to load scripts
|
||||
(default path is ~/.weechat/perl).
|
||||
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
|
||||
when WeeChat is starting up.
|
||||
WeeChat perl scripts are compatible with X-Chat, not with Irssi, sorry ;)
|
||||
|
||||
|
||||
2.1 Why using WeeChat ? X-Chat and Irssi are so good...
|
||||
2.5
|
||||
================================================================================
|
||||
Q: How can I load Python scripts?
|
||||
|
||||
Because WeeChat is very light and has new features.
|
||||
Some new features:
|
||||
* many GUI (Curses, Gtk, Qt),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
This is the "geekest Irc client" ;)
|
||||
A: Today Python interface is not developed, so can't load any Python script.
|
||||
|
||||
|
||||
2.2 I've launched WeeChat, but I'm lost, what can I do?
|
||||
2.6
|
||||
================================================================================
|
||||
Q: How can I load Ruby scripts?
|
||||
|
||||
For help you can type /help. For help about a command, type /help command.
|
||||
A: Today Ruby interface is not developed, so can't load any Ruby script.
|
||||
|
||||
|
||||
2.3 How can I customize key bindings?
|
||||
3.1
|
||||
================================================================================
|
||||
Q: How should I report bugs?
|
||||
|
||||
Today you can't do that. This will be available in a future version.
|
||||
A: There is 3 ways to report bugs:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #weechat
|
||||
2. you can submit your bug at this url:
|
||||
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
|
||||
3. you can mail your problem, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
2.4 How can I load Perl scripts?
|
||||
Are Perl scripts compatible with X-chat or/and Irssi ?
|
||||
3.2
|
||||
================================================================================
|
||||
Q: How should I submit patches?
|
||||
|
||||
Yes, you can use /perl command to launch scripts
|
||||
(default path is ~/.weechat/perl).
|
||||
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
|
||||
when WeeChat is starting up.
|
||||
WeeChat perl scripts are compatible with X-Chat, not with Irssi, sorry ;)
|
||||
A: There is 3 ways to submit patches:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #weechat
|
||||
2. you can submit your patch at this url:
|
||||
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
|
||||
3. you can mail your patch, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
2.5 How can I load Python scripts?
|
||||
3.3
|
||||
================================================================================
|
||||
Q: How should I submit new feature request?
|
||||
|
||||
Today Python interface is not developed, so can't load any Python script.
|
||||
A: There is 2 ways to submit your feature request:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #weechat
|
||||
2. you can mail your feature request, look at support page for developer's
|
||||
mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
2.6 How can I load Ruby scripts?
|
||||
3.4
|
||||
================================================================================
|
||||
Q: Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
|
||||
|
||||
Today Ruby interface is not developed, so can't load any Ruby script.
|
||||
A: Yes. Future versions will be available for these OS.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 3- Development |
|
||||
\------------------------------------------------------------------------------/
|
||||
3.5
|
||||
================================================================================
|
||||
Q: I want to help WeeChat developers. What can I do?
|
||||
|
||||
A: There's many tasks to do (code, documentation, ...)
|
||||
Please contact us with IRC or mail, look at support page:
|
||||
http://weechat.flashtux.org/support.php
|
||||
|
||||
|
||||
3.1 How should I report bugs?
|
||||
3.6
|
||||
================================================================================
|
||||
Q: Can I give money or other things to WeeChat developers?
|
||||
|
||||
There is 3 ways to report bugs:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can submit your bug at this url:
|
||||
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
|
||||
3. you can mail your problem, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.2 How should I submit patches?
|
||||
|
||||
There is 3 ways to submit patches:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can submit your patch at this url:
|
||||
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
|
||||
3. you can mail your patch, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.3 How should I submit new feature request?
|
||||
|
||||
There is 2 ways to submit your feature request:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can mail your feature request, look at support page for developer's
|
||||
mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.4 Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
|
||||
|
||||
Yes. Future versions will be available for these OS.
|
||||
|
||||
|
||||
3.5 I want to help WeeChat developers. What can I do?
|
||||
|
||||
There's many tasks to do (code, documentation, ...)
|
||||
Please contact us with IRC or mail, look at support page:
|
||||
http://weechat.flashtux.org/support.php
|
||||
|
||||
|
||||
3.6 Can I give money or other things to WeeChat developers?
|
||||
|
||||
No.
|
||||
A: No.
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
WeeChat FAQ, 2004-05-31
|
||||
=======================
|
||||
|
||||
Public concerné :
|
||||
Tous les utilisateurs de WeeChat.
|
||||
|
||||
Avant de lire la suite ceci :
|
||||
la liste suivante de questions/réponses n'est *pas* exhaustive.
|
||||
Il est donc possible que vous ne trouviez pas de question/réponse correspondant
|
||||
à votre problème.
|
||||
Lisez les quand même SVP, elles peuvent vous aider à corriger votre problème.
|
||||
Et même si votre problème est mentionné ci-dessous, il est possible que la
|
||||
réponse ne vous aide pas à corriger le problème. Dans ce cas, contactez-nous,
|
||||
nous essaierons de vous aider Ă trouver une solution.
|
||||
|
||||
1 - Compilation
|
||||
2 - Utilisation de WeeChat
|
||||
3 - Développement
|
||||
|
||||
1.1
|
||||
================================================================================
|
||||
Q: J'ai entendu parler de plusieurs interfaces pour WeeChat.
|
||||
Comment puis-je les compiler/utiliser ?
|
||||
|
||||
R: L'interface Curses est construite par défaut.
|
||||
Pour construire l'interface Gtk ou Qt, vous devez spécifier des options
|
||||
pour le script ./configure :
|
||||
--enable-gtk pour activer l'interface Gtk
|
||||
--enable-qt pour activer l'interface Qt
|
||||
Tapez ./configure --help pour voir les options disponibles.
|
||||
ATTENTION : seule l'interface Curses est ok aujourd'hui.
|
||||
Les autres interfaces sont en développement.
|
||||
|
||||
|
||||
1.2
|
||||
================================================================================
|
||||
Q: Je ne peux pas compiler le CVS WeeChat.
|
||||
|
||||
R: Vérifiez que vous avez bien la dernière version d'autoconf et automake.
|
||||
WeeChat a été développé avec autoconf version 2.56 et automake
|
||||
version 1.7.
|
||||
Vous devez avoir au moins ces versions pour compiler le CVS WeeChat.
|
||||
Si vous n'avez pas ou ne souhaitez pas installer ces versions, vous
|
||||
pouvez télécharger et installer le paquet "devel", un paquet construit
|
||||
quasiment tous les jours, basé sur le CVS.
|
||||
Notez que ce paquet peut ne pas correspondre exactement Ă la base CVS.
|
||||
|
||||
|
||||
2.1
|
||||
================================================================================
|
||||
Q: Pourquoi utiliser WeeChat ? X-Chat et Irssi sont si bien...
|
||||
|
||||
R: Parce que WeeChat est très léger et a de nouvelles fonctionnalités.
|
||||
Quelques nouvelles fonctionnalités :
|
||||
* plusieurs interfaces (Curses, Gtk, Qt),
|
||||
* extensible par des scripts (Perl, Python, Ruby),
|
||||
* développé à partir de zéro (non basé sur un quelconque client IRC)
|
||||
* multi-platformes
|
||||
* 100% GPL et libre
|
||||
C'est le client le plus "geek" ;)
|
||||
|
||||
|
||||
2.2
|
||||
================================================================================
|
||||
Q: J'ai lancé WeeChat, mais je suis perdu, que puis-je faire ?
|
||||
|
||||
R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
|
||||
tapez /help commande.
|
||||
|
||||
|
||||
2.3
|
||||
================================================================================
|
||||
Q: Comment puis-je configurer les raccourcis clavier ?
|
||||
|
||||
R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
|
||||
version future.
|
||||
|
||||
|
||||
2.4
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Perl ?
|
||||
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
|
||||
|
||||
R: La commande /perl permet de charger les scripts Perl
|
||||
(le chemin par défaut est ~/.weechat/perl).
|
||||
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
|
||||
chargés par WeeChat lorsqu'il démarre.
|
||||
Les scripts Perl WeeChat sont compatibles avec X-Chat, pas Irssi,
|
||||
désolé ;)
|
||||
|
||||
|
||||
2.5
|
||||
================================================================================
|
||||
Q: Comment puis-je charger les scripts Python ?
|
||||
|
||||
R: Aujourd'hui l'interface Python n'est pas déceloppée.
|
||||
Vous ne pouvez donc charger aucun script Python.
|
||||
|
||||
|
||||
2.6
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Ruby ?
|
||||
|
||||
R: Aujourd'hui l'interface Ruby n'est pas développée.
|
||||
Vous ne pouvez donc charger aucun script Ruby.
|
||||
|
||||
|
||||
3.1
|
||||
================================================================================
|
||||
Q: Comment dois-je reporter les bugs ?
|
||||
|
||||
R: Il y a 3 manières de reporter les bugs :
|
||||
1. vous pouvez nous joindre sur IRC: irc.freenode.net, canal #weechat
|
||||
2. vous pouvez soumettre votre bug Ă cette adresse :
|
||||
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
|
||||
3. vous pouvez envoyer votre problem par mail, consultez la page
|
||||
support pour les mails des développeurs :
|
||||
http://weechat.flashtux.org/support.php
|
||||
(vous pouvez souscrire et envoyer Ă la liste de diffusion
|
||||
"support")
|
||||
|
||||
|
||||
3.2
|
||||
================================================================================
|
||||
Q: Comment dois-je soumettre les patches ?
|
||||
|
||||
R: Il y a 3 manières de soumettre les patches :
|
||||
1. vous pouvez nous joindre sur IRC: irc.freenode.net, canal #weechat
|
||||
2. vous pouvez soumettre votre patch Ă cette adresse :
|
||||
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
|
||||
3. vous pouvez envoyer votre patch par mail, consultez la page
|
||||
support pour les mails des développeurs :
|
||||
http://weechat.flashtux.org/support.php
|
||||
(vous pouvez souscrire et envoyer Ă la liste de diffusion
|
||||
"support")
|
||||
|
||||
|
||||
3.3
|
||||
================================================================================
|
||||
Q: Comment dois-je soumettre les demandes de nouvelles fonctionnalités ?
|
||||
|
||||
R: Il y a 2 manières :
|
||||
1. vous pouvez nous joindre sur IRC: irc.freenode.net, channel #weechat
|
||||
2. vous pouvez envoyer un mail, consultez la page support pour les
|
||||
mails des développeurs :
|
||||
http://weechat.flashtux.org/support.php
|
||||
(vous pouvez souscrire et envoyer Ă la liste de diffusion
|
||||
"support")
|
||||
|
||||
|
||||
3.4
|
||||
================================================================================
|
||||
Q: WeeChat sera-t-il porté sur *BSD, QNX, MacOS X, Microsoft Windows ?
|
||||
|
||||
R: Oui. Les futures versions seront disponibles pour ces OS.
|
||||
|
||||
|
||||
3.5
|
||||
================================================================================
|
||||
Q: Je souhaiterai aider les développeurs WeeChat. Que puis-je faire ?
|
||||
|
||||
R: Il y a plusieurs choses Ă faire (code, documentation, ...)
|
||||
Merci de prendre contact avec nous par IRC ou mail, consultez la page
|
||||
support :
|
||||
http://weechat.flashtux.org/support.php
|
||||
|
||||
|
||||
3.6
|
||||
================================================================================
|
||||
Q: Puis-je donner de l'argent ou d'autres choses aux développeurs WeeChat ?
|
||||
|
||||
R: Non.
|
||||
@@ -2,9 +2,11 @@ WeeChat - Installation instructions
|
||||
===================================
|
||||
|
||||
1) Run './configure'
|
||||
options: --disable-curses : do not build Curses interface
|
||||
options: --enble-perl : enable Perl scripts
|
||||
--disable-curses : do not build Curses interface
|
||||
--enable-gtk : build Gtk+ interface (under development!)
|
||||
--enable-qt : build Qt interface (not developed!)
|
||||
--with-debug : 1 for debug compilation, 2 for debug messages
|
||||
|
||||
2) Run 'make'
|
||||
|
||||
@@ -12,4 +14,4 @@ WeeChat - Installation instructions
|
||||
|
||||
4) Enjoy ! :-)
|
||||
|
||||
See AUTHORS for any support, feel free to contact us for any problem ;)
|
||||
See AUTHORS for support, feel free to contact us for any problem ;)
|
||||
|
||||
+8
-2
@@ -17,6 +17,12 @@
|
||||
|
||||
SUBDIRS = po intl src
|
||||
|
||||
EXTRA_DIST = weechat.1 BUGS FAQ
|
||||
EXTRA_DIST = weechat-curses.1 BUGS FAQ FAQ.fr \
|
||||
debian/changelog debian/control \
|
||||
debian/copyright debian/files \
|
||||
debian/rules debian/weechat-common.docs \
|
||||
debian/weechat-common.install debian/weechat-curses.dirs \
|
||||
debian/weechat-curses.install debian/weechat-gtk.dirs \
|
||||
debian/weechat-gtk.install
|
||||
|
||||
man_MANS = weechat.1
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2004-10-30
|
||||
|
||||
WeeChat 0.0.8 released.
|
||||
|
||||
* FlashCode, 2004-08-08
|
||||
|
||||
WeeChat 0.0.7 released.
|
||||
|
||||
* FlashCode, 2004-06-05
|
||||
|
||||
WeeChat 0.0.6 released.
|
||||
|
||||
* FlashCode, 2004-02-07
|
||||
|
||||
WeeChat 0.0.5 released.
|
||||
|
||||
* FlashCode, 2004-01-01
|
||||
|
||||
WeeChat 0.0.4 released.
|
||||
|
||||
@@ -24,7 +24,7 @@ Copyright
|
||||
|
||||
WeeChat (c) Copyright 2004
|
||||
by: FlashCode <flashcode@flashtux.org>
|
||||
Xahlexx <xahlex@tuxisland.org>
|
||||
Xahlexx <xahlex@weeland.org>
|
||||
Bounga <bounga@altern.org>
|
||||
(see AUTHORS file if you want to contact authors)
|
||||
|
||||
@@ -46,6 +46,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
---
|
||||
(1) only curses interface is available today
|
||||
(2) plugin interfaces are not yet developed
|
||||
(1) only Curses interface is available today
|
||||
(2) only Perl interface is available today
|
||||
(3) only GNU/Linux version is available today
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2004-01-01
|
||||
TODO - 2004-10-30
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -10,34 +10,36 @@ Legend:
|
||||
? is this really necessary?
|
||||
|
||||
|
||||
v0.0.4:
|
||||
v0.0.8:
|
||||
------
|
||||
|
||||
* General:
|
||||
# debug messages can be enabled via ./configure --enbale-debug option
|
||||
- Windows version
|
||||
+ Solaris version
|
||||
|
||||
* IRC protocol:
|
||||
+ "/dcc" command (for chat and sending/receiving files)
|
||||
|
||||
* Interface:
|
||||
# log chats to file
|
||||
# "/buffer" command, buffers ordered by number, auto-jump to active
|
||||
buffers (alt-a), jump to buffers by number (alt-number)
|
||||
+ "/window" command, split terminal in multiple windows
|
||||
(horizontally/vertically)
|
||||
+ internationalization (traduce WeeChat in many languages)
|
||||
# intercept Ctrl-C
|
||||
# when private window is created (another user is talking), WeeChat does not
|
||||
switch to this window
|
||||
# highlight when our nick is written in a channel/private window
|
||||
|
||||
* Plugins:
|
||||
# Perl plugin
|
||||
# "/perl load" and "/perl unload" commands to (un)load Perl scripts
|
||||
# auto-load Perl scripts at startup
|
||||
* Configuration:
|
||||
+ add missing options for config file
|
||||
- add key bindings to config file
|
||||
|
||||
|
||||
Future versions:
|
||||
---------------
|
||||
|
||||
* General:
|
||||
- Windows version
|
||||
- *BSD version
|
||||
|
||||
* IRC protocol:
|
||||
+ "/mode" command: change the user/channels modes
|
||||
- "/dcc" command (for chat and sending/receiving files)
|
||||
- complete "/list" command: add regexp search, display only channels that
|
||||
match regexp
|
||||
- "/ignore" and "/unignore" commands: hide all that is write by a given
|
||||
@@ -48,9 +50,6 @@ Future versions:
|
||||
nick/host connect to the given irc network
|
||||
|
||||
* WeeChat commands:
|
||||
+ "/set" command: allow the user to set the WeeChat variables
|
||||
under WeeChat without editing the config file (colours, time
|
||||
format, etc)
|
||||
- "/reload" command: reload the WeeChat's config file
|
||||
- "/highlight" command: highlight a given word when it appears on
|
||||
channels/privates
|
||||
@@ -60,19 +59,16 @@ Future versions:
|
||||
and show us the output on the current window. An option to exec
|
||||
like -o could send the output to the server, on the current
|
||||
channel/private
|
||||
- "/last": command to look for text in previous messages
|
||||
|
||||
* Interface:
|
||||
+ Gtk GUI
|
||||
- display current channel modes (example : #weechat(+nt))
|
||||
- color for nicks (except own nick) when nick colors are disabled
|
||||
- interpret special chars in messages (color & bold for example)
|
||||
- many channel windows in one window/term (window split)
|
||||
- add lag indicator
|
||||
- forget some old lines that were displayed long time ago (now all is saved,
|
||||
if WeeChat is running for long time, a lot of memory is used!)
|
||||
- improve completion (for example complete command parameters when possible)
|
||||
- understand incomplete commands if unambigous (for example: /he for /help is ok)
|
||||
- add clock (in status bar?)
|
||||
- log chats to file
|
||||
- tab key with empty command line should switch to next window (like F7)
|
||||
? Qt GUI
|
||||
|
||||
* TCP/IP communication:
|
||||
@@ -81,12 +77,6 @@ Future versions:
|
||||
- SSL support
|
||||
- IPv6 protocol implementation
|
||||
|
||||
* Configuration:
|
||||
- add missing options for config file
|
||||
- add key bindings to config file
|
||||
- load config file after GUI (so init values by default (colors, ...) before
|
||||
loading config)
|
||||
|
||||
* Plugins:
|
||||
- Python plugin
|
||||
- "/python load" and "/python unload" commands to (un)load Python scripts
|
||||
|
||||
+22
-8
@@ -19,10 +19,10 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.56)
|
||||
AC_INIT(WeeChat, 0.0.4, flashcode@flashtux.org)
|
||||
AC_INIT(WeeChat, 0.0.8, flashcode@flashtux.org)
|
||||
AC_CONFIG_SRCDIR([src/common/weechat.c])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE([weechat], [0.0.4])
|
||||
AM_INIT_AUTOMAKE([weechat], [0.0.8])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
@@ -38,7 +38,7 @@ AC_CHECK_LIB([curses], [initscr], LIBCURSES_FOUND=1, LIBCURSES_FOUND=0)
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
|
||||
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_TIME
|
||||
@@ -59,7 +59,7 @@ AC_ARG_ENABLE(curses, [ --disable-curses Turn off Curses interface (defa
|
||||
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
|
||||
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
|
||||
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging messages (default=no)],enable_debug=yes,enable_debug=no)
|
||||
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
|
||||
|
||||
enable_plugins="no"
|
||||
enable_python="no"
|
||||
@@ -108,11 +108,15 @@ fi
|
||||
|
||||
AC_SUBST(PLUGINS_LIBS)
|
||||
|
||||
if test "x$enable_debug" = "xyes" ; then
|
||||
AC_DEFINE(DEBUG)
|
||||
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
|
||||
CFLAGS="-Wall -W -pipe -O2 -g"
|
||||
else
|
||||
CFLAGS="-Wall -W -pipe -O2"
|
||||
fi
|
||||
|
||||
CFLAGS="-Wall -W -pipe -O2"
|
||||
if test "x$debug" = "x2" ; then
|
||||
AC_DEFINE(DEBUG)
|
||||
fi
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
src/Makefile
|
||||
@@ -145,6 +149,15 @@ if test "x$listgui" = "x" ; then
|
||||
AC_MSG_ERROR([No interface specified... Please specify at least Curses, Gtk or Qt.])
|
||||
fi
|
||||
|
||||
msg_debug_compiler="No"
|
||||
msg_debug_verbose="No"
|
||||
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
|
||||
msg_debug_compiler="Yes"
|
||||
fi
|
||||
if test "x$debug" = "x2" ; then
|
||||
msg_debug_verbose="Yes"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo Interfaces.................... :$listgui
|
||||
echo
|
||||
@@ -153,7 +166,8 @@ echo Build with Perl support....... : $enable_perl
|
||||
echo Build with Python support..... : $enable_python
|
||||
echo Build with Ruby support....... : $enable_ruby
|
||||
echo
|
||||
echo Print debugging messages...... : $enable_debug
|
||||
echo Compile with debug info....... : $msg_debug_compiler
|
||||
echo Print debugging messages...... : $msg_debug_verbose
|
||||
echo
|
||||
eval eval echo WeeChat will be installed in $bindir.
|
||||
echo
|
||||
|
||||
Vendored
+24
@@ -1,3 +1,27 @@
|
||||
weechat (0.0.8-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.8, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 30 Oct 2004 11:40:00 +0200
|
||||
|
||||
weechat (0.0.7-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.7, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 08 Aug 2004 21:00:00 +0200
|
||||
|
||||
weechat (0.0.6-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.6, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 05 Jun 2004 11:30:00 +0200
|
||||
|
||||
weechat (0.0.5-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.5, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 07 Feb 2004 20:30:00 +0200
|
||||
|
||||
weechat (0.0.4-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.4, see ChangeLog for detail.
|
||||
|
||||
Vendored
+1
-9
@@ -2,7 +2,7 @@ Source: weechat
|
||||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: FlashCode <flashcode@flashtux.org>
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5 (>= 5.2.20020112a-7)
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5 (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
|
||||
Standards-Version: 3.5.8
|
||||
|
||||
Package: weechat
|
||||
@@ -21,14 +21,6 @@ Description: Fast, light and extensible IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-gtk
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
|
||||
Description: Fast, light and extensible IRC client
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-common
|
||||
Architecture: all
|
||||
Replaces: weechat
|
||||
|
||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
||||
This package was debianized by FlashCode <flashcode@flashtux.org> on
|
||||
Thu, 01 Jan 2004 13:00:00 +0200.
|
||||
Sat, 30 Oct 2004 11:40:00 +0200.
|
||||
|
||||
It was downloaded from http://weechat.flashtux.org/download
|
||||
|
||||
Upstream Author(s): FlashCode <flashcode@flashtux.org>
|
||||
Upstream Author: FlashCode <flashcode@flashtux.org>
|
||||
|
||||
Copyright:
|
||||
|
||||
|
||||
Vendored
+7
-8
@@ -1,9 +1,6 @@
|
||||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
export DH_VERBOSE=1
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -O0
|
||||
@@ -17,7 +14,7 @@ endif
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
./configure --prefix=/usr --sysconfdir=/etc --enable-gtk
|
||||
./configure --prefix=/usr --sysconfdir=/etc --enable-perl
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
@@ -43,17 +40,16 @@ install: build
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/weechat
|
||||
dh_install --sourcedir=debian/weechat
|
||||
install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
#install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
dh_testdir -pweechat-common
|
||||
dh_testroot -pweechat-common
|
||||
dh_installchangelogs -pweechat-common
|
||||
dh_installchangelogs ChangeLog -pweechat-common
|
||||
dh_installdocs -pweechat-common
|
||||
dh_installexamples -pweechat-common
|
||||
dh_installman weechat.1 -pweechat-common
|
||||
dh_compress -pweechat-common
|
||||
dh_fixperms -pweechat-common
|
||||
dh_installdeb -pweechat-common
|
||||
@@ -66,6 +62,9 @@ binary-indep: build install
|
||||
binary-arch: build install
|
||||
dh_testdir -a
|
||||
dh_testroot -a
|
||||
dh_installchangelogs -a
|
||||
dh_installdocs -a
|
||||
dh_installman weechat-curses.1 -pweechat-curses
|
||||
dh_link -a
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
|
||||
Vendored
+1
-3
@@ -1,9 +1,7 @@
|
||||
AUTHORS
|
||||
BUGS
|
||||
ChangeLog
|
||||
COPYING
|
||||
FAQ
|
||||
INSTALL
|
||||
FAQ.fr
|
||||
NEWS
|
||||
README
|
||||
TODO
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
usr/share/locale
|
||||
+427
-21
@@ -6,14 +6,21 @@
|
||||
|
||||
@c WeeChat documentation (english version)
|
||||
@c
|
||||
@c Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
@c
|
||||
@c Permission is granted to copy, distribute and/or modify this document
|
||||
@c under the terms of the GNU Free Documentation License, Version 1.2
|
||||
@c or any later version published by the Free Software Foundation;
|
||||
@c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
@c A copy of the license is included in the section entitled "GNU
|
||||
@c Free Documentation License".
|
||||
@c This manual is free software; you can redistribute it and/or modify
|
||||
@c it under the terms of the GNU General Public License as published by
|
||||
@c the Free Software Foundation; either version 2 of the License, or
|
||||
@c (at your option) any later version.
|
||||
@c
|
||||
@c This manual is distributed in the hope that it will be useful,
|
||||
@c but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
@c GNU General Public License for more details.
|
||||
@c
|
||||
@c You should have received a copy of the GNU General Public License
|
||||
@c along with this program; if not, write to the Free Software
|
||||
@c Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
@c pdf : texi2pdf weechat_doc_en.texi
|
||||
@c html: makeinfo --html --no-split --number-sections weechat_doc_en.texi
|
||||
@@ -28,7 +35,7 @@
|
||||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.0.4 - November, 23 2003
|
||||
@subtitle Documentation for WeeChat v0.0.8-pre2 - October, 03 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -41,7 +48,7 @@ This manual documents WeeChat IRC client, it is part of WeeChat.@*
|
||||
Latest version of this document can be found on this page:@*
|
||||
@uref{http://weechat.flashtux.org/doc.php?lang=en}@*
|
||||
@*
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
This document may be used under the terms the GNU General Public License
|
||||
@@ -149,7 +156,7 @@ Mandrake/Redhat (or any RPM compatible distribution)@*
|
||||
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
To install: see Gentoo documentation
|
||||
To install: @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (not available!)
|
||||
@item
|
||||
@@ -171,7 +178,7 @@ Nota: to build only some interfaces, you can give parameters
|
||||
to ./configure, type @kbd{./configure --help} for help about options.@*
|
||||
|
||||
Then get root privileges and install WeeChat:@*
|
||||
@kbd{su -}@*
|
||||
@kbd{su}@*
|
||||
(enter root password)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@@ -198,17 +205,20 @@ Then follow instructions for source package - @xref{Source package}.
|
||||
@chapter Usage
|
||||
|
||||
@menu
|
||||
* Run WeeChat::
|
||||
* Run WeeChat::
|
||||
* Config file::
|
||||
* Key bindings::
|
||||
* WeeChat commands::
|
||||
@end menu
|
||||
|
||||
@node Run WeeChat, Key bindings, Usage, Usage
|
||||
@node Run WeeChat, Config file, Usage, Usage
|
||||
@section Run WeeChat
|
||||
|
||||
@subsection Command line parameters
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Display config file help (list of options)@*
|
||||
@item -h, --help
|
||||
Display help screen@*
|
||||
@item -l, --license
|
||||
@@ -220,7 +230,7 @@ Display WeeChat version@*
|
||||
@subsection Run WeeChat
|
||||
|
||||
Just issue this command to run WeeChat:@*
|
||||
@kbd{weechat}@*
|
||||
@kbd{weechat-curses} (for Curses front-end)@*
|
||||
or @kbd{weechat-gtk} (for Gtk front-end)@*
|
||||
or @kbd{weechat-qt} (for Qt front-end)@*
|
||||
|
||||
@@ -231,7 +241,327 @@ The default configuration file is: ~/.weechat/weechat.rc@*
|
||||
You can edit this file at your convenience to configure WeeChat, or you can
|
||||
set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
|
||||
|
||||
@node Key bindings, WeeChat commands, Run WeeChat, Usage
|
||||
@node Config file, Key bindings, Run WeeChat, Usage
|
||||
@section Config file
|
||||
|
||||
Here is a list of all options for config file:@*
|
||||
|
||||
@table @kbd
|
||||
@item look_set_title
|
||||
Set title for window (terminal for Curses GUI) with name & version@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_startup_logo
|
||||
Display WeeChat logo at startup@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_startup_version
|
||||
Display WeeChat version at startup@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_weechat_slogan
|
||||
WeeChat slogan (if empty, slogan is not used)@*
|
||||
Type: string (any string), default value: 'the geekest IRC client!'@*
|
||||
@item look_color_nicks
|
||||
Display nick names with different colors@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_color_actions
|
||||
Display actions with different colors@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_remove_colors_from_msgs
|
||||
Remove colors from incoming messages@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_nicklist
|
||||
Display nicklist window (for channel windows)@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_nicklist_position
|
||||
Nicklist position (top, left, right (default), bottom)@*
|
||||
Type: string (values: 'left', 'right', 'top', 'bottom'), default value: 'right'@*
|
||||
@item look_nicklist_min_size
|
||||
Min size for nicklist (width or height, depending on look_nicklist_position (0 = no min size))@*
|
||||
Type: integer (values: between 0 and 100), default value: 0@*
|
||||
@item look_nicklist_max_size
|
||||
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))@*
|
||||
Type: integer (values: between 0 and 100), default value: 0@*
|
||||
@item look_no_nickname
|
||||
Text to display instead of nick when not connected@*
|
||||
Type: string (any string), default value: '-cmd-'@*
|
||||
@item look_nickmode
|
||||
Display nick mode ((half)op/voice) before each nick@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_nickmode_empty
|
||||
Display space if nick mode is not (half)op/voice@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item look_nick_completor
|
||||
The string inserted after nick completion@*
|
||||
Type: string (any string), default value: ':'@*
|
||||
@item look_display_away
|
||||
Display message to all channels when (un)marking as away@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar
|
||||
Enable info bar@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Timestamp for time in infobar@*
|
||||
Type: string (any string), default value: '%B, %A %d %G - %H:%M'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Delay (in seconds) for highlight messages in infobar (0 = disable highlight notifications in infobar)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 7@*
|
||||
@item col_title
|
||||
Color for title bar@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_title_bg
|
||||
Background for title bar@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_chat
|
||||
Color for chat text@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_chat_time
|
||||
Color for time in chat window@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_chat_time_sep
|
||||
Color for time separator (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'brown'@*
|
||||
@item col_chat_prefix1
|
||||
Color for 1st and 3rd char of prefix@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
|
||||
@item col_chat_prefix2
|
||||
Color for middle char of prefix@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_chat_nick
|
||||
Color for nicks in actions (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
|
||||
@item col_chat_host
|
||||
Color for hostnames (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'cyan'@*
|
||||
@item col_chat_channel
|
||||
Color for channel names in actions (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_chat_dark
|
||||
Color for dark separators (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'green'@*
|
||||
@item col_chat_highlight
|
||||
Color for highlighted nick (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_chat_bg
|
||||
Background for chat window@*
|
||||
Type: color (Curses or Gtk color), default value: 'default'@*
|
||||
@item col_status
|
||||
Color for status bar@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_status_delimiters
|
||||
Color for status bar delimiters@*
|
||||
Type: color (Curses or Gtk color), default value: 'cyan'@*
|
||||
@item col_status_data_msg
|
||||
Color for window with new messages (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_status_highlight
|
||||
Color for window with highlight (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
|
||||
@item col_status_data_other
|
||||
Color for window with new data (not messages) (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_status_more
|
||||
Color for window with new data (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_status_bg
|
||||
Background for status window@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar
|
||||
Color for info bar text@*
|
||||
Type: color (Curses or Gtk color), default value: 'black'@*
|
||||
@item col_infobar_highlight
|
||||
Color for info bar highlight notification@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_infobar_bg
|
||||
Background for info bar window@*
|
||||
Type: color (Curses or Gtk color), default value: 'cyan'@*
|
||||
@item col_input
|
||||
Color for input text@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_input_channel
|
||||
Color for input text (channel name)@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_input_nick
|
||||
Color for input text (nick name)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
|
||||
@item col_input_bg
|
||||
Background for input window@*
|
||||
Type: color (Curses or Gtk color), default value: 'default'@*
|
||||
@item col_nick
|
||||
Color for nicknames@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_nick_op
|
||||
Color for operator symbol@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
|
||||
@item col_nick_halfop
|
||||
Color for half-operator symbol@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
|
||||
@item col_nick_voice
|
||||
Color for voice symbol@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_nick_sep
|
||||
Color for nick separator@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_nick_self
|
||||
Color for local nick@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_nick_private
|
||||
Color for other nick in private window@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_nick_bg
|
||||
Background for nicknames@*
|
||||
Type: color (Curses or Gtk color), default value: 'default'@*
|
||||
@item col_chat_dcc_selected
|
||||
Color for selected DCC (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_dcc_waiting
|
||||
Color for "waiting" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_dcc_connecting
|
||||
Color for "connecting" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_dcc_active
|
||||
Color for "active" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightblue'@*
|
||||
@item col_dcc_done
|
||||
Color for "done" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
|
||||
@item col_dcc_failed
|
||||
Color for "failed" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightred'@*
|
||||
@item col_dcc_aborted
|
||||
Color for "aborted" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightred'@*
|
||||
@item history_max_lines
|
||||
Maximum number of lines in history for one server/channel/private window (0 = unlimited)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 4096@*
|
||||
@item history_max_commands
|
||||
Maximum number of user commands in history (0 = unlimited)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 100@*
|
||||
@item log_auto_server
|
||||
Automatically log server messages@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item log_auto_channel
|
||||
Automatically log channel chats@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item log_auto_private
|
||||
Automatically log private chats@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item log_path
|
||||
Path for WeeChat log files@*
|
||||
Type: string (any string), default value: '~/.weechat/logs/'@*
|
||||
@item log_timestamp
|
||||
Timestamp for log (see man strftime for date/time specifiers)@*
|
||||
Type: string (any string), default value: '%Y %b %d %H:%M:%S'@*
|
||||
@item dcc_auto_accept_files
|
||||
Automatically accept incoming dcc files@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item dcc_auto_accept_chats
|
||||
Automatically accept dcc chats (use carefully!)@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item dcc_timeout
|
||||
Timeout for dcc request (in seconds)@*
|
||||
Type: integer (values: between 1 and 2147483647), default value: 300@*
|
||||
@item dcc_blocksize
|
||||
Block size for dcc packets in bytes (default: 1024)@*
|
||||
Type: integer (values: between 1024 and 102400), default value: 1024@*
|
||||
@item dcc_download_path
|
||||
Path for writing incoming files with dcc (default: user home)@*
|
||||
Type: string (any string), default value: '~'@*
|
||||
@item dcc_upload_path
|
||||
Path for reading files when sending thru dcc (when no path is specified)@*
|
||||
Type: string (any string), default value: '~'@*
|
||||
@item dcc_auto_rename
|
||||
Rename incoming files if already exists (add '.1', '.2', ...)@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item dcc_auto_resume
|
||||
Automatically resume dcc transfer if connection with remote host is loosed@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item proxy_use
|
||||
Use a proxy server to connect to irc server@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item proxy_address
|
||||
Proxy server address (IP or hostname)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item proxy_port
|
||||
Port for connecting to proxy server@*
|
||||
Type: integer (values: between 0 and 65535), default value: 1080@*
|
||||
@item proxy_password
|
||||
Password for proxy server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_name
|
||||
Name associated to IRC server (for display only)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_autoconnect
|
||||
Automatically connect to server when WeeChat is starting@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item server_address
|
||||
IP address or hostname of IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_port
|
||||
Port for connecting to server@*
|
||||
Type: integer (values: between 0 and 65535), default value: 6667@*
|
||||
@item server_password
|
||||
Password for IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_nick1
|
||||
Nickname to use on IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_nick2
|
||||
Alternate nickname to use on IRC server (if nickname is already used)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_nick3
|
||||
2nd alternate nickname to use on IRC server (if alternate nickname is already used)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_username
|
||||
User name to use on IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_realname
|
||||
Real name to use on IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_command
|
||||
First command to run when connected to server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_autojoin
|
||||
Comma separated list of channels to join when connected to server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@end table
|
||||
|
||||
Colors for Curses GUI are:@*
|
||||
@itemize @minus
|
||||
@item
|
||||
@kbd{default}: default color (transparent for background)
|
||||
@item
|
||||
@kbd{black}: black
|
||||
@item
|
||||
@kbd{red}: dark red
|
||||
@item
|
||||
@kbd{lightred}: light red
|
||||
@item
|
||||
@kbd{green}: dark green
|
||||
@item
|
||||
@kbd{lightgreen}: light green
|
||||
@item
|
||||
@kbd{brown}: brown
|
||||
@item
|
||||
@kbd{yellow}: yellow
|
||||
@item
|
||||
@kbd{blue}: dark blue
|
||||
@item
|
||||
@kbd{lightblue}: light blue
|
||||
@item
|
||||
@kbd{magenta}: dark magenta
|
||||
@item
|
||||
@kbd{lightmagenta}: light magenta
|
||||
@item
|
||||
@kbd{cyan}: dark cyan
|
||||
@item
|
||||
@kbd{lightcyan}: light cyan
|
||||
@item
|
||||
@kbd{gray}: gray
|
||||
@item
|
||||
@kbd{white}: white
|
||||
@end itemize
|
||||
|
||||
@node Key bindings, WeeChat commands, Config file, Usage
|
||||
@section Key bindings
|
||||
|
||||
@table @kbd
|
||||
@@ -263,14 +593,32 @@ Execute command or send message@*
|
||||
Call again last commands/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Show window history@*
|
||||
Show buffer history@*
|
||||
@*
|
||||
@item F6 / F7
|
||||
Switch to previous / next window@*
|
||||
Switch to previous / next buffer@*
|
||||
@*
|
||||
@item F8
|
||||
Switch to next window@*
|
||||
@*
|
||||
@item F10
|
||||
Remove last infobar message@*
|
||||
@*
|
||||
@item Alt + left arrow / Alt + right arrow
|
||||
Same as F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Switch to next buffer with activity (with priority: highlight, message, other)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Display current DCC@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Clear hotlist (activity notification on other buffers)@*
|
||||
@*
|
||||
@item Alt + digit (1-9)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node WeeChat commands, , Key bindings, Usage
|
||||
@@ -345,6 +693,39 @@ Print message in current window (channel or server).@*
|
||||
@code{IRC::print ("message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_with_channel ( channel, [server,] message );}@*
|
||||
@*
|
||||
Print message in a channel.@*
|
||||
|
||||
@emph{Arguments:}
|
||||
@itemize @minus
|
||||
@item @option{channel}: name of channel
|
||||
@item @option{server}: internal name of server
|
||||
@item @option{message}: message to display
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Examples:}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_infobar ( delay, message );}@*
|
||||
@*
|
||||
Print message in infobar.@*
|
||||
|
||||
@emph{Arguments:}
|
||||
@itemize @minus
|
||||
@item @option{delay}: after this delay (in seconds), message will be erased
|
||||
(if 0, message will not be erased).
|
||||
@item @option{message}: message to display
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Example:}@*
|
||||
@code{IRC::print_infobar (5, "message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::add_message_handler ( name, function );}@*
|
||||
@*
|
||||
@@ -364,7 +745,8 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
|
||||
@code{IRC::add_message_handler ("privmsg", my_function);}@*
|
||||
@code{sub my_function}@*
|
||||
@code{@{ }@*
|
||||
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@*
|
||||
@code{@ @ @ @ IRC::print ("server=$_[0]\n");}@*
|
||||
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
|
||||
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
|
||||
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
|
||||
@code{@} }@*
|
||||
@@ -389,11 +771,35 @@ available until your Perl script will be unloaded.
|
||||
@code{IRC::add_command_handler ("command", my_command);}@*
|
||||
@code{sub my_command}@*
|
||||
@code{@{ }@*
|
||||
@code{@ @ @ @ IRC::print("Arguments: ".@@_[0]);}@*
|
||||
@code{@ @ @ @ IRC::print("Server: $_[0], arguments: $_[1]\n");}@*
|
||||
@code{@ @ @ @ return 0;}@*
|
||||
@code{@} }@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::get_info ( [server,] name );}@*
|
||||
@*
|
||||
Get various info about WeeChat, server or user.@*
|
||||
|
||||
@emph{Arguments:}
|
||||
@itemize @minus
|
||||
@item @option{server}: internal name of server
|
||||
@item @option{name}: name of info to retrieve:
|
||||
@itemize @minus
|
||||
@item @option{0 or version}: get WeeChat version
|
||||
@item @option{1 or nick}: get nickname
|
||||
@item @option{2 or channel}: get channel name
|
||||
@item @option{3 or server}: get server name
|
||||
@item @option{4 or weechatdir}: get WeeChat home directory
|
||||
@item @option{5 or away}: get away flag for server
|
||||
@end itemize
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Examples:}@*
|
||||
@code{$version = get_info("version");}@*
|
||||
@code{$nick = get_info("freenode", "nick");}@*
|
||||
@*
|
||||
|
||||
@end itemize
|
||||
|
||||
@node Python scripts, Ruby scripts, Perl scripts, Extensions
|
||||
@@ -466,7 +872,7 @@ Support with IRC:@*
|
||||
- server: @b{irc.freenode.net}@*
|
||||
- channel: @b{#weechat}@*@*
|
||||
@item
|
||||
WeeChat forum: soon!@*@*
|
||||
WeeChat forum: @uref{http://forums.flashtux.org}@*@*
|
||||
@item
|
||||
Support with mailing list:@*
|
||||
- to subscribe/unsubscribe:@*@uref{http://mail.nongnu.org/mailman/listinfo/weechat-support}.@*
|
||||
@@ -486,7 +892,7 @@ Look for WeeChat support page for detail:@*
|
||||
|
||||
This manual documents WeeChat IRC client, it is part of WeeChat.@*
|
||||
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
This document may be used under the terms the GNU General Public License
|
||||
|
||||
+428
-22
@@ -6,14 +6,21 @@
|
||||
|
||||
@c WeeChat documentation (french version)
|
||||
@c
|
||||
@c Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
@c
|
||||
@c Permission is granted to copy, distribute and/or modify this document
|
||||
@c under the terms of the GNU Free Documentation License, Version 1.2
|
||||
@c or any later version published by the Free Software Foundation;
|
||||
@c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
@c A copy of the license is included in the section entitled "GNU
|
||||
@c Free Documentation License".
|
||||
@c This manual is free software; you can redistribute it and/or modify
|
||||
@c it under the terms of the GNU General Public License as published by
|
||||
@c the Free Software Foundation; either version 2 of the License, or
|
||||
@c (at your option) any later version.
|
||||
@c
|
||||
@c This manual is distributed in the hope that it will be useful,
|
||||
@c but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
@c GNU General Public License for more details.
|
||||
@c
|
||||
@c You should have received a copy of the GNU General Public License
|
||||
@c along with this program; if not, write to the Free Software
|
||||
@c Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
@c pdf : texi2pdf weechat_doc_fr.texi
|
||||
@c html: makeinfo --html --no-split --number-sections weechat_doc_fr.texi
|
||||
@@ -28,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.0.4 - 23 novembre 2003
|
||||
@subtitle Documentation pour WeeChat v0.0.8-pre2 - 03 Octobre 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -41,7 +48,7 @@ Ce manuel documente le client IRC WeeChat, il fait partie de WeeChat.@*
|
||||
La derni@`ere version de ce document peut @^etre t@'el@'echarg@'ee sur cette page :@*
|
||||
@uref{http://weechat.flashtux.org/doc.php}@*
|
||||
@*
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
Ce document peut @^etre utilis@'e sous les termes de la licence GNU General Public
|
||||
@@ -148,7 +155,7 @@ Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
|
||||
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
Pour installer : voir la documentation Gentoo
|
||||
Pour installer : @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (non disponible !)
|
||||
@item
|
||||
@@ -170,7 +177,7 @@ Note: pour ne construire que certaines interfaces, vous pouvez passer des param@
|
||||
@`a ./configure, tapez @kbd{./configure --help} pour de l'aide sur ces options.@*
|
||||
|
||||
Obtenez les droits root et installez WeeChat :@*
|
||||
@kbd{su -}@*
|
||||
@kbd{su}@*
|
||||
(entrez le mot de passe de root)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@@ -198,17 +205,20 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
|
||||
@chapter Utilisation
|
||||
|
||||
@menu
|
||||
* Lancer WeeChat::
|
||||
* Lancer WeeChat::
|
||||
* Fichier de configuration::
|
||||
* Raccourcis clavier::
|
||||
* Commandes WeeChat::
|
||||
@end menu
|
||||
|
||||
@node Lancer WeeChat, Raccourcis clavier, Utilisation, Utilisation
|
||||
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
|
||||
@section Lancer WeeChat
|
||||
|
||||
@subsection Param@`etres de ligne de commande
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Afficher l'aide sur le fichier de config (liste des options)@*
|
||||
@item -h, --help
|
||||
Afficher l'aide@*
|
||||
@item -l, --license
|
||||
@@ -220,7 +230,7 @@ Afficher la version de WeeChat@*
|
||||
@subsection Lancer WeeChat
|
||||
|
||||
Tapez simplement cette commande pour lancer WeeChat :@*
|
||||
@kbd{weechat-curses}@*
|
||||
@kbd{weechat-curses} (pour l'interface Curses)@*
|
||||
ou @kbd{weechat-gtk} (pour l'interface Gtk)@*
|
||||
ou @kbd{weechat-qt} (pour l'interface Qt)@*
|
||||
|
||||
@@ -231,7 +241,327 @@ Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
|
||||
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
|
||||
vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} - @xref{Commandes WeeChat}.
|
||||
|
||||
@node Raccourcis clavier, Commandes WeeChat, Lancer WeeChat, Utilisation
|
||||
@node Fichier de configuration, Raccourcis clavier, Lancer WeeChat, Utilisation
|
||||
@section Fichier de configuration
|
||||
|
||||
Liste des options du fichier de configuration :@*
|
||||
|
||||
@table @kbd
|
||||
@item look_set_title
|
||||
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_startup_logo
|
||||
Afficher le logo WeeChat au d@'emarrage@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_startup_version
|
||||
Afficher la version de WeeChat au d@'emarrage@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_weechat_slogan
|
||||
Slogan WeeChat (si vide, le slogan ne sera pas utilis@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'the geekest IRC client!'@*
|
||||
@item look_color_nicks
|
||||
Afficher les utilisateurs avec diff@'erentes couleurs@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_color_actions
|
||||
Afficher les actions avec diff@'erentes couleurs@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_remove_colors_from_msgs
|
||||
Supprimer les couleurs dans les messages entrants@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_nicklist
|
||||
Afficher la fen@^etre des utilisateurs (pour les fen@^etres de canaux)@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_nicklist_position
|
||||
Position de la fen@^etre d'utilisateurs (haut (top), gauche (left), droite (right, par d@'efaut), bas (bottom))@*
|
||||
Type: cha@^ine (valeurs: 'left', 'right', 'top', 'bottom'), valeur par d@'efaut: 'right'@*
|
||||
@item look_nicklist_min_size
|
||||
Taille minimum pour la fen@^etre d'utilisateurs (largeur ou hauteur, selon look_nicklist_position (0 = pas de taille minimum))@*
|
||||
Type: entier (valeurs: entre 0 et 100), valeur par d@'efaut: 0@*
|
||||
@item look_nicklist_max_size
|
||||
Taille maximum pour la fen@^etre d'utilisateurs (largeur ou hauteur, selon look_nicklist_position (0 = pas de taille maximum; si min == max et > 0, alors la taille est fixe))@*
|
||||
Type: entier (valeurs: entre 0 et 100), valeur par d@'efaut: 0@*
|
||||
@item look_no_nickname
|
||||
Texte @`a afficher en lieu et place du nom d'utilisateur lorsque la connexion n'est pas active@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '-cmd-'@*
|
||||
@item look_nickmode
|
||||
Afficher le mode de l'utilisateur ((half)op/voice) devant chaque utilisateur@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_nickmode_empty
|
||||
Afficher un espace si le mode utilisateur n'est pas (half)op/voice@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item look_nick_completor
|
||||
La cha@^ine affich@'ee apr@`es la compl@'etion des utilisateurs@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ':'@*
|
||||
@item look_display_away
|
||||
Affiche un message sur tous les canaux pour l'absence/le retour@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar
|
||||
Active la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Horodatage pour les conversations sauvegard@'ees@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %G - %H:%M'@*
|
||||
@item look_infobar_delay_highlight
|
||||
D@'elai (en secondes) pour la notification des messages dans la barre d'infos (0 = d@'esactiver les notifications dans la barre d'infos)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 7@*
|
||||
@item col_title
|
||||
Couleur pour la barre de titre@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_title_bg
|
||||
Couleur de fond pour la barre de titre@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_chat
|
||||
Couleur pour le texte de discussion@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_chat_time
|
||||
Couleur pour l'heure dans la fen@^etre de discussion@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_chat_time_sep
|
||||
Couleur pour la s@'eparation de l'heure (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'brown'@*
|
||||
@item col_chat_prefix1
|
||||
Couleur pour le 1er et le 3@`eme caract@`ere du pr@'efixe@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
|
||||
@item col_chat_prefix2
|
||||
Couleur pour le caract@`ere du milieu du pr@'efixe@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_chat_nick
|
||||
Couleur pour les noms d'utilisateurs dans les actions (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
|
||||
@item col_chat_host
|
||||
Couleur pour les noms de machines (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
|
||||
@item col_chat_channel
|
||||
Couleur pour les canaux dans les actions (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_chat_dark
|
||||
Couleur pour les s@'eparateurs sombres (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'green'@*
|
||||
@item col_chat_highlight
|
||||
Couleur pour le pseudo surlign@'e (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_chat_bg
|
||||
Couleur de fond pour la fen@^etre de discussion@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
|
||||
@item col_status
|
||||
Couleur pour la barre de statut@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_status_delimiters
|
||||
Couleur pour les d@'elimiteurs de la barre de statut@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
|
||||
@item col_status_data_msg
|
||||
Couleur pour une fen@^etre avec de nouvelles infos (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_status_highlight
|
||||
Couleur pour une fen@^etre avec un highlight (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
|
||||
@item col_status_data_other
|
||||
Couleur pour une fen@^etre avec des nouvelles donn@'ees (pas des infos) (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_status_more
|
||||
Couleur pour une fen@^etre avec des nouvelles donn@'ees (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_status_bg
|
||||
Couleur de fond pour la fen@^etre de statut@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar
|
||||
Couleur pour la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'black'@*
|
||||
@item col_infobar_highlight
|
||||
Couleur pour la notification dans la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_infobar_bg
|
||||
Couleur de fond pour la fen@^etre de barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
|
||||
@item col_input
|
||||
Couleur pour le texte saisi@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_input_channel
|
||||
Couleur pour le texte saisi (nom du canal)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_input_nick
|
||||
Couleur pour le texte saisi (pseudo)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
|
||||
@item col_input_bg
|
||||
Couleur de fond pour la fen@^etre de saisie@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
|
||||
@item col_nick
|
||||
Couleur pour les pseudos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_nick_op
|
||||
Couleur pour le symbole op@'erateur@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
|
||||
@item col_nick_halfop
|
||||
Couleur pour le symbole demi-op@'erateur@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
|
||||
@item col_nick_voice
|
||||
Couleur pour le symbole voix@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_nick_sep
|
||||
Couleur pour le s@'eparateur de pseudo@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_nick_self
|
||||
Couleur pour le pseudo local@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_nick_private
|
||||
Couleur pour l'autre pseudo dans la fen@^etre priv@'ee@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_nick_bg
|
||||
Couleur de fond pour les pseudos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
|
||||
@item col_chat_dcc_selected
|
||||
Couleur pour le DCC s@'electionn@'e (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_dcc_waiting
|
||||
Couleur pour le statut dcc "attente"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_dcc_connecting
|
||||
Couleur pour le statut dcc "connexion"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_dcc_active
|
||||
Couleur pour le statut dcc "actif"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightblue'@*
|
||||
@item col_dcc_done
|
||||
Couleur pour le statut dcc "termin@'e"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
|
||||
@item col_dcc_failed
|
||||
Couleur pour le statut dcc "@'echou@'e"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
|
||||
@item col_dcc_aborted
|
||||
Couleur pour le statut dcc "interrompu"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
|
||||
@item history_max_lines
|
||||
Nombre maximum de lignes dans l'historique pour un serveur/fen@^etre/fen@^etre priv@'ee (0 = sans limite)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 4096@*
|
||||
@item history_max_commands
|
||||
Nombre maximum de commandes utilisateur dans l'historique (0 = sans limite)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 100@*
|
||||
@item log_auto_server
|
||||
Enregistrer automatiquement les messages du serveur@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item log_auto_channel
|
||||
Enregistrer automatiquement les conversations des canaux@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item log_auto_private
|
||||
Enregistrer automatiquement les conversations priv@'ees@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item log_path
|
||||
Chemin pour les conversations sauvegard@'ees par WeeChat@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~/.weechat/logs/'@*
|
||||
@item log_timestamp
|
||||
Horodatage pour les conversations sauvegard@'ees (voir man strftime pour le format de date/heure)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%Y %b %d %H:%M:%S'@*
|
||||
@item dcc_auto_accept_files
|
||||
Accepte automatiquement les fichiers dcc entrants@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item dcc_auto_accept_chats
|
||||
Accepte automatiquement les demandes de discussion dcc (@`a utiliser avec pr@'ecaution !)@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item dcc_timeout
|
||||
D@'elai d'attente pour les requ@^etes dcc (en secondes)@*
|
||||
Type: entier (valeurs: entre 1 et 2147483647), valeur par d@'efaut: 300@*
|
||||
@item dcc_blocksize
|
||||
Taille de bloc pour les paquets dcc en octets (d@'efaut: 1024)@*
|
||||
Type: entier (valeurs: entre 1024 et 102400), valeur par d@'efaut: 1024@*
|
||||
@item dcc_download_path
|
||||
Chemin pour @'ecrire les fichiers re@,{c}us par dcc (par d@'efaut: r@'epertoire de l'utilisateur)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~'@*
|
||||
@item dcc_upload_path
|
||||
Chemin pour lire les fichiers lorsqu'ils sont envoy@'es par dcc (quand aucun chemin n'est sp@'ecifi@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~'@*
|
||||
@item dcc_auto_rename
|
||||
Renommer les fichiers re@,{c}us s'ils existent d@'ej@`a (ajoute '.1', '.2', ...)@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item dcc_auto_resume
|
||||
Continuer automatiquement les transferts dcc si la connexion avec la machine distante a @'et@'e perdue@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item proxy_use
|
||||
Utiliser un proxy pour se connecter au serveur irc@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item proxy_address
|
||||
Adresse du serveur proxy (IP ou nom)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item proxy_port
|
||||
Port pour se connecter au serveur proxy@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 1080@*
|
||||
@item proxy_password
|
||||
Mot de passe pour le serveur proxy@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_name
|
||||
Nom associ@'e au serveur IRC (pour affichage seulement)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_autoconnect
|
||||
Connexion automatique au serveur quand WeeChat d@'emarre@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item server_address
|
||||
Adresse IP ou nom du serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_port
|
||||
Port pour se connecter au serveur@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 6667@*
|
||||
@item server_password
|
||||
Mot de passe pour le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_nick1
|
||||
Pseudo @`a utiliser sur le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_nick2
|
||||
Pseudo alternatif pour le serveur IRC (si le pseudo est d@'ej@`a utilis@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_nick3
|
||||
2nd pseudo alternatif pour le serveur IRC (si le pseudo alternatif est d@'ej@`a utilis@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_username
|
||||
Nom d'utilisateur pour le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_realname
|
||||
Nom r@'eel pour le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_command
|
||||
Commande @`a ex@'ecuter en premier lorsque connect@'e au serveur@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_autojoin
|
||||
Liste des canaux (s@'epar@'es par des virgules) @`a rejoindre lorsque connect@'e au serveur@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@end table
|
||||
|
||||
Les couleurs pour l'interface Curses sont :@*
|
||||
@itemize @minus
|
||||
@item
|
||||
@kbd{default}: couleur par d@'efaut (transparent pour le fond)
|
||||
@item
|
||||
@kbd{black}: noir
|
||||
@item
|
||||
@kbd{red}: rouge fonc@'e
|
||||
@item
|
||||
@kbd{lightred}: rouge clair
|
||||
@item
|
||||
@kbd{green}: vert fonc@'e
|
||||
@item
|
||||
@kbd{lightgreen}: vert clair
|
||||
@item
|
||||
@kbd{brown}: marron
|
||||
@item
|
||||
@kbd{yellow}: jaune
|
||||
@item
|
||||
@kbd{blue}: bleu fonc@'e
|
||||
@item
|
||||
@kbd{lightblue}: bleu clair
|
||||
@item
|
||||
@kbd{magenta}: violet fonc@'e
|
||||
@item
|
||||
@kbd{lightmagenta}: violet clair
|
||||
@item
|
||||
@kbd{cyan}: cyan fonc@'e
|
||||
@item
|
||||
@kbd{lightcyan}: cyan clair
|
||||
@item
|
||||
@kbd{gray}: gris
|
||||
@item
|
||||
@kbd{white}: blanc
|
||||
@end itemize
|
||||
|
||||
@node Raccourcis clavier, Commandes WeeChat, Fichier de configuration, Utilisation
|
||||
@section Raccourcis clavier
|
||||
|
||||
@table @kbd
|
||||
@@ -263,14 +593,32 @@ Ex@'ecuter la commande ou envoyer le message@*
|
||||
Rappeler les derni@`eres commandes/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Afficher l'historique de la fen@^etre@*
|
||||
Afficher l'historique du tampon@*
|
||||
@*
|
||||
@item F6 / F7
|
||||
Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
|
||||
@*
|
||||
Aller au tampon pr@'ec@'edent@*
|
||||
@*
|
||||
@item F8
|
||||
Aller @`a la fen@^etre suivante@*
|
||||
@*
|
||||
@item F10
|
||||
Effacer le dernier message de la barre d'infos@*
|
||||
@*
|
||||
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
|
||||
Identique @`a F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Afficher les DCC en cours@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Vide la hotlist (notification d'activité sur les autres tampons)@*
|
||||
@*
|
||||
@item Alt + chiffre (1-9)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node Commandes WeeChat, , Raccourcis clavier, Utilisation
|
||||
@@ -345,6 +693,39 @@ Affiche un message dans la fen@^etre courante (canal ou serveur).@*
|
||||
@code{IRC::print ("message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_with_channel ( canal, [serveur,] message );}@*
|
||||
@*
|
||||
Affiche un message dans un canal.@*
|
||||
|
||||
@emph{Param@`etres :}
|
||||
@itemize @minus
|
||||
@item @option{canal}: nom du canal
|
||||
@item @option{serveur}: nom interne du serveur
|
||||
@item @option{message}: message @`a afficher
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemples :}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_infobar ( d@'elai, message );}@*
|
||||
@*
|
||||
Affiche un message dans la barre d'infos.@*
|
||||
|
||||
@emph{Param@`etres :}
|
||||
@itemize @minus
|
||||
@item @option{d@'elai}: d@'elai (en secondes) pendant lequel le message est affich@'e
|
||||
(si 0, le message ne sera pas effac@'e).
|
||||
@item @option{message}: message @`a afficher
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemple :}@*
|
||||
@code{IRC::print_infobar (5, "message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::add_message_handler ( nom, fonction );}@*
|
||||
@*
|
||||
@@ -365,7 +746,8 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
|
||||
@code{IRC::add_message_handler ("privmsg", ma_fonction);}@*
|
||||
@code{sub ma_fonction}@*
|
||||
@code{@{ }@*
|
||||
@code{@ @ @ @ ($null, $canal, $message) = split ":",@@_[0],3;}@*
|
||||
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
|
||||
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
|
||||
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
|
||||
@code{@ @ @ @ IRC::print ("masque=$masque, canal=$canal, message=$message\n");}@*
|
||||
@code{@} }@*
|
||||
@@ -390,11 +772,35 @@ ne seront plus accessibles tant que le script Perl sera charg@'e.
|
||||
@code{IRC::add_command_handler ("commande", ma_commande);}@*
|
||||
@code{sub ma_commande}@*
|
||||
@code{@{ }@*
|
||||
@code{@ @ @ @ IRC::print("Param@`etres : ".@@_[0]);}@*
|
||||
@code{@ @ @ @ IRC::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
|
||||
@code{@ @ @ @ return 0;}@*
|
||||
@code{@} }@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::get_info ( [serveur,] nom );}@*
|
||||
@*
|
||||
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
|
||||
|
||||
@emph{Param@`etres :}
|
||||
@itemize @minus
|
||||
@item @option{serveur}: nom interne du serveur
|
||||
@item @option{nom}: nom de l'info @`a obtenir :
|
||||
@itemize @minus
|
||||
@item @option{0 ou version}: obtenir la version de WeeChat
|
||||
@item @option{1 ou nick}: obtenir le pseudo
|
||||
@item @option{2 ou channel}: obtenir le nom du canal
|
||||
@item @option{3 ou server}: obtenir le nom du serveur
|
||||
@item @option{4 ou weechatdir}: obtenir le r@'epertoire maison de WeeChat
|
||||
@item @option{5 ou away}: obtenir le drapeau "away" du serveur
|
||||
@end itemize
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemples :}@*
|
||||
@code{$version = get_info("version");}@*
|
||||
@code{$nick = get_info("freenode", "nick");}@*
|
||||
@*
|
||||
|
||||
@end itemize
|
||||
|
||||
@node Scripts Python, Scripts Ruby, Scripts Perl, Extensions
|
||||
@@ -466,7 +872,7 @@ Support par IRC:@*
|
||||
- serveur : @b{irc.freenode.net}@*
|
||||
- canal : @b{#weechat}@*@*
|
||||
@item
|
||||
Forum WeeChat : bient@^ot !@*@*
|
||||
Forum WeeChat : @uref{http://forums.flashtux.org}@*@*
|
||||
@item
|
||||
Support par la liste de diffusion :@*
|
||||
- pour souscrire/d@'esinscrire :@*@uref{http://mail.nongnu.org/mailman/listinfo/weechat-support}.@*
|
||||
@@ -486,7 +892,7 @@ Voir la page support WeeChat pour plus de d@'etails :@*
|
||||
|
||||
Ce manuel documente le client IRC WeeChat, il fait partie de WeeChat.@*
|
||||
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
Ce document peut @^etre utilis@'e sous les termes de la licence GNU General Public
|
||||
|
||||
+65
-14
@@ -6,14 +6,21 @@
|
||||
|
||||
@c WeeChat documentation (vers@~ao partuguesa)
|
||||
@c
|
||||
@c Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
@c
|
||||
@c Permission is granted to copy, distribute and/or modify this document
|
||||
@c under the terms of the GNU Free Documentation License, Version 1.2
|
||||
@c or any later version published by the Free Software Foundation;
|
||||
@c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
@c A copy of the license is included in the section entitled "GNU
|
||||
@c Free Documentation License".
|
||||
@c This manual is free software; you can redistribute it and/or modify
|
||||
@c it under the terms of the GNU General Public License as published by
|
||||
@c the Free Software Foundation; either version 2 of the License, or
|
||||
@c (at your option) any later version.
|
||||
@c
|
||||
@c This manual is distributed in the hope that it will be useful,
|
||||
@c but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
@c GNU General Public License for more details.
|
||||
@c
|
||||
@c You should have received a copy of the GNU General Public License
|
||||
@c along with this program; if not, write to the Free Software
|
||||
@c Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
@c pdf : texi2pdf weechat_doc_pt.texi
|
||||
@c html: makeinfo --html --no-split --number-sections weechat_doc_pt.texi
|
||||
@@ -28,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Guia do Utilizador
|
||||
@subtitle Cliente de IRC rapido, leve e extencivel
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.3 - 23 de Novembro de 2003
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.7 - 27 de Agosto de 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -41,7 +48,7 @@ Este manual documenta o cliente de IRC WeeChat, ele faz parte do WeeChat.@*
|
||||
A ultima versĂŁo deste documento pode ser descarregada de :@*
|
||||
@uref{http://weechat.flashtux.org/doc.php}@*
|
||||
@*
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
Este documento pode ser utilizado sobre os termos da Licen@,{c}a P@'ublica geral GNU (GNU General Public
|
||||
@@ -147,7 +154,7 @@ Mandrake/Redhat (ou outra distro compat@'ivel com RPMs)@*
|
||||
Instala@,{c}@~ao : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
Instala@,{c}@~ao : ver a documenta@,{c}@~ao da Gentoo
|
||||
Instala@,{c}@~ao : @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (non disponible !)
|
||||
@item
|
||||
@@ -169,7 +176,7 @@ Nota: Para compilar certas interfaces, podes passar par@^ametros
|
||||
ao ./configure, escreve @kbd{./configure --help} para veres as op@,{c}@~oes.@*
|
||||
|
||||
Obter os direitos do root e instalar o Weechat :@*
|
||||
@kbd{su -}@*
|
||||
@kbd{su}@*
|
||||
(escreve aqui a palavra-passe do superutilizador)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@@ -207,6 +214,8 @@ Segue agora as instru@,{c}@~oes para compilar o c@'odigo fonte - @xref{Codigo Fo
|
||||
@subsection Par@^ametros de linha de comandos
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Mostrar da lima dos config da exposi@,{c}@~ao (lista das op@,{c}@~oes)
|
||||
@item -h, --help
|
||||
Mostrar a ajuda@*
|
||||
@item -l, --license
|
||||
@@ -218,7 +227,7 @@ Mostrar a vers@~ao do WeeChat@*
|
||||
@subsection Invocar o WeeChat
|
||||
|
||||
Escreve simplesmente este comando para invoceres o WeeChat :@*
|
||||
@kbd{weechat-curses}@*
|
||||
@kbd{weechat-curses} (para a interface em Curses)@*
|
||||
ou @kbd{weechat-gtk} (para a interface em Gtk)@*
|
||||
ou @kbd{weechat-qt} (para a interface em Qt)@*
|
||||
|
||||
@@ -268,6 +277,15 @@ Ir para a janela anterior/seguinte@*
|
||||
@item Alt + Seta da esquerda / Alt + Seta da direita
|
||||
Identico a F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Comute ao amortecedor seguinte com atividade (com prioridade: destaque, mensagem, outra)@*
|
||||
@*
|
||||
@item Alt + d@'igito (1-9)
|
||||
Comute ao amortecedor pelo n@'umero@*
|
||||
@*
|
||||
@item F10
|
||||
Apagar a @'ultima mensagem da barra do info@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node Comandos do WeeChat, , Recursos de teclado, Utilizacao
|
||||
@@ -340,6 +358,39 @@ Imprimne uma mensagem na janela actual (canal ou servidor).@*
|
||||
@code{IRC::print ("mensagem");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_with_channel ( canal, [servidor,] mensagem );}@*
|
||||
@*
|
||||
Imprimne uma mensagem na canal.@*
|
||||
|
||||
@emph{Argumentos:}
|
||||
@itemize @minus
|
||||
@item @option{canal}: nome da canal
|
||||
@item @option{servidor}: nome interno da servidor
|
||||
@item @option{mensagem}: mensagem a mostrar
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemplos:}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "freenode", "mensagem");}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "mensagem");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_infobar ( atrasa, mensagem );}@*
|
||||
@*
|
||||
Imprimne uma mensagem na barra do info.@*
|
||||
|
||||
@emph{Argumentos:}
|
||||
@itemize @minus
|
||||
@item @option{atrasa}: depois que isto atrasa (nos segundos), a mensagem estar@'a apagada
|
||||
(se 0, mensagem n@~ao forem apagados).
|
||||
@item @option{mensagem}: mensagem a mostrar
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemplo:}@*
|
||||
@code{IRC::print_infobar (5, "mensagem");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::add_message_handler ( nome, fun@,{c}@~ao );}@*
|
||||
@*
|
||||
@@ -457,7 +508,7 @@ Suporte por IRC:@*
|
||||
- servidor : @b{irc.freenode.net}@*
|
||||
- canal : @b{#weechat}@*@*
|
||||
@item
|
||||
Forum do WeeChat : mais tarde !@*@*
|
||||
Forum do WeeChat : @uref{http://forums.flashtux.org}@*@*
|
||||
@item
|
||||
Suporte por lista de correio-e :@*
|
||||
- para te inscreveres/desinscreveres :@*@uref{http://mail.nongnu.org/mailman/listinfo/weechat-support}.@*
|
||||
@@ -477,7 +528,7 @@ Para mais detalhes, v@^e tamb@'em a p@'agina de suporte do WeeChat :@*
|
||||
|
||||
Este manual documenta o cliente de IRC WeeChat, Ele faz parte do WeeChat.@*
|
||||
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
Tradu@,{c}@~ao portuguesa de Jo@~ao Jer@'onimo <@email{j_j_b_o@@sapo.pt, j_j_b_o AT sapo.pt}>@*
|
||||
@*
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
./src/irc/irc-display.c
|
||||
./src/irc/irc-send.c
|
||||
./src/irc/irc-recv.c
|
||||
./src/irc/irc-dcc.c
|
||||
./src/plugins/perl/wee-perl.c
|
||||
./src/plugins/perl/wee-perl.h
|
||||
./src/plugins/plugins.c
|
||||
@@ -23,6 +24,7 @@
|
||||
./src/common/command.h
|
||||
./src/common/completion.h
|
||||
./src/common/history.h
|
||||
./src/common/log.c
|
||||
./src/common/weechat.h
|
||||
./src/common/weeconfig.c
|
||||
./src/common/weeconfig.h
|
||||
|
||||
+1289
-814
File diff suppressed because it is too large
Load Diff
@@ -28,4 +28,8 @@ lib_weechat_main_a_SOURCES = weechat.c \
|
||||
weeconfig.c \
|
||||
weeconfig.h \
|
||||
history.c \
|
||||
history.h
|
||||
history.h \
|
||||
hotlist.c \
|
||||
hotlist.h \
|
||||
log.c \
|
||||
log.h
|
||||
|
||||
+407
-101
@@ -43,6 +43,14 @@ t_weechat_command weechat_commands[] =
|
||||
N_("alias_name: name of alias\ncommand: command name (WeeChat "
|
||||
"or IRC command, without first '/')\n" "arguments: arguments for command"),
|
||||
0, MAX_ARGS, NULL, weechat_cmd_alias },
|
||||
{ "buffer", N_("manage buffers"),
|
||||
N_("[action | number]"),
|
||||
N_("action: action to do:\n"
|
||||
" move move buffer in the list (may be relative, for example -1)\n"
|
||||
" list list opened buffers (no parameter implies this list)\n"
|
||||
" notify set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
|
||||
"number: jump to buffer by number"),
|
||||
0, MAX_ARGS, weechat_cmd_buffer, NULL },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
N_("-all: clear all windows"),
|
||||
@@ -59,7 +67,7 @@ t_weechat_command weechat_commands[] =
|
||||
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
|
||||
0, 1, weechat_cmd_help, NULL },
|
||||
{ "perl", N_("list/load/unload Perl scripts"),
|
||||
N_("[load filename] | [unload]"),
|
||||
N_("[load filename] | [autoload] | [unload]"),
|
||||
N_("filename: Perl script (file) to load\n"
|
||||
"Without argument, /perl command lists all loaded Perl scripts."),
|
||||
0, 2, weechat_cmd_perl, NULL },
|
||||
@@ -77,17 +85,25 @@ t_weechat_command weechat_commands[] =
|
||||
"nick2: alternate nick for server\n"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user\n"),
|
||||
"realname: real name of user"),
|
||||
0, MAX_ARGS, weechat_cmd_server, NULL },
|
||||
{ "save", N_("save config to disk"),
|
||||
N_("[file]"), N_("file: filename for writing config"),
|
||||
0, 1, weechat_cmd_save, NULL },
|
||||
{ "set", N_("set config parameters"),
|
||||
N_("[option [value]]"), N_("option: name of an option\nvalue: value for option"),
|
||||
0, 2, weechat_cmd_set, NULL },
|
||||
0, MAX_ARGS, NULL, weechat_cmd_set },
|
||||
{ "unalias", N_("remove an alias"),
|
||||
N_("alias_name"), N_("alias_name: name of alias to remove"),
|
||||
1, 1, NULL, weechat_cmd_unalias },
|
||||
{ "window", N_("manage windows"),
|
||||
N_("[action]"),
|
||||
N_("action: action to do:\n"
|
||||
" close close current window (under development!)\n"
|
||||
" list list opened windows (no parameter implies this list)\n"
|
||||
" splith split current window horizontally\n"
|
||||
" splitv split current window vertically"),
|
||||
0, MAX_ARGS, weechat_cmd_window, NULL },
|
||||
{ NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -207,14 +223,14 @@ index_command_build ()
|
||||
i = 0;
|
||||
while (weechat_commands[i].command_name)
|
||||
{
|
||||
index_command_new (weechat_commands[i].command_name);
|
||||
(void) index_command_new (weechat_commands[i].command_name);
|
||||
i++;
|
||||
}
|
||||
i = 0;
|
||||
while (irc_commands[i].command_name)
|
||||
{
|
||||
if (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
|
||||
index_command_new (irc_commands[i].command_name);
|
||||
(void) index_command_new (irc_commands[i].command_name);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -363,8 +379,11 @@ alias_new (char *alias_name, char *alias_command)
|
||||
{
|
||||
new_alias->alias_name = strdup (alias_name);
|
||||
new_alias->alias_command = (char *)malloc (strlen (alias_command) + 2);
|
||||
new_alias->alias_command[0] = '/';
|
||||
strcpy (new_alias->alias_command + 1, alias_command);
|
||||
if (new_alias->alias_command)
|
||||
{
|
||||
new_alias->alias_command[0] = '/';
|
||||
strcpy (new_alias->alias_command + 1, alias_command);
|
||||
}
|
||||
alias_insert_sorted (new_alias);
|
||||
return new_alias;
|
||||
}
|
||||
@@ -409,7 +428,7 @@ alias_free (t_weechat_alias *alias)
|
||||
*/
|
||||
|
||||
char **
|
||||
explode_string (char *string, char *separators, int num_items_max,
|
||||
explode_string (/*@null@*/ char *string, char *separators, int num_items_max,
|
||||
int *num_items)
|
||||
{
|
||||
int i, n_items;
|
||||
@@ -502,7 +521,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
char *command, *pos, *ptr_args, **argv, *alias_command;
|
||||
t_weechat_alias *ptr_alias;
|
||||
|
||||
if ((!string[0]) || (string[0] != '/'))
|
||||
if ((!string) || (!string[0]) || (string[0] != '/'))
|
||||
return 0;
|
||||
|
||||
command = strdup (string);
|
||||
@@ -521,7 +540,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
ptr_args = NULL;
|
||||
}
|
||||
|
||||
if (!plugin_exec_command (command + 1, ptr_args))
|
||||
if (!plugin_exec_command (command + 1, (server) ? server->name : "", ptr_args))
|
||||
{
|
||||
argv = explode_string (ptr_args, " ", 0, &argc);
|
||||
|
||||
@@ -572,6 +591,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
free (argv[j]);
|
||||
free (argv);
|
||||
}
|
||||
free (command);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -630,6 +650,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
free (argv[j]);
|
||||
free (argv);
|
||||
}
|
||||
free (command);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -643,14 +664,18 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
length1 = strlen (ptr_alias->alias_command);
|
||||
length2 = strlen (ptr_args);
|
||||
alias_command = (char *)malloc (length1 + 1 + length2 + 1);
|
||||
strcpy (alias_command, ptr_alias->alias_command);
|
||||
alias_command[length1] = ' ';
|
||||
strcpy (alias_command + length1 + 1, ptr_args);
|
||||
exec_weechat_command (server, alias_command);
|
||||
free (alias_command);
|
||||
if (alias_command)
|
||||
{
|
||||
strcpy (alias_command, ptr_alias->alias_command);
|
||||
alias_command[length1] = ' ';
|
||||
strcpy (alias_command + length1 + 1, ptr_args);
|
||||
}
|
||||
(void) exec_weechat_command (server, alias_command);
|
||||
if (alias_command)
|
||||
free (alias_command);
|
||||
}
|
||||
else
|
||||
exec_weechat_command (server, ptr_alias->alias_command);
|
||||
(void) exec_weechat_command (server, ptr_alias->alias_command);
|
||||
|
||||
if (argv)
|
||||
{
|
||||
@@ -658,6 +683,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
free (argv[j]);
|
||||
free (argv);
|
||||
}
|
||||
free (command);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -672,6 +698,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
free (argv);
|
||||
}
|
||||
}
|
||||
free (command);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -690,52 +717,52 @@ user_command (t_irc_server *server, char *command)
|
||||
if ((command[0] == '/') && (command[1] != '/'))
|
||||
{
|
||||
/* WeeChat internal command (or IRC command) */
|
||||
exec_weechat_command (server, command);
|
||||
(void) exec_weechat_command (server, command);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((command[0] == '/') && (command[1] == '/'))
|
||||
command++;
|
||||
if (server && (!WIN_IS_SERVER(gui_current_window)))
|
||||
if (server && (!BUFFER_IS_SERVER(gui_current_window->buffer)))
|
||||
{
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n",
|
||||
CHANNEL(gui_current_window)->name,
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
command);
|
||||
|
||||
if (WIN_IS_PRIVATE(gui_current_window))
|
||||
if (BUFFER_IS_PRIVATE(gui_current_window->buffer))
|
||||
{
|
||||
gui_printf_color_type (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color_type (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
gui_printf_color_type (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color_type (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_SELF,
|
||||
"%s", server->nick);
|
||||
gui_printf_color_type (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color_type (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_color_type (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color_type (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", command);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_nick = nick_search (CHANNEL(gui_current_window), server->nick);
|
||||
ptr_nick = nick_search (CHANNEL(gui_current_window->buffer), server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (CHANNEL(gui_current_window)->window, ptr_nick,
|
||||
irc_display_nick (CHANNEL(gui_current_window->buffer)->buffer, ptr_nick,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_color (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
COLOR_WIN_CHAT, "%s\n", command);
|
||||
}
|
||||
else
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s cannot find nick for sending message\n"),
|
||||
WEECHAT_ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
gui_printf ((server) ? server->window : NULL,
|
||||
gui_printf ((server) ? server->buffer : NULL,
|
||||
_("This window is not a channel!\n"));
|
||||
}
|
||||
}
|
||||
@@ -768,7 +795,7 @@ weechat_cmd_alias (char *arguments)
|
||||
}
|
||||
if (!alias_new (arguments, pos))
|
||||
return -1;
|
||||
index_command_new (arguments);
|
||||
(void) index_command_new (arguments);
|
||||
gui_printf (NULL, _("Alias \"%s\" => \"%s\" created\n"),
|
||||
arguments, pos);
|
||||
}
|
||||
@@ -799,6 +826,174 @@ weechat_cmd_alias (char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_buffer: manage buffers
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
long number;
|
||||
char *error;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened buffers */
|
||||
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf (NULL, _("Opened buffers:\n"));
|
||||
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "[");
|
||||
gui_printf (NULL, "%d", ptr_buffer->number);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "] ");
|
||||
|
||||
if (ptr_buffer->dcc)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "DCC\n");
|
||||
else if (BUFFER_IS_SERVER (ptr_buffer))
|
||||
{
|
||||
gui_printf (NULL, _("Server: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s\n", SERVER(ptr_buffer)->name);
|
||||
}
|
||||
else if (BUFFER_IS_CHANNEL (ptr_buffer))
|
||||
{
|
||||
gui_printf (NULL, _("Channel: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s", CHANNEL(ptr_buffer)->name);
|
||||
gui_printf (NULL, _(" (server: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s", SERVER(ptr_buffer)->name);
|
||||
gui_printf (NULL, ")\n");
|
||||
}
|
||||
else if (BUFFER_IS_PRIVATE (ptr_buffer))
|
||||
{
|
||||
gui_printf (NULL, _("Private with: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_NICK,
|
||||
"%s", CHANNEL(ptr_buffer)->name);
|
||||
gui_printf (NULL, _(" (server: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s", SERVER(ptr_buffer)->name);
|
||||
gui_printf (NULL, ")\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "move") == 0)
|
||||
{
|
||||
/* move buffer to another number in the list */
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "buffer");
|
||||
return -1;
|
||||
}
|
||||
|
||||
error = NULL;
|
||||
number = strtol (((argv[1][0] == '+') || (argv[1][0] == '-')) ? argv[1] + 1 : argv[1],
|
||||
&error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
if (argv[1][0] == '+')
|
||||
gui_move_buffer_to_number (gui_current_window,
|
||||
gui_current_window->buffer->number + ((int) number));
|
||||
else if (argv[1][0] == '-')
|
||||
gui_move_buffer_to_number (gui_current_window,
|
||||
gui_current_window->buffer->number - ((int) number));
|
||||
else
|
||||
gui_move_buffer_to_number (gui_current_window, (int) number);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
gui_printf (NULL, _("%s incorrect buffer number\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp (argv[0], "notify") == 0)
|
||||
{
|
||||
/* set notify level for buffer */
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
/* display notify level for all buffers */
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf (NULL, _("Notify levels: "));
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
gui_printf (NULL, "%d.%s:",
|
||||
ptr_buffer->number,
|
||||
(ptr_buffer->dcc) ? "DCC" :
|
||||
((BUFFER_IS_SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
|
||||
CHANNEL(ptr_buffer)->name));
|
||||
if (ptr_buffer->dcc)
|
||||
gui_printf (NULL, "-");
|
||||
else
|
||||
gui_printf (NULL, "%d", ptr_buffer->notify_level);
|
||||
if (ptr_buffer->next_buffer)
|
||||
gui_printf (NULL, " ");
|
||||
}
|
||||
gui_printf (NULL, "\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
error = NULL;
|
||||
number = strtol (argv[1], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
if ((number < 0) || (number > 3))
|
||||
{
|
||||
/* invalid highlight level */
|
||||
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
gui_current_window->buffer->notify_level = number;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* jump to buffer by number */
|
||||
|
||||
error = NULL;
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
if (!gui_switch_to_buffer_by_number (gui_current_window, (int) number))
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s buffer \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[0], "buffer");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
gui_printf (NULL, _("%s incorrect buffer number\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_clear: display or create alias
|
||||
*/
|
||||
@@ -809,7 +1004,7 @@ weechat_cmd_clear (int argc, char **argv)
|
||||
if (argc == 1)
|
||||
{
|
||||
if (strcmp (argv[0], "-all") == 0)
|
||||
gui_window_clear_all ();
|
||||
gui_buffer_clear_all ();
|
||||
else
|
||||
{
|
||||
gui_printf (NULL,
|
||||
@@ -819,7 +1014,7 @@ weechat_cmd_clear (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
else
|
||||
gui_window_clear (gui_current_window);
|
||||
gui_buffer_clear (gui_current_window->buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -846,8 +1041,11 @@ weechat_cmd_connect (int argc, char **argv)
|
||||
WEECHAT_ERROR, argv[0]);
|
||||
return -1;
|
||||
}
|
||||
if (!ptr_server->window)
|
||||
gui_window_new (ptr_server, NULL, 1);
|
||||
if (!ptr_server->buffer)
|
||||
{
|
||||
if (!gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1))
|
||||
return -1;
|
||||
}
|
||||
if (server_connect (ptr_server))
|
||||
{
|
||||
irc_login (ptr_server);
|
||||
@@ -892,7 +1090,7 @@ weechat_cmd_disconnect (int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
server_disconnect (ptr_server);
|
||||
gui_redraw_window_status (gui_current_window);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -990,7 +1188,7 @@ weechat_cmd_perl (int argc, char **argv)
|
||||
#ifdef PLUGINS
|
||||
t_plugin_script *ptr_plugin_script;
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
int handler_found;
|
||||
int handler_found, path_length;
|
||||
char *path_script;
|
||||
|
||||
#ifdef PLUGIN_PERL
|
||||
@@ -1065,6 +1263,8 @@ weechat_cmd_perl (int argc, char **argv)
|
||||
|
||||
break;
|
||||
case 1:
|
||||
if (strcmp (argv[0], "autoload") == 0)
|
||||
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
|
||||
if (strcmp (argv[0], "unload") == 0)
|
||||
{
|
||||
/* unload all Perl scripts */
|
||||
@@ -1081,10 +1281,11 @@ weechat_cmd_perl (int argc, char **argv)
|
||||
path_script = NULL;
|
||||
else
|
||||
{
|
||||
path_script = (char *) malloc ((strlen (weechat_home) +
|
||||
strlen (argv[1]) + 7) * sizeof (char));
|
||||
sprintf (path_script, "%s%s%s%s%s", weechat_home,
|
||||
DIR_SEPARATOR, "perl", DIR_SEPARATOR, argv[1]);
|
||||
path_length = strlen (weechat_home) + strlen (argv[1]) + 7;
|
||||
path_script = (char *) malloc (path_length * sizeof (char));
|
||||
snprintf (path_script, path_length, "%s%s%s%s%s",
|
||||
weechat_home, DIR_SEPARATOR, "perl",
|
||||
DIR_SEPARATOR, argv[1]);
|
||||
}
|
||||
plugin_load (PLUGIN_TYPE_PERL,
|
||||
(path_script) ? path_script : argv[1]);
|
||||
@@ -1167,8 +1368,11 @@ weechat_cmd_server (int argc, char **argv)
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf_color (NULL,
|
||||
COLOR_WIN_CHAT,
|
||||
_(" Autoconnect: %s\n"),
|
||||
(ptr_server->autoconnect) ? _("yes") : _("no"));
|
||||
_(" Autoconnect: %s%s\n"),
|
||||
(ptr_server->autoconnect) ? _("yes") : _("no"),
|
||||
(ptr_server->command_line) ?
|
||||
_(" (temporary server, will not be saved)") :
|
||||
"");
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf_color (NULL,
|
||||
COLOR_WIN_CHAT,
|
||||
@@ -1282,7 +1486,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT, _("has been deleted\n"));
|
||||
|
||||
server_free (server_found);
|
||||
gui_redraw_window (gui_current_window);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1399,11 +1603,11 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
|
||||
/* create new server */
|
||||
new_server = server_new (server.name, server.autoconnect, server.address,
|
||||
server.port, server.password, server.nick1,
|
||||
server.nick2, server.nick3, server.username,
|
||||
server.realname, server.command,
|
||||
server.autojoin);
|
||||
new_server = server_new (server.name, server.autoconnect, 0,
|
||||
server.address, server.port, server.password,
|
||||
server.nick1, server.nick2, server.nick3,
|
||||
server.username, server.realname,
|
||||
server.command, server.autojoin, 1);
|
||||
if (new_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
@@ -1423,7 +1627,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
|
||||
if (new_server->autoconnect)
|
||||
{
|
||||
gui_window_new (new_server, NULL, 1);
|
||||
(void) gui_buffer_new (gui_current_window, new_server, NULL, 0, 1);
|
||||
if (server_connect (new_server))
|
||||
irc_login (new_server);
|
||||
}
|
||||
@@ -1438,72 +1642,140 @@ weechat_cmd_server (int argc, char **argv)
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_set (int argc, char **argv)
|
||||
weechat_cmd_set (char *arguments)
|
||||
{
|
||||
char *option, *value;
|
||||
int i, j, section_displayed;
|
||||
char *color_name;
|
||||
t_config_option *ptr_option;
|
||||
int number_found;
|
||||
|
||||
/* TODO: complete /set command */
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
option = NULL;
|
||||
value = NULL;
|
||||
if (arguments && arguments[0])
|
||||
{
|
||||
section_displayed = 0;
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
option = arguments;
|
||||
value = strchr (option, ' ');
|
||||
if (value)
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
value[0] = '\0';
|
||||
value++;
|
||||
while (value[0] == ' ')
|
||||
value++;
|
||||
}
|
||||
}
|
||||
|
||||
if (value && value[0])
|
||||
{
|
||||
ptr_option = config_option_search (option);
|
||||
if (ptr_option)
|
||||
{
|
||||
if (ptr_option->handler_change == NULL)
|
||||
{
|
||||
if ((argc == 0) ||
|
||||
((argc > 0)
|
||||
&& (strstr (weechat_options[i][j].option_name, argv[0])
|
||||
!= NULL)))
|
||||
gui_printf (NULL,
|
||||
_("%s option \"%s\" can not be changed while WeeChat is running\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (config_option_set_value (ptr_option, value) == 0)
|
||||
{
|
||||
if (!section_displayed)
|
||||
(void) (ptr_option->handler_change());
|
||||
gui_printf (NULL, "[%s]\n", config_get_section (ptr_option));
|
||||
gui_printf (NULL, " %s = %s\n", option, value);
|
||||
}
|
||||
else
|
||||
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (NULL, _("%s config option \"%s\" not found\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
number_found = 0;
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
section_displayed = 0;
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
if ((!option) ||
|
||||
((option) && (option[0])
|
||||
&& (strstr (weechat_options[i][j].option_name, option)
|
||||
!= NULL)))
|
||||
{
|
||||
gui_printf (NULL, "[%s]\n",
|
||||
config_sections[i].section_name);
|
||||
section_displayed = 1;
|
||||
}
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
gui_printf (NULL, " %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(*weechat_options[i][j].ptr_int) ?
|
||||
"ON" : "OFF");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
gui_printf (NULL,
|
||||
" %s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
*weechat_options[i][j].ptr_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
gui_printf (NULL,
|
||||
" %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int]);
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
color_name = gui_get_color_by_value (*weechat_options[i][j].ptr_int);
|
||||
gui_printf (NULL,
|
||||
" %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(color_name) ? color_name : _("(unknown)"));
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
gui_printf (NULL, " %s = %s\n",
|
||||
weechat_options[i][j].
|
||||
option_name,
|
||||
(*weechat_options[i][j].
|
||||
ptr_string) ?
|
||||
*weechat_options[i][j].
|
||||
ptr_string : "");
|
||||
break;
|
||||
if (!section_displayed)
|
||||
{
|
||||
gui_printf (NULL, "[%s]\n",
|
||||
config_sections[i].section_name);
|
||||
section_displayed = 1;
|
||||
}
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
gui_printf (NULL, " %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(*weechat_options[i][j].ptr_int) ?
|
||||
"ON" : "OFF");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
gui_printf (NULL,
|
||||
" %s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
*weechat_options[i][j].ptr_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
gui_printf (NULL,
|
||||
" %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int]);
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
color_name = gui_get_color_by_value (*weechat_options[i][j].ptr_int);
|
||||
gui_printf (NULL,
|
||||
" %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(color_name) ? color_name : _("(unknown)"));
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
gui_printf (NULL, " %s = %s\n",
|
||||
weechat_options[i][j].
|
||||
option_name,
|
||||
(*weechat_options[i][j].
|
||||
ptr_string) ?
|
||||
*weechat_options[i][j].
|
||||
ptr_string : "");
|
||||
break;
|
||||
}
|
||||
number_found++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (number_found == 0)
|
||||
{
|
||||
if (value)
|
||||
gui_printf (NULL, _("No config option found with \"%s\"\n"),
|
||||
value);
|
||||
else
|
||||
gui_printf (NULL, _("No config option found with \"%s\"\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value)
|
||||
gui_printf (NULL, _("%d config option(s) found with \"%s\"\n"),
|
||||
number_found, value);
|
||||
else
|
||||
gui_printf (NULL, _("%d config option(s) found\n"),
|
||||
number_found);
|
||||
}
|
||||
}
|
||||
gui_printf (NULL, "(TODO) \"/set\" command not fully developed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1533,3 +1805,37 @@ weechat_cmd_unalias (char *arguments)
|
||||
arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_window: manage windows
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_window (int argc, char **argv)
|
||||
{
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened windows */
|
||||
gui_printf (NULL, "window list -- NOT DEVELOPED!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "splith") == 0)
|
||||
{
|
||||
/* split window horizontally */
|
||||
gui_window_split_horiz (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "splitv") == 0)
|
||||
{
|
||||
/* split window vertically */
|
||||
gui_window_split_vertic (gui_current_window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "window");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ extern t_weechat_alias *alias_new (char *, char *);
|
||||
extern int exec_weechat_command (t_irc_server *, char *);
|
||||
extern void user_command (t_irc_server *, char *);
|
||||
extern int weechat_cmd_alias (char *);
|
||||
extern int weechat_cmd_buffer (int, char **);
|
||||
extern int weechat_cmd_clear (int, char **);
|
||||
extern int weechat_cmd_connect (int, char **);
|
||||
extern int weechat_cmd_disconnect (int, char **);
|
||||
@@ -74,7 +75,8 @@ extern int weechat_cmd_help (int, char **);
|
||||
extern int weechat_cmd_perl (int, char **);
|
||||
extern int weechat_cmd_save (int, char **);
|
||||
extern int weechat_cmd_server (int, char **);
|
||||
extern int weechat_cmd_set (int, char **);
|
||||
extern int weechat_cmd_set (char *);
|
||||
extern int weechat_cmd_unalias (char *);
|
||||
extern int weechat_cmd_window (int, char **);
|
||||
|
||||
#endif /* command.h */
|
||||
|
||||
+79
-8
@@ -29,39 +29,110 @@
|
||||
|
||||
#include "weechat.h"
|
||||
#include "history.h"
|
||||
#include "weeconfig.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
t_history *history_general = NULL;
|
||||
t_history *history_general_last = NULL;
|
||||
t_history *history_general_ptr = NULL;
|
||||
int num_history_general = 0;
|
||||
|
||||
|
||||
/*
|
||||
* history_hide_password: hide a nickserv password
|
||||
*/
|
||||
|
||||
void
|
||||
history_hide_password (char *string)
|
||||
{
|
||||
char *pos_pwd;
|
||||
|
||||
if (strstr (string, "nickserv "))
|
||||
{
|
||||
pos_pwd = strstr (string, "identify ");
|
||||
if (!pos_pwd)
|
||||
pos_pwd = strstr (string, "register ");
|
||||
if (pos_pwd)
|
||||
{
|
||||
pos_pwd += 9;
|
||||
while (pos_pwd[0])
|
||||
{
|
||||
pos_pwd[0] = '*';
|
||||
pos_pwd++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* history_add: add a text/command to history
|
||||
*/
|
||||
|
||||
void
|
||||
history_add (void *window, char *string)
|
||||
history_add (void *buffer, char *string)
|
||||
{
|
||||
t_history *new_history;
|
||||
t_history *new_history, *ptr_history;
|
||||
|
||||
/* add history to general history */
|
||||
new_history = (t_history *)malloc (sizeof (t_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
history_hide_password (new_history->text);
|
||||
|
||||
/* add history to general history */
|
||||
if (history_general)
|
||||
history_general->prev_history = new_history;
|
||||
else
|
||||
history_general_last = new_history;
|
||||
new_history->next_history = history_general;
|
||||
new_history->prev_history = NULL;
|
||||
history_general = new_history;
|
||||
num_history_general++;
|
||||
|
||||
/* add history to local history */
|
||||
if (((t_gui_window *)(window))->history)
|
||||
((t_gui_window *)(window))->history->prev_history = new_history;
|
||||
new_history->next_history = ((t_gui_window *)(window))->history;
|
||||
/* remove one command if necessary */
|
||||
if ((cfg_history_max_commands > 0)
|
||||
&& (num_history_general > cfg_history_max_commands))
|
||||
{
|
||||
ptr_history = history_general_last->prev_history;
|
||||
history_general_last->prev_history->next_history = NULL;
|
||||
if (history_general_last->text)
|
||||
free (history_general_last->text);
|
||||
free (history_general_last);
|
||||
history_general_last = ptr_history;
|
||||
num_history_general--;
|
||||
}
|
||||
}
|
||||
|
||||
/* add history to local history */
|
||||
new_history = (t_history *)malloc (sizeof (t_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
history_hide_password (new_history->text);
|
||||
|
||||
if (((t_gui_buffer *)(buffer))->history)
|
||||
((t_gui_buffer *)(buffer))->history->prev_history = new_history;
|
||||
else
|
||||
((t_gui_buffer *)(buffer))->last_history = new_history;
|
||||
new_history->next_history = ((t_gui_buffer *)(buffer))->history;
|
||||
new_history->prev_history = NULL;
|
||||
((t_gui_window *)window)->history = new_history;
|
||||
((t_gui_buffer *)buffer)->history = new_history;
|
||||
((t_gui_buffer *)(buffer))->num_history++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((cfg_history_max_commands > 0)
|
||||
&& (((t_gui_buffer *)(buffer))->num_history > cfg_history_max_commands))
|
||||
{
|
||||
ptr_history = ((t_gui_buffer *)buffer)->last_history->prev_history;
|
||||
((t_gui_buffer *)buffer)->last_history->prev_history->next_history = NULL;
|
||||
if (((t_gui_buffer *)buffer)->last_history->text)
|
||||
free (((t_gui_buffer *)buffer)->last_history->text);
|
||||
free (((t_gui_buffer *)buffer)->last_history);
|
||||
((t_gui_buffer *)buffer)->last_history = ptr_history;
|
||||
((t_gui_buffer *)(buffer))->num_history++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* hotlist.c: WeeChat hotlist (buffers with activity) */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "hotlist.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
t_weechat_hotlist *hotlist = NULL;
|
||||
t_weechat_hotlist *last_hotlist = NULL;
|
||||
t_gui_buffer *hotlist_initial_buffer = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* hotlist_search: find hotlist with buffer pointer
|
||||
*/
|
||||
|
||||
t_weechat_hotlist *
|
||||
hotlist_search (t_gui_buffer *buffer)
|
||||
{
|
||||
t_weechat_hotlist *ptr_hotlist;
|
||||
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist; ptr_hotlist = ptr_hotlist->next_hotlist)
|
||||
{
|
||||
if (ptr_hotlist->buffer == buffer)
|
||||
return ptr_hotlist;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_find_pos: find position for a inserting in hotlist (for sorting hotlist)
|
||||
*/
|
||||
|
||||
t_weechat_hotlist *
|
||||
hotlist_find_pos (t_weechat_hotlist *new_hotlist)
|
||||
{
|
||||
t_weechat_hotlist *ptr_hotlist;
|
||||
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist; ptr_hotlist = ptr_hotlist->next_hotlist)
|
||||
{
|
||||
if (new_hotlist->priority > ptr_hotlist->priority)
|
||||
return ptr_hotlist;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_add: add a buffer to hotlist, with priority
|
||||
*/
|
||||
|
||||
void
|
||||
hotlist_add (int priority, t_gui_buffer *buffer)
|
||||
{
|
||||
t_weechat_hotlist *new_hotlist, *pos_hotlist;
|
||||
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
/* do not highlight current buffer */
|
||||
if (buffer == gui_current_window->buffer)
|
||||
return;
|
||||
|
||||
if ((pos_hotlist = hotlist_search (buffer)))
|
||||
{
|
||||
/* return if priority is greater or equal than the one to add */
|
||||
if (pos_hotlist->priority >= priority)
|
||||
return;
|
||||
/* remove buffer if present with lower priority and go on */
|
||||
hotlist_free (pos_hotlist);
|
||||
}
|
||||
|
||||
if ((new_hotlist = (t_weechat_hotlist *) malloc (sizeof (t_weechat_hotlist))) == NULL)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s cannot add a buffer to hotlist\n"), WEECHAT_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
new_hotlist->priority = priority;
|
||||
new_hotlist->buffer = buffer;
|
||||
|
||||
if (hotlist)
|
||||
{
|
||||
pos_hotlist = hotlist_find_pos (new_hotlist);
|
||||
|
||||
if (pos_hotlist)
|
||||
{
|
||||
/* insert hotlist into the hotlist (before hotlist found) */
|
||||
new_hotlist->prev_hotlist = pos_hotlist->prev_hotlist;
|
||||
new_hotlist->next_hotlist = pos_hotlist;
|
||||
if (pos_hotlist->prev_hotlist)
|
||||
pos_hotlist->prev_hotlist->next_hotlist = new_hotlist;
|
||||
else
|
||||
hotlist = new_hotlist;
|
||||
pos_hotlist->prev_hotlist = new_hotlist;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* add hotlist to the end */
|
||||
new_hotlist->prev_hotlist = last_hotlist;
|
||||
new_hotlist->next_hotlist = NULL;
|
||||
last_hotlist->next_hotlist = new_hotlist;
|
||||
last_hotlist = new_hotlist;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
new_hotlist->prev_hotlist = NULL;
|
||||
new_hotlist->next_hotlist = NULL;
|
||||
hotlist = new_hotlist;
|
||||
last_hotlist = new_hotlist;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_free: free a hotlist and remove it from hotlist queue
|
||||
*/
|
||||
|
||||
void
|
||||
hotlist_free (t_weechat_hotlist *ptr_hotlist)
|
||||
{
|
||||
t_weechat_hotlist *new_hotlist;
|
||||
|
||||
/* remove hotlist from queue */
|
||||
if (last_hotlist == ptr_hotlist)
|
||||
last_hotlist = ptr_hotlist->prev_hotlist;
|
||||
if (ptr_hotlist->prev_hotlist)
|
||||
{
|
||||
(ptr_hotlist->prev_hotlist)->next_hotlist = ptr_hotlist->next_hotlist;
|
||||
new_hotlist = hotlist;
|
||||
}
|
||||
else
|
||||
new_hotlist = ptr_hotlist->next_hotlist;
|
||||
|
||||
if (ptr_hotlist->next_hotlist)
|
||||
(ptr_hotlist->next_hotlist)->prev_hotlist = ptr_hotlist->prev_hotlist;
|
||||
|
||||
free (ptr_hotlist);
|
||||
hotlist = new_hotlist;
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_free_all: free all hotlists
|
||||
*/
|
||||
|
||||
void
|
||||
hotlist_free_all ()
|
||||
{
|
||||
/* remove all hotlists */
|
||||
while (hotlist)
|
||||
hotlist_free (hotlist);
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_remove_buffer: remove a buffer from hotlist
|
||||
*/
|
||||
|
||||
void
|
||||
hotlist_remove_buffer (t_gui_buffer *buffer)
|
||||
{
|
||||
t_weechat_hotlist *pos_hotlist;
|
||||
|
||||
pos_hotlist = hotlist_search (buffer);
|
||||
if (pos_hotlist)
|
||||
hotlist_free (pos_hotlist);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_HOTLIST_H
|
||||
#define __WEECHAT_HOTLIST_H 1
|
||||
|
||||
#include "../irc/irc.h"
|
||||
|
||||
typedef struct t_weechat_hotlist t_weechat_hotlist;
|
||||
|
||||
struct t_weechat_hotlist
|
||||
{
|
||||
int priority; /* 0=crappy msg (join/part), 1=msg, */
|
||||
/* 2=nick highlight */
|
||||
t_gui_buffer *buffer; /* associated buffer */
|
||||
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
|
||||
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
|
||||
};
|
||||
|
||||
extern t_weechat_hotlist *hotlist;
|
||||
extern t_gui_buffer *hotlist_initial_buffer;
|
||||
|
||||
extern void hotlist_add (int, t_gui_buffer *);
|
||||
extern void hotlist_free (t_weechat_hotlist *);
|
||||
extern void hotlist_free_all ();
|
||||
extern void hotlist_remove_buffer (t_gui_buffer *);
|
||||
|
||||
#endif /* hotlist.h */
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* log.c: log buffers to files */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "log.h"
|
||||
#include "weeconfig.h"
|
||||
|
||||
|
||||
/*
|
||||
* log_write_date: writes date to log file
|
||||
*/
|
||||
|
||||
void
|
||||
log_write_date (t_gui_buffer *buffer)
|
||||
{
|
||||
static char buf_time[256];
|
||||
static time_t seconds;
|
||||
struct tm *date_tmp;
|
||||
|
||||
if (buffer->log_file)
|
||||
{
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
if (date_tmp)
|
||||
{
|
||||
strftime (buf_time, sizeof (buf_time) - 1, cfg_log_timestamp, date_tmp);
|
||||
fprintf (buffer->log_file, "%s ", buf_time);
|
||||
fflush (buffer->log_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* log_write: writes a message to log file
|
||||
*/
|
||||
|
||||
void
|
||||
log_write (t_gui_buffer *buffer, char *message)
|
||||
{
|
||||
if (buffer->log_file)
|
||||
{
|
||||
fprintf (buffer->log_file, "%s", message);
|
||||
fflush (buffer->log_file);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* log_start: starts a log
|
||||
*/
|
||||
|
||||
void
|
||||
log_start (t_gui_buffer *buffer)
|
||||
{
|
||||
int length;
|
||||
char *ptr_home;
|
||||
|
||||
ptr_home = getenv ("HOME");
|
||||
length = strlen (cfg_log_path) +
|
||||
((cfg_log_path[0] == '~') ? strlen (ptr_home) : 0) +
|
||||
64;
|
||||
if (SERVER(buffer))
|
||||
length += strlen (SERVER(buffer)->name);
|
||||
if (CHANNEL(buffer))
|
||||
length += strlen (CHANNEL(buffer)->name);
|
||||
buffer->log_filename = (char *) malloc (length);
|
||||
if (!buffer->log_filename)
|
||||
{
|
||||
wee_log_printf (_("Not enough memory to write log file for a buffer\n"));
|
||||
return;
|
||||
}
|
||||
if (cfg_log_path[0] == '~')
|
||||
{
|
||||
strcpy (buffer->log_filename, ptr_home);
|
||||
strcat (buffer->log_filename, cfg_log_path + 1);
|
||||
}
|
||||
else
|
||||
strcpy (buffer->log_filename, cfg_log_path);
|
||||
if (buffer->log_filename[strlen (buffer->log_filename) - 1] != DIR_SEPARATOR_CHAR)
|
||||
strcat (buffer->log_filename, DIR_SEPARATOR);
|
||||
|
||||
if (SERVER(buffer))
|
||||
{
|
||||
strcat (buffer->log_filename, SERVER(buffer)->name);
|
||||
strcat (buffer->log_filename, ".");
|
||||
}
|
||||
if (CHANNEL(buffer))
|
||||
{
|
||||
strcat (buffer->log_filename, CHANNEL(buffer)->name);
|
||||
strcat (buffer->log_filename, ".");
|
||||
}
|
||||
strcat (buffer->log_filename, "weechatlog");
|
||||
|
||||
buffer->log_file = fopen (buffer->log_filename, "a");
|
||||
if (!buffer->log_file)
|
||||
{
|
||||
wee_log_printf (_("Unable to write log file for a buffer\n"));
|
||||
free (buffer->log_filename);
|
||||
return;
|
||||
}
|
||||
log_write (buffer, _("**** Beginning of log "));
|
||||
log_write_date (buffer);
|
||||
log_write (buffer, "****\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* log_end: ends a log
|
||||
*/
|
||||
|
||||
void
|
||||
log_end (t_gui_buffer *buffer)
|
||||
{
|
||||
if (buffer->log_file)
|
||||
{
|
||||
log_write (buffer, _("**** End of log "));
|
||||
log_write_date (buffer);
|
||||
log_write (buffer, "****\n");
|
||||
fclose (buffer->log_file);
|
||||
buffer->log_file = NULL;
|
||||
}
|
||||
if (buffer->log_filename)
|
||||
free (buffer->log_filename);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_LOG_H
|
||||
#define __WEECHAT_LOG_H 1
|
||||
|
||||
#include "../irc/irc.h"
|
||||
|
||||
extern void log_write_date (t_gui_buffer *);
|
||||
extern void log_write (t_gui_buffer *, char *);
|
||||
extern void log_start (t_gui_buffer *);
|
||||
extern void log_end (t_gui_buffer *);
|
||||
|
||||
#endif /* log.h */
|
||||
+194
-47
@@ -10,7 +10,7 @@
|
||||
* ### ###
|
||||
* ### By: FlashCode <flashcode@flashtux.org> ###
|
||||
* ### Bounga <bounga@altern.org> ###
|
||||
* ### Xahlexx <xahlexx@tuxisland.org> ###
|
||||
* ### Xahlexx <xahlexx@weeland.org> ###
|
||||
* ### ###
|
||||
* ### http://weechat.flashtux.org ###
|
||||
* ### ###
|
||||
@@ -60,7 +60,9 @@
|
||||
|
||||
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
|
||||
char *weechat_home; /* WeeChat home dir. (example: /home/toto/.weechat) */
|
||||
FILE *log_file; /* WeeChat log file (~/.weechat/weechat.log) */
|
||||
FILE *weechat_log_file; /* WeeChat log file (~/.weechat/weechat.log) */
|
||||
|
||||
int server_cmd_line; /* at least one server on WeeChat command line */
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,7 +88,7 @@ wee_log_printf (char *message, ...)
|
||||
static time_t seconds;
|
||||
struct tm *date_tmp;
|
||||
|
||||
if (!log_file)
|
||||
if (!weechat_log_file)
|
||||
return;
|
||||
|
||||
va_start (argptr, message);
|
||||
@@ -95,11 +97,87 @@ wee_log_printf (char *message, ...)
|
||||
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
fprintf (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);
|
||||
fflush (log_file);
|
||||
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);
|
||||
else
|
||||
fprintf (weechat_log_file, "%s", buffer);
|
||||
fflush (weechat_log_file);
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_config_options: display config options
|
||||
*/
|
||||
|
||||
void wee_display_config_options ()
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
printf (_("WeeChat configuration options (~/.weechat/weechat.rc):\n\n"));
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if (weechat_options[i])
|
||||
{
|
||||
j = 0;
|
||||
while (weechat_options[i][j].option_name)
|
||||
{
|
||||
printf ("* %s:\n",
|
||||
weechat_options[i][j].option_name);
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
printf (_(" . type boolean (values: 'on' or 'off')\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_int == BOOL_TRUE) ?
|
||||
"on" : "off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
printf (_(" . type integer (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);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
printf (_(" . type string (values: "));
|
||||
k = 0;
|
||||
while (weechat_options[i][j].array_values[k])
|
||||
{
|
||||
printf ("'%s'",
|
||||
weechat_options[i][j].array_values[k]);
|
||||
if (weechat_options[i][j].array_values[k + 1])
|
||||
printf (", ");
|
||||
k++;
|
||||
}
|
||||
printf (")\n");
|
||||
printf (_(" . 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 (Curses or Gtk color, look at WeeChat doc)\n"));
|
||||
printf (_(" . 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 (any string)\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
break;
|
||||
}
|
||||
printf (_(" . description: %s\n\n"),
|
||||
gettext (weechat_options[i][j].long_description));
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf (_("Moreover, you can define aliases in [alias] section, by adding lines like:\n"));
|
||||
printf ("j=join\n");
|
||||
printf (_("where 'j' is alias name, and 'join' associated command.\n\n"));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -110,26 +188,56 @@ void
|
||||
wee_parse_args (int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
t_irc_server server_tmp;
|
||||
|
||||
server_cmd_line = 0;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if ((strcmp (argv[i], "-h") == 0)
|
||||
|| (strcmp (argv[i], "--help") == 0))
|
||||
if ((strcmp (argv[i], "-c") == 0)
|
||||
|| (strcmp (argv[i], "--config") == 0))
|
||||
{
|
||||
printf ("\n%s%s", WEE_USAGE);
|
||||
exit (0);
|
||||
wee_display_config_options ();
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-h") == 0)
|
||||
|| (strcmp (argv[i], "--help") == 0))
|
||||
{
|
||||
printf ("\n" WEE_USAGE1, argv[0], argv[0]);
|
||||
printf ("%s", WEE_USAGE2);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-l") == 0)
|
||||
|| (strcmp (argv[i], "--license") == 0))
|
||||
{
|
||||
printf ("\n%s%s", WEE_LICENSE);
|
||||
exit (0);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-v") == 0)
|
||||
|| (strcmp (argv[i], "--version") == 0))
|
||||
{
|
||||
printf (PACKAGE_VERSION "\n");
|
||||
exit (0);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else if ((strncasecmp (argv[i], "irc://", 6) == 0))
|
||||
{
|
||||
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]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!server_new (server_tmp.name, 0, 1,
|
||||
server_tmp.address, server_tmp.port,
|
||||
server_tmp.password, server_tmp.nick1,
|
||||
server_tmp.nick2, server_tmp.nick3,
|
||||
NULL, NULL, NULL, server_tmp.autojoin, 1))
|
||||
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
server_destroy (&server_tmp);
|
||||
server_cmd_line = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -173,48 +281,87 @@ wee_create_dir (char *directory)
|
||||
void
|
||||
wee_create_home_dirs ()
|
||||
{
|
||||
char *dir_name;
|
||||
char *ptr_home, *dir_name;
|
||||
int dir_length;
|
||||
|
||||
/* TODO: rewrite this code for Windows version */
|
||||
ptr_home = getenv ("HOME");
|
||||
if (!ptr_home)
|
||||
{
|
||||
fprintf (stderr, _("%s unable to get HOME directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
dir_length = strlen (ptr_home) + 10;
|
||||
weechat_home =
|
||||
(char *) malloc ((strlen (getenv ("HOME")) + 10) * sizeof (char));
|
||||
sprintf (weechat_home, "%s%s.weechat", getenv ("HOME"), DIR_SEPARATOR);
|
||||
(char *) malloc (dir_length * sizeof (char));
|
||||
if (!weechat_home)
|
||||
{
|
||||
fprintf (stderr, _("%s not enough memory for home directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
DIR_SEPARATOR);
|
||||
|
||||
/* create home directory "~/.weechat" ; error is fatal */
|
||||
if (!wee_create_dir (weechat_home))
|
||||
exit (1);
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create ~/.weechat directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
dir_name = (char *) malloc ((strlen (weechat_home) + 64) * sizeof (char));
|
||||
dir_length = strlen (weechat_home) + 64;
|
||||
dir_name = (char *) malloc (dir_length * sizeof (char));
|
||||
|
||||
#ifdef PLUGIN_PERL
|
||||
/* create "~/.weechat/perl" */
|
||||
sprintf (dir_name, "%s%s%s", weechat_home, DIR_SEPARATOR, "perl");
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
|
||||
"perl");
|
||||
if (wee_create_dir (dir_name))
|
||||
{
|
||||
/* create "~/.weechat/perl/autoload" */
|
||||
sprintf (dir_name, "%s%s%s%s%s", weechat_home, DIR_SEPARATOR, "perl",
|
||||
DIR_SEPARATOR, "autoload");
|
||||
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home,
|
||||
DIR_SEPARATOR, "perl", DIR_SEPARATOR, "autoload");
|
||||
wee_create_dir (dir_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PLUGIN_PYTHON
|
||||
/* create "~/.weechat/python" */
|
||||
sprintf (dir_name, "%s%s%s", weechat_home, DIR_SEPARATOR, "python");
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
|
||||
"python");
|
||||
if (wee_create_dir (dir_name))
|
||||
{
|
||||
/* create "~/.weechat/python/autoload" */
|
||||
sprintf (dir_name, "%s%s%s%s%s", weechat_home, DIR_SEPARATOR, "python",
|
||||
DIR_SEPARATOR, "autoload");
|
||||
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home,
|
||||
DIR_SEPARATOR, "python", DIR_SEPARATOR, "autoload");
|
||||
wee_create_dir (dir_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PLUGIN_RUBY
|
||||
/* create "~/.weechat/ruby" */
|
||||
sprintf (dir_name, "%s%s%s", weechat_home, DIR_SEPARATOR, "ruby");
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
|
||||
"ruby");
|
||||
if (wee_create_dir (dir_name))
|
||||
{
|
||||
/* create "~/.weechat/ruby/autoload" */
|
||||
sprintf (dir_name, "%s%s%s%s%s", weechat_home, DIR_SEPARATOR, "ruby",
|
||||
DIR_SEPARATOR, "autoload");
|
||||
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home,
|
||||
DIR_SEPARATOR, "ruby", DIR_SEPARATOR, "autoload");
|
||||
wee_create_dir (dir_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* create "~/.weechat/logs" */
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
|
||||
"logs");
|
||||
if (!wee_create_dir (dir_name))
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create ~/.weechat/logs directory\n"),
|
||||
WEECHAT_WARNING);
|
||||
}
|
||||
|
||||
free (dir_name);
|
||||
}
|
||||
@@ -226,9 +373,6 @@ wee_create_home_dirs ()
|
||||
void
|
||||
wee_init_vars ()
|
||||
{
|
||||
/* GUI not yet initialized */
|
||||
gui_ready = 0;
|
||||
|
||||
/* init received messages queue */
|
||||
recv_msgq = NULL;
|
||||
msgq_last_msg = NULL;
|
||||
@@ -241,18 +385,17 @@ wee_init_vars ()
|
||||
void
|
||||
wee_init_log ()
|
||||
{
|
||||
int filename_length;
|
||||
char *filename;
|
||||
|
||||
filename_length = strlen (weechat_home) + 64;
|
||||
filename =
|
||||
(char *) malloc ((strlen (weechat_home) + 64) * sizeof (char));
|
||||
sprintf (filename, "%s/" WEECHAT_LOG_NAME, weechat_home);
|
||||
if ((log_file = fopen (filename, "wt")) == NULL)
|
||||
{
|
||||
free (filename);
|
||||
(char *) malloc (filename_length * sizeof (char));
|
||||
snprintf (filename, filename_length, "%s/" WEECHAT_LOG_NAME, weechat_home);
|
||||
if ((weechat_log_file = fopen (filename, "wt")) == NULL)
|
||||
fprintf (stderr,
|
||||
_("%s unable to create/append to log file (~/.weechat/%s)"),
|
||||
WEECHAT_ERROR, WEECHAT_LOG_NAME);
|
||||
}
|
||||
WEECHAT_WARNING, WEECHAT_LOG_NAME);
|
||||
free (filename);
|
||||
}
|
||||
|
||||
@@ -303,11 +446,12 @@ weechat_welcome_message ()
|
||||
void
|
||||
wee_shutdown ()
|
||||
{
|
||||
dcc_end ();
|
||||
server_free_all ();
|
||||
gui_end ();
|
||||
if (log_file)
|
||||
fclose (log_file);
|
||||
exit (0);
|
||||
if (weechat_log_file)
|
||||
fclose (weechat_log_file);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -336,25 +480,28 @@ main (int argc, char *argv[])
|
||||
case 0: /* config file OK */
|
||||
break;
|
||||
case -1: /* config file not found */
|
||||
config_create_default ();
|
||||
config_read ();
|
||||
if (config_create_default () < 0)
|
||||
return EXIT_FAILURE;
|
||||
if (config_read () != 0)
|
||||
return EXIT_FAILURE;
|
||||
break;
|
||||
default: /* other error (fatal) */
|
||||
server_free_all ();
|
||||
return 1;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
gui_init (); /* init WeeChat interface */
|
||||
plugin_init (); /* init plugin interface(s) */
|
||||
weechat_welcome_message (); /* display WeeChat welcome message */
|
||||
server_auto_connect (); /* auto-connect to servers */
|
||||
/* auto-connect to servers */
|
||||
server_auto_connect (server_cmd_line);
|
||||
|
||||
gui_main_loop (); /* WeeChat main loop */
|
||||
|
||||
plugin_end (); /* end plugin interface(s) */
|
||||
server_disconnect_all (); /* disconnect from all servers */
|
||||
config_write (NULL); /* save config file */
|
||||
(void) config_write (NULL); /* save config file */
|
||||
wee_shutdown (); /* quit WeeChat (oh no, why?) */
|
||||
|
||||
return 0; /* make gcc happy (never executed) */
|
||||
return EXIT_SUCCESS; /* make gcc happy (never executed) */
|
||||
}
|
||||
|
||||
+14
-8
@@ -59,7 +59,8 @@
|
||||
PACKAGE_STRING " (c) Copyright 2004, compiled on " __DATE__ " " __TIME__ \
|
||||
"\nDeveloped by FlashCode <flashcode@flashtux.org>\n" \
|
||||
" Bounga <bounga@altern.org>\n" \
|
||||
" Xahlexx <xahlexx@tuxisland.org>\n\n" \
|
||||
" Xahlexx <xahlexx@weeland.org>\n" \
|
||||
"Website: " 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" \
|
||||
"the Free Software Foundation; either version 2 of the License, or\n" \
|
||||
@@ -75,21 +76,26 @@
|
||||
"along with this program; if not, write to the Free Software\n" \
|
||||
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\n"
|
||||
|
||||
#define WEE_USAGE \
|
||||
#define WEE_USAGE1 \
|
||||
PACKAGE_STRING " (c) Copyright 2004, compiled on " __DATE__ " " __TIME__ \
|
||||
"\nDeveloped by FlashCode <flashcode@flashtux.org>\n" \
|
||||
" Bounga <bounga@altern.org>\n" \
|
||||
" Xahlexx <xahlexx@tuxisland.org>\n\n" \
|
||||
" -h, --help this help screen\n", \
|
||||
"\nDeveloped by FlashCode, Bounga and Xahlexx - " WEECHAT_WEBSITE "\n\n" \
|
||||
"Usage: %s [options ...]\n" \
|
||||
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
|
||||
|
||||
#define WEE_USAGE2 \
|
||||
" -c, --config config file help (list of options)\n" \
|
||||
" -h, --help this help screen\n" \
|
||||
" -l, --license display WeeChat license\n" \
|
||||
" -v, --version display WeeChat version\n\n"
|
||||
|
||||
/* directory separator, depending on OS */
|
||||
|
||||
#ifdef _WIN32
|
||||
#define DIR_SEPARATOR "\\"
|
||||
#define DIR_SEPARATOR "\\"
|
||||
#define DIR_SEPARATOR_CHAR '\\'
|
||||
#else
|
||||
#define DIR_SEPARATOR "/"
|
||||
#define DIR_SEPARATOR "/"
|
||||
#define DIR_SEPARATOR_CHAR '/'
|
||||
#endif
|
||||
|
||||
/* global variables and functions */
|
||||
|
||||
+410
-221
File diff suppressed because it is too large
Load Diff
+30
-7
@@ -70,7 +70,7 @@ struct t_config_option
|
||||
char **array_values;
|
||||
int *ptr_int;
|
||||
char **ptr_string;
|
||||
int (*handler_change)(int *, char **);
|
||||
void (*handler_change)();
|
||||
};
|
||||
|
||||
extern int cfg_look_set_title;
|
||||
@@ -88,6 +88,10 @@ extern int cfg_look_nickmode;
|
||||
extern int cfg_look_nickmode_empty;
|
||||
extern char *cfg_look_no_nickname;
|
||||
extern char *cfg_look_completor;
|
||||
extern int cfg_look_display_away;
|
||||
extern int cfg_look_infobar;
|
||||
extern char *cfg_look_infobar_timestamp;
|
||||
extern int cfg_look_infobar_delay_highlight;
|
||||
|
||||
extern int cfg_col_title;
|
||||
extern int cfg_col_title_bg;
|
||||
@@ -103,11 +107,15 @@ extern int cfg_col_chat_dark;
|
||||
extern int cfg_col_chat_highlight;
|
||||
extern int cfg_col_chat_bg;
|
||||
extern int cfg_col_status;
|
||||
extern int cfg_col_status_active;
|
||||
extern int cfg_col_status_delimiters;
|
||||
extern int cfg_col_status_data_msg;
|
||||
extern int cfg_col_status_data_highlight;
|
||||
extern int cfg_col_status_data_other;
|
||||
extern int cfg_col_status_more;
|
||||
extern int cfg_col_status_bg;
|
||||
extern int cfg_col_infobar;
|
||||
extern int cfg_col_infobar_highlight;
|
||||
extern int cfg_col_infobar_bg;
|
||||
extern int cfg_col_input;
|
||||
extern int cfg_col_input_channel;
|
||||
extern int cfg_col_input_nick;
|
||||
@@ -120,22 +128,28 @@ extern int cfg_col_nick_sep;
|
||||
extern int cfg_col_nick_self;
|
||||
extern int cfg_col_nick_private;
|
||||
extern int cfg_col_nick_bg;
|
||||
extern int cfg_col_dcc_selected;
|
||||
extern int cfg_col_dcc_waiting;
|
||||
extern int cfg_col_dcc_connecting;
|
||||
extern int cfg_col_dcc_active;
|
||||
extern int cfg_col_dcc_done;
|
||||
extern int cfg_col_dcc_failed;
|
||||
extern int cfg_col_dcc_aborted;
|
||||
|
||||
extern int cfg_history_max_lines;
|
||||
extern int cfg_history_max_commands;
|
||||
|
||||
extern int cfg_log_auto_channels;
|
||||
extern int cfg_log_auto_server;
|
||||
extern int cfg_log_auto_channel;
|
||||
extern int cfg_log_auto_private;
|
||||
extern char *cfg_log_path;
|
||||
extern char *cfg_log_name;
|
||||
extern char *cfg_log_timestamp;
|
||||
extern char *cfg_log_start_string;
|
||||
extern char *cfg_log_end_string;
|
||||
extern int cfg_log_hide_nickserv_pwd;
|
||||
|
||||
extern int cfg_dcc_auto_accept_files;
|
||||
extern int cfg_dcc_auto_accept_max_size;
|
||||
extern int cfg_dcc_auto_accept_chats;
|
||||
extern int cfg_dcc_timeout;
|
||||
extern int cfg_dcc_blocksize;
|
||||
extern char *cfg_dcc_download_path;
|
||||
extern char *cfg_dcc_upload_path;
|
||||
extern int cfg_dcc_auto_rename;
|
||||
@@ -149,6 +163,15 @@ extern char *cfg_proxy_password;
|
||||
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
|
||||
extern t_config_option * weechat_options [CONFIG_NUMBER_SECTIONS];
|
||||
|
||||
extern char *config_get_section ();
|
||||
extern void config_change_noop ();
|
||||
extern void config_change_title ();
|
||||
extern void config_change_buffers ();
|
||||
extern void config_change_buffer_content ();
|
||||
extern void config_change_color ();
|
||||
extern int config_option_set_value (t_config_option *, char *);
|
||||
extern t_config_option *config_option_search (char *);
|
||||
extern int config_set_value (char *, char *);
|
||||
extern int config_read ();
|
||||
extern int config_create_default ();
|
||||
extern int config_write ();
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
bin_PROGRAMS = weechat-curses
|
||||
|
||||
weechat_curses_LDADD = ../../common/lib_weechat_main.a \
|
||||
|
||||
+1253
-756
File diff suppressed because it is too large
Load Diff
+435
-171
@@ -37,6 +37,7 @@
|
||||
#include "../gui.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "../../common/command.h"
|
||||
#include "../../common/hotlist.h"
|
||||
#include "../../irc/irc.h"
|
||||
|
||||
#define KEY_ESCAPE 27
|
||||
@@ -49,239 +50,347 @@ void
|
||||
gui_read_keyb ()
|
||||
{
|
||||
int key, i;
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
char new_char[2];
|
||||
t_dcc *dcc_selected;
|
||||
|
||||
key = getch ();
|
||||
if (key != ERR)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
/* resize event: do nothing */
|
||||
/* resize event */
|
||||
case KEY_RESIZE:
|
||||
gui_redraw_window (gui_current_window);
|
||||
gui_curses_resize_handler ();
|
||||
break;
|
||||
/* inactive function keys */
|
||||
case KEY_F(1):
|
||||
case KEY_F(2):
|
||||
case KEY_F(3):
|
||||
case KEY_F(4):
|
||||
case KEY_F(5):
|
||||
case KEY_F(9):
|
||||
case KEY_F(11):
|
||||
case KEY_F(12):
|
||||
break;
|
||||
/* previous buffer in window */
|
||||
case KEY_F(6):
|
||||
gui_switch_to_previous_window ();
|
||||
gui_switch_to_previous_buffer (gui_current_window);
|
||||
break;
|
||||
/* next buffer in window */
|
||||
case KEY_F(7):
|
||||
gui_switch_to_next_buffer (gui_current_window);
|
||||
break;
|
||||
/* next window */
|
||||
case KEY_F(7):
|
||||
gui_switch_to_next_window ();
|
||||
case KEY_F(8):
|
||||
gui_switch_to_next_window (gui_current_window);
|
||||
break;
|
||||
/* remove last infobar message */
|
||||
case KEY_F(10):
|
||||
gui_infobar_remove ();
|
||||
break;
|
||||
/* cursor up */
|
||||
case KEY_UP:
|
||||
if (gui_current_window->ptr_history)
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->ptr_history =
|
||||
gui_current_window->ptr_history->next_history;
|
||||
if (!gui_current_window->ptr_history)
|
||||
gui_current_window->ptr_history =
|
||||
gui_current_window->history;
|
||||
if (dcc_list)
|
||||
{
|
||||
if (gui_current_window->dcc_selected
|
||||
&& ((t_dcc *)(gui_current_window->dcc_selected))->prev_dcc)
|
||||
{
|
||||
if (gui_current_window->dcc_selected ==
|
||||
gui_current_window->dcc_first)
|
||||
gui_current_window->dcc_first =
|
||||
((t_dcc *)(gui_current_window->dcc_first))->prev_dcc;
|
||||
gui_current_window->dcc_selected =
|
||||
((t_dcc *)(gui_current_window->dcc_selected))->prev_dcc;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 1);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
gui_current_window->ptr_history =
|
||||
gui_current_window->history;
|
||||
if (gui_current_window->ptr_history)
|
||||
{
|
||||
gui_current_window->input_buffer_size =
|
||||
strlen (gui_current_window->ptr_history->text);
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->input_buffer_size;
|
||||
strcpy (gui_current_window->input_buffer,
|
||||
gui_current_window->ptr_history->text);
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->ptr_history->next_history;
|
||||
if (!gui_current_window->buffer->ptr_history)
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->history;
|
||||
}
|
||||
else
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->history;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_size =
|
||||
strlen (gui_current_window->buffer->ptr_history->text);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
strcpy (gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->ptr_history->text);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor down */
|
||||
case KEY_DOWN:
|
||||
if (gui_current_window->ptr_history)
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->ptr_history =
|
||||
gui_current_window->ptr_history->prev_history;
|
||||
if (gui_current_window->ptr_history)
|
||||
gui_current_window->input_buffer_size =
|
||||
strlen (gui_current_window->ptr_history->text);
|
||||
else
|
||||
gui_current_window->input_buffer_size = 0;
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->input_buffer_size;
|
||||
if (gui_current_window->ptr_history)
|
||||
strcpy (gui_current_window->input_buffer,
|
||||
gui_current_window->ptr_history->text);
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (dcc_list)
|
||||
{
|
||||
if (!gui_current_window->dcc_selected
|
||||
|| ((t_dcc *)(gui_current_window->dcc_selected))->next_dcc)
|
||||
{
|
||||
if (gui_current_window->dcc_last_displayed
|
||||
&& (gui_current_window->dcc_selected ==
|
||||
gui_current_window->dcc_last_displayed))
|
||||
{
|
||||
if (gui_current_window->dcc_first)
|
||||
gui_current_window->dcc_first =
|
||||
((t_dcc *)(gui_current_window->dcc_first))->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_first =
|
||||
dcc_list->next_dcc;
|
||||
}
|
||||
if (gui_current_window->dcc_selected)
|
||||
gui_current_window->dcc_selected =
|
||||
((t_dcc *)(gui_current_window->dcc_selected))->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_selected =
|
||||
dcc_list->next_dcc;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 1);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->ptr_history->prev_history;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
gui_current_window->buffer->input_buffer_size =
|
||||
strlen (gui_current_window->buffer->ptr_history->text);
|
||||
else
|
||||
gui_current_window->buffer->input_buffer_size = 0;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
strcpy (gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->ptr_history->text);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor left */
|
||||
case KEY_LEFT:
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer_pos--;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos--;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor right */
|
||||
case KEY_RIGHT:
|
||||
if (gui_current_window->input_buffer_pos <
|
||||
gui_current_window->input_buffer_size)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer_pos++;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* home key */
|
||||
case KEY_HOME:
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer_pos = 0;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos = 0;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* end key */
|
||||
case KEY_END:
|
||||
if (gui_current_window->input_buffer_pos <
|
||||
gui_current_window->input_buffer_size)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->input_buffer_size;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* page up */
|
||||
case KEY_PPAGE:
|
||||
gui_move_page_up ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_page_up (gui_current_window);
|
||||
break;
|
||||
/* page down */
|
||||
case KEY_NPAGE:
|
||||
gui_move_page_down ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_page_down (gui_current_window);
|
||||
break;
|
||||
/* erase before cursor and move cursor to the left */
|
||||
case 127:
|
||||
case KEY_BACKSPACE:
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos-1;
|
||||
while (gui_current_window->input_buffer[i])
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i+1];
|
||||
i++;
|
||||
i = gui_current_window->buffer->input_buffer_pos-1;
|
||||
while (gui_current_window->buffer->input_buffer[i])
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i+1];
|
||||
i++;
|
||||
}
|
||||
gui_current_window->buffer->input_buffer_size--;
|
||||
gui_current_window->buffer->input_buffer_pos--;
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
gui_current_window->input_buffer_size--;
|
||||
gui_current_window->input_buffer_pos--;
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->completion.position = -1;
|
||||
}
|
||||
break;
|
||||
/* Control + Backspace */
|
||||
case 0x08:
|
||||
gui_delete_previous_word ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_delete_previous_word (gui_current_window->buffer);
|
||||
break;
|
||||
/* Control + L */
|
||||
case 0x0C:
|
||||
gui_curses_resize_handler ();
|
||||
break;
|
||||
/* erase char under cursor */
|
||||
case KEY_DC:
|
||||
if (gui_current_window->input_buffer_pos <
|
||||
gui_current_window->input_buffer_size)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos;
|
||||
while (gui_current_window->input_buffer[i])
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i+1];
|
||||
i++;
|
||||
i = gui_current_window->buffer->input_buffer_pos;
|
||||
while (gui_current_window->buffer->input_buffer[i])
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i+1];
|
||||
i++;
|
||||
}
|
||||
gui_current_window->buffer->input_buffer_size--;
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
gui_current_window->input_buffer_size--;
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->completion.position = -1;
|
||||
}
|
||||
break;
|
||||
/* Tab : completion */
|
||||
case '\t':
|
||||
completion_search (&(gui_current_window->completion),
|
||||
CHANNEL(gui_current_window),
|
||||
gui_current_window->input_buffer,
|
||||
gui_current_window->input_buffer_size,
|
||||
gui_current_window->input_buffer_pos);
|
||||
if (gui_current_window->completion.word_found)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
// replace word with new completed word into input buffer
|
||||
gui_current_window->input_buffer_size +=
|
||||
gui_current_window->completion.diff_size;
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
|
||||
if (gui_current_window->completion.diff_size > 0)
|
||||
completion_search (&(gui_current_window->buffer->completion),
|
||||
CHANNEL(gui_current_window->buffer),
|
||||
gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->input_buffer_size,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
if (gui_current_window->buffer->completion.word_found)
|
||||
{
|
||||
for (i = gui_current_window->input_buffer_size - 1;
|
||||
i >= gui_current_window->completion.position_replace +
|
||||
(int)strlen (gui_current_window->completion.word_found); i--)
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i -
|
||||
gui_current_window->completion.diff_size];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = gui_current_window->completion.position_replace +
|
||||
strlen (gui_current_window->completion.word_found);
|
||||
i < gui_current_window->input_buffer_size; i++)
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i -
|
||||
gui_current_window->completion.diff_size];
|
||||
}
|
||||
|
||||
strncpy (gui_current_window->input_buffer + gui_current_window->completion.position_replace,
|
||||
gui_current_window->completion.word_found,
|
||||
strlen (gui_current_window->completion.word_found));
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->completion.position_replace +
|
||||
strlen (gui_current_window->completion.word_found);
|
||||
gui_current_window->completion.position =
|
||||
gui_current_window->input_buffer_pos;
|
||||
|
||||
/* add space or completor to the end of completion, if needed */
|
||||
if (gui_current_window->completion.base_word[0] == '/')
|
||||
{
|
||||
if (gui_current_window->input_buffer[gui_current_window->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (" ",
|
||||
gui_current_window->input_buffer_pos);
|
||||
gui_current_window->completion.position++;
|
||||
gui_current_window->input_buffer_pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->completion.base_word_pos == 0)
|
||||
/* replace word with new completed word into input buffer */
|
||||
gui_current_window->buffer->input_buffer_size +=
|
||||
gui_current_window->buffer->completion.diff_size;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
|
||||
if (gui_current_window->buffer->completion.diff_size > 0)
|
||||
{
|
||||
if (strncmp (gui_current_window->input_buffer + gui_current_window->input_buffer_pos,
|
||||
cfg_look_completor, strlen (cfg_look_completor)) != 0)
|
||||
gui_buffer_insert_string (cfg_look_completor,
|
||||
gui_current_window->input_buffer_pos);
|
||||
gui_current_window->completion.position += strlen (cfg_look_completor);
|
||||
gui_current_window->input_buffer_pos += strlen (cfg_look_completor);
|
||||
if (gui_current_window->input_buffer[gui_current_window->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (" ",
|
||||
gui_current_window->input_buffer_pos);
|
||||
gui_current_window->completion.position++;
|
||||
gui_current_window->input_buffer_pos++;
|
||||
for (i = gui_current_window->buffer->input_buffer_size - 1;
|
||||
i >= gui_current_window->buffer->completion.position_replace +
|
||||
(int)strlen (gui_current_window->buffer->completion.word_found); i--)
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i -
|
||||
gui_current_window->buffer->completion.diff_size];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = gui_current_window->buffer->completion.position_replace +
|
||||
strlen (gui_current_window->buffer->completion.word_found);
|
||||
i < gui_current_window->buffer->input_buffer_size; i++)
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i -
|
||||
gui_current_window->buffer->completion.diff_size];
|
||||
}
|
||||
|
||||
strncpy (gui_current_window->buffer->input_buffer + gui_current_window->buffer->completion.position_replace,
|
||||
gui_current_window->buffer->completion.word_found,
|
||||
strlen (gui_current_window->buffer->completion.word_found));
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->completion.position_replace +
|
||||
strlen (gui_current_window->buffer->completion.word_found);
|
||||
gui_current_window->buffer->completion.position =
|
||||
gui_current_window->buffer->input_buffer_pos;
|
||||
|
||||
/* add space or completor to the end of completion, if needed */
|
||||
if (gui_current_window->buffer->completion.base_word[0] == '/')
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
" ",
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->completion.position++;
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->buffer->completion.base_word_pos == 0)
|
||||
{
|
||||
if (strncmp (gui_current_window->buffer->input_buffer + gui_current_window->buffer->input_buffer_pos,
|
||||
cfg_look_completor, strlen (cfg_look_completor)) != 0)
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
cfg_look_completor,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->completion.position += strlen (cfg_look_completor);
|
||||
gui_current_window->buffer->input_buffer_pos += strlen (cfg_look_completor);
|
||||
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
" ",
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->completion.position++;
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
}
|
||||
}
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
gui_draw_window_input (gui_current_window);
|
||||
}
|
||||
break;
|
||||
/* escape code (for control-key) */
|
||||
case KEY_ESCAPE:
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
switch (key)
|
||||
{
|
||||
/* Alt + left arrow */
|
||||
case KEY_LEFT:
|
||||
gui_switch_to_previous_window ();
|
||||
gui_switch_to_previous_buffer (gui_current_window);
|
||||
break;
|
||||
/* Alt + right arrow */
|
||||
case KEY_RIGHT:
|
||||
gui_switch_to_next_window ();
|
||||
gui_switch_to_next_buffer (gui_current_window);
|
||||
break;
|
||||
case 79:
|
||||
/* TODO: replace 79 by constant name! */
|
||||
@@ -293,50 +402,175 @@ gui_read_keyb ()
|
||||
{
|
||||
/* Control + Right */
|
||||
case 99:
|
||||
gui_move_next_word ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_next_word (gui_current_window->buffer);
|
||||
break;
|
||||
/* Control + Left */
|
||||
case 100:
|
||||
gui_move_previous_word ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_previous_word (gui_current_window->buffer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-number */
|
||||
case 48: /* Alt-0 */
|
||||
case 49: /* Alt-1 */
|
||||
case 50: /* Alt-2 */
|
||||
case 51: /* Alt-3 */
|
||||
case 52: /* Alt-4 */
|
||||
case 53: /* Alt-5 */
|
||||
case 54: /* Alt-6 */
|
||||
case 55: /* Alt-7 */
|
||||
case 56: /* Alt-8 */
|
||||
case 57: /* Alt-9 */
|
||||
gui_switch_to_buffer_by_number (gui_current_window, (key == 48) ? 10 : key - 48);
|
||||
break;
|
||||
/* Alt-A */
|
||||
case 'a':
|
||||
case 'A':
|
||||
if (hotlist)
|
||||
{
|
||||
if (!hotlist_initial_buffer)
|
||||
hotlist_initial_buffer = gui_current_window->buffer;
|
||||
gui_switch_to_buffer (gui_current_window, hotlist->buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hotlist_initial_buffer)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window, hotlist_initial_buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
hotlist_initial_buffer = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-D */
|
||||
case 'd':
|
||||
case 'D':
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (buffer_before_dcc)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window,
|
||||
buffer_before_dcc);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_before_dcc = gui_current_window->buffer;
|
||||
gui_switch_to_dcc_buffer ();
|
||||
}
|
||||
break;
|
||||
/* Alt-R */
|
||||
case 'r':
|
||||
case 'R':
|
||||
if (hotlist)
|
||||
{
|
||||
hotlist_free_all ();
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
hotlist_initial_buffer = gui_current_window->buffer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* send command/message */
|
||||
case '\n':
|
||||
if (gui_current_window->input_buffer_size > 0)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
history_add (gui_current_window, gui_current_window->input_buffer);
|
||||
gui_current_window->input_buffer_size = 0;
|
||||
gui_current_window->input_buffer_pos = 0;
|
||||
gui_current_window->input_buffer_1st_display = 0;
|
||||
gui_current_window->completion.position = -1;
|
||||
gui_current_window->ptr_history = NULL;
|
||||
ptr_window = gui_current_window;
|
||||
user_command (SERVER(gui_current_window),
|
||||
gui_current_window->input_buffer);
|
||||
if (ptr_window == gui_current_window)
|
||||
gui_draw_window_input (ptr_window);
|
||||
if (ptr_window)
|
||||
ptr_window->input_buffer[0] = '\0';
|
||||
if (gui_current_window->buffer->input_buffer_size > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
history_add (gui_current_window->buffer, gui_current_window->buffer->input_buffer);
|
||||
gui_current_window->buffer->input_buffer_size = 0;
|
||||
gui_current_window->buffer->input_buffer_pos = 0;
|
||||
gui_current_window->buffer->input_buffer_1st_display = 0;
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
gui_current_window->buffer->ptr_history = NULL;
|
||||
ptr_buffer = gui_current_window->buffer;
|
||||
user_command (SERVER(gui_current_window->buffer),
|
||||
gui_current_window->buffer->input_buffer);
|
||||
if (ptr_buffer == gui_current_window->buffer)
|
||||
gui_draw_buffer_input (ptr_buffer, 0);
|
||||
if (ptr_buffer)
|
||||
ptr_buffer->input_buffer[0] = '\0';
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* other key => add to input buffer */
|
||||
default:
|
||||
/*gui_printf (gui_current_window,
|
||||
"[Debug] key pressed = %d, as octal: %o\n", key, key);*/
|
||||
new_char[0] = key;
|
||||
new_char[1] = '\0';
|
||||
gui_buffer_insert_string (new_char,
|
||||
gui_current_window->input_buffer_pos);
|
||||
gui_current_window->input_buffer_pos++;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_current_window->completion.position = -1;
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
dcc_selected = (gui_current_window->dcc_selected) ?
|
||||
(t_dcc *) gui_current_window->dcc_selected : dcc_list;
|
||||
switch (key)
|
||||
{
|
||||
/* accept DCC */
|
||||
case 'a':
|
||||
case 'A':
|
||||
if (dcc_selected
|
||||
&& (((dcc_selected->type == DCC_CHAT_RECV)
|
||||
|| (dcc_selected->type == DCC_FILE_RECV))
|
||||
&& (dcc_selected->status == DCC_WAITING)))
|
||||
{
|
||||
dcc_accept (dcc_selected);
|
||||
}
|
||||
break;
|
||||
/* cancel DCC */
|
||||
case 'c':
|
||||
case 'C':
|
||||
if (dcc_selected
|
||||
&& ((dcc_selected->status == DCC_WAITING)
|
||||
|| (dcc_selected->status == DCC_CONNECTING)
|
||||
|| (dcc_selected->status == DCC_ACTIVE)))
|
||||
{
|
||||
dcc_close (dcc_selected, DCC_ABORTED);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
/* close DCC window */
|
||||
case 'q':
|
||||
case 'Q':
|
||||
gui_buffer_free (gui_current_window->buffer, 1);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
break;
|
||||
/* remove from DCC list */
|
||||
case 'r':
|
||||
case 'R':
|
||||
if (dcc_selected
|
||||
&& (((dcc_selected->type == DCC_CHAT_RECV)
|
||||
|| (dcc_selected->type == DCC_FILE_RECV))
|
||||
&& ((dcc_selected->status == DCC_DONE)
|
||||
|| (dcc_selected->status == DCC_FAILED)
|
||||
|| (dcc_selected->status == DCC_ABORTED))))
|
||||
{
|
||||
if (dcc_selected->next_dcc)
|
||||
gui_current_window->dcc_selected = dcc_selected->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_selected = NULL;
|
||||
dcc_free (dcc_selected);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
new_char[0] = key;
|
||||
new_char[1] = '\0';
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
new_char,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -352,10 +586,37 @@ gui_main_loop ()
|
||||
fd_set read_fd;
|
||||
static struct timeval timeout;
|
||||
t_irc_server *ptr_server;
|
||||
int old_min, old_sec;
|
||||
time_t new_time;
|
||||
struct tm *local_time;
|
||||
|
||||
quit_weechat = 0;
|
||||
old_min = -1;
|
||||
old_sec = -1;
|
||||
while (!quit_weechat)
|
||||
{
|
||||
new_time = time (NULL);
|
||||
local_time = localtime (&new_time);
|
||||
|
||||
/* minute has changed ? => redraw infobar */
|
||||
if (local_time->tm_min != old_min)
|
||||
{
|
||||
old_min = local_time->tm_min;
|
||||
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
|
||||
}
|
||||
|
||||
/* second has changed ? => count down time for infobar, if needed */
|
||||
if (local_time->tm_sec != old_sec)
|
||||
{
|
||||
old_sec = local_time->tm_sec;
|
||||
if (gui_infobar && gui_infobar->remaining_time > 0)
|
||||
{
|
||||
gui_infobar->remaining_time--;
|
||||
if (gui_infobar->remaining_time == 0)
|
||||
gui_infobar_remove ();
|
||||
}
|
||||
}
|
||||
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 10000;
|
||||
FD_ZERO (&read_fd);
|
||||
@@ -383,5 +644,8 @@ gui_main_loop ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* manages active DCC */
|
||||
dcc_handle ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
bin_PROGRAMS = weechat-gtk
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GTK_CFLAGS)
|
||||
|
||||
INCLUDES = $(GTK_CFLAGS)
|
||||
bin_PROGRAMS = weechat-gtk
|
||||
|
||||
weechat_gtk_LDADD = ../../common/lib_weechat_main.a \
|
||||
../../irc/lib_weechat_irc.a \
|
||||
|
||||
@@ -349,6 +349,35 @@ gui_redraw_window_status (t_gui_window *window)
|
||||
gui_draw_window_status (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_window_infobar: draw infobar window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_draw_window_infobar (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: draw infobar window! */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_redraw_window_infobar: redraw infobar window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_redraw_window_infobar (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: first delete window content */
|
||||
gui_draw_window_infobar (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_window_input: draw input window
|
||||
*/
|
||||
@@ -570,6 +599,16 @@ gui_init_colors ()
|
||||
/* TODO: init colors for Gtk */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_set_window_title: set window title
|
||||
*/
|
||||
|
||||
void
|
||||
gui_set_window_title ()
|
||||
{
|
||||
/* TODO: set window title for Gtk */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_init: init GUI
|
||||
*/
|
||||
|
||||
+523
-198
@@ -34,86 +34,80 @@
|
||||
|
||||
#include "../common/weechat.h"
|
||||
#include "gui.h"
|
||||
#include "../common/weeconfig.h"
|
||||
#include "../common/hotlist.h"
|
||||
#include "../common/log.h"
|
||||
#include "../irc/irc.h"
|
||||
|
||||
|
||||
int gui_ready; /* = 1 if GUI is initialized */
|
||||
int gui_init_ok = 0; /* = 1 if GUI is initialized */
|
||||
int gui_ok = 0; /* = 1 if GUI is ok */
|
||||
/* (0 when term size too small) */
|
||||
|
||||
t_gui_window *gui_windows = NULL; /* pointer to first window */
|
||||
t_gui_window *last_gui_window = NULL; /* pointer to last window */
|
||||
t_gui_window *gui_current_window = NULL; /* pointer to current window */
|
||||
|
||||
t_gui_buffer *gui_buffers = NULL; /* pointer to first buffer */
|
||||
t_gui_buffer *last_gui_buffer = NULL; /* pointer to last buffer */
|
||||
t_gui_buffer *buffer_before_dcc = NULL; /* buffer before dcc switch */
|
||||
t_gui_infobar *gui_infobar; /* pointer to infobar content */
|
||||
|
||||
|
||||
/*
|
||||
* gui_window_new: create a new window
|
||||
* (TODO: add coordinates and size, for splited windows)
|
||||
*/
|
||||
|
||||
t_gui_window *
|
||||
gui_window_new (void *server, void *channel, int switch_to_window
|
||||
/*int x, int y, int width, int height*/)
|
||||
gui_window_new (int x, int y, int width, int height)
|
||||
{
|
||||
t_gui_window *new_window;
|
||||
|
||||
if (gui_windows)
|
||||
{
|
||||
/* use first window if no server was assigned to this window */
|
||||
if (!SERVER(gui_windows))
|
||||
{
|
||||
if (server)
|
||||
((t_irc_server *)(server))->window = gui_windows;
|
||||
if (channel)
|
||||
((t_irc_channel *)(channel))->window = gui_windows;
|
||||
SERVER(gui_windows) = server;
|
||||
CHANNEL(gui_windows) = channel;
|
||||
return gui_windows;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
wee_log_printf ("creating new window (x:%d, y:%d, width:%d, height:%d)\n",
|
||||
x, y, width, height);
|
||||
#endif
|
||||
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
|
||||
{
|
||||
new_window->is_displayed = 0;
|
||||
new_window->win_x = x;
|
||||
new_window->win_y = y;
|
||||
new_window->win_width = width;
|
||||
new_window->win_height = height;
|
||||
|
||||
/* assign server and channel to window */
|
||||
SERVER(new_window) = server;
|
||||
CHANNEL(new_window) = channel;
|
||||
/* assign window to server and channel */
|
||||
if (server && !channel)
|
||||
SERVER(new_window)->window = new_window;
|
||||
if (channel)
|
||||
CHANNEL(new_window)->window = new_window;
|
||||
new_window->win_chat_x = 0;
|
||||
new_window->win_chat_y = 0;
|
||||
new_window->win_chat_width = 0;
|
||||
new_window->win_chat_height = 0;
|
||||
new_window->win_chat_cursor_x = 0;
|
||||
new_window->win_chat_cursor_y = 0;
|
||||
|
||||
gui_calculate_pos_size (new_window);
|
||||
new_window->win_nick_x = 0;
|
||||
new_window->win_nick_y = 0;
|
||||
new_window->win_nick_width = 0;
|
||||
new_window->win_nick_height = 0;
|
||||
|
||||
/* init windows */
|
||||
gui_window_init_subwindows(new_window);
|
||||
new_window->win_title = NULL;
|
||||
new_window->win_chat = NULL;
|
||||
new_window->win_nick = NULL;
|
||||
new_window->win_status = NULL;
|
||||
new_window->win_infobar = NULL;
|
||||
new_window->win_input = NULL;
|
||||
new_window->win_separator = NULL;
|
||||
|
||||
/* init lines */
|
||||
new_window->lines = NULL;
|
||||
new_window->last_line = NULL;
|
||||
new_window->first_line_displayed = 1;
|
||||
new_window->textview_chat = NULL;
|
||||
new_window->textbuffer_chat = NULL;
|
||||
new_window->texttag_chat = NULL;
|
||||
new_window->textview_nicklist = NULL;
|
||||
new_window->textbuffer_nicklist = NULL;
|
||||
|
||||
new_window->dcc_first = NULL;
|
||||
new_window->dcc_selected = NULL;
|
||||
new_window->dcc_last_displayed = NULL;
|
||||
|
||||
new_window->buffer = NULL;
|
||||
|
||||
new_window->first_line_displayed = 0;
|
||||
new_window->sub_lines = 0;
|
||||
new_window->line_complete = 1;
|
||||
new_window->unread_data = 0;
|
||||
|
||||
/* init input buffer */
|
||||
new_window->input_buffer_alloc = INPUT_BUFFER_BLOCK_SIZE;
|
||||
new_window->input_buffer = (char *) malloc (INPUT_BUFFER_BLOCK_SIZE);
|
||||
new_window->input_buffer[0] = '\0';
|
||||
new_window->input_buffer_size = 0;
|
||||
new_window->input_buffer_pos = 0;
|
||||
new_window->input_buffer_1st_display = 0;
|
||||
|
||||
/* init completion */
|
||||
completion_init (&(new_window->completion));
|
||||
|
||||
/* init history */
|
||||
new_window->history = NULL;
|
||||
new_window->ptr_history = NULL;
|
||||
|
||||
/* switch to new window */
|
||||
if (switch_to_window)
|
||||
gui_switch_to_window (new_window);
|
||||
|
||||
/* add window to windows queue */
|
||||
new_window->prev_window = last_gui_window;
|
||||
@@ -123,9 +117,6 @@ gui_window_new (void *server, void *channel, int switch_to_window
|
||||
gui_windows = new_window;
|
||||
last_gui_window = new_window;
|
||||
new_window->next_window = NULL;
|
||||
|
||||
/* redraw whole screen */
|
||||
gui_redraw_window (gui_current_window);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
@@ -134,159 +125,380 @@ gui_window_new (void *server, void *channel, int switch_to_window
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_clear: clear window content
|
||||
* gui_buffer_new: create a new buffer in current window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_clear (t_gui_window *window)
|
||||
t_gui_buffer *
|
||||
gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
|
||||
int switch_to_buffer)
|
||||
{
|
||||
t_gui_line *ptr_line;
|
||||
t_gui_message *ptr_message;
|
||||
t_gui_buffer *new_buffer;
|
||||
|
||||
while (window->lines)
|
||||
#ifdef DEBUG
|
||||
wee_log_printf ("creating new buffer\n");
|
||||
#endif
|
||||
|
||||
/* use first buffer if no server was assigned to this buffer */
|
||||
if (!dcc && gui_buffers && (!SERVER(gui_buffers)))
|
||||
{
|
||||
ptr_line = window->lines->next_line;
|
||||
while (window->lines->messages)
|
||||
{
|
||||
ptr_message = window->lines->messages->next_message;
|
||||
if (window->lines->messages->message)
|
||||
free (window->lines->messages->message);
|
||||
free (window->lines->messages);
|
||||
window->lines->messages = ptr_message;
|
||||
}
|
||||
free (window->lines);
|
||||
window->lines = ptr_line;
|
||||
if (server)
|
||||
((t_irc_server *)(server))->buffer = gui_buffers;
|
||||
if (channel)
|
||||
((t_irc_channel *)(channel))->buffer = gui_buffers;
|
||||
SERVER(gui_buffers) = server;
|
||||
CHANNEL(gui_buffers) = channel;
|
||||
if (cfg_log_auto_server)
|
||||
log_start (gui_buffers);
|
||||
return gui_buffers;
|
||||
}
|
||||
|
||||
window->lines = NULL;
|
||||
window->last_line = NULL;
|
||||
window->first_line_displayed = 1;
|
||||
window->sub_lines = 0;
|
||||
window->line_complete = 1;
|
||||
window->unread_data = 0;
|
||||
if ((new_buffer = (t_gui_buffer *)(malloc (sizeof (t_gui_buffer)))))
|
||||
{
|
||||
new_buffer->num_displayed = 0;
|
||||
new_buffer->number = (last_gui_buffer) ? last_gui_buffer->number + 1 : 1;
|
||||
|
||||
/* assign server and channel to buffer */
|
||||
SERVER(new_buffer) = server;
|
||||
CHANNEL(new_buffer) = channel;
|
||||
new_buffer->dcc = dcc;
|
||||
/* assign buffer to server and channel */
|
||||
if (server && !channel)
|
||||
SERVER(new_buffer)->buffer = new_buffer;
|
||||
if (channel)
|
||||
CHANNEL(new_buffer)->buffer = new_buffer;
|
||||
|
||||
if (!window->buffer)
|
||||
{
|
||||
window->buffer = new_buffer;
|
||||
window->first_line_displayed = 1;
|
||||
window->sub_lines = 0;
|
||||
gui_calculate_pos_size (window);
|
||||
gui_window_init_subwindows (window);
|
||||
}
|
||||
|
||||
/* init lines */
|
||||
new_buffer->lines = NULL;
|
||||
new_buffer->last_line = NULL;
|
||||
new_buffer->num_lines = 0;
|
||||
new_buffer->line_complete = 1;
|
||||
|
||||
/* notify level */
|
||||
new_buffer->notify_level = 3;
|
||||
|
||||
/* create/append to log file */
|
||||
new_buffer->log_filename = NULL;
|
||||
new_buffer->log_file = NULL;
|
||||
if ((cfg_log_auto_server && BUFFER_IS_SERVER(new_buffer))
|
||||
|| (cfg_log_auto_channel && BUFFER_IS_CHANNEL(new_buffer))
|
||||
|| (cfg_log_auto_private && BUFFER_IS_PRIVATE(new_buffer)))
|
||||
log_start (new_buffer);
|
||||
|
||||
/* init input buffer */
|
||||
new_buffer->input_buffer_alloc = INPUT_BUFFER_BLOCK_SIZE;
|
||||
new_buffer->input_buffer = (char *) malloc (INPUT_BUFFER_BLOCK_SIZE);
|
||||
new_buffer->input_buffer[0] = '\0';
|
||||
new_buffer->input_buffer_size = 0;
|
||||
new_buffer->input_buffer_pos = 0;
|
||||
new_buffer->input_buffer_1st_display = 0;
|
||||
|
||||
/* init completion */
|
||||
completion_init (&(new_buffer->completion));
|
||||
|
||||
/* init history */
|
||||
new_buffer->history = NULL;
|
||||
new_buffer->last_history = NULL;
|
||||
new_buffer->ptr_history = NULL;
|
||||
new_buffer->num_history = 0;
|
||||
|
||||
/* add buffer to buffers queue */
|
||||
new_buffer->prev_buffer = last_gui_buffer;
|
||||
if (gui_buffers)
|
||||
last_gui_buffer->next_buffer = new_buffer;
|
||||
else
|
||||
gui_buffers = new_buffer;
|
||||
last_gui_buffer = new_buffer;
|
||||
new_buffer->next_buffer = NULL;
|
||||
|
||||
/* switch to new buffer */
|
||||
if (switch_to_buffer)
|
||||
gui_switch_to_buffer (window, new_buffer);
|
||||
|
||||
/* redraw buffer */
|
||||
gui_redraw_buffer (new_buffer);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
if (window == gui_current_window)
|
||||
gui_redraw_window_chat (window);
|
||||
return new_buffer;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_clear_all: clear all windows content
|
||||
* gui_buffer_clear: clear buffer content
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_clear_all ()
|
||||
gui_buffer_clear (t_gui_buffer *buffer)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
t_gui_line *ptr_line;
|
||||
t_gui_message *ptr_message;
|
||||
|
||||
while (buffer->lines)
|
||||
{
|
||||
ptr_line = buffer->lines->next_line;
|
||||
while (buffer->lines->messages)
|
||||
{
|
||||
ptr_message = buffer->lines->messages->next_message;
|
||||
if (buffer->lines->messages->message)
|
||||
free (buffer->lines->messages->message);
|
||||
free (buffer->lines->messages);
|
||||
buffer->lines->messages = ptr_message;
|
||||
}
|
||||
free (buffer->lines);
|
||||
buffer->lines = ptr_line;
|
||||
}
|
||||
|
||||
buffer->lines = NULL;
|
||||
buffer->last_line = NULL;
|
||||
buffer->num_lines = 0;
|
||||
buffer->line_complete = 1;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
gui_window_clear (ptr_win);
|
||||
{
|
||||
if (ptr_win->buffer == buffer)
|
||||
{
|
||||
ptr_win->first_line_displayed = 1;
|
||||
ptr_win->sub_lines = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer == gui_current_window->buffer)
|
||||
gui_draw_buffer_chat (buffer, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_free: delete a window
|
||||
* gui_buffer_clear_all: clear all buffers content
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_free (t_gui_window *window)
|
||||
gui_buffer_clear_all ()
|
||||
{
|
||||
t_gui_line *ptr_line;
|
||||
t_gui_message *ptr_message;
|
||||
int create_new;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
create_new = (window->server || window->channel);
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
gui_buffer_clear (ptr_buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_infobar_printf: display message in infobar
|
||||
*/
|
||||
|
||||
void
|
||||
gui_infobar_printf (int time_displayed, int color, char *message, ...)
|
||||
{
|
||||
static char buffer[1024];
|
||||
va_list argptr;
|
||||
t_gui_infobar *ptr_infobar;
|
||||
char *pos;
|
||||
|
||||
/* TODO: manage splitted windows! */
|
||||
if ((window == gui_current_window) &&
|
||||
((window->next_window) || (window->prev_window)))
|
||||
gui_switch_to_previous_window ();
|
||||
va_start (argptr, message);
|
||||
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
/* free lines and messages */
|
||||
while (window->lines)
|
||||
ptr_infobar = (t_gui_infobar *)malloc (sizeof (t_gui_infobar));
|
||||
if (ptr_infobar)
|
||||
{
|
||||
ptr_line = window->lines->next_line;
|
||||
while (window->lines->messages)
|
||||
{
|
||||
ptr_message = window->lines->messages->next_message;
|
||||
if (window->lines->messages->message)
|
||||
free (window->lines->messages->message);
|
||||
free (window->lines->messages);
|
||||
window->lines->messages = ptr_message;
|
||||
}
|
||||
free (window->lines);
|
||||
window->lines = ptr_line;
|
||||
ptr_infobar->color = color;
|
||||
ptr_infobar->text = strdup (buffer);
|
||||
pos = strchr (ptr_infobar->text, '\n');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
ptr_infobar->remaining_time = (time_displayed <= 0) ? -1 : time_displayed;
|
||||
ptr_infobar->next_infobar = gui_infobar;
|
||||
gui_infobar = ptr_infobar;
|
||||
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
|
||||
}
|
||||
if (window->input_buffer)
|
||||
free (window->input_buffer);
|
||||
|
||||
completion_free (&(window->completion));
|
||||
|
||||
/* remove window from windows list */
|
||||
if (window->prev_window)
|
||||
window->prev_window->next_window = window->next_window;
|
||||
if (window->next_window)
|
||||
window->next_window->prev_window = window->prev_window;
|
||||
if (gui_windows == window)
|
||||
gui_windows = window->next_window;
|
||||
if (last_gui_window == window)
|
||||
last_gui_window = window->prev_window;
|
||||
|
||||
free (window);
|
||||
|
||||
/* always at least one window */
|
||||
if (!gui_windows && create_new)
|
||||
gui_window_new (NULL, NULL, 1);
|
||||
else
|
||||
wee_log_printf (_("%s not enough memory for infobar message\n"),
|
||||
WEECHAT_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_new_line: create new line for a window
|
||||
* gui_infobar_remove: remove last displayed message in infobar
|
||||
*/
|
||||
|
||||
void
|
||||
gui_infobar_remove ()
|
||||
{
|
||||
t_gui_infobar *new_infobar;
|
||||
|
||||
if (gui_infobar)
|
||||
{
|
||||
new_infobar = gui_infobar->next_infobar;
|
||||
if (gui_infobar->text)
|
||||
free (gui_infobar->text);
|
||||
free (gui_infobar);
|
||||
gui_infobar = new_infobar;
|
||||
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_line_free: delete a line from a buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_line_free (t_gui_line *line)
|
||||
{
|
||||
t_gui_message *ptr_message;
|
||||
|
||||
while (line->messages)
|
||||
{
|
||||
ptr_message = line->messages->next_message;
|
||||
if (line->messages->message)
|
||||
free (line->messages->message);
|
||||
free (line->messages);
|
||||
line->messages = ptr_message;
|
||||
}
|
||||
free (line);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_buffer_free: delete a buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
t_gui_line *ptr_line;
|
||||
int create_new;
|
||||
|
||||
create_new = (buffer->server || buffer->channel);
|
||||
|
||||
hotlist_remove_buffer (buffer);
|
||||
if (hotlist_initial_buffer == buffer)
|
||||
hotlist_initial_buffer = NULL;
|
||||
|
||||
if (switch_to_another)
|
||||
{
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if ((buffer == ptr_win->buffer) &&
|
||||
((buffer->next_buffer) || (buffer->prev_buffer)))
|
||||
gui_switch_to_previous_buffer (ptr_win);
|
||||
}
|
||||
}
|
||||
|
||||
/* decrease buffer number for all next buffers */
|
||||
for (ptr_buffer = buffer->next_buffer; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
ptr_buffer->number--;
|
||||
}
|
||||
|
||||
/* free lines and messages */
|
||||
while (buffer->lines)
|
||||
{
|
||||
ptr_line = buffer->lines->next_line;
|
||||
gui_line_free (buffer->lines);
|
||||
buffer->lines = ptr_line;
|
||||
}
|
||||
|
||||
/* close log if opened */
|
||||
if (buffer->log_file)
|
||||
log_end (buffer);
|
||||
|
||||
if (buffer->input_buffer)
|
||||
free (buffer->input_buffer);
|
||||
|
||||
completion_free (&(buffer->completion));
|
||||
|
||||
/* remove buffer from buffers list */
|
||||
if (buffer->prev_buffer)
|
||||
buffer->prev_buffer->next_buffer = buffer->next_buffer;
|
||||
if (buffer->next_buffer)
|
||||
buffer->next_buffer->prev_buffer = buffer->prev_buffer;
|
||||
if (gui_buffers == buffer)
|
||||
gui_buffers = buffer->next_buffer;
|
||||
if (last_gui_buffer == buffer)
|
||||
last_gui_buffer = buffer->prev_buffer;
|
||||
|
||||
free (buffer);
|
||||
|
||||
/* always at least one buffer */
|
||||
if (!gui_buffers && create_new && switch_to_another)
|
||||
(void) gui_buffer_new (gui_windows, NULL, NULL, 0, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_new_line: create new line for a buffer
|
||||
*/
|
||||
|
||||
t_gui_line *
|
||||
gui_new_line (t_gui_window *window)
|
||||
gui_new_line (t_gui_buffer *buffer)
|
||||
{
|
||||
t_gui_line *new_line;
|
||||
t_gui_line *new_line, *ptr_line;
|
||||
|
||||
if ((new_line = (t_gui_line *) malloc (sizeof (struct t_gui_line))))
|
||||
{
|
||||
new_line->length = 0;
|
||||
new_line->length_align = 0;
|
||||
new_line->line_with_message = 0;
|
||||
new_line->line_with_highlight = 0;
|
||||
new_line->messages = NULL;
|
||||
new_line->last_message = NULL;
|
||||
if (!window->lines)
|
||||
window->lines = new_line;
|
||||
if (!buffer->lines)
|
||||
buffer->lines = new_line;
|
||||
else
|
||||
window->last_line->next_line = new_line;
|
||||
new_line->prev_line = window->last_line;
|
||||
buffer->last_line->next_line = new_line;
|
||||
new_line->prev_line = buffer->last_line;
|
||||
new_line->next_line = NULL;
|
||||
window->last_line = new_line;
|
||||
buffer->last_line = new_line;
|
||||
buffer->num_lines++;
|
||||
}
|
||||
else
|
||||
{
|
||||
wee_log_printf (_("%s not enough memory for new line!\n"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* remove one line if necessary */
|
||||
if ((cfg_history_max_lines > 0)
|
||||
&& (buffer->num_lines > cfg_history_max_lines))
|
||||
{
|
||||
if (buffer->last_line == buffer->lines)
|
||||
buffer->last_line = NULL;
|
||||
ptr_line = buffer->lines->next_line;
|
||||
gui_line_free (buffer->lines);
|
||||
buffer->lines = ptr_line;
|
||||
ptr_line->prev_line = NULL;
|
||||
buffer->num_lines--;
|
||||
//if (buffer->first_line_displayed)
|
||||
gui_draw_buffer_chat (buffer, 1);
|
||||
}
|
||||
|
||||
return new_line;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_new_message: create a new message for last line of window
|
||||
* gui_new_message: create a new message for last line of a buffer
|
||||
*/
|
||||
|
||||
t_gui_message *
|
||||
gui_new_message (t_gui_window *window)
|
||||
gui_new_message (t_gui_buffer *buffer)
|
||||
{
|
||||
t_gui_message *new_message;
|
||||
|
||||
if ((new_message = (t_gui_message *) malloc (sizeof (struct t_gui_message))))
|
||||
{
|
||||
if (!window->last_line->messages)
|
||||
window->last_line->messages = new_message;
|
||||
if (!buffer->last_line->messages)
|
||||
buffer->last_line->messages = new_message;
|
||||
else
|
||||
window->last_line->last_message->next_message = new_message;
|
||||
new_message->prev_message = window->last_line->last_message;
|
||||
buffer->last_line->last_message->next_message = new_message;
|
||||
new_message->prev_message = buffer->last_line->last_message;
|
||||
new_message->next_message = NULL;
|
||||
window->last_line->last_message = new_message;
|
||||
buffer->last_line->last_message = new_message;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -302,16 +514,16 @@ gui_new_message (t_gui_window *window)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_optimize_input_buffer_size (t_gui_window *window)
|
||||
gui_optimize_input_buffer_size (t_gui_buffer *buffer)
|
||||
{
|
||||
int optimal_size;
|
||||
|
||||
optimal_size = ((window->input_buffer_size / INPUT_BUFFER_BLOCK_SIZE) *
|
||||
optimal_size = ((buffer->input_buffer_size / INPUT_BUFFER_BLOCK_SIZE) *
|
||||
INPUT_BUFFER_BLOCK_SIZE) + INPUT_BUFFER_BLOCK_SIZE;
|
||||
if (window->input_buffer_alloc != optimal_size)
|
||||
if (buffer->input_buffer_alloc != optimal_size)
|
||||
{
|
||||
window->input_buffer_alloc = optimal_size;
|
||||
window->input_buffer = realloc (window->input_buffer, optimal_size);
|
||||
buffer->input_buffer_alloc = optimal_size;
|
||||
buffer->input_buffer = realloc (buffer->input_buffer, optimal_size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,25 +532,25 @@ gui_optimize_input_buffer_size (t_gui_window *window)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_delete_previous_word ()
|
||||
gui_delete_previous_word (t_gui_buffer *buffer)
|
||||
{
|
||||
int i, j, num_char_deleted, num_char_end;
|
||||
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
if (buffer->input_buffer_pos > 0)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos - 1;
|
||||
i = buffer->input_buffer_pos - 1;
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
(buffer->input_buffer[i] == ' '))
|
||||
i--;
|
||||
if (i >= 0)
|
||||
{
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] != ' '))
|
||||
(buffer->input_buffer[i] != ' '))
|
||||
i--;
|
||||
if (i >= 0)
|
||||
{
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
(buffer->input_buffer[i] == ' '))
|
||||
i--;
|
||||
}
|
||||
}
|
||||
@@ -346,20 +558,20 @@ gui_delete_previous_word ()
|
||||
if (i >= 0)
|
||||
i++;
|
||||
i++;
|
||||
num_char_deleted = gui_current_window->input_buffer_pos - i;
|
||||
num_char_end = gui_current_window->input_buffer_size -
|
||||
gui_current_window->input_buffer_pos;
|
||||
num_char_deleted = buffer->input_buffer_pos - i;
|
||||
num_char_end = buffer->input_buffer_size -
|
||||
buffer->input_buffer_pos;
|
||||
|
||||
for (j = 0; j < num_char_end; j++)
|
||||
gui_current_window->input_buffer[i + j] =
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_pos + j];
|
||||
buffer->input_buffer[i + j] =
|
||||
buffer->input_buffer[buffer->input_buffer_pos + j];
|
||||
|
||||
gui_current_window->input_buffer_size -= num_char_deleted;
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
gui_current_window->input_buffer_pos = i;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->completion.position = -1;
|
||||
buffer->input_buffer_size -= num_char_deleted;
|
||||
buffer->input_buffer[buffer->input_buffer_size] = '\0';
|
||||
buffer->input_buffer_pos = i;
|
||||
gui_draw_buffer_input (buffer, 0);
|
||||
gui_optimize_input_buffer_size (buffer);
|
||||
buffer->completion.position = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,26 +580,26 @@ gui_delete_previous_word ()
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_previous_word ()
|
||||
gui_move_previous_word (t_gui_buffer *buffer)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
if (buffer->input_buffer_pos > 0)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos - 1;
|
||||
i = buffer->input_buffer_pos - 1;
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
(buffer->input_buffer[i] == ' '))
|
||||
i--;
|
||||
if (i < 0)
|
||||
gui_current_window->input_buffer_pos = 0;
|
||||
buffer->input_buffer_pos = 0;
|
||||
else
|
||||
{
|
||||
while ((i >= 0) &&
|
||||
(gui_current_window->input_buffer[i] != ' '))
|
||||
(buffer->input_buffer[i] != ' '))
|
||||
i--;
|
||||
gui_current_window->input_buffer_pos = i + 1;
|
||||
buffer->input_buffer_pos = i + 1;
|
||||
}
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_draw_buffer_input (buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,32 +608,32 @@ gui_move_previous_word ()
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_next_word ()
|
||||
gui_move_next_word (t_gui_buffer *buffer)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (gui_current_window->input_buffer_pos <
|
||||
gui_current_window->input_buffer_size + 1)
|
||||
if (buffer->input_buffer_pos <
|
||||
buffer->input_buffer_size + 1)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos;
|
||||
while ((i <= gui_current_window->input_buffer_size) &&
|
||||
(gui_current_window->input_buffer[i] == ' '))
|
||||
i = buffer->input_buffer_pos;
|
||||
while ((i <= buffer->input_buffer_size) &&
|
||||
(buffer->input_buffer[i] == ' '))
|
||||
i++;
|
||||
if (i > gui_current_window->input_buffer_size)
|
||||
gui_current_window->input_buffer_pos = i - 1;
|
||||
if (i > buffer->input_buffer_size)
|
||||
buffer->input_buffer_pos = i - 1;
|
||||
else
|
||||
{
|
||||
while ((i <= gui_current_window->input_buffer_size) &&
|
||||
(gui_current_window->input_buffer[i] != ' '))
|
||||
while ((i <= buffer->input_buffer_size) &&
|
||||
(buffer->input_buffer[i] != ' '))
|
||||
i++;
|
||||
if (i > gui_current_window->input_buffer_size)
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->input_buffer_size;
|
||||
if (i > buffer->input_buffer_size)
|
||||
buffer->input_buffer_pos =
|
||||
buffer->input_buffer_size;
|
||||
else
|
||||
gui_current_window->input_buffer_pos = i;
|
||||
buffer->input_buffer_pos = i;
|
||||
|
||||
}
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_draw_buffer_input (buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,24 +642,137 @@ gui_move_next_word ()
|
||||
*/
|
||||
|
||||
void
|
||||
gui_buffer_insert_string (char *string, int pos)
|
||||
gui_buffer_insert_string (t_gui_buffer *buffer, char *string, int pos)
|
||||
{
|
||||
int i, start, end, length;
|
||||
|
||||
length = strlen (string);
|
||||
|
||||
/* increase buffer size */
|
||||
gui_current_window->input_buffer_size += length;
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
buffer->input_buffer_size += length;
|
||||
gui_optimize_input_buffer_size (buffer);
|
||||
buffer->input_buffer[buffer->input_buffer_size] = '\0';
|
||||
|
||||
/* move end of string to the right */
|
||||
start = pos + length;
|
||||
end = gui_current_window->input_buffer_size - 1;
|
||||
end = buffer->input_buffer_size - 1;
|
||||
for (i = end; i >= start; i--)
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i - length];
|
||||
buffer->input_buffer[i] =
|
||||
buffer->input_buffer[i - length];
|
||||
|
||||
/* insert new string */
|
||||
strncpy (gui_current_window->input_buffer + pos, string, length);
|
||||
strncpy (buffer->input_buffer + pos, string, length);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_buffer_by_number: switch to another buffer with number
|
||||
*/
|
||||
|
||||
t_gui_buffer *
|
||||
gui_switch_to_buffer_by_number (t_gui_window *window, int number)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
/* buffer is currently displayed ? */
|
||||
if (number == window->buffer->number)
|
||||
return window->buffer;
|
||||
|
||||
/* search for buffer in the list */
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
if ((ptr_buffer != window->buffer) && (number == ptr_buffer->number))
|
||||
{
|
||||
gui_switch_to_buffer (window, ptr_buffer);
|
||||
gui_redraw_buffer (window->buffer);
|
||||
return ptr_buffer;
|
||||
}
|
||||
}
|
||||
|
||||
/* buffer not found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_buffer_by_number: switch to another buffer with number
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_buffer_to_number (t_gui_window *window, int number)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
int i;
|
||||
|
||||
/* buffer number is already ok ? */
|
||||
if (number == window->buffer->number)
|
||||
return;
|
||||
|
||||
if (number < 1)
|
||||
number = 1;
|
||||
|
||||
/* remove buffer from list */
|
||||
if (window->buffer == gui_buffers)
|
||||
{
|
||||
gui_buffers = window->buffer->next_buffer;
|
||||
gui_buffers->prev_buffer = NULL;
|
||||
}
|
||||
if (window->buffer == last_gui_buffer)
|
||||
{
|
||||
last_gui_buffer = window->buffer->prev_buffer;
|
||||
last_gui_buffer->next_buffer = NULL;
|
||||
}
|
||||
if (window->buffer->prev_buffer)
|
||||
(window->buffer->prev_buffer)->next_buffer = window->buffer->next_buffer;
|
||||
if (window->buffer->next_buffer)
|
||||
(window->buffer->next_buffer)->prev_buffer = window->buffer->prev_buffer;
|
||||
|
||||
if (number == 1)
|
||||
{
|
||||
gui_buffers->prev_buffer = window->buffer;
|
||||
window->buffer->prev_buffer = NULL;
|
||||
window->buffer->next_buffer = gui_buffers;
|
||||
gui_buffers = window->buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* assign new number to all buffers */
|
||||
i = 1;
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
ptr_buffer->number = i++;
|
||||
}
|
||||
|
||||
/* search for new position in the list */
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
if (ptr_buffer->number == number)
|
||||
break;
|
||||
}
|
||||
if (ptr_buffer)
|
||||
{
|
||||
/* insert before buffer found */
|
||||
window->buffer->prev_buffer = ptr_buffer->prev_buffer;
|
||||
window->buffer->next_buffer = ptr_buffer;
|
||||
if (ptr_buffer->prev_buffer)
|
||||
(ptr_buffer->prev_buffer)->next_buffer = window->buffer;
|
||||
ptr_buffer->prev_buffer = window->buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* number not found (too big)? => add to end */
|
||||
window->buffer->prev_buffer = last_gui_buffer;
|
||||
window->buffer->next_buffer = NULL;
|
||||
last_gui_buffer->next_buffer = window->buffer;
|
||||
last_gui_buffer = window->buffer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* assign new number to all buffers */
|
||||
i = 1;
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
ptr_buffer->number = i++;
|
||||
}
|
||||
|
||||
gui_redraw_buffer (window->buffer);
|
||||
}
|
||||
|
||||
+171
-101
@@ -26,54 +26,65 @@
|
||||
|
||||
#define INPUT_BUFFER_BLOCK_SIZE 256
|
||||
|
||||
#define NUM_COLORS 36
|
||||
#define COLOR_WIN_TITLE 1
|
||||
#define COLOR_WIN_CHAT 2
|
||||
#define COLOR_WIN_CHAT_TIME 3
|
||||
#define COLOR_WIN_CHAT_TIME_SEP 4
|
||||
#define COLOR_WIN_CHAT_PREFIX1 5
|
||||
#define COLOR_WIN_CHAT_PREFIX2 6
|
||||
#define COLOR_WIN_CHAT_NICK 7
|
||||
#define COLOR_WIN_CHAT_HOST 8
|
||||
#define COLOR_WIN_CHAT_CHANNEL 9
|
||||
#define COLOR_WIN_CHAT_DARK 10
|
||||
#define COLOR_WIN_CHAT_HIGHLIGHT 11
|
||||
#define COLOR_WIN_STATUS 12
|
||||
#define COLOR_WIN_STATUS_ACTIVE 13
|
||||
#define COLOR_WIN_STATUS_DATA_MSG 14
|
||||
#define COLOR_WIN_STATUS_DATA_OTHER 15
|
||||
#define COLOR_WIN_STATUS_MORE 16
|
||||
#define COLOR_WIN_INPUT 17
|
||||
#define COLOR_WIN_INPUT_CHANNEL 18
|
||||
#define COLOR_WIN_INPUT_NICK 19
|
||||
#define COLOR_WIN_NICK 20
|
||||
#define COLOR_WIN_NICK_OP 21
|
||||
#define COLOR_WIN_NICK_HALFOP 22
|
||||
#define COLOR_WIN_NICK_VOICE 23
|
||||
#define COLOR_WIN_NICK_SEP 24
|
||||
#define COLOR_WIN_NICK_SELF 25
|
||||
#define COLOR_WIN_NICK_PRIVATE 26
|
||||
#define COLOR_WIN_NICK_FIRST 27
|
||||
#define COLOR_WIN_NICK_LAST 36
|
||||
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
|
||||
#define NUM_COLORS 46
|
||||
#define COLOR_WIN_TITLE 1
|
||||
#define COLOR_WIN_CHAT 2
|
||||
#define COLOR_WIN_CHAT_TIME 3
|
||||
#define COLOR_WIN_CHAT_TIME_SEP 4
|
||||
#define COLOR_WIN_CHAT_PREFIX1 5
|
||||
#define COLOR_WIN_CHAT_PREFIX2 6
|
||||
#define COLOR_WIN_CHAT_NICK 7
|
||||
#define COLOR_WIN_CHAT_HOST 8
|
||||
#define COLOR_WIN_CHAT_CHANNEL 9
|
||||
#define COLOR_WIN_CHAT_DARK 10
|
||||
#define COLOR_WIN_CHAT_HIGHLIGHT 11
|
||||
#define COLOR_WIN_STATUS 12
|
||||
#define COLOR_WIN_STATUS_DELIMITERS 13
|
||||
#define COLOR_WIN_STATUS_DATA_MSG 14
|
||||
#define COLOR_WIN_STATUS_DATA_HIGHLIGHT 15
|
||||
#define COLOR_WIN_STATUS_DATA_OTHER 16
|
||||
#define COLOR_WIN_STATUS_MORE 17
|
||||
#define COLOR_WIN_INFOBAR 18
|
||||
#define COLOR_WIN_INFOBAR_HIGHLIGHT 19
|
||||
#define COLOR_WIN_INPUT 20
|
||||
#define COLOR_WIN_INPUT_CHANNEL 21
|
||||
#define COLOR_WIN_INPUT_NICK 22
|
||||
#define COLOR_WIN_NICK 23
|
||||
#define COLOR_WIN_NICK_OP 24
|
||||
#define COLOR_WIN_NICK_HALFOP 25
|
||||
#define COLOR_WIN_NICK_VOICE 26
|
||||
#define COLOR_WIN_NICK_SEP 27
|
||||
#define COLOR_WIN_NICK_SELF 28
|
||||
#define COLOR_WIN_NICK_PRIVATE 29
|
||||
#define COLOR_WIN_NICK_FIRST 30
|
||||
#define COLOR_WIN_NICK_LAST 39
|
||||
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
|
||||
#define COLOR_DCC_SELECTED 40
|
||||
#define COLOR_DCC_WAITING 41
|
||||
#define COLOR_DCC_CONNECTING 42
|
||||
#define COLOR_DCC_ACTIVE 43
|
||||
#define COLOR_DCC_DONE 44
|
||||
#define COLOR_DCC_FAILED 45
|
||||
#define COLOR_DCC_ABORTED 46
|
||||
|
||||
#define SERVER(window) ((t_irc_server *)(window->server))
|
||||
#define CHANNEL(window) ((t_irc_channel *)(window->channel))
|
||||
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
|
||||
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
|
||||
|
||||
#define WIN_IS_SERVER(window) (SERVER(window) && !CHANNEL(window))
|
||||
#define WIN_IS_CHANNEL(window) (CHANNEL(window) && (CHANNEL(window)->type == CHAT_CHANNEL))
|
||||
#define WIN_IS_PRIVATE(window) (CHANNEL(window) && (CHANNEL(window)->type == CHAT_PRIVATE))
|
||||
#define BUFFER_IS_SERVER(buffer) (SERVER(buffer) && !CHANNEL(buffer))
|
||||
#define BUFFER_IS_CHANNEL(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_CHANNEL))
|
||||
#define BUFFER_IS_PRIVATE(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_PRIVATE))
|
||||
|
||||
#define MSG_TYPE_TIME 0
|
||||
#define MSG_TYPE_NICK 1
|
||||
#define MSG_TYPE_INFO 2
|
||||
#define MSG_TYPE_MSG 3
|
||||
#define MSG_TYPE_TIME 1
|
||||
#define MSG_TYPE_NICK 2
|
||||
#define MSG_TYPE_INFO 4
|
||||
#define MSG_TYPE_MSG 8
|
||||
#define MSG_TYPE_HIGHLIGHT 16
|
||||
|
||||
#define gui_printf_color(window, color, fmt, argz...) \
|
||||
gui_printf_color_type(window, MSG_TYPE_INFO, color, fmt, ##argz)
|
||||
#define gui_printf_color(buffer, color, fmt, argz...) \
|
||||
gui_printf_color_type(buffer, MSG_TYPE_INFO, color, fmt, ##argz)
|
||||
|
||||
#define gui_printf(window, fmt, argz...) \
|
||||
gui_printf_color_type(window, MSG_TYPE_INFO, -1, fmt, ##argz)
|
||||
#define gui_printf(buffer, fmt, argz...) \
|
||||
gui_printf_color_type(buffer, MSG_TYPE_INFO, -1, fmt, ##argz)
|
||||
|
||||
typedef struct t_gui_message t_gui_message;
|
||||
|
||||
@@ -93,6 +104,7 @@ struct t_gui_line
|
||||
int length; /* length of the line (in char) */
|
||||
int length_align; /* alignment length (time or time/nick) */
|
||||
int line_with_message; /* line contains a message from a user? */
|
||||
int line_with_highlight; /* line contains highlight */
|
||||
t_gui_message *messages; /* messages for the line */
|
||||
t_gui_message *last_message; /* last message of the line */
|
||||
t_gui_line *prev_line; /* link to previous line */
|
||||
@@ -107,16 +119,72 @@ struct t_gui_color
|
||||
int color;
|
||||
};
|
||||
|
||||
typedef struct t_gui_infobar t_gui_infobar;
|
||||
|
||||
struct t_gui_infobar
|
||||
{
|
||||
int color; /* text color */
|
||||
char *text; /* infobar text */
|
||||
int remaining_time; /* delay (sec) before erasing this text */
|
||||
/* if < 0, text is never erased (except */
|
||||
/* by user action to erase it) */
|
||||
t_gui_infobar *next_infobar; /* next message for infobar */
|
||||
};
|
||||
|
||||
typedef struct t_gui_buffer t_gui_buffer;
|
||||
|
||||
struct t_gui_buffer
|
||||
{
|
||||
int num_displayed; /* number of windows displaying buffer */
|
||||
|
||||
int number; /* buffer number (for jump/switch) */
|
||||
|
||||
/* server/channel */
|
||||
void *server; /* buffer's server */
|
||||
void *channel; /* buffer's channel */
|
||||
int dcc; /* buffer is dcc status */
|
||||
|
||||
/* chat content (lines, line is composed by many messages) */
|
||||
t_gui_line *lines; /* lines of chat window */
|
||||
t_gui_line *last_line; /* last line of chat window */
|
||||
int num_lines; /* number of lines in the window */
|
||||
int line_complete; /* current line complete ? (\n ending) */
|
||||
|
||||
/* notify level: when activity should be displayed? default: 3 (always) */
|
||||
int notify_level; /* 0 = never */
|
||||
/* 1 = highlight only */
|
||||
/* 2 = highlight + message */
|
||||
/* 3 = highlight + message + join/part */
|
||||
|
||||
/* file to save buffer content */
|
||||
char *log_filename; /* filename for saving buffer content */
|
||||
FILE *log_file; /* for logging buffer to file */
|
||||
|
||||
/* inupt buffer */
|
||||
char *input_buffer; /* input buffer */
|
||||
int input_buffer_alloc; /* input buffer: allocated size in mem */
|
||||
int input_buffer_size; /* buffer size (user input length) */
|
||||
int input_buffer_pos; /* position into buffer */
|
||||
int input_buffer_1st_display; /* first char displayed on screen */
|
||||
|
||||
/* completion */
|
||||
t_completion completion; /* for cmds/nicks completion */
|
||||
|
||||
/* history */
|
||||
t_history *history; /* commands history */
|
||||
t_history *last_history; /* last command in history */
|
||||
t_history *ptr_history; /* current command in history */
|
||||
int num_history; /* number of commands in history */
|
||||
|
||||
/* link to previous/next buffer */
|
||||
t_gui_buffer *prev_buffer; /* link to previous buffer */
|
||||
t_gui_buffer *next_buffer; /* link to next buffer */
|
||||
};
|
||||
|
||||
typedef struct t_gui_window t_gui_window;
|
||||
|
||||
struct t_gui_window
|
||||
{
|
||||
int is_displayed; /* = 1 if window is displayed */
|
||||
|
||||
/* server/channel */
|
||||
void *server; /* window's server */
|
||||
void *channel; /* window's channel */
|
||||
|
||||
/* global position & size */
|
||||
int win_x, win_y; /* position of window */
|
||||
int win_width, win_height; /* window geometry */
|
||||
@@ -135,97 +203,99 @@ struct t_gui_window
|
||||
|
||||
/* windows for Curses GUI */
|
||||
void *win_title; /* title window */
|
||||
void *win_chat; /* chat window (exemple: channel) */
|
||||
void *win_chat; /* chat window (example: channel) */
|
||||
void *win_nick; /* nick window */
|
||||
void *win_status; /* status window */
|
||||
void *win_infobar; /* info bar window */
|
||||
void *win_input; /* input window */
|
||||
void *win_separator; /* separation between 2 splited (V) win */
|
||||
|
||||
/* windows for Curses GUI */
|
||||
/* windows for Gtk GUI */
|
||||
void *textview_chat; /* textview widget for chat */
|
||||
void *textbuffer_chat; /* textbuffer widget for chat */
|
||||
void *texttag_chat; /* texttag widget for chat */
|
||||
void *textview_nicklist; /* textview widget for nicklist */
|
||||
void *textbuffer_nicklist; /* textbuffer widget for nicklist */
|
||||
|
||||
/* windows for Curses GUI */
|
||||
/* windows for Qt GUI */
|
||||
/* TODO: declare Qt window */
|
||||
|
||||
/* chat content (lines, line is composed by many messages) */
|
||||
t_gui_line *lines; /* lines of chat window */
|
||||
t_gui_line *last_line; /* last line of chat window */
|
||||
/* DCC */
|
||||
void *dcc_first; /* first dcc displayed */
|
||||
void *dcc_selected; /* selected dcc */
|
||||
void *dcc_last_displayed; /* last dcc displayed (for scroll) */
|
||||
|
||||
t_gui_buffer *buffer; /* buffer currently displayed in window */
|
||||
|
||||
int first_line_displayed; /* = 1 if first line is displayed */
|
||||
int sub_lines; /* if > 0 then do not display until end */
|
||||
int line_complete; /* current line complete ? (\n ending) */
|
||||
int unread_data; /* highlight windows with unread data */
|
||||
|
||||
/* inupt buffer */
|
||||
char *input_buffer; /* input buffer */
|
||||
int input_buffer_alloc; /* input buffer: allocated size in mem */
|
||||
int input_buffer_size; /* buffer size (user input length) */
|
||||
int input_buffer_pos; /* position into buffer */
|
||||
int input_buffer_1st_display; /* first char displayed on screen */
|
||||
|
||||
/* completion */
|
||||
t_completion completion; /* for cmds/nicks completion */
|
||||
|
||||
/* history */
|
||||
t_history *history; /* commands history */
|
||||
t_history *ptr_history; /* current command in history */
|
||||
|
||||
/* link to next window */
|
||||
t_gui_window *prev_window; /* link to previous window */
|
||||
t_gui_window *next_window; /* link to next window */
|
||||
};
|
||||
|
||||
/* variables */
|
||||
|
||||
extern int gui_ready;
|
||||
extern int gui_init_ok;
|
||||
extern int gui_ok;
|
||||
extern t_gui_window *gui_windows;
|
||||
extern t_gui_window *last_gui_window;
|
||||
extern t_gui_window *gui_current_window;
|
||||
extern t_gui_buffer *gui_buffers;
|
||||
extern t_gui_buffer *last_gui_buffer;
|
||||
extern t_gui_buffer *buffer_before_dcc;
|
||||
extern t_gui_infobar *gui_infobar;
|
||||
|
||||
/* prototypes */
|
||||
|
||||
/* GUI independent functions */
|
||||
extern t_gui_window *gui_window_new (void *, void *, int /*int, int, int, int*/); /* TODO: add coordinates and size */
|
||||
extern void gui_window_clear (t_gui_window *);
|
||||
extern void gui_window_clear_all ();
|
||||
extern t_gui_line *gui_new_line (t_gui_window *);
|
||||
extern t_gui_message *gui_new_message (t_gui_window *);
|
||||
extern void gui_optimize_input_buffer_size (t_gui_window *);
|
||||
extern void gui_delete_previous_word ();
|
||||
extern void gui_move_previous_word ();
|
||||
extern void gui_move_next_word ();
|
||||
extern void gui_buffer_insert_string (char *, int);
|
||||
extern t_gui_window *gui_window_new (int, int, int, int);
|
||||
extern t_gui_buffer *gui_buffer_new (t_gui_window *, void *, void *, int, int);
|
||||
extern void gui_buffer_clear (t_gui_buffer *);
|
||||
extern void gui_buffer_clear_all ();
|
||||
extern void gui_infobar_printf (int, int, char *, ...);
|
||||
extern void gui_infobar_remove ();
|
||||
extern void gui_buffer_free (t_gui_buffer *, int);
|
||||
extern t_gui_line *gui_new_line (t_gui_buffer *);
|
||||
extern t_gui_message *gui_new_message (t_gui_buffer *);
|
||||
extern void gui_optimize_input_buffer_size (t_gui_buffer *);
|
||||
extern void gui_delete_previous_word (t_gui_buffer *);
|
||||
extern void gui_move_previous_word (t_gui_buffer *);
|
||||
extern void gui_move_next_word (t_gui_buffer *);
|
||||
extern void gui_buffer_insert_string (t_gui_buffer *, char *, int);
|
||||
extern t_gui_buffer *gui_switch_to_buffer_by_number (t_gui_window *, int);
|
||||
extern void gui_move_buffer_to_number (t_gui_window *, int);
|
||||
/* GUI dependant functions */
|
||||
extern int gui_assign_color (int *, char *);
|
||||
extern int gui_get_color_by_name (char *);
|
||||
extern char *gui_get_color_by_value (int);
|
||||
extern int gui_window_has_nicklist (t_gui_window *);
|
||||
extern int gui_buffer_has_nicklist (t_gui_buffer *);
|
||||
extern void gui_calculate_pos_size (t_gui_window *);
|
||||
extern void gui_draw_window_title (t_gui_window *);
|
||||
extern void gui_redraw_window_title (t_gui_window *);
|
||||
extern void gui_draw_window_chat (t_gui_window *);
|
||||
extern void gui_redraw_window_chat (t_gui_window *);
|
||||
extern void gui_draw_window_nick (t_gui_window *);
|
||||
extern void gui_redraw_window_nick (t_gui_window *);
|
||||
extern void gui_draw_window_status (t_gui_window *);
|
||||
extern void gui_redraw_window_status (t_gui_window *);
|
||||
extern void gui_draw_window_input (t_gui_window *);
|
||||
extern void gui_redraw_window_input (t_gui_window *);
|
||||
extern void gui_redraw_window (t_gui_window *);
|
||||
extern void gui_switch_to_window (t_gui_window *);
|
||||
extern void gui_switch_to_previous_window ();
|
||||
extern void gui_switch_to_next_window ();
|
||||
extern void gui_draw_buffer_title (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_chat (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_nick (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_status (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_infobar (t_gui_buffer *, int);
|
||||
extern void gui_draw_buffer_input (t_gui_buffer *, int);
|
||||
extern void gui_redraw_buffer (t_gui_buffer *);
|
||||
extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *);
|
||||
extern t_gui_buffer *gui_get_dcc_buffer ();
|
||||
extern void gui_switch_to_dcc_buffer ();
|
||||
extern void gui_switch_to_previous_buffer (t_gui_window *);
|
||||
extern void gui_switch_to_next_buffer (t_gui_window *);
|
||||
extern void gui_switch_to_next_window (t_gui_window *);
|
||||
extern void gui_move_page_up ();
|
||||
extern void gui_move_page_down ();
|
||||
extern void gui_curses_resize_handler ();
|
||||
extern void gui_window_init_subwindows (t_gui_window *);
|
||||
extern void gui_window_split_horiz (t_gui_window *);
|
||||
extern void gui_window_split_vertic (t_gui_window *);
|
||||
extern void gui_pre_init (int *, char **[]);
|
||||
//extern void gui_init_colors ();
|
||||
extern void gui_init_colors ();
|
||||
extern void gui_set_window_title ();
|
||||
extern void gui_init ();
|
||||
extern void gui_window_free (t_gui_window *);
|
||||
extern void gui_end ();
|
||||
extern void gui_printf_color_type (t_gui_window *, int, int, char *, ...);
|
||||
extern void gui_printf_color_type (/*@null@*/ t_gui_buffer *, int, int, char *, ...);
|
||||
extern void gui_main_loop ();
|
||||
|
||||
#endif /* gui.h */
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
noinst_LIBRARIES = lib_weechat_irc.a
|
||||
|
||||
lib_weechat_irc_a_SOURCES = irc.h \
|
||||
@@ -24,4 +26,5 @@ lib_weechat_irc_a_SOURCES = irc.h \
|
||||
irc-server.c \
|
||||
irc-channel.c \
|
||||
irc-nick.c \
|
||||
irc-dcc.c \
|
||||
irc-display.c
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "irc.h"
|
||||
|
||||
|
||||
t_irc_channel *current_channel = NULL;
|
||||
char *channel_modes = "iklmnst";
|
||||
|
||||
|
||||
/*
|
||||
@@ -40,7 +40,7 @@ t_irc_channel *current_channel = NULL;
|
||||
|
||||
t_irc_channel *
|
||||
channel_new (t_irc_server *server, int channel_type, char *channel_name,
|
||||
int switch_to_window)
|
||||
int switch_to_buffer)
|
||||
{
|
||||
t_irc_channel *new_channel;
|
||||
|
||||
@@ -55,6 +55,10 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name,
|
||||
new_channel->type = channel_type;
|
||||
new_channel->name = strdup (channel_name);
|
||||
new_channel->topic = NULL;
|
||||
memset (new_channel->modes, ' ', sizeof (new_channel->modes));
|
||||
new_channel->modes[sizeof (new_channel->modes) - 1] = '\0';
|
||||
new_channel->limit = 0;
|
||||
new_channel->key = NULL;
|
||||
new_channel->nicks = NULL;
|
||||
new_channel->last_nick = NULL;
|
||||
|
||||
@@ -67,7 +71,7 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name,
|
||||
server->channels = new_channel;
|
||||
server->last_channel = new_channel;
|
||||
|
||||
gui_window_new (server, new_channel, switch_to_window);
|
||||
gui_buffer_new (gui_current_window, server, new_channel, 0, switch_to_buffer);
|
||||
|
||||
/* all is ok, return address of new channel */
|
||||
return new_channel;
|
||||
|
||||
+22
-5
@@ -44,6 +44,12 @@ t_irc_command irc_commands[] =
|
||||
N_("nickname type"),
|
||||
N_("nickname: user to send ctcp to\ntype: \"action\" or \"version\""),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_ctcp, NULL },
|
||||
{ "dcc", N_("starts DCC (file or chat)"),
|
||||
N_("action nickname [file]"),
|
||||
N_("action: 'send' (file) or 'chat'\n"
|
||||
"nickname: nickname to send file or chat\n"
|
||||
"file: filename (on local host)"),
|
||||
2, 3, 1, NULL, irc_cmd_send_dcc, NULL },
|
||||
{ "deop", N_("removes channel operator status from nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, 1, 1, irc_cmd_send_deop, NULL, NULL },
|
||||
@@ -119,15 +125,15 @@ t_irc_command irc_commands[] =
|
||||
" w: user receives wallops\n"
|
||||
" o: operator flag\n"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
|
||||
{ "msg", N_("send message to a nick or channel"),
|
||||
N_("receiver[,receiver] text"),
|
||||
N_("receiver: nick or channel (may be mask, '*' = current channel)"
|
||||
"\ntext: text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
|
||||
{ "motd", N_("get the \"Message Of The Day\""),
|
||||
N_("[target]"),
|
||||
N_("target: server name"),
|
||||
0, 1, 1, NULL, irc_cmd_send_motd, NULL },
|
||||
{ "msg", N_("send message to a nick or channel"),
|
||||
N_("receiver[,receiver] text"),
|
||||
N_("receiver: nick or channel (may be mask, '*' = current channel)"
|
||||
"\ntext: text to send"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
|
||||
{ "names", N_("list nicknames on channels"),
|
||||
N_("[channel[,channel]]"), N_("channel: channel name"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_names, NULL },
|
||||
@@ -158,6 +164,11 @@ t_irc_command irc_commands[] =
|
||||
{ "privmsg", N_("message received"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
|
||||
{ "query", N_("send a private message to a nick"),
|
||||
N_("nickname [text]"),
|
||||
N_("nickname: nickname for private conversation"
|
||||
"\ntext: text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_query, NULL },
|
||||
{ "quit", N_("close all connections & quit " PACKAGE_NAME),
|
||||
N_("[quit_message]"),
|
||||
N_("quit_message: quit message (displayed to other users)"),
|
||||
@@ -280,6 +291,8 @@ t_irc_command irc_commands[] =
|
||||
{ "321", N_("/list start"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
|
||||
{ "322", N_("channel (for /list)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
|
||||
{ "323", N_("/list end"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
|
||||
{ "324", N_("channel mode"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
|
||||
{ "329", "???", "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
|
||||
{ "331", N_("no topic for channel"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
|
||||
{ "332", N_("topic of channel"),
|
||||
N_("channel :topic"),
|
||||
@@ -383,6 +396,10 @@ t_irc_command irc_commands[] =
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "475", N_("cannot join channel (bad channel key)"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "476", N_("bad channel mask"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "477", N_("channel doesn't support modes"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "481", N_("you're not an IRC operator"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "482", N_("you're not channel operator"),
|
||||
|
||||
@@ -0,0 +1,387 @@
|
||||
/*
|
||||
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* irc-dcc.c: DCC communications (files & chat) */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include "../common/weechat.h"
|
||||
#include "irc.h"
|
||||
#include "../common/weeconfig.h"
|
||||
#include "../common/hotlist.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
t_dcc *dcc_list = NULL; /* DCC files & chat list */
|
||||
char *dcc_status_string[] = /* strings for DCC status */
|
||||
{ N_("Waiting"), N_("Connecting"), N_("Active"), N_("Done"), N_("Failed"),
|
||||
N_("Aborted") };
|
||||
|
||||
|
||||
/*
|
||||
* dcc_redraw: redraw DCC buffer (and add to hotlist)
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_redraw (int highlight)
|
||||
{
|
||||
gui_redraw_buffer (gui_get_dcc_buffer ());
|
||||
if (highlight)
|
||||
{
|
||||
hotlist_add (highlight, gui_get_dcc_buffer ());
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_connect: connect to another host
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_connect (t_dcc *ptr_dcc)
|
||||
{
|
||||
struct sockaddr_in addr;
|
||||
|
||||
ptr_dcc->status = DCC_CONNECTING;
|
||||
|
||||
ptr_dcc->sock = socket (AF_INET, SOCK_STREAM, 0);
|
||||
if (ptr_dcc->sock == -1)
|
||||
return;
|
||||
memset (&addr, 0, sizeof (addr));
|
||||
addr.sin_port = htons (ptr_dcc->port);
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
|
||||
fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK);
|
||||
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_send: send DCC request (file or chat)
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_send ()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_free: free DCC struct and remove it from list
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_free (t_dcc *ptr_dcc)
|
||||
{
|
||||
t_dcc *new_dcc_list;
|
||||
|
||||
if (ptr_dcc->prev_dcc)
|
||||
{
|
||||
(ptr_dcc->prev_dcc)->next_dcc = ptr_dcc->next_dcc;
|
||||
new_dcc_list = dcc_list;
|
||||
}
|
||||
else
|
||||
new_dcc_list = ptr_dcc->next_dcc;
|
||||
|
||||
if (ptr_dcc->next_dcc)
|
||||
(ptr_dcc->next_dcc)->prev_dcc = ptr_dcc->prev_dcc;
|
||||
|
||||
if (ptr_dcc->nick)
|
||||
free (ptr_dcc->nick);
|
||||
if (ptr_dcc->filename)
|
||||
free (ptr_dcc->filename);
|
||||
|
||||
free (ptr_dcc);
|
||||
dcc_list = new_dcc_list;
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_close: close a DCC connection
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_close (t_dcc *ptr_dcc, int status)
|
||||
{
|
||||
ptr_dcc->status = status;
|
||||
if (ptr_dcc->sock != -1)
|
||||
{
|
||||
close (ptr_dcc->sock);
|
||||
ptr_dcc->sock = -1;
|
||||
}
|
||||
if (ptr_dcc->file != -1)
|
||||
{
|
||||
close (ptr_dcc->file);
|
||||
ptr_dcc->file = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_accept: accepts a DCC file or chat request
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_accept (t_dcc *ptr_dcc)
|
||||
{
|
||||
char *ptr_home, *filename2;
|
||||
|
||||
dcc_connect (ptr_dcc);
|
||||
if (ptr_dcc->sock == -1)
|
||||
ptr_dcc->status = DCC_FAILED;
|
||||
else
|
||||
{
|
||||
ptr_dcc->status = DCC_ACTIVE;
|
||||
ptr_home = getenv ("HOME");
|
||||
ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) +
|
||||
strlen (ptr_dcc->nick) +
|
||||
strlen (ptr_dcc->filename) +
|
||||
((cfg_dcc_download_path[0] == '~') ?
|
||||
strlen (ptr_home) : 0) +
|
||||
4);
|
||||
if (!ptr_dcc->local_filename)
|
||||
{
|
||||
ptr_dcc->status = DCC_FAILED;
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
if (cfg_dcc_download_path[0] == '~')
|
||||
{
|
||||
strcpy (ptr_dcc->local_filename, ptr_home);
|
||||
strcat (ptr_dcc->local_filename, cfg_dcc_download_path + 1);
|
||||
}
|
||||
else
|
||||
strcpy (ptr_dcc->local_filename, cfg_dcc_download_path);
|
||||
if (ptr_dcc->local_filename[strlen (ptr_dcc->local_filename) - 1] != DIR_SEPARATOR_CHAR)
|
||||
strcat (ptr_dcc->local_filename, DIR_SEPARATOR);
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->nick);
|
||||
strcat (ptr_dcc->local_filename, ".");
|
||||
strcat (ptr_dcc->local_filename, ptr_dcc->filename);
|
||||
|
||||
/* file already exists? */
|
||||
if (access (ptr_dcc->local_filename, F_OK) == 0)
|
||||
{
|
||||
/* if auto rename is not set, then abort DCC */
|
||||
if (!cfg_dcc_auto_rename)
|
||||
{
|
||||
ptr_dcc->status = DCC_FAILED;
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
|
||||
filename2 = (char *) malloc (strlen (ptr_dcc->local_filename) + 16);
|
||||
if (!filename2)
|
||||
{
|
||||
ptr_dcc->status = DCC_FAILED;
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
ptr_dcc->filename_suffix = 0;
|
||||
do
|
||||
{
|
||||
ptr_dcc->filename_suffix++;
|
||||
sprintf (filename2, "%s.%d",
|
||||
ptr_dcc->local_filename,
|
||||
ptr_dcc->filename_suffix);
|
||||
}
|
||||
while (access (filename2, F_OK) == 0);
|
||||
|
||||
free (ptr_dcc->local_filename);
|
||||
ptr_dcc->local_filename = strdup (filename2);
|
||||
free (filename2);
|
||||
}
|
||||
ptr_dcc->file = open (ptr_dcc->local_filename,
|
||||
O_CREAT | O_TRUNC | O_WRONLY,
|
||||
0644);
|
||||
}
|
||||
dcc_redraw (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_add: add a DCC file to queue
|
||||
*/
|
||||
|
||||
t_dcc *
|
||||
dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nick, char *filename,
|
||||
unsigned int size)
|
||||
{
|
||||
t_dcc *new_dcc;
|
||||
|
||||
if ((new_dcc = (t_dcc *) malloc (sizeof (t_dcc))) == NULL)
|
||||
{
|
||||
gui_printf (NULL, _("%s not enough memory for new DCC\n"), WEECHAT_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
new_dcc->server = server;
|
||||
new_dcc->type = type;
|
||||
new_dcc->status = DCC_WAITING;
|
||||
new_dcc->addr = addr;
|
||||
new_dcc->port = port;
|
||||
new_dcc->nick = strdup (nick);
|
||||
new_dcc->sock = -1;
|
||||
new_dcc->file = -1;
|
||||
new_dcc->filename = strdup (filename);
|
||||
new_dcc->local_filename = NULL;
|
||||
new_dcc->filename_suffix = -1;
|
||||
new_dcc->size = size;
|
||||
new_dcc->pos = 0;
|
||||
new_dcc->prev_dcc = NULL;
|
||||
new_dcc->next_dcc = dcc_list;
|
||||
if (dcc_list)
|
||||
dcc_list->prev_dcc = new_dcc;
|
||||
dcc_list = new_dcc;
|
||||
|
||||
gui_current_window->dcc_first = NULL;
|
||||
gui_current_window->dcc_selected = NULL;
|
||||
|
||||
if (type == DCC_FILE_RECV)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_INFO);
|
||||
gui_printf (server->buffer, _("Incoming DCC file from "));
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_NICK,
|
||||
"%s",
|
||||
nick);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_DARK,
|
||||
" (");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_HOST,
|
||||
"%d.%d.%d.%d",
|
||||
addr >> 24, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_DARK,
|
||||
")");
|
||||
gui_printf (server->buffer, ": ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
filename);
|
||||
gui_printf (server->buffer, ", ");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%lu",
|
||||
size);
|
||||
gui_printf (server->buffer, _(" bytes\n"));
|
||||
}
|
||||
|
||||
if ( ( (type == DCC_CHAT_RECV) && (cfg_dcc_auto_accept_chats) )
|
||||
|| ( (type == DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) )
|
||||
dcc_accept (new_dcc);
|
||||
else
|
||||
dcc_redraw (2);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 0);
|
||||
|
||||
return new_dcc;
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_handle: receive/send data for each active DCC
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_handle ()
|
||||
{
|
||||
t_dcc *ptr_dcc;
|
||||
int num;
|
||||
char buffer[8192];
|
||||
uint32_t pos;
|
||||
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
if (ptr_dcc->status == DCC_ACTIVE)
|
||||
{
|
||||
if (ptr_dcc->type == DCC_FILE_RECV)
|
||||
{
|
||||
num = recv (ptr_dcc->sock, buffer, sizeof (buffer), 0);
|
||||
if (num != -1)
|
||||
{
|
||||
if (num == 0)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (write (ptr_dcc->file, buffer, num) == -1)
|
||||
{
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
dcc_redraw (1);
|
||||
return;
|
||||
}
|
||||
ptr_dcc->pos += (unsigned long) num;
|
||||
pos = htonl (ptr_dcc->pos);
|
||||
send (ptr_dcc->sock, (char *) &pos, 4, 0);
|
||||
if (ptr_dcc->pos >= ptr_dcc->size)
|
||||
{
|
||||
irc_display_prefix (ptr_dcc->server->buffer, PREFIX_INFO);
|
||||
gui_printf (ptr_dcc->server->buffer, _("DCC: file "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
ptr_dcc->filename);
|
||||
gui_printf (ptr_dcc->server->buffer, _(" (local filename: "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s",
|
||||
ptr_dcc->local_filename);
|
||||
gui_printf (ptr_dcc->server->buffer, _(") from "));
|
||||
gui_printf_color (ptr_dcc->server->buffer,
|
||||
COLOR_WIN_CHAT_NICK,
|
||||
"%s",
|
||||
ptr_dcc->nick);
|
||||
gui_printf (ptr_dcc->server->buffer, _(": ok!\n"));
|
||||
dcc_close (ptr_dcc, DCC_DONE);
|
||||
dcc_redraw (1);
|
||||
}
|
||||
dcc_redraw (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_end: close all opened sockets (called when WeeChat is exiting)
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_end ()
|
||||
{
|
||||
t_dcc *ptr_dcc;
|
||||
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
if (ptr_dcc->sock != -1)
|
||||
{
|
||||
if (ptr_dcc->status == DCC_ACTIVE)
|
||||
wee_log_printf (_("aborting active DCC: \"%s\" from %s\n"),
|
||||
ptr_dcc->filename, ptr_dcc->nick);
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
-25
@@ -41,16 +41,16 @@
|
||||
*/
|
||||
|
||||
void
|
||||
irc_display_prefix (t_gui_window *window, char *prefix)
|
||||
irc_display_prefix (t_gui_buffer *buffer, char *prefix)
|
||||
{
|
||||
if (prefix[0] == prefix[2])
|
||||
{
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_PREFIX1, "%c", prefix[0]);
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_PREFIX2, "%c", prefix[1]);
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_PREFIX1, "%c ", prefix[2]);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%c", prefix[0]);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX2, "%c", prefix[1]);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%c ", prefix[2]);
|
||||
}
|
||||
else
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -59,45 +59,45 @@ irc_display_prefix (t_gui_window *window, char *prefix)
|
||||
*/
|
||||
|
||||
void
|
||||
irc_display_nick (t_gui_window *window, t_irc_nick *nick, int message_type,
|
||||
irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
|
||||
int display_around, int color_nick, int no_nickmode)
|
||||
{
|
||||
if (display_around)
|
||||
gui_printf_color_type (window,
|
||||
gui_printf_color_type (buffer,
|
||||
message_type, COLOR_WIN_CHAT_DARK, "<");
|
||||
if (cfg_look_nickmode)
|
||||
{
|
||||
if (nick->is_op)
|
||||
gui_printf_color_type (window,
|
||||
gui_printf_color_type (buffer,
|
||||
message_type,
|
||||
COLOR_WIN_NICK_OP, "@");
|
||||
else
|
||||
{
|
||||
if (nick->is_halfop)
|
||||
gui_printf_color_type (window,
|
||||
gui_printf_color_type (buffer,
|
||||
message_type,
|
||||
COLOR_WIN_NICK_HALFOP, "%%");
|
||||
else
|
||||
{
|
||||
if (nick->has_voice)
|
||||
gui_printf_color_type (window,
|
||||
gui_printf_color_type (buffer,
|
||||
message_type,
|
||||
COLOR_WIN_NICK_VOICE, "+");
|
||||
else
|
||||
if (cfg_look_nickmode_empty && !no_nickmode)
|
||||
gui_printf_color_type (window,
|
||||
gui_printf_color_type (buffer,
|
||||
message_type,
|
||||
COLOR_WIN_CHAT, " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (color_nick < 0)
|
||||
gui_printf_color_type (window,
|
||||
gui_printf_color_type (buffer,
|
||||
message_type,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
"%s", nick->nick);
|
||||
else
|
||||
gui_printf_color_type (window,
|
||||
gui_printf_color_type (buffer,
|
||||
message_type,
|
||||
(color_nick) ?
|
||||
((cfg_look_color_nicks) ?
|
||||
@@ -106,7 +106,7 @@ irc_display_nick (t_gui_window *window, t_irc_nick *nick, int message_type,
|
||||
"%s", nick->nick);
|
||||
|
||||
if (display_around)
|
||||
gui_printf_color_type (window,
|
||||
gui_printf_color_type (buffer,
|
||||
message_type, COLOR_WIN_CHAT_DARK, "> ");
|
||||
}
|
||||
|
||||
@@ -115,21 +115,21 @@ irc_display_nick (t_gui_window *window, t_irc_nick *nick, int message_type,
|
||||
*/
|
||||
|
||||
void
|
||||
irc_display_mode (t_gui_window *window, char *channel_name, char set_flag,
|
||||
irc_display_mode (t_gui_buffer *buffer, char *channel_name, char set_flag,
|
||||
char *symbol, char *nick_host, char *message, char *param)
|
||||
{
|
||||
irc_display_prefix (window, PREFIX_INFO);
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_DARK, "[");
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_CHANNEL, "%s", channel_name);
|
||||
gui_printf_color (window, COLOR_WIN_CHAT, "/");
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_CHANNEL, "%c%s", set_flag, symbol);
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_DARK, "] ");
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_NICK, "%s", nick_host);
|
||||
irc_display_prefix (buffer, PREFIX_INFO);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_DARK, "[");
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_CHANNEL, "%s", channel_name);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT, "/");
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_CHANNEL, "%c%s", set_flag, symbol);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_DARK, "] ");
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_NICK, "%s", nick_host);
|
||||
if (param)
|
||||
{
|
||||
gui_printf_color (window, COLOR_WIN_CHAT, " %s ", message);
|
||||
gui_printf_color (window, COLOR_WIN_CHAT_NICK, "%s\n", param);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT, " %s ", message);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT_NICK, "%s\n", param);
|
||||
}
|
||||
else
|
||||
gui_printf_color (window, COLOR_WIN_CHAT, " %s\n", message);
|
||||
gui_printf_color (buffer, COLOR_WIN_CHAT, " %s\n", message);
|
||||
}
|
||||
|
||||
+18
-26
@@ -37,34 +37,18 @@
|
||||
*/
|
||||
|
||||
int
|
||||
nick_find_color (t_irc_channel *channel)
|
||||
nick_find_color (t_irc_nick *nick)
|
||||
{
|
||||
int i, color_less_used, min_used;
|
||||
int count_used[COLOR_WIN_NICK_NUMBER];
|
||||
t_irc_nick *ptr_nick;
|
||||
int i, color;
|
||||
|
||||
/* initialize array for counting usage of color */
|
||||
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
|
||||
count_used[i] = 0;
|
||||
|
||||
/* summarize each color usage */
|
||||
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
|
||||
count_used[ptr_nick->color - COLOR_WIN_NICK_FIRST]++;
|
||||
|
||||
/* look for color less used on channel */
|
||||
color_less_used = -1;
|
||||
min_used = INT_MAX;
|
||||
for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
|
||||
color = 0;
|
||||
for (i = strlen (nick->nick) - 1; i >= 0; i--)
|
||||
{
|
||||
if (count_used[i] < min_used)
|
||||
{
|
||||
color_less_used = i;
|
||||
min_used = count_used[i];
|
||||
}
|
||||
color += (int)(nick->nick[i]);
|
||||
}
|
||||
color = (color % COLOR_WIN_NICK_NUMBER);
|
||||
|
||||
return (color_less_used < 0) ?
|
||||
COLOR_WIN_NICK_FIRST : COLOR_WIN_NICK_FIRST + color_less_used;
|
||||
return COLOR_WIN_NICK_FIRST + color;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -182,7 +166,7 @@ nick_new (t_irc_channel *channel, char *nick_name,
|
||||
/* alloc memory for new nick */
|
||||
if ((new_nick = (t_irc_nick *) malloc (sizeof (t_irc_nick))) == NULL)
|
||||
{
|
||||
gui_printf (channel->window,
|
||||
gui_printf (channel->buffer,
|
||||
_("%s cannot allocate new nick\n"), WEECHAT_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
@@ -192,10 +176,10 @@ nick_new (t_irc_channel *channel, char *nick_name,
|
||||
new_nick->is_op = is_op;
|
||||
new_nick->is_halfop = is_halfop;
|
||||
new_nick->has_voice = has_voice;
|
||||
if (strcasecmp (new_nick->nick, SERVER(channel->window)->nick) == 0)
|
||||
if (strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0)
|
||||
new_nick->color = COLOR_WIN_NICK_SELF;
|
||||
else
|
||||
new_nick->color = nick_find_color (channel);
|
||||
new_nick->color = nick_find_color (new_nick);
|
||||
|
||||
nick_insert_sorted (channel, new_nick);
|
||||
|
||||
@@ -231,10 +215,18 @@ nick_resort (t_irc_channel *channel, t_irc_nick *nick)
|
||||
void
|
||||
nick_change (t_irc_channel *channel, t_irc_nick *nick, char *new_nick)
|
||||
{
|
||||
int nick_is_me;
|
||||
|
||||
nick_is_me = (strcmp (nick->nick, SERVER(channel->buffer)->nick) == 0) ? 1 : 0;
|
||||
|
||||
/* change nickname */
|
||||
if (nick->nick)
|
||||
free (nick->nick);
|
||||
nick->nick = strdup (new_nick);
|
||||
if (nick_is_me)
|
||||
nick->color = COLOR_WIN_NICK_SELF;
|
||||
else
|
||||
nick->color = nick_find_color (nick);
|
||||
|
||||
/* insert again nick into sorted list */
|
||||
nick_resort (channel, nick);
|
||||
|
||||
+827
-459
File diff suppressed because it is too large
Load Diff
+299
-85
@@ -56,7 +56,7 @@ irc_login (t_irc_server *server)
|
||||
hostname[sizeof (hostname) - 1] = '\0';
|
||||
if (!hostname[0])
|
||||
strcpy (hostname, _("unknown"));
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s: using local hostname \"%s\"\n"),
|
||||
PACKAGE_NAME, hostname);
|
||||
server_sendf (server,
|
||||
@@ -89,6 +89,8 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *pos;
|
||||
t_irc_server *ptr_server;
|
||||
time_t elapsed;
|
||||
char buffer[4096];
|
||||
|
||||
if (arguments && (strncmp (arguments, "-all", 4) == 0))
|
||||
{
|
||||
@@ -101,21 +103,65 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (server->is_connected)
|
||||
if (ptr_server->is_connected)
|
||||
{
|
||||
if (pos)
|
||||
{
|
||||
ptr_server->is_away = 1;
|
||||
ptr_server->away_time = time (NULL);
|
||||
server_sendf (ptr_server, "AWAY :%s\r\n", pos);
|
||||
if (cfg_look_display_away)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer), "is away: %s", pos);
|
||||
irc_send_me_all_channels (ptr_server, buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
server_sendf (ptr_server, "AWAY\r\n");
|
||||
ptr_server->is_away = 0;
|
||||
elapsed = time (NULL) - ptr_server->away_time;
|
||||
if (cfg_look_display_away)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer),
|
||||
"is back (gone %.2ld:%.2ld:%.2ld)",
|
||||
elapsed / 3600,
|
||||
(elapsed / 60) % 60,
|
||||
elapsed % 60);
|
||||
irc_send_me_all_channels (ptr_server, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (arguments)
|
||||
{
|
||||
server->is_away = 1;
|
||||
server->away_time = time (NULL);
|
||||
server_sendf (server, "AWAY :%s\r\n", arguments);
|
||||
if (cfg_look_display_away)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer), "is away: %s", arguments);
|
||||
irc_send_me_all_channels (server, buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
server_sendf (server, "AWAY\r\n");
|
||||
server->is_away = 0;
|
||||
elapsed = time (NULL) - server->away_time;
|
||||
if (cfg_look_display_away)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer),
|
||||
"is back (gone %.2ld:%.2ld:%.2ld)",
|
||||
elapsed / 3600,
|
||||
(elapsed / 60) % 60,
|
||||
elapsed % 60);
|
||||
irc_send_me_all_channels (server, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -178,6 +224,17 @@ irc_cmd_send_ctcp (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_dcc: starts DCC (file or chat)
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_dcc (t_irc_server *server, char *arguments)
|
||||
{
|
||||
/* TODO: write this command! */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_deop: remove operator privileges from nickname(s)
|
||||
*/
|
||||
@@ -187,15 +244,15 @@ irc_cmd_send_deop (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (WIN_IS_CHANNEL(gui_current_window))
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s -o %s\r\n",
|
||||
CHANNEL(gui_current_window)->name,
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
else
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
WEECHAT_ERROR, "deop");
|
||||
return 0;
|
||||
@@ -210,16 +267,16 @@ irc_cmd_send_devoice (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (WIN_IS_CHANNEL(gui_current_window))
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s -v %s\r\n",
|
||||
CHANNEL(gui_current_window)->name,
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
WEECHAT_ERROR, "devoice");
|
||||
return -1;
|
||||
@@ -295,19 +352,31 @@ irc_cmd_send_join (t_irc_server *server, char *arguments)
|
||||
int
|
||||
irc_cmd_send_kick (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *args, *pos;
|
||||
|
||||
if (string_is_channel (arguments))
|
||||
server_sendf (server, "KICK %s\r\n", arguments);
|
||||
else
|
||||
{
|
||||
if (WIN_IS_CHANNEL (gui_current_window))
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
{
|
||||
server_sendf (server,
|
||||
"KICK %s %s\r\n",
|
||||
CHANNEL(gui_current_window)->name, arguments);
|
||||
args = strdup (arguments);
|
||||
pos = strchr (args, ' ');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
if (pos)
|
||||
server_sendf (server,
|
||||
"KICK %s %s :%s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name, args, pos + 1);
|
||||
else
|
||||
server_sendf (server,
|
||||
"KICK %s %s\r\n",
|
||||
CHANNEL(gui_current_window->buffer)->name, args);
|
||||
free (args);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
WEECHAT_ERROR, "kick");
|
||||
return -1;
|
||||
@@ -370,6 +439,41 @@ irc_cmd_send_lusers (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_send_me: send a ctcp action to a channel
|
||||
*/
|
||||
|
||||
int
|
||||
irc_send_me (t_irc_server *server, t_irc_channel *channel, char *arguments)
|
||||
{
|
||||
server_sendf (server, "PRIVMSG %s :\01ACTION %s\01\r\n",
|
||||
channel->name, arguments);
|
||||
irc_display_prefix (channel->buffer, PREFIX_ACTION_ME);
|
||||
gui_printf_color (channel->buffer,
|
||||
COLOR_WIN_CHAT_NICK, "%s", server->nick);
|
||||
gui_printf_color (channel->buffer,
|
||||
COLOR_WIN_CHAT, " %s\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_send_me_all_channels: send a ctcp action to all channels of a server
|
||||
*/
|
||||
|
||||
int
|
||||
irc_send_me_all_channels (t_irc_server *server, char *arguments)
|
||||
{
|
||||
t_irc_channel *ptr_channel;
|
||||
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
irc_send_me (server, ptr_channel, arguments);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_me: send a ctcp action to the current channel
|
||||
*/
|
||||
@@ -377,20 +481,14 @@ irc_cmd_send_lusers (t_irc_server *server, char *arguments)
|
||||
int
|
||||
irc_cmd_send_me (t_irc_server *server, char *arguments)
|
||||
{
|
||||
if (WIN_IS_SERVER(gui_current_window))
|
||||
if (BUFFER_IS_SERVER(gui_current_window->buffer))
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
WEECHAT_ERROR, "me");
|
||||
return -1;
|
||||
}
|
||||
server_sendf (server, "PRIVMSG %s :\01ACTION %s\01\r\n",
|
||||
CHANNEL(gui_current_window)->name, arguments);
|
||||
irc_display_prefix (gui_current_window, PREFIX_ACTION_ME);
|
||||
gui_printf_color (gui_current_window,
|
||||
COLOR_WIN_CHAT_NICK, "%s", server->nick);
|
||||
gui_printf_color (gui_current_window,
|
||||
COLOR_WIN_CHAT, " %s\n", arguments);
|
||||
irc_send_me (server, CHANNEL(gui_current_window->buffer), arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -405,6 +503,20 @@ irc_cmd_send_mode (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_motd: get the "Message Of The Day"
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_motd (t_irc_server *server, char *arguments)
|
||||
{
|
||||
if (arguments)
|
||||
server_sendf (server, "MOTD %s\r\n", arguments);
|
||||
else
|
||||
server_sendf (server, "MOTD\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_msg: send a message to a nick or channel
|
||||
*/
|
||||
@@ -413,6 +525,7 @@ int
|
||||
irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *pos, *pos_comma;
|
||||
char *msg_pwd_hidden, *pos_pwd;
|
||||
t_irc_channel *ptr_channel;
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
@@ -434,25 +547,25 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
}
|
||||
if (strcmp (arguments, "*") == 0)
|
||||
{
|
||||
if (WIN_IS_SERVER(gui_current_window))
|
||||
if (BUFFER_IS_SERVER(gui_current_window->buffer))
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
WEECHAT_ERROR, "msg *");
|
||||
return -1;
|
||||
}
|
||||
ptr_channel = CHANNEL(gui_current_window);
|
||||
ptr_channel = CHANNEL(gui_current_window->buffer);
|
||||
ptr_nick = nick_search (ptr_channel, server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (ptr_channel->window, ptr_nick,
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_color_type (ptr_channel->window,
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
}
|
||||
else
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s nick not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "msg");
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n", ptr_channel->name, pos);
|
||||
@@ -467,14 +580,14 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
ptr_nick = nick_search (ptr_channel, server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (ptr_channel->window, ptr_nick,
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_color_type (ptr_channel->window,
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
}
|
||||
else
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s nick not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "msg");
|
||||
}
|
||||
@@ -482,32 +595,67 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* message to nickserv with identify ? */
|
||||
if (strcmp (arguments, "nickserv") == 0)
|
||||
{
|
||||
msg_pwd_hidden = strdup (pos);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
{
|
||||
pos_pwd = strstr (msg_pwd_hidden, "identify ");
|
||||
if (!pos_pwd)
|
||||
pos_pwd = strstr (msg_pwd_hidden, "register ");
|
||||
if (pos_pwd)
|
||||
{
|
||||
pos_pwd += 9;
|
||||
while (pos_pwd[0])
|
||||
{
|
||||
pos_pwd[0] = '*';
|
||||
pos_pwd++;
|
||||
}
|
||||
}
|
||||
}
|
||||
gui_printf_color_type (server->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "-");
|
||||
gui_printf_color_type (server->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_NICK, "%s", arguments);
|
||||
gui_printf_color_type (server->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "-");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, " %s\n", msg_pwd_hidden);
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n", arguments, pos);
|
||||
free (msg_pwd_hidden);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ptr_channel = channel_search (server, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
ptr_channel = channel_new (server, CHAT_PRIVATE, arguments, 1);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s cannot create new private window \"%s\"\n"),
|
||||
WEECHAT_ERROR,
|
||||
arguments);
|
||||
return -1;
|
||||
}
|
||||
gui_redraw_window_title (ptr_channel->window);
|
||||
gui_draw_buffer_title (ptr_channel->buffer, 1);
|
||||
}
|
||||
|
||||
gui_printf_color_type (ptr_channel->window,
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
gui_printf_color_type (ptr_channel->window,
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_SELF,
|
||||
"%s", server->nick);
|
||||
gui_printf_color_type (ptr_channel->window,
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_color_type (ptr_channel->window,
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n", arguments, pos);
|
||||
@@ -518,7 +666,7 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s wrong argument count for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "msg");
|
||||
return -1;
|
||||
@@ -526,20 +674,6 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_motd: get the "Message Of The Day"
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_motd (t_irc_server *server, char *arguments)
|
||||
{
|
||||
if (arguments)
|
||||
server_sendf (server, "MOTD %s\r\n", arguments);
|
||||
else
|
||||
server_sendf (server, "MOTD\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_names: list nicknames on channels
|
||||
*/
|
||||
@@ -551,16 +685,16 @@ irc_cmd_send_names (t_irc_server *server, char *arguments)
|
||||
server_sendf (server, "NAMES %s\r\n", arguments);
|
||||
else
|
||||
{
|
||||
if (!WIN_IS_CHANNEL(gui_current_window))
|
||||
if (!BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
WEECHAT_ERROR, "names");
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
server_sendf (server, "NAMES %s\r\n",
|
||||
CHANNEL(gui_current_window)->name);
|
||||
CHANNEL(gui_current_window->buffer)->name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -598,16 +732,16 @@ irc_cmd_send_op (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (WIN_IS_CHANNEL(gui_current_window))
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s +o %s\r\n",
|
||||
CHANNEL(gui_current_window)->name,
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
WEECHAT_ERROR, "op");
|
||||
return -1;
|
||||
@@ -622,7 +756,7 @@ irc_cmd_send_op (t_irc_server *server, int argc, char **argv)
|
||||
int
|
||||
irc_cmd_send_oper (t_irc_server *server, char *arguments)
|
||||
{
|
||||
server_sendf (server, "OPER %s %s\r\n", arguments);
|
||||
server_sendf (server, "OPER %s\r\n", arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -652,36 +786,36 @@ irc_cmd_send_part (t_irc_server *server, char *arguments)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (WIN_IS_SERVER(gui_current_window))
|
||||
if (BUFFER_IS_SERVER(gui_current_window->buffer))
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
WEECHAT_ERROR, "part");
|
||||
return -1;
|
||||
}
|
||||
channel_name = CHANNEL(gui_current_window)->name;
|
||||
channel_name = CHANNEL(gui_current_window->buffer)->name;
|
||||
pos_args = arguments;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (WIN_IS_SERVER(gui_current_window))
|
||||
if (BUFFER_IS_SERVER(gui_current_window->buffer))
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
WEECHAT_ERROR, "part");
|
||||
return -1;
|
||||
}
|
||||
if (WIN_IS_PRIVATE(gui_current_window))
|
||||
if (BUFFER_IS_PRIVATE(gui_current_window->buffer))
|
||||
{
|
||||
ptr_channel = CHANNEL(gui_current_window);
|
||||
gui_window_free (ptr_channel->window);
|
||||
ptr_channel = CHANNEL(gui_current_window->buffer);
|
||||
gui_buffer_free (ptr_channel->buffer, 1);
|
||||
channel_free (server, ptr_channel);
|
||||
gui_redraw_window_status (gui_current_window);
|
||||
gui_redraw_window_input (gui_current_window);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
return 0;
|
||||
}
|
||||
channel_name = CHANNEL(gui_current_window)->name;
|
||||
channel_name = CHANNEL(gui_current_window->buffer)->name;
|
||||
pos_args = NULL;
|
||||
}
|
||||
|
||||
@@ -714,6 +848,77 @@ irc_cmd_send_pong (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_query: start private conversation with a nick
|
||||
*/
|
||||
|
||||
int
|
||||
irc_cmd_send_query (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *pos;
|
||||
t_irc_channel *ptr_channel;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
pos = strchr (arguments, ' ');
|
||||
if (pos)
|
||||
{
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
if (!pos[0])
|
||||
pos = NULL;
|
||||
}
|
||||
|
||||
/* create private window if not already opened */
|
||||
ptr_channel = channel_search (server, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
ptr_channel = channel_new (server, CHAT_PRIVATE, arguments, 1);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
gui_printf (server->buffer,
|
||||
_("%s cannot create new private window \"%s\"\n"),
|
||||
WEECHAT_ERROR,
|
||||
arguments);
|
||||
return -1;
|
||||
}
|
||||
gui_draw_buffer_title (ptr_channel->buffer, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
if (ptr_buffer->channel == ptr_channel)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window, ptr_buffer);
|
||||
gui_redraw_buffer (ptr_buffer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* display text if given */
|
||||
if (pos)
|
||||
{
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_SELF,
|
||||
"%s", server->nick);
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_color_type (ptr_channel->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", pos);
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n", arguments, pos);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_quit: disconnect from all servers and quit WeeChat
|
||||
*/
|
||||
@@ -721,12 +926,21 @@ irc_cmd_send_pong (t_irc_server *server, char *arguments)
|
||||
int
|
||||
irc_cmd_send_quit (t_irc_server *server, char *arguments)
|
||||
{
|
||||
if (server && server->is_connected)
|
||||
t_irc_server *ptr_server;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) server;
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (arguments)
|
||||
server_sendf (server, "QUIT :%s\r\n", arguments);
|
||||
else
|
||||
server_sendf (server, "QUIT\r\n");
|
||||
if (ptr_server->is_connected)
|
||||
{
|
||||
if (arguments)
|
||||
server_sendf (ptr_server, "QUIT :%s\r\n", arguments);
|
||||
else
|
||||
server_sendf (ptr_server, "QUIT\r\n");
|
||||
}
|
||||
}
|
||||
quit_weechat = 1;
|
||||
return 0;
|
||||
@@ -892,14 +1106,14 @@ irc_cmd_send_topic (t_irc_server *server, char *arguments)
|
||||
/* look for current channel if not specified */
|
||||
if (!channel_name)
|
||||
{
|
||||
if (WIN_IS_SERVER(gui_current_window))
|
||||
if (BUFFER_IS_SERVER(gui_current_window->buffer))
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
WEECHAT_ERROR, "topic");
|
||||
return -1;
|
||||
}
|
||||
channel_name = CHANNEL(gui_current_window)->name;
|
||||
channel_name = CHANNEL(gui_current_window->buffer)->name;
|
||||
}
|
||||
|
||||
if (new_topic)
|
||||
@@ -962,8 +1176,8 @@ irc_cmd_send_version (t_irc_server *server, char *arguments)
|
||||
{
|
||||
if (arguments)
|
||||
{
|
||||
if (WIN_IS_CHANNEL(gui_current_window) &&
|
||||
nick_search (CHANNEL(gui_current_window), arguments))
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer) &&
|
||||
nick_search (CHANNEL(gui_current_window->buffer), arguments))
|
||||
server_sendf (server, "PRIVMSG %s :\01VERSION\01\r\n",
|
||||
arguments);
|
||||
else
|
||||
@@ -972,8 +1186,8 @@ irc_cmd_send_version (t_irc_server *server, char *arguments)
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (server->window, PREFIX_INFO);
|
||||
gui_printf (server->window, _("%s, compiled on %s %s\n"),
|
||||
irc_display_prefix (server->buffer, PREFIX_INFO);
|
||||
gui_printf (server->buffer, _("%s, compiled on %s %s\n"),
|
||||
PACKAGE_STRING,
|
||||
__DATE__, __TIME__);
|
||||
server_sendf (server, "VERSION\r\n");
|
||||
@@ -990,16 +1204,16 @@ irc_cmd_send_voice (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (WIN_IS_CHANNEL(gui_current_window))
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
{
|
||||
for (i = 0; i < argc; i++)
|
||||
server_sendf (server, "MODE %s +v %s\r\n",
|
||||
CHANNEL(gui_current_window)->name,
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
argv[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
WEECHAT_ERROR, "voice");
|
||||
return -1;
|
||||
|
||||
+216
-92
@@ -26,9 +26,11 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
@@ -42,7 +44,6 @@
|
||||
|
||||
t_irc_server *irc_servers = NULL;
|
||||
t_irc_server *last_irc_server = NULL;
|
||||
t_irc_server *current_irc_server = NULL;
|
||||
|
||||
t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
|
||||
@@ -59,6 +60,7 @@ server_init (t_irc_server *server)
|
||||
{
|
||||
server->name = NULL;
|
||||
server->autoconnect = 0;
|
||||
server->command_line = 0;
|
||||
server->address = NULL;
|
||||
server->port = -1;
|
||||
server->password = NULL;
|
||||
@@ -75,11 +77,108 @@ server_init (t_irc_server *server)
|
||||
server->is_away = 0;
|
||||
server->server_read = -1;
|
||||
server->server_write = -1;
|
||||
server->window = NULL;
|
||||
server->buffer = NULL;
|
||||
server->channels = NULL;
|
||||
server->last_channel = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* server_init_with_url: init a server with url of this form:
|
||||
* irc://nick:pass@irc.toto.org:6667
|
||||
* returns: 0 = ok
|
||||
* -1 = invalid syntax
|
||||
*/
|
||||
|
||||
int
|
||||
server_init_with_url (char *irc_url, t_irc_server *server)
|
||||
{
|
||||
char *url, *pos_server, *pos_channel, *pos, *pos2;
|
||||
struct passwd *my_passwd;
|
||||
|
||||
server_init (server);
|
||||
if (strncasecmp (irc_url, "irc://", 6) != 0)
|
||||
return -1;
|
||||
url = strdup (irc_url);
|
||||
pos_server = strchr (url, '@');
|
||||
if (pos_server)
|
||||
{
|
||||
pos_server[0] = '\0';
|
||||
pos_server++;
|
||||
pos = url + 6;
|
||||
if (!pos[0])
|
||||
{
|
||||
free (url);
|
||||
return -1;
|
||||
}
|
||||
pos2 = strchr (pos, ':');
|
||||
if (pos2)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
server->password = strdup (pos2 + 1);
|
||||
}
|
||||
server->nick1 = strdup (pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((my_passwd = getpwuid (geteuid ())) != NULL)
|
||||
server->nick1 = strdup (my_passwd->pw_name);
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "%s: %s (%s).",
|
||||
WEECHAT_WARNING,
|
||||
_("Unable to get user's name"),
|
||||
strerror (errno));
|
||||
free (url);
|
||||
return -1;
|
||||
}
|
||||
pos_server = url + 6;
|
||||
}
|
||||
if (!pos_server[0])
|
||||
{
|
||||
free (url);
|
||||
return -1;
|
||||
}
|
||||
pos_channel = strchr (pos_server, '/');
|
||||
if (pos_channel)
|
||||
{
|
||||
pos_channel[0] = '\0';
|
||||
pos_channel++;
|
||||
}
|
||||
pos = strchr (pos_server, ':');
|
||||
if (pos)
|
||||
{
|
||||
pos[0] = '\0';
|
||||
server->port = atoi (pos + 1);
|
||||
}
|
||||
server->name = strdup (pos_server);
|
||||
server->address = strdup (pos_server);
|
||||
if (pos_channel && pos_channel[0])
|
||||
{
|
||||
if (string_is_channel (pos_channel))
|
||||
server->autojoin = strdup (pos_channel);
|
||||
else
|
||||
{
|
||||
server->autojoin = (char *) malloc (strlen (pos_channel) + 2);
|
||||
strcpy (server->autojoin, "#");
|
||||
strcat (server->autojoin, pos_channel);
|
||||
}
|
||||
}
|
||||
|
||||
free (url);
|
||||
|
||||
/* some default values */
|
||||
if (server->port < 0)
|
||||
server->port = DEFAULT_IRC_PORT;
|
||||
server->nick2 = (char *) malloc (strlen (server->nick1) + 2);
|
||||
strcpy (server->nick2, server->nick1);
|
||||
server->nick2 = strcat (server->nick2, "1");
|
||||
server->nick3 = (char *) malloc (strlen (server->nick1) + 2);
|
||||
strcpy (server->nick3, server->nick1);
|
||||
server->nick3 = strcat (server->nick3, "2");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* server_alloc: allocate a new server and add it to the servers queue
|
||||
*/
|
||||
@@ -170,8 +269,6 @@ server_free (t_irc_server *server)
|
||||
(server->next_server)->prev_server = server->prev_server;
|
||||
|
||||
server_destroy (server);
|
||||
if (server->window)
|
||||
gui_window_free (server->window);
|
||||
free (server);
|
||||
irc_servers = new_irc_servers;
|
||||
}
|
||||
@@ -193,9 +290,10 @@ server_free_all ()
|
||||
*/
|
||||
|
||||
t_irc_server *
|
||||
server_new (char *name, int autoconnect, char *address, int port,
|
||||
char *password, char *nick1, char *nick2, char *nick3,
|
||||
char *username, char *realname, char *command, char *autojoin)
|
||||
server_new (char *name, int autoconnect, int command_line, char *address,
|
||||
int port, char *password, char *nick1, char *nick2, char *nick3,
|
||||
char *username, char *realname, char *command, char *autojoin,
|
||||
int autorejoin)
|
||||
{
|
||||
t_irc_server *new_server;
|
||||
|
||||
@@ -205,17 +303,19 @@ server_new (char *name, int autoconnect, char *address, int port,
|
||||
#ifdef DEBUG
|
||||
wee_log_printf ("creating new server (name:%s, address:%s, port:%d, pwd:%s, "
|
||||
"nick1:%s, nick2:%s, nick3:%s, username:%s, realname:%s, "
|
||||
"command:%s, autojoin:%s)\n",
|
||||
"command:%s, autojoin:%s, autorejoin:%s)\n",
|
||||
name, address, port, (password) ? password : "",
|
||||
(nick1) ? nick1 : "", (nick2) ? nick2 : "", (nick3) ? nick3 : "",
|
||||
(username) ? username : "", (realname) ? realname : "",
|
||||
(command) ? command : "", (autojoin) ? autojoin : "");
|
||||
(command) ? command : "", (autojoin) ? autojoin : "",
|
||||
(autorejoin) ? "on" : "off");
|
||||
#endif
|
||||
|
||||
if ((new_server = server_alloc ()))
|
||||
{
|
||||
new_server->name = strdup (name);
|
||||
new_server->autoconnect = autoconnect;
|
||||
new_server->command_line = command_line;
|
||||
new_server->address = strdup (address);
|
||||
new_server->port = port;
|
||||
new_server->password = (password) ? strdup (password) : strdup ("");
|
||||
@@ -230,6 +330,7 @@ server_new (char *name, int autoconnect, char *address, int port,
|
||||
(command) ? strdup (command) : NULL;
|
||||
new_server->autojoin =
|
||||
(autojoin) ? strdup (autojoin) : NULL;
|
||||
new_server->autorejoin = autorejoin;
|
||||
new_server->nick = strdup (new_server->nick1);
|
||||
}
|
||||
else
|
||||
@@ -254,7 +355,7 @@ server_send (t_irc_server * server, char *buffer, int size_buf)
|
||||
* server_sendf: send formatted data to irc server
|
||||
*/
|
||||
|
||||
int
|
||||
void
|
||||
server_sendf (t_irc_server * server, char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
@@ -262,24 +363,26 @@ server_sendf (t_irc_server * server, char *fmt, ...)
|
||||
int size_buf;
|
||||
|
||||
if (!server)
|
||||
return -1;
|
||||
return;
|
||||
|
||||
va_start (args, fmt);
|
||||
size_buf = vsnprintf (buffer, sizeof (buffer) - 1, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
if ((size_buf == 0) || (strcmp (buffer, "\r\n") == 0))
|
||||
return 0;
|
||||
return;
|
||||
|
||||
buffer[sizeof (buffer) - 1] = '\0';
|
||||
if ((size_buf < 0) || (size_buf > (int) (sizeof (buffer) - 1)))
|
||||
size_buf = strlen (buffer);
|
||||
buffer[size_buf - 2] = '\0';
|
||||
#ifdef DEBUG
|
||||
gui_printf (server->window, "[DEBUG] Sending to server >>> %s\n", buffer);
|
||||
gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer);
|
||||
#endif
|
||||
buffer[size_buf - 2] = '\r';
|
||||
return server_send (server, buffer, size_buf);
|
||||
if (server_send (server, buffer, size_buf) <= 0)
|
||||
gui_printf (server->buffer, _("%s error sending data to IRC server\n"),
|
||||
WEECHAT_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -287,18 +390,32 @@ server_sendf (t_irc_server * server, char *fmt, ...)
|
||||
*/
|
||||
|
||||
void
|
||||
server_msgq_add_msg (t_irc_server * server, char *msg)
|
||||
server_msgq_add_msg (t_irc_server *server, char *msg)
|
||||
{
|
||||
t_irc_message *message;
|
||||
|
||||
message = (t_irc_message *) malloc (sizeof (t_irc_message));
|
||||
if (!message)
|
||||
{
|
||||
gui_printf (server->buffer,
|
||||
_("%s not enough memory for received IRC message\n"),
|
||||
WEECHAT_ERROR);
|
||||
return;
|
||||
}
|
||||
message->server = server;
|
||||
if (unterminated_message)
|
||||
{
|
||||
message->data = (char *) malloc (strlen (unterminated_message) +
|
||||
strlen (msg) + 1);
|
||||
strcpy (message->data, unterminated_message);
|
||||
strcat (message->data, msg);
|
||||
if (!message->data)
|
||||
gui_printf (server->buffer,
|
||||
_("%s not enough memory for received IRC message\n"),
|
||||
WEECHAT_ERROR);
|
||||
else
|
||||
{
|
||||
strcpy (message->data, unterminated_message);
|
||||
strcat (message->data, msg);
|
||||
}
|
||||
free (unterminated_message);
|
||||
unterminated_message = NULL;
|
||||
}
|
||||
@@ -344,10 +461,15 @@ server_msgq_add_buffer (t_irc_server * server, char *buffer)
|
||||
unterminated_message =
|
||||
(char *) realloc (unterminated_message,
|
||||
strlen (buffer) + 1);
|
||||
strcpy (unterminated_message, buffer);
|
||||
if (!unterminated_message)
|
||||
gui_printf (server->buffer,
|
||||
_("%s not enough memory for received IRC message\n"),
|
||||
WEECHAT_ERROR);
|
||||
else
|
||||
strcpy (unterminated_message, buffer);
|
||||
return;
|
||||
}
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s unable to explode received buffer\n"),
|
||||
WEECHAT_ERROR);
|
||||
}
|
||||
@@ -362,81 +484,83 @@ void
|
||||
server_msgq_flush ()
|
||||
{
|
||||
t_irc_message *next;
|
||||
/*char **argv;
|
||||
int argc;*/
|
||||
char *entire_line, *ptr_data, *pos, *pos2;
|
||||
char *host, *command, *args;
|
||||
|
||||
/* TODO: optimize this function, parse only a few messages (for low CPU time!) */
|
||||
while (recv_msgq)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
gui_printf (gui_current_window, "[DEBUG] %s\n", recv_msgq->data);
|
||||
#endif
|
||||
|
||||
ptr_data = recv_msgq->data;
|
||||
entire_line = strdup (ptr_data);
|
||||
|
||||
while (ptr_data[0] == ' ')
|
||||
ptr_data++;
|
||||
|
||||
if (ptr_data)
|
||||
if (recv_msgq->data)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
gui_printf (NULL, "[DEBUG] data received from server: %s\n", ptr_data);
|
||||
gui_printf (gui_current_window->buffer, "[DEBUG] %s\n", recv_msgq->data);
|
||||
#endif
|
||||
|
||||
host = NULL;
|
||||
command = NULL;
|
||||
args = ptr_data;
|
||||
ptr_data = recv_msgq->data;
|
||||
entire_line = strdup (ptr_data);
|
||||
|
||||
if (ptr_data[0] == ':')
|
||||
{
|
||||
pos = strchr(ptr_data, ' ');
|
||||
pos[0] = '\0';
|
||||
host = ptr_data+1;
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
pos = ptr_data;
|
||||
while (ptr_data[0] == ' ')
|
||||
ptr_data++;
|
||||
|
||||
if (pos != NULL)
|
||||
if (ptr_data)
|
||||
{
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
pos2 = strchr(pos, ' ');
|
||||
if (pos2 != NULL)
|
||||
#ifdef DEBUG
|
||||
gui_printf (NULL, "[DEBUG] data received from server: %s\n", ptr_data);
|
||||
#endif
|
||||
|
||||
host = NULL;
|
||||
command = NULL;
|
||||
args = ptr_data;
|
||||
|
||||
if (ptr_data[0] == ':')
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
command = strdup(pos);
|
||||
pos2++;
|
||||
while (pos2[0] == ' ')
|
||||
pos = strchr(ptr_data, ' ');
|
||||
pos[0] = '\0';
|
||||
host = ptr_data+1;
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
pos = ptr_data;
|
||||
|
||||
if (pos != NULL)
|
||||
{
|
||||
while (pos[0] == ' ')
|
||||
pos++;
|
||||
pos2 = strchr(pos, ' ');
|
||||
if (pos2 != NULL)
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
command = strdup(pos);
|
||||
pos2++;
|
||||
args = (pos2[0] == ':') ? pos2+1 : pos2;
|
||||
while (pos2[0] == ' ')
|
||||
pos2++;
|
||||
args = (pos2[0] == ':') ? pos2+1 : pos2;
|
||||
}
|
||||
}
|
||||
|
||||
switch (irc_recv_command (recv_msgq->server, entire_line, host,
|
||||
command, args))
|
||||
{
|
||||
case -1:
|
||||
gui_printf (recv_msgq->server->buffer,
|
||||
_("Command '%s' failed!\n"), command);
|
||||
break;
|
||||
case -2:
|
||||
gui_printf (recv_msgq->server->buffer,
|
||||
_("No command to execute!\n"));
|
||||
break;
|
||||
case -3:
|
||||
gui_printf (recv_msgq->server->buffer,
|
||||
_("Unknown command: cmd=%s, args=%s\n"),
|
||||
command, args);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (irc_recv_command (recv_msgq->server, entire_line, host,
|
||||
command, args))
|
||||
{
|
||||
case -1:
|
||||
gui_printf (recv_msgq->server->window,
|
||||
_("Command '%s' failed!\n"), command);
|
||||
break;
|
||||
case -2:
|
||||
gui_printf (recv_msgq->server->window,
|
||||
_("No command to execute!\n"));
|
||||
break;
|
||||
case -3:
|
||||
gui_printf (recv_msgq->server->window,
|
||||
_("Unknown command: cmd=%s, args=%s\n"),
|
||||
command, args);
|
||||
break;
|
||||
}
|
||||
free (entire_line);
|
||||
free (recv_msgq->data);
|
||||
}
|
||||
|
||||
free (entire_line);
|
||||
free (recv_msgq->data);
|
||||
|
||||
next = recv_msgq->next_message;
|
||||
free (recv_msgq);
|
||||
recv_msgq = next;
|
||||
@@ -478,7 +602,7 @@ server_connect (t_irc_server *server)
|
||||
int error;
|
||||
int server_pipe[2];
|
||||
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s: connecting to %s:%d...\n"),
|
||||
PACKAGE_NAME, server->address, server->port);
|
||||
wee_log_printf (_("connecting to server %s:%d...\n"),
|
||||
@@ -488,7 +612,7 @@ server_connect (t_irc_server *server)
|
||||
/* create pipe */
|
||||
if (pipe (server_pipe) < 0)
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s cannot create pipe\n"), WEECHAT_ERROR);
|
||||
server_free (server);
|
||||
return 0;
|
||||
@@ -502,14 +626,14 @@ server_connect (t_irc_server *server)
|
||||
if (setsockopt
|
||||
(server->sock4, SOL_SOCKET, SO_REUSEADDR, (char *) &set,
|
||||
sizeof (set)) == -1)
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s cannot set socket option \"SO_REUSEADDR\"\n"),
|
||||
WEECHAT_ERROR);
|
||||
set = 1;
|
||||
if (setsockopt
|
||||
(server->sock4, SOL_SOCKET, SO_KEEPALIVE, (char *) &set,
|
||||
sizeof (set)) == -1)
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s cannot set socket option \"SO_KEEPALIVE\"\n"),
|
||||
WEECHAT_ERROR);
|
||||
|
||||
@@ -517,7 +641,7 @@ server_connect (t_irc_server *server)
|
||||
ip4_hostent = gethostbyname (server->address);
|
||||
if (!ip4_hostent)
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s address \"%s\" not found\n"),
|
||||
WEECHAT_ERROR, server->address);
|
||||
close (server->server_read);
|
||||
@@ -533,14 +657,14 @@ server_connect (t_irc_server *server)
|
||||
/*error = bind(server->sock4, (struct sockaddr *)(&addr), sizeof(addr));
|
||||
if (error != 0)
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
WEECHAT_ERORR "server_connect: can't bind to hostname\n");
|
||||
return 0;
|
||||
} */
|
||||
ip_address = inet_ntoa (addr.sin_addr);
|
||||
if (!ip_address)
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s IP address not found\n"), WEECHAT_ERROR);
|
||||
close (server->server_read);
|
||||
close (server->server_write);
|
||||
@@ -550,13 +674,13 @@ server_connect (t_irc_server *server)
|
||||
}
|
||||
|
||||
/* connection to server */
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s: server IP is: %s\n"), PACKAGE_NAME, ip_address);
|
||||
|
||||
error = connect (server->sock4, (struct sockaddr *) &addr, sizeof (addr));
|
||||
if (error != 0)
|
||||
{
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s cannot connect to irc server\n"), WEECHAT_ERROR);
|
||||
close (server->server_read);
|
||||
close (server->server_write);
|
||||
@@ -564,8 +688,7 @@ server_connect (t_irc_server *server)
|
||||
server->sock4 = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
current_irc_server = server;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -574,16 +697,17 @@ server_connect (t_irc_server *server)
|
||||
*/
|
||||
|
||||
void
|
||||
server_auto_connect ()
|
||||
server_auto_connect (int command_line)
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (ptr_server->autoconnect)
|
||||
if ( ((command_line) && (ptr_server->command_line))
|
||||
|| ((!command_line) && (ptr_server->autoconnect)) )
|
||||
{
|
||||
gui_window_new (ptr_server, NULL, 1);
|
||||
(void) gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1);
|
||||
if (server_connect (ptr_server))
|
||||
irc_login (ptr_server);
|
||||
}
|
||||
@@ -601,12 +725,12 @@ server_disconnect (t_irc_server *server)
|
||||
|
||||
if (server->is_connected)
|
||||
{
|
||||
/* write disconnection message on each channel/private window */
|
||||
/* write disconnection message on each channel/private buffer */
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
irc_display_prefix (ptr_channel->window, PREFIX_INFO);
|
||||
gui_printf (ptr_channel->window, _("Disconnected from server!\n"));
|
||||
irc_display_prefix (ptr_channel->buffer, PREFIX_INFO);
|
||||
gui_printf (ptr_channel->buffer, _("Disconnected from server!\n"));
|
||||
}
|
||||
|
||||
/* close communication with server */
|
||||
|
||||
+99
-12
@@ -21,8 +21,11 @@
|
||||
#ifndef __WEECHAT_IRC_H
|
||||
#define __WEECHAT_IRC_H 1
|
||||
|
||||
#include <time.h>
|
||||
#include "../gui/gui.h"
|
||||
|
||||
/* prefixes for chat window */
|
||||
|
||||
#define PREFIX_SERVER "-@-"
|
||||
#define PREFIX_INFO "-=-"
|
||||
#define PREFIX_ACTION_ME "-*-"
|
||||
@@ -34,6 +37,38 @@
|
||||
|
||||
#define CHANNEL_PREFIX "#&+!"
|
||||
|
||||
/* channel modes */
|
||||
|
||||
#define NUM_CHANNEL_MODES 7
|
||||
#define CHANNEL_MODE_INVITE 0
|
||||
#define CHANNEL_MODE_KEY 1
|
||||
#define CHANNEL_MODE_LIMIT 2
|
||||
#define CHANNEL_MODE_MODERATED 3
|
||||
#define CHANNEL_MODE_NO_MSG_OUT 4
|
||||
#define CHANNEL_MODE_SECRET 5
|
||||
#define CHANNEL_MODE_TOPIC 6
|
||||
#define SET_CHANNEL_MODE(channel, set, mode) \
|
||||
if (set) \
|
||||
channel->modes[mode] = channel_modes[mode]; \
|
||||
else \
|
||||
channel->modes[mode] = ' ';
|
||||
|
||||
#define DEFAULT_IRC_PORT 6667
|
||||
|
||||
/* DCC types & status */
|
||||
|
||||
#define DCC_CHAT_RECV 0 /* receiving DCC chat */
|
||||
#define DCC_CHAT_SEND 1 /* sending DCC chat */
|
||||
#define DCC_FILE_RECV 2 /* incoming DCC file */
|
||||
#define DCC_FILE_SEND 3 /* sending DCC file */
|
||||
|
||||
#define DCC_WAITING 0 /* waiting for host answer */
|
||||
#define DCC_CONNECTING 1 /* connecting to host */
|
||||
#define DCC_ACTIVE 2 /* sending/receiving data */
|
||||
#define DCC_DONE 3 /* transfer done */
|
||||
#define DCC_FAILED 4 /* DCC failed */
|
||||
#define DCC_ABORTED 5 /* DCC aborted by user */
|
||||
|
||||
/* nick types */
|
||||
|
||||
typedef struct t_irc_nick t_irc_nick;
|
||||
@@ -62,9 +97,12 @@ struct t_irc_channel
|
||||
int type; /* channel type */
|
||||
char *name; /* name of channel (exemple: "#abc") */
|
||||
char *topic; /* topic of channel (host for private) */
|
||||
char modes[NUM_CHANNEL_MODES+1];/* channel modes */
|
||||
int limit; /* user limit (0 is limit not set) */
|
||||
char *key; /* channel key (NULL if no key is set) */
|
||||
t_irc_nick *nicks; /* nicks on the channel */
|
||||
t_irc_nick *last_nick; /* last nick on the channel */
|
||||
t_gui_window *window; /* GUI window allocated for channel */
|
||||
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
|
||||
t_irc_channel *prev_channel; /* link to previous channel */
|
||||
t_irc_channel *next_channel; /* link to next channel */
|
||||
};
|
||||
@@ -78,6 +116,7 @@ struct t_irc_server
|
||||
/* user choices */
|
||||
char *name; /* name of server (only for display) */
|
||||
int autoconnect; /* = 1 if auto connect at startup */
|
||||
int command_line; /* server was given on command line */
|
||||
char *address; /* address of server (IP or name) */
|
||||
int port; /* port for server (6667 by default) */
|
||||
char *password; /* password for server */
|
||||
@@ -88,15 +127,17 @@ struct t_irc_server
|
||||
char *realname; /* real name */
|
||||
char *command; /* command to run once connected */
|
||||
char *autojoin; /* channels to automatically join */
|
||||
int autorejoin; /* auto rejoin channels when kicked */
|
||||
|
||||
/* internal vars */
|
||||
char *nick; /* current nickname */
|
||||
int is_connected; /* 1 if WeeChat is connected to server */
|
||||
int sock4; /* socket for server */
|
||||
int is_away; /* 1 is user is marker as away */
|
||||
time_t away_time; /* time() when user marking as away */
|
||||
int server_read; /* pipe for reading server data */
|
||||
int server_write; /* pipe for sending data to server */
|
||||
t_gui_window *window; /* GUI window allocated for server */
|
||||
t_gui_buffer *buffer; /* GUI buffer allocated for server */
|
||||
t_irc_channel *channels; /* opened channels on server */
|
||||
t_irc_channel *last_channel; /* last opened channal on server */
|
||||
t_irc_server *prev_server; /* link to previous server */
|
||||
@@ -123,6 +164,8 @@ struct t_irc_command
|
||||
/* function called when cmd is received */
|
||||
};
|
||||
|
||||
/* irc messages */
|
||||
|
||||
typedef struct t_irc_message t_irc_message;
|
||||
|
||||
struct t_irc_message
|
||||
@@ -132,25 +175,52 @@ struct t_irc_message
|
||||
t_irc_message *next_message; /* link to next message */
|
||||
};
|
||||
|
||||
/* DCC */
|
||||
|
||||
typedef struct t_dcc t_dcc;
|
||||
|
||||
struct t_dcc
|
||||
{
|
||||
t_irc_server *server; /* irc server */
|
||||
int type; /* DCC type (send or receive) */
|
||||
int status; /* DCC status (waiting, sending, ..) */
|
||||
unsigned long addr; /* IP address */
|
||||
int port; /* port */
|
||||
char *nick; /* remote nick */
|
||||
int sock; /* socket for connection */
|
||||
int file; /* local file (for reading or writing) */
|
||||
char *filename; /* filename (given by sender) */
|
||||
char *local_filename; /* local filename (with path) */
|
||||
int filename_suffix; /* suffix (.1 for ex) if renaming file */
|
||||
unsigned long size; /* file size */
|
||||
unsigned long pos; /* number of bytes received/sent */
|
||||
t_dcc *prev_dcc; /* link to previous dcc file/chat */
|
||||
t_dcc *next_dcc; /* link to next dcc file/chat */
|
||||
};
|
||||
|
||||
extern t_irc_command irc_commands[];
|
||||
extern t_irc_server *irc_servers, *current_irc_server;
|
||||
extern t_irc_server *irc_servers;
|
||||
extern t_irc_message *recv_msgq, *msgq_last_msg;
|
||||
extern t_irc_channel *current_channel;
|
||||
extern t_dcc *dcc_list;
|
||||
extern char *dcc_status_string[6];
|
||||
extern char *channel_modes;
|
||||
|
||||
/* server functions (irc-server.c) */
|
||||
|
||||
extern void server_init (t_irc_server *);
|
||||
extern int server_init_with_url (char *, t_irc_server *);
|
||||
extern t_irc_server *server_alloc ();
|
||||
extern void server_destroy (t_irc_server *);
|
||||
extern void server_free (t_irc_server *);
|
||||
extern void server_free_all ();
|
||||
extern t_irc_server *server_new (char *, int, char *, int, char *, char *,
|
||||
char *, char *, char *, char *, char *, char *);
|
||||
extern t_irc_server *server_new (char *, int, int, char *, int, char *, char *,
|
||||
char *, char *, char *, char *, char *, char *,
|
||||
int);
|
||||
extern int server_send (t_irc_server *, char *, int);
|
||||
extern int server_sendf (t_irc_server *, char *, ...);
|
||||
extern void server_sendf (t_irc_server *, char *, ...);
|
||||
extern void server_recv (t_irc_server *);
|
||||
extern int server_connect ();
|
||||
extern void server_auto_connect ();
|
||||
extern void server_auto_connect (int);
|
||||
extern void server_disconnect (t_irc_server *);
|
||||
extern void server_disconnect_all ();
|
||||
extern t_irc_server *server_search (char *);
|
||||
@@ -176,11 +246,22 @@ extern t_irc_nick *nick_search (t_irc_channel *, char *);
|
||||
extern void nick_count (t_irc_channel *, int *, int *, int *, int *, int *);
|
||||
extern int nick_get_max_length (t_irc_channel *);
|
||||
|
||||
/* DCC functions (irc-dcc.c) */
|
||||
|
||||
extern void dcc_send ();
|
||||
extern void dcc_free (t_dcc *);
|
||||
extern void dcc_close (t_dcc *, int);
|
||||
extern void dcc_accept (t_dcc *);
|
||||
extern t_dcc *dcc_add (t_irc_server *, int, unsigned long, int, char *, char *,
|
||||
unsigned int);
|
||||
extern void dcc_handle ();
|
||||
extern void dcc_end ();
|
||||
|
||||
/* IRC display (irc-diplay.c) */
|
||||
|
||||
extern void irc_display_prefix (t_gui_window *, char *);
|
||||
extern void irc_display_nick (t_gui_window *, t_irc_nick *, int, int, int, int);
|
||||
extern void irc_display_mode (t_gui_window *, char *, char, char *, char *,
|
||||
extern void irc_display_prefix (/*@null@*/ t_gui_buffer *, char *);
|
||||
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, int, int, int, int);
|
||||
extern void irc_display_mode (t_gui_buffer *, char *, char, char *, char *,
|
||||
char *, char *);
|
||||
|
||||
/* IRC protocol (irc-commands.c) */
|
||||
@@ -191,6 +272,7 @@ extern void irc_login (t_irc_server *);
|
||||
extern int irc_cmd_send_admin (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_away (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ctcp (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_dcc (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_deop (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_devoice (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_die (t_irc_server *, char *);
|
||||
@@ -203,10 +285,12 @@ extern int irc_cmd_send_kill (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_links (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_list (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_lusers (t_irc_server *, char *);
|
||||
extern int irc_send_me (t_irc_server *, t_irc_channel *, char *);
|
||||
extern int irc_send_me_all_channels (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_me (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_mode (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_msg (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_motd (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_msg (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_names (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_nick (t_irc_server *, int, char **);
|
||||
extern int irc_cmd_send_notice (t_irc_server *, char *);
|
||||
@@ -215,6 +299,7 @@ extern int irc_cmd_send_oper (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_part (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ping (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_pong (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_query (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_quit (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_quote (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_rehash (t_irc_server *, char *);
|
||||
@@ -268,6 +353,8 @@ extern int irc_cmd_recv_320 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_321 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_322 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_323 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_324 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_329 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_331 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_332 (t_irc_server *, char *, char *);
|
||||
extern int irc_cmd_recv_333 (t_irc_server *, char *, char *);
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
if PLUGIN_PERL
|
||||
perl_dir = perl
|
||||
endif
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
INCLUDES = $(PERL_CFLAGS)
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(PERL_CFLAGS)
|
||||
|
||||
noinst_LIBRARIES = lib_weechat_perl.a
|
||||
|
||||
|
||||
+131
-28
@@ -120,7 +120,7 @@ static XS (XS_IRC_register)
|
||||
}
|
||||
|
||||
/*
|
||||
* IRC::print: print message to current window
|
||||
* IRC::print: print message to current buffer
|
||||
*/
|
||||
|
||||
static XS (XS_IRC_print)
|
||||
@@ -135,8 +135,8 @@ static XS (XS_IRC_print)
|
||||
for (i = 0; i < items; i++)
|
||||
{
|
||||
message = SvPV (ST (i), integer);
|
||||
irc_display_prefix (gui_current_window, PREFIX_PLUGIN);
|
||||
gui_printf (gui_current_window, "%s", message);
|
||||
irc_display_prefix (gui_current_window->buffer, PREFIX_PLUGIN);
|
||||
gui_printf (gui_current_window->buffer, "%s", message);
|
||||
}
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
@@ -151,7 +151,7 @@ static XS (XS_IRC_print_with_channel)
|
||||
{
|
||||
int integer;
|
||||
char *message, *channel, *server = NULL;
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
t_irc_server *ptr_server;
|
||||
t_irc_channel *ptr_channel;
|
||||
dXSARGS;
|
||||
@@ -167,9 +167,9 @@ static XS (XS_IRC_print_with_channel)
|
||||
server = NULL;
|
||||
}
|
||||
|
||||
/* look for window for printing message */
|
||||
/* look for buffer for printing message */
|
||||
channel = SvPV (ST (1), integer);
|
||||
ptr_window = NULL;
|
||||
ptr_buffer = NULL;
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
@@ -180,28 +180,101 @@ static XS (XS_IRC_print_with_channel)
|
||||
{
|
||||
if (strcasecmp (ptr_channel->name, channel) == 0)
|
||||
{
|
||||
ptr_window = ptr_channel->window;
|
||||
ptr_buffer = ptr_channel->buffer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ptr_window)
|
||||
if (ptr_buffer)
|
||||
break;
|
||||
}
|
||||
|
||||
/* window found => display message & return 1 */
|
||||
if (ptr_window)
|
||||
/* buffer found => display message & return 1 */
|
||||
if (ptr_buffer)
|
||||
{
|
||||
message = SvPV (ST (0), integer);
|
||||
irc_display_prefix (ptr_window, PREFIX_PLUGIN);
|
||||
gui_printf (ptr_window, "%s", message);
|
||||
irc_display_prefix (ptr_buffer, PREFIX_PLUGIN);
|
||||
gui_printf (ptr_buffer, "%s", message);
|
||||
XSRETURN_YES;
|
||||
}
|
||||
|
||||
/* no window found => return 0 */
|
||||
/* no buffer found => return 0 */
|
||||
XSRETURN_NO;
|
||||
}
|
||||
|
||||
/*
|
||||
* IRC::print_infobar: print message to infobar
|
||||
*/
|
||||
|
||||
static XS (XS_IRC_print_infobar)
|
||||
{
|
||||
int integer;
|
||||
dXSARGS;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) cv;
|
||||
|
||||
if (items == 2)
|
||||
gui_infobar_printf (SvIV (ST (0)), COLOR_WIN_INFOBAR, SvPV (ST (1), integer));
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("Perl error: wrong parameters for IRC::print_infobar Perl function\n"));
|
||||
}
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
/*
|
||||
* IRC::command: send command to server
|
||||
*/
|
||||
|
||||
static XS (XS_IRC_command)
|
||||
{
|
||||
int integer;
|
||||
char *server, *command, *command2;
|
||||
t_irc_server *ptr_server;
|
||||
dXSARGS;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) cv;
|
||||
|
||||
if (items == 2)
|
||||
{
|
||||
server = SvPV (ST (0), integer);
|
||||
command = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("Perl error: server not found for IRC::command Perl function\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
command = SvPV (ST (0), integer);
|
||||
}
|
||||
|
||||
if (ptr_server)
|
||||
{
|
||||
command2 = (char *) malloc (strlen (command) + 8);
|
||||
strcpy (command2, command);
|
||||
if (!strstr (command2, "\r\n"))
|
||||
strcat (command2, "\r\n");
|
||||
server_sendf (ptr_server, command2);
|
||||
free (command2);
|
||||
}
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
/*
|
||||
* IRC::add_message_handler: add handler for messages (privmsg, ...)
|
||||
*/
|
||||
@@ -260,17 +333,37 @@ static XS (XS_IRC_add_command_handler)
|
||||
|
||||
static XS (XS_IRC_get_info)
|
||||
{
|
||||
char *arg, *info = NULL;
|
||||
char *arg, *info = NULL, *server;
|
||||
t_irc_server *ptr_server;
|
||||
int integer;
|
||||
dXSARGS;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) items;
|
||||
(void) cv;
|
||||
|
||||
arg = SvPV (ST (0), integer);
|
||||
if (items == 2)
|
||||
{
|
||||
server = SvPV (ST (0), integer);
|
||||
arg = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("Perl error: server not found for IRC::get_info Perl function\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
arg = SvPV (ST (0), integer);
|
||||
}
|
||||
|
||||
if (arg)
|
||||
if (ptr_server && arg)
|
||||
{
|
||||
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
@@ -279,16 +372,18 @@ static XS (XS_IRC_get_info)
|
||||
}
|
||||
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
|
||||
{
|
||||
info = current_irc_server->nick;
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
|
||||
{
|
||||
if (WIN_IS_CHANNEL (gui_current_window))
|
||||
info = CHANNEL (gui_current_window)->name;
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
|
||||
{
|
||||
info = current_irc_server->name;
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
|
||||
{
|
||||
@@ -296,7 +391,7 @@ static XS (XS_IRC_get_info)
|
||||
}
|
||||
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
|
||||
{
|
||||
XST_mIV (0, current_irc_server->is_away);
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
return;
|
||||
}
|
||||
@@ -321,6 +416,8 @@ xs_init (pTHX)
|
||||
newXS ("IRC::register", XS_IRC_register, "IRC");
|
||||
newXS ("IRC::print", XS_IRC_print, "IRC");
|
||||
newXS ("IRC::print_with_channel", XS_IRC_print_with_channel, "IRC");
|
||||
newXS ("IRC::print_infobar", XS_IRC_print_infobar, "IRC");
|
||||
newXS ("IRC::command", XS_IRC_command, "IRC");
|
||||
newXS ("IRC::add_message_handler", XS_IRC_add_message_handler, "IRC");
|
||||
newXS ("IRC::add_command_handler", XS_IRC_add_command_handler, "IRC");
|
||||
newXS ("IRC::get_info", XS_IRC_get_info, "IRC");
|
||||
@@ -399,9 +496,9 @@ wee_perl_search (char *name)
|
||||
*/
|
||||
|
||||
int
|
||||
wee_perl_exec (char *function, char *arguments)
|
||||
wee_perl_exec (char *function, char *server, char *arguments)
|
||||
{
|
||||
char *argv[2];
|
||||
char *argv[3];
|
||||
int count, return_code;
|
||||
SV *sv;
|
||||
|
||||
@@ -410,8 +507,12 @@ wee_perl_exec (char *function, char *arguments)
|
||||
ENTER;
|
||||
SAVETMPS;
|
||||
PUSHMARK(sp);
|
||||
argv[0] = arguments;
|
||||
argv[1] = NULL;
|
||||
if (!server)
|
||||
argv[0] = strdup ("");
|
||||
else
|
||||
argv[0] = server;
|
||||
argv[1] = arguments;
|
||||
argv[2] = NULL;
|
||||
count = perl_call_argv (function, G_EVAL | G_SCALAR, argv);
|
||||
SPAGAIN;
|
||||
|
||||
@@ -455,7 +556,9 @@ wee_perl_load (char *filename)
|
||||
{
|
||||
/* execute Perl script */
|
||||
wee_log_printf (_("loading Perl script \"%s\"\n"), filename);
|
||||
return wee_perl_exec ("wee_perl_load_eval_file", filename);
|
||||
irc_display_prefix (NULL, PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _("Loading Perl script \"%s\"\n"), filename);
|
||||
return wee_perl_exec ("wee_perl_load_eval_file", filename, "");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -508,7 +611,7 @@ wee_perl_unload (t_plugin_script *ptr_perl_script)
|
||||
|
||||
/* call shutdown callback function */
|
||||
if (ptr_perl_script->shutdown_func[0])
|
||||
wee_perl_exec (ptr_perl_script->shutdown_func, "");
|
||||
wee_perl_exec (ptr_perl_script->shutdown_func, "", "");
|
||||
wee_perl_script_free (ptr_perl_script);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
extern void wee_perl_init ();
|
||||
extern t_plugin_script *wee_perl_search (char *);
|
||||
extern int wee_perl_exec (char *, char *);
|
||||
extern int wee_perl_exec (char *, char *, char *);
|
||||
extern int wee_perl_load (char *);
|
||||
extern void wee_perl_unload (t_plugin_script *);
|
||||
extern void wee_perl_unload_all ();
|
||||
|
||||
@@ -56,15 +56,17 @@ t_plugin_handler *last_plugin_cmd_handler = NULL;
|
||||
void
|
||||
plugin_auto_load (int plugin_type, char *directory)
|
||||
{
|
||||
int dir_length;
|
||||
char *dir_name, *current_dir;
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
struct stat statbuf;
|
||||
|
||||
/* build directory, adding WeeChat home */
|
||||
dir_length = strlen (weechat_home) + strlen (directory) + 2;
|
||||
dir_name =
|
||||
(char *) malloc ((strlen (weechat_home) + strlen (directory) + 2) * sizeof (char));
|
||||
sprintf (dir_name, "%s%s%s", weechat_home, DIR_SEPARATOR, directory);
|
||||
(char *) malloc (dir_length * sizeof (char));
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR, directory);
|
||||
|
||||
/* save working directory */
|
||||
current_dir = (char *) malloc (1024 * sizeof (char));
|
||||
@@ -271,7 +273,7 @@ plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
|
||||
*/
|
||||
|
||||
void
|
||||
plugin_event_msg (char *irc_command, char *arguments)
|
||||
plugin_event_msg (char *irc_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -283,7 +285,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -299,7 +301,7 @@ plugin_event_msg (char *irc_command, char *arguments)
|
||||
*/
|
||||
|
||||
int
|
||||
plugin_exec_command (char *user_command, char *arguments)
|
||||
plugin_exec_command (char *user_command, char *arguments, char *server)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
@@ -311,7 +313,7 @@ plugin_exec_command (char *user_command, char *arguments)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
|
||||
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
|
||||
#endif
|
||||
|
||||
/* command executed */
|
||||
|
||||
@@ -59,16 +59,17 @@ extern t_plugin_handler *last_plugin_cmd_handler;
|
||||
extern t_plugin_script *perl_scripts;
|
||||
#endif
|
||||
|
||||
extern void plugin_auto_load (int, char *);
|
||||
extern void plugin_init ();
|
||||
extern void plugin_load (int, char *);
|
||||
extern void plugin_unload (int, char *);
|
||||
extern void plugin_unload (int, /*@null@*/ char *);
|
||||
extern t_plugin_handler *plugin_handler_search (t_plugin_handler *, char *);
|
||||
extern void plugin_handler_add (t_plugin_handler **, t_plugin_handler **,
|
||||
int, char *, char *);
|
||||
extern void plugin_handler_free_all_type (t_plugin_handler **,
|
||||
t_plugin_handler **, int);
|
||||
extern void plugin_event_msg (char *, char *);
|
||||
extern int plugin_exec_command (char *, char *);
|
||||
extern void plugin_event_msg (char *, char *, char *);
|
||||
extern int plugin_exec_command (char *, /*@null@*/ char *, char *);
|
||||
extern void plugin_end ();
|
||||
|
||||
#endif /* plugins.h */
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
.TH WEECHAT 1 "January 2004" "FlashCode"
|
||||
.TH WEECHAT 1 "October 2004" "FlashCode"
|
||||
|
||||
.SH NAME
|
||||
weechat \- Wee Enhanced Environment for Chat
|
||||
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B weechat
|
||||
.RI [ options ]
|
||||
.B weechat-curses
|
||||
.RI [ options... ]
|
||||
or
|
||||
.RI [ url... ]
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
@@ -17,6 +19,10 @@ It is compliant with RFCs 1459, 2810, 2811, 2812, and 2813.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-c, \-\-config
|
||||
.br
|
||||
display config file help (list of options)
|
||||
.TP
|
||||
.B \-h, \-\-help
|
||||
.br
|
||||
display summary of options
|
||||
@@ -29,6 +35,15 @@ display program license
|
||||
.br
|
||||
display WeeChat version
|
||||
|
||||
.SH URL
|
||||
WeeChat can use an URL (Uniform Resource Locator) to automatically connect
|
||||
to an IRC server. These are in the following form:
|
||||
.TP
|
||||
.B irc://[[nickname][:password]@]server[:port][/[#&+!]channel]
|
||||
.TP
|
||||
Exemple to join WeeChat channel support with nick "FlashCode":
|
||||
irc://FlashCode@irc.freenode.net/weechat
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.B $HOME/.weechat/weechat.rc
|
||||
@@ -42,7 +57,7 @@ WeeChat is written by:
|
||||
.br
|
||||
- FlashCode <flashcode@flashtux.org>
|
||||
- Bounga <bounga@altern.org>
|
||||
- Xahlexx <xahlexx@tuxisland.org>
|
||||
- Xahlexx <xahlexx@weeland.org>
|
||||
.br
|
||||
WeeChat on the web:
|
||||
.UR
|
||||
+13
-4
@@ -1,5 +1,5 @@
|
||||
%define name weechat
|
||||
%define version 0.0.4
|
||||
%define version 0.0.8
|
||||
%define release 1
|
||||
|
||||
Name: %{name}
|
||||
@@ -10,6 +10,7 @@ Source: http://weechat.flashtux.org/download/%{name}-%{version}.tar.gz
|
||||
URL: http://weechat.flashtux.org
|
||||
Group: Networking/IRC
|
||||
BuildRoot: %{_tmppath}/%{name}-buildroot
|
||||
Requires: perl
|
||||
License: GPL
|
||||
|
||||
%description
|
||||
@@ -22,7 +23,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure
|
||||
./configure --enable-perl
|
||||
make DESTDIR="$RPM_BUILD_ROOT" LOCALRPM="local"
|
||||
|
||||
%install
|
||||
@@ -35,11 +36,19 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f %{name}.lang
|
||||
%defattr(-,root,root,0755)
|
||||
%doc AUTHORS BUGS ChangeLog COPYING FAQ INSTALL NEWS README TODO
|
||||
/usr/local/man/man1/weechat.1*
|
||||
%doc AUTHORS BUGS ChangeLog COPYING FAQ FAQ.fr INSTALL NEWS README TODO
|
||||
/usr/local/man/man1/weechat-curses.1*
|
||||
/usr/local/bin/weechat-curses
|
||||
|
||||
%changelog
|
||||
* Sat Oct 30 2004 FlashCode <flashcode@flashtux.org> 0.0.8-1
|
||||
- Released version 0.0.8
|
||||
* Sat Aug 08 2004 FlashCode <flashcode@flashtux.org> 0.0.7-1
|
||||
- Released version 0.0.7
|
||||
* Sat Jun 05 2004 FlashCode <flashcode@flashtux.org> 0.0.6-1
|
||||
- Released version 0.0.6
|
||||
* Thu Feb 02 2004 FlashCode <flashcode@flashtux.org> 0.0.5-1
|
||||
- Released version 0.0.5
|
||||
* Thu Jan 01 2004 FlashCode <flashcode@flashtux.org> 0.0.4-1
|
||||
- Released version 0.0.4
|
||||
* Mon Nov 03 2003 FlashCode <flashcode@flashtux.org> 0.0.3-1
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ Bounga <bounga@altern.org>
|
||||
Jabber: Bounga@jabber.org
|
||||
ICQ : 178297842
|
||||
|
||||
Xahlexx <xahlexx@tuxisland.org>
|
||||
Web : http://www.tuxisland.org
|
||||
Xahlexx <xahlexx@weeland.org>
|
||||
Web : http://www.weeland.org
|
||||
IRC : nick is "xahlexx"
|
||||
|
||||
|
||||
|
||||
+3
-4
@@ -1,20 +1,19 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2004-01-01
|
||||
WeeChat known bugs, 2004-10-30
|
||||
|
||||
- ./configure does not check that Curses headers are installed
|
||||
- ./configure does not check that Gtk 2.0 libraries are installed
|
||||
- ./configure does not check that Perl headers & libraries are installed
|
||||
- too much nicks in the channel (> height of window) => display bug
|
||||
- problem when resizing terminal and that some windows are outside new term size
|
||||
- some IRC commands are marked as 'unknown' when received
|
||||
(IRC protocol is under dev!)
|
||||
- too much opened channels => display bug
|
||||
- when kicked, channel is not prefixed by '(' and sufixed by ')'
|
||||
- when function key (non used by WeeChat) is pressed, prompt is deleted
|
||||
- when quitting WeeChat term title is not restored (if look_set_title is ON)
|
||||
- command name for /server can not contain spaces
|
||||
- wrong alias is not created and not saved when quitting WeeChat
|
||||
- when many WeeChat are launched, log file is not properly written (cleared by
|
||||
each WeeChat at startup)
|
||||
- display problems with Konsole (Kde terminal)
|
||||
- display problems with old Konsole versions (Kde terminal)
|
||||
|
||||
+56
-1
@@ -1,9 +1,64 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2004-01-01
|
||||
ChangeLog - 2004-10-30
|
||||
|
||||
|
||||
Version 0.0.8 (2004-10-30):
|
||||
* /kick command fixed: now ok with many words as reason
|
||||
* nickserv passwords hidden (new config option: log_hide_nickserv_pwd on/off)
|
||||
* auto-rejoin channels when kicked (new config option: server_autorejoin on/off)
|
||||
* added IRC::command function for Perl scripts
|
||||
* fixed bug when adding alias with same name as other
|
||||
* /buffer command developed (buffers list, move and notify)
|
||||
* logging buffers to disk (server/channel/private according to user prefs)
|
||||
* Away now announced in channels, and config option "look_display_away" added
|
||||
to enable/disable this feature
|
||||
* Fixed crash when resizing terminal to very small size
|
||||
* "-MORE-" message is now erased when switching to another buffer
|
||||
* DCC file receive ok (Alt-D for DCC view)
|
||||
* /query command now reopens private buffer if already opened
|
||||
* added key for redrawing terminal (Ctrl-L)
|
||||
* added key for clearing hotlist (Alt-R)
|
||||
|
||||
Version 0.0.7 (2004-08-08):
|
||||
* new "col_status_delimiters" config option
|
||||
* /buffer command added, buffers ordered by number, auto-jump to active
|
||||
buffers (alt-a), jump to buffers by number (alt-number)
|
||||
* /window command added, split terminal horizontally/vertically
|
||||
* unique color for each nick (based on nickname)
|
||||
* action messages are now considered as messages, not crappy joins/parts
|
||||
* fixed display bug when nicklist is displayed at bottom of screen
|
||||
* added history limit (text buffer & commands)
|
||||
* replaced --enable-debug with --with-debug option for ./configure, which is
|
||||
now integer: 1 = compiler debug flag, 2 = same 1 with verbose debug messages
|
||||
in WeeChat (default: 0 = no debug)
|
||||
|
||||
Version 0.0.6 (2004-06-05):
|
||||
* improved channel highlight (priority to message vs join/part)
|
||||
* fixed bug when opened private win and remote user changes his nick
|
||||
* /query command added (starts private conversation)
|
||||
* IRC messages 476, 477 added
|
||||
* /mode command is now ok and channel flags are displayed in status bar
|
||||
* fixed display bug (text was blinking when scrolling)
|
||||
* CTCP Version reply is now in english only and doesn't show host (security reason)
|
||||
|
||||
Version 0.0.5 (2004-02-07):
|
||||
* /set command to modify config options when WeeChat is running
|
||||
* fixed look_nicklist config option, now enables/disables nicklist
|
||||
* secured code to prevent buffer overflows and memory leaks
|
||||
* fixed QUIT IRC command: now sent to all connected servers (not only current)
|
||||
* URL command line parameter to connect to server(s)
|
||||
* new Perl script function to display message in info bar ("IRC::print_infobar")
|
||||
* info bar highlight notifications
|
||||
* info bar timestamp is added to config ("look_infobar_timestamp")
|
||||
* added info bar (optional, "look_infobar" to enable it, "on" by default)
|
||||
* fixed crash with /oper command
|
||||
* for default config file, nick is now based on un*x username (thanks to Witukind)
|
||||
* fixed crash when config file cannot be written
|
||||
* -c (or --config) command line parameter added to see config file options
|
||||
* highlight action messages
|
||||
|
||||
Version 0.0.4 (2004-01-01):
|
||||
* Perl plugin, with auto-load
|
||||
* when private window is created (another user is talking), WeeChat does not
|
||||
|
||||
+120
-121
@@ -1,158 +1,157 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
WeeChat FAQ, 2004-05-31
|
||||
=======================
|
||||
|
||||
WeeChat FAQ, 2004-01-01
|
||||
Intended audience:
|
||||
All WeeChat users.
|
||||
|
||||
Before reading the following:
|
||||
the following Q/A list is *not* exhaustive.
|
||||
It is also possible that you won't find any Q/A that matches your problem.
|
||||
Please read them anyway, they may provide you help in fixing your problem
|
||||
anyway.
|
||||
And even if your problem is listed below, it is possible that the answers don't
|
||||
help you anymore to solve it. Then, please contact us, we will try to help you
|
||||
finding a solution.
|
||||
|
||||
1 - Compiling
|
||||
2 - Using WeeChat
|
||||
3 - Development
|
||||
|
||||
1.1
|
||||
================================================================================
|
||||
Q: I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
|
||||
A: Curses GUI is built by default.
|
||||
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
|
||||
--enable-gtk to enable Gtk GUI
|
||||
--enable-qt to enable Qt QUI
|
||||
Type ./configure --help to see available options.
|
||||
WARNING: only Curses GUI is ok today. Other GUI are under development!
|
||||
|
||||
|
||||
1- Compiling
|
||||
1.2
|
||||
================================================================================
|
||||
Q: I can't compile WeeChat CVS.
|
||||
|
||||
1.1 I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
1.2 I can't compile WeeChat CVS.
|
||||
|
||||
2- Using WeeChat
|
||||
|
||||
2.1 Why using WeeChat ? X-Chat and Irssi are so good...
|
||||
2.2 I've launched WeeChat, but I'm lost, what can I do?
|
||||
2.3 How can I customize key bindings?
|
||||
2.4 How can I load Perl scripts?
|
||||
Are Perl scripts compatible with X-chat or/and Irssi ?
|
||||
2.5 How can I load Python scripts?
|
||||
2.6 How can I load Ruby scripts?
|
||||
|
||||
3- Development
|
||||
|
||||
3.1 How should I report bugs?
|
||||
3.2 How should I submit patches?
|
||||
3.3 How should I submit new feature request?
|
||||
3.4 Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows?
|
||||
3.5 I want to help WeeChat developers. What can I do?
|
||||
3.6 Can I give money or other things to WeeChat developers?
|
||||
A: Check that you have latest version of autoconf and automake.
|
||||
WeeChat has been developed with autoconf version 2.56 and automake
|
||||
version 1.7.
|
||||
You should have at least these versions in order to compile WeeChat CVS.
|
||||
If you can't or don't want to install these versions, you can download and
|
||||
install "devel package", a package built almost every day, based on CVS.
|
||||
Note that this package may not correspond exactly to CVS base.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 1- Compiling |
|
||||
\------------------------------------------------------------------------------/
|
||||
2.1
|
||||
================================================================================
|
||||
Q: Why using WeeChat ? X-Chat and Irssi are so good...
|
||||
|
||||
A: Because WeeChat is very light and has new features.
|
||||
Some new features:
|
||||
* many GUI (Curses, Gtk, Qt),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
This is the "geekest Irc client" ;)
|
||||
|
||||
|
||||
1.1 I heard about many GUI for WeeChat. How can I compile/use them?
|
||||
2.2
|
||||
================================================================================
|
||||
Q: I've launched WeeChat, but I'm lost, what can I do?
|
||||
|
||||
Curses GUI is built by default.
|
||||
To build Gtk or Qt GUI you've to specify extra options to ./configure script:
|
||||
--enable-gtk to enable gtk GUI
|
||||
--enable-qt to enable Qt QUI
|
||||
Type ./configure --help to see available options.
|
||||
WARNING: only Curses GUI is ok today. Other GUI are under development!
|
||||
A: For help you can type /help. For help about a command, type /help command.
|
||||
|
||||
|
||||
1.2 I can't compile WeeChat CVS.
|
||||
2.3
|
||||
================================================================================
|
||||
Q: How can I customize key bindings?
|
||||
|
||||
Check that you have latest version of autoconf and automake.
|
||||
WeeChat has been developed with autoconf version 2.56 and automake version 1.7.
|
||||
You should have at least these versions in order to compile WeeChat CVS.
|
||||
If you can't or don't want to install these versions, you can download and
|
||||
install "devel package", a package built almost every day, based on CVS.
|
||||
Note that this package may not correspond exactly to CVS base.
|
||||
A: Today you can't do that. This will be available in a future version.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 2- Using WeeChat |
|
||||
\------------------------------------------------------------------------------/
|
||||
2.4
|
||||
================================================================================
|
||||
Q: How can I load Perl scripts?
|
||||
Are Perl scripts compatible with X-chat or/and Irssi ?
|
||||
|
||||
A: You can use /perl command to load scripts
|
||||
(default path is ~/.weechat/perl).
|
||||
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
|
||||
when WeeChat is starting up.
|
||||
WeeChat perl scripts are compatible with X-Chat, not with Irssi, sorry ;)
|
||||
|
||||
|
||||
2.1 Why using WeeChat ? X-Chat and Irssi are so good...
|
||||
2.5
|
||||
================================================================================
|
||||
Q: How can I load Python scripts?
|
||||
|
||||
Because WeeChat is very light and has new features.
|
||||
Some new features:
|
||||
* many GUI (Curses, Gtk, Qt),
|
||||
* extensible with scripts (Perl, Python, Ruby),
|
||||
* developed from scratch (not based on any other IRC client)
|
||||
* multi-platform
|
||||
* 100% GPL and free
|
||||
This is the "geekest Irc client" ;)
|
||||
A: Today Python interface is not developed, so can't load any Python script.
|
||||
|
||||
|
||||
2.2 I've launched WeeChat, but I'm lost, what can I do?
|
||||
2.6
|
||||
================================================================================
|
||||
Q: How can I load Ruby scripts?
|
||||
|
||||
For help you can type /help. For help about a command, type /help command.
|
||||
A: Today Ruby interface is not developed, so can't load any Ruby script.
|
||||
|
||||
|
||||
2.3 How can I customize key bindings?
|
||||
3.1
|
||||
================================================================================
|
||||
Q: How should I report bugs?
|
||||
|
||||
Today you can't do that. This will be available in a future version.
|
||||
A: There is 3 ways to report bugs:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #weechat
|
||||
2. you can submit your bug at this url:
|
||||
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
|
||||
3. you can mail your problem, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
2.4 How can I load Perl scripts?
|
||||
Are Perl scripts compatible with X-chat or/and Irssi ?
|
||||
3.2
|
||||
================================================================================
|
||||
Q: How should I submit patches?
|
||||
|
||||
Yes, you can use /perl command to launch scripts
|
||||
(default path is ~/.weechat/perl).
|
||||
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
|
||||
when WeeChat is starting up.
|
||||
WeeChat perl scripts are compatible with X-Chat, not with Irssi, sorry ;)
|
||||
A: There is 3 ways to submit patches:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #weechat
|
||||
2. you can submit your patch at this url:
|
||||
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
|
||||
3. you can mail your patch, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
2.5 How can I load Python scripts?
|
||||
3.3
|
||||
================================================================================
|
||||
Q: How should I submit new feature request?
|
||||
|
||||
Today Python interface is not developed, so can't load any Python script.
|
||||
A: There is 2 ways to submit your feature request:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #weechat
|
||||
2. you can mail your feature request, look at support page for developer's
|
||||
mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
2.6 How can I load Ruby scripts?
|
||||
3.4
|
||||
================================================================================
|
||||
Q: Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
|
||||
|
||||
Today Ruby interface is not developed, so can't load any Ruby script.
|
||||
A: Yes. Future versions will be available for these OS.
|
||||
|
||||
|
||||
/------------------------------------------------------------------------------\
|
||||
| 3- Development |
|
||||
\------------------------------------------------------------------------------/
|
||||
3.5
|
||||
================================================================================
|
||||
Q: I want to help WeeChat developers. What can I do?
|
||||
|
||||
A: There's many tasks to do (code, documentation, ...)
|
||||
Please contact us with IRC or mail, look at support page:
|
||||
http://weechat.flashtux.org/support.php
|
||||
|
||||
|
||||
3.1 How should I report bugs?
|
||||
3.6
|
||||
================================================================================
|
||||
Q: Can I give money or other things to WeeChat developers?
|
||||
|
||||
There is 3 ways to report bugs:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can submit your bug at this url:
|
||||
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
|
||||
3. you can mail your problem, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.2 How should I submit patches?
|
||||
|
||||
There is 3 ways to submit patches:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can submit your patch at this url:
|
||||
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
|
||||
3. you can mail your patch, look at support page for developer's mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.3 How should I submit new feature request?
|
||||
|
||||
There is 2 ways to submit your feature request:
|
||||
1. you can join us on IRC: irc.freenode.net, channel #eci
|
||||
If no one can help you (huh?), try another way, see below.
|
||||
2. you can mail your feature request, look at support page for developer's
|
||||
mails:
|
||||
http://weechat.flashtux.org/support.php
|
||||
(you can subscribe and send to "support" mailing list)
|
||||
|
||||
|
||||
3.4 Will WeeChat be ported to *BSD, QNX, MacOS X, Microsoft Windows ?
|
||||
|
||||
Yes. Future versions will be available for these OS.
|
||||
|
||||
|
||||
3.5 I want to help WeeChat developers. What can I do?
|
||||
|
||||
There's many tasks to do (code, documentation, ...)
|
||||
Please contact us with IRC or mail, look at support page:
|
||||
http://weechat.flashtux.org/support.php
|
||||
|
||||
|
||||
3.6 Can I give money or other things to WeeChat developers?
|
||||
|
||||
No.
|
||||
A: No.
|
||||
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
WeeChat FAQ, 2004-05-31
|
||||
=======================
|
||||
|
||||
Public concerné :
|
||||
Tous les utilisateurs de WeeChat.
|
||||
|
||||
Avant de lire la suite ceci :
|
||||
la liste suivante de questions/réponses n'est *pas* exhaustive.
|
||||
Il est donc possible que vous ne trouviez pas de question/réponse correspondant
|
||||
à votre problème.
|
||||
Lisez les quand même SVP, elles peuvent vous aider à corriger votre problème.
|
||||
Et même si votre problème est mentionné ci-dessous, il est possible que la
|
||||
réponse ne vous aide pas à corriger le problème. Dans ce cas, contactez-nous,
|
||||
nous essaierons de vous aider Ă trouver une solution.
|
||||
|
||||
1 - Compilation
|
||||
2 - Utilisation de WeeChat
|
||||
3 - Développement
|
||||
|
||||
1.1
|
||||
================================================================================
|
||||
Q: J'ai entendu parler de plusieurs interfaces pour WeeChat.
|
||||
Comment puis-je les compiler/utiliser ?
|
||||
|
||||
R: L'interface Curses est construite par défaut.
|
||||
Pour construire l'interface Gtk ou Qt, vous devez spécifier des options
|
||||
pour le script ./configure :
|
||||
--enable-gtk pour activer l'interface Gtk
|
||||
--enable-qt pour activer l'interface Qt
|
||||
Tapez ./configure --help pour voir les options disponibles.
|
||||
ATTENTION : seule l'interface Curses est ok aujourd'hui.
|
||||
Les autres interfaces sont en développement.
|
||||
|
||||
|
||||
1.2
|
||||
================================================================================
|
||||
Q: Je ne peux pas compiler le CVS WeeChat.
|
||||
|
||||
R: Vérifiez que vous avez bien la dernière version d'autoconf et automake.
|
||||
WeeChat a été développé avec autoconf version 2.56 et automake
|
||||
version 1.7.
|
||||
Vous devez avoir au moins ces versions pour compiler le CVS WeeChat.
|
||||
Si vous n'avez pas ou ne souhaitez pas installer ces versions, vous
|
||||
pouvez télécharger et installer le paquet "devel", un paquet construit
|
||||
quasiment tous les jours, basé sur le CVS.
|
||||
Notez que ce paquet peut ne pas correspondre exactement Ă la base CVS.
|
||||
|
||||
|
||||
2.1
|
||||
================================================================================
|
||||
Q: Pourquoi utiliser WeeChat ? X-Chat et Irssi sont si bien...
|
||||
|
||||
R: Parce que WeeChat est très léger et a de nouvelles fonctionnalités.
|
||||
Quelques nouvelles fonctionnalités :
|
||||
* plusieurs interfaces (Curses, Gtk, Qt),
|
||||
* extensible par des scripts (Perl, Python, Ruby),
|
||||
* développé à partir de zéro (non basé sur un quelconque client IRC)
|
||||
* multi-platformes
|
||||
* 100% GPL et libre
|
||||
C'est le client le plus "geek" ;)
|
||||
|
||||
|
||||
2.2
|
||||
================================================================================
|
||||
Q: J'ai lancé WeeChat, mais je suis perdu, que puis-je faire ?
|
||||
|
||||
R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
|
||||
tapez /help commande.
|
||||
|
||||
|
||||
2.3
|
||||
================================================================================
|
||||
Q: Comment puis-je configurer les raccourcis clavier ?
|
||||
|
||||
R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
|
||||
version future.
|
||||
|
||||
|
||||
2.4
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Perl ?
|
||||
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
|
||||
|
||||
R: La commande /perl permet de charger les scripts Perl
|
||||
(le chemin par défaut est ~/.weechat/perl).
|
||||
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
|
||||
chargés par WeeChat lorsqu'il démarre.
|
||||
Les scripts Perl WeeChat sont compatibles avec X-Chat, pas Irssi,
|
||||
désolé ;)
|
||||
|
||||
|
||||
2.5
|
||||
================================================================================
|
||||
Q: Comment puis-je charger les scripts Python ?
|
||||
|
||||
R: Aujourd'hui l'interface Python n'est pas déceloppée.
|
||||
Vous ne pouvez donc charger aucun script Python.
|
||||
|
||||
|
||||
2.6
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Ruby ?
|
||||
|
||||
R: Aujourd'hui l'interface Ruby n'est pas développée.
|
||||
Vous ne pouvez donc charger aucun script Ruby.
|
||||
|
||||
|
||||
3.1
|
||||
================================================================================
|
||||
Q: Comment dois-je reporter les bugs ?
|
||||
|
||||
R: Il y a 3 manières de reporter les bugs :
|
||||
1. vous pouvez nous joindre sur IRC: irc.freenode.net, canal #weechat
|
||||
2. vous pouvez soumettre votre bug Ă cette adresse :
|
||||
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
|
||||
3. vous pouvez envoyer votre problem par mail, consultez la page
|
||||
support pour les mails des développeurs :
|
||||
http://weechat.flashtux.org/support.php
|
||||
(vous pouvez souscrire et envoyer Ă la liste de diffusion
|
||||
"support")
|
||||
|
||||
|
||||
3.2
|
||||
================================================================================
|
||||
Q: Comment dois-je soumettre les patches ?
|
||||
|
||||
R: Il y a 3 manières de soumettre les patches :
|
||||
1. vous pouvez nous joindre sur IRC: irc.freenode.net, canal #weechat
|
||||
2. vous pouvez soumettre votre patch Ă cette adresse :
|
||||
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
|
||||
3. vous pouvez envoyer votre patch par mail, consultez la page
|
||||
support pour les mails des développeurs :
|
||||
http://weechat.flashtux.org/support.php
|
||||
(vous pouvez souscrire et envoyer Ă la liste de diffusion
|
||||
"support")
|
||||
|
||||
|
||||
3.3
|
||||
================================================================================
|
||||
Q: Comment dois-je soumettre les demandes de nouvelles fonctionnalités ?
|
||||
|
||||
R: Il y a 2 manières :
|
||||
1. vous pouvez nous joindre sur IRC: irc.freenode.net, channel #weechat
|
||||
2. vous pouvez envoyer un mail, consultez la page support pour les
|
||||
mails des développeurs :
|
||||
http://weechat.flashtux.org/support.php
|
||||
(vous pouvez souscrire et envoyer Ă la liste de diffusion
|
||||
"support")
|
||||
|
||||
|
||||
3.4
|
||||
================================================================================
|
||||
Q: WeeChat sera-t-il porté sur *BSD, QNX, MacOS X, Microsoft Windows ?
|
||||
|
||||
R: Oui. Les futures versions seront disponibles pour ces OS.
|
||||
|
||||
|
||||
3.5
|
||||
================================================================================
|
||||
Q: Je souhaiterai aider les développeurs WeeChat. Que puis-je faire ?
|
||||
|
||||
R: Il y a plusieurs choses Ă faire (code, documentation, ...)
|
||||
Merci de prendre contact avec nous par IRC ou mail, consultez la page
|
||||
support :
|
||||
http://weechat.flashtux.org/support.php
|
||||
|
||||
|
||||
3.6
|
||||
================================================================================
|
||||
Q: Puis-je donner de l'argent ou d'autres choses aux développeurs WeeChat ?
|
||||
|
||||
R: Non.
|
||||
+4
-2
@@ -2,9 +2,11 @@ WeeChat - Installation instructions
|
||||
===================================
|
||||
|
||||
1) Run './configure'
|
||||
options: --disable-curses : do not build Curses interface
|
||||
options: --enble-perl : enable Perl scripts
|
||||
--disable-curses : do not build Curses interface
|
||||
--enable-gtk : build Gtk+ interface (under development!)
|
||||
--enable-qt : build Qt interface (not developed!)
|
||||
--with-debug : 1 for debug compilation, 2 for debug messages
|
||||
|
||||
2) Run 'make'
|
||||
|
||||
@@ -12,4 +14,4 @@ WeeChat - Installation instructions
|
||||
|
||||
4) Enjoy ! :-)
|
||||
|
||||
See AUTHORS for any support, feel free to contact us for any problem ;)
|
||||
See AUTHORS for support, feel free to contact us for any problem ;)
|
||||
|
||||
+8
-2
@@ -17,6 +17,12 @@
|
||||
|
||||
SUBDIRS = po intl src
|
||||
|
||||
EXTRA_DIST = weechat.1 BUGS FAQ
|
||||
EXTRA_DIST = weechat-curses.1 BUGS FAQ FAQ.fr \
|
||||
debian/changelog debian/control \
|
||||
debian/copyright debian/files \
|
||||
debian/rules debian/weechat-common.docs \
|
||||
debian/weechat-common.install debian/weechat-curses.dirs \
|
||||
debian/weechat-curses.install debian/weechat-gtk.dirs \
|
||||
debian/weechat-gtk.install
|
||||
|
||||
man_MANS = weechat.1
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2004-10-30
|
||||
|
||||
WeeChat 0.0.8 released.
|
||||
|
||||
* FlashCode, 2004-08-08
|
||||
|
||||
WeeChat 0.0.7 released.
|
||||
|
||||
* FlashCode, 2004-06-05
|
||||
|
||||
WeeChat 0.0.6 released.
|
||||
|
||||
* FlashCode, 2004-02-07
|
||||
|
||||
WeeChat 0.0.5 released.
|
||||
|
||||
* FlashCode, 2004-01-01
|
||||
|
||||
WeeChat 0.0.4 released.
|
||||
|
||||
+3
-3
@@ -24,7 +24,7 @@ Copyright
|
||||
|
||||
WeeChat (c) Copyright 2004
|
||||
by: FlashCode <flashcode@flashtux.org>
|
||||
Xahlexx <xahlex@tuxisland.org>
|
||||
Xahlexx <xahlex@weeland.org>
|
||||
Bounga <bounga@altern.org>
|
||||
(see AUTHORS file if you want to contact authors)
|
||||
|
||||
@@ -46,6 +46,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
---
|
||||
(1) only curses interface is available today
|
||||
(2) plugin interfaces are not yet developed
|
||||
(1) only Curses interface is available today
|
||||
(2) only Perl interface is available today
|
||||
(3) only GNU/Linux version is available today
|
||||
|
||||
+19
-29
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2004-01-01
|
||||
TODO - 2004-10-30
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -10,34 +10,36 @@ Legend:
|
||||
? is this really necessary?
|
||||
|
||||
|
||||
v0.0.4:
|
||||
v0.0.8:
|
||||
------
|
||||
|
||||
* General:
|
||||
# debug messages can be enabled via ./configure --enbale-debug option
|
||||
- Windows version
|
||||
+ Solaris version
|
||||
|
||||
* IRC protocol:
|
||||
+ "/dcc" command (for chat and sending/receiving files)
|
||||
|
||||
* Interface:
|
||||
# log chats to file
|
||||
# "/buffer" command, buffers ordered by number, auto-jump to active
|
||||
buffers (alt-a), jump to buffers by number (alt-number)
|
||||
+ "/window" command, split terminal in multiple windows
|
||||
(horizontally/vertically)
|
||||
+ internationalization (traduce WeeChat in many languages)
|
||||
# intercept Ctrl-C
|
||||
# when private window is created (another user is talking), WeeChat does not
|
||||
switch to this window
|
||||
# highlight when our nick is written in a channel/private window
|
||||
|
||||
* Plugins:
|
||||
# Perl plugin
|
||||
# "/perl load" and "/perl unload" commands to (un)load Perl scripts
|
||||
# auto-load Perl scripts at startup
|
||||
* Configuration:
|
||||
+ add missing options for config file
|
||||
- add key bindings to config file
|
||||
|
||||
|
||||
Future versions:
|
||||
---------------
|
||||
|
||||
* General:
|
||||
- Windows version
|
||||
- *BSD version
|
||||
|
||||
* IRC protocol:
|
||||
+ "/mode" command: change the user/channels modes
|
||||
- "/dcc" command (for chat and sending/receiving files)
|
||||
- complete "/list" command: add regexp search, display only channels that
|
||||
match regexp
|
||||
- "/ignore" and "/unignore" commands: hide all that is write by a given
|
||||
@@ -48,9 +50,6 @@ Future versions:
|
||||
nick/host connect to the given irc network
|
||||
|
||||
* WeeChat commands:
|
||||
+ "/set" command: allow the user to set the WeeChat variables
|
||||
under WeeChat without editing the config file (colours, time
|
||||
format, etc)
|
||||
- "/reload" command: reload the WeeChat's config file
|
||||
- "/highlight" command: highlight a given word when it appears on
|
||||
channels/privates
|
||||
@@ -60,19 +59,16 @@ Future versions:
|
||||
and show us the output on the current window. An option to exec
|
||||
like -o could send the output to the server, on the current
|
||||
channel/private
|
||||
- "/last": command to look for text in previous messages
|
||||
|
||||
* Interface:
|
||||
+ Gtk GUI
|
||||
- display current channel modes (example : #weechat(+nt))
|
||||
- color for nicks (except own nick) when nick colors are disabled
|
||||
- interpret special chars in messages (color & bold for example)
|
||||
- many channel windows in one window/term (window split)
|
||||
- add lag indicator
|
||||
- forget some old lines that were displayed long time ago (now all is saved,
|
||||
if WeeChat is running for long time, a lot of memory is used!)
|
||||
- improve completion (for example complete command parameters when possible)
|
||||
- understand incomplete commands if unambigous (for example: /he for /help is ok)
|
||||
- add clock (in status bar?)
|
||||
- log chats to file
|
||||
- tab key with empty command line should switch to next window (like F7)
|
||||
? Qt GUI
|
||||
|
||||
* TCP/IP communication:
|
||||
@@ -81,12 +77,6 @@ Future versions:
|
||||
- SSL support
|
||||
- IPv6 protocol implementation
|
||||
|
||||
* Configuration:
|
||||
- add missing options for config file
|
||||
- add key bindings to config file
|
||||
- load config file after GUI (so init values by default (colors, ...) before
|
||||
loading config)
|
||||
|
||||
* Plugins:
|
||||
- Python plugin
|
||||
- "/python load" and "/python unload" commands to (un)load Python scripts
|
||||
|
||||
+22
-8
@@ -19,10 +19,10 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.56)
|
||||
AC_INIT(WeeChat, 0.0.4, flashcode@flashtux.org)
|
||||
AC_INIT(WeeChat, 0.0.8, flashcode@flashtux.org)
|
||||
AC_CONFIG_SRCDIR([src/common/weechat.c])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE([weechat], [0.0.4])
|
||||
AM_INIT_AUTOMAKE([weechat], [0.0.8])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
@@ -38,7 +38,7 @@ AC_CHECK_LIB([curses], [initscr], LIBCURSES_FOUND=1, LIBCURSES_FOUND=0)
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
|
||||
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_TIME
|
||||
@@ -59,7 +59,7 @@ AC_ARG_ENABLE(curses, [ --disable-curses Turn off Curses interface (defa
|
||||
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
|
||||
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
|
||||
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging messages (default=no)],enable_debug=yes,enable_debug=no)
|
||||
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
|
||||
|
||||
enable_plugins="no"
|
||||
enable_python="no"
|
||||
@@ -108,11 +108,15 @@ fi
|
||||
|
||||
AC_SUBST(PLUGINS_LIBS)
|
||||
|
||||
if test "x$enable_debug" = "xyes" ; then
|
||||
AC_DEFINE(DEBUG)
|
||||
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
|
||||
CFLAGS="-Wall -W -pipe -O2 -g"
|
||||
else
|
||||
CFLAGS="-Wall -W -pipe -O2"
|
||||
fi
|
||||
|
||||
CFLAGS="-Wall -W -pipe -O2"
|
||||
if test "x$debug" = "x2" ; then
|
||||
AC_DEFINE(DEBUG)
|
||||
fi
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
src/Makefile
|
||||
@@ -145,6 +149,15 @@ if test "x$listgui" = "x" ; then
|
||||
AC_MSG_ERROR([No interface specified... Please specify at least Curses, Gtk or Qt.])
|
||||
fi
|
||||
|
||||
msg_debug_compiler="No"
|
||||
msg_debug_verbose="No"
|
||||
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
|
||||
msg_debug_compiler="Yes"
|
||||
fi
|
||||
if test "x$debug" = "x2" ; then
|
||||
msg_debug_verbose="Yes"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo Interfaces.................... :$listgui
|
||||
echo
|
||||
@@ -153,7 +166,8 @@ echo Build with Perl support....... : $enable_perl
|
||||
echo Build with Python support..... : $enable_python
|
||||
echo Build with Ruby support....... : $enable_ruby
|
||||
echo
|
||||
echo Print debugging messages...... : $enable_debug
|
||||
echo Compile with debug info....... : $msg_debug_compiler
|
||||
echo Print debugging messages...... : $msg_debug_verbose
|
||||
echo
|
||||
eval eval echo WeeChat will be installed in $bindir.
|
||||
echo
|
||||
|
||||
@@ -1,3 +1,27 @@
|
||||
weechat (0.0.8-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.8, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 30 Oct 2004 11:40:00 +0200
|
||||
|
||||
weechat (0.0.7-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.7, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 08 Aug 2004 21:00:00 +0200
|
||||
|
||||
weechat (0.0.6-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.6, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 05 Jun 2004 11:30:00 +0200
|
||||
|
||||
weechat (0.0.5-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.5, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 07 Feb 2004 20:30:00 +0200
|
||||
|
||||
weechat (0.0.4-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.4, see ChangeLog for detail.
|
||||
|
||||
@@ -2,7 +2,7 @@ Source: weechat
|
||||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: FlashCode <flashcode@flashtux.org>
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5 (>= 5.2.20020112a-7)
|
||||
Build-Depends: debhelper (>> 4.0.0), libncurses5 (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
|
||||
Standards-Version: 3.5.8
|
||||
|
||||
Package: weechat
|
||||
@@ -21,14 +21,6 @@ Description: Fast, light and extensible IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-gtk
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
|
||||
Description: Fast, light and extensible IRC client
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
It is customizable and extensible with scripts.
|
||||
|
||||
Package: weechat-common
|
||||
Architecture: all
|
||||
Replaces: weechat
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
This package was debianized by FlashCode <flashcode@flashtux.org> on
|
||||
Thu, 01 Jan 2004 13:00:00 +0200.
|
||||
Sat, 30 Oct 2004 11:40:00 +0200.
|
||||
|
||||
It was downloaded from http://weechat.flashtux.org/download
|
||||
|
||||
Upstream Author(s): FlashCode <flashcode@flashtux.org>
|
||||
Upstream Author: FlashCode <flashcode@flashtux.org>
|
||||
|
||||
Copyright:
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
export DH_VERBOSE=1
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -O0
|
||||
@@ -17,7 +14,7 @@ endif
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
./configure --prefix=/usr --sysconfdir=/etc --enable-gtk
|
||||
./configure --prefix=/usr --sysconfdir=/etc --enable-perl
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
@@ -43,17 +40,16 @@ install: build
|
||||
$(MAKE) install DESTDIR=$(CURDIR)/debian/weechat
|
||||
dh_install --sourcedir=debian/weechat
|
||||
install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
#install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
dh_testdir -pweechat-common
|
||||
dh_testroot -pweechat-common
|
||||
dh_installchangelogs -pweechat-common
|
||||
dh_installchangelogs ChangeLog -pweechat-common
|
||||
dh_installdocs -pweechat-common
|
||||
dh_installexamples -pweechat-common
|
||||
dh_installman weechat.1 -pweechat-common
|
||||
dh_compress -pweechat-common
|
||||
dh_fixperms -pweechat-common
|
||||
dh_installdeb -pweechat-common
|
||||
@@ -66,6 +62,9 @@ binary-indep: build install
|
||||
binary-arch: build install
|
||||
dh_testdir -a
|
||||
dh_testroot -a
|
||||
dh_installchangelogs -a
|
||||
dh_installdocs -a
|
||||
dh_installman weechat-curses.1 -pweechat-curses
|
||||
dh_link -a
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
AUTHORS
|
||||
BUGS
|
||||
ChangeLog
|
||||
COPYING
|
||||
FAQ
|
||||
INSTALL
|
||||
FAQ.fr
|
||||
NEWS
|
||||
README
|
||||
TODO
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
usr/share/locale
|
||||
+427
-21
@@ -6,14 +6,21 @@
|
||||
|
||||
@c WeeChat documentation (english version)
|
||||
@c
|
||||
@c Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
@c
|
||||
@c Permission is granted to copy, distribute and/or modify this document
|
||||
@c under the terms of the GNU Free Documentation License, Version 1.2
|
||||
@c or any later version published by the Free Software Foundation;
|
||||
@c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
@c A copy of the license is included in the section entitled "GNU
|
||||
@c Free Documentation License".
|
||||
@c This manual is free software; you can redistribute it and/or modify
|
||||
@c it under the terms of the GNU General Public License as published by
|
||||
@c the Free Software Foundation; either version 2 of the License, or
|
||||
@c (at your option) any later version.
|
||||
@c
|
||||
@c This manual is distributed in the hope that it will be useful,
|
||||
@c but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
@c GNU General Public License for more details.
|
||||
@c
|
||||
@c You should have received a copy of the GNU General Public License
|
||||
@c along with this program; if not, write to the Free Software
|
||||
@c Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
@c pdf : texi2pdf weechat_doc_en.texi
|
||||
@c html: makeinfo --html --no-split --number-sections weechat_doc_en.texi
|
||||
@@ -28,7 +35,7 @@
|
||||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.0.4 - November, 23 2003
|
||||
@subtitle Documentation for WeeChat v0.0.8-pre2 - October, 03 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -41,7 +48,7 @@ This manual documents WeeChat IRC client, it is part of WeeChat.@*
|
||||
Latest version of this document can be found on this page:@*
|
||||
@uref{http://weechat.flashtux.org/doc.php?lang=en}@*
|
||||
@*
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
This document may be used under the terms the GNU General Public License
|
||||
@@ -149,7 +156,7 @@ Mandrake/Redhat (or any RPM compatible distribution)@*
|
||||
To install: @kbd{rpm -i /path/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
To install: see Gentoo documentation
|
||||
To install: @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (not available!)
|
||||
@item
|
||||
@@ -171,7 +178,7 @@ Nota: to build only some interfaces, you can give parameters
|
||||
to ./configure, type @kbd{./configure --help} for help about options.@*
|
||||
|
||||
Then get root privileges and install WeeChat:@*
|
||||
@kbd{su -}@*
|
||||
@kbd{su}@*
|
||||
(enter root password)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@@ -198,17 +205,20 @@ Then follow instructions for source package - @xref{Source package}.
|
||||
@chapter Usage
|
||||
|
||||
@menu
|
||||
* Run WeeChat::
|
||||
* Run WeeChat::
|
||||
* Config file::
|
||||
* Key bindings::
|
||||
* WeeChat commands::
|
||||
@end menu
|
||||
|
||||
@node Run WeeChat, Key bindings, Usage, Usage
|
||||
@node Run WeeChat, Config file, Usage, Usage
|
||||
@section Run WeeChat
|
||||
|
||||
@subsection Command line parameters
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Display config file help (list of options)@*
|
||||
@item -h, --help
|
||||
Display help screen@*
|
||||
@item -l, --license
|
||||
@@ -220,7 +230,7 @@ Display WeeChat version@*
|
||||
@subsection Run WeeChat
|
||||
|
||||
Just issue this command to run WeeChat:@*
|
||||
@kbd{weechat}@*
|
||||
@kbd{weechat-curses} (for Curses front-end)@*
|
||||
or @kbd{weechat-gtk} (for Gtk front-end)@*
|
||||
or @kbd{weechat-qt} (for Qt front-end)@*
|
||||
|
||||
@@ -231,7 +241,327 @@ The default configuration file is: ~/.weechat/weechat.rc@*
|
||||
You can edit this file at your convenience to configure WeeChat, or you can
|
||||
set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
|
||||
|
||||
@node Key bindings, WeeChat commands, Run WeeChat, Usage
|
||||
@node Config file, Key bindings, Run WeeChat, Usage
|
||||
@section Config file
|
||||
|
||||
Here is a list of all options for config file:@*
|
||||
|
||||
@table @kbd
|
||||
@item look_set_title
|
||||
Set title for window (terminal for Curses GUI) with name & version@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_startup_logo
|
||||
Display WeeChat logo at startup@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_startup_version
|
||||
Display WeeChat version at startup@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_weechat_slogan
|
||||
WeeChat slogan (if empty, slogan is not used)@*
|
||||
Type: string (any string), default value: 'the geekest IRC client!'@*
|
||||
@item look_color_nicks
|
||||
Display nick names with different colors@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_color_actions
|
||||
Display actions with different colors@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_remove_colors_from_msgs
|
||||
Remove colors from incoming messages@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_nicklist
|
||||
Display nicklist window (for channel windows)@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_nicklist_position
|
||||
Nicklist position (top, left, right (default), bottom)@*
|
||||
Type: string (values: 'left', 'right', 'top', 'bottom'), default value: 'right'@*
|
||||
@item look_nicklist_min_size
|
||||
Min size for nicklist (width or height, depending on look_nicklist_position (0 = no min size))@*
|
||||
Type: integer (values: between 0 and 100), default value: 0@*
|
||||
@item look_nicklist_max_size
|
||||
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))@*
|
||||
Type: integer (values: between 0 and 100), default value: 0@*
|
||||
@item look_no_nickname
|
||||
Text to display instead of nick when not connected@*
|
||||
Type: string (any string), default value: '-cmd-'@*
|
||||
@item look_nickmode
|
||||
Display nick mode ((half)op/voice) before each nick@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_nickmode_empty
|
||||
Display space if nick mode is not (half)op/voice@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item look_nick_completor
|
||||
The string inserted after nick completion@*
|
||||
Type: string (any string), default value: ':'@*
|
||||
@item look_display_away
|
||||
Display message to all channels when (un)marking as away@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar
|
||||
Enable info bar@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Timestamp for time in infobar@*
|
||||
Type: string (any string), default value: '%B, %A %d %G - %H:%M'@*
|
||||
@item look_infobar_delay_highlight
|
||||
Delay (in seconds) for highlight messages in infobar (0 = disable highlight notifications in infobar)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 7@*
|
||||
@item col_title
|
||||
Color for title bar@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_title_bg
|
||||
Background for title bar@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_chat
|
||||
Color for chat text@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_chat_time
|
||||
Color for time in chat window@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_chat_time_sep
|
||||
Color for time separator (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'brown'@*
|
||||
@item col_chat_prefix1
|
||||
Color for 1st and 3rd char of prefix@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
|
||||
@item col_chat_prefix2
|
||||
Color for middle char of prefix@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_chat_nick
|
||||
Color for nicks in actions (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightcyan'@*
|
||||
@item col_chat_host
|
||||
Color for hostnames (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'cyan'@*
|
||||
@item col_chat_channel
|
||||
Color for channel names in actions (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_chat_dark
|
||||
Color for dark separators (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'green'@*
|
||||
@item col_chat_highlight
|
||||
Color for highlighted nick (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_chat_bg
|
||||
Background for chat window@*
|
||||
Type: color (Curses or Gtk color), default value: 'default'@*
|
||||
@item col_status
|
||||
Color for status bar@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_status_delimiters
|
||||
Color for status bar delimiters@*
|
||||
Type: color (Curses or Gtk color), default value: 'cyan'@*
|
||||
@item col_status_data_msg
|
||||
Color for window with new messages (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_status_highlight
|
||||
Color for window with highlight (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
|
||||
@item col_status_data_other
|
||||
Color for window with new data (not messages) (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_status_more
|
||||
Color for window with new data (status bar)@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_status_bg
|
||||
Background for status window@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_infobar
|
||||
Color for info bar text@*
|
||||
Type: color (Curses or Gtk color), default value: 'black'@*
|
||||
@item col_infobar_highlight
|
||||
Color for info bar highlight notification@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_infobar_bg
|
||||
Background for info bar window@*
|
||||
Type: color (Curses or Gtk color), default value: 'cyan'@*
|
||||
@item col_input
|
||||
Color for input text@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_input_channel
|
||||
Color for input text (channel name)@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_input_nick
|
||||
Color for input text (nick name)@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
|
||||
@item col_input_bg
|
||||
Background for input window@*
|
||||
Type: color (Curses or Gtk color), default value: 'default'@*
|
||||
@item col_nick
|
||||
Color for nicknames@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_nick_op
|
||||
Color for operator symbol@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
|
||||
@item col_nick_halfop
|
||||
Color for half-operator symbol@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightmagenta'@*
|
||||
@item col_nick_voice
|
||||
Color for voice symbol@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_nick_sep
|
||||
Color for nick separator@*
|
||||
Type: color (Curses or Gtk color), default value: 'blue'@*
|
||||
@item col_nick_self
|
||||
Color for local nick@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_nick_private
|
||||
Color for other nick in private window@*
|
||||
Type: color (Curses or Gtk color), default value: 'gray'@*
|
||||
@item col_nick_bg
|
||||
Background for nicknames@*
|
||||
Type: color (Curses or Gtk color), default value: 'default'@*
|
||||
@item col_chat_dcc_selected
|
||||
Color for selected DCC (chat window)@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_dcc_waiting
|
||||
Color for "waiting" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'white'@*
|
||||
@item col_dcc_connecting
|
||||
Color for "connecting" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'yellow'@*
|
||||
@item col_dcc_active
|
||||
Color for "active" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightblue'@*
|
||||
@item col_dcc_done
|
||||
Color for "done" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
|
||||
@item col_dcc_failed
|
||||
Color for "failed" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightred'@*
|
||||
@item col_dcc_aborted
|
||||
Color for "aborted" dcc status@*
|
||||
Type: color (Curses or Gtk color), default value: 'lightred'@*
|
||||
@item history_max_lines
|
||||
Maximum number of lines in history for one server/channel/private window (0 = unlimited)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 4096@*
|
||||
@item history_max_commands
|
||||
Maximum number of user commands in history (0 = unlimited)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 100@*
|
||||
@item log_auto_server
|
||||
Automatically log server messages@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item log_auto_channel
|
||||
Automatically log channel chats@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item log_auto_private
|
||||
Automatically log private chats@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item log_path
|
||||
Path for WeeChat log files@*
|
||||
Type: string (any string), default value: '~/.weechat/logs/'@*
|
||||
@item log_timestamp
|
||||
Timestamp for log (see man strftime for date/time specifiers)@*
|
||||
Type: string (any string), default value: '%Y %b %d %H:%M:%S'@*
|
||||
@item dcc_auto_accept_files
|
||||
Automatically accept incoming dcc files@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item dcc_auto_accept_chats
|
||||
Automatically accept dcc chats (use carefully!)@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item dcc_timeout
|
||||
Timeout for dcc request (in seconds)@*
|
||||
Type: integer (values: between 1 and 2147483647), default value: 300@*
|
||||
@item dcc_blocksize
|
||||
Block size for dcc packets in bytes (default: 1024)@*
|
||||
Type: integer (values: between 1024 and 102400), default value: 1024@*
|
||||
@item dcc_download_path
|
||||
Path for writing incoming files with dcc (default: user home)@*
|
||||
Type: string (any string), default value: '~'@*
|
||||
@item dcc_upload_path
|
||||
Path for reading files when sending thru dcc (when no path is specified)@*
|
||||
Type: string (any string), default value: '~'@*
|
||||
@item dcc_auto_rename
|
||||
Rename incoming files if already exists (add '.1', '.2', ...)@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item dcc_auto_resume
|
||||
Automatically resume dcc transfer if connection with remote host is loosed@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item proxy_use
|
||||
Use a proxy server to connect to irc server@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item proxy_address
|
||||
Proxy server address (IP or hostname)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item proxy_port
|
||||
Port for connecting to proxy server@*
|
||||
Type: integer (values: between 0 and 65535), default value: 1080@*
|
||||
@item proxy_password
|
||||
Password for proxy server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_name
|
||||
Name associated to IRC server (for display only)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_autoconnect
|
||||
Automatically connect to server when WeeChat is starting@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@item server_address
|
||||
IP address or hostname of IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_port
|
||||
Port for connecting to server@*
|
||||
Type: integer (values: between 0 and 65535), default value: 6667@*
|
||||
@item server_password
|
||||
Password for IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_nick1
|
||||
Nickname to use on IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_nick2
|
||||
Alternate nickname to use on IRC server (if nickname is already used)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_nick3
|
||||
2nd alternate nickname to use on IRC server (if alternate nickname is already used)@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_username
|
||||
User name to use on IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_realname
|
||||
Real name to use on IRC server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_command
|
||||
First command to run when connected to server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@item server_autojoin
|
||||
Comma separated list of channels to join when connected to server@*
|
||||
Type: string (any string), default value: ''@*
|
||||
@end table
|
||||
|
||||
Colors for Curses GUI are:@*
|
||||
@itemize @minus
|
||||
@item
|
||||
@kbd{default}: default color (transparent for background)
|
||||
@item
|
||||
@kbd{black}: black
|
||||
@item
|
||||
@kbd{red}: dark red
|
||||
@item
|
||||
@kbd{lightred}: light red
|
||||
@item
|
||||
@kbd{green}: dark green
|
||||
@item
|
||||
@kbd{lightgreen}: light green
|
||||
@item
|
||||
@kbd{brown}: brown
|
||||
@item
|
||||
@kbd{yellow}: yellow
|
||||
@item
|
||||
@kbd{blue}: dark blue
|
||||
@item
|
||||
@kbd{lightblue}: light blue
|
||||
@item
|
||||
@kbd{magenta}: dark magenta
|
||||
@item
|
||||
@kbd{lightmagenta}: light magenta
|
||||
@item
|
||||
@kbd{cyan}: dark cyan
|
||||
@item
|
||||
@kbd{lightcyan}: light cyan
|
||||
@item
|
||||
@kbd{gray}: gray
|
||||
@item
|
||||
@kbd{white}: white
|
||||
@end itemize
|
||||
|
||||
@node Key bindings, WeeChat commands, Config file, Usage
|
||||
@section Key bindings
|
||||
|
||||
@table @kbd
|
||||
@@ -263,14 +593,32 @@ Execute command or send message@*
|
||||
Call again last commands/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Show window history@*
|
||||
Show buffer history@*
|
||||
@*
|
||||
@item F6 / F7
|
||||
Switch to previous / next window@*
|
||||
Switch to previous / next buffer@*
|
||||
@*
|
||||
@item F8
|
||||
Switch to next window@*
|
||||
@*
|
||||
@item F10
|
||||
Remove last infobar message@*
|
||||
@*
|
||||
@item Alt + left arrow / Alt + right arrow
|
||||
Same as F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Switch to next buffer with activity (with priority: highlight, message, other)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Display current DCC@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Clear hotlist (activity notification on other buffers)@*
|
||||
@*
|
||||
@item Alt + digit (1-9)
|
||||
Switch to buffer by number@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node WeeChat commands, , Key bindings, Usage
|
||||
@@ -345,6 +693,39 @@ Print message in current window (channel or server).@*
|
||||
@code{IRC::print ("message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_with_channel ( channel, [server,] message );}@*
|
||||
@*
|
||||
Print message in a channel.@*
|
||||
|
||||
@emph{Arguments:}
|
||||
@itemize @minus
|
||||
@item @option{channel}: name of channel
|
||||
@item @option{server}: internal name of server
|
||||
@item @option{message}: message to display
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Examples:}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_infobar ( delay, message );}@*
|
||||
@*
|
||||
Print message in infobar.@*
|
||||
|
||||
@emph{Arguments:}
|
||||
@itemize @minus
|
||||
@item @option{delay}: after this delay (in seconds), message will be erased
|
||||
(if 0, message will not be erased).
|
||||
@item @option{message}: message to display
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Example:}@*
|
||||
@code{IRC::print_infobar (5, "message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::add_message_handler ( name, function );}@*
|
||||
@*
|
||||
@@ -364,7 +745,8 @@ RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
|
||||
@code{IRC::add_message_handler ("privmsg", my_function);}@*
|
||||
@code{sub my_function}@*
|
||||
@code{@{ }@*
|
||||
@code{@ @ @ @ ($null, $channel, $message) = split ":",@@_[0],3;}@*
|
||||
@code{@ @ @ @ IRC::print ("server=$_[0]\n");}@*
|
||||
@code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
|
||||
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
|
||||
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
|
||||
@code{@} }@*
|
||||
@@ -389,11 +771,35 @@ available until your Perl script will be unloaded.
|
||||
@code{IRC::add_command_handler ("command", my_command);}@*
|
||||
@code{sub my_command}@*
|
||||
@code{@{ }@*
|
||||
@code{@ @ @ @ IRC::print("Arguments: ".@@_[0]);}@*
|
||||
@code{@ @ @ @ IRC::print("Server: $_[0], arguments: $_[1]\n");}@*
|
||||
@code{@ @ @ @ return 0;}@*
|
||||
@code{@} }@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::get_info ( [server,] name );}@*
|
||||
@*
|
||||
Get various info about WeeChat, server or user.@*
|
||||
|
||||
@emph{Arguments:}
|
||||
@itemize @minus
|
||||
@item @option{server}: internal name of server
|
||||
@item @option{name}: name of info to retrieve:
|
||||
@itemize @minus
|
||||
@item @option{0 or version}: get WeeChat version
|
||||
@item @option{1 or nick}: get nickname
|
||||
@item @option{2 or channel}: get channel name
|
||||
@item @option{3 or server}: get server name
|
||||
@item @option{4 or weechatdir}: get WeeChat home directory
|
||||
@item @option{5 or away}: get away flag for server
|
||||
@end itemize
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Examples:}@*
|
||||
@code{$version = get_info("version");}@*
|
||||
@code{$nick = get_info("freenode", "nick");}@*
|
||||
@*
|
||||
|
||||
@end itemize
|
||||
|
||||
@node Python scripts, Ruby scripts, Perl scripts, Extensions
|
||||
@@ -466,7 +872,7 @@ Support with IRC:@*
|
||||
- server: @b{irc.freenode.net}@*
|
||||
- channel: @b{#weechat}@*@*
|
||||
@item
|
||||
WeeChat forum: soon!@*@*
|
||||
WeeChat forum: @uref{http://forums.flashtux.org}@*@*
|
||||
@item
|
||||
Support with mailing list:@*
|
||||
- to subscribe/unsubscribe:@*@uref{http://mail.nongnu.org/mailman/listinfo/weechat-support}.@*
|
||||
@@ -486,7 +892,7 @@ Look for WeeChat support page for detail:@*
|
||||
|
||||
This manual documents WeeChat IRC client, it is part of WeeChat.@*
|
||||
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
This document may be used under the terms the GNU General Public License
|
||||
|
||||
+428
-22
@@ -6,14 +6,21 @@
|
||||
|
||||
@c WeeChat documentation (french version)
|
||||
@c
|
||||
@c Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
@c
|
||||
@c Permission is granted to copy, distribute and/or modify this document
|
||||
@c under the terms of the GNU Free Documentation License, Version 1.2
|
||||
@c or any later version published by the Free Software Foundation;
|
||||
@c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
@c A copy of the license is included in the section entitled "GNU
|
||||
@c Free Documentation License".
|
||||
@c This manual is free software; you can redistribute it and/or modify
|
||||
@c it under the terms of the GNU General Public License as published by
|
||||
@c the Free Software Foundation; either version 2 of the License, or
|
||||
@c (at your option) any later version.
|
||||
@c
|
||||
@c This manual is distributed in the hope that it will be useful,
|
||||
@c but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
@c GNU General Public License for more details.
|
||||
@c
|
||||
@c You should have received a copy of the GNU General Public License
|
||||
@c along with this program; if not, write to the Free Software
|
||||
@c Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
@c pdf : texi2pdf weechat_doc_fr.texi
|
||||
@c html: makeinfo --html --no-split --number-sections weechat_doc_fr.texi
|
||||
@@ -28,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.0.4 - 23 novembre 2003
|
||||
@subtitle Documentation pour WeeChat v0.0.8-pre2 - 03 Octobre 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -41,7 +48,7 @@ Ce manuel documente le client IRC WeeChat, il fait partie de WeeChat.@*
|
||||
La derni@`ere version de ce document peut @^etre t@'el@'echarg@'ee sur cette page :@*
|
||||
@uref{http://weechat.flashtux.org/doc.php}@*
|
||||
@*
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
Ce document peut @^etre utilis@'e sous les termes de la licence GNU General Public
|
||||
@@ -148,7 +155,7 @@ Mandrake/Redhat (ou toute distribution compatible avec les RPM)@*
|
||||
Pour installer : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
Pour installer : voir la documentation Gentoo
|
||||
Pour installer : @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (non disponible !)
|
||||
@item
|
||||
@@ -170,7 +177,7 @@ Note: pour ne construire que certaines interfaces, vous pouvez passer des param@
|
||||
@`a ./configure, tapez @kbd{./configure --help} pour de l'aide sur ces options.@*
|
||||
|
||||
Obtenez les droits root et installez WeeChat :@*
|
||||
@kbd{su -}@*
|
||||
@kbd{su}@*
|
||||
(entrez le mot de passe de root)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@@ -198,17 +205,20 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
|
||||
@chapter Utilisation
|
||||
|
||||
@menu
|
||||
* Lancer WeeChat::
|
||||
* Lancer WeeChat::
|
||||
* Fichier de configuration::
|
||||
* Raccourcis clavier::
|
||||
* Commandes WeeChat::
|
||||
@end menu
|
||||
|
||||
@node Lancer WeeChat, Raccourcis clavier, Utilisation, Utilisation
|
||||
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
|
||||
@section Lancer WeeChat
|
||||
|
||||
@subsection Param@`etres de ligne de commande
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Afficher l'aide sur le fichier de config (liste des options)@*
|
||||
@item -h, --help
|
||||
Afficher l'aide@*
|
||||
@item -l, --license
|
||||
@@ -220,7 +230,7 @@ Afficher la version de WeeChat@*
|
||||
@subsection Lancer WeeChat
|
||||
|
||||
Tapez simplement cette commande pour lancer WeeChat :@*
|
||||
@kbd{weechat-curses}@*
|
||||
@kbd{weechat-curses} (pour l'interface Curses)@*
|
||||
ou @kbd{weechat-gtk} (pour l'interface Gtk)@*
|
||||
ou @kbd{weechat-qt} (pour l'interface Qt)@*
|
||||
|
||||
@@ -231,7 +241,327 @@ Le fichier de configuration par d@'efaut est : ~/.weechat/weechat.rc@*
|
||||
Vous pouvez @'editer ce fichier pour configurer WeeChat @`a votre convenance, ou
|
||||
vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} - @xref{Commandes WeeChat}.
|
||||
|
||||
@node Raccourcis clavier, Commandes WeeChat, Lancer WeeChat, Utilisation
|
||||
@node Fichier de configuration, Raccourcis clavier, Lancer WeeChat, Utilisation
|
||||
@section Fichier de configuration
|
||||
|
||||
Liste des options du fichier de configuration :@*
|
||||
|
||||
@table @kbd
|
||||
@item look_set_title
|
||||
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_startup_logo
|
||||
Afficher le logo WeeChat au d@'emarrage@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_startup_version
|
||||
Afficher la version de WeeChat au d@'emarrage@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_weechat_slogan
|
||||
Slogan WeeChat (si vide, le slogan ne sera pas utilis@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'the geekest IRC client!'@*
|
||||
@item look_color_nicks
|
||||
Afficher les utilisateurs avec diff@'erentes couleurs@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_color_actions
|
||||
Afficher les actions avec diff@'erentes couleurs@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_remove_colors_from_msgs
|
||||
Supprimer les couleurs dans les messages entrants@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_nicklist
|
||||
Afficher la fen@^etre des utilisateurs (pour les fen@^etres de canaux)@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_nicklist_position
|
||||
Position de la fen@^etre d'utilisateurs (haut (top), gauche (left), droite (right, par d@'efaut), bas (bottom))@*
|
||||
Type: cha@^ine (valeurs: 'left', 'right', 'top', 'bottom'), valeur par d@'efaut: 'right'@*
|
||||
@item look_nicklist_min_size
|
||||
Taille minimum pour la fen@^etre d'utilisateurs (largeur ou hauteur, selon look_nicklist_position (0 = pas de taille minimum))@*
|
||||
Type: entier (valeurs: entre 0 et 100), valeur par d@'efaut: 0@*
|
||||
@item look_nicklist_max_size
|
||||
Taille maximum pour la fen@^etre d'utilisateurs (largeur ou hauteur, selon look_nicklist_position (0 = pas de taille maximum; si min == max et > 0, alors la taille est fixe))@*
|
||||
Type: entier (valeurs: entre 0 et 100), valeur par d@'efaut: 0@*
|
||||
@item look_no_nickname
|
||||
Texte @`a afficher en lieu et place du nom d'utilisateur lorsque la connexion n'est pas active@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '-cmd-'@*
|
||||
@item look_nickmode
|
||||
Afficher le mode de l'utilisateur ((half)op/voice) devant chaque utilisateur@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_nickmode_empty
|
||||
Afficher un espace si le mode utilisateur n'est pas (half)op/voice@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item look_nick_completor
|
||||
La cha@^ine affich@'ee apr@`es la compl@'etion des utilisateurs@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ':'@*
|
||||
@item look_display_away
|
||||
Affiche un message sur tous les canaux pour l'absence/le retour@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar
|
||||
Active la barre d'infos@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item look_infobar_timestamp
|
||||
Horodatage pour les conversations sauvegard@'ees@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %G - %H:%M'@*
|
||||
@item look_infobar_delay_highlight
|
||||
D@'elai (en secondes) pour la notification des messages dans la barre d'infos (0 = d@'esactiver les notifications dans la barre d'infos)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 7@*
|
||||
@item col_title
|
||||
Couleur pour la barre de titre@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_title_bg
|
||||
Couleur de fond pour la barre de titre@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_chat
|
||||
Couleur pour le texte de discussion@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_chat_time
|
||||
Couleur pour l'heure dans la fen@^etre de discussion@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_chat_time_sep
|
||||
Couleur pour la s@'eparation de l'heure (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'brown'@*
|
||||
@item col_chat_prefix1
|
||||
Couleur pour le 1er et le 3@`eme caract@`ere du pr@'efixe@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
|
||||
@item col_chat_prefix2
|
||||
Couleur pour le caract@`ere du milieu du pr@'efixe@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_chat_nick
|
||||
Couleur pour les noms d'utilisateurs dans les actions (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightcyan'@*
|
||||
@item col_chat_host
|
||||
Couleur pour les noms de machines (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
|
||||
@item col_chat_channel
|
||||
Couleur pour les canaux dans les actions (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_chat_dark
|
||||
Couleur pour les s@'eparateurs sombres (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'green'@*
|
||||
@item col_chat_highlight
|
||||
Couleur pour le pseudo surlign@'e (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_chat_bg
|
||||
Couleur de fond pour la fen@^etre de discussion@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
|
||||
@item col_status
|
||||
Couleur pour la barre de statut@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_status_delimiters
|
||||
Couleur pour les d@'elimiteurs de la barre de statut@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
|
||||
@item col_status_data_msg
|
||||
Couleur pour une fen@^etre avec de nouvelles infos (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_status_highlight
|
||||
Couleur pour une fen@^etre avec un highlight (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
|
||||
@item col_status_data_other
|
||||
Couleur pour une fen@^etre avec des nouvelles donn@'ees (pas des infos) (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_status_more
|
||||
Couleur pour une fen@^etre avec des nouvelles donn@'ees (barre de statut)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_status_bg
|
||||
Couleur de fond pour la fen@^etre de statut@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_infobar
|
||||
Couleur pour la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'black'@*
|
||||
@item col_infobar_highlight
|
||||
Couleur pour la notification dans la barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_infobar_bg
|
||||
Couleur de fond pour la fen@^etre de barre d'infos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
|
||||
@item col_input
|
||||
Couleur pour le texte saisi@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_input_channel
|
||||
Couleur pour le texte saisi (nom du canal)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_input_nick
|
||||
Couleur pour le texte saisi (pseudo)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
|
||||
@item col_input_bg
|
||||
Couleur de fond pour la fen@^etre de saisie@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
|
||||
@item col_nick
|
||||
Couleur pour les pseudos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_nick_op
|
||||
Couleur pour le symbole op@'erateur@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
|
||||
@item col_nick_halfop
|
||||
Couleur pour le symbole demi-op@'erateur@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightmagenta'@*
|
||||
@item col_nick_voice
|
||||
Couleur pour le symbole voix@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_nick_sep
|
||||
Couleur pour le s@'eparateur de pseudo@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'blue'@*
|
||||
@item col_nick_self
|
||||
Couleur pour le pseudo local@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_nick_private
|
||||
Couleur pour l'autre pseudo dans la fen@^etre priv@'ee@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
|
||||
@item col_nick_bg
|
||||
Couleur de fond pour les pseudos@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
|
||||
@item col_chat_dcc_selected
|
||||
Couleur pour le DCC s@'electionn@'e (fen@^etre de discussion)@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_dcc_waiting
|
||||
Couleur pour le statut dcc "attente"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
|
||||
@item col_dcc_connecting
|
||||
Couleur pour le statut dcc "connexion"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
|
||||
@item col_dcc_active
|
||||
Couleur pour le statut dcc "actif"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightblue'@*
|
||||
@item col_dcc_done
|
||||
Couleur pour le statut dcc "termin@'e"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
|
||||
@item col_dcc_failed
|
||||
Couleur pour le statut dcc "@'echou@'e"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
|
||||
@item col_dcc_aborted
|
||||
Couleur pour le statut dcc "interrompu"@*
|
||||
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
|
||||
@item history_max_lines
|
||||
Nombre maximum de lignes dans l'historique pour un serveur/fen@^etre/fen@^etre priv@'ee (0 = sans limite)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 4096@*
|
||||
@item history_max_commands
|
||||
Nombre maximum de commandes utilisateur dans l'historique (0 = sans limite)@*
|
||||
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 100@*
|
||||
@item log_auto_server
|
||||
Enregistrer automatiquement les messages du serveur@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item log_auto_channel
|
||||
Enregistrer automatiquement les conversations des canaux@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item log_auto_private
|
||||
Enregistrer automatiquement les conversations priv@'ees@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item log_path
|
||||
Chemin pour les conversations sauvegard@'ees par WeeChat@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~/.weechat/logs/'@*
|
||||
@item log_timestamp
|
||||
Horodatage pour les conversations sauvegard@'ees (voir man strftime pour le format de date/heure)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%Y %b %d %H:%M:%S'@*
|
||||
@item dcc_auto_accept_files
|
||||
Accepte automatiquement les fichiers dcc entrants@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item dcc_auto_accept_chats
|
||||
Accepte automatiquement les demandes de discussion dcc (@`a utiliser avec pr@'ecaution !)@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item dcc_timeout
|
||||
D@'elai d'attente pour les requ@^etes dcc (en secondes)@*
|
||||
Type: entier (valeurs: entre 1 et 2147483647), valeur par d@'efaut: 300@*
|
||||
@item dcc_blocksize
|
||||
Taille de bloc pour les paquets dcc en octets (d@'efaut: 1024)@*
|
||||
Type: entier (valeurs: entre 1024 et 102400), valeur par d@'efaut: 1024@*
|
||||
@item dcc_download_path
|
||||
Chemin pour @'ecrire les fichiers re@,{c}us par dcc (par d@'efaut: r@'epertoire de l'utilisateur)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~'@*
|
||||
@item dcc_upload_path
|
||||
Chemin pour lire les fichiers lorsqu'ils sont envoy@'es par dcc (quand aucun chemin n'est sp@'ecifi@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~'@*
|
||||
@item dcc_auto_rename
|
||||
Renommer les fichiers re@,{c}us s'ils existent d@'ej@`a (ajoute '.1', '.2', ...)@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item dcc_auto_resume
|
||||
Continuer automatiquement les transferts dcc si la connexion avec la machine distante a @'et@'e perdue@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item proxy_use
|
||||
Utiliser un proxy pour se connecter au serveur irc@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
|
||||
@item proxy_address
|
||||
Adresse du serveur proxy (IP ou nom)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item proxy_port
|
||||
Port pour se connecter au serveur proxy@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 1080@*
|
||||
@item proxy_password
|
||||
Mot de passe pour le serveur proxy@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_name
|
||||
Nom associ@'e au serveur IRC (pour affichage seulement)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_autoconnect
|
||||
Connexion automatique au serveur quand WeeChat d@'emarre@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
@item server_address
|
||||
Adresse IP ou nom du serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_port
|
||||
Port pour se connecter au serveur@*
|
||||
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 6667@*
|
||||
@item server_password
|
||||
Mot de passe pour le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_nick1
|
||||
Pseudo @`a utiliser sur le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_nick2
|
||||
Pseudo alternatif pour le serveur IRC (si le pseudo est d@'ej@`a utilis@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_nick3
|
||||
2nd pseudo alternatif pour le serveur IRC (si le pseudo alternatif est d@'ej@`a utilis@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_username
|
||||
Nom d'utilisateur pour le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_realname
|
||||
Nom r@'eel pour le serveur IRC@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_command
|
||||
Commande @`a ex@'ecuter en premier lorsque connect@'e au serveur@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item server_autojoin
|
||||
Liste des canaux (s@'epar@'es par des virgules) @`a rejoindre lorsque connect@'e au serveur@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@end table
|
||||
|
||||
Les couleurs pour l'interface Curses sont :@*
|
||||
@itemize @minus
|
||||
@item
|
||||
@kbd{default}: couleur par d@'efaut (transparent pour le fond)
|
||||
@item
|
||||
@kbd{black}: noir
|
||||
@item
|
||||
@kbd{red}: rouge fonc@'e
|
||||
@item
|
||||
@kbd{lightred}: rouge clair
|
||||
@item
|
||||
@kbd{green}: vert fonc@'e
|
||||
@item
|
||||
@kbd{lightgreen}: vert clair
|
||||
@item
|
||||
@kbd{brown}: marron
|
||||
@item
|
||||
@kbd{yellow}: jaune
|
||||
@item
|
||||
@kbd{blue}: bleu fonc@'e
|
||||
@item
|
||||
@kbd{lightblue}: bleu clair
|
||||
@item
|
||||
@kbd{magenta}: violet fonc@'e
|
||||
@item
|
||||
@kbd{lightmagenta}: violet clair
|
||||
@item
|
||||
@kbd{cyan}: cyan fonc@'e
|
||||
@item
|
||||
@kbd{lightcyan}: cyan clair
|
||||
@item
|
||||
@kbd{gray}: gris
|
||||
@item
|
||||
@kbd{white}: blanc
|
||||
@end itemize
|
||||
|
||||
@node Raccourcis clavier, Commandes WeeChat, Fichier de configuration, Utilisation
|
||||
@section Raccourcis clavier
|
||||
|
||||
@table @kbd
|
||||
@@ -263,14 +593,32 @@ Ex@'ecuter la commande ou envoyer le message@*
|
||||
Rappeler les derni@`eres commandes/messages@*
|
||||
@*
|
||||
@item PageUp / PageDown
|
||||
Afficher l'historique de la fen@^etre@*
|
||||
Afficher l'historique du tampon@*
|
||||
@*
|
||||
@item F6 / F7
|
||||
Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
|
||||
@*
|
||||
Aller au tampon pr@'ec@'edent@*
|
||||
@*
|
||||
@item F8
|
||||
Aller @`a la fen@^etre suivante@*
|
||||
@*
|
||||
@item F10
|
||||
Effacer le dernier message de la barre d'infos@*
|
||||
@*
|
||||
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
|
||||
Identique @`a F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
|
||||
@*
|
||||
@item Alt + D
|
||||
Afficher les DCC en cours@*
|
||||
@*
|
||||
@item Alt + R
|
||||
Vide la hotlist (notification d'activité sur les autres tampons)@*
|
||||
@*
|
||||
@item Alt + chiffre (1-9)
|
||||
Sauter au tampon avec ce num@'ero@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node Commandes WeeChat, , Raccourcis clavier, Utilisation
|
||||
@@ -345,6 +693,39 @@ Affiche un message dans la fen@^etre courante (canal ou serveur).@*
|
||||
@code{IRC::print ("message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_with_channel ( canal, [serveur,] message );}@*
|
||||
@*
|
||||
Affiche un message dans un canal.@*
|
||||
|
||||
@emph{Param@`etres :}
|
||||
@itemize @minus
|
||||
@item @option{canal}: nom du canal
|
||||
@item @option{serveur}: nom interne du serveur
|
||||
@item @option{message}: message @`a afficher
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemples :}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_infobar ( d@'elai, message );}@*
|
||||
@*
|
||||
Affiche un message dans la barre d'infos.@*
|
||||
|
||||
@emph{Param@`etres :}
|
||||
@itemize @minus
|
||||
@item @option{d@'elai}: d@'elai (en secondes) pendant lequel le message est affich@'e
|
||||
(si 0, le message ne sera pas effac@'e).
|
||||
@item @option{message}: message @`a afficher
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemple :}@*
|
||||
@code{IRC::print_infobar (5, "message");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::add_message_handler ( nom, fonction );}@*
|
||||
@*
|
||||
@@ -365,7 +746,8 @@ RFC 2812 : @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
|
||||
@code{IRC::add_message_handler ("privmsg", ma_fonction);}@*
|
||||
@code{sub ma_fonction}@*
|
||||
@code{@{ }@*
|
||||
@code{@ @ @ @ ($null, $canal, $message) = split ":",@@_[0],3;}@*
|
||||
@code{@ @ @ @ IRC::print ("serveur=$_[0]\n");}@*
|
||||
@code{@ @ @ @ ($null, $canal, $message) = split ":",$_[1],3;}@*
|
||||
@code{@ @ @ @ ($masque, $null, $canal) = split " ", $canal;}@*
|
||||
@code{@ @ @ @ IRC::print ("masque=$masque, canal=$canal, message=$message\n");}@*
|
||||
@code{@} }@*
|
||||
@@ -390,11 +772,35 @@ ne seront plus accessibles tant que le script Perl sera charg@'e.
|
||||
@code{IRC::add_command_handler ("commande", ma_commande);}@*
|
||||
@code{sub ma_commande}@*
|
||||
@code{@{ }@*
|
||||
@code{@ @ @ @ IRC::print("Param@`etres : ".@@_[0]);}@*
|
||||
@code{@ @ @ @ IRC::print("Serveur: $_[0], param@`etres: $_[1]\n");}@*
|
||||
@code{@ @ @ @ return 0;}@*
|
||||
@code{@} }@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::get_info ( [serveur,] nom );}@*
|
||||
@*
|
||||
Obtenir des informations vari@'ees sur WeeChat, le serveur ou l'utilisateur.@*
|
||||
|
||||
@emph{Param@`etres :}
|
||||
@itemize @minus
|
||||
@item @option{serveur}: nom interne du serveur
|
||||
@item @option{nom}: nom de l'info @`a obtenir :
|
||||
@itemize @minus
|
||||
@item @option{0 ou version}: obtenir la version de WeeChat
|
||||
@item @option{1 ou nick}: obtenir le pseudo
|
||||
@item @option{2 ou channel}: obtenir le nom du canal
|
||||
@item @option{3 ou server}: obtenir le nom du serveur
|
||||
@item @option{4 ou weechatdir}: obtenir le r@'epertoire maison de WeeChat
|
||||
@item @option{5 ou away}: obtenir le drapeau "away" du serveur
|
||||
@end itemize
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemples :}@*
|
||||
@code{$version = get_info("version");}@*
|
||||
@code{$nick = get_info("freenode", "nick");}@*
|
||||
@*
|
||||
|
||||
@end itemize
|
||||
|
||||
@node Scripts Python, Scripts Ruby, Scripts Perl, Extensions
|
||||
@@ -466,7 +872,7 @@ Support par IRC:@*
|
||||
- serveur : @b{irc.freenode.net}@*
|
||||
- canal : @b{#weechat}@*@*
|
||||
@item
|
||||
Forum WeeChat : bient@^ot !@*@*
|
||||
Forum WeeChat : @uref{http://forums.flashtux.org}@*@*
|
||||
@item
|
||||
Support par la liste de diffusion :@*
|
||||
- pour souscrire/d@'esinscrire :@*@uref{http://mail.nongnu.org/mailman/listinfo/weechat-support}.@*
|
||||
@@ -486,7 +892,7 @@ Voir la page support WeeChat pour plus de d@'etails :@*
|
||||
|
||||
Ce manuel documente le client IRC WeeChat, il fait partie de WeeChat.@*
|
||||
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
Ce document peut @^etre utilis@'e sous les termes de la licence GNU General Public
|
||||
|
||||
@@ -6,14 +6,21 @@
|
||||
|
||||
@c WeeChat documentation (vers@~ao partuguesa)
|
||||
@c
|
||||
@c Copyright (c) 2003 by FlashCode <flashcode@flashtux.org>
|
||||
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
@c
|
||||
@c Permission is granted to copy, distribute and/or modify this document
|
||||
@c under the terms of the GNU Free Documentation License, Version 1.2
|
||||
@c or any later version published by the Free Software Foundation;
|
||||
@c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
@c A copy of the license is included in the section entitled "GNU
|
||||
@c Free Documentation License".
|
||||
@c This manual is free software; you can redistribute it and/or modify
|
||||
@c it under the terms of the GNU General Public License as published by
|
||||
@c the Free Software Foundation; either version 2 of the License, or
|
||||
@c (at your option) any later version.
|
||||
@c
|
||||
@c This manual is distributed in the hope that it will be useful,
|
||||
@c but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
@c GNU General Public License for more details.
|
||||
@c
|
||||
@c You should have received a copy of the GNU General Public License
|
||||
@c along with this program; if not, write to the Free Software
|
||||
@c Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
@c pdf : texi2pdf weechat_doc_pt.texi
|
||||
@c html: makeinfo --html --no-split --number-sections weechat_doc_pt.texi
|
||||
@@ -28,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Guia do Utilizador
|
||||
@subtitle Cliente de IRC rapido, leve e extencivel
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.3 - 23 de Novembro de 2003
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.7 - 27 de Agosto de 2004
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -41,7 +48,7 @@ Este manual documenta o cliente de IRC WeeChat, ele faz parte do WeeChat.@*
|
||||
A ultima versĂŁo deste documento pode ser descarregada de :@*
|
||||
@uref{http://weechat.flashtux.org/doc.php}@*
|
||||
@*
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
@*
|
||||
Este documento pode ser utilizado sobre os termos da Licen@,{c}a P@'ublica geral GNU (GNU General Public
|
||||
@@ -147,7 +154,7 @@ Mandrake/Redhat (ou outra distro compat@'ivel com RPMs)@*
|
||||
Instala@,{c}@~ao : @kbd{rpm -i /chemin/weechat-x.y.z-1.i386.rpm}
|
||||
@item
|
||||
Gentoo@*
|
||||
Instala@,{c}@~ao : ver a documenta@,{c}@~ao da Gentoo
|
||||
Instala@,{c}@~ao : @kbd{emerge weechat}
|
||||
@item
|
||||
*BSD (non disponible !)
|
||||
@item
|
||||
@@ -169,7 +176,7 @@ Nota: Para compilar certas interfaces, podes passar par@^ametros
|
||||
ao ./configure, escreve @kbd{./configure --help} para veres as op@,{c}@~oes.@*
|
||||
|
||||
Obter os direitos do root e instalar o Weechat :@*
|
||||
@kbd{su -}@*
|
||||
@kbd{su}@*
|
||||
(escreve aqui a palavra-passe do superutilizador)@*
|
||||
@kbd{make install}@*
|
||||
|
||||
@@ -207,6 +214,8 @@ Segue agora as instru@,{c}@~oes para compilar o c@'odigo fonte - @xref{Codigo Fo
|
||||
@subsection Par@^ametros de linha de comandos
|
||||
|
||||
@table @code
|
||||
@item -c, --config
|
||||
Mostrar da lima dos config da exposi@,{c}@~ao (lista das op@,{c}@~oes)
|
||||
@item -h, --help
|
||||
Mostrar a ajuda@*
|
||||
@item -l, --license
|
||||
@@ -218,7 +227,7 @@ Mostrar a vers@~ao do WeeChat@*
|
||||
@subsection Invocar o WeeChat
|
||||
|
||||
Escreve simplesmente este comando para invoceres o WeeChat :@*
|
||||
@kbd{weechat-curses}@*
|
||||
@kbd{weechat-curses} (para a interface em Curses)@*
|
||||
ou @kbd{weechat-gtk} (para a interface em Gtk)@*
|
||||
ou @kbd{weechat-qt} (para a interface em Qt)@*
|
||||
|
||||
@@ -268,6 +277,15 @@ Ir para a janela anterior/seguinte@*
|
||||
@item Alt + Seta da esquerda / Alt + Seta da direita
|
||||
Identico a F6 / F7@*
|
||||
@*
|
||||
@item Alt + A
|
||||
Comute ao amortecedor seguinte com atividade (com prioridade: destaque, mensagem, outra)@*
|
||||
@*
|
||||
@item Alt + d@'igito (1-9)
|
||||
Comute ao amortecedor pelo n@'umero@*
|
||||
@*
|
||||
@item F10
|
||||
Apagar a @'ultima mensagem da barra do info@*
|
||||
@*
|
||||
@end table
|
||||
|
||||
@node Comandos do WeeChat, , Recursos de teclado, Utilizacao
|
||||
@@ -340,6 +358,39 @@ Imprimne uma mensagem na janela actual (canal ou servidor).@*
|
||||
@code{IRC::print ("mensagem");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_with_channel ( canal, [servidor,] mensagem );}@*
|
||||
@*
|
||||
Imprimne uma mensagem na canal.@*
|
||||
|
||||
@emph{Argumentos:}
|
||||
@itemize @minus
|
||||
@item @option{canal}: nome da canal
|
||||
@item @option{servidor}: nome interno da servidor
|
||||
@item @option{mensagem}: mensagem a mostrar
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemplos:}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "freenode", "mensagem");}@*
|
||||
@code{IRC::print_with_channel ("#weechat", "mensagem");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::print_infobar ( atrasa, mensagem );}@*
|
||||
@*
|
||||
Imprimne uma mensagem na barra do info.@*
|
||||
|
||||
@emph{Argumentos:}
|
||||
@itemize @minus
|
||||
@item @option{atrasa}: depois que isto atrasa (nos segundos), a mensagem estar@'a apagada
|
||||
(se 0, mensagem n@~ao forem apagados).
|
||||
@item @option{mensagem}: mensagem a mostrar
|
||||
@end itemize
|
||||
@*
|
||||
@emph{Exemplo:}@*
|
||||
@code{IRC::print_infobar (5, "mensagem");}@*
|
||||
@*
|
||||
|
||||
@item
|
||||
@command{IRC::add_message_handler ( nome, fun@,{c}@~ao );}@*
|
||||
@*
|
||||
@@ -457,7 +508,7 @@ Suporte por IRC:@*
|
||||
- servidor : @b{irc.freenode.net}@*
|
||||
- canal : @b{#weechat}@*@*
|
||||
@item
|
||||
Forum do WeeChat : mais tarde !@*@*
|
||||
Forum do WeeChat : @uref{http://forums.flashtux.org}@*@*
|
||||
@item
|
||||
Suporte por lista de correio-e :@*
|
||||
- para te inscreveres/desinscreveres :@*@uref{http://mail.nongnu.org/mailman/listinfo/weechat-support}.@*
|
||||
@@ -477,7 +528,7 @@ Para mais detalhes, v@^e tamb@'em a p@'agina de suporte do WeeChat :@*
|
||||
|
||||
Este manual documenta o cliente de IRC WeeChat, Ele faz parte do WeeChat.@*
|
||||
|
||||
Copyright @copyright{} 2003 FlashCode
|
||||
Copyright @copyright{} 2004 FlashCode
|
||||
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
|
||||
Tradu@,{c}@~ao portuguesa de Jo@~ao Jer@'onimo <@email{j_j_b_o@@sapo.pt, j_j_b_o AT sapo.pt}>@*
|
||||
@*
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
./src/irc/irc-display.c
|
||||
./src/irc/irc-send.c
|
||||
./src/irc/irc-recv.c
|
||||
./src/irc/irc-dcc.c
|
||||
./src/plugins/perl/wee-perl.c
|
||||
./src/plugins/perl/wee-perl.h
|
||||
./src/plugins/plugins.c
|
||||
@@ -23,6 +24,7 @@
|
||||
./src/common/command.h
|
||||
./src/common/completion.h
|
||||
./src/common/history.h
|
||||
./src/common/log.c
|
||||
./src/common/weechat.h
|
||||
./src/common/weeconfig.c
|
||||
./src/common/weeconfig.h
|
||||
|
||||
+1220
-696
File diff suppressed because it is too large
Load Diff
+1289
-814
File diff suppressed because it is too large
Load Diff
@@ -28,4 +28,8 @@ lib_weechat_main_a_SOURCES = weechat.c \
|
||||
weeconfig.c \
|
||||
weeconfig.h \
|
||||
history.c \
|
||||
history.h
|
||||
history.h \
|
||||
hotlist.c \
|
||||
hotlist.h \
|
||||
log.c \
|
||||
log.h
|
||||
|
||||
+407
-101
@@ -43,6 +43,14 @@ t_weechat_command weechat_commands[] =
|
||||
N_("alias_name: name of alias\ncommand: command name (WeeChat "
|
||||
"or IRC command, without first '/')\n" "arguments: arguments for command"),
|
||||
0, MAX_ARGS, NULL, weechat_cmd_alias },
|
||||
{ "buffer", N_("manage buffers"),
|
||||
N_("[action | number]"),
|
||||
N_("action: action to do:\n"
|
||||
" move move buffer in the list (may be relative, for example -1)\n"
|
||||
" list list opened buffers (no parameter implies this list)\n"
|
||||
" notify set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
|
||||
"number: jump to buffer by number"),
|
||||
0, MAX_ARGS, weechat_cmd_buffer, NULL },
|
||||
{ "clear", N_("clear window(s)"),
|
||||
N_("[-all]"),
|
||||
N_("-all: clear all windows"),
|
||||
@@ -59,7 +67,7 @@ t_weechat_command weechat_commands[] =
|
||||
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
|
||||
0, 1, weechat_cmd_help, NULL },
|
||||
{ "perl", N_("list/load/unload Perl scripts"),
|
||||
N_("[load filename] | [unload]"),
|
||||
N_("[load filename] | [autoload] | [unload]"),
|
||||
N_("filename: Perl script (file) to load\n"
|
||||
"Without argument, /perl command lists all loaded Perl scripts."),
|
||||
0, 2, weechat_cmd_perl, NULL },
|
||||
@@ -77,17 +85,25 @@ t_weechat_command weechat_commands[] =
|
||||
"nick2: alternate nick for server\n"
|
||||
"nick3: second alternate nick for server\n"
|
||||
"username: user name\n"
|
||||
"realname: real name of user\n"),
|
||||
"realname: real name of user"),
|
||||
0, MAX_ARGS, weechat_cmd_server, NULL },
|
||||
{ "save", N_("save config to disk"),
|
||||
N_("[file]"), N_("file: filename for writing config"),
|
||||
0, 1, weechat_cmd_save, NULL },
|
||||
{ "set", N_("set config parameters"),
|
||||
N_("[option [value]]"), N_("option: name of an option\nvalue: value for option"),
|
||||
0, 2, weechat_cmd_set, NULL },
|
||||
0, MAX_ARGS, NULL, weechat_cmd_set },
|
||||
{ "unalias", N_("remove an alias"),
|
||||
N_("alias_name"), N_("alias_name: name of alias to remove"),
|
||||
1, 1, NULL, weechat_cmd_unalias },
|
||||
{ "window", N_("manage windows"),
|
||||
N_("[action]"),
|
||||
N_("action: action to do:\n"
|
||||
" close close current window (under development!)\n"
|
||||
" list list opened windows (no parameter implies this list)\n"
|
||||
" splith split current window horizontally\n"
|
||||
" splitv split current window vertically"),
|
||||
0, MAX_ARGS, weechat_cmd_window, NULL },
|
||||
{ NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -207,14 +223,14 @@ index_command_build ()
|
||||
i = 0;
|
||||
while (weechat_commands[i].command_name)
|
||||
{
|
||||
index_command_new (weechat_commands[i].command_name);
|
||||
(void) index_command_new (weechat_commands[i].command_name);
|
||||
i++;
|
||||
}
|
||||
i = 0;
|
||||
while (irc_commands[i].command_name)
|
||||
{
|
||||
if (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
|
||||
index_command_new (irc_commands[i].command_name);
|
||||
(void) index_command_new (irc_commands[i].command_name);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -363,8 +379,11 @@ alias_new (char *alias_name, char *alias_command)
|
||||
{
|
||||
new_alias->alias_name = strdup (alias_name);
|
||||
new_alias->alias_command = (char *)malloc (strlen (alias_command) + 2);
|
||||
new_alias->alias_command[0] = '/';
|
||||
strcpy (new_alias->alias_command + 1, alias_command);
|
||||
if (new_alias->alias_command)
|
||||
{
|
||||
new_alias->alias_command[0] = '/';
|
||||
strcpy (new_alias->alias_command + 1, alias_command);
|
||||
}
|
||||
alias_insert_sorted (new_alias);
|
||||
return new_alias;
|
||||
}
|
||||
@@ -409,7 +428,7 @@ alias_free (t_weechat_alias *alias)
|
||||
*/
|
||||
|
||||
char **
|
||||
explode_string (char *string, char *separators, int num_items_max,
|
||||
explode_string (/*@null@*/ char *string, char *separators, int num_items_max,
|
||||
int *num_items)
|
||||
{
|
||||
int i, n_items;
|
||||
@@ -502,7 +521,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
char *command, *pos, *ptr_args, **argv, *alias_command;
|
||||
t_weechat_alias *ptr_alias;
|
||||
|
||||
if ((!string[0]) || (string[0] != '/'))
|
||||
if ((!string) || (!string[0]) || (string[0] != '/'))
|
||||
return 0;
|
||||
|
||||
command = strdup (string);
|
||||
@@ -521,7 +540,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
ptr_args = NULL;
|
||||
}
|
||||
|
||||
if (!plugin_exec_command (command + 1, ptr_args))
|
||||
if (!plugin_exec_command (command + 1, (server) ? server->name : "", ptr_args))
|
||||
{
|
||||
argv = explode_string (ptr_args, " ", 0, &argc);
|
||||
|
||||
@@ -572,6 +591,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
free (argv[j]);
|
||||
free (argv);
|
||||
}
|
||||
free (command);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -630,6 +650,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
free (argv[j]);
|
||||
free (argv);
|
||||
}
|
||||
free (command);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -643,14 +664,18 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
length1 = strlen (ptr_alias->alias_command);
|
||||
length2 = strlen (ptr_args);
|
||||
alias_command = (char *)malloc (length1 + 1 + length2 + 1);
|
||||
strcpy (alias_command, ptr_alias->alias_command);
|
||||
alias_command[length1] = ' ';
|
||||
strcpy (alias_command + length1 + 1, ptr_args);
|
||||
exec_weechat_command (server, alias_command);
|
||||
free (alias_command);
|
||||
if (alias_command)
|
||||
{
|
||||
strcpy (alias_command, ptr_alias->alias_command);
|
||||
alias_command[length1] = ' ';
|
||||
strcpy (alias_command + length1 + 1, ptr_args);
|
||||
}
|
||||
(void) exec_weechat_command (server, alias_command);
|
||||
if (alias_command)
|
||||
free (alias_command);
|
||||
}
|
||||
else
|
||||
exec_weechat_command (server, ptr_alias->alias_command);
|
||||
(void) exec_weechat_command (server, ptr_alias->alias_command);
|
||||
|
||||
if (argv)
|
||||
{
|
||||
@@ -658,6 +683,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
free (argv[j]);
|
||||
free (argv);
|
||||
}
|
||||
free (command);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -672,6 +698,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
free (argv);
|
||||
}
|
||||
}
|
||||
free (command);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -690,52 +717,52 @@ user_command (t_irc_server *server, char *command)
|
||||
if ((command[0] == '/') && (command[1] != '/'))
|
||||
{
|
||||
/* WeeChat internal command (or IRC command) */
|
||||
exec_weechat_command (server, command);
|
||||
(void) exec_weechat_command (server, command);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((command[0] == '/') && (command[1] == '/'))
|
||||
command++;
|
||||
if (server && (!WIN_IS_SERVER(gui_current_window)))
|
||||
if (server && (!BUFFER_IS_SERVER(gui_current_window->buffer)))
|
||||
{
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n",
|
||||
CHANNEL(gui_current_window)->name,
|
||||
CHANNEL(gui_current_window->buffer)->name,
|
||||
command);
|
||||
|
||||
if (WIN_IS_PRIVATE(gui_current_window))
|
||||
if (BUFFER_IS_PRIVATE(gui_current_window->buffer))
|
||||
{
|
||||
gui_printf_color_type (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color_type (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "<");
|
||||
gui_printf_color_type (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color_type (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_NICK_SELF,
|
||||
"%s", server->nick);
|
||||
gui_printf_color_type (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color_type (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "> ");
|
||||
gui_printf_color_type (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color_type (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
MSG_TYPE_MSG,
|
||||
COLOR_WIN_CHAT, "%s\n", command);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_nick = nick_search (CHANNEL(gui_current_window), server->nick);
|
||||
ptr_nick = nick_search (CHANNEL(gui_current_window->buffer), server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (CHANNEL(gui_current_window)->window, ptr_nick,
|
||||
irc_display_nick (CHANNEL(gui_current_window->buffer)->buffer, ptr_nick,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
gui_printf_color (CHANNEL(gui_current_window)->window,
|
||||
gui_printf_color (CHANNEL(gui_current_window->buffer)->buffer,
|
||||
COLOR_WIN_CHAT, "%s\n", command);
|
||||
}
|
||||
else
|
||||
gui_printf (server->window,
|
||||
gui_printf (server->buffer,
|
||||
_("%s cannot find nick for sending message\n"),
|
||||
WEECHAT_ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
gui_printf ((server) ? server->window : NULL,
|
||||
gui_printf ((server) ? server->buffer : NULL,
|
||||
_("This window is not a channel!\n"));
|
||||
}
|
||||
}
|
||||
@@ -768,7 +795,7 @@ weechat_cmd_alias (char *arguments)
|
||||
}
|
||||
if (!alias_new (arguments, pos))
|
||||
return -1;
|
||||
index_command_new (arguments);
|
||||
(void) index_command_new (arguments);
|
||||
gui_printf (NULL, _("Alias \"%s\" => \"%s\" created\n"),
|
||||
arguments, pos);
|
||||
}
|
||||
@@ -799,6 +826,174 @@ weechat_cmd_alias (char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_buffer: manage buffers
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_buffer (int argc, char **argv)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
long number;
|
||||
char *error;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened buffers */
|
||||
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf (NULL, _("Opened buffers:\n"));
|
||||
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "[");
|
||||
gui_printf (NULL, "%d", ptr_buffer->number);
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "] ");
|
||||
|
||||
if (ptr_buffer->dcc)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "DCC\n");
|
||||
else if (BUFFER_IS_SERVER (ptr_buffer))
|
||||
{
|
||||
gui_printf (NULL, _("Server: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s\n", SERVER(ptr_buffer)->name);
|
||||
}
|
||||
else if (BUFFER_IS_CHANNEL (ptr_buffer))
|
||||
{
|
||||
gui_printf (NULL, _("Channel: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s", CHANNEL(ptr_buffer)->name);
|
||||
gui_printf (NULL, _(" (server: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s", SERVER(ptr_buffer)->name);
|
||||
gui_printf (NULL, ")\n");
|
||||
}
|
||||
else if (BUFFER_IS_PRIVATE (ptr_buffer))
|
||||
{
|
||||
gui_printf (NULL, _("Private with: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_NICK,
|
||||
"%s", CHANNEL(ptr_buffer)->name);
|
||||
gui_printf (NULL, _(" (server: "));
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
|
||||
"%s", SERVER(ptr_buffer)->name);
|
||||
gui_printf (NULL, ")\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "move") == 0)
|
||||
{
|
||||
/* move buffer to another number in the list */
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "buffer");
|
||||
return -1;
|
||||
}
|
||||
|
||||
error = NULL;
|
||||
number = strtol (((argv[1][0] == '+') || (argv[1][0] == '-')) ? argv[1] + 1 : argv[1],
|
||||
&error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
if (argv[1][0] == '+')
|
||||
gui_move_buffer_to_number (gui_current_window,
|
||||
gui_current_window->buffer->number + ((int) number));
|
||||
else if (argv[1][0] == '-')
|
||||
gui_move_buffer_to_number (gui_current_window,
|
||||
gui_current_window->buffer->number - ((int) number));
|
||||
else
|
||||
gui_move_buffer_to_number (gui_current_window, (int) number);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
gui_printf (NULL, _("%s incorrect buffer number\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp (argv[0], "notify") == 0)
|
||||
{
|
||||
/* set notify level for buffer */
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
/* display notify level for all buffers */
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf (NULL, _("Notify levels: "));
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
gui_printf (NULL, "%d.%s:",
|
||||
ptr_buffer->number,
|
||||
(ptr_buffer->dcc) ? "DCC" :
|
||||
((BUFFER_IS_SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
|
||||
CHANNEL(ptr_buffer)->name));
|
||||
if (ptr_buffer->dcc)
|
||||
gui_printf (NULL, "-");
|
||||
else
|
||||
gui_printf (NULL, "%d", ptr_buffer->notify_level);
|
||||
if (ptr_buffer->next_buffer)
|
||||
gui_printf (NULL, " ");
|
||||
}
|
||||
gui_printf (NULL, "\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
error = NULL;
|
||||
number = strtol (argv[1], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
if ((number < 0) || (number > 3))
|
||||
{
|
||||
/* invalid highlight level */
|
||||
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
gui_current_window->buffer->notify_level = number;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* jump to buffer by number */
|
||||
|
||||
error = NULL;
|
||||
number = strtol (argv[0], &error, 10);
|
||||
if ((error) && (error[0] == '\0'))
|
||||
{
|
||||
if (!gui_switch_to_buffer_by_number (gui_current_window, (int) number))
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s buffer \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, argv[0], "buffer");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* invalid number */
|
||||
gui_printf (NULL, _("%s incorrect buffer number\n"),
|
||||
WEECHAT_ERROR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_clear: display or create alias
|
||||
*/
|
||||
@@ -809,7 +1004,7 @@ weechat_cmd_clear (int argc, char **argv)
|
||||
if (argc == 1)
|
||||
{
|
||||
if (strcmp (argv[0], "-all") == 0)
|
||||
gui_window_clear_all ();
|
||||
gui_buffer_clear_all ();
|
||||
else
|
||||
{
|
||||
gui_printf (NULL,
|
||||
@@ -819,7 +1014,7 @@ weechat_cmd_clear (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
else
|
||||
gui_window_clear (gui_current_window);
|
||||
gui_buffer_clear (gui_current_window->buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -846,8 +1041,11 @@ weechat_cmd_connect (int argc, char **argv)
|
||||
WEECHAT_ERROR, argv[0]);
|
||||
return -1;
|
||||
}
|
||||
if (!ptr_server->window)
|
||||
gui_window_new (ptr_server, NULL, 1);
|
||||
if (!ptr_server->buffer)
|
||||
{
|
||||
if (!gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1))
|
||||
return -1;
|
||||
}
|
||||
if (server_connect (ptr_server))
|
||||
{
|
||||
irc_login (ptr_server);
|
||||
@@ -892,7 +1090,7 @@ weechat_cmd_disconnect (int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
server_disconnect (ptr_server);
|
||||
gui_redraw_window_status (gui_current_window);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -990,7 +1188,7 @@ weechat_cmd_perl (int argc, char **argv)
|
||||
#ifdef PLUGINS
|
||||
t_plugin_script *ptr_plugin_script;
|
||||
t_plugin_handler *ptr_plugin_handler;
|
||||
int handler_found;
|
||||
int handler_found, path_length;
|
||||
char *path_script;
|
||||
|
||||
#ifdef PLUGIN_PERL
|
||||
@@ -1065,6 +1263,8 @@ weechat_cmd_perl (int argc, char **argv)
|
||||
|
||||
break;
|
||||
case 1:
|
||||
if (strcmp (argv[0], "autoload") == 0)
|
||||
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
|
||||
if (strcmp (argv[0], "unload") == 0)
|
||||
{
|
||||
/* unload all Perl scripts */
|
||||
@@ -1081,10 +1281,11 @@ weechat_cmd_perl (int argc, char **argv)
|
||||
path_script = NULL;
|
||||
else
|
||||
{
|
||||
path_script = (char *) malloc ((strlen (weechat_home) +
|
||||
strlen (argv[1]) + 7) * sizeof (char));
|
||||
sprintf (path_script, "%s%s%s%s%s", weechat_home,
|
||||
DIR_SEPARATOR, "perl", DIR_SEPARATOR, argv[1]);
|
||||
path_length = strlen (weechat_home) + strlen (argv[1]) + 7;
|
||||
path_script = (char *) malloc (path_length * sizeof (char));
|
||||
snprintf (path_script, path_length, "%s%s%s%s%s",
|
||||
weechat_home, DIR_SEPARATOR, "perl",
|
||||
DIR_SEPARATOR, argv[1]);
|
||||
}
|
||||
plugin_load (PLUGIN_TYPE_PERL,
|
||||
(path_script) ? path_script : argv[1]);
|
||||
@@ -1167,8 +1368,11 @@ weechat_cmd_server (int argc, char **argv)
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf_color (NULL,
|
||||
COLOR_WIN_CHAT,
|
||||
_(" Autoconnect: %s\n"),
|
||||
(ptr_server->autoconnect) ? _("yes") : _("no"));
|
||||
_(" Autoconnect: %s%s\n"),
|
||||
(ptr_server->autoconnect) ? _("yes") : _("no"),
|
||||
(ptr_server->command_line) ?
|
||||
_(" (temporary server, will not be saved)") :
|
||||
"");
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
gui_printf_color (NULL,
|
||||
COLOR_WIN_CHAT,
|
||||
@@ -1282,7 +1486,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
gui_printf_color (NULL, COLOR_WIN_CHAT, _("has been deleted\n"));
|
||||
|
||||
server_free (server_found);
|
||||
gui_redraw_window (gui_current_window);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1399,11 +1603,11 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
|
||||
/* create new server */
|
||||
new_server = server_new (server.name, server.autoconnect, server.address,
|
||||
server.port, server.password, server.nick1,
|
||||
server.nick2, server.nick3, server.username,
|
||||
server.realname, server.command,
|
||||
server.autojoin);
|
||||
new_server = server_new (server.name, server.autoconnect, 0,
|
||||
server.address, server.port, server.password,
|
||||
server.nick1, server.nick2, server.nick3,
|
||||
server.username, server.realname,
|
||||
server.command, server.autojoin, 1);
|
||||
if (new_server)
|
||||
{
|
||||
irc_display_prefix (NULL, PREFIX_INFO);
|
||||
@@ -1423,7 +1627,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
|
||||
if (new_server->autoconnect)
|
||||
{
|
||||
gui_window_new (new_server, NULL, 1);
|
||||
(void) gui_buffer_new (gui_current_window, new_server, NULL, 0, 1);
|
||||
if (server_connect (new_server))
|
||||
irc_login (new_server);
|
||||
}
|
||||
@@ -1438,72 +1642,140 @@ weechat_cmd_server (int argc, char **argv)
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_set (int argc, char **argv)
|
||||
weechat_cmd_set (char *arguments)
|
||||
{
|
||||
char *option, *value;
|
||||
int i, j, section_displayed;
|
||||
char *color_name;
|
||||
t_config_option *ptr_option;
|
||||
int number_found;
|
||||
|
||||
/* TODO: complete /set command */
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
option = NULL;
|
||||
value = NULL;
|
||||
if (arguments && arguments[0])
|
||||
{
|
||||
section_displayed = 0;
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
option = arguments;
|
||||
value = strchr (option, ' ');
|
||||
if (value)
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
value[0] = '\0';
|
||||
value++;
|
||||
while (value[0] == ' ')
|
||||
value++;
|
||||
}
|
||||
}
|
||||
|
||||
if (value && value[0])
|
||||
{
|
||||
ptr_option = config_option_search (option);
|
||||
if (ptr_option)
|
||||
{
|
||||
if (ptr_option->handler_change == NULL)
|
||||
{
|
||||
if ((argc == 0) ||
|
||||
((argc > 0)
|
||||
&& (strstr (weechat_options[i][j].option_name, argv[0])
|
||||
!= NULL)))
|
||||
gui_printf (NULL,
|
||||
_("%s option \"%s\" can not be changed while WeeChat is running\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (config_option_set_value (ptr_option, value) == 0)
|
||||
{
|
||||
if (!section_displayed)
|
||||
(void) (ptr_option->handler_change());
|
||||
gui_printf (NULL, "[%s]\n", config_get_section (ptr_option));
|
||||
gui_printf (NULL, " %s = %s\n", option, value);
|
||||
}
|
||||
else
|
||||
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (NULL, _("%s config option \"%s\" not found\n"),
|
||||
WEECHAT_ERROR, option);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
number_found = 0;
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
section_displayed = 0;
|
||||
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
|
||||
{
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
if ((!option) ||
|
||||
((option) && (option[0])
|
||||
&& (strstr (weechat_options[i][j].option_name, option)
|
||||
!= NULL)))
|
||||
{
|
||||
gui_printf (NULL, "[%s]\n",
|
||||
config_sections[i].section_name);
|
||||
section_displayed = 1;
|
||||
}
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
gui_printf (NULL, " %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(*weechat_options[i][j].ptr_int) ?
|
||||
"ON" : "OFF");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
gui_printf (NULL,
|
||||
" %s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
*weechat_options[i][j].ptr_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
gui_printf (NULL,
|
||||
" %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int]);
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
color_name = gui_get_color_by_value (*weechat_options[i][j].ptr_int);
|
||||
gui_printf (NULL,
|
||||
" %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(color_name) ? color_name : _("(unknown)"));
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
gui_printf (NULL, " %s = %s\n",
|
||||
weechat_options[i][j].
|
||||
option_name,
|
||||
(*weechat_options[i][j].
|
||||
ptr_string) ?
|
||||
*weechat_options[i][j].
|
||||
ptr_string : "");
|
||||
break;
|
||||
if (!section_displayed)
|
||||
{
|
||||
gui_printf (NULL, "[%s]\n",
|
||||
config_sections[i].section_name);
|
||||
section_displayed = 1;
|
||||
}
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
gui_printf (NULL, " %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(*weechat_options[i][j].ptr_int) ?
|
||||
"ON" : "OFF");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
gui_printf (NULL,
|
||||
" %s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
*weechat_options[i][j].ptr_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
gui_printf (NULL,
|
||||
" %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int]);
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
color_name = gui_get_color_by_value (*weechat_options[i][j].ptr_int);
|
||||
gui_printf (NULL,
|
||||
" %s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(color_name) ? color_name : _("(unknown)"));
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
gui_printf (NULL, " %s = %s\n",
|
||||
weechat_options[i][j].
|
||||
option_name,
|
||||
(*weechat_options[i][j].
|
||||
ptr_string) ?
|
||||
*weechat_options[i][j].
|
||||
ptr_string : "");
|
||||
break;
|
||||
}
|
||||
number_found++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (number_found == 0)
|
||||
{
|
||||
if (value)
|
||||
gui_printf (NULL, _("No config option found with \"%s\"\n"),
|
||||
value);
|
||||
else
|
||||
gui_printf (NULL, _("No config option found with \"%s\"\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value)
|
||||
gui_printf (NULL, _("%d config option(s) found with \"%s\"\n"),
|
||||
number_found, value);
|
||||
else
|
||||
gui_printf (NULL, _("%d config option(s) found\n"),
|
||||
number_found);
|
||||
}
|
||||
}
|
||||
gui_printf (NULL, "(TODO) \"/set\" command not fully developed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1533,3 +1805,37 @@ weechat_cmd_unalias (char *arguments)
|
||||
arguments);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_cmd_window: manage windows
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_cmd_window (int argc, char **argv)
|
||||
{
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened windows */
|
||||
gui_printf (NULL, "window list -- NOT DEVELOPED!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "splith") == 0)
|
||||
{
|
||||
/* split window horizontally */
|
||||
gui_window_split_horiz (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "splitv") == 0)
|
||||
{
|
||||
/* split window vertically */
|
||||
gui_window_split_vertic (gui_current_window);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s unknown option for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, "window");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ extern t_weechat_alias *alias_new (char *, char *);
|
||||
extern int exec_weechat_command (t_irc_server *, char *);
|
||||
extern void user_command (t_irc_server *, char *);
|
||||
extern int weechat_cmd_alias (char *);
|
||||
extern int weechat_cmd_buffer (int, char **);
|
||||
extern int weechat_cmd_clear (int, char **);
|
||||
extern int weechat_cmd_connect (int, char **);
|
||||
extern int weechat_cmd_disconnect (int, char **);
|
||||
@@ -74,7 +75,8 @@ extern int weechat_cmd_help (int, char **);
|
||||
extern int weechat_cmd_perl (int, char **);
|
||||
extern int weechat_cmd_save (int, char **);
|
||||
extern int weechat_cmd_server (int, char **);
|
||||
extern int weechat_cmd_set (int, char **);
|
||||
extern int weechat_cmd_set (char *);
|
||||
extern int weechat_cmd_unalias (char *);
|
||||
extern int weechat_cmd_window (int, char **);
|
||||
|
||||
#endif /* command.h */
|
||||
|
||||
@@ -29,39 +29,110 @@
|
||||
|
||||
#include "weechat.h"
|
||||
#include "history.h"
|
||||
#include "weeconfig.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
t_history *history_general = NULL;
|
||||
t_history *history_general_last = NULL;
|
||||
t_history *history_general_ptr = NULL;
|
||||
int num_history_general = 0;
|
||||
|
||||
|
||||
/*
|
||||
* history_hide_password: hide a nickserv password
|
||||
*/
|
||||
|
||||
void
|
||||
history_hide_password (char *string)
|
||||
{
|
||||
char *pos_pwd;
|
||||
|
||||
if (strstr (string, "nickserv "))
|
||||
{
|
||||
pos_pwd = strstr (string, "identify ");
|
||||
if (!pos_pwd)
|
||||
pos_pwd = strstr (string, "register ");
|
||||
if (pos_pwd)
|
||||
{
|
||||
pos_pwd += 9;
|
||||
while (pos_pwd[0])
|
||||
{
|
||||
pos_pwd[0] = '*';
|
||||
pos_pwd++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* history_add: add a text/command to history
|
||||
*/
|
||||
|
||||
void
|
||||
history_add (void *window, char *string)
|
||||
history_add (void *buffer, char *string)
|
||||
{
|
||||
t_history *new_history;
|
||||
t_history *new_history, *ptr_history;
|
||||
|
||||
/* add history to general history */
|
||||
new_history = (t_history *)malloc (sizeof (t_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
history_hide_password (new_history->text);
|
||||
|
||||
/* add history to general history */
|
||||
if (history_general)
|
||||
history_general->prev_history = new_history;
|
||||
else
|
||||
history_general_last = new_history;
|
||||
new_history->next_history = history_general;
|
||||
new_history->prev_history = NULL;
|
||||
history_general = new_history;
|
||||
num_history_general++;
|
||||
|
||||
/* add history to local history */
|
||||
if (((t_gui_window *)(window))->history)
|
||||
((t_gui_window *)(window))->history->prev_history = new_history;
|
||||
new_history->next_history = ((t_gui_window *)(window))->history;
|
||||
/* remove one command if necessary */
|
||||
if ((cfg_history_max_commands > 0)
|
||||
&& (num_history_general > cfg_history_max_commands))
|
||||
{
|
||||
ptr_history = history_general_last->prev_history;
|
||||
history_general_last->prev_history->next_history = NULL;
|
||||
if (history_general_last->text)
|
||||
free (history_general_last->text);
|
||||
free (history_general_last);
|
||||
history_general_last = ptr_history;
|
||||
num_history_general--;
|
||||
}
|
||||
}
|
||||
|
||||
/* add history to local history */
|
||||
new_history = (t_history *)malloc (sizeof (t_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
history_hide_password (new_history->text);
|
||||
|
||||
if (((t_gui_buffer *)(buffer))->history)
|
||||
((t_gui_buffer *)(buffer))->history->prev_history = new_history;
|
||||
else
|
||||
((t_gui_buffer *)(buffer))->last_history = new_history;
|
||||
new_history->next_history = ((t_gui_buffer *)(buffer))->history;
|
||||
new_history->prev_history = NULL;
|
||||
((t_gui_window *)window)->history = new_history;
|
||||
((t_gui_buffer *)buffer)->history = new_history;
|
||||
((t_gui_buffer *)(buffer))->num_history++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((cfg_history_max_commands > 0)
|
||||
&& (((t_gui_buffer *)(buffer))->num_history > cfg_history_max_commands))
|
||||
{
|
||||
ptr_history = ((t_gui_buffer *)buffer)->last_history->prev_history;
|
||||
((t_gui_buffer *)buffer)->last_history->prev_history->next_history = NULL;
|
||||
if (((t_gui_buffer *)buffer)->last_history->text)
|
||||
free (((t_gui_buffer *)buffer)->last_history->text);
|
||||
free (((t_gui_buffer *)buffer)->last_history);
|
||||
((t_gui_buffer *)buffer)->last_history = ptr_history;
|
||||
((t_gui_buffer *)(buffer))->num_history++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* hotlist.c: WeeChat hotlist (buffers with activity) */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "hotlist.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
t_weechat_hotlist *hotlist = NULL;
|
||||
t_weechat_hotlist *last_hotlist = NULL;
|
||||
t_gui_buffer *hotlist_initial_buffer = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* hotlist_search: find hotlist with buffer pointer
|
||||
*/
|
||||
|
||||
t_weechat_hotlist *
|
||||
hotlist_search (t_gui_buffer *buffer)
|
||||
{
|
||||
t_weechat_hotlist *ptr_hotlist;
|
||||
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist; ptr_hotlist = ptr_hotlist->next_hotlist)
|
||||
{
|
||||
if (ptr_hotlist->buffer == buffer)
|
||||
return ptr_hotlist;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_find_pos: find position for a inserting in hotlist (for sorting hotlist)
|
||||
*/
|
||||
|
||||
t_weechat_hotlist *
|
||||
hotlist_find_pos (t_weechat_hotlist *new_hotlist)
|
||||
{
|
||||
t_weechat_hotlist *ptr_hotlist;
|
||||
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist; ptr_hotlist = ptr_hotlist->next_hotlist)
|
||||
{
|
||||
if (new_hotlist->priority > ptr_hotlist->priority)
|
||||
return ptr_hotlist;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_add: add a buffer to hotlist, with priority
|
||||
*/
|
||||
|
||||
void
|
||||
hotlist_add (int priority, t_gui_buffer *buffer)
|
||||
{
|
||||
t_weechat_hotlist *new_hotlist, *pos_hotlist;
|
||||
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
/* do not highlight current buffer */
|
||||
if (buffer == gui_current_window->buffer)
|
||||
return;
|
||||
|
||||
if ((pos_hotlist = hotlist_search (buffer)))
|
||||
{
|
||||
/* return if priority is greater or equal than the one to add */
|
||||
if (pos_hotlist->priority >= priority)
|
||||
return;
|
||||
/* remove buffer if present with lower priority and go on */
|
||||
hotlist_free (pos_hotlist);
|
||||
}
|
||||
|
||||
if ((new_hotlist = (t_weechat_hotlist *) malloc (sizeof (t_weechat_hotlist))) == NULL)
|
||||
{
|
||||
gui_printf (NULL,
|
||||
_("%s cannot add a buffer to hotlist\n"), WEECHAT_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
new_hotlist->priority = priority;
|
||||
new_hotlist->buffer = buffer;
|
||||
|
||||
if (hotlist)
|
||||
{
|
||||
pos_hotlist = hotlist_find_pos (new_hotlist);
|
||||
|
||||
if (pos_hotlist)
|
||||
{
|
||||
/* insert hotlist into the hotlist (before hotlist found) */
|
||||
new_hotlist->prev_hotlist = pos_hotlist->prev_hotlist;
|
||||
new_hotlist->next_hotlist = pos_hotlist;
|
||||
if (pos_hotlist->prev_hotlist)
|
||||
pos_hotlist->prev_hotlist->next_hotlist = new_hotlist;
|
||||
else
|
||||
hotlist = new_hotlist;
|
||||
pos_hotlist->prev_hotlist = new_hotlist;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* add hotlist to the end */
|
||||
new_hotlist->prev_hotlist = last_hotlist;
|
||||
new_hotlist->next_hotlist = NULL;
|
||||
last_hotlist->next_hotlist = new_hotlist;
|
||||
last_hotlist = new_hotlist;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
new_hotlist->prev_hotlist = NULL;
|
||||
new_hotlist->next_hotlist = NULL;
|
||||
hotlist = new_hotlist;
|
||||
last_hotlist = new_hotlist;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_free: free a hotlist and remove it from hotlist queue
|
||||
*/
|
||||
|
||||
void
|
||||
hotlist_free (t_weechat_hotlist *ptr_hotlist)
|
||||
{
|
||||
t_weechat_hotlist *new_hotlist;
|
||||
|
||||
/* remove hotlist from queue */
|
||||
if (last_hotlist == ptr_hotlist)
|
||||
last_hotlist = ptr_hotlist->prev_hotlist;
|
||||
if (ptr_hotlist->prev_hotlist)
|
||||
{
|
||||
(ptr_hotlist->prev_hotlist)->next_hotlist = ptr_hotlist->next_hotlist;
|
||||
new_hotlist = hotlist;
|
||||
}
|
||||
else
|
||||
new_hotlist = ptr_hotlist->next_hotlist;
|
||||
|
||||
if (ptr_hotlist->next_hotlist)
|
||||
(ptr_hotlist->next_hotlist)->prev_hotlist = ptr_hotlist->prev_hotlist;
|
||||
|
||||
free (ptr_hotlist);
|
||||
hotlist = new_hotlist;
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_free_all: free all hotlists
|
||||
*/
|
||||
|
||||
void
|
||||
hotlist_free_all ()
|
||||
{
|
||||
/* remove all hotlists */
|
||||
while (hotlist)
|
||||
hotlist_free (hotlist);
|
||||
}
|
||||
|
||||
/*
|
||||
* hotlist_remove_buffer: remove a buffer from hotlist
|
||||
*/
|
||||
|
||||
void
|
||||
hotlist_remove_buffer (t_gui_buffer *buffer)
|
||||
{
|
||||
t_weechat_hotlist *pos_hotlist;
|
||||
|
||||
pos_hotlist = hotlist_search (buffer);
|
||||
if (pos_hotlist)
|
||||
hotlist_free (pos_hotlist);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_HOTLIST_H
|
||||
#define __WEECHAT_HOTLIST_H 1
|
||||
|
||||
#include "../irc/irc.h"
|
||||
|
||||
typedef struct t_weechat_hotlist t_weechat_hotlist;
|
||||
|
||||
struct t_weechat_hotlist
|
||||
{
|
||||
int priority; /* 0=crappy msg (join/part), 1=msg, */
|
||||
/* 2=nick highlight */
|
||||
t_gui_buffer *buffer; /* associated buffer */
|
||||
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
|
||||
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
|
||||
};
|
||||
|
||||
extern t_weechat_hotlist *hotlist;
|
||||
extern t_gui_buffer *hotlist_initial_buffer;
|
||||
|
||||
extern void hotlist_add (int, t_gui_buffer *);
|
||||
extern void hotlist_free (t_weechat_hotlist *);
|
||||
extern void hotlist_free_all ();
|
||||
extern void hotlist_remove_buffer (t_gui_buffer *);
|
||||
|
||||
#endif /* hotlist.h */
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* log.c: log buffers to files */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "weechat.h"
|
||||
#include "log.h"
|
||||
#include "weeconfig.h"
|
||||
|
||||
|
||||
/*
|
||||
* log_write_date: writes date to log file
|
||||
*/
|
||||
|
||||
void
|
||||
log_write_date (t_gui_buffer *buffer)
|
||||
{
|
||||
static char buf_time[256];
|
||||
static time_t seconds;
|
||||
struct tm *date_tmp;
|
||||
|
||||
if (buffer->log_file)
|
||||
{
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
if (date_tmp)
|
||||
{
|
||||
strftime (buf_time, sizeof (buf_time) - 1, cfg_log_timestamp, date_tmp);
|
||||
fprintf (buffer->log_file, "%s ", buf_time);
|
||||
fflush (buffer->log_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* log_write: writes a message to log file
|
||||
*/
|
||||
|
||||
void
|
||||
log_write (t_gui_buffer *buffer, char *message)
|
||||
{
|
||||
if (buffer->log_file)
|
||||
{
|
||||
fprintf (buffer->log_file, "%s", message);
|
||||
fflush (buffer->log_file);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* log_start: starts a log
|
||||
*/
|
||||
|
||||
void
|
||||
log_start (t_gui_buffer *buffer)
|
||||
{
|
||||
int length;
|
||||
char *ptr_home;
|
||||
|
||||
ptr_home = getenv ("HOME");
|
||||
length = strlen (cfg_log_path) +
|
||||
((cfg_log_path[0] == '~') ? strlen (ptr_home) : 0) +
|
||||
64;
|
||||
if (SERVER(buffer))
|
||||
length += strlen (SERVER(buffer)->name);
|
||||
if (CHANNEL(buffer))
|
||||
length += strlen (CHANNEL(buffer)->name);
|
||||
buffer->log_filename = (char *) malloc (length);
|
||||
if (!buffer->log_filename)
|
||||
{
|
||||
wee_log_printf (_("Not enough memory to write log file for a buffer\n"));
|
||||
return;
|
||||
}
|
||||
if (cfg_log_path[0] == '~')
|
||||
{
|
||||
strcpy (buffer->log_filename, ptr_home);
|
||||
strcat (buffer->log_filename, cfg_log_path + 1);
|
||||
}
|
||||
else
|
||||
strcpy (buffer->log_filename, cfg_log_path);
|
||||
if (buffer->log_filename[strlen (buffer->log_filename) - 1] != DIR_SEPARATOR_CHAR)
|
||||
strcat (buffer->log_filename, DIR_SEPARATOR);
|
||||
|
||||
if (SERVER(buffer))
|
||||
{
|
||||
strcat (buffer->log_filename, SERVER(buffer)->name);
|
||||
strcat (buffer->log_filename, ".");
|
||||
}
|
||||
if (CHANNEL(buffer))
|
||||
{
|
||||
strcat (buffer->log_filename, CHANNEL(buffer)->name);
|
||||
strcat (buffer->log_filename, ".");
|
||||
}
|
||||
strcat (buffer->log_filename, "weechatlog");
|
||||
|
||||
buffer->log_file = fopen (buffer->log_filename, "a");
|
||||
if (!buffer->log_file)
|
||||
{
|
||||
wee_log_printf (_("Unable to write log file for a buffer\n"));
|
||||
free (buffer->log_filename);
|
||||
return;
|
||||
}
|
||||
log_write (buffer, _("**** Beginning of log "));
|
||||
log_write_date (buffer);
|
||||
log_write (buffer, "****\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* log_end: ends a log
|
||||
*/
|
||||
|
||||
void
|
||||
log_end (t_gui_buffer *buffer)
|
||||
{
|
||||
if (buffer->log_file)
|
||||
{
|
||||
log_write (buffer, _("**** End of log "));
|
||||
log_write_date (buffer);
|
||||
log_write (buffer, "****\n");
|
||||
fclose (buffer->log_file);
|
||||
buffer->log_file = NULL;
|
||||
}
|
||||
if (buffer->log_filename)
|
||||
free (buffer->log_filename);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
|
||||
* See README for License detail, AUTHORS for developers list.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __WEECHAT_LOG_H
|
||||
#define __WEECHAT_LOG_H 1
|
||||
|
||||
#include "../irc/irc.h"
|
||||
|
||||
extern void log_write_date (t_gui_buffer *);
|
||||
extern void log_write (t_gui_buffer *, char *);
|
||||
extern void log_start (t_gui_buffer *);
|
||||
extern void log_end (t_gui_buffer *);
|
||||
|
||||
#endif /* log.h */
|
||||
+194
-47
@@ -10,7 +10,7 @@
|
||||
* ### ###
|
||||
* ### By: FlashCode <flashcode@flashtux.org> ###
|
||||
* ### Bounga <bounga@altern.org> ###
|
||||
* ### Xahlexx <xahlexx@tuxisland.org> ###
|
||||
* ### Xahlexx <xahlexx@weeland.org> ###
|
||||
* ### ###
|
||||
* ### http://weechat.flashtux.org ###
|
||||
* ### ###
|
||||
@@ -60,7 +60,9 @@
|
||||
|
||||
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
|
||||
char *weechat_home; /* WeeChat home dir. (example: /home/toto/.weechat) */
|
||||
FILE *log_file; /* WeeChat log file (~/.weechat/weechat.log) */
|
||||
FILE *weechat_log_file; /* WeeChat log file (~/.weechat/weechat.log) */
|
||||
|
||||
int server_cmd_line; /* at least one server on WeeChat command line */
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,7 +88,7 @@ wee_log_printf (char *message, ...)
|
||||
static time_t seconds;
|
||||
struct tm *date_tmp;
|
||||
|
||||
if (!log_file)
|
||||
if (!weechat_log_file)
|
||||
return;
|
||||
|
||||
va_start (argptr, message);
|
||||
@@ -95,11 +97,87 @@ wee_log_printf (char *message, ...)
|
||||
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
fprintf (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);
|
||||
fflush (log_file);
|
||||
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);
|
||||
else
|
||||
fprintf (weechat_log_file, "%s", buffer);
|
||||
fflush (weechat_log_file);
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_config_options: display config options
|
||||
*/
|
||||
|
||||
void wee_display_config_options ()
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
printf (_("WeeChat configuration options (~/.weechat/weechat.rc):\n\n"));
|
||||
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
|
||||
{
|
||||
if (weechat_options[i])
|
||||
{
|
||||
j = 0;
|
||||
while (weechat_options[i][j].option_name)
|
||||
{
|
||||
printf ("* %s:\n",
|
||||
weechat_options[i][j].option_name);
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
printf (_(" . type boolean (values: 'on' or 'off')\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_int == BOOL_TRUE) ?
|
||||
"on" : "off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
printf (_(" . type integer (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);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
printf (_(" . type string (values: "));
|
||||
k = 0;
|
||||
while (weechat_options[i][j].array_values[k])
|
||||
{
|
||||
printf ("'%s'",
|
||||
weechat_options[i][j].array_values[k]);
|
||||
if (weechat_options[i][j].array_values[k + 1])
|
||||
printf (", ");
|
||||
k++;
|
||||
}
|
||||
printf (")\n");
|
||||
printf (_(" . 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 (Curses or Gtk color, look at WeeChat doc)\n"));
|
||||
printf (_(" . 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 (any string)\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
break;
|
||||
}
|
||||
printf (_(" . description: %s\n\n"),
|
||||
gettext (weechat_options[i][j].long_description));
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf (_("Moreover, you can define aliases in [alias] section, by adding lines like:\n"));
|
||||
printf ("j=join\n");
|
||||
printf (_("where 'j' is alias name, and 'join' associated command.\n\n"));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -110,26 +188,56 @@ void
|
||||
wee_parse_args (int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
t_irc_server server_tmp;
|
||||
|
||||
server_cmd_line = 0;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if ((strcmp (argv[i], "-h") == 0)
|
||||
|| (strcmp (argv[i], "--help") == 0))
|
||||
if ((strcmp (argv[i], "-c") == 0)
|
||||
|| (strcmp (argv[i], "--config") == 0))
|
||||
{
|
||||
printf ("\n%s%s", WEE_USAGE);
|
||||
exit (0);
|
||||
wee_display_config_options ();
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-h") == 0)
|
||||
|| (strcmp (argv[i], "--help") == 0))
|
||||
{
|
||||
printf ("\n" WEE_USAGE1, argv[0], argv[0]);
|
||||
printf ("%s", WEE_USAGE2);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-l") == 0)
|
||||
|| (strcmp (argv[i], "--license") == 0))
|
||||
{
|
||||
printf ("\n%s%s", WEE_LICENSE);
|
||||
exit (0);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-v") == 0)
|
||||
|| (strcmp (argv[i], "--version") == 0))
|
||||
{
|
||||
printf (PACKAGE_VERSION "\n");
|
||||
exit (0);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else if ((strncasecmp (argv[i], "irc://", 6) == 0))
|
||||
{
|
||||
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]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!server_new (server_tmp.name, 0, 1,
|
||||
server_tmp.address, server_tmp.port,
|
||||
server_tmp.password, server_tmp.nick1,
|
||||
server_tmp.nick2, server_tmp.nick3,
|
||||
NULL, NULL, NULL, server_tmp.autojoin, 1))
|
||||
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
server_destroy (&server_tmp);
|
||||
server_cmd_line = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -173,48 +281,87 @@ wee_create_dir (char *directory)
|
||||
void
|
||||
wee_create_home_dirs ()
|
||||
{
|
||||
char *dir_name;
|
||||
char *ptr_home, *dir_name;
|
||||
int dir_length;
|
||||
|
||||
/* TODO: rewrite this code for Windows version */
|
||||
ptr_home = getenv ("HOME");
|
||||
if (!ptr_home)
|
||||
{
|
||||
fprintf (stderr, _("%s unable to get HOME directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
dir_length = strlen (ptr_home) + 10;
|
||||
weechat_home =
|
||||
(char *) malloc ((strlen (getenv ("HOME")) + 10) * sizeof (char));
|
||||
sprintf (weechat_home, "%s%s.weechat", getenv ("HOME"), DIR_SEPARATOR);
|
||||
(char *) malloc (dir_length * sizeof (char));
|
||||
if (!weechat_home)
|
||||
{
|
||||
fprintf (stderr, _("%s not enough memory for home directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
DIR_SEPARATOR);
|
||||
|
||||
/* create home directory "~/.weechat" ; error is fatal */
|
||||
if (!wee_create_dir (weechat_home))
|
||||
exit (1);
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create ~/.weechat directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
dir_name = (char *) malloc ((strlen (weechat_home) + 64) * sizeof (char));
|
||||
dir_length = strlen (weechat_home) + 64;
|
||||
dir_name = (char *) malloc (dir_length * sizeof (char));
|
||||
|
||||
#ifdef PLUGIN_PERL
|
||||
/* create "~/.weechat/perl" */
|
||||
sprintf (dir_name, "%s%s%s", weechat_home, DIR_SEPARATOR, "perl");
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
|
||||
"perl");
|
||||
if (wee_create_dir (dir_name))
|
||||
{
|
||||
/* create "~/.weechat/perl/autoload" */
|
||||
sprintf (dir_name, "%s%s%s%s%s", weechat_home, DIR_SEPARATOR, "perl",
|
||||
DIR_SEPARATOR, "autoload");
|
||||
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home,
|
||||
DIR_SEPARATOR, "perl", DIR_SEPARATOR, "autoload");
|
||||
wee_create_dir (dir_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PLUGIN_PYTHON
|
||||
/* create "~/.weechat/python" */
|
||||
sprintf (dir_name, "%s%s%s", weechat_home, DIR_SEPARATOR, "python");
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
|
||||
"python");
|
||||
if (wee_create_dir (dir_name))
|
||||
{
|
||||
/* create "~/.weechat/python/autoload" */
|
||||
sprintf (dir_name, "%s%s%s%s%s", weechat_home, DIR_SEPARATOR, "python",
|
||||
DIR_SEPARATOR, "autoload");
|
||||
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home,
|
||||
DIR_SEPARATOR, "python", DIR_SEPARATOR, "autoload");
|
||||
wee_create_dir (dir_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PLUGIN_RUBY
|
||||
/* create "~/.weechat/ruby" */
|
||||
sprintf (dir_name, "%s%s%s", weechat_home, DIR_SEPARATOR, "ruby");
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
|
||||
"ruby");
|
||||
if (wee_create_dir (dir_name))
|
||||
{
|
||||
/* create "~/.weechat/ruby/autoload" */
|
||||
sprintf (dir_name, "%s%s%s%s%s", weechat_home, DIR_SEPARATOR, "ruby",
|
||||
DIR_SEPARATOR, "autoload");
|
||||
snprintf (dir_name, dir_length, "%s%s%s%s%s", weechat_home,
|
||||
DIR_SEPARATOR, "ruby", DIR_SEPARATOR, "autoload");
|
||||
wee_create_dir (dir_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* create "~/.weechat/logs" */
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
|
||||
"logs");
|
||||
if (!wee_create_dir (dir_name))
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create ~/.weechat/logs directory\n"),
|
||||
WEECHAT_WARNING);
|
||||
}
|
||||
|
||||
free (dir_name);
|
||||
}
|
||||
@@ -226,9 +373,6 @@ wee_create_home_dirs ()
|
||||
void
|
||||
wee_init_vars ()
|
||||
{
|
||||
/* GUI not yet initialized */
|
||||
gui_ready = 0;
|
||||
|
||||
/* init received messages queue */
|
||||
recv_msgq = NULL;
|
||||
msgq_last_msg = NULL;
|
||||
@@ -241,18 +385,17 @@ wee_init_vars ()
|
||||
void
|
||||
wee_init_log ()
|
||||
{
|
||||
int filename_length;
|
||||
char *filename;
|
||||
|
||||
filename_length = strlen (weechat_home) + 64;
|
||||
filename =
|
||||
(char *) malloc ((strlen (weechat_home) + 64) * sizeof (char));
|
||||
sprintf (filename, "%s/" WEECHAT_LOG_NAME, weechat_home);
|
||||
if ((log_file = fopen (filename, "wt")) == NULL)
|
||||
{
|
||||
free (filename);
|
||||
(char *) malloc (filename_length * sizeof (char));
|
||||
snprintf (filename, filename_length, "%s/" WEECHAT_LOG_NAME, weechat_home);
|
||||
if ((weechat_log_file = fopen (filename, "wt")) == NULL)
|
||||
fprintf (stderr,
|
||||
_("%s unable to create/append to log file (~/.weechat/%s)"),
|
||||
WEECHAT_ERROR, WEECHAT_LOG_NAME);
|
||||
}
|
||||
WEECHAT_WARNING, WEECHAT_LOG_NAME);
|
||||
free (filename);
|
||||
}
|
||||
|
||||
@@ -303,11 +446,12 @@ weechat_welcome_message ()
|
||||
void
|
||||
wee_shutdown ()
|
||||
{
|
||||
dcc_end ();
|
||||
server_free_all ();
|
||||
gui_end ();
|
||||
if (log_file)
|
||||
fclose (log_file);
|
||||
exit (0);
|
||||
if (weechat_log_file)
|
||||
fclose (weechat_log_file);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -336,25 +480,28 @@ main (int argc, char *argv[])
|
||||
case 0: /* config file OK */
|
||||
break;
|
||||
case -1: /* config file not found */
|
||||
config_create_default ();
|
||||
config_read ();
|
||||
if (config_create_default () < 0)
|
||||
return EXIT_FAILURE;
|
||||
if (config_read () != 0)
|
||||
return EXIT_FAILURE;
|
||||
break;
|
||||
default: /* other error (fatal) */
|
||||
server_free_all ();
|
||||
return 1;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
gui_init (); /* init WeeChat interface */
|
||||
plugin_init (); /* init plugin interface(s) */
|
||||
weechat_welcome_message (); /* display WeeChat welcome message */
|
||||
server_auto_connect (); /* auto-connect to servers */
|
||||
/* auto-connect to servers */
|
||||
server_auto_connect (server_cmd_line);
|
||||
|
||||
gui_main_loop (); /* WeeChat main loop */
|
||||
|
||||
plugin_end (); /* end plugin interface(s) */
|
||||
server_disconnect_all (); /* disconnect from all servers */
|
||||
config_write (NULL); /* save config file */
|
||||
(void) config_write (NULL); /* save config file */
|
||||
wee_shutdown (); /* quit WeeChat (oh no, why?) */
|
||||
|
||||
return 0; /* make gcc happy (never executed) */
|
||||
return EXIT_SUCCESS; /* make gcc happy (never executed) */
|
||||
}
|
||||
|
||||
@@ -59,7 +59,8 @@
|
||||
PACKAGE_STRING " (c) Copyright 2004, compiled on " __DATE__ " " __TIME__ \
|
||||
"\nDeveloped by FlashCode <flashcode@flashtux.org>\n" \
|
||||
" Bounga <bounga@altern.org>\n" \
|
||||
" Xahlexx <xahlexx@tuxisland.org>\n\n" \
|
||||
" Xahlexx <xahlexx@weeland.org>\n" \
|
||||
"Website: " 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" \
|
||||
"the Free Software Foundation; either version 2 of the License, or\n" \
|
||||
@@ -75,21 +76,26 @@
|
||||
"along with this program; if not, write to the Free Software\n" \
|
||||
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\n"
|
||||
|
||||
#define WEE_USAGE \
|
||||
#define WEE_USAGE1 \
|
||||
PACKAGE_STRING " (c) Copyright 2004, compiled on " __DATE__ " " __TIME__ \
|
||||
"\nDeveloped by FlashCode <flashcode@flashtux.org>\n" \
|
||||
" Bounga <bounga@altern.org>\n" \
|
||||
" Xahlexx <xahlexx@tuxisland.org>\n\n" \
|
||||
" -h, --help this help screen\n", \
|
||||
"\nDeveloped by FlashCode, Bounga and Xahlexx - " WEECHAT_WEBSITE "\n\n" \
|
||||
"Usage: %s [options ...]\n" \
|
||||
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
|
||||
|
||||
#define WEE_USAGE2 \
|
||||
" -c, --config config file help (list of options)\n" \
|
||||
" -h, --help this help screen\n" \
|
||||
" -l, --license display WeeChat license\n" \
|
||||
" -v, --version display WeeChat version\n\n"
|
||||
|
||||
/* directory separator, depending on OS */
|
||||
|
||||
#ifdef _WIN32
|
||||
#define DIR_SEPARATOR "\\"
|
||||
#define DIR_SEPARATOR "\\"
|
||||
#define DIR_SEPARATOR_CHAR '\\'
|
||||
#else
|
||||
#define DIR_SEPARATOR "/"
|
||||
#define DIR_SEPARATOR "/"
|
||||
#define DIR_SEPARATOR_CHAR '/'
|
||||
#endif
|
||||
|
||||
/* global variables and functions */
|
||||
|
||||
+410
-221
File diff suppressed because it is too large
Load Diff
@@ -70,7 +70,7 @@ struct t_config_option
|
||||
char **array_values;
|
||||
int *ptr_int;
|
||||
char **ptr_string;
|
||||
int (*handler_change)(int *, char **);
|
||||
void (*handler_change)();
|
||||
};
|
||||
|
||||
extern int cfg_look_set_title;
|
||||
@@ -88,6 +88,10 @@ extern int cfg_look_nickmode;
|
||||
extern int cfg_look_nickmode_empty;
|
||||
extern char *cfg_look_no_nickname;
|
||||
extern char *cfg_look_completor;
|
||||
extern int cfg_look_display_away;
|
||||
extern int cfg_look_infobar;
|
||||
extern char *cfg_look_infobar_timestamp;
|
||||
extern int cfg_look_infobar_delay_highlight;
|
||||
|
||||
extern int cfg_col_title;
|
||||
extern int cfg_col_title_bg;
|
||||
@@ -103,11 +107,15 @@ extern int cfg_col_chat_dark;
|
||||
extern int cfg_col_chat_highlight;
|
||||
extern int cfg_col_chat_bg;
|
||||
extern int cfg_col_status;
|
||||
extern int cfg_col_status_active;
|
||||
extern int cfg_col_status_delimiters;
|
||||
extern int cfg_col_status_data_msg;
|
||||
extern int cfg_col_status_data_highlight;
|
||||
extern int cfg_col_status_data_other;
|
||||
extern int cfg_col_status_more;
|
||||
extern int cfg_col_status_bg;
|
||||
extern int cfg_col_infobar;
|
||||
extern int cfg_col_infobar_highlight;
|
||||
extern int cfg_col_infobar_bg;
|
||||
extern int cfg_col_input;
|
||||
extern int cfg_col_input_channel;
|
||||
extern int cfg_col_input_nick;
|
||||
@@ -120,22 +128,28 @@ extern int cfg_col_nick_sep;
|
||||
extern int cfg_col_nick_self;
|
||||
extern int cfg_col_nick_private;
|
||||
extern int cfg_col_nick_bg;
|
||||
extern int cfg_col_dcc_selected;
|
||||
extern int cfg_col_dcc_waiting;
|
||||
extern int cfg_col_dcc_connecting;
|
||||
extern int cfg_col_dcc_active;
|
||||
extern int cfg_col_dcc_done;
|
||||
extern int cfg_col_dcc_failed;
|
||||
extern int cfg_col_dcc_aborted;
|
||||
|
||||
extern int cfg_history_max_lines;
|
||||
extern int cfg_history_max_commands;
|
||||
|
||||
extern int cfg_log_auto_channels;
|
||||
extern int cfg_log_auto_server;
|
||||
extern int cfg_log_auto_channel;
|
||||
extern int cfg_log_auto_private;
|
||||
extern char *cfg_log_path;
|
||||
extern char *cfg_log_name;
|
||||
extern char *cfg_log_timestamp;
|
||||
extern char *cfg_log_start_string;
|
||||
extern char *cfg_log_end_string;
|
||||
extern int cfg_log_hide_nickserv_pwd;
|
||||
|
||||
extern int cfg_dcc_auto_accept_files;
|
||||
extern int cfg_dcc_auto_accept_max_size;
|
||||
extern int cfg_dcc_auto_accept_chats;
|
||||
extern int cfg_dcc_timeout;
|
||||
extern int cfg_dcc_blocksize;
|
||||
extern char *cfg_dcc_download_path;
|
||||
extern char *cfg_dcc_upload_path;
|
||||
extern int cfg_dcc_auto_rename;
|
||||
@@ -149,6 +163,15 @@ extern char *cfg_proxy_password;
|
||||
extern t_config_section config_sections [CONFIG_NUMBER_SECTIONS];
|
||||
extern t_config_option * weechat_options [CONFIG_NUMBER_SECTIONS];
|
||||
|
||||
extern char *config_get_section ();
|
||||
extern void config_change_noop ();
|
||||
extern void config_change_title ();
|
||||
extern void config_change_buffers ();
|
||||
extern void config_change_buffer_content ();
|
||||
extern void config_change_color ();
|
||||
extern int config_option_set_value (t_config_option *, char *);
|
||||
extern t_config_option *config_option_search (char *);
|
||||
extern int config_set_value (char *, char *);
|
||||
extern int config_read ();
|
||||
extern int config_create_default ();
|
||||
extern int config_write ();
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
bin_PROGRAMS = weechat-curses
|
||||
|
||||
weechat_curses_LDADD = ../../common/lib_weechat_main.a \
|
||||
|
||||
+1253
-756
File diff suppressed because it is too large
Load Diff
+435
-171
@@ -37,6 +37,7 @@
|
||||
#include "../gui.h"
|
||||
#include "../../common/weeconfig.h"
|
||||
#include "../../common/command.h"
|
||||
#include "../../common/hotlist.h"
|
||||
#include "../../irc/irc.h"
|
||||
|
||||
#define KEY_ESCAPE 27
|
||||
@@ -49,239 +50,347 @@ void
|
||||
gui_read_keyb ()
|
||||
{
|
||||
int key, i;
|
||||
t_gui_window *ptr_window;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
char new_char[2];
|
||||
t_dcc *dcc_selected;
|
||||
|
||||
key = getch ();
|
||||
if (key != ERR)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
/* resize event: do nothing */
|
||||
/* resize event */
|
||||
case KEY_RESIZE:
|
||||
gui_redraw_window (gui_current_window);
|
||||
gui_curses_resize_handler ();
|
||||
break;
|
||||
/* inactive function keys */
|
||||
case KEY_F(1):
|
||||
case KEY_F(2):
|
||||
case KEY_F(3):
|
||||
case KEY_F(4):
|
||||
case KEY_F(5):
|
||||
case KEY_F(9):
|
||||
case KEY_F(11):
|
||||
case KEY_F(12):
|
||||
break;
|
||||
/* previous buffer in window */
|
||||
case KEY_F(6):
|
||||
gui_switch_to_previous_window ();
|
||||
gui_switch_to_previous_buffer (gui_current_window);
|
||||
break;
|
||||
/* next buffer in window */
|
||||
case KEY_F(7):
|
||||
gui_switch_to_next_buffer (gui_current_window);
|
||||
break;
|
||||
/* next window */
|
||||
case KEY_F(7):
|
||||
gui_switch_to_next_window ();
|
||||
case KEY_F(8):
|
||||
gui_switch_to_next_window (gui_current_window);
|
||||
break;
|
||||
/* remove last infobar message */
|
||||
case KEY_F(10):
|
||||
gui_infobar_remove ();
|
||||
break;
|
||||
/* cursor up */
|
||||
case KEY_UP:
|
||||
if (gui_current_window->ptr_history)
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->ptr_history =
|
||||
gui_current_window->ptr_history->next_history;
|
||||
if (!gui_current_window->ptr_history)
|
||||
gui_current_window->ptr_history =
|
||||
gui_current_window->history;
|
||||
if (dcc_list)
|
||||
{
|
||||
if (gui_current_window->dcc_selected
|
||||
&& ((t_dcc *)(gui_current_window->dcc_selected))->prev_dcc)
|
||||
{
|
||||
if (gui_current_window->dcc_selected ==
|
||||
gui_current_window->dcc_first)
|
||||
gui_current_window->dcc_first =
|
||||
((t_dcc *)(gui_current_window->dcc_first))->prev_dcc;
|
||||
gui_current_window->dcc_selected =
|
||||
((t_dcc *)(gui_current_window->dcc_selected))->prev_dcc;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 1);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
gui_current_window->ptr_history =
|
||||
gui_current_window->history;
|
||||
if (gui_current_window->ptr_history)
|
||||
{
|
||||
gui_current_window->input_buffer_size =
|
||||
strlen (gui_current_window->ptr_history->text);
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->input_buffer_size;
|
||||
strcpy (gui_current_window->input_buffer,
|
||||
gui_current_window->ptr_history->text);
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->ptr_history->next_history;
|
||||
if (!gui_current_window->buffer->ptr_history)
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->history;
|
||||
}
|
||||
else
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->history;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_size =
|
||||
strlen (gui_current_window->buffer->ptr_history->text);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
strcpy (gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->ptr_history->text);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor down */
|
||||
case KEY_DOWN:
|
||||
if (gui_current_window->ptr_history)
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->ptr_history =
|
||||
gui_current_window->ptr_history->prev_history;
|
||||
if (gui_current_window->ptr_history)
|
||||
gui_current_window->input_buffer_size =
|
||||
strlen (gui_current_window->ptr_history->text);
|
||||
else
|
||||
gui_current_window->input_buffer_size = 0;
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->input_buffer_size;
|
||||
if (gui_current_window->ptr_history)
|
||||
strcpy (gui_current_window->input_buffer,
|
||||
gui_current_window->ptr_history->text);
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (dcc_list)
|
||||
{
|
||||
if (!gui_current_window->dcc_selected
|
||||
|| ((t_dcc *)(gui_current_window->dcc_selected))->next_dcc)
|
||||
{
|
||||
if (gui_current_window->dcc_last_displayed
|
||||
&& (gui_current_window->dcc_selected ==
|
||||
gui_current_window->dcc_last_displayed))
|
||||
{
|
||||
if (gui_current_window->dcc_first)
|
||||
gui_current_window->dcc_first =
|
||||
((t_dcc *)(gui_current_window->dcc_first))->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_first =
|
||||
dcc_list->next_dcc;
|
||||
}
|
||||
if (gui_current_window->dcc_selected)
|
||||
gui_current_window->dcc_selected =
|
||||
((t_dcc *)(gui_current_window->dcc_selected))->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_selected =
|
||||
dcc_list->next_dcc;
|
||||
gui_draw_buffer_chat (gui_current_window->buffer, 1);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
{
|
||||
gui_current_window->buffer->ptr_history =
|
||||
gui_current_window->buffer->ptr_history->prev_history;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
gui_current_window->buffer->input_buffer_size =
|
||||
strlen (gui_current_window->buffer->ptr_history->text);
|
||||
else
|
||||
gui_current_window->buffer->input_buffer_size = 0;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
if (gui_current_window->buffer->ptr_history)
|
||||
strcpy (gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->ptr_history->text);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor left */
|
||||
case KEY_LEFT:
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer_pos--;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos--;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* cursor right */
|
||||
case KEY_RIGHT:
|
||||
if (gui_current_window->input_buffer_pos <
|
||||
gui_current_window->input_buffer_size)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer_pos++;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* home key */
|
||||
case KEY_HOME:
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer_pos = 0;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos = 0;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* end key */
|
||||
case KEY_END:
|
||||
if (gui_current_window->input_buffer_pos <
|
||||
gui_current_window->input_buffer_size)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->input_buffer_size;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->input_buffer_size;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* page up */
|
||||
case KEY_PPAGE:
|
||||
gui_move_page_up ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_page_up (gui_current_window);
|
||||
break;
|
||||
/* page down */
|
||||
case KEY_NPAGE:
|
||||
gui_move_page_down ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_page_down (gui_current_window);
|
||||
break;
|
||||
/* erase before cursor and move cursor to the left */
|
||||
case 127:
|
||||
case KEY_BACKSPACE:
|
||||
if (gui_current_window->input_buffer_pos > 0)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos-1;
|
||||
while (gui_current_window->input_buffer[i])
|
||||
if (gui_current_window->buffer->input_buffer_pos > 0)
|
||||
{
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i+1];
|
||||
i++;
|
||||
i = gui_current_window->buffer->input_buffer_pos-1;
|
||||
while (gui_current_window->buffer->input_buffer[i])
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i+1];
|
||||
i++;
|
||||
}
|
||||
gui_current_window->buffer->input_buffer_size--;
|
||||
gui_current_window->buffer->input_buffer_pos--;
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
gui_current_window->input_buffer_size--;
|
||||
gui_current_window->input_buffer_pos--;
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->completion.position = -1;
|
||||
}
|
||||
break;
|
||||
/* Control + Backspace */
|
||||
case 0x08:
|
||||
gui_delete_previous_word ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_delete_previous_word (gui_current_window->buffer);
|
||||
break;
|
||||
/* Control + L */
|
||||
case 0x0C:
|
||||
gui_curses_resize_handler ();
|
||||
break;
|
||||
/* erase char under cursor */
|
||||
case KEY_DC:
|
||||
if (gui_current_window->input_buffer_pos <
|
||||
gui_current_window->input_buffer_size)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
i = gui_current_window->input_buffer_pos;
|
||||
while (gui_current_window->input_buffer[i])
|
||||
if (gui_current_window->buffer->input_buffer_pos <
|
||||
gui_current_window->buffer->input_buffer_size)
|
||||
{
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i+1];
|
||||
i++;
|
||||
i = gui_current_window->buffer->input_buffer_pos;
|
||||
while (gui_current_window->buffer->input_buffer[i])
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i+1];
|
||||
i++;
|
||||
}
|
||||
gui_current_window->buffer->input_buffer_size--;
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
gui_current_window->input_buffer_size--;
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->completion.position = -1;
|
||||
}
|
||||
break;
|
||||
/* Tab : completion */
|
||||
case '\t':
|
||||
completion_search (&(gui_current_window->completion),
|
||||
CHANNEL(gui_current_window),
|
||||
gui_current_window->input_buffer,
|
||||
gui_current_window->input_buffer_size,
|
||||
gui_current_window->input_buffer_pos);
|
||||
if (gui_current_window->completion.word_found)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
// replace word with new completed word into input buffer
|
||||
gui_current_window->input_buffer_size +=
|
||||
gui_current_window->completion.diff_size;
|
||||
gui_optimize_input_buffer_size (gui_current_window);
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
|
||||
if (gui_current_window->completion.diff_size > 0)
|
||||
completion_search (&(gui_current_window->buffer->completion),
|
||||
CHANNEL(gui_current_window->buffer),
|
||||
gui_current_window->buffer->input_buffer,
|
||||
gui_current_window->buffer->input_buffer_size,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
if (gui_current_window->buffer->completion.word_found)
|
||||
{
|
||||
for (i = gui_current_window->input_buffer_size - 1;
|
||||
i >= gui_current_window->completion.position_replace +
|
||||
(int)strlen (gui_current_window->completion.word_found); i--)
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i -
|
||||
gui_current_window->completion.diff_size];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = gui_current_window->completion.position_replace +
|
||||
strlen (gui_current_window->completion.word_found);
|
||||
i < gui_current_window->input_buffer_size; i++)
|
||||
gui_current_window->input_buffer[i] =
|
||||
gui_current_window->input_buffer[i -
|
||||
gui_current_window->completion.diff_size];
|
||||
}
|
||||
|
||||
strncpy (gui_current_window->input_buffer + gui_current_window->completion.position_replace,
|
||||
gui_current_window->completion.word_found,
|
||||
strlen (gui_current_window->completion.word_found));
|
||||
gui_current_window->input_buffer_pos =
|
||||
gui_current_window->completion.position_replace +
|
||||
strlen (gui_current_window->completion.word_found);
|
||||
gui_current_window->completion.position =
|
||||
gui_current_window->input_buffer_pos;
|
||||
|
||||
/* add space or completor to the end of completion, if needed */
|
||||
if (gui_current_window->completion.base_word[0] == '/')
|
||||
{
|
||||
if (gui_current_window->input_buffer[gui_current_window->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (" ",
|
||||
gui_current_window->input_buffer_pos);
|
||||
gui_current_window->completion.position++;
|
||||
gui_current_window->input_buffer_pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->completion.base_word_pos == 0)
|
||||
/* replace word with new completed word into input buffer */
|
||||
gui_current_window->buffer->input_buffer_size +=
|
||||
gui_current_window->buffer->completion.diff_size;
|
||||
gui_optimize_input_buffer_size (gui_current_window->buffer);
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
|
||||
if (gui_current_window->buffer->completion.diff_size > 0)
|
||||
{
|
||||
if (strncmp (gui_current_window->input_buffer + gui_current_window->input_buffer_pos,
|
||||
cfg_look_completor, strlen (cfg_look_completor)) != 0)
|
||||
gui_buffer_insert_string (cfg_look_completor,
|
||||
gui_current_window->input_buffer_pos);
|
||||
gui_current_window->completion.position += strlen (cfg_look_completor);
|
||||
gui_current_window->input_buffer_pos += strlen (cfg_look_completor);
|
||||
if (gui_current_window->input_buffer[gui_current_window->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (" ",
|
||||
gui_current_window->input_buffer_pos);
|
||||
gui_current_window->completion.position++;
|
||||
gui_current_window->input_buffer_pos++;
|
||||
for (i = gui_current_window->buffer->input_buffer_size - 1;
|
||||
i >= gui_current_window->buffer->completion.position_replace +
|
||||
(int)strlen (gui_current_window->buffer->completion.word_found); i--)
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i -
|
||||
gui_current_window->buffer->completion.diff_size];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = gui_current_window->buffer->completion.position_replace +
|
||||
strlen (gui_current_window->buffer->completion.word_found);
|
||||
i < gui_current_window->buffer->input_buffer_size; i++)
|
||||
gui_current_window->buffer->input_buffer[i] =
|
||||
gui_current_window->buffer->input_buffer[i -
|
||||
gui_current_window->buffer->completion.diff_size];
|
||||
}
|
||||
|
||||
strncpy (gui_current_window->buffer->input_buffer + gui_current_window->buffer->completion.position_replace,
|
||||
gui_current_window->buffer->completion.word_found,
|
||||
strlen (gui_current_window->buffer->completion.word_found));
|
||||
gui_current_window->buffer->input_buffer_pos =
|
||||
gui_current_window->buffer->completion.position_replace +
|
||||
strlen (gui_current_window->buffer->completion.word_found);
|
||||
gui_current_window->buffer->completion.position =
|
||||
gui_current_window->buffer->input_buffer_pos;
|
||||
|
||||
/* add space or completor to the end of completion, if needed */
|
||||
if (gui_current_window->buffer->completion.base_word[0] == '/')
|
||||
{
|
||||
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
" ",
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->completion.position++;
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gui_current_window->buffer->completion.base_word_pos == 0)
|
||||
{
|
||||
if (strncmp (gui_current_window->buffer->input_buffer + gui_current_window->buffer->input_buffer_pos,
|
||||
cfg_look_completor, strlen (cfg_look_completor)) != 0)
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
cfg_look_completor,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->completion.position += strlen (cfg_look_completor);
|
||||
gui_current_window->buffer->input_buffer_pos += strlen (cfg_look_completor);
|
||||
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
" ",
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->completion.position++;
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
}
|
||||
}
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
}
|
||||
gui_draw_window_input (gui_current_window);
|
||||
}
|
||||
break;
|
||||
/* escape code (for control-key) */
|
||||
case KEY_ESCAPE:
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
switch (key)
|
||||
{
|
||||
/* Alt + left arrow */
|
||||
case KEY_LEFT:
|
||||
gui_switch_to_previous_window ();
|
||||
gui_switch_to_previous_buffer (gui_current_window);
|
||||
break;
|
||||
/* Alt + right arrow */
|
||||
case KEY_RIGHT:
|
||||
gui_switch_to_next_window ();
|
||||
gui_switch_to_next_buffer (gui_current_window);
|
||||
break;
|
||||
case 79:
|
||||
/* TODO: replace 79 by constant name! */
|
||||
@@ -293,50 +402,175 @@ gui_read_keyb ()
|
||||
{
|
||||
/* Control + Right */
|
||||
case 99:
|
||||
gui_move_next_word ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_next_word (gui_current_window->buffer);
|
||||
break;
|
||||
/* Control + Left */
|
||||
case 100:
|
||||
gui_move_previous_word ();
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
gui_move_previous_word (gui_current_window->buffer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-number */
|
||||
case 48: /* Alt-0 */
|
||||
case 49: /* Alt-1 */
|
||||
case 50: /* Alt-2 */
|
||||
case 51: /* Alt-3 */
|
||||
case 52: /* Alt-4 */
|
||||
case 53: /* Alt-5 */
|
||||
case 54: /* Alt-6 */
|
||||
case 55: /* Alt-7 */
|
||||
case 56: /* Alt-8 */
|
||||
case 57: /* Alt-9 */
|
||||
gui_switch_to_buffer_by_number (gui_current_window, (key == 48) ? 10 : key - 48);
|
||||
break;
|
||||
/* Alt-A */
|
||||
case 'a':
|
||||
case 'A':
|
||||
if (hotlist)
|
||||
{
|
||||
if (!hotlist_initial_buffer)
|
||||
hotlist_initial_buffer = gui_current_window->buffer;
|
||||
gui_switch_to_buffer (gui_current_window, hotlist->buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hotlist_initial_buffer)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window, hotlist_initial_buffer);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
hotlist_initial_buffer = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* Alt-D */
|
||||
case 'd':
|
||||
case 'D':
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
if (buffer_before_dcc)
|
||||
{
|
||||
gui_switch_to_buffer (gui_current_window,
|
||||
buffer_before_dcc);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_before_dcc = gui_current_window->buffer;
|
||||
gui_switch_to_dcc_buffer ();
|
||||
}
|
||||
break;
|
||||
/* Alt-R */
|
||||
case 'r':
|
||||
case 'R':
|
||||
if (hotlist)
|
||||
{
|
||||
hotlist_free_all ();
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
hotlist_initial_buffer = gui_current_window->buffer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* send command/message */
|
||||
case '\n':
|
||||
if (gui_current_window->input_buffer_size > 0)
|
||||
if (!gui_current_window->buffer->dcc)
|
||||
{
|
||||
gui_current_window->input_buffer[gui_current_window->input_buffer_size] = '\0';
|
||||
history_add (gui_current_window, gui_current_window->input_buffer);
|
||||
gui_current_window->input_buffer_size = 0;
|
||||
gui_current_window->input_buffer_pos = 0;
|
||||
gui_current_window->input_buffer_1st_display = 0;
|
||||
gui_current_window->completion.position = -1;
|
||||
gui_current_window->ptr_history = NULL;
|
||||
ptr_window = gui_current_window;
|
||||
user_command (SERVER(gui_current_window),
|
||||
gui_current_window->input_buffer);
|
||||
if (ptr_window == gui_current_window)
|
||||
gui_draw_window_input (ptr_window);
|
||||
if (ptr_window)
|
||||
ptr_window->input_buffer[0] = '\0';
|
||||
if (gui_current_window->buffer->input_buffer_size > 0)
|
||||
{
|
||||
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
|
||||
history_add (gui_current_window->buffer, gui_current_window->buffer->input_buffer);
|
||||
gui_current_window->buffer->input_buffer_size = 0;
|
||||
gui_current_window->buffer->input_buffer_pos = 0;
|
||||
gui_current_window->buffer->input_buffer_1st_display = 0;
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
gui_current_window->buffer->ptr_history = NULL;
|
||||
ptr_buffer = gui_current_window->buffer;
|
||||
user_command (SERVER(gui_current_window->buffer),
|
||||
gui_current_window->buffer->input_buffer);
|
||||
if (ptr_buffer == gui_current_window->buffer)
|
||||
gui_draw_buffer_input (ptr_buffer, 0);
|
||||
if (ptr_buffer)
|
||||
ptr_buffer->input_buffer[0] = '\0';
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* other key => add to input buffer */
|
||||
default:
|
||||
/*gui_printf (gui_current_window,
|
||||
"[Debug] key pressed = %d, as octal: %o\n", key, key);*/
|
||||
new_char[0] = key;
|
||||
new_char[1] = '\0';
|
||||
gui_buffer_insert_string (new_char,
|
||||
gui_current_window->input_buffer_pos);
|
||||
gui_current_window->input_buffer_pos++;
|
||||
gui_draw_window_input (gui_current_window);
|
||||
gui_current_window->completion.position = -1;
|
||||
if (gui_current_window->buffer->dcc)
|
||||
{
|
||||
dcc_selected = (gui_current_window->dcc_selected) ?
|
||||
(t_dcc *) gui_current_window->dcc_selected : dcc_list;
|
||||
switch (key)
|
||||
{
|
||||
/* accept DCC */
|
||||
case 'a':
|
||||
case 'A':
|
||||
if (dcc_selected
|
||||
&& (((dcc_selected->type == DCC_CHAT_RECV)
|
||||
|| (dcc_selected->type == DCC_FILE_RECV))
|
||||
&& (dcc_selected->status == DCC_WAITING)))
|
||||
{
|
||||
dcc_accept (dcc_selected);
|
||||
}
|
||||
break;
|
||||
/* cancel DCC */
|
||||
case 'c':
|
||||
case 'C':
|
||||
if (dcc_selected
|
||||
&& ((dcc_selected->status == DCC_WAITING)
|
||||
|| (dcc_selected->status == DCC_CONNECTING)
|
||||
|| (dcc_selected->status == DCC_ACTIVE)))
|
||||
{
|
||||
dcc_close (dcc_selected, DCC_ABORTED);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
/* close DCC window */
|
||||
case 'q':
|
||||
case 'Q':
|
||||
gui_buffer_free (gui_current_window->buffer, 1);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
break;
|
||||
/* remove from DCC list */
|
||||
case 'r':
|
||||
case 'R':
|
||||
if (dcc_selected
|
||||
&& (((dcc_selected->type == DCC_CHAT_RECV)
|
||||
|| (dcc_selected->type == DCC_FILE_RECV))
|
||||
&& ((dcc_selected->status == DCC_DONE)
|
||||
|| (dcc_selected->status == DCC_FAILED)
|
||||
|| (dcc_selected->status == DCC_ABORTED))))
|
||||
{
|
||||
if (dcc_selected->next_dcc)
|
||||
gui_current_window->dcc_selected = dcc_selected->next_dcc;
|
||||
else
|
||||
gui_current_window->dcc_selected = NULL;
|
||||
dcc_free (dcc_selected);
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*gui_printf (gui_current_window->buffer,
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
new_char[0] = key;
|
||||
new_char[1] = '\0';
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
new_char,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -352,10 +586,37 @@ gui_main_loop ()
|
||||
fd_set read_fd;
|
||||
static struct timeval timeout;
|
||||
t_irc_server *ptr_server;
|
||||
int old_min, old_sec;
|
||||
time_t new_time;
|
||||
struct tm *local_time;
|
||||
|
||||
quit_weechat = 0;
|
||||
old_min = -1;
|
||||
old_sec = -1;
|
||||
while (!quit_weechat)
|
||||
{
|
||||
new_time = time (NULL);
|
||||
local_time = localtime (&new_time);
|
||||
|
||||
/* minute has changed ? => redraw infobar */
|
||||
if (local_time->tm_min != old_min)
|
||||
{
|
||||
old_min = local_time->tm_min;
|
||||
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
|
||||
}
|
||||
|
||||
/* second has changed ? => count down time for infobar, if needed */
|
||||
if (local_time->tm_sec != old_sec)
|
||||
{
|
||||
old_sec = local_time->tm_sec;
|
||||
if (gui_infobar && gui_infobar->remaining_time > 0)
|
||||
{
|
||||
gui_infobar->remaining_time--;
|
||||
if (gui_infobar->remaining_time == 0)
|
||||
gui_infobar_remove ();
|
||||
}
|
||||
}
|
||||
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 10000;
|
||||
FD_ZERO (&read_fd);
|
||||
@@ -383,5 +644,8 @@ gui_main_loop ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* manages active DCC */
|
||||
dcc_handle ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
bin_PROGRAMS = weechat-gtk
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GTK_CFLAGS)
|
||||
|
||||
INCLUDES = $(GTK_CFLAGS)
|
||||
bin_PROGRAMS = weechat-gtk
|
||||
|
||||
weechat_gtk_LDADD = ../../common/lib_weechat_main.a \
|
||||
../../irc/lib_weechat_irc.a \
|
||||
|
||||
@@ -349,6 +349,35 @@ gui_redraw_window_status (t_gui_window *window)
|
||||
gui_draw_window_status (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_window_infobar: draw infobar window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_draw_window_infobar (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: draw infobar window! */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_redraw_window_infobar: redraw infobar window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_redraw_window_infobar (t_gui_window *window)
|
||||
{
|
||||
/* TODO: manage splitted windows! */
|
||||
if (window != gui_current_window)
|
||||
return;
|
||||
|
||||
/* TODO: first delete window content */
|
||||
gui_draw_window_infobar (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_draw_window_input: draw input window
|
||||
*/
|
||||
@@ -570,6 +599,16 @@ gui_init_colors ()
|
||||
/* TODO: init colors for Gtk */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_set_window_title: set window title
|
||||
*/
|
||||
|
||||
void
|
||||
gui_set_window_title ()
|
||||
{
|
||||
/* TODO: set window title for Gtk */
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_init: init GUI
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user