1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-20 10:04:48 +02:00

Compare commits

...

173 Commits

Author SHA1 Message Date
Sebastien Helleu f5074da156 Version 0.1.1 2005-03-20 07:22:53 +00:00
Sebastien Helleu a23af790df Option irc_away_check is now 0 by default (waiting for fix) 2005-03-20 07:19:16 +00:00
Sebastien Helleu 6d1d1a7b90 Fixed display bug when halfop flag is set/unset 2005-03-17 21:40:54 +00:00
Sebastien Helleu 0b78294f1a Added /halfop & /dehalfop commands, fixed halfop display bug in nicklist 2005-03-16 21:49:49 +00:00
Sebastien Helleu 2580406aa7 Fixed translation 2005-03-15 22:52:18 +00:00
Sebastien Helleu bbd4011020 Added nicks count for channel buffers 2005-03-15 21:15:36 +00:00
Sebastien Helleu 1524432007 More explicit message when channel or nick not found 2005-03-15 19:01:58 +00:00
Sebastien Helleu 09242c3ba6 Added /ban, /unban and /kickban commands, fixed /kick command 2005-03-13 23:36:45 +00:00
Sebastien Helleu bba97304a0 Do not highlight server buffer for notices from memoserv 2005-03-13 09:22:48 +00:00
Sebastien Helleu 32851b7758 Do not highlight server buffer for notices from nickserv and chanserv 2005-03-13 09:05:53 +00:00
Sebastien Helleu 4322501ebd Fixed /invite command (and now invite requests are displayed) 2005-03-12 20:08:08 +00:00
Sebastien Helleu 39d14185a1 FIFO command/text not authorized on special buffers like DCC 2005-03-12 18:52:29 +00:00
Sebastien Helleu c3f5e88286 Added FIFO pipe for remote control 2005-03-12 03:16:30 +00:00
Sebastien Helleu 89c311646f Updated doc 2005-03-11 20:05:43 +00:00
Sebastien Helleu bcd4623a6d Added WeeChat & IRC commands to doc 2005-03-10 17:30:34 +00:00
Sebastien Helleu 8270b50548 Added spanish doc 2005-03-10 17:28:52 +00:00
Sebastien Helleu 6e253245fe Fixed some commands help for doc 2005-03-10 17:20:14 +00:00
Sebastien Helleu 47d03e7dee Fixed list of commands output 2005-03-10 15:49:49 +00:00
Sebastien Helleu 9fbd33faaf Added --irc-commands and --weechat-commands command line options 2005-03-10 15:40:18 +00:00
Sebastien Helleu 5301c75021 Fixed type used for Mac OS (replaced uint32_t by u_int32_t) 2005-03-10 14:49:50 +00:00
Sebastien Helleu 7f165b4c7c Display "Disconnected" only on connected servers 2005-03-09 13:59:12 +00:00
Sebastien Helleu 9526e4a79d Fixed crash when cancelling DCC CHAT that was not started 2005-03-09 13:56:05 +00:00
Sebastien Helleu 2b79d0fe5c Properly display CTCP SOUND on channel 2005-03-07 19:21:28 +00:00
Sebastien Helleu de43c7984a Fixed bug in server messages parser 2005-03-06 22:28:11 +00:00
Sebastien Helleu f78eb88e5a Crash message modified 2005-03-06 20:56:24 +00:00
Sebastien Helleu 4b5b5354da Fixed display bug with empty strings 2005-03-05 22:42:31 +00:00
Sebastien Helleu ac446e9c1f Nick completion with nothing as base word is disabled 2005-03-05 19:19:37 +00:00
Sebastien Helleu 951ec2e7be Fixed crash when a line is ending by lot of spaces 2005-03-05 19:19:12 +00:00
Sebastien Helleu bce7a0e961 Server errors are now displayed on appropriate buffers (default is server buffer) 2005-03-05 17:23:45 +00:00
Sebastien Helleu 7433015842 Added crash dump when WeeChat receives SIGSEGV (Segmentation fault) 2005-03-05 17:03:15 +00:00
Sebastien Helleu 57daa68be5 Fixed some translations 2005-02-28 10:45:09 +00:00
Sebastien Helleu d310a8e960 Fixed display bug when many windows are opened 2005-02-27 23:12:34 +00:00
Sebastien Helleu 4281d09a95 Fixed some translations 2005-02-27 22:49:38 +00:00
Sebastien Helleu 7dedba18bf Fixed typo 2005-02-27 13:43:44 +00:00
Sebastien Helleu 90e4e34f8c Added spanish translation 2005-02-27 13:25:36 +00:00
Sebastien Helleu 12026ef17e Fixed bug with disconnection (was causing high cpu usage) 2005-02-27 10:27:03 +00:00
Sebastien Helleu 46234f0504 Fixed completion bug: now allows command completion in private buffers 2005-02-27 10:16:51 +00:00
Sebastien Helleu 4d4d697b17 Added date/time for DCC CHAT on DCC buffer 2005-02-27 10:08:45 +00:00
Sebastien Helleu 3686d92cb5 Added DCC CHAT (send & recv) 2005-02-27 02:40:11 +00:00
Sebastien Helleu 64c33a8295 Improved display: align messages after prefixes (for example: "-@-" or "-=-") 2005-02-26 11:52:40 +00:00
Sebastien Helleu 7596736ae9 Added new display engine: doesn't cut words at end of lines 2005-02-26 11:10:20 +00:00
Sebastien Helleu 8f55d297e6 Don't check for away on channels when connection to server is down 2005-02-24 21:27:03 +00:00
Sebastien Helleu 5238dba084 Remove brackets after nick in status bar for private buffers 2005-02-22 22:31:57 +00:00
Sebastien Helleu 81e700ea43 Added key for previous window (now: F5/F6 = switch buffer, F7/F8 = switch window) 2005-02-22 21:58:40 +00:00
Sebastien Helleu a13f301d49 Added key for previous window (now: F5/F6 = switch buffer, F7/F8 = switch window) 2005-02-22 21:48:26 +00:00
Sebastien Helleu 575565371b Nicklist now refreshed when using multiple windows 2005-02-22 19:35:52 +00:00
Sebastien Helleu 24d0c49ae4 Fixed crash when quitting WeeChat 2005-02-22 19:32:37 +00:00
Sebastien Helleu 559b651669 Fixed /connect and /disconnect commands, improved output of some commands 2005-02-21 20:29:55 +00:00
Sebastien Helleu 6199f9b629 /set command does not add "=" any more after completed option name 2005-02-20 15:01:41 +00:00
Sebastien Helleu 6e60c95056 Fixed minor display bug 2005-02-20 13:41:07 +00:00
Sebastien Helleu 73f6606771 Connection to IRC server is now made by child process (non blocking) 2005-02-20 13:37:47 +00:00
Sebastien Helleu e3088336ab Fixed translation 2005-02-20 00:18:12 +00:00
Sebastien Helleu 3e81666752 Added DCC send 2005-02-20 00:08:22 +00:00
Sebastien Helleu 6d0be7db4b Added test of HAVE_ICONV, so compile is ok if iconv is not found 2005-02-19 00:32:11 +00:00
Sebastien Helleu 5cdcfdebb7 Improved /help command output 2005-02-17 22:48:44 +00:00
Sebastien Helleu ca50f2c8fc Removed AC_FUNC_MALLOC and AC_FUNC_REALLOC (was causing troubles with cross-compile) 2005-02-17 20:33:37 +00:00
Sebastien Helleu 84f84823c9 Added support for UnrealIrcd ("~" for chan owner, "&" for chan admin) 2005-02-15 20:03:35 +00:00
Sebastien Helleu 0d21ca207d Fixed /buffer close command (now ok when disconnected from server) 2005-02-15 18:41:47 +00:00
Sebastien Helleu 235d96d728 Fixed /help command (display bug) 2005-02-14 22:42:23 +00:00
Sebastien Helleu 58417dddc6 Fixed infobar display bug when multpile windows are opened 2005-02-13 20:25:52 +00:00
Sebastien Helleu b3d66118b4 Fixed display bugs when many windows are opened 2005-02-13 19:59:11 +00:00
Sebastien Helleu 0473d2c8db Plugins messages are logged with new config option (log_plugin_msg); on server buffer, only server messages are logged 2005-02-12 21:21:54 +00:00
Sebastien Helleu 34ce958df9 Version 0.1.1-cvs 2005-02-12 13:32:42 +00:00
Sebastien Helleu dfc1c0370d Version 0.1.0 2005-02-12 12:59:32 +00:00
Sebastien Helleu 89d9fb641e Default decoded charset is UTF-8 2005-02-12 11:12:46 +00:00
Sebastien Helleu a55da76244 Fixed display bug for nicklist window when using multiple windows 2005-02-10 18:42:14 +00:00
Sebastien Helleu e90e206b35 Updated french translations 2005-02-06 16:04:59 +00:00
Sebastien Helleu 8ede80b2b6 Nick window separator is now a single line (instead of colored space) 2005-02-06 15:56:32 +00:00
Sebastien Helleu 1af0359046 Fixed charset conversions when locale is UTF-8 (added "look_charset_internal" option) 2005-02-06 13:15:47 +00:00
Sebastien Helleu 9c67fdf3ea Fixed display bug when resizing term with many windows 2005-02-06 10:34:51 +00:00
Sebastien Helleu 0c695733b3 Improved /window command: now split and merge are ok, fixed crash when resizing terminal to small size 2005-02-06 03:13:33 +00:00
Sebastien Helleu df4ed3eeba Updated documentation and french translations 2005-02-05 18:07:12 +00:00
Sebastien Helleu 85bd530a88 Away check is now customizable (with new irc_away_check option) 2005-02-05 17:39:48 +00:00
Sebastien Helleu 8921e45815 Fixed many memory leaks 2005-01-31 23:33:59 +00:00
Sebastien Helleu 74b83e5294 Fixed small color bug in nicks 2005-01-27 22:28:30 +00:00
Sebastien Helleu 4fa9edeb56 Fixed bug when sending automatically who command during server split 2005-01-27 13:37:55 +00:00
Sebastien Helleu 4d3e76eb3e Fixed bug in message parser when connected to many servers 2005-01-27 00:11:06 +00:00
Sebastien Helleu c48ee3cd73 Fixed bug in message parser when connected to many servers 2005-01-26 23:54:29 +00:00
Sebastien Helleu 9a7b7af41c Away nicks are now displayed with another color 2005-01-26 22:21:58 +00:00
Sebastien Helleu 7debba0eca Added away indicator 2005-01-25 20:54:22 +00:00
Sebastien Helleu a0255a0a3a Updated doc with new config options 2005-01-23 18:29:20 +00:00
Sebastien Helleu 159fa3d806 Improved completion for /set command (now adds '=' at the end) 2005-01-23 18:24:08 +00:00
Sebastien Helleu 07686bf69b Min value for "irc_lag_min_show" is now 0 2005-01-23 17:59:18 +00:00
Sebastien Helleu f877e8be51 Fixed display bug for lag (missing space) 2005-01-23 17:31:53 +00:00
Sebastien Helleu 757d00ab48 Fixed crash when closing some private buffers 2005-01-23 16:32:40 +00:00
Sebastien Helleu ecb6ed6707 Wait "irc_lag_check" seconds for 1st lag check after connection to server 2005-01-23 10:05:38 +00:00
Sebastien Helleu 9d0b6fad72 Added lag indicator 2005-01-23 02:14:37 +00:00
Sebastien Helleu 63d6ee1007 Added nick completion in private buffers 2005-01-19 17:05:34 +00:00
Sebastien Helleu 6a1230de54 Added charset conversion in infobar 2005-01-19 17:04:55 +00:00
Sebastien Helleu 684f43298e Updated french translation 2005-01-19 06:25:07 +00:00
Sebastien Helleu 26af7b49fd Fixed possible crash with "/server del" and "/buffer close" commands 2005-01-19 06:21:27 +00:00
Sebastien Helleu 1ee8e1edb2 Allow nick completion for /quote command 2005-01-17 22:03:33 +00:00
Sebastien Helleu a5bbd513b7 Allow nick completion for /me command 2005-01-16 19:29:40 +00:00
Sebastien Helleu 88930e50dd Improved completion (now completes commands args), fixed color bug (gray removed, replaced by default), fixed crash when unknown section with option(s) in config file, fixed IRC commands: /op, /deop, /voice, /devoice 2005-01-16 11:52:22 +00:00
Sebastien Helleu 555999534e Fixed /quit command with arg and %v 2005-01-09 12:03:07 +00:00
Sebastien Helleu 64601fc662 Fixed /me command (now ok without parameter) 2005-01-08 17:37:23 +00:00
Sebastien Helleu d8360af103 Fixed display bug for title in first server buffer 2005-01-08 11:53:10 +00:00
Sebastien Helleu 55c042d604 Logs are now disabled by default (server/channel/private) 2005-01-08 11:40:23 +00:00
Sebastien Helleu 6d3c24361d Improved /set command: new colors, server options can be changed while WeeChat is running 2005-01-05 23:07:08 +00:00
Sebastien Helleu 2f5c9a8fd4 Fixed /away command, new [irc] config section, option "look_display_away" moved to "irc_display_away", added default away/part/quit messages in config file 2005-01-04 22:48:40 +00:00
Sebastien Helleu 96fc2c9aec Server & error messages now prefixed, /server command modified, ~/.weechat/logs dir can be read/write by user only 2005-01-03 23:40:22 +00:00
Sebastien Helleu aca19813ad Added chmod on ~/.weeechat/weechat.rc file (only onwer can read/write) 2005-01-02 16:22:20 +00:00
Sebastien Helleu 7dbaec1abf Replaced "curses" by "ncurses" 2005-01-02 13:07:19 +00:00
Sebastien Helleu 3b05b6bafe Reset away time when disconnected from server 2005-01-02 12:26:20 +00:00
Sebastien Helleu 82265b629b Fixed /away command (now ok when not away) 2005-01-02 11:44:33 +00:00
Sebastien Helleu a3e3113e4e Fixed /set command (now empty strings are allowed) 2005-01-02 02:45:06 +00:00
Sebastien Helleu b2c5317e17 Added new options look_charset_decode/look_charset_encode and /unset command. 2005-01-02 02:10:10 +00:00
Sebastien Helleu 9adb547b36 Version 0.1.0-cvs 2005-01-01 13:27:54 +00:00
Sebastien Helleu 14e833c257 Version 0.0.9 2005-01-01 12:31:19 +00:00
Sebastien Helleu de5af8a3b1 Added /buffer close, new keys: Alt-S (switch to server buffer), Alt-X (switch to first channel of next server) 2004-12-31 15:59:58 +00:00
Sebastien Helleu 37a2f80fae Fixed bug when parsing messages, now looking for for \r\n and \n to cut messages 2004-12-28 08:21:53 +00:00
Sebastien Helleu 0f95a48854 Fixed bug in notice display when no '!' is found in host 2004-12-28 07:52:56 +00:00
Sebastien Helleu 39b5f07d6f Inline help is now translated with gettext 2004-12-27 17:15:59 +00:00
Sebastien Helleu f4f2ec3668 auto-reconnection to server (new options: server_autoreconnect (on/off), server_autoreconnect_delay (in seconds)), disconnections are now managed without problem by WeeChat 2004-12-27 16:22:39 +00:00
Sebastien Helleu 486e55be02 Updated french translation 2004-12-27 12:53:58 +00:00
Sebastien Helleu c35f841b58 Major bug fixed when socket is closed by server (100% CPU usage fixed) 2004-12-27 12:50:51 +00:00
Sebastien Helleu 209fe89d27 Fixed bug when resizing window (input not displayed after resize) 2004-12-24 12:46:00 +00:00
Sebastien Helleu fca4840c4a Colors suppression in incoming messages is now ok (option look_remove_colors_from_msgs) 2004-12-23 11:31:34 +00:00
Sebastien Helleu 97ef63e2e6 Updated ChangeLog 2004-12-22 13:39:39 +00:00
Sebastien Helleu 17b409afe8 Fixed notice command (to server and display when received), fixed display of nick mode changes 2004-12-22 13:34:24 +00:00
Sebastien Helleu bf4bcd3b8c Updated doc for version 0.0.9-pre1 2004-12-22 10:57:45 +00:00
Sebastien Helleu 5233063825 Added keys: Ctrl+A (=home), Ctrl+E (=end), Ctrl+W (=ctrl+backspace) 2004-12-22 09:31:08 +00:00
Sebastien Helleu 9eeece2ccb Fixed typo 2004-12-22 01:16:27 +00:00
Sebastien Helleu 9e8f42c141 French translation for new config option "server_command_delay" 2004-12-21 19:55:21 +00:00
Sebastien Helleu 996343fc1d Added server_command_delay config option (delay in seconds after startup command) 2004-12-21 19:35:09 +00:00
Sebastien Helleu ecafff21ce Changes in main event loop: treats keyboard input & servers messages at same time 2004-12-21 19:11:38 +00:00
Sebastien Helleu cf9d394e3a Modified CFLAGS management (can now be customized) 2004-11-05 21:05:32 +00:00
Sebastien Helleu 0955167b6b Version 0.0.9-pre1 2004-10-30 12:14:14 +00:00
Sebastien Helleu 2b96cacd51 Version 0.0.8 2004-10-30 09:57:16 +00:00
Sebastien Helleu 45f7cdda18 Added debian dir 2004-10-30 09:53:47 +00:00
Sebastien Helleu dcf0119264 Removed file 2004-10-30 09:49:22 +00:00
Sebastien Helleu c98365803d Renamed man page weechat.1 to weechat-curses.1 2004-10-30 09:47:51 +00:00
Sebastien Helleu ebcf17c78d Fixed bug with /kick command (now ok with many words as reason) 2004-10-29 08:02:07 +00:00
Sebastien Helleu 022bf4d070 Fixed bug with /kick command (now ok with many words as reason) 2004-10-24 19:27:02 +00:00
Sebastien Helleu d37ec4791c Changed xahlexx mail 2004-10-22 19:45:41 +00:00
Sebastien Helleu e5038b4119 nickserv passwords hidden (new config option: log_hide_nickserv_pwd on/off) 2004-10-17 11:33:21 +00:00
Sebastien Helleu 482d327562 nickserv passwords hidden (new config option: log_hide_nickserv_pwd on/off) 2004-10-17 11:28:03 +00:00
Sebastien Helleu cb5269404c Fixed display bug with channel name and privates when kicked 2004-10-17 09:24:27 +00:00
Sebastien Helleu 76c4d4d427 Auto-rejoin channels when kicked (new config option: server_autorejoin on/off) 2004-10-17 09:13:54 +00:00
Sebastien Helleu 34c6051ffc Updated doc for version 0.0.8-pre2 2004-10-03 19:51:22 +00:00
Sebastien Helleu e69afa1401 Fixed call to plugin_exec_command when server is NULL 2004-10-03 16:40:16 +00:00
Sebastien Helleu 2a227141c4 Fixed bug in wee_perl_exec() when server == NULL 2004-10-03 16:37:56 +00:00
Sebastien Helleu 7ef14b95b6 Added IRC::command function for Perl scripts 2004-10-03 16:29:05 +00:00
Sebastien Helleu 4e5f1698ba Fixed bug when adding alias with same name as other 2004-10-03 12:43:32 +00:00
Sebastien Helleu 0a6945b6ed Command "/buffer notify" 2004-10-03 01:56:30 +00:00
Sebastien Helleu 046452b7e0 Perl plugin interface available 2004-10-01 12:40:39 +00:00
Sebastien Helleu d79dc3233a Fixed display bug: now redraws all DCC view when one or more DCC status are modified 2004-09-28 21:33:54 +00:00
Sebastien Helleu ce7f24ecc1 Log server/channel/private to file 2004-09-19 20:26:15 +00:00
Sebastien Helleu 0f718bf2c0 Commands "/buffer (list)" and "/buffer move" now ok 2004-09-19 09:46:11 +00:00
Sebastien Helleu a9e05f57ee Commands "/buffer (list)" and "/buffer move" now ok 2004-09-19 09:21:50 +00:00
Sebastien Helleu 24508e733c Fixed path for included .h files 2004-09-19 06:59:18 +00:00
Sebastien Helleu 9f5c71ca98 Fixed typo in french translation 2004-09-18 16:03:20 +00:00
Sebastien Helleu 491dff4238 Redraw status bar when closing DCC view 2004-09-18 16:02:50 +00:00
Sebastien Helleu 7b84ab4b71 Added some options for ./configure script 2004-09-16 22:08:03 +00:00
Sebastien Helleu c656661812 Added DCC control keys (Accept, Cancel, Remove, Close DCC view) 2004-09-16 20:01:56 +00:00
Sebastien Helleu 6753591f86 New /perl autoload command 2004-09-13 19:48:22 +00:00
Sebastien Helleu 4e8ed66a1e Updated french translations 2004-09-12 17:33:16 +00:00
Sebastien Helleu 0e47caf091 Away now announced in channels, and config option "look_display_away" added to enable/disable this feature 2004-09-12 17:22:45 +00:00
Sebastien Helleu 6100af949b Updated french translations 2004-09-12 11:47:36 +00:00
Sebastien Helleu 4b3d25175f Display DCC progress in realtime, added selected DCC color config option, move into DCC list is ok (scroll) 2004-09-11 14:54:11 +00:00
Sebastien Helleu b3fd00fc23 Removed debug message 2004-09-09 22:24:08 +00:00
Sebastien Helleu 1484e17ce1 DCC not auto accepted (depending on config), "~" replaced by home in dcc download dir, suffix displayed in filename received (if file is renamed), highlight for DCC buffer 2004-09-09 21:41:54 +00:00
Sebastien Helleu 9759d72d3d Incoming DCC file 2004-09-08 21:48:45 +00:00
Sebastien Helleu 92eb995917 Receive DCC packets (for DCC file) 2004-09-08 16:56:56 +00:00
Sebastien Helleu 1425ee40f4 Fixed crash when resizing terminal to very small size, "-MORE-" message is now erased when switching to another buffer 2004-09-08 16:41:15 +00:00
Sebastien Helleu c8eae742b9 Version 0.0.8-pre2: DCC window with Alt-D, /query command now reopens private buffer if already opened 2004-08-31 22:53:33 +00:00
Sebastien Helleu 441dd2313f Updated doc for v0.0.7 (date) 2004-08-27 20:55:36 +00:00
Sebastien Helleu aea603b6ed Added DCC buffer type 2004-08-26 22:20:04 +00:00
Sebastien Helleu 9c6f2fcb8c Added Ctrl-L key to redraw terminal 2004-08-25 20:51:25 +00:00
Sebastien Helleu 74ee53c102 Added Ctrl-L key to redraw terminal 2004-08-25 20:51:25 +00:00
Sebastien Helleu 649fd216ed After hotlist clear, initial buffer for loop is current buffer 2004-08-10 18:07:43 +00:00
Sebastien Helleu 9278198964 Added key for clearing hotlist (Alt-R) 2004-08-10 18:02:38 +00:00
Sebastien Helleu 2ff30b15f2 Version 0.0.8-pre1 2004-08-08 21:25:52 +00:00
154 changed files with 37748 additions and 8174 deletions
+17 -11
View File
@@ -1,29 +1,35 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
Developers:
----------
All developers are connected to IRC:
server: irc.freenode.net, channel: #weechat
Developer:
---------
FlashCode <flashcode@flashtux.org>
Web : http://www.flashtux.org
IRC : nick is "FlashCode"
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
Testers:
-------
Bounga <bounga@altern.org>
Web : http://bounga.ath.cx
IRC : nick is "Bounga"
IRC : nick is "Bounga" @ irc.freenode.net
Jabber: Bounga@jabber.org
ICQ : 178297842
Xahlexx <xahlexx@tuxisland.org>
Web : http://www.tuxisland.org
IRC : nick is "xahlexx"
Xahlexx <xahlexx@weeland.org>
Web : http://www.weeland.org
IRC : nick is "xahlexx" @ irc.freenode.net
=====
Whole team is connected to IRC:
server: irc.freenode.net, channel: #weechat
See README file for licence detail.
+3 -9
View File
@@ -1,21 +1,15 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2004-08-08
WeeChat known bugs, 2005-02-12
- ./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
- too much nicks in the channel (> height of window) => some nicks are hidden
- when quitting WeeChat term title is not restored (if look_set_title is ON)
- command name for /server can not contain spaces
- wrong alias is not created and not saved when quitting WeeChat
- when many WeeChat are launched, log file is not properly written (cleared by
each WeeChat at startup)
- display problems with old Konsole versions (Kde terminal)
- display problems with old Konsole versions (Kde terminal) (???)
+83 -1
View File
@@ -1,9 +1,91 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2004-08-08
ChangeLog - 2005-03-20
Version 0.1.1 (2005-03-20):
* added nicks count for channel buffers
* added FIFO pipe for remote control
* added crash dump when WeeChat receives SIGSEGV (Segmentation fault)
* added new display engine: doesn't cut words at end of lines
* added DCC send and DCC chat
* added /halfop & /dehalfop commands, fixed halfop display bug in nicklist
* added /ban, /unban and /kickban commands
* added spanish translation
* added --irc-commands and --weechat-commands command line options
* connection to IRC server is now made by child process (non blocking)
* added support for UnrealIrcd ("~" for chan owner, "&" for chan admin)
* new key for window switch (now: F5/F6=switch buffer, F7/F8=switch window)
* on server buffer, only server messages are logged
* improved /help command output
* plugins messages are logged with new config option (log_plugin_msg)
* fixed /kick command
* fixed /invite command (and now invite requests are displayed)
* fixed /buffer close command (now ok when disconnected from server)
* fixed display bugs when many windows are opened
Version 0.1.0 (2005-02-12):
* improved /window command: now split and merge are ok
* away nicks are now displayed with another color (new option: "irc_away_check")
* added away indicator in status bar
* added lag indicator (and auto-disconnect after a delay if important lag)
* improved completion: now completes commands arguments (IRC and internal),
when only one completion matches, completion mechanism is stoped (to
complete command arg for example)
* improved /set command: empty strings are allowed, new colors, server
options can be changed while WeeChat is running
* added default away/part/quit messages in config file
* new [irc] section in config file, option "look_display_away" moved to
"irc_display_away"
* server messages & errors are all prefixed (by 3 chars, like '-@-')
* added new options for charset (UTF-8 support): look_charset_decode,
look_charset_encode and look_charset_internal
* fixed many memory leaks
* fixed colors bug: removed "gray" color (replaced by "default"), colors are
ok when terminal has white (or light) background
* fixed crash when resizing terminal to small size
* fixed crash when multiple servers and big messages received from server
* fixed crash when closing some private buffers
* fixed crash when unknown section with option(s) in config file
* fixed /op, /deop, /voice, /devoice (now ok with many nicks)
* fixed /me command (now ok without parameter)
* fixed /away command (now ok if not away)
* logs are now disabled by default (server/channel/private)
Version 0.0.9 (2005-01-01):
* auto-reconnection to server (new options: server_autoreconnect (on/off),
server_autoreconnect_delay (in seconds))
* major bug fixed when socket is closed by server (100% CPU usage fixed),
and disconnections are now ok (all channels are "closed", history is still
visible, and buffer will be used again if reconnection to server)
* option "look_remove_colors_from_msgs" is now working
* fixed display of nick mode changes
* new command "/buffer close" (close any server/channel/private buffer)
* /notice command fixed (and display when received from server)
* new keys: Ctrl+A (=home), Ctrl+E (=end), Ctrl+W (=Ctrl+Backspace),
Alt-S (switch to server buffer), Alt-X (switch to first channel of next
server)
* added new config option: "server_command_delay" (delay in seconds after
startup command for each server)
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
+26 -14
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2004-05-31
WeeChat FAQ, 2005-02-06
=======================
Intended audience:
@@ -53,7 +53,7 @@ A: Because WeeChat is very light and has new features.
* developed from scratch (not based on any other IRC client)
* multi-platform
* 100% GPL and free
This is the "geekest Irc client" ;)
This is the "geekest" IRC client ;)
2.2
@@ -65,13 +65,24 @@ A: For help you can type /help. For help about a command, type /help command.
2.3
================================================================================
Q: How can I customize key bindings?
Q: I don't see come chars with accents, what can I do?
A: Today you can't do that. This will be available in a future version.
A: You have to setup charset used for decoding, encoding, and internal WeeChat
charset.
Change value of option "look_charset_decode" to "UTF-8".
Option "look_charset_internal" should not be changed (default is
"ISO-8859-1").
2.4
================================================================================
Q: How can I customize key bindings?
A: Today you can't do that. This is planed for a future version.
2.5
================================================================================
Q: How can I load Perl scripts?
Are Perl scripts compatible with X-chat or/and Irssi ?
@@ -79,21 +90,22 @@ 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.5
================================================================================
Q: How can I load Python scripts?
A: Today Python interface is not developed, so can't load any Python script.
WeeChat perl scripts are compatible with X-Chat, but not with Irssi,
sorry ;)
2.6
================================================================================
Q: How can I load Python scripts?
A: Today Python interface is not developed, so you can't load any Python script.
2.7
================================================================================
Q: How can I load Ruby scripts?
A: Today Ruby interface is not developed, so can't load any Ruby script.
A: Today Ruby interface is not developed, so you can't load any Ruby script.
3.1
@@ -154,4 +166,4 @@ A: There's many tasks to do (code, documentation, ...)
================================================================================
Q: Can I give money or other things to WeeChat developers?
A: No.
A: Beer is welcome :)
+18 -7
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2004-05-31
WeeChat FAQ, 2005-02-06
=======================
Public concerné :
@@ -57,7 +57,7 @@ R: Parce que WeeChat est tr
* 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" ;)
C'est le client IRC le plus "geek" ;)
2.2
@@ -70,13 +70,24 @@ R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
2.3
================================================================================
Q: Je ne vois pas bien certains accents dans WeeChat, que faire ?
R: Il faut configurer le charset utilisé pour le décodage, l'encodage ainsi que
le charset interne à WeeChat.
Modifiez la valeur de l'option "look_charset_decode" en "UTF-8".
L'option "look_charset_internal" ne devrait pas être modifiée (par défaut
"ISO-8859-1").
2.4
================================================================================
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
2.5
================================================================================
Q: Comment puis-je charger des scripts Perl ?
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
@@ -85,11 +96,11 @@ 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,
Les scripts Perl WeeChat sont compatibles avec X-Chat, mais pas Irssi,
désolé ;)
2.5
2.6
================================================================================
Q: Comment puis-je charger les scripts Python ?
@@ -97,7 +108,7 @@ R: Aujourd'hui l'interface Python n'est pas d
Vous ne pouvez donc charger aucun script Python.
2.6
2.7
================================================================================
Q: Comment puis-je charger des scripts Ruby ?
@@ -169,4 +180,4 @@ R: Il y a plusieurs choses
================================================================================
Q: Puis-je donner de l'argent ou d'autres choses aux développeurs WeeChat ?
R: Non.
R: La bière est la bienvenue :)
+4 -2
View File
@@ -2,9 +2,11 @@ WeeChat - Installation instructions
===================================
1) Run './configure'
options: --disable-curses : do not build Curses interface
options: --enable-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=X : X=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 ;)
+9 -3
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,6 +17,12 @@
SUBDIRS = po intl src
EXTRA_DIST = weechat.1 BUGS FAQ FAQ.fr
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
+16
View File
@@ -1,6 +1,22 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-03-20
WeeChat 0.1.1 released.
* FlashCode, 2005-02-12
WeeChat 0.1.0 released.
* FlashCode, 2005-01-01
WeeChat 0.0.9 released.
* FlashCode, 2004-10-30
WeeChat 0.0.8 released.
* FlashCode, 2004-08-08
WeeChat 0.0.7 released.
+3 -6
View File
@@ -22,10 +22,7 @@ Features
Copyright
---------
WeeChat (c) Copyright 2004
by: FlashCode <flashcode@flashtux.org>
Xahlexx <xahlex@tuxisland.org>
Bounga <bounga@altern.org>
WeeChat (c) Copyright 2003-2005 by FlashCode <flashcode@flashtux.org>
(see AUTHORS file if you want to contact authors)
WeeChat is distributed under GPL licence (see COPYING file for complete license):
@@ -46,6 +43,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
+13 -20
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2004-08-08
TODO - 2005-03-20
Legend:
# done
@@ -10,34 +10,30 @@ Legend:
? is this really necessary?
v0.0.8:
v0.1.1:
------
* General:
- Windows version
+ Windows version
+ Solaris version
+ *BSD version
* IRC protocol:
+ "/dcc" command (for chat and sending/receiving files)
# "/dcc send" command
# "/dcc chat" command (and incoming DCC chats)
- customizable CTCP version reply
* Interface:
+ "/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)
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* Configuration:
+ add missing options for config file
- add key bindings to config file
* TCP/IP communication:
# connect to server with child process (background)
Future versions:
---------------
* General:
- *BSD version
* IRC protocol:
- complete "/list" command: add regexp search, display only channels that
match regexp
@@ -61,18 +57,12 @@ Future versions:
- "/last": command to look for text in previous messages
* Interface:
+ Gtk GUI
- color for nicks (except own nick) when nick colors are disabled
- interpret special chars in messages (color & bold for example)
- add lag indicator
- improve completion (for example complete command parameters when possible)
- understand incomplete commands if unambigous (for example: /he for /help is ok)
- tab key with empty command line should switch to next window (like F7)
- log chats to file
? Qt GUI
* TCP/IP communication:
- connect to server with child process (background)
- proxy support
- SSL support
- IPv6 protocol implementation
@@ -82,3 +72,6 @@ Future versions:
- "/python load" and "/python unload" commands to (un)load Python scripts
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
* Configuration:
- add key bindings to config file
+29 -27
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.0.7, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.1, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.0.7])
AM_INIT_AUTOMAKE([weechat], [0.1.1])
# Checks for programs.
AC_PROG_CC
@@ -30,11 +30,11 @@ AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Gettext
ALL_LINGUAS="fr"
ALL_LINGUAS="fr es"
AM_GNU_GETTEXT
# Checks for libraries.
AC_CHECK_LIB([curses], [initscr], LIBCURSES_FOUND=1, LIBCURSES_FOUND=0)
AC_CHECK_LIB([ncurses], [initscr], LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
# Checks for header files.
AC_HEADER_STDC
@@ -45,8 +45,6 @@ AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
@@ -55,11 +53,11 @@ AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(curses, [ --disable-curses Turn off Curses interface (default=auto)],,enable_curses=yes)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],,enable_ncurses=yes)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
enable_plugins="no"
enable_python="no"
@@ -67,19 +65,19 @@ PYTHON_CFLAGS=
enable_ruby="no"
RUBY_CFLAGS=
AM_CONDITIONAL(GUI_CURSES, test "$enable_curses" = "yes")
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
# AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
# AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
if test "x$enable_curses" = "xyes" ; then
if test "$LIBCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([Curses library not found! Install Curses library or run ./configure with --disable-curses parameter.])
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([ncurses library not found! Install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
CURSES_LIBS="-lcurses"
AC_SUBST(CURSES_LIBS)
NCURSES_LIBS="-lncurses"
AC_SUBST(NCURSES_LIBS)
fi
if test "x$enable_gtk" = "xyes" ; then
@@ -108,10 +106,14 @@ fi
AC_SUBST(PLUGINS_LIBS)
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
CFLAGS="-O2"
fi
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
CFLAGS="-Wall -W -pipe -O2 -g"
CFLAGS="-Wall -W $CFLAGS -pipe -g"
else
CFLAGS="-Wall -W -pipe -O2"
CFLAGS="-Wall -W $CFLAGS -pipe"
fi
if test "x$debug" = "x2" ; then
@@ -135,8 +137,8 @@ echo
echo $PACKAGE $VERSION
listgui=
if test "x$enable_curses" = "xyes" ; then
listgui="$listgui Curses"
if test "x$enable_ncurses" = "xyes" ; then
listgui="$listgui ncurses"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
@@ -146,16 +148,16 @@ if test "x$enable_qt" = "xyes" ; then
fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([No interface specified... Please specify at least Curses, Gtk or Qt.])
AC_MSG_ERROR([No interface specified... Please specify at least ncurses, Gtk or Qt.])
fi
msg_debug_compiler="No"
msg_debug_verbose="No"
msg_debug_compiler="no"
msg_debug_verbose="no"
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
msg_debug_compiler="Yes"
msg_debug_compiler="yes"
fi
if test "x$debug" = "x2" ; then
msg_debug_verbose="Yes"
msg_debug_verbose="yes"
fi
echo
+24
View File
@@ -1,3 +1,27 @@
weechat (0.1.1-1) unstable; urgency=low
* WeeChat version 0.1.1, see ChangeLog for detail.
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 20 Mar 2005 08:00:00 +0200
weechat (0.1.0-1) unstable; urgency=low
* WeeChat version 0.1.0, see ChangeLog for detail.
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 12 Feb 2005 12:00:00 +0200
weechat (0.0.9-1) unstable; urgency=low
* WeeChat version 0.0.9, see ChangeLog for detail.
-- FlashCode <flashcode@flashtux.org> Sat, 01 Jan 2005 13:00:00 +0200
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.
+4 -4
View File
@@ -1,13 +1,13 @@
Source: weechat
Section: net
Priority: optional
Maintainer: FlashCode <flashcode@flashtux.org>
Build-Depends: debhelper (>> 4.0.0), libncurses5 (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
Standards-Version: 3.5.8
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
Standards-Version: 3.6.1
Package: weechat
Architecture: all
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${Source-Version})
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${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.
+2 -2
View File
@@ -1,9 +1,9 @@
This package was debianized by FlashCode <flashcode@flashtux.org> on
Sat, 08 Aug 2004 21:00:00 +0200.
Sat, 20 Mar 2005 08:00: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:
+20 -19
View File
@@ -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,8 @@ endif
configure: configure-stamp
configure-stamp:
dh_testdir
./configure --prefix=/usr --sysconfdir=/etc --enable-perl
./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man \
--enable-perl
touch configure-stamp
@@ -32,7 +30,7 @@ clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
-$(MAKE) clean
-$(MAKE) distclean
dh_clean
install: build
@@ -43,30 +41,33 @@ 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_testdir -pweechat-common -pweechat
dh_testroot -pweechat-common -pweechat
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
dh_shlibdeps -pweechat-common
dh_gencontrol -pweechat-common
dh_md5sums -pweechat-common
dh_builddeb -pweechat-common
dh_compress -pweechat-common -pweechat
dh_link -pweechat usr/share/doc/weechat-common usr/share/doc/weechat
dh_fixperms -pweechat-common -pweechat
dh_installdeb -pweechat-common -pweechat
dh_shlibdeps -pweechat-common -pweechat
dh_gencontrol -pweechat-common -pweechat
dh_md5sums -pweechat-common -pweechat
dh_builddeb -pweechat-common -pweechat
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_link -a
# dh_installchangelogs -a
# dh_installdocs -a
dh_installman weechat-curses.1 -pweechat-curses
dh_link -a usr/share/doc/weechat-common usr/share/doc/weechat-curses
dh_strip -a
dh_compress -a
dh_fixperms -a
-3
View File
@@ -1,10 +1,7 @@
AUTHORS
BUGS
ChangeLog
COPYING
FAQ
FAQ.fr
INSTALL
NEWS
README
TODO
+1
View File
@@ -0,0 +1 @@
usr/share/locale
+5 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2003 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,15 +15,18 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
all: weechat_doc_fr.texi weechat_doc_en.texi weechat_doc_pt.texi
all: weechat_doc_fr.texi weechat_doc_en.texi weechat_doc_pt.texi weechat_doc_es.texi
export LANG=fr_FR && makeinfo --html --no-split --number-sections weechat_doc_fr.texi
export LANG=fr_FR && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_fr.texi >weechat_doc_fr.txt
export LANG=en_EN && makeinfo --html --no-split --number-sections weechat_doc_en.texi
export LANG=en_EN && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_en.texi >weechat_doc_en.txt
export LANG=es_ES && makeinfo --html --no-split --number-sections weechat_doc_es.texi
export LANG=es_ES && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_es.texi >weechat_doc_es.txt
export LANG=pt_PT && makeinfo --html --no-split --number-sections weechat_doc_pt.texi
export LANG=pt_PT && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_pt.texi >weechat_doc_pt.txt
export LANG=fr_FR && texi2pdf weechat_doc_fr.texi
export LANG=en_EN && texi2pdf weechat_doc_en.texi
export LANG=es_ES && texi2pdf weechat_doc_es.texi
export LANG=pt_PT && texi2pdf weechat_doc_pt.texi
clean:
+699 -65
View File
@@ -6,7 +6,7 @@
@c WeeChat documentation (english version)
@c
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
@c Copyright (c) 2005 by FlashCode <flashcode@flashtux.org>
@c
@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
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.0.7 - July, 04 2004
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
@image{weechat_image}
@@ -46,9 +46,9 @@
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}@*
@uref{http://weechat.flashtux.org/doc.php}@*
@*
Copyright @copyright{} 2004 FlashCode
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
@*
This document may be used under the terms the GNU General Public License
@@ -209,6 +209,7 @@ Then follow instructions for source package - @xref{Source package}.
* Config file::
* Key bindings::
* WeeChat commands::
* FIFO pipe::
@end menu
@node Run WeeChat, Config file, Usage, Usage
@@ -244,9 +245,10 @@ set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
@node Config file, Key bindings, Run WeeChat, Usage
@section Config file
Here is a list of all options for config file:@*
List of options for config file:@*
@table @kbd
@item look_set_title
Set title for window (terminal for Curses GUI) with name & version@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -259,6 +261,15 @@ 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_charset_decode
Charset for decoding messages from server, examples: UTF-8, ISO-8859-1 (if empty, messages are not converted)@*
Type: string (any string), default value: 'UTF-8'@*
@item look_charset_encode
Charset for encoding messages sent to server, examples: UFT-8, ISO-8859-1 (if empty, local charset is used)@*
Type: string (any string), default value: ''@*
@item look_charset_internal
Internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)@*
Type: string (any string), default value: 'ISO-8859-1'@*
@item look_color_nicks
Display nick names with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -297,22 +308,22 @@ 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'@*
Type: string (any string), default value: '%B, %A %d %Y - %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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_chat_time
Color for time in chat window@*
Type: color (Curses or Gtk color), default value: 'gray'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_chat_time_sep
Color for time separator (chat window)@*
Type: color (Curses or Gtk color), default value: 'brown'@*
@@ -342,16 +353,19 @@ 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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@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: 'lightred'@*
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: 'yellow'@*
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: 'lightmagenta'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_status_more
Color for window with new data (status bar)@*
Type: color (Curses or Gtk color), default value: 'white'@*
@@ -369,7 +383,7 @@ 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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_input_channel
Color for input text (channel name)@*
Type: color (Curses or Gtk color), default value: 'white'@*
@@ -381,7 +395,16 @@ 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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_nick_away
Color for away nicknames@*
Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_nick_chanowner
Color for chan owner symbol (specific to unrealircd)@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_nick_chanadmin
Color for chan admin symbol (specific to unrealircd)@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_nick_op
Color for operator symbol@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@@ -399,55 +422,103 @@ 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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@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: 'lightcyan'@*
@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_channels
@item log_auto_server
Automatically log server messages@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item log_auto_channel
Automatically log channel chats@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item log_auto_private
Automatically log private chats@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item log_plugin_msg
Log messages from plugins (scripts)@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item log_path
Path for WeeChat log files@*
Type: string (any string), default value: '~/.weechat/logs/'@*
@item log_name
Name for log files (%S == irc server name, %N == channel name (or nickname if private chat)@*
Type: string (any string), default value: '%S,%N.weechatlog'@*
@item log_timestamp
Timestamp for log (see man strftime for date/time specifiers)@*
Type: string (any string), default value: '~'@*
@item log_start_string
Text written when starting new log file (see man strftime for date/time specifiers)@*
Type: string (any string), default value: '--- Log started %a %b %d %Y %H:%M:%s'@*
@item log_end_string
Text written when ending log file (see man strftime for date/time specifiers)@*
Type: string (any string), default value: '--- Log ended %a %b %d %Y %H:%M:%s'@*
Type: string (any string), default value: '%Y %b %d %H:%M:%S'@*
@item log_hide_nickserv_pwd
Hide password displayed by nickserv@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item irc_display_away
Display message to all channels when (un)marking as away@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item irc_default_msg_away
Default message when away@*
Type: string (any string), default value: 'away'@*
@item irc_default_msg_part
Default part message (leaving channel)@*
Type: string (any string), default value: ''@*
@item irc_default_msg_quit
Default quit message ('%v' will be replaced by WeeChat version in string)@*
Type: string (any string), default value: 'WeeChat %v'@*
@item irc_away_check
Interval between two checks for away (in minutes, 0 = never check)@*
Type: integer (values: between 0 and 2147483647), default value: 0@*
@item irc_lag_check
Interval between two checks for lag (in seconds)@*
Type: integer (values: between 30 and 2147483647), default value: 60@*
@item irc_lag_min_show
Minimum lag to show (in seconds)@*
Type: integer (values: between 0 and 2147483647), default value: 1@*
@item irc_lag_disconnect
Disconnect after important lag (in minutes, 0 = never disconnect)@*
Type: integer (values: between 0 and 2147483647), default value: 5@*
@item dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item dcc_auto_accept_max_size
Maximum size for incoming file when automatically accepted@*
Type: integer (values: between 0 and 2147483647), default value: 0@*
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'@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@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: 65536)@*
Type: integer (values: between 1024 and 102400), default value: 65536@*
@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_convert_spaces
Convert spaces to underscores when sending files@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item dcc_auto_rename
Rename incoming files if already exists (add '.1', '.2', ...)@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -472,6 +543,12 @@ 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_autoreconnect
Automatically reconnect to server when disconnected@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item server_autoreconnect_delay
Delay (in seconds) before trying again to reconnect to server@*
Type: integer (values: between 0 and 65535), default value: 30@*
@item server_address
IP address or hostname of IRC server@*
Type: string (any string), default value: ''@*
@@ -499,9 +576,16 @@ 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_command_delay
Delay (in seconds) after command was executed (example: give some time for authentication)@*
Type: integer (values: between 0 and 5), default value: 0@*
@item server_autojoin
Comma separated list of channels to join when connected to server@*
Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@end table
Colors for Curses GUI are:@*
@@ -535,8 +619,6 @@ Colors for Curses GUI are:@*
@item
@kbd{lightcyan}: light cyan
@item
@kbd{gray}: gray
@item
@kbd{white}: white
@end itemize
@@ -550,13 +632,16 @@ Go to previous / next char in command line@*
@item Ctrl + left arrow / Ctrl + right arrow
Go to previous / next word in command line@*
@*
@item Home / End
Go to the beginning / end of command line@*
@item Home / Ctrl + A
Go to the beginning of command line@*
@*
@item End / Ctrl + E
Go to the end of command line@*
@*
@item Backspace / Delete
Erase previous / next char of command line@*
@*
@item Ctrl + Backspace
@item Ctrl + Backspace / Ctrl + W
Erase previous word of command line@*
@*
@item Tab
@@ -574,30 +659,563 @@ Call again last commands/messages@*
@item PageUp / PageDown
Show buffer history@*
@*
@item F6 / F7
@item F5 / F6
Switch to previous / next buffer@*
@*
@item F8
Switch to next window@*
@*
@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 + digit (1-9)
Switch to buffer by number@*
@item F7 / F8
Switch to previous / next window@*
@*
@item F10
Remove last infobar message@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@item Alt + left arrow / Alt + right arrow
Same as F5 / F6@*
@*
@item Alt + A
Switch to next buffer with activity (with priority: highlight, message, other)@*
@*
@item Alt + D
Display current DCC@*
@*
@item Alt + R
Clear hotlist (activity notification on other buffers)@*
@*
@item Alt + S
Switch to server buffer@*
@*
@item Alt + X
Switch to first channel of next server (or server buffer if no channel is opened)@*
@*
@item Alt + digit (1-9)
Switch to buffer by number@*
@*
@end table
@node WeeChat commands, , Key bindings, Usage
@node WeeChat commands, FIFO pipe, Key bindings, Usage
@section WeeChat commands
NOT WRITTEN!
WeeChat internal commands:@*
@table @kbd
@item alias [alias_name [command [arguments]]
@*
create an alias for a command@*
@*
alias_name: name of alias@*
command: command name (WeeChat or IRC command, without first '/')@*
arguments: arguments for command@*
@*
@item buffer [action | number]
@*
manage buffers@*
@*
action: action to do:@*
move: move buffer in the list (may be relative, for example -1)@*
close: close buffer (for channel: same as /part without part message)@*
list: list opened buffers (no parameter implies this list)@*
notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)@*
number: jump to buffer by number@*
@*
@item clear [-all]
@*
clear window(s)@*
@*
-all: clear all windows@*
@*
@item connect [servername]
@*
connect to a server@*
@*
servername: server name to connect@*
@*
@item disconnect [servername]
@*
disconnect from a server@*
@*
servername: server name to disconnect@*
@*
@item debug dump
@*
print debug messages@*
@*
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)@*
@*
@item help [command]
@*
display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item perl [load filename] | [autoload] | [unload]
@*
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@*
list, add or remove servers@*
@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
nick3: second alternate nick for server@*
username: user name@*
realname: real name of user@*
@*
@item save [file]
@*
save config to disk@*
@*
file: filename for writing config@*
@*
@item set [option[=value]]
@*
set config parameters@*
@*
option: name of an option@*
value: value for option@*
@*
@item unalias alias_name
@*
remove an alias@*
@*
alias_name: name of alias to remove@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
manage windows@*
@*
list: list opened windows (no parameter implies this list)@*
splith: split current window horizontally@*
splitv: split current window vertically@*
merge: merge window with another@*
@*
@end table
IRC commands:@*
@table @kbd
@item admin [target]
@*
find information about the administrator of the server@*
@*
target: server@*
@*
@item away [-all] [message]
@*
toggle away status@*
@*
-all: toggle away status on all connected servers@*
message: message for away (if no message is given, away status is removed)@*
@*
@item ban [channel] [nickname [nickname ...]]
@*
bans nicks or hosts@*
@*
channel: channel for ban@*
nickname: user or host to ban@*
@*
@item ctcp nickname type
@*
send a ctcp message@*
@*
nickname: user to send ctcp to@*
type: "action" or "version"@*
@*
@item dcc action [nickname [file]]
@*
starts DCC (file or chat) or close chat@*
@*
action: 'send' (file) or 'chat' or 'close' (chat)@*
nickname: nickname to send file or chat@*
file: filename (on local host)@*
@*
@item dehalfop nickname [nickname]
@*
removes half channel operator status from nickname(s)@*
@*
@item deop nickname [nickname]
@*
removes channel operator status from nickname(s)@*
@*
@item devoice nickname [nickname]
@*
removes voice from nickname(s)@*
@*
@item die
@*
shutdown the server@*
@*
@item halfop nickname [nickname]
@*
gives half channel operator status to nickname(s)@*
@*
@item info [target]
@*
get information describing the server@*
@*
target: server name@*
@*
@item invite nickname channel
@*
invite a nick on a channel@*
@*
nickname: nick to invite@*
channel: channel to invite@*
@*
@item ison nickname [nickname ...]
@*
check if a nickname is currently on IRC@*
@*
nickname: nickname@*
@*
@item join channel[,channel] [key[,key]]
@*
join a channel@*
@*
channel: channel name to join@*
key: key to join the channel@*
@*
@item kick [channel] nickname [comment]
@*
forcibly remove a user from a channel@*
@*
channel: channel where user is@*
nickname: nickname to kick@*
comment: comment for kick@*
@*
@item kickban [channel] nickname [comment]
@*
kicks and bans a nick from a channel@*
@*
channel: channel where user is@*
nickname: nickname to kick and ban@*
comment: comment for kick@*
@*
@item kill nickname comment
@*
close client-server connection@*
@*
nickname: nickname@*
comment: comment for kill@*
@*
@item links [[server] server_mask]
@*
list all servernames which are known by the server answering the query@*
@*
server: this server should answer the query@*
server_mask: list of servers must match this mask@*
@*
@item list [channel[,channel] [server]]
@*
list channels and their topic@*
@*
channel: channel to list@*
server: server name@*
@*
@item lusers [mask [target]]
@*
get statistics about the size of the IRC network@*
@*
mask: servers matching the mask only@*
target: server for forwarding request@*
@*
@item me message
@*
send a ctcp action to the current channel@*
@*
message: message to send@*
@*
@item mode @{ channel @{[+|-]|o|p|s|i|t|n|b|v@} [limit] [user] [ban mask] @} | @{ nickname @{[+|-]|i|w|s|o@} @}
@*
change channel or user mode@*
@*
channel modes:@*
channel: channel name to modify@*
o: give/take channel operator privileges@*
p: private channel flag@*
s: secret channel flag@*
i: invite-only channel flag@*
t: topic settable by channel operator only flag@*
n: no messages to channel from clients on the outside@*
m: moderated channel@*
l: set the user limit to channel@*
b: set a ban mask to keep users out@*
v: give/take the ability to speak on a moderated channel@*
k: set a channel key (password)@*
user modes:@*
nickname: nickname to modify@*
i: mark a user as invisible@*
s: mark a user for receive server notices@*
w: user receives wallops@*
o: operator flag@*
@*
@item motd [target]
@*
get the "Message Of The Day"@*
@*
target: server name@*
@*
@item msg receiver[,receiver] text
@*
send message to a nick or channel@*
@*
receiver: nick or channel (may be mask, '*' = current channel)@*
text: text to send@*
@*
@item names [channel[,channel]]
@*
list nicknames on channels@*
@*
channel: channel name@*
@*
@item nick nickname
@*
change current nickname@*
@*
nickname: new nickname for current IRC server@*
@*
@item notice nickname text
@*
send notice message to user@*
@*
nickname: user to send notice to@*
text: text to send@*
@*
@item op nickname [nickname]
@*
gives channel operator status to nickname(s)@*
@*
@item oper user password
@*
get operator privileges@*
@*
user/password: used to get privileges on current IRC server@*
@*
@item part [channel[,channel]] [part_message]
@*
leave a channel@*
@*
channel: channel name to leave@*
part_message: part message (displayed to other users)@*
@*
@item ping server1 [server2]
@*
ping server@*
@*
server1: server to ping@*
server2: forward ping to this server@*
@*
@item pong daemon [daemon2]
@*
answer to a ping message@*
@*
daemon: daemon who has responded to Ping message@*
daemon2: forward message to this daemon@*
@*
@item query nickname [text]
@*
send a private message to a nick@*
@*
nickname: nickname for private conversation@*
text: text to send@*
@*
@item quit [quit_message]
@*
close all connections & quit@*
@*
quit_message: quit message (displayed to other users)@*
@*
@item quote data
@*
send raw data to server without parsing@*
@*
data: raw data to send@*
@*
@item rehash
@*
tell the server to reload its config file@*
@*
@item restart
@*
tell the server to restart itself@*
@*
@item service nickname reserved distribution type reserved info
@*
register a new service@*
@*
distribution: visibility of service@*
type: reserved for future usage@*
@*
@item servlist [mask [type]]
@*
list services currently connected to the network@*
@*
mask: list only services matching this mask@*
type: list only services of this type@*
@*
@item squery service text
@*
deliver a message to a service@*
@*
service: name of service@*
text: text to send@*
@*
@item squit server comment
@*
disconnect server links@*
@*
server: server name@*
comment: comment for quit@*
@*
@item stats [query [server]]
@*
query statistics about server@*
@*
query: c/h/i/k/l/m/o/y/u (see RFC1459)@*
server: server name@*
@*
@item summon user [target [channel]]
@*
give users who are on a host running an IRC server a message asking them to please join IRC@*
@*
user: username@*
target: server name@*
channel: channel name@*
@*
@item time [target]
@*
query local time from server@*
@*
target: query time from specified server@*
@*
@item topic [channel] [topic]
@*
get/set channel topic@*
@*
channel: channel name@*
topic: new topic for channel (if topic is "-delete" then topic is deleted)@*
@*
@item trace [target]
@*
find the route to specific server@*
@*
target: server@*
@*
@item unban [channel] nickname [nickname ...]
@*
unbans nicks or hosts@*
@*
channel: channel for unban@*
nickname: user or host to unban@*
@*
@item userhost nickname [nickname ...]
@*
return a list of information about nicknames@*
@*
nickname: nickname@*
@*
@item users [target]
@*
list of users logged into the server@*
@*
target: server@*
@*
@item version [server | nickname]
@*
gives the version info of nick or server (current or specified)@*
@*
server: server name@*
nickname: nickname@*
@*
@item voice nickname [nickname]
@*
gives voice to nickname(s)@*
@*
@item wallops text
@*
send a message to all currently connected users who have set the 'w' user mode for themselves@*
@*
text to send@*
@*
@item who [mask ["o"]]
@*
generate a query which returns a list of information@*
@*
mask: only information which match this mask@*
o: only operators are returned according to the mask supplied@*
@*
@item whois [server] nickname[,nickname]
@*
query information about user(s)@*
@*
server: server name@*
nickname: nickname (may be a mask)@*
@*
@item whowas nickname [,nickname [,nickname ...]] [count [target]]
@*
ask for information about a nickname which no longer exists@*
@*
nickname: nickname to search@*
count: number of replies to return (full search if negative number)@*
target: reply should match this mask@*
@*
@end table
@node FIFO pipe, , WeeChat commands, Usage
@section FIFO pipe
You can remote control WeeChat, by sending commands or text to a FIFO pipe
(you have to enable option "irc_fifo_pipe", it is disabled by default).@*
The FIFO pipe is located in ~/.weechat/ and is called "weechat_fifo_xxxxx"
(where xxxxx is the process ID (PID) of running WeeChat).@*
So if many WeeChat are running, you have many FIFO pipe, one for each session.@*
@*
The syntax for the FIFO pipe commands/text is:@*
@command{server,channel *text or command here}@*
where server and channel are optional, but if channel is here, server should be too.@*
@*
Some examples:
@table @asis
@item @bullet{} change your nick on freenode to "mynick|out":
@*
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on #weechat channel:
@*
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
@*
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
You can write a script to send command to all running WeeChat at same time, for example:@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
for fifo in $(/bin/ls ~/.weechat/weechat_fifo_* 2>/dev/null); do
echo -e "$1" >$fifo
done
fi
@end verbatim
@*
If the script is called "auto_weechat_command", you can run it with:@*
@command{./auto_weechat_command "freenode,#weechat *hello"}
@c ******************************* Extensions *********************************
@@ -718,7 +1336,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{@} }@*
@@ -743,11 +1362,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
@@ -789,15 +1432,6 @@ WeeChat is developed by:@*
@item
FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@item
Bounga
<@email{bounga@@altern.org, bounga AT altern.org}>
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -840,7 +1474,7 @@ Look for WeeChat support page for detail:@*
This manual documents WeeChat IRC client, it is part of WeeChat.@*
Copyright @copyright{} 2004 FlashCode
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
@*
This document may be used under the terms the GNU General Public License
File diff suppressed because it is too large Load Diff
+703 -65
View File
@@ -6,7 +6,7 @@
@c WeeChat documentation (french version)
@c
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
@c Copyright (c) 2005 by FlashCode <flashcode@flashtux.org>
@c
@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
@@ -35,7 +35,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.0.7 - 04 juillet 2004
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
@image{weechat_image}
@@ -48,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{} 2004 FlashCode
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
@*
Ce document peut @^etre utilis@'e sous les termes de la licence GNU General Public
@@ -209,6 +209,7 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
* Fichier de configuration::
* Raccourcis clavier::
* Commandes WeeChat::
* Tube FIFO::
@end menu
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
@@ -247,6 +248,7 @@ vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} -
Liste des options du fichier de configuration :@*
@table @kbd
@item look_set_title
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -259,6 +261,15 @@ 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_charset_decode
Jeu de caract@`eres pour d@'ecoder les messages du serveur, exemples: UTF-8, ISO-8859-1 (si non renseign@'e, les messages ne sont pas convertis)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'UTF-8'@*
@item look_charset_encode
Jeu de caract@`eres pour encoder les messages envoy@'es au serveur, exemples: UFT-8, ISO-8859-1 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item look_charset_internal
Jeu de caract@`eres interne @`a WeeChat, devrait @^etre ISO-xxxx m@^eme si la locale est UTF-8 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'ISO-8859-1'@*
@item look_color_nicks
Afficher les utilisateurs avec diff@'erentes couleurs@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -297,22 +308,22 @@ 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'@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y - %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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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'@*
@@ -342,16 +353,19 @@ 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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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: 'lightred'@*
@item col_status_highlight
Color for window with highlight (status bar)@*
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: 'lightmagenta'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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'@*
@@ -369,7 +383,7 @@ 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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_input_channel
Couleur pour le texte saisi (nom du canal)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@@ -381,7 +395,16 @@ 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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_nick_away
Couleur pour les pseudos absents@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
@item col_nick_chanowner
Couleur pour le symbole du propri@'etaire du canal (sp@'ecifique @`a unrealircd)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_nick_chanadmin
Couleur pour le symbole administrateur du canal (sp@'ecifique @`a unrealircd)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_nick_op
Couleur pour le symbole op@'erateur@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@@ -399,55 +422,106 @@ 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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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: 'lightcyan'@*
@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_channels
@item log_auto_server
Enregistrer automatiquement les messages du serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item log_auto_channel
Enregistrer automatiquement les conversations des canaux@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item log_auto_private
Enregistrer automatiquement les conversations priv@'ees@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item log_plugin_msg
Enregistrer les messages des plugins (scripts)@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@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_name
Nom des conversations saivegard@'ees (%S == nom du serveur irc, %N == nom du canal (ou pseudo si fen@^etre priv@'ee)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%S,%N.weechatlog'@*
@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: '~'@*
@item log_start_string
Texte @'ecrit en d@'emarrant la sauvegarde d'une discussion (voir man strftime pour le format de date/heure)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '--- Log started %a %b %d %Y %H:%M:%s'@*
@item log_end_string
Texte @'ecrit @`a la fin d'une discussion sauvegard@'ees (voir man strftime pour le format de date/heure)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '--- Log ended %a %b %d %Y %H:%M:%s'@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%Y %b %d %H:%M:%S'@*
@item log_hide_nickserv_pwd
Masquer le mot de passe affich@'e par nickserv@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item irc_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 irc_default_msg_away
Message par d@'efaut pour l'absence@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'away'@*
@item irc_default_msg_part
Message par d@'efaut pour le part (quitte un canal)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item irc_default_msg_quit
Message de fin par d@'efaut ('%v' sera remplac@'e par la version de WeeChat dans la cha@^ine)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@item irc_away_check
Intervalle entre deux v@'erifications des absences (en minutes, 0 = ne jemais v@'erifier)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 0@*
@item irc_lag_check
Intervalle entre deux mesures de lag (en secondes)@*
Type: entier (valeurs: entre 30 et 2147483647), valeur par d@'efaut: 60@*
@item irc_lag_min_show
Lag minimum @`a afficher (en secondes)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 1@*
@item irc_lag_disconnect
D@'econnexion apr@`es un lag important (en minutes, 0 = ne jamais se d@'econnecter)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 5@*
@item irc_fifo_pipe
Cr@'eer un tube FIFO pour le contr@^ole @`a distance@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item dcc_auto_accept_files
Accepte automatiquement les fichiers dcc entrants@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item dcc_auto_accept_max_size
Taille maximum pour un fichier entrant lorsqu'il est accept@'e automatiquement@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 0@*
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'@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@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: 65536)@*
Type: entier (valeurs: entre 1024 et 102400), valeur par d@'efaut: 65536@*
@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_convert_spaces
Convertir les espaces en underscores lors d'envoi de fichiers@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@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'@*
@@ -472,6 +546,12 @@ 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_autoreconnect
Reconnexion automatique au serveur apr@`es une d@'econnexion@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item server_autoreconnect_delay
D@'elai (en secondes) avant de tenter une reconnexion au serveur@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 30@*
@item server_address
Adresse IP ou nom du serveur IRC@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -499,9 +579,16 @@ 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_command_delay
D@'elai (en secondes) apr@`es ex@'ecution de la commande (exemple: donner du temps pour l'authentification)@*
Type: entier (valeurs: entre 0 et 5), valeur par d@'efaut: 0@*
@item server_autojoin
Liste des canaux (s@'epar@'es par des virgules) @`a rejoindre lorsque connect@'e au serveur@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_autorejoin
Rejoindre automatiquement les canaux quand mis dehors@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@end table
Les couleurs pour l'interface Curses sont :@*
@@ -535,8 +622,6 @@ Les couleurs pour l'interface Curses sont :@*
@item
@kbd{lightcyan}: cyan clair
@item
@kbd{gray}: gris
@item
@kbd{white}: blanc
@end itemize
@@ -550,13 +635,16 @@ Aller au caract@`ere pr@'ec@'edent / suivant sur la ligne de commande@*
@item Ctrl + fl@`eche gauche / Ctrl + fl@`eche droite
Aller au mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@item Home / End
Aller au d@'ebut / @`a la fin de la ligne de commande@*
@item Home / Ctrl + A
Aller au d@'ebut de la ligne de commande@*
@*
@item End / Ctrl + E
Aller @`a la fin de la ligne de commande@*
@*
@item Backspace / Delete
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@item Ctrl + Backspace
@item Ctrl + Backspace / Ctrl + W
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
@*
@item Tab
@@ -574,30 +662,564 @@ Rappeler les derni@`eres commandes/messages@*
@item PageUp / PageDown
Afficher l'historique du tampon@*
@*
@item F6 / F7
Aller au tampon pr@'ec@'edent@*
@item F5 / F6
Aller au tampon pr@'ec@'edent / suivant@*
@*
@item F8
Aller @`a la fen@^etre suivante@*
@*
@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 + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@item F7 / F8
Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
Identique @`a F5 / F6@*
@*
@item Alt + A
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
@*
@item Alt + D
Afficher les DCC en cours@*
@*
@item Alt + R
Vide la hotlist (notification d'activité sur les autres tampons)@*
@*
@item Alt + S
Sauter au tampon du serveur@*
@*
@item Alt + X
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
@*
@item Alt + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@*
@end table
@node Commandes WeeChat, , Raccourcis clavier, Utilisation
@node Commandes WeeChat, Tube FIFO, Raccourcis clavier, Utilisation
@section Commandes WeeChat
NON ECRIT !
Commandes internes WeeChat :@*
@table @kbd
@item alias [nom_alias [commande [param@`etres]]
@*
cr@'eer un alias pour une commande@*
@*
nom_alias: nom de l'alias@*
commande: nom de la commande (commande WeeChat ou IRC, sans le premier '/')@*
param@`etres: param@`etres pour la commande@*
@*
@item buffer [action | nombre]
@*
gestion des buffers@*
@*
action: action @`a effectuer:@*
move: d@'eplacer le tampon dans la liste (peut @^etre relatif, par exemple -1)@*
close: fermer le tampon (pour un canal: @'equivalent @`a /part sans message de fin)@*
list: liste les tampons ouverts (pas de param@`etre affiche cette liste)@*
notify: fixer le niveau de notification (0=jamais, 1=highlight, 2=1+msg, 3=2+join/part)@*
nombre: sauter au tampon qui a ce num@'ero@*
@*
@item clear [-all]
@*
affacer la/les fen@^etre(s)@*
@*
-all: effacer toutes les fen@^etres@*
@*
@item connect [nom_serveur]
@*
se connecter @`a un serveur@*
@*
nom_serveur: nom du serveur pour se connecter@*
@*
@item disconnect [nom_serveur]
@*
se d@'econnecter d'un serveur@*
@*
nom_serveur: nom du serveur pour se d@'econnecter@*
@*
@item debug dump
@*
affiche des messages de debuggage@*
@*
dump: affiche les variables m@'emoire WeeChat dans le fichier log (les m@^emes messages sont affich@'es lorsque WeeChat plante)@*
@*
@item help [commande]
@*
afficher l'aide sur les commandes@*
@*
commande: nom d'une commande WeeChat ou IRC@*
@*
@item perl [load fichier] | [autoload] | [unload]
@*
liste/charge/d@'echarge des scripts Perl@*
@*
fichier: script Perl (fichier) @`a charger@*
Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@*
@*
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@*
liste, ajoute ou retire des serveurs@*
@*
nom_serveur: nom du serveur, pour usage interne et affichage@*
nom/IP: nom ou adresse IP du serveur@*
port: port pour le serveur (nombre entier)@*
mot_de_passe: mot de passe pour le serveur@*
pseudo1: premier pseudo pour le serveur@*
pseudo2: pseudo alternatif pour le serveur@*
pseudo3: second pseudo alternatif pour le serveur@*
nom_utilisateur: nom d'utilisateur@*
nom_r@'eel: nom r@'eel de l'utilisateur@*
@*
@item save [fichier]
@*
sauvegarder la configuration sur disque@*
@*
fichier: fichier pour sauvegarder la configuration@*
@*
@item set [option[=valeur]]
@*
modifier des param@`etres de configuration@*
@*
option: nom d'une option@*
valeur: valeur pour l'option@*
@*
@item unalias nom_alias
@*
supprimer un alias@*
@*
nom_alias: nom de l'alias @`a supprimer@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
gestion des fen@^etres@*
@*
list: liste les fen@^etres ouvertes (pas de param@`etre affiche cette liste)@*
splith: @'eclate la fen@^etre en deux horizontalement@*
splitv: @'eclate la fen@^etre en deux verticalement@*
merge: fusionne la fen@^etre avec une autre@*
@*
@end table
Commandes IRC :@*
@table @kbd
@item admin [cible]
@*
trouver les informations sur l'administrateur du serveur@*
@*
cible: serveur@*
@*
@item away [-all] [message]
@*
basculer le statut absent@*
@*
-all: basculer le statut absent sur tous les serveurs connect@'es@*
message: message pour l'absence (si pas de message donn@'e, le statut d'absence est supprim@'e)@*
@*
@item ban [canal] [pseudo [pseudo ...]]
@*
bannit des pseudos ou masques@*
@*
canal: nom du canal pour le bannissement@*
pseudo: pseudo ou masque pour le bannissement@*
@*
@item ctcp pseudo type
@*
envoyer un message ctcp@*
@*
pseudo: utilisateur pour envoyer le ctcp@*
type: "action" ou "version"@*
@*
@item dcc action [pseudo [fichier]]
@*
d@'emarre le DCC (fichier ou discussion) ou ferme une discussion@*
@*
action: 'send' (envoi de fichier) ou 'chat' (discussion) ou 'close' (fermeture discussion)@*
pseudo: pseudo pour envoyer le fichier ou discuter@*
fichier: nom du fichier (sur la machine locale)@*
@*
@item dehalfop pseudo [pseudo]
@*
retire le statut de demi-op@'erateur du canal @`a/aux nick(s)@*
@*
@item deop pseudo [pseudo]
@*
retire le statut d'op@'erateur du canal @`a/aux nick(s)@*
@*
@item devoice pseudo [pseudo]
@*
retire la voix du/des pseudo(s)@*
@*
@item die
@*
arr@^eter le serveur@*
@*
@item halfop pseudo [pseudo]
@*
donner le statut de demi-op@'erateur @`a un/des utilisateur(s)@*
@*
@item info [cible]
@*
voir les informations d@'ecrivant le serveur@*
@*
cible: nom du serveur@*
@*
@item invite pseudo canal
@*
inviter un utilisateur sur un canal@*
@*
pseudo: utilisateur @`a inviter@*
channel: canal pour l'invitation@*
@*
@item ison pseudo [pseudo ...]
@*
v@'erifier si un utilisateur est actuellement sur IRC@*
@*
pseudo: pseudo@*
@*
@item join canal[,canal] [cl@'e[,cl@'e]]
@*
joindre un canal@*
@*
canal: nom du canal @`a rejoindre@*
cl@'e: cl@'e pour rejoindre le canal@*
@*
@item kick [canal] pseudo [commentaire]
@*
retirer par la force un utilisateur d'un canal@*
@*
canal: canal o@`u l'utilisateur se trouve@*
pseudo: utilisateur @`a @'eliminer@*
commentaire: commentaire pour l'@'elimination@*
@*
@item kickban [canal] pseudo [commentaire]
@*
retirer par la force un utilisateur d'un canal et le bannir@*
@*
canal: canal o@`u l'utilisateur se trouve@*
pseudo: utilisateur @`a @'eliminer et bannir@*
commentaire: commentaire pour l'@'elimination@*
@*
@item kill pseudo commentaire
@*
fermer la connexion client-serveur@*
@*
pseudo: utilisateur@*
commentaire: commentaire pour la mort@*
@*
@item links [[serveur] masque_serveur]
@*
lister tous les noms de serveurs connus du serveur qui r@'epondent @`a la requ@^ete@*
@*
serveur: ce serveur doit r@'epondre @`a la requ@^ete@*
masque_serveur: liste des serveurs correspondant au masque@*
@*
@item list [canal[,canall] [serveur]]
@*
lister les canaux et leur sujet@*
@*
canal: canal @`a lister@*
serveur: nom du serveur@*
@*
@item lusers [masque [cible]]
@*
obtenir des statistiques sur la taille du r@'eseau IRC@*
@*
masque: serveurs qui correspondent au masque seulement@*
cible: serveur pour faire suivre la requ@^ete@*
@*
@item me message
@*
envoyer une action ctcp au canal courant@*
@*
message: message @`a envoyer@*
@*
@item mode @{ canal @{[+|-]|o|p|s|i|t|n|b|v@} [limite] [utilisateur] [masque de banissement] @} | @{ nick @{[+|-]|i|w|s|o@} @}
@*
changer le mode du canal ou de l'utilisateur@*
@*
modes de canaux :@*
canal: nom du canal @`a modifier@*
o: donner/reprendre le statut privil@'egi@'e d'op@'erateur@*
p: indicateur de canal priv@'e@*
s: indicateur de canal secret@*
i: indicateur de canal avec invitation seulement@*
t: le titre est modifiable seulement par un op@'erateur du canal@*
n: aucun message au canal depuis l'ext@'erieur@*
m: canal mod@'er@'e@*
l: fixer la limite d'utilisateurs pour le canal@*
b: param@'etrer un masque de banissement pour garder des utilisateurs dehors@*
v: donner/reprendre la possibilit@'e de parler sur un canal mod@'er@'e@*
k: d@'efinir une cl@'e (mot de passe) pour acc@'eder au canal@*
modes utilisateur :@*
pseudo: utilisateur @`a modifier@*
i: marquer un utilisateur comme invisible@*
s: marquer un utilisateur pour recevoir les notices du serveur@*
w: l'utilisateur re@,{c}oit les wallops@*
o: drapeau op@'erateur@*
@*
@item motd [cible]
@*
obtenir le message du jour@*
@*
cible: nom du serveur@*
@*
@item msg cible[,cible] texte
@*
envoyer un message @`a un utilisateur ou canal@*
@*
cible: utilisateur ou canal (peut-@^etre un masque, '*' = canal courant)@*
texte: texte @`a envoyer@*
@*
@item names [canal[,canal]]
@*
lister les utilisateurs sur des canaux@*
@*
canal: nom du canal@*
@*
@item nick pseudo
@*
changer le pseudo courant@*
@*
pseudo: nouveau pseudo pour le serveur IRC courant@*
@*
@item notice pseudo texte
@*
envoyer un message notice @`a un utilisateur@*
@*
pseudo: utilisateur cible pour la notice@*
texte: texte @`a envoyer@*
@*
@item op pseudo [pseudo]
@*
donner le statut op@'erateur @`a un/des utilisateur(s)@*
@*
@item oper utilisateur mot_de_passe
@*
obtenir le statut d'op@'erateur@*
@*
utilisateur/mot_de_passe: utilis@'e pour obtenir les privil@`eges sur le serveur IRC courant@*
@*
@item part [canal[,canall] [message_de_fin]
@*
quitter un canal@*
@*
canal: canal @`a quitter@*
message_de_fin: message de fin (affich@'e aux autres utilisateurs)@*
@*
@item ping serveur1 [serveur2]
@*
pinguer un serveur@*
@*
serveur1: serveur @`a pinguer@*
serveur2: faire suivre le ping @`a ce serveur@*
@*
@item pong d@'emon [d@'emon2]
@*
r@'epondre @`a un message ping@*
@*
d@'emon: d@'emon qui a r@'epondu au message Ping@*
d@'emon2: faire suivre le message @`a ce d@'emon@*
@*
@item query pseudo [texte]
@*
envoyer un message priv@'e @`a un utilisateur@*
@*
pseudo: utilisateur pour la conversation priv@'ee@*
texte: texte @`a envoyer@*
@*
@item quit [message_de_fin]
@*
fermer toutes les connexions et quitter@*
@*
message_de_fin: message de fin (affich@'e aux autres utilisateurs)@*
@*
@item quote donn@'ees
@*
envoyer des donn@'ees brutes au serveur sans analyse@*
@*
donn@'ees: donn@'ees brutes @`a envoyer@*
@*
@item rehash
@*
demander au serveur de recharger son fichier de configuration@*
@*
@item restart
@*
demander au serveur de red@'emarrer@*
@*
@item service pseudo r@'eserv@'e distribution type r@'eserv@'e info
@*
enregister un nouveau service@*
@*
distribution: visibilit@'e du service@*
type: r@'eserv@'e pour une utilisation future@*
@*
@item servlist [masque [type]]
@*
lister les services actuellement connect@'es au r@'eseau@*
@*
masque: lister seulement les services qui correspondent @`a ce masque@*
type: lister seulement les services de ce type@*
@*
@item squery service texte
@*
envoyer un message @`a un service@*
@*
service: nom du service@*
texte: texte @`a envoyer@*
@*
@item squit serveur commentaire
@*
d@'econnecter les liens vers un serveur@*
@*
serveur: nom du serveur@*
commentaire: commentaire pour quitter@*
@*
@item stats [requ@^ete [serveur]]
@*
demander des statistiques sur le serveur@*
@*
requ@^ete: c/h/i/k/l/m/o/y/u (voir la RFC1459)@*
serveur: nom du serveur@*
@*
@item summon utilisateur [cible [canal]]
@*
envoyer aux utilisateurs d'un serveur IRC un message leur demandant de rejoindre IRC@*
@*
utilisateur: nom d'utilisateur@*
cible: nom du serveur@*
canal: nom du canal@*
@*
@item time [cible]
@*
demander l'heure locale de serveur@*
@*
cible: demander l'heure de ce serveur@*
@*
@item topic [canal] [titre]
@*
recevoir/d@'efinir le titre du canal@*
@*
canal: nom du canal@*
titre: nouveau titre pour le canal (si le titre est "-delete" alors le titre est supprim@'e)@*
@*
@item trace [cible]
@*
trouver le chemin jusqu'@`a un serveur sp@'ecifique@*
@*
cible: serveur@*
@*
@item unban [canal] pseudo [pseudo ...]
@*
supprime le bannissement sur des pseudos ou masques@*
@*
canal: nom du canal pour supprimer le bannissement@*
pseudo: pseudo ou masque pour supprimer le bannissement@*
@*
@item userhost pseudo [pseudo ...]
@*
retourne une liste d'informations sur des utilisateurs@*
@*
pseudo: pseudo@*
@*
@item users [cible]
@*
liste des utilisateurs connect@'es au serveur@*
@*
cible: serveur@*
@*
@item version [serveur | pseudo]
@*
retourne la version de l'utilisateur ou du serveur (courant ou sp@'ecifi@'e)@*
@*
serveur: nom du serveur@*
pseudo: utilisateur@*
@*
@item voice pseudo [pseudo]
@*
donne la voix @`a/aux utilisateur(s)@*
@*
@item wallops texte
@*
envoyer un message @`a tous les utilisateurs connect@'es qui ont activ@'e le mode utilisateur 'w' pour eux-m@^emes@*
@*
texte @`a envoyer@*
@*
@item who [masque ["o"]]
@*
g@'en@`ere une requ@^ete qui retourne une liste d'information@*
@*
masque: information qui correspond @`a ce masque uniquement@*
o: seul les op@'erateurs sont retourn@'es correspondant au masque fourni@*
@*
@item whois [serveur] pseudo[,pseudo]
@*
demande les informations sur le(s) utilisateur(s)@*
@*
serveur: nom du serveur@*
pseudo: utilisateur (peut @^etre un masque)@*
@*
@item whowas pseudo [,pseudo [,pseudo ...]] [nombre [cible]]
@*
demander de l'information sur un nick qui n'existe plus@*
@*
pseudo: pseudo @`a chercher@*
nombre: nombre de r@'eponses @`a retourner (recherche compl@`ete si nombre n@'egatif)@*
cible: la r@'eponse doit correspondre @`a ce masque@*
@*
@end table
@node Tube FIFO, , Commandes WeeChat, Utilisation
@section Tube FIFO
Vous pouvez contr@^oler WeeChat @`a distance, en envoyant des commandes ou du
texte dans un tube FIFO (l'option "irc_fifo_pipe" doit @^etre activ@'ee, elle
est d@'esactiv@'ee par d@'efaut).@*
Le tube FIFO est dans le r@'epertoire ~/.weechat/ et s'appelle "weechat_fifo_xxxxx"
(o@`u xxxxx est l'ID du processus (PID) du WeeChat qui tourne).@*
Donc si plusieurs WeeChat tournent, vous avez plusieurs tubes FIFO, un pour
chaque session.@*
@*
La syntaxe pour envoyer des commandes ou du texte dans le tube FIFO est la suivante :@*
@command{serveur,canal *texte ou commande ici}@*
o@`u le serveur et le canal sont facultatifs, mais si le canal est l@`a, le
serveur doit l'@^etre aussi.@*
@*
Quelques exemples :
@table @asis
@item @bullet{} changement du pseudo sur freenode en "pseudo|absent":
@command{echo "freenode */nick pseudo|absent" >~/.weechat/weechat_fifo_12345}
@item @bullet{} affichage de texte sur le canal #weechat :
@command{echo "freenode,#weechat *bonjour tout le monde !" >~/.weechat/weechat_fifo_12345}
@item @bullet{} affichage de texte sur le canal courant (le tampon affich@'e par WeeChat):
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Attention :} ceci est dangereux et vous ne devriez pas le faire sauf si vous savez ce que vous faites !
@item @bullet{} envoyer deux commandes pour décharger/recharger les scripts Perl (vous devez les séparer par \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
Vous pouvez @'ecrire un script qui envoie les commandes @`a tous les WeeChat qui
tournent en m@^eme temps, par exemple :@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
for fifo in $(/bin/ls ~/.weechat/weechat_fifo_* 2>/dev/null); do
echo -e "$1" >$fifo
done
fi
@end verbatim
@*
Si le script s'appelle "auto_weechat_command", vous pouvez le lancer ainsi :@*
@command{./auto_weechat_command "freenode,#weechat *bonjour"}
@c ******************************* Extensions *********************************
@@ -719,7 +1341,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{@} }@*
@@ -744,11 +1367,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
@@ -789,15 +1436,6 @@ WeeChat est d@'evelopp@'e par :@*
@item
FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@item
Bounga
<@email{bounga@@altern.org, bounga AT altern.org}>
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -840,7 +1478,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{} 2004 FlashCode
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
@*
Ce document peut @^etre utilis@'e sous les termes de la licence GNU General Public
+107 -27
View File
@@ -6,7 +6,7 @@
@c WeeChat documentation (vers@~ao partuguesa)
@c
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
@c Copyright (c) 2005 by FlashCode <flashcode@flashtux.org>
@c
@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
@@ -35,7 +35,7 @@
@title WeeChat - Guia do Utilizador
@subtitle Cliente de IRC rapido, leve e extencivel
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.7 - 04 de Julho de 2004
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.1 - 20 de Mar@,{c}o de 2005
@image{weechat_image}
@@ -48,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{} 2004 FlashCode
Copyright @copyright{} 2005 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
@@ -206,6 +206,7 @@ Segue agora as instru@,{c}@~oes para compilar o c@'odigo fonte - @xref{Codigo Fo
* Invocar o WeeChat::
* Recursos de teclado::
* Comandos do WeeChat::
* FIFO pipe::
@end menu
@node Invocar o WeeChat, Recursos de teclado, Utilizacao, Utilizacao
@@ -247,13 +248,16 @@ Ir um caractere para traz / para a frente na linha de comando@*
@item Ctrl + Seta esquerda / Ctrl + Seta Direita
Ir uma palavra para traz / para a frente na linha de comando@*
@*
@item Home / End
Ir para o in@'icio / para o fim da linha de comando@*
@item Home / Ctrl + A
Ir para o in@'icio da linha de comando@*
@*
@item End / Ctrl + E
Ir para o fim da linha de comando@*
@*
@item Backspace / Delete
Apagar o caractere anterior / seguinte na linha de comando@*
@*
@item Ctrl + Backspace
@item Ctrl + Backspace / Ctrl + W
Apagar a palavra anterior na linha de comando
@*
@item Tab
@@ -271,28 +275,89 @@ Repetir os ultimos comandos/mensagens@*
@item PageUp / PageDown
Navegar no hist@'orico da janela@*
@*
@item F6 / F7
Ir para a janela anterior/seguinte@*
@item F5 / F6
Comute ao amortecedor 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 F7 / F8
Comute ao janela anterior / seguinte@*
@*
@item F10
Apagar a @'ultima mensagem da barra do info@*
@*
@item Ctrl + L
Redesenhe a janela inteira@*
@*
@item Alt + Seta da esquerda / Alt + Seta da direita
Identico a F5 / F6@*
@*
@item Alt + A
Comute ao amortecedor seguinte com atividade (com prioridade: destaque, mensagem, outra)@*
@*
@item Alt + D
Exposi@,{c}@~ao DCC atual@*
@*
@item Alt + R
Hotlist desobstru@'ido (notifica@,{c}@~ao da atividade em outros amortecedores)@*
@*
@item Alt + S
Comute ao amortecedor do servidor@*
@*
@item Alt + X
Comute @`a primeira canaleta do servidor seguinte (ou do amortecedor do servidor se nenhuma canaleta for aberta)@*
@*
@item Alt + d@'igito (1-9)
Comute ao amortecedor pelo n@'umero@*
@*
@end table
@node Comandos do WeeChat, , Recursos de teclado, Utilizacao
@node Comandos do WeeChat, FIFO pipe, Recursos de teclado, Utilizacao
@section Comandos do WeeChat
N@~AO ESCRITO !
@node FIFO pipe, , Comandos do WeeChat, Utilizacao
@section FIFO pipe
You can remote control WeeChat, by sending commands or text to a FIFO pipe
(you have to enable option "irc_fifo_pipe", it is disabled by default).@*
The FIFO pipe is located in ~/.weechat/ and is called "weechat_fifo_xxxxx"
(where xxxxx is the process ID (PID) of running WeeChat).@*
So if many WeeChat are running, you have many FIFO pipe, one for each session.@*
@*
The syntax for the FIFO pipe commands/text is:@*
@command{server,channel *text or command here}@*
where server and channel are optional, but if channel is here, server should be too.@*
@*
Some examples:
@table @asis
@item @bullet{} change your nick on freenode to "mynick|out":
@*
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on #weechat channel:
@*
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
@*
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
You can write a script to send command to all running WeeChat at same time, for example:@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
for fifo in $(/bin/ls ~/.weechat/weechat_fifo_* 2>/dev/null); do
echo -e "$1" >$fifo
done
fi
@end verbatim
@*
If the script is called "auto_weechat_command", you can run it with:@*
@command{./auto_weechat_command "freenode,#weechat *hello"}
@c ******************************* Extencoes *********************************
@@ -438,6 +503,30 @@ Este nome pode pertencer a um comando j
@code{@} }@*
@*
@item
@command{IRC::get_info ( [servidor,] nome );}@*
@*
Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@emph{Argumentos:}
@itemize @minus
@item @option{servidor}: nome interno da servidor
@item @option{nome}: nome do info a recuperar:
@itemize @minus
@item @option{0 ou version}: comece a vers@~ao de WeeChat
@item @option{1 ou nick}: comece o nickname
@item @option{2 ou channel}: comece o nome da canal
@item @option{3 ou server}: comece o nome do servidor
@item @option{4 ou weechatdir}: comece a WeeChat o diret@'orio home
@item @option{5 ou away}: comece a bandeira ausente para o servidor
@end itemize
@end itemize
@*
@emph{Exemplos:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@*
@end itemize
@node Scripts Python, Scripts Ruby, Scripts Perl, Extencoes
@@ -479,15 +568,6 @@ O WeeChat @'e desenvolvido por :@*
@item
FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@item
Bounga
<@email{bounga@@altern.org, bounga AT altern.org}>
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -528,7 +608,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{} 2004 FlashCode
Copyright @copyright{} 2005 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}>@*
@*
Binary file not shown.
+14 -5
View File
@@ -1,11 +1,12 @@
./src/irc/irc-nick.c
./src/irc/irc-server.c
./src/irc/irc-channel.c
./src/irc/irc.h
./src/irc/irc-commands.c
./src/irc/irc-display.c
./src/irc/irc-send.c
./src/irc/irc-recv.c
./src/irc/irc-dcc.c
./src/irc/irc.h
./src/plugins/perl/wee-perl.c
./src/plugins/perl/wee-perl.h
./src/plugins/plugins.c
@@ -14,15 +15,23 @@
./src/gui/curses/gui-display.c
./src/gui/gtk/gui-display.c
./src/gui/gtk/gui-input.c
./src/gui/gui.h
./src/gui/gui-common.c
./src/gui/gui.h
./src/common/command.c
./src/common/completion.c
./src/common/history.c
./src/common/weechat.c
./src/common/command.h
./src/common/completion.c
./src/common/completion.h
./src/common/fifo.c
./src/common/fifo.h
./src/common/history.c
./src/common/history.h
./src/common/hotlist.c
./src/common/hotlist.h
./src/common/log.c
./src/common/log.h
./src/common/weechat.c
./src/common/weechat.h
./src/common/weeconfig.c
./src/common/weeconfig.h
./src/common/weelist.c
./src/common/weelist.h
+3710
View File
File diff suppressed because it is too large Load Diff
+1593 -970
View File
File diff suppressed because it is too large Load Diff
+1502 -913
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
+8 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,9 +25,15 @@ lib_weechat_main_a_SOURCES = weechat.c \
command.h \
completion.c \
completion.h \
weelist.c \
weelist.h \
weeconfig.c \
weeconfig.h \
history.c \
history.h \
hotlist.c \
hotlist.h
hotlist.h \
log.c \
log.h \
fifo.c \
fifo.h
+819 -417
View File
File diff suppressed because it is too large Load Diff
+12 -14
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,9 @@
#ifndef __WEECHAT_COMMAND_H
#define __WEECHAT_COMMAND_H 1
#include "weelist.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
#define MAX_ARGS 8192
@@ -48,28 +50,23 @@ struct t_weechat_alias
t_weechat_alias *next_alias;
};
typedef struct t_index_command t_index_command;
struct t_index_command
{
char *command_name;
t_index_command *prev_index;
t_index_command *next_index;
};
extern t_weechat_command weechat_commands[];
extern t_weechat_alias *weechat_alias;
extern t_index_command *index_commands;
extern t_weelist *index_commands;
extern t_weelist *last_index_command;
extern t_index_command *index_command_search (char *);
extern t_index_command *index_command_new (char *);
extern void index_command_build ();
extern void command_index_build ();
extern void command_index_free ();
extern t_weechat_alias *alias_new (char *, char *);
extern void alias_free_all ();
extern int exec_weechat_command (t_irc_server *, char *);
extern void user_command (t_irc_server *, char *);
extern void user_command (t_irc_server *, t_gui_buffer *, 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_debug (int, char **);
extern int weechat_cmd_disconnect (int, char **);
extern int weechat_cmd_help (int, char **);
extern int weechat_cmd_perl (int, char **);
@@ -77,6 +74,7 @@ extern int weechat_cmd_save (int, char **);
extern int weechat_cmd_server (int, char **);
extern int weechat_cmd_set (char *);
extern int weechat_cmd_unalias (char *);
extern int weechat_cmd_unset (char *);
extern int weechat_cmd_window (int, char **);
#endif /* command.h */
+651 -73
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -29,8 +29,10 @@
#include "weechat.h"
#include "completion.h"
#include "../irc/irc.h"
#include "command.h"
#include "weelist.h"
#include "weeconfig.h"
#include "../irc/irc.h"
/*
@@ -40,8 +42,14 @@
void
completion_init (t_completion *completion)
{
completion->context = COMPLETION_NULL;
completion->base_command = NULL;
completion->base_command_arg = 0;
completion->position = -1;
completion->base_word = NULL;
completion->completion_list = NULL;
completion->last_completion = NULL;
}
/*
@@ -51,8 +59,527 @@ completion_init (t_completion *completion)
void
completion_free (t_completion *completion)
{
if (completion->base_command)
free (completion->base_command);
completion->base_command = NULL;
if (completion->base_word)
free (completion->base_word);
completion->base_word = NULL;
while (completion->completion_list)
weelist_remove (&completion->completion_list,
&completion->last_completion,
completion->completion_list);
completion->completion_list = NULL;
completion->last_completion = NULL;
}
/*
* completion_stop: stop completion (for example after 1 arg of command with 1 arg)
*/
void
completion_stop (t_completion *completion)
{
completion->context = COMPLETION_NULL;
completion->position = -1;
}
/*
* completion_build_list: build data list according to command and argument #
*/
void
completion_build_list (t_completion *completion, void *channel)
{
t_weelist *ptr_list;
int i, j;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
char option_name[256];
t_weechat_alias *ptr_alias;
/* WeeChat internal commands */
/* no completion for some commands */
if ((strcasecmp (completion->base_command, "server") == 0)
|| (strcasecmp (completion->base_command, "save") == 0))
{
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "alias") == 0)
&& (completion->base_command_arg == 1))
{
for (ptr_list = index_commands; ptr_list; ptr_list = ptr_list->next_weelist)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_list->data);
}
return;
}
if ((strcasecmp (completion->base_command, "buffer") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"close");
weelist_add (&completion->completion_list,
&completion->last_completion,
"list");
weelist_add (&completion->completion_list,
&completion->last_completion,
"move");
weelist_add (&completion->completion_list,
&completion->last_completion,
"notify");
return;
}
if ((strcasecmp (completion->base_command, "clear") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"-all");
return;
}
if ((strcasecmp (completion->base_command, "connect") == 0)
|| (strcasecmp (completion->base_command, "disconnect") == 0))
{
if (completion->base_command_arg == 1)
{
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_server->name);
}
return;
}
else
{
completion_stop (completion);
return;
}
}
if (strcasecmp (completion->base_command, "debug") == 0)
{
if (completion->base_command_arg == 1)
weelist_add (&completion->completion_list,
&completion->last_completion,
"dump");
else
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "help") == 0)
&& (completion->base_command_arg == 1))
{
for (i = 0; weechat_commands[i].command_name; i++)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_commands[i].command_name);
}
for (i = 0; irc_commands[i].command_name; i++)
{
if (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
weelist_add (&completion->completion_list,
&completion->last_completion,
irc_commands[i].command_name);
}
return;
}
if ((strcasecmp (completion->base_command, "perl") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"load");
weelist_add (&completion->completion_list,
&completion->last_completion,
"autoload");
weelist_add (&completion->completion_list,
&completion->last_completion,
"unload");
return;
}
if ((strcasecmp (completion->base_command, "set") == 0)
&& (completion->base_command_arg == 1))
{
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
weechat_options[i][j].option_name);
}
}
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
snprintf (option_name, sizeof (option_name), "%s.%s",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
option_name);
}
}
return;
}
if ((strcasecmp (completion->base_command, "unalias") == 0)
&& (completion->base_command_arg == 1))
{
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_alias->alias_name);
}
return;
}
if (strcasecmp (completion->base_command, "window") == 0)
{
if (completion->base_command_arg == 1)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"list");
weelist_add (&completion->completion_list,
&completion->last_completion,
"splith");
weelist_add (&completion->completion_list,
&completion->last_completion,
"splitv");
weelist_add (&completion->completion_list,
&completion->last_completion,
"merge");
return;
}
if (completion->base_command_arg == 2)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"down");
weelist_add (&completion->completion_list,
&completion->last_completion,
"up");
weelist_add (&completion->completion_list,
&completion->last_completion,
"left");
weelist_add (&completion->completion_list,
&completion->last_completion,
"right");
weelist_add (&completion->completion_list,
&completion->last_completion,
"all");
return;
}
completion_stop (completion);
return;
}
/* IRC commands */
/* no completion for some commands */
if ((strcasecmp (completion->base_command, "admin") == 0)
|| (strcasecmp (completion->base_command, "die") == 0)
|| (strcasecmp (completion->base_command, "info") == 0)
|| (strcasecmp (completion->base_command, "join") == 0)
|| (strcasecmp (completion->base_command, "links") == 0)
|| (strcasecmp (completion->base_command, "list") == 0)
|| (strcasecmp (completion->base_command, "lusers") == 0)
|| (strcasecmp (completion->base_command, "motd") == 0)
|| (strcasecmp (completion->base_command, "oper") == 0)
|| (strcasecmp (completion->base_command, "rehash") == 0)
|| (strcasecmp (completion->base_command, "restart") == 0)
|| (strcasecmp (completion->base_command, "service") == 0)
|| (strcasecmp (completion->base_command, "servlist") == 0)
|| (strcasecmp (completion->base_command, "squery") == 0)
|| (strcasecmp (completion->base_command, "squit") == 0)
|| (strcasecmp (completion->base_command, "stats") == 0)
|| (strcasecmp (completion->base_command, "summon") == 0)
|| (strcasecmp (completion->base_command, "time") == 0)
|| (strcasecmp (completion->base_command, "trace") == 0)
|| (strcasecmp (completion->base_command, "users") == 0)
|| (strcasecmp (completion->base_command, "wallops") == 0)
|| (strcasecmp (completion->base_command, "who") == 0))
{
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "away") == 0)
&& (completion->base_command_arg == 1))
{
if (cfg_irc_default_msg_away && cfg_irc_default_msg_away[0])
weelist_add (&completion->completion_list,
&completion->last_completion,
cfg_irc_default_msg_away);
return;
}
if ((strcasecmp (completion->base_command, "ctcp") == 0)
&& (completion->base_command_arg == 2))
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"action");
weelist_add (&completion->completion_list,
&completion->last_completion,
"version");
return;
}
if ((strcasecmp (completion->base_command, "dcc") == 0)
&& (completion->base_command_arg == 1))
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"chat");
weelist_add (&completion->completion_list,
&completion->last_completion,
"send");
weelist_add (&completion->completion_list,
&completion->last_completion,
"close");
return;
}
if (strcasecmp (completion->base_command, "invite") == 0)
{
/* arg1: nickname */
if (completion->base_command_arg == 1)
return;
/* arg > 2: not allowed */
if (completion->base_command_arg > 2)
{
completion_stop (completion);
return;
}
/* arg2: channel */
if (SERVER(gui_current_window->buffer))
{
for (ptr_channel = SERVER(gui_current_window->buffer)->channels;
ptr_channel; ptr_channel = ptr_channel->next_channel)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
ptr_channel->name);
}
}
return;
}
if (strcasecmp (completion->base_command, "kick") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "kill") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if (strcasecmp (completion->base_command, "notice") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "part") == 0)
&& (completion->base_command_arg == 1))
{
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
weelist_add (&completion->completion_list,
&completion->last_completion,
cfg_irc_default_msg_part);
return;
}
if (strcasecmp (completion->base_command, "query") == 0)
{
if (completion->base_command_arg != 1)
completion_stop (completion);
return;
}
if ((strcasecmp (completion->base_command, "quit") == 0)
&& (completion->base_command_arg == 1))
{
if (cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0])
weelist_add (&completion->completion_list,
&completion->last_completion,
cfg_irc_default_msg_quit);
return;
}
if (strcasecmp (completion->base_command, "topic") == 0)
{
if (completion->base_command_arg == 1)
{
if (!channel || !((t_irc_channel *)channel)->topic
|| !((t_irc_channel *)channel)->topic[0])
completion_stop (completion);
else
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)channel)->topic);
}
else
completion_stop (completion);
return;
}
}
/*
* completion_find_context: find context for completion
*/
void
completion_find_context (t_completion *completion, void *channel, char *buffer,
int size, int pos)
{
int i, command, command_arg, pos_start, pos_end;
/* look for context */
completion_free (completion);
command = (buffer[0] == '/') ? 1 : 0;
command_arg = 0;
i = 0;
while (i < pos)
{
if (buffer[i] == ' ')
{
command_arg++;
i++;
while ((i < pos) && (buffer[i] == ' ')) i++;
}
else
i++;
}
if (command)
{
if (command_arg > 0)
{
completion->context = COMPLETION_COMMAND_ARG;
completion->base_command_arg = command_arg;
}
else
{
completion->context = COMPLETION_COMMAND;
completion->base_command_arg = 0;
}
}
else
{
if (channel)
completion->context = COMPLETION_NICK;
else
completion->context = COMPLETION_NULL;
}
/* look for word to complete (base word) */
completion->base_word_pos = 0;
completion->position_replace = pos;
if (size > 0)
{
i = pos;
pos_start = i;
if (buffer[i] == ' ')
{
if ((i > 0) && (buffer[i-1] != ' '))
{
i--;
while ((i >= 0) && (buffer[i] != ' '))
i--;
pos_start = i + 1;
}
}
else
{
while ((i >= 0) && (buffer[i] != ' '))
i--;
pos_start = i + 1;
}
i = pos;
while ((i < size) && (buffer[i] != ' '))
i++;
pos_end = i - 1;
completion->base_word_pos = pos_start;
if (pos_start <= pos_end)
{
if (completion->context == COMPLETION_COMMAND)
completion->position_replace = pos_start + 1;
else
completion->position_replace = pos_start;
completion->base_word = (char *) malloc (pos_end - pos_start + 2);
for (i = pos_start; i <= pos_end; i++)
completion->base_word[i - pos_start] = buffer[i];
completion->base_word[pos_end - pos_start + 1] = '\0';
}
}
if (!completion->base_word)
completion->base_word = strdup ("");
/* find command (for command argument completion only) */
if (completion->context == COMPLETION_COMMAND_ARG)
{
pos_start = 0;
while ((pos_start < size) && (buffer[pos_start] != '/'))
pos_start++;
if (buffer[pos_start] == '/')
{
pos_start++;
pos_end = pos_start;
while ((pos_end < size) && (buffer[pos_end] != ' '))
pos_end++;
if (buffer[pos_end] == ' ')
pos_end--;
completion->base_command = (char *) malloc (pos_end - pos_start + 2);
for (i = pos_start; i <= pos_end; i++)
completion->base_command[i - pos_start] = buffer[i];
completion->base_command[pos_end - pos_start + 1] = '\0';
completion_build_list (completion, channel);
}
}
/* nick completion with nothing as base word is disabled,
in order to prevent completion when pasting messages with [tab] inside */
if ((completion->context == COMPLETION_NICK)
&& ((!completion->base_word) || (!completion->base_word[0])))
{
completion->context = COMPLETION_NULL;
return;
}
if (!completion->completion_list && channel &&
(((t_irc_channel *)channel)->type == CHAT_PRIVATE)
&& (completion->context == COMPLETION_NICK))
{
/* nick completion in private (only other nick and self) */
completion->context = COMPLETION_NICK;
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)channel)->name);
weelist_add (&completion->completion_list,
&completion->last_completion,
SERVER(gui_current_window->buffer)->nick);
}
}
/*
@@ -62,23 +589,37 @@ completion_free (t_completion *completion)
void
completion_command (t_completion *completion)
{
int length, word_found_seen;
t_index_command *ptr_index;
int length, word_found_seen, other_completion;
t_weelist *ptr_weelist, *ptr_weelist2;
length = strlen (completion->base_word) - 1;
word_found_seen = 0;
for (ptr_index = index_commands; ptr_index; ptr_index = ptr_index->next_index)
other_completion = 0;
for (ptr_weelist = index_commands; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
{
if (strncasecmp (ptr_index->command_name, completion->base_word + 1, length) == 0)
if (strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
completion->word_found = ptr_index->command_name;
completion->word_found = ptr_weelist->data;
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
ptr_weelist2 = ptr_weelist2->next_weelist)
{
if (strncasecmp (ptr_weelist2->data,
completion->base_word + 1, length) == 0)
other_completion++;
}
if (other_completion == 0)
completion->position = -1;
else
if (completion->position < 0)
completion->position = 0;
return;
}
other_completion++;
}
if (completion->word_found &&
(strcasecmp (ptr_index->command_name, completion->word_found) == 0))
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
word_found_seen = 1;
}
if (completion->word_found)
@@ -88,6 +629,54 @@ completion_command (t_completion *completion)
}
}
/*
* completion_command_arg: complete a command argument
*/
void
completion_command_arg (t_completion *completion, t_irc_channel *channel)
{
int length, word_found_seen, other_completion;
t_weelist *ptr_weelist, *ptr_weelist2;
length = strlen (completion->base_word);
word_found_seen = 0;
other_completion = 0;
for (ptr_weelist = completion->completion_list; ptr_weelist;
ptr_weelist = ptr_weelist->next_weelist)
{
if (strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
{
if ((!completion->word_found) || word_found_seen)
{
completion->word_found = ptr_weelist->data;
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
ptr_weelist2 = ptr_weelist2->next_weelist)
{
if (strncasecmp (ptr_weelist2->data,
completion->base_word, length) == 0)
other_completion++;
}
if (other_completion == 0)
completion->position = -1;
else
if (completion->position < 0)
completion->position = 0;
return;
}
other_completion++;
}
if (completion->word_found &&
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
word_found_seen = 1;
}
if (completion->word_found)
{
completion->word_found = NULL;
completion_command_arg (completion, channel);
}
}
/*
* completion_nick: complete a nick
*/
@@ -95,11 +684,21 @@ completion_command (t_completion *completion)
void
completion_nick (t_completion *completion, t_irc_channel *channel)
{
int length, word_found_seen;
t_irc_nick *ptr_nick;
int length, word_found_seen, other_completion;
t_irc_nick *ptr_nick, *ptr_nick2;
if (!channel)
return;
if (((t_irc_channel *)channel)->type == CHAT_PRIVATE)
{
completion_command_arg (completion, channel);
return;
}
length = strlen (completion->base_word);
word_found_seen = 0;
other_completion = 0;
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
if (strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
@@ -107,8 +706,21 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
if ((!completion->word_found) || word_found_seen)
{
completion->word_found = ptr_nick->nick;
for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
ptr_nick2 = ptr_nick2->next_nick)
{
if (strncasecmp (ptr_nick2->nick,
completion->base_word, length) == 0)
other_completion++;
}
if (other_completion == 0)
completion->position = -1;
else
if (completion->position < 0)
completion->position = 0;
return;
}
other_completion++;
}
if (completion->word_found &&
(strcasecmp (ptr_nick->nick, completion->word_found) == 0))
@@ -129,83 +741,49 @@ void
completion_search (t_completion *completion, void *channel,
char *buffer, int size, int pos)
{
int i, pos_start, pos_end;
char *old_word_found;
/* TODO: complete when no word is there with command according to context */
if (size == 0)
{
completion->word_found = NULL;
return;
}
/* if new complation => look for base word */
/* if new completion => look for base word */
if (pos != completion->position)
{
completion->word_found = NULL;
if ((pos == size) || (buffer[pos-1] != ' '))
pos--;
if ((pos > 0) && (buffer[pos] == ' '))
return;
i = pos;
while ((i >= 0) && (buffer[i] != ' '))
i--;
pos_start = i + 1;
i = pos;
while ((i < size) && (buffer[i] != ' '))
i++;
pos_end = i - 1;
if (pos_start > pos_end)
return;
completion->base_word_pos = pos_start;
if (completion->base_word)
free (completion->base_word);
completion->base_word = (char *) malloc (pos_end - pos_start + 2);
for (i = pos_start; i <= pos_end; i++)
completion->base_word[i - pos_start] = buffer[i];
completion->base_word[pos_end - pos_start + 1] = '\0';
if (completion->base_word[0] == '/')
completion->position_replace = pos_start + 1;
else
completion->position_replace = pos_start;
completion_find_context (completion, channel, buffer, size, pos);
}
/* completion */
old_word_found = completion->word_found;
if (completion->base_word[0] == '/')
switch (completion->context)
{
completion_command (completion);
if (completion->word_found)
{
if (old_word_found)
completion->diff_size = strlen (completion->word_found) -
strlen (old_word_found);
case COMPLETION_NULL:
/* should never be executed */
return;
case COMPLETION_NICK:
if (channel)
completion_nick (completion, (t_irc_channel *)channel);
else
completion->diff_size = strlen (completion->word_found) -
strlen (completion->base_word) + 1;
}
return;
break;
case COMPLETION_COMMAND:
completion_command (completion);
break;
case COMPLETION_COMMAND_ARG:
if (completion->completion_list)
completion_command_arg (completion, (t_irc_channel *)channel);
else
completion_nick (completion, (t_irc_channel *)channel);
break;
}
else
if (completion->word_found)
{
if (channel)
if (old_word_found)
completion->diff_size = strlen (completion->word_found) -
strlen (old_word_found);
else
{
completion_nick (completion, (t_irc_channel *)channel);
if (completion->word_found)
{
if (old_word_found)
completion->diff_size = strlen (completion->word_found) -
strlen (old_word_found);
else
completion->diff_size = strlen (completion->word_found) -
strlen (completion->base_word);
}
completion->diff_size = strlen (completion->word_found) -
strlen (completion->base_word);
if (completion->context == COMPLETION_COMMAND)
completion->diff_size++;
}
}
}
+24 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -21,16 +21,33 @@
#ifndef __WEECHAT_COMPLETION_H
#define __WEECHAT_COMPLETION_H 1
#include "weelist.h"
#define COMPLETION_NULL 0
#define COMPLETION_NICK 1
#define COMPLETION_COMMAND 2
#define COMPLETION_COMMAND_ARG 3
typedef struct t_completion t_completion;
struct t_completion
{
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where we shoud complete */
char *word_found; /* word found (to replace base word) */
int position_replace; /* position where word should be replaced */
int diff_size; /* size difference (< 0 = char(s) deleted) */
/* completion context */
int context; /* context: null, nick, command, cmd arg */
char *base_command; /* command with arg to complete (can be NULL) */
int base_command_arg; /* # arg to complete (if context is cmd arg) */
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
/* for command argument completion */
t_weelist *completion_list; /* data list for completion */
t_weelist *last_completion; /* last data element for completion */
/* completion found */
char *word_found; /* word found (to replace base word) */
int position_replace; /* position where word has to be replaced */
int diff_size; /* size difference (< 0 = char(s) deleted) */
};
extern void completion_init (t_completion *);
+310
View File
@@ -0,0 +1,310 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* fifo.c: FIFO pipe for WeeChat remote control */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "weechat.h"
#include "fifo.h"
#include "command.h"
#include "weeconfig.h"
#include "../gui/gui.h"
int weechat_fifo = -1;
char *weechat_fifo_filename = NULL;
char *weechat_fifo_unterminated = NULL;
/*
* fifo_create: create FIFO pipe for remote control
*/
void
fifo_create ()
{
int filename_length;
if (cfg_irc_fifo_pipe)
{
/* build FIFO filename: "~/.weechat/weechat_fifo_" + process PID */
if (!weechat_fifo_filename)
{
filename_length = strlen (weechat_home) + 64;
weechat_fifo_filename = (char *) malloc (filename_length * sizeof (char));
snprintf (weechat_fifo_filename, filename_length, "%s/weechat_fifo_%d",
weechat_home, (int) getpid());
}
/* create FIFO pipe, writable for user only */
if ((weechat_fifo = mkfifo (weechat_fifo_filename, 0600)) != 0)
{
weechat_fifo = -1;
gui_printf (NULL,
_("%s unable to create FIFO pipe for remote control (%s)\n"),
WEECHAT_ERROR, weechat_fifo_filename);
wee_log_printf (_("%s unable to create FIFO pipe for remote control (%s)\n"),
WEECHAT_ERROR, weechat_fifo_filename);
return;
}
/* open FIFO pipe in read-only (for WeeChat), non nlobking mode */
if ((weechat_fifo = open (weechat_fifo_filename, O_RDONLY | O_NONBLOCK)) == -1)
{
gui_printf (NULL,
_("%s unable to open FIFO pipe (%s) for reading\n"),
WEECHAT_ERROR, weechat_fifo_filename);
wee_log_printf (_("%s unable to open FIFO pipe (%s) for reading\n"),
WEECHAT_ERROR, weechat_fifo_filename);
return;
}
wee_log_printf (_("FIFO pipe is open\n"));
}
}
/*
* fifo_exec: execute a command/text received by FIFO pipe
*/
void
fifo_exec (char *text)
{
char *pos_msg, *pos;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_gui_buffer *ptr_buffer;
pos = NULL;
ptr_server = NULL;
ptr_channel = NULL;
ptr_buffer = NULL;
/* look for server/channel at beginning of text */
/* text may be: "server,channel *text" or "server *text" or "*text" */
if (text[0] == '*')
{
pos_msg = text + 1;
ptr_server = SERVER(gui_current_window->buffer);
ptr_buffer = gui_current_window->buffer;
if (!ptr_server)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s invalid buffer for displaying text via FIFO pipe\n"),
WEECHAT_WARNING);
return;
}
}
else
{
pos_msg = strstr (text, " *");
if (!pos_msg)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s invalid text received on FIFO pipe\n"),
WEECHAT_WARNING);
return;
}
pos_msg[0] = '\0';
pos = pos_msg - 1;
pos_msg += 2;
while ((pos >= text) && (pos[0] == ' '))
{
pos[0] = '\0';
pos--;
}
if (text[0])
{
pos = strchr (text, ',');
if (pos)
pos[0] = '\0';
ptr_server = server_search (text);
if (!ptr_server || !ptr_server->buffer)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s server \"%s\" not found (FIFO pipe data)\n"),
WEECHAT_WARNING, text);
return;
}
if (ptr_server)
{
if (pos)
{
ptr_channel = channel_search (ptr_server, pos + 1);
if (!ptr_channel)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s channel \"%s\" not found (FIFO pipe data)\n"),
WEECHAT_WARNING, pos + 1);
return;
}
}
}
}
}
if (!ptr_server)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s invalid text received on FIFO pipe\n"),
WEECHAT_WARNING);
return;
}
if (!ptr_buffer)
{
if (ptr_channel)
ptr_buffer = ptr_channel->buffer;
else
ptr_buffer = ptr_server->buffer;
}
user_command (ptr_server, ptr_buffer, pos_msg);
}
/*
* fifo_read: read data in FIFO pipe
*/
void
fifo_read ()
{
static char buffer[4096 + 2];
char *buf2, *pos, *ptr_buf, *next_ptr_buf;
int num_read;
num_read = read (weechat_fifo, buffer, sizeof (buffer) - 2);
if (num_read > 0)
{
buffer[num_read] = '\0';
buf2 = NULL;
ptr_buf = buffer;
if (weechat_fifo_unterminated)
{
buf2 = (char *) malloc (strlen (weechat_fifo_unterminated) +
strlen (buffer) + 1);
if (buf2)
{
strcpy (buf2, weechat_fifo_unterminated);
strcat (buf2, buffer);
}
ptr_buf = buf2;
free (weechat_fifo_unterminated);
weechat_fifo_unterminated = NULL;
}
while (ptr_buf && ptr_buf[0])
{
next_ptr_buf = NULL;
pos = strstr (ptr_buf, "\r\n");
if (pos)
{
pos[0] = '\0';
next_ptr_buf = pos + 2;
}
else
{
pos = strstr (ptr_buf, "\n");
if (pos)
{
pos[0] = '\0';
next_ptr_buf = pos + 1;
}
else
{
weechat_fifo_unterminated = strdup (ptr_buf);
ptr_buf = NULL;
next_ptr_buf = NULL;
}
}
if (ptr_buf)
fifo_exec (ptr_buf);
ptr_buf = next_ptr_buf;
}
if (buf2)
free (buf2);
}
else
{
if (num_read < 0)
{
gui_printf (NULL,
_("%s error reading FIFO pipe, closing it\n"),
WEECHAT_ERROR);
wee_log_printf (_("%s error reading FIFO pipe, closing it\n"),
WEECHAT_ERROR);
fifo_remove ();
}
else
{
close (weechat_fifo);
weechat_fifo = open (weechat_fifo_filename, O_RDONLY | O_NONBLOCK);
}
}
}
/*
* fifo_remove: remove FIFO pipe
*/
void
fifo_remove ()
{
if (weechat_fifo != -1)
{
/* close FIFO pipe */
close (weechat_fifo);
weechat_fifo = -1;
}
/* remove FIFO from disk */
if (weechat_fifo_filename)
unlink (weechat_fifo_filename);
if (weechat_fifo_unterminated)
{
free (weechat_fifo_unterminated);
weechat_fifo_unterminated = NULL;
}
if (weechat_fifo_filename)
{
free (weechat_fifo_filename);
weechat_fifo_filename = NULL;
}
wee_log_printf (_("FIFO pipe is closed\n"));
}
+30
View File
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WEECHAT_FIFO_H
#define __WEECHAT_FIFO_H 1
extern int weechat_fifo;
extern void fifo_create ();
extern void fifo_read ();
extern void fifo_remove ();
#endif /* fifo.h */
+78 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -39,6 +39,32 @@ 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
*/
@@ -53,6 +79,8 @@ history_add (void *buffer, char *string)
if (new_history)
{
new_history->text = strdup (string);
if (cfg_log_hide_nickserv_pwd)
history_hide_password (new_history->text);
if (history_general)
history_general->prev_history = new_history;
@@ -82,6 +110,8 @@ history_add (void *buffer, char *string)
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;
@@ -106,3 +136,50 @@ history_add (void *buffer, char *string)
}
}
}
/*
* history_general_free: free general history
*/
void
history_general_free ()
{
t_history *ptr_history;
while (history_general)
{
ptr_history = history_general->next_history;
if (history_general->text)
free (history_general->text);
free (history_general);
history_general = ptr_history;
}
history_general = NULL;
history_general_last = NULL;
history_general_ptr = NULL;
num_history_general = 0;
}
/*
* history_buffer_free: free history for a buffer
*/
void
history_buffer_free (void *buffer)
{
t_history *ptr_history;
while (((t_gui_buffer *)(buffer))->history)
{
ptr_history = ((t_gui_buffer *)(buffer))->history->next_history;
if (((t_gui_buffer *)(buffer))->history->text)
free (((t_gui_buffer *)(buffer))->history->text);
free (((t_gui_buffer *)(buffer))->history);
((t_gui_buffer *)(buffer))->history = ptr_history;
}
((t_gui_buffer *)(buffer))->history = NULL;
((t_gui_buffer *)(buffer))->last_history = NULL;
((t_gui_buffer *)(buffer))->ptr_history = NULL;
((t_gui_buffer *)(buffer))->num_history = 0;
}
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -31,5 +31,7 @@ struct t_history
};
extern void history_add (void *, char *);
extern void history_general_free ();
extern void history_buffer_free (void *);
#endif /* history.h */
+20 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -80,6 +80,13 @@ 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 */
@@ -159,6 +166,18 @@ hotlist_free (t_weechat_hotlist *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
*/
+2 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -39,6 +39,7 @@ 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 */
+172
View File
@@ -0,0 +1,172 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* 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"
#include "../gui/gui.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_write_line: writes a WeeChat line to log file
*/
void
log_write_line (t_gui_buffer *buffer, t_gui_line *line)
{
t_gui_message *ptr_msg;
if (buffer->log_file)
{
log_write_date (buffer);
for (ptr_msg = line->messages; ptr_msg; ptr_msg = ptr_msg->next_message)
{
if (ptr_msg->type != MSG_TYPE_TIME)
fprintf (buffer->log_file, "%s", ptr_msg->message);
}
fprintf (buffer->log_file, "\n");
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);
}
+33
View File
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WEECHAT_LOG_H
#define __WEECHAT_LOG_H 1
#include "../irc/irc.h"
#include "../gui/gui.h"
extern void log_write_date (t_gui_buffer *);
extern void log_write (t_gui_buffer *, char *);
extern void log_write_line (t_gui_buffer *, t_gui_line *);
extern void log_start (t_gui_buffer *);
extern void log_end (t_gui_buffer *);
#endif /* log.h */
+326 -46
View File
@@ -8,15 +8,13 @@
* ### WeeChat - Wee Enhanced Environment for Chat ###
* ### Fast & light environment for Chat ###
* ### ###
* ### By: FlashCode <flashcode@flashtux.org> ###
* ### Bounga <bounga@altern.org> ###
* ### Xahlexx <xahlexx@tuxisland.org> ###
* ### ###
* ### http://weechat.flashtux.org ###
* ### By FlashCode <flashcode@flashtux.org> ###
### ###
* ### http://weechat.flashtux.org ###
* ### ###
* ############################################################################
*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -50,32 +48,31 @@
#include <time.h>
#include <signal.h>
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
#include <langinfo.h>
#include "weechat.h"
#include "weeconfig.h"
#include "command.h"
#include "fifo.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
#include "../plugins/plugins.h"
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) */
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
int sigsegv = 0; /* SIGSEGV received? */
char *weechat_home = NULL; /* WeeChat home dir. (example: /home/toto/.weechat) */
FILE *weechat_log_file = NULL; /* WeeChat log file (~/.weechat/weechat.log) */
char *local_charset = NULL; /* local charset, for example: ISO-8859-1 */
int server_cmd_line; /* at least one server on WeeChat command line */
/*
* my_sigint: SIGINT handler, do nothing (just ignore this signal)
* Prevents user for exiting with Ctrl-C
*/
void
my_sigint ()
{
/* do nothing */
}
/*
* wee_log_printf: displays a message in WeeChat log (~/.weechat/weechat.log)
*/
@@ -88,7 +85,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);
@@ -98,13 +95,84 @@ wee_log_printf (char *message, ...)
seconds = time (NULL);
date_tmp = localtime (&seconds);
if (date_tmp)
fprintf (log_file, "[%04d-%02d-%02d %02d:%02d:%02d] %s",
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 (log_file, "%s", buffer);
fflush (log_file);
fprintf (weechat_log_file, "%s", buffer);
fflush (weechat_log_file);
}
/*
* weechat_convert_encoding: convert string to another encoding
*/
char *
weechat_convert_encoding (char *from_code, char *to_code, char *string)
{
char *outbuf;
#ifdef HAVE_ICONV
iconv_t cd;
char *inbuf, *ptr_inbuf, *ptr_outbuf;
int inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (strcasecmp(from_code, to_code) != 0))
{
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))
outbuf = strdup (string);
else
{
inbuf = strdup (string);
ptr_inbuf = inbuf;
inbytesleft = strlen (inbuf);
outbytesleft = inbytesleft * 4;
outbuf = (char *) malloc (outbytesleft + 2);
ptr_outbuf = outbuf;
iconv (cd, &ptr_inbuf, &inbytesleft, &ptr_outbuf, &outbytesleft);
if (inbytesleft != 0)
{
free (outbuf);
outbuf = strdup (string);
}
else
ptr_outbuf[0] = '\0';
free (inbuf);
iconv_close (cd);
}
}
else
outbuf = strdup (string);
#else
/* make gcc happy */
(void) from_code;
(void) to_code;
outbuf = strdup (string);
#endif /* HAVE_ICONV */
return outbuf;
}
/*
* get_timeval_diff: calculates difference between two times (return in milliseconds)
*/
long get_timeval_diff(struct timeval *tv1, struct timeval *tv2)
{
long diff_sec, diff_usec;
diff_sec = tv2->tv_sec - tv1->tv_sec;
diff_usec = tv2->tv_usec - tv1->tv_usec;
if (diff_usec < 0)
{
diff_usec += 1000000;
diff_sec--;
}
return ((diff_usec / 1000) + (diff_sec * 1000));
}
/*
@@ -180,6 +248,59 @@ void wee_display_config_options ()
printf (_("where 'j' is alias name, and 'join' associated command.\n\n"));
}
/*
* wee_display_commands: display WeeChat and/or IRC commands
*/
void wee_display_commands (int weechat_cmd, int irc_cmd)
{
int i;
if (weechat_cmd)
{
printf (_("%s internal commands:\n"), PACKAGE_NAME);
printf ("\n");
for (i = 0; weechat_commands[i].command_name; i++)
{
printf ("* %s", weechat_commands[i].command_name);
if (weechat_commands[i].arguments &&
weechat_commands[i].arguments[0])
printf (" %s\n\n", _(weechat_commands[i].arguments));
else
printf ("\n\n");
printf ("%s\n\n", _(weechat_commands[i].command_description));
if (weechat_commands[i].arguments_description &&
weechat_commands[i].arguments_description[0])
printf ("%s\n\n",
_(weechat_commands[i].arguments_description));
}
}
if (irc_cmd)
{
printf (_("IRC commands:\n"));
printf ("\n");
for (i = 0; irc_commands[i].command_name; i++)
{
if (irc_commands[i].cmd_function_args ||
irc_commands[i].cmd_function_1arg)
{
printf ("* %s", irc_commands[i].command_name);
if (irc_commands[i].arguments &&
irc_commands[i].arguments[0])
printf (" %s\n\n", _(irc_commands[i].arguments));
else
printf ("\n\n");
printf ("%s\n\n", _(irc_commands[i].command_description));
if (irc_commands[i].arguments_description &&
irc_commands[i].arguments_description[0])
printf ("%s\n\n",
_(irc_commands[i].arguments_description));
}
}
}
}
/*
* wee_parse_args: parse command line args
*/
@@ -198,26 +319,38 @@ wee_parse_args (int argc, char *argv[])
|| (strcmp (argv[i], "--config") == 0))
{
wee_display_config_options ();
exit (EXIT_SUCCESS);
wee_shutdown (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);
wee_shutdown (EXIT_SUCCESS);
}
if ((strcmp (argv[i], "-i") == 0)
|| (strcmp (argv[i], "--irc-commands") == 0))
{
wee_display_commands (0, 1);
wee_shutdown (EXIT_SUCCESS);
}
else if ((strcmp (argv[i], "-l") == 0)
|| (strcmp (argv[i], "--license") == 0))
{
printf ("\n%s%s", WEE_LICENSE);
exit (EXIT_SUCCESS);
wee_shutdown (EXIT_SUCCESS);
}
else if ((strcmp (argv[i], "-v") == 0)
|| (strcmp (argv[i], "--version") == 0))
{
printf (PACKAGE_VERSION "\n");
exit (EXIT_SUCCESS);
wee_shutdown (EXIT_SUCCESS);
}
if ((strcmp (argv[i], "-w") == 0)
|| (strcmp (argv[i], "--weechat-commands") == 0))
{
wee_display_commands (1, 0);
wee_shutdown (EXIT_SUCCESS);
}
else if ((strncasecmp (argv[i], "irc://", 6) == 0))
{
@@ -228,11 +361,13 @@ wee_parse_args (int argc, char *argv[])
}
else
{
if (!server_new (server_tmp.name, 0, 1,
server_tmp.address, server_tmp.port,
if (!server_new (server_tmp.name, server_tmp.autoconnect,
server_tmp.autoreconnect,
server_tmp.autoreconnect_delay,
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))
NULL, NULL, NULL, 0, server_tmp.autojoin, 1))
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
WEECHAT_WARNING, argv[i]);
server_destroy (&server_tmp);
@@ -290,7 +425,7 @@ wee_create_home_dirs ()
{
fprintf (stderr, _("%s unable to get HOME directory\n"),
WEECHAT_ERROR);
exit (EXIT_FAILURE);
wee_shutdown (EXIT_FAILURE);
}
dir_length = strlen (ptr_home) + 10;
weechat_home =
@@ -299,7 +434,7 @@ wee_create_home_dirs ()
{
fprintf (stderr, _("%s not enough memory for home directory\n"),
WEECHAT_ERROR);
exit (EXIT_FAILURE);
wee_shutdown (EXIT_FAILURE);
}
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
DIR_SEPARATOR);
@@ -309,7 +444,7 @@ wee_create_home_dirs ()
{
fprintf (stderr, _("%s unable to create ~/.weechat directory\n"),
WEECHAT_ERROR);
exit (EXIT_FAILURE);
wee_shutdown (EXIT_FAILURE);
}
dir_length = strlen (weechat_home) + 64;
@@ -354,6 +489,16 @@ wee_create_home_dirs ()
}
#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);
}
chmod (dir_name, 0700);
free (dir_name);
}
@@ -364,9 +509,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;
@@ -386,7 +528,7 @@ wee_init_log ()
filename =
(char *) malloc (filename_length * sizeof (char));
snprintf (filename, filename_length, "%s/" WEECHAT_LOG_NAME, weechat_home);
if ((log_file = fopen (filename, "wt")) == NULL)
if ((weechat_log_file = fopen (filename, "wt")) == NULL)
fprintf (stderr,
_("%s unable to create/append to log file (~/.weechat/%s)"),
WEECHAT_WARNING, WEECHAT_LOG_NAME);
@@ -433,18 +575,150 @@ weechat_welcome_message ()
"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
}
/*
* wee_gui_shutdown: shutdown WeeChat GUI
*/
void
wee_gui_shutdown ()
{
dcc_end ();
server_free_all ();
gui_end ();
}
/*
* wee_shutdown: shutdown WeeChat
*/
void
wee_shutdown ()
wee_shutdown (int return_code)
{
server_free_all ();
gui_end ();
if (log_file)
fclose (log_file);
exit (EXIT_SUCCESS);
fifo_remove ();
if (weechat_home)
free (weechat_home);
if (weechat_log_file)
fclose (weechat_log_file);
if (local_charset)
free (local_charset);
alias_free_all ();
exit (return_code);
}
/*
* wee_dump writes dump to WeeChat log file
*/
void
wee_dump (int crash)
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
t_gui_window *ptr_window;
t_gui_buffer *ptr_buffer;
/* prevent reentrance */
if (sigsegv)
exit (EXIT_FAILURE);
if (crash)
{
sigsegv = 1;
wee_log_printf ("very bad, WeeChat is crashing (SIGSEGV received)...\n");
}
wee_log_printf ("\n");
if (crash)
{
wee_log_printf ("****** WeeChat CRASH DUMP ******\n");
wee_log_printf ("****** Please send this file to WeeChat developers ******\n");
wee_log_printf ("****** and explain when this crash happened ******\n");
}
else
{
wee_log_printf ("****** WeeChat dump request ******\n");
}
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
wee_log_printf ("\n");
server_print_log (ptr_server);
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
wee_log_printf ("\n");
channel_print_log (ptr_channel);
for (ptr_nick = ptr_channel->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
{
wee_log_printf ("\n");
nick_print_log (ptr_nick);
}
}
}
wee_log_printf ("\n");
wee_log_printf ("[windows/buffers]\n");
wee_log_printf (" => windows:\n");
for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window)
{
wee_log_printf (" 0x%X\n", ptr_window);
}
wee_log_printf (" => buffers:\n");
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
wee_log_printf (" 0x%X\n", ptr_buffer);
}
wee_log_printf (" => current window = 0x%X\n", gui_current_window);
for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window)
{
wee_log_printf ("\n");
gui_window_print_log (ptr_window);
}
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
wee_log_printf ("\n");
gui_buffer_print_log (ptr_buffer);
}
wee_log_printf ("\n");
wee_log_printf ("****** End of dump ******\n");
wee_log_printf ("\n");
}
/*
* my_sigint: SIGINT handler, do nothing (just ignore this signal)
* Prevents user for exiting with Ctrl-C
*/
void
my_sigint ()
{
/* do nothing */
}
/*
* my_sigsegv: SIGSEGV handler: save crash log to ~/.weechat/weechat.log and exit
*/
void
my_sigsegv ()
{
wee_dump (1);
wee_gui_shutdown ();
fprintf (stderr, "\n");
fprintf (stderr, "*** Very bad! WeeChat has crashed (SIGSEGV received)\n");
fprintf (stderr, "*** Full crash dump was saved to ~/.weechat/weechat.log file\n");
fprintf (stderr, "*** Please send this file to WeeChat developers.\n");
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
wee_shutdown (EXIT_FAILURE);
}
/*
@@ -460,13 +734,16 @@ main (int argc, char *argv[])
textdomain (PACKAGE);
#endif
local_charset = strdup (nl_langinfo (CODESET));
signal (SIGINT, my_sigint); /* ignore SIGINT signal */
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */
wee_init_vars (); /* initialize some variables */
wee_parse_args (argc, argv); /* parse command line args */
wee_create_home_dirs (); /* create WeeChat directories */
wee_init_log (); /* init log file */
index_command_build (); /* build commands index for completion */
command_index_build (); /* build commands index for completion */
switch (config_read ()) /* read configuration */
{
@@ -488,13 +765,16 @@ main (int argc, char *argv[])
weechat_welcome_message (); /* display WeeChat welcome message */
/* auto-connect to servers */
server_auto_connect (server_cmd_line);
fifo_create (); /* create FIFO pipe for remote control */
gui_main_loop (); /* WeeChat main loop */
plugin_end (); /* end plugin interface(s) */
server_disconnect_all (); /* disconnect from all servers */
(void) config_write (NULL); /* save config file */
wee_shutdown (); /* quit WeeChat (oh no, why?) */
command_index_free (); /* free commands index */
wee_gui_shutdown (); /* shut down WeeChat GUI */
wee_shutdown (EXIT_SUCCESS); /* quit WeeChat (oh no, why?) */
return EXIT_SUCCESS; /* make gcc happy (never executed) */
}
+24 -18
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,7 @@
#endif
#include <stdio.h>
#include <sys/time.h>
#if defined(ENABLE_NLS) && !defined(_)
#include <locale.h>
@@ -43,11 +44,11 @@
#endif
#define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2004 by Wee Team"
#define WEECHAT_COPYRIGHT_DATE "(c) 2003-2005"
#define WEECHAT_WEBSITE "http://weechat.flashtux.org"
#define WEECHAT_ERROR _(PACKAGE_NAME " Error:")
#define WEECHAT_WARNING _(PACKAGE_NAME " Warning:")
#define WEECHAT_ERROR _("WeeChat Error:")
#define WEECHAT_WARNING _("WeeChat Warning:")
/* log file */
@@ -56,11 +57,8 @@
/* license */
#define WEE_LICENSE \
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" \
"Website: " WEECHAT_WEBSITE "\n\n" \
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
"This program is free software; you can redistribute it and/or modify\n" \
"it under the terms of the GNU General Public License as published by\n" \
"the Free Software Foundation; either version 2 of the License, or\n" \
@@ -77,31 +75,39 @@
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\n"
#define WEE_USAGE1 \
PACKAGE_STRING " (c) Copyright 2004, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode, Bounga and Xahlexx - " WEECHAT_WEBSITE "\n\n" \
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
"Usage: %s [options ...]\n" \
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
#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"
" -c, --config display config file options\n" \
" -h, --help this help screen\n" \
" -i, --irc-commands display IRC commands\n" \
" -l, --license display WeeChat license\n" \
" -v, --version display WeeChat version\n" \
" -w, --weechat-commands display WeeChat commands\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 */
extern int quit_weechat;
extern char *weechat_home;
extern char *local_charset;
extern void wee_log_printf (char *, ...);
extern void wee_shutdown ();
extern void wee_dump (int);
extern char *weechat_convert_encoding (char *, char *, char *);
extern long get_timeval_diff (struct timeval *, struct timeval *);
extern void wee_shutdown (int);
#endif /* weechat.h */
+451 -143
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -33,10 +33,12 @@
#include <time.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "weechat.h"
#include "weeconfig.h"
#include "command.h"
#include "fifo.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@@ -48,6 +50,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
{ CONFIG_SECTION_COLORS, "colors" },
{ CONFIG_SECTION_HISTORY, "history" },
{ CONFIG_SECTION_LOG, "log" },
{ CONFIG_SECTION_IRC, "irc" },
{ CONFIG_SECTION_DCC, "dcc" },
{ CONFIG_SECTION_PROXY, "proxy" },
{ CONFIG_SECTION_ALIAS, "alias" },
@@ -60,6 +63,9 @@ int cfg_look_set_title;
int cfg_look_startup_logo;
int cfg_look_startup_version;
char *cfg_look_weechat_slogan;
char *cfg_look_charset_decode;
char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
int cfg_look_color_nicks;
int cfg_look_color_actions;
int cfg_look_remove_colors_from_msgs;
@@ -94,6 +100,18 @@ t_config_option weechat_options_look[] =
N_("WeeChat slogan (if empty, slogan is not used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"the geekest IRC client!", NULL, NULL, &cfg_look_weechat_slogan, config_change_noop },
{ "look_charset_decode", N_("charset for decoding messages from server"),
N_("charset for decoding messages from server, examples: UTF-8, ISO-8859-1 (if empty, messages are not converted)"),
OPTION_TYPE_STRING, 0, 0, 0,
"UTF-8", NULL, NULL, &cfg_look_charset_decode, config_change_buffer_content },
{ "look_charset_encode", N_("charset for encoding messages sent to server"),
N_("charset for encoding messages sent to server, examples: UFT-8, ISO-8859-1 (if empty, local charset is used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_look_charset_encode, config_change_buffer_content },
{ "look_charset_internal", N_("internal WeeChat charset (should be ISO)"),
N_("internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)"),
OPTION_TYPE_STRING, 0, 0, 0,
"ISO-8859-1", NULL, NULL, &cfg_look_charset_internal, config_change_buffer_content },
{ "look_color_nicks", N_("display nick names with different colors"),
N_("display nick names with different colors"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -147,7 +165,7 @@ t_config_option weechat_options_look[] =
{ "look_infobar_timestamp", N_("timestamp for time in infobar"),
N_("timestamp for time in infobar"),
OPTION_TYPE_STRING, 0, 0, 0,
"%B, %A %d %G - %H:%M", NULL, NULL, &cfg_look_infobar_timestamp, config_change_buffer_content },
"%B, %A %d %Y - %H:%M", NULL, NULL, &cfg_look_infobar_timestamp, config_change_buffer_content },
{ "look_infobar_delay_highlight", N_("delay (in seconds) for highlight messages in infobar"),
N_("delay (in seconds) for highlight messages in infobar "
"(0 = disable highlight notifications in infobar)"),
@@ -186,6 +204,9 @@ int cfg_col_input_channel;
int cfg_col_input_nick;
int cfg_col_input_bg;
int cfg_col_nick;
int cfg_col_nick_away;
int cfg_col_nick_chanowner;
int cfg_col_nick_chanadmin;
int cfg_col_nick_op;
int cfg_col_nick_halfop;
int cfg_col_nick_voice;
@@ -193,13 +214,20 @@ int cfg_col_nick_sep;
int cfg_col_nick_self;
int cfg_col_nick_private;
int cfg_col_nick_bg;
int cfg_col_dcc_selected;
int cfg_col_dcc_waiting;
int cfg_col_dcc_connecting;
int cfg_col_dcc_active;
int cfg_col_dcc_done;
int cfg_col_dcc_failed;
int cfg_col_dcc_aborted;
t_config_option weechat_options_colors[] =
{ /* title window */
{ "col_title", N_("color for title bar"),
N_("color for title bar"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_title, NULL, &config_change_color },
"default", NULL, &cfg_col_title, NULL, &config_change_color },
{ "col_title_bg", N_("background for title bar"),
N_("background for title bar"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -209,11 +237,11 @@ t_config_option weechat_options_colors[] =
{ "col_chat", N_("color for chat text"),
N_("color for chat text"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_chat, NULL, &config_change_color },
"default", NULL, &cfg_col_chat, NULL, &config_change_color },
{ "col_chat_time", N_("color for time"),
N_("color for time in chat window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_chat_time, NULL, &config_change_color },
"default", NULL, &cfg_col_chat_time, NULL, &config_change_color },
{ "col_chat_time_sep", N_("color for time separator"),
N_("color for time separator (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -255,7 +283,7 @@ t_config_option weechat_options_colors[] =
{ "col_status", N_("color for status bar"),
N_("color for status bar"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_status, NULL, &config_change_color },
"default", NULL, &cfg_col_status, NULL, &config_change_color },
{ "col_status_delimiters", N_("color for status bar delimiters"),
N_("color for status bar delimiters"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -271,8 +299,8 @@ t_config_option weechat_options_colors[] =
{ "col_status_data_other", N_("color for window with new data (not messages)"),
N_("color for window with new data (not messages) (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_status_data_other, NULL, &config_change_color },
{ "col_status_more", N_("color for \"*MORE*\" text"),
"default", NULL, &cfg_col_status_data_other, NULL, &config_change_color },
{ "col_status_more", N_("color for \"-MORE-\" text"),
N_("color for window with new data (status bar)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_status_more, NULL, &config_change_color },
@@ -299,7 +327,7 @@ t_config_option weechat_options_colors[] =
{ "col_input", N_("color for input text"),
N_("color for input text"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_input, NULL, &config_change_color },
"default", NULL, &cfg_col_input, NULL, &config_change_color },
{ "col_input_channel", N_("color for input text (channel name)"),
N_("color for input text (channel name)"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -317,7 +345,19 @@ t_config_option weechat_options_colors[] =
{ "col_nick", N_("color for nicknames"),
N_("color for nicknames"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_nick, NULL, &config_change_color },
"default", NULL, &cfg_col_nick, NULL, &config_change_color },
{ "col_nick_away", N_("color for away nicknames"),
N_("color for away nicknames"),
OPTION_TYPE_COLOR, 0, 0, 0,
"cyan", NULL, &cfg_col_nick_away, NULL, &config_change_color },
{ "col_nick_chanowner", N_("color for chan owner symbol"),
N_("color for chan owner symbol (specific to unrealircd)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_nick_chanowner, NULL, &config_change_color },
{ "col_nick_chanadmin", N_("color for chan admin symbol"),
N_("color for chan admin symbol (specific to unrealircd)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_nick_chanadmin, NULL, &config_change_color },
{ "col_nick_op", N_("color for operator symbol"),
N_("color for operator symbol"),
OPTION_TYPE_COLOR, 0, 0, 0,
@@ -341,12 +381,42 @@ t_config_option weechat_options_colors[] =
{ "col_nick_private", N_("color for other nick in private window"),
N_("color for other nick in private window"),
OPTION_TYPE_COLOR, 0, 0, 0,
"gray", NULL, &cfg_col_nick_private, NULL, &config_change_color },
"default", NULL, &cfg_col_nick_private, NULL, &config_change_color },
{ "col_nick_bg", N_("background for nicknames"),
N_("background for nicknames"),
OPTION_TYPE_COLOR, 0, 0, 0,
"default", NULL, &cfg_col_nick_bg, NULL, &config_change_color },
/* DCC */
{ "col_chat_dcc_selected", N_("color for selected DCC"),
N_("color for selected DCC (chat window)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"white", NULL, &cfg_col_dcc_selected, NULL, &config_change_color },
{ "col_dcc_waiting", N_("color for \"waiting\" dcc status"),
N_("color for \"waiting\" dcc status"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightcyan", NULL, &cfg_col_dcc_waiting, NULL, &config_change_color },
{ "col_dcc_connecting", N_("color for \"connecting\" dcc status"),
N_("color for \"connecting\" dcc status"),
OPTION_TYPE_COLOR, 0, 0, 0,
"yellow", NULL, &cfg_col_dcc_connecting, NULL, &config_change_color },
{ "col_dcc_active", N_("color for \"active\" dcc status"),
N_("color for \"active\" dcc status"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightblue", NULL, &cfg_col_dcc_active, NULL, &config_change_color },
{ "col_dcc_done", N_("color for \"done\" dcc status"),
N_("color for \"done\" dcc status"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightgreen", NULL, &cfg_col_dcc_done, NULL, &config_change_color },
{ "col_dcc_failed", N_("color for \"failed\" dcc status"),
N_("color for \"failed\" dcc status"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightred", NULL, &cfg_col_dcc_failed, NULL, &config_change_color },
{ "col_dcc_aborted", N_("color for \"aborted\" dcc status"),
N_("color for \"aborted\" dcc status"),
OPTION_TYPE_COLOR, 0, 0, 0,
"lightred", NULL, &cfg_col_dcc_aborted, NULL, &config_change_color },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -360,103 +430,157 @@ t_config_option weechat_options_history[] =
N_("maximum number of lines in history "
"for one server/channel/private window (0 = unlimited)"),
OPTION_TYPE_INT, 0, INT_MAX, 4096,
NULL, NULL, &cfg_history_max_lines, NULL, NULL },
NULL, NULL, &cfg_history_max_lines, NULL, config_change_noop },
{ "history_max_commands", N_("max user commands in history"),
N_("maximum number of user commands in history (0 = unlimited)"),
OPTION_TYPE_INT, 0, INT_MAX, 100,
NULL, NULL, &cfg_history_max_commands, NULL, NULL },
NULL, NULL, &cfg_history_max_commands, NULL, config_change_noop },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
/* config, log section */
int cfg_log_auto_channels;
int cfg_log_auto_server;
int cfg_log_auto_channel;
int cfg_log_auto_private;
int cfg_log_plugin_msg;
char *cfg_log_path;
char *cfg_log_name;
char *cfg_log_timestamp;
char *cfg_log_start_string;
char *cfg_log_end_string;
int cfg_log_hide_nickserv_pwd;
t_config_option weechat_options_log[] =
{ { "log_auto_channels", N_("automatically log channel chats"),
{ { "log_auto_server", N_("automatically log server messages"),
N_("automatically log server messages"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_log_auto_server, NULL, NULL },
{ "log_auto_channel", N_("automatically log channel chats"),
N_("automatically log channel chats"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_log_auto_channels, NULL, NULL },
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_log_auto_channel, NULL, NULL },
{ "log_auto_private", N_("automatically log private chats"),
N_("automatically log private chats"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_log_auto_private, NULL, NULL },
{ "log_plugin_msg", N_("log messages from plugins (scripts)"),
N_("log messages from plugins (scripts)"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_log_plugin_msg, NULL, NULL },
{ "log_path", N_("path for log files"),
N_("path for WeeChat log files"),
OPTION_TYPE_STRING, 0, 0, 0,
"~/.weechat/logs/", NULL, NULL, &cfg_log_path, NULL },
{ "log_name", N_("name for log files"),
N_("name for log files (%S == irc server name, "
"%N == channel name (or nickname if private chat)"),
OPTION_TYPE_STRING, 0, 0, 0,
"%S,%N.weechatlog", NULL, NULL, &cfg_log_name, NULL },
"~/.weechat/logs/", NULL, NULL, &cfg_log_path, config_change_noop },
{ "log_timestamp", N_("timestamp for log"),
N_("timestamp for log (see man strftime for date/time specifiers)"),
OPTION_TYPE_STRING, 0, 0, 0,
"~", NULL, NULL, &cfg_log_timestamp, NULL },
{ "log_start_string", N_("start string for log files"),
N_("text written when starting new log file "
"(see man strftime for date/time specifiers)"),
"%Y %b %d %H:%M:%S", NULL, NULL, &cfg_log_timestamp, config_change_noop },
{ "log_hide_nickserv_pwd", N_("hide password displayed by nickserv"),
N_("hide password displayed by nickserv"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_log_hide_nickserv_pwd, NULL, config_change_noop },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
/* config, irc section */
int cfg_irc_display_away;
char *cfg_irc_default_msg_away;
char *cfg_irc_default_msg_part;
char *cfg_irc_default_msg_quit;
int cfg_irc_away_check;
int cfg_irc_lag_check;
int cfg_irc_lag_min_show;
int cfg_irc_lag_disconnect;
int cfg_irc_fifo_pipe;
t_config_option weechat_options_irc[] =
{ { "irc_display_away", N_("display message to all channels when away"),
N_("display message to all channels when (un)marking as away"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_irc_display_away, NULL, config_change_noop },
{ "irc_default_msg_away", N_("default message when away"),
N_("default message when away"),
OPTION_TYPE_STRING, 0, 0, 0,
"--- Log started %a %b %d %Y %H:%M:%s", NULL, NULL, &cfg_log_start_string, NULL },
{ "log_end_string", N_("end string for log files"),
N_("text written when ending log file "
"(see man strftime for date/time specifiers)"),
"away", NULL, NULL, &cfg_irc_default_msg_away, config_change_noop },
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
OPTION_TYPE_STRING, 0, 0, 0,
"--- Log ended %a %b %d %Y %H:%M:%s", NULL, NULL, &cfg_log_end_string, NULL },
"", NULL, NULL, &cfg_irc_default_msg_part, config_change_noop },
{ "irc_default_msg_quit", N_("default quit message"),
N_("default quit message ('%v' will be replaced by WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_quit, config_change_noop },
{ "irc_away_check", N_("interval between two checks for away"),
N_("interval between two checks for away (in minutes, 0 = never check)"),
OPTION_TYPE_INT, 0, INT_MAX, 0,
NULL, NULL, &cfg_irc_away_check, NULL, config_change_away_check },
{ "irc_lag_check", N_("interval between two checks for lag"),
N_("interval between two checks for lag (in seconds)"),
OPTION_TYPE_INT, 30, INT_MAX, 60,
NULL, NULL, &cfg_irc_lag_check, NULL, config_change_noop },
{ "irc_lag_min_show", N_("minimum lag to show"),
N_("minimum lag to show (in seconds)"),
OPTION_TYPE_INT, 0, INT_MAX, 1,
NULL, NULL, &cfg_irc_lag_min_show, NULL, config_change_noop },
{ "irc_lag_disconnect", N_("disconnect after important lag"),
N_("disconnect after important lag (in minutes, 0 = never disconnect)"),
OPTION_TYPE_INT, 0, INT_MAX, 5,
NULL, NULL, &cfg_irc_lag_disconnect, NULL, config_change_noop },
{ "irc_fifo_pipe", N_("create a FIFO pipe for remote control"),
N_("create a FIFO pipe for remote control"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_irc_fifo_pipe, NULL, config_change_fifo_pipe },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
/* config, dcc section */
int cfg_dcc_auto_accept_files;
int cfg_dcc_auto_accept_max_size;
int cfg_dcc_auto_accept_chats;
int cfg_dcc_timeout;
int cfg_dcc_blocksize;
char *cfg_dcc_download_path;
char *cfg_dcc_upload_path;
int cfg_dcc_convert_spaces;
int cfg_dcc_auto_rename;
int cfg_dcc_auto_resume;
t_config_option weechat_options_dcc[] =
{ { "dcc_auto_accept_files", N_("automatically accept dcc files"),
N_("automatically accept incoming dcc files"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_dcc_auto_accept_files, NULL, NULL },
{ "dcc_auto_accept_max_size", N_("max size when auto accepting file"),
N_("maximum size for incoming file when automatically accepted"),
OPTION_TYPE_INT, 0, INT_MAX, 0,
NULL, NULL, &cfg_dcc_auto_accept_max_size, NULL, NULL },
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_dcc_auto_accept_files, NULL, config_change_noop },
{ "dcc_auto_accept_chats", N_("automatically accept dcc chats"),
N_("automatically accept dcc chats (use carefully!)"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, NULL },
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, config_change_noop },
{ "dcc_timeout", N_("timeout for dcc request"),
N_("timeout for dcc request (in seconds)"),
OPTION_TYPE_INT, 1, INT_MAX, 300,
NULL, NULL, &cfg_dcc_timeout, NULL, NULL },
NULL, NULL, &cfg_dcc_timeout, NULL, config_change_noop },
{ "dcc_blocksize", N_("block size for dcc packets"),
N_("block size for dcc packets in bytes (default: 65536)"),
OPTION_TYPE_INT, 1024, 102400, 65536,
NULL, NULL, &cfg_dcc_blocksize, NULL, config_change_noop },
{ "dcc_download_path", N_("path for incoming files with dcc"),
N_("path for writing incoming files with dcc (default: user home)"),
OPTION_TYPE_STRING, 0, 0, 0,
"~", NULL, NULL, &cfg_dcc_download_path, NULL },
"~", NULL, NULL, &cfg_dcc_download_path, config_change_noop },
{ "dcc_upload_path", N_("default path for sending files with dcc"),
N_("path for reading files when sending thru dcc (when no path is specified)"),
OPTION_TYPE_STRING, 0, 0, 0, "~",
NULL, NULL, &cfg_dcc_upload_path, NULL },
NULL, NULL, &cfg_dcc_upload_path, config_change_noop },
{ "dcc_convert_spaces", N_("convert spaces to underscores when sending files"),
N_("convert spaces to underscores when sending files"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_dcc_convert_spaces, NULL, config_change_noop },
{ "dcc_auto_rename", N_("automatically rename dcc files if already exists"),
N_("rename incoming files if already exists (add '.1', '.2', ...)"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_dcc_auto_rename, NULL, NULL },
NULL, NULL, &cfg_dcc_auto_rename, NULL, config_change_noop },
{ "dcc_auto_resume", N_("automatically resume aborted transfers"),
N_("automatically resume dcc transfer if connection with remote host is loosed"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_dcc_auto_resume, NULL, NULL },
NULL, NULL, &cfg_dcc_auto_resume, NULL, config_change_noop },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -471,19 +595,19 @@ t_config_option weechat_options_proxy[] =
{ { "proxy_use", N_("use proxy"),
N_("use a proxy server to connect to irc server"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_proxy_use, NULL, NULL },
NULL, NULL, &cfg_proxy_use, NULL, config_change_noop },
{ "proxy_address", N_("proxy address"),
N_("proxy server address (IP or hostname)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_address, NULL },
"", NULL, NULL, &cfg_proxy_address, config_change_noop },
{ "proxy_port", N_("port for proxy"),
N_("port for connecting to proxy server"),
OPTION_TYPE_INT, 0, 65535, 1080,
NULL, NULL, &cfg_proxy_port, NULL, NULL },
NULL, NULL, &cfg_proxy_port, NULL, config_change_noop },
{ "proxy_password", N_("proxy password"),
N_("password for proxy server"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &cfg_proxy_password, NULL },
"", NULL, NULL, &cfg_proxy_password, config_change_noop },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -500,6 +624,14 @@ t_config_option weechat_options_server[] =
N_("automatically connect to server when WeeChat is starting"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &(cfg_server.autoconnect), NULL, NULL },
{ "server_autoreconnect", N_("automatically reconnect to server"),
N_("automatically reconnect to server when disconnected"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &(cfg_server.autoreconnect), NULL, NULL },
{ "server_autoreconnect_delay", N_("delay before trying again to reconnect"),
N_("delay (in seconds) before trying again to reconnect to server"),
OPTION_TYPE_INT, 0, 65535, 30,
NULL, NULL, &(cfg_server.autoreconnect_delay), NULL, NULL },
{ "server_address", N_("server address or hostname"),
N_("IP address or hostname of IRC server"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -536,10 +668,18 @@ t_config_option weechat_options_server[] =
N_("first command to run when connected to server"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.command), NULL },
{ "server_command_delay", N_("delay (in seconds) after command was executed"),
N_("delay (in seconds) after command was executed (example: give some time for authentication)"),
OPTION_TYPE_INT, 0, 5, 0,
NULL, NULL, &(cfg_server.command_delay), NULL, NULL },
{ "server_autojoin", N_("list of channels to join when connected to server"),
N_("comma separated list of channels to join when connected to server"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.autojoin), NULL },
{ "server_autorejoin", N_("automatically rejoin channels when kicked"),
N_("automatically rejoin channels when kicked"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &(cfg_server.autorejoin), NULL, NULL },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
@@ -547,8 +687,8 @@ t_config_option weechat_options_server[] =
t_config_option *weechat_options[CONFIG_NUMBER_SECTIONS] =
{ weechat_options_look, weechat_options_colors, weechat_options_history,
weechat_options_log, weechat_options_dcc, weechat_options_proxy,
NULL, weechat_options_server
weechat_options_log, weechat_options_irc, weechat_options_dcc,
weechat_options_proxy, NULL, weechat_options_server
};
@@ -645,11 +785,45 @@ config_change_buffer_content ()
*/
void
config_change_color()
config_change_color ()
{
gui_init_colors ();
}
/*
* config_change_away_check: called when away check is changed
*/
void
config_change_away_check ()
{
check_away = 0;
if (cfg_irc_away_check == 0)
{
/* reset away flag for all nicks/chans/servers */
server_remove_away ();
}
}
/*
* config_change_fifo_pipe: called when FIFO pipe is changed
*/
void
config_change_fifo_pipe ()
{
if (cfg_irc_fifo_pipe)
{
if (weechat_fifo == -1)
fifo_create ();
}
else
{
if (weechat_fifo != -1)
fifo_remove ();
}
}
/*
* config_option_set_value: set new value for an option
* return: 0 if success
@@ -696,6 +870,117 @@ config_option_set_value (t_config_option *option, char *value)
return 0;
}
/*
* config_get_server_option_ptr: get a pointer to a server config option
*/
void *
config_get_server_option_ptr (t_irc_server *server, char *option_name)
{
if (strcasecmp (option_name, "server_name") == 0)
return (void *)(&server->name);
if (strcasecmp (option_name, "server_autoconnect") == 0)
return (void *)(&server->autoconnect);
if (strcasecmp (option_name, "server_autoreconnect") == 0)
return (void *)(&server->autoreconnect);
if (strcasecmp (option_name, "server_autoreconnect_delay") == 0)
return (void *)(&server->autoreconnect_delay);
if (strcasecmp (option_name, "server_address") == 0)
return (void *)(&server->address);
if (strcasecmp (option_name, "server_port") == 0)
return (void *)(&server->port);
if (strcasecmp (option_name, "server_password") == 0)
return (void *)(&server->password);
if (strcasecmp (option_name, "server_nick1") == 0)
return (void *)(&server->nick1);
if (strcasecmp (option_name, "server_nick2") == 0)
return (void *)(&server->nick2);
if (strcasecmp (option_name, "server_nick3") == 0)
return (void *)(&server->nick3);
if (strcasecmp (option_name, "server_username") == 0)
return (void *)(&server->username);
if (strcasecmp (option_name, "server_realname") == 0)
return (void *)(&server->realname);
if (strcasecmp (option_name, "server_command") == 0)
return (void *)(&server->command);
if (strcasecmp (option_name, "server_command_delay") == 0)
return (void *)(&server->command_delay);
if (strcasecmp (option_name, "server_autojoin") == 0)
return (void *)(&server->autojoin);
if (strcasecmp (option_name, "server_autorejoin") == 0)
return (void *)(&server->autorejoin);
/* option not found */
return NULL;
}
/*
* config_set_server_value: set new value for an option
* return: 0 if success
* -1 if option not found
* -2 if bad value
*/
int
config_set_server_value (t_irc_server *server, char *option_name,
char *value)
{
t_config_option *ptr_option;
int i;
void *ptr_data;
int int_value;
ptr_data = config_get_server_option_ptr (server, option_name);
if (!ptr_data)
return -1;
ptr_option = NULL;
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
/* if option found, return pointer */
if (strcasecmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, option_name) == 0)
{
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
break;
}
}
if (!ptr_option)
return -1;
switch (ptr_option->option_type)
{
case OPTION_TYPE_BOOLEAN:
if (strcasecmp (value, "on") == 0)
*((int *)(ptr_data)) = BOOL_TRUE;
else if (strcasecmp (value, "off") == 0)
*((int *)(ptr_data)) = BOOL_FALSE;
else
return -2;
break;
case OPTION_TYPE_INT:
int_value = atoi (value);
if ((int_value < ptr_option->min) || (int_value > ptr_option->max))
return -2;
*((int *)(ptr_data)) = int_value;
break;
case OPTION_TYPE_INT_WITH_STRING:
int_value = get_pos_array_values (ptr_option->array_values, value);
if (int_value < 0)
return -2;
*((int *)(ptr_data)) = int_value;
break;
case OPTION_TYPE_COLOR:
if (!gui_assign_color ((int *)ptr_data, value))
return -2;
break;
case OPTION_TYPE_STRING:
if (*((char **)ptr_data))
free (*((char **)ptr_data));
*((char **)ptr_data) = strdup (value);
break;
}
return 0;
}
/*
* config_option_search: look for an option and return pointer to this option
* if option is not found, NULL is returned
@@ -773,10 +1058,12 @@ config_allocate_server (char *filename, int line_number)
return 0;
}
if (!server_new (cfg_server.name,
cfg_server.autoconnect, 0, cfg_server.address, cfg_server.port,
cfg_server.autoconnect, cfg_server.autoreconnect,
cfg_server.autoreconnect_delay, 0, cfg_server.address, cfg_server.port,
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
cfg_server.nick3, cfg_server.username, cfg_server.realname,
cfg_server.command, cfg_server.autojoin))
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
cfg_server.autorejoin))
{
server_free_all ();
gui_printf (NULL,
@@ -820,7 +1107,7 @@ config_default_values ()
if (int_value < 0)
gui_printf (NULL,
_("%s unable to assign default int with string (\"%s\")\n"),
weechat_options[i][j].default_string);
WEECHAT_WARNING, weechat_options[i][j].default_string);
else
*weechat_options[i][j].ptr_int =
int_value;
@@ -831,7 +1118,7 @@ config_default_values ()
weechat_options[i][j].default_string))
gui_printf (NULL,
_("%s unable to assign default color (\"%s\")\n"),
weechat_options[i][j].default_string);
WEECHAT_WARNING, weechat_options[i][j].default_string);
break;
case OPTION_TYPE_STRING:
*weechat_options[i][j].ptr_string =
@@ -933,96 +1220,105 @@ config_read ()
}
else
{
pos = strchr (line, '=');
if (pos == NULL)
if (section == CONFIG_SECTION_NONE)
{
gui_printf (NULL,
_("%s %s, line %d: invalid syntax, missing \"=\"\n"),
_("%s %s, line %d: invalid section for option, line is ignored\n"),
WEECHAT_WARNING, filename, line_number);
}
else
{
pos[0] = '\0';
pos++;
pos2 = strchr (pos, '\r');
if (pos2 != NULL)
pos2[0] = '\0';
pos2 = strchr (pos, '\n');
if (pos2 != NULL)
pos2[0] = '\0';
if (section == CONFIG_SECTION_ALIAS)
{
if (alias_new (line, pos))
index_command_new (pos);
}
pos = strchr (line, '=');
if (pos == NULL)
gui_printf (NULL,
_("%s %s, line %d: invalid syntax, missing \"=\"\n"),
WEECHAT_WARNING, filename, line_number);
else
{
option_number = -1;
for (i = 0;
weechat_options[section][i].option_name; i++)
pos[0] = '\0';
pos++;
pos2 = strchr (pos, '\r');
if (pos2 != NULL)
pos2[0] = '\0';
pos2 = strchr (pos, '\n');
if (pos2 != NULL)
pos2[0] = '\0';
if (section == CONFIG_SECTION_ALIAS)
{
if (strcmp
(weechat_options[section][i].option_name,
ptr_line) == 0)
{
option_number = i;
break;
}
if (alias_new (line, pos))
weelist_add (&index_commands, &last_index_command, line);
}
if (option_number < 0)
gui_printf (NULL,
_("%s %s, line %d: invalid option \"%s\"\n"),
WEECHAT_WARNING, filename, line_number, ptr_line);
else
{
if (config_option_set_value (&weechat_options[section][option_number], pos) < 0)
option_number = -1;
for (i = 0;
weechat_options[section][i].option_name; i++)
{
switch (weechat_options[section]
[option_number].option_type)
if (strcmp
(weechat_options[section][i].option_name,
ptr_line) == 0)
{
case OPTION_TYPE_BOOLEAN:
gui_printf (NULL,
_("%s %s, line %d: invalid value for"
"option '%s'\n"
"Expected: boolean value: "
"'off' or 'on'\n"),
WEECHAT_WARNING, filename,
line_number, ptr_line);
break;
case OPTION_TYPE_INT:
gui_printf (NULL,
_("%s %s, line %d: invalid value for "
"option '%s'\n"
"Expected: integer between %d "
"and %d\n"),
WEECHAT_WARNING, filename,
line_number, ptr_line,
weechat_options[section][option_number].min,
weechat_options[section][option_number].max);
break;
case OPTION_TYPE_INT_WITH_STRING:
gui_printf (NULL,
_("%s %s, line %d: invalid value for "
"option '%s'\n"
"Expected: one of these strings: "),
WEECHAT_WARNING, filename,
line_number, ptr_line);
i = 0;
while (weechat_options[section][option_number].array_values[i])
{
gui_printf (NULL, "\"%s\" ",
weechat_options[section][option_number].array_values[i]);
i++;
}
gui_printf (NULL, "\n");
break;
case OPTION_TYPE_COLOR:
gui_printf (NULL,
_("%s %s, line %d: invalid color "
"name for option '%s'\n"),
WEECHAT_WARNING, filename,
line_number,
ptr_line);
break;
option_number = i;
break;
}
}
if (option_number < 0)
gui_printf (NULL,
_("%s %s, line %d: invalid option \"%s\"\n"),
WEECHAT_WARNING, filename, line_number, ptr_line);
else
{
if (config_option_set_value (&weechat_options[section][option_number], pos) < 0)
{
switch (weechat_options[section]
[option_number].option_type)
{
case OPTION_TYPE_BOOLEAN:
gui_printf (NULL,
_("%s %s, line %d: invalid value for"
"option '%s'\n"
"Expected: boolean value: "
"'off' or 'on'\n"),
WEECHAT_WARNING, filename,
line_number, ptr_line);
break;
case OPTION_TYPE_INT:
gui_printf (NULL,
_("%s %s, line %d: invalid value for "
"option '%s'\n"
"Expected: integer between %d "
"and %d\n"),
WEECHAT_WARNING, filename,
line_number, ptr_line,
weechat_options[section][option_number].min,
weechat_options[section][option_number].max);
break;
case OPTION_TYPE_INT_WITH_STRING:
gui_printf (NULL,
_("%s %s, line %d: invalid value for "
"option '%s'\n"
"Expected: one of these strings: "),
WEECHAT_WARNING, filename,
line_number, ptr_line);
i = 0;
while (weechat_options[section][option_number].array_values[i])
{
gui_printf (NULL, "\"%s\" ",
weechat_options[section][option_number].array_values[i]);
i++;
}
gui_printf (NULL, "\n");
break;
case OPTION_TYPE_COLOR:
gui_printf (NULL,
_("%s %s, line %d: invalid color "
"name for option '%s'\n"),
WEECHAT_WARNING, filename,
line_number,
ptr_line);
break;
}
}
}
}
@@ -1096,8 +1392,7 @@ config_create_default ()
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if ((i == CONFIG_SECTION_HISTORY) || (i == CONFIG_SECTION_LOG) ||
(i == CONFIG_SECTION_DCC) || (i == CONFIG_SECTION_PROXY))
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
@@ -1137,6 +1432,7 @@ config_create_default ()
fprintf (file, "SIGNOFF=quit\n");
fprintf (file, "C=clear\n");
fprintf (file, "CL=clear\n");
fprintf (file, "CLOSE=buffer close\n");
fprintf (file, "# CHAT=dcc chat\n");
fprintf (file, "# GET=dcc get\n");
fprintf (file, "# IG=ignore\n");
@@ -1161,6 +1457,8 @@ config_create_default ()
fprintf (file, "\n[server]\n");
fprintf (file, "server_name=freenode\n");
fprintf (file, "server_autoconnect=on\n");
fprintf (file, "server_autoreconnect=on\n");
fprintf (file, "server_autoreconnect_delay=30\n");
fprintf (file, "server_address=irc.freenode.net\n");
fprintf (file, "server_port=6667\n");
fprintf (file, "server_password=\n");
@@ -1205,9 +1503,12 @@ config_create_default ()
}
fprintf (file, "server_command=\n");
fprintf (file, "server_command_delay=0\n");
fprintf (file, "server_autojoin=\n");
fprintf (file, "server_autorejoin=on\n");
fclose (file);
chmod (filename, 0600);
free (filename);
return 0;
}
@@ -1263,8 +1564,7 @@ config_write (char *config_name)
if ((i != CONFIG_SECTION_ALIAS) && (i != CONFIG_SECTION_SERVER))
{
fprintf (file, "\n[%s]\n", config_sections[i].section_name);
if ((i == CONFIG_SECTION_LOG) || (i == CONFIG_SECTION_DCC) ||
(i == CONFIG_SECTION_PROXY))
if (i == CONFIG_SECTION_PROXY)
fprintf (file,
"# WARNING!!! Options for section \"%s\" are not developed!\n",
config_sections[i].section_name);
@@ -1331,6 +1631,10 @@ config_write (char *config_name)
fprintf (file, "server_name=%s\n", ptr_server->name);
fprintf (file, "server_autoconnect=%s\n",
(ptr_server->autoconnect) ? "on" : "off");
fprintf (file, "server_autoreconnect=%s\n",
(ptr_server->autoreconnect) ? "on" : "off");
fprintf (file, "server_autoreconnect_delay=%d\n",
ptr_server->autoreconnect_delay);
fprintf (file, "server_address=%s\n", ptr_server->address);
fprintf (file, "server_port=%d\n", ptr_server->port);
fprintf (file, "server_password=%s\n",
@@ -1342,12 +1646,16 @@ config_write (char *config_name)
fprintf (file, "server_realname=%s\n", ptr_server->realname);
fprintf (file, "server_command=%s\n",
(ptr_server->command) ? ptr_server->command : "");
fprintf (file, "server_command_delay=%d\n", ptr_server->command_delay);
fprintf (file, "server_autojoin=%s\n",
(ptr_server->autojoin) ? ptr_server->autojoin : "");
fprintf (file, "server_autorejoin=%s\n",
(ptr_server->autorejoin) ? "on" : "off");
}
}
fclose (file);
chmod (filename, 0600);
free (filename);
return 0;
}
+42 -11
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -21,6 +21,8 @@
#ifndef __WEECHAT_CONFIG_H
#define __WEECHAT_CONFIG_H 1
#include "../irc/irc.h"
#define WEECHAT_CONFIG_NAME "weechat.rc"
#define CONFIG_SECTION_NONE -1
@@ -28,11 +30,12 @@
#define CONFIG_SECTION_COLORS 1
#define CONFIG_SECTION_HISTORY 2
#define CONFIG_SECTION_LOG 3
#define CONFIG_SECTION_DCC 4
#define CONFIG_SECTION_PROXY 5
#define CONFIG_SECTION_ALIAS 6
#define CONFIG_SECTION_SERVER 7
#define CONFIG_NUMBER_SECTIONS 8
#define CONFIG_SECTION_IRC 4
#define CONFIG_SECTION_DCC 5
#define CONFIG_SECTION_PROXY 6
#define CONFIG_SECTION_ALIAS 7
#define CONFIG_SECTION_SERVER 8
#define CONFIG_NUMBER_SECTIONS 9
#define OPTION_TYPE_BOOLEAN 1 /* values: on/off */
#define OPTION_TYPE_INT 2 /* values: from min to max */
@@ -77,6 +80,9 @@ extern int cfg_look_set_title;
extern int cfg_look_startup_logo;
extern int cfg_look_startup_version;
extern char *cfg_look_weechat_slogan;
extern char *cfg_look_charset_decode;
extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern int cfg_look_color_nicks;
extern int cfg_look_color_actions;
extern int cfg_look_remove_colors_from_msgs;
@@ -120,6 +126,9 @@ extern int cfg_col_input_channel;
extern int cfg_col_input_nick;
extern int cfg_col_input_bg;
extern int cfg_col_nick;
extern int cfg_col_nick_away;
extern int cfg_col_nick_chanowner;
extern int cfg_col_nick_chanadmin;
extern int cfg_col_nick_op;
extern int cfg_col_nick_halfop;
extern int cfg_col_nick_voice;
@@ -127,24 +136,42 @@ 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 int cfg_log_plugin_msg;
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_irc_display_away;
extern char *cfg_irc_default_msg_away;
extern char *cfg_irc_default_msg_part;
extern char *cfg_irc_default_msg_quit;
extern int cfg_irc_away_check;
extern int cfg_irc_lag_check;
extern int cfg_irc_lag_min_show;
extern int cfg_irc_lag_disconnect;
extern int cfg_irc_fifo_pipe;
extern 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_convert_spaces;
extern int cfg_dcc_auto_rename;
extern int cfg_dcc_auto_resume;
@@ -162,9 +189,13 @@ extern void config_change_title ();
extern void config_change_buffers ();
extern void config_change_buffer_content ();
extern void config_change_color ();
extern void config_change_away_check ();
extern void config_change_fifo_pipe ();
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 void *config_get_server_option_ptr (t_irc_server *, char *);
extern int config_set_server_value (t_irc_server *, char *, char *);
extern int config_read ();
extern int config_create_default ();
extern int config_write ();
+162
View File
@@ -0,0 +1,162 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* weelist.c: sorted lists management */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "weechat.h"
#include "weelist.h"
/*
* weelist_search: search date in a list
*/
t_weelist *
weelist_search (t_weelist *weelist, char *data)
{
t_weelist *ptr_weelist;
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
{
if (strcasecmp (data, ptr_weelist->data) == 0)
return ptr_weelist;
}
/* word not found in list */
return NULL;
}
/*
* weelist_find_pos: find position for data (keeping list sorted)
*/
t_weelist *
weelist_find_pos (t_weelist *weelist, char *data)
{
t_weelist *ptr_weelist;
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
{
if (strcasecmp (data, ptr_weelist->data) < 0)
return ptr_weelist;
}
/* position not found, best position is at the end */
return NULL;
}
/*
* weelist_insert: insert an element to the list (at good position)
*/
void
weelist_insert (t_weelist **weelist, t_weelist **last_weelist, t_weelist *element)
{
t_weelist *pos_weelist;
pos_weelist = weelist_find_pos (*weelist, element->data);
if (*weelist)
{
if (pos_weelist)
{
/* insert data into the list (before position found) */
element->prev_weelist = pos_weelist->prev_weelist;
element->next_weelist = pos_weelist;
if (pos_weelist->prev_weelist)
pos_weelist->prev_weelist->next_weelist = element;
else
*weelist = element;
pos_weelist->prev_weelist = element;
}
else
{
/* add data to the end */
element->prev_weelist = *last_weelist;
element->next_weelist = NULL;
(*last_weelist)->next_weelist = element;
*last_weelist = element;
}
}
else
{
element->prev_weelist = NULL;
element->next_weelist = NULL;
*weelist = element;
*last_weelist = element;
}
}
/*
* weelist_add: create new data and add it to list
*/
t_weelist *
weelist_add (t_weelist **weelist, t_weelist **last_weelist, char *data)
{
t_weelist *new_weelist;
if (!data || (!data[0]))
return NULL;
if ((new_weelist = ((t_weelist *) malloc (sizeof (t_weelist)))))
{
new_weelist->data = strdup (data);
weelist_insert (weelist, last_weelist, new_weelist);
return new_weelist;
}
/* failed to allocate new element */
return NULL;
}
/*
* weelist_remove: free an element in a list
*/
void
weelist_remove (t_weelist **weelist, t_weelist **last_weelist, t_weelist *element)
{
t_weelist *new_weelist;
/* remove element from list */
if (*last_weelist == element)
*last_weelist = element->prev_weelist;
if (element->prev_weelist)
{
(element->prev_weelist)->next_weelist = element->next_weelist;
new_weelist = *weelist;
}
else
new_weelist = element->next_weelist;
if (element->next_weelist)
(element->next_weelist)->prev_weelist = element->prev_weelist;
/* free data */
if (element->data)
free (element->data);
free (element);
*weelist = new_weelist;
}
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WEECHAT_LIST_H
#define __WEECHAT_LIST_H 1
typedef struct t_weelist t_weelist;
struct t_weelist
{
char *data;
t_weelist *prev_weelist;
t_weelist *next_weelist;
};
t_weelist *weelist_search (t_weelist *, char *);
t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
#endif /* weelist.h */
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
if GUI_CURSES
if GUI_NCURSES
curses_dir=curses
endif
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ bin_PROGRAMS = weechat-curses
weechat_curses_LDADD = ../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(CURSES_LIBS) \
$(NCURSES_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
weechat_curses_SOURCES = ../gui.h \
+1169 -440
View File
File diff suppressed because it is too large Load Diff
+523 -187
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -31,13 +31,14 @@
#include <signal.h>
#include <time.h>
#include <sys/socket.h>
#include <curses.h>
#include <ncurses.h>
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/weeconfig.h"
#include "../../common/command.h"
#include "../../common/hotlist.h"
#include "../../common/fifo.h"
#include "../../irc/irc.h"
#define KEY_ESCAPE 27
@@ -51,7 +52,10 @@ gui_read_keyb ()
{
int key, i;
t_gui_buffer *ptr_buffer;
char new_char[2];
t_irc_server *ptr_server;
t_irc_dcc *ptr_dcc;
char new_char[3], *decoded_string;
t_irc_dcc *dcc_selected;
key = getch ();
if (key != ERR)
@@ -60,27 +64,29 @@ gui_read_keyb ()
{
/* resize event */
case KEY_RESIZE:
gui_calculate_pos_size (gui_current_window);
gui_redraw_buffer (gui_current_window->buffer);
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):
case KEY_F(5):
gui_switch_to_previous_buffer (gui_current_window);
break;
/* next buffer in window */
case KEY_F(7):
case KEY_F(6):
gui_switch_to_next_buffer (gui_current_window);
break;
/* previous window */
case KEY_F(7):
gui_switch_to_previous_window (gui_current_window);
break;
/* next window */
case KEY_F(8):
gui_switch_to_next_window (gui_current_window);
@@ -88,211 +94,310 @@ gui_read_keyb ()
/* remove last infobar message */
case KEY_F(10):
gui_infobar_remove ();
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
break;
/* cursor up */
case KEY_UP:
if (gui_current_window->buffer->ptr_history)
if (gui_current_window->buffer->dcc)
{
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;
if (dcc_list)
{
if (gui_current_window->dcc_selected
&& ((t_irc_dcc *)(gui_current_window->dcc_selected))->prev_dcc)
{
if (gui_current_window->dcc_selected ==
gui_current_window->dcc_first)
gui_current_window->dcc_first =
((t_irc_dcc *)(gui_current_window->dcc_first))->prev_dcc;
gui_current_window->dcc_selected =
((t_irc_dcc *)(gui_current_window->dcc_selected))->prev_dcc;
gui_draw_buffer_chat (gui_current_window->buffer, 1);
gui_draw_buffer_input (gui_current_window->buffer, 1);
}
}
}
else
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);
if (gui_current_window->buffer->ptr_history)
{
gui_current_window->buffer->ptr_history =
gui_current_window->buffer->ptr_history->next_history;
if (!gui_current_window->buffer->ptr_history)
gui_current_window->buffer->ptr_history =
gui_current_window->buffer->history;
}
else
gui_current_window->buffer->ptr_history =
gui_current_window->buffer->history;
if (gui_current_window->buffer->ptr_history)
{
gui_current_window->buffer->input_buffer_size =
strlen (gui_current_window->buffer->ptr_history->text);
gui_optimize_input_buffer_size (gui_current_window->buffer);
gui_current_window->buffer->input_buffer_pos =
gui_current_window->buffer->input_buffer_size;
strcpy (gui_current_window->buffer->input_buffer,
gui_current_window->buffer->ptr_history->text);
gui_draw_buffer_input (gui_current_window->buffer, 0);
}
}
break;
/* cursor down */
case KEY_DOWN:
if (gui_current_window->buffer->ptr_history)
if (gui_current_window->buffer->dcc)
{
if (dcc_list)
{
if (!gui_current_window->dcc_selected
|| ((t_irc_dcc *)(gui_current_window->dcc_selected))->next_dcc)
{
if (gui_current_window->dcc_last_displayed
&& (gui_current_window->dcc_selected ==
gui_current_window->dcc_last_displayed))
{
if (gui_current_window->dcc_first)
gui_current_window->dcc_first =
((t_irc_dcc *)(gui_current_window->dcc_first))->next_dcc;
else
gui_current_window->dcc_first =
dcc_list->next_dcc;
}
if (gui_current_window->dcc_selected)
gui_current_window->dcc_selected =
((t_irc_dcc *)(gui_current_window->dcc_selected))->next_dcc;
else
gui_current_window->dcc_selected =
dcc_list->next_dcc;
gui_draw_buffer_chat (gui_current_window->buffer, 1);
gui_draw_buffer_input (gui_current_window->buffer, 1);
}
}
}
else
{
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);
{
gui_current_window->buffer->ptr_history =
gui_current_window->buffer->ptr_history->prev_history;
if (gui_current_window->buffer->ptr_history)
gui_current_window->buffer->input_buffer_size =
strlen (gui_current_window->buffer->ptr_history->text);
else
gui_current_window->buffer->input_buffer_size = 0;
gui_optimize_input_buffer_size (gui_current_window->buffer);
gui_current_window->buffer->input_buffer_pos =
gui_current_window->buffer->input_buffer_size;
if (gui_current_window->buffer->ptr_history)
strcpy (gui_current_window->buffer->input_buffer,
gui_current_window->buffer->ptr_history->text);
gui_draw_buffer_input (gui_current_window->buffer, 0);
}
}
break;
/* cursor left */
case KEY_LEFT:
if (gui_current_window->buffer->input_buffer_pos > 0)
if (!gui_current_window->buffer->dcc)
{
gui_current_window->buffer->input_buffer_pos--;
gui_draw_buffer_input (gui_current_window->buffer, 0);
if (gui_current_window->buffer->input_buffer_pos > 0)
{
gui_current_window->buffer->input_buffer_pos--;
gui_draw_buffer_input (gui_current_window->buffer, 0);
}
}
break;
/* cursor right */
case KEY_RIGHT:
if (gui_current_window->buffer->input_buffer_pos <
gui_current_window->buffer->input_buffer_size)
if (!gui_current_window->buffer->dcc)
{
gui_current_window->buffer->input_buffer_pos++;
gui_draw_buffer_input (gui_current_window->buffer, 0);
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 */
/* home key or Control + A */
case KEY_HOME:
if (gui_current_window->buffer->input_buffer_pos > 0)
case 0x01:
if (!gui_current_window->buffer->dcc)
{
gui_current_window->buffer->input_buffer_pos = 0;
gui_draw_buffer_input (gui_current_window->buffer, 0);
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 */
/* end key or Control + E */
case KEY_END:
if (gui_current_window->buffer->input_buffer_pos <
gui_current_window->buffer->input_buffer_size)
case 0x05:
if (!gui_current_window->buffer->dcc)
{
gui_current_window->buffer->input_buffer_pos =
gui_current_window->buffer->input_buffer_size;
gui_draw_buffer_input (gui_current_window->buffer, 0);
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 (gui_current_window);
if (!gui_current_window->buffer->dcc)
gui_move_page_up (gui_current_window);
break;
/* page down */
case KEY_NPAGE:
gui_move_page_down (gui_current_window);
if (!gui_current_window->buffer->dcc)
gui_move_page_down (gui_current_window);
break;
/* erase before cursor and move cursor to the left */
case 127:
case KEY_BACKSPACE:
if (gui_current_window->buffer->input_buffer_pos > 0)
if (!gui_current_window->buffer->dcc)
{
i = gui_current_window->buffer->input_buffer_pos-1;
while (gui_current_window->buffer->input_buffer[i])
if (gui_current_window->buffer->input_buffer_pos > 0)
{
gui_current_window->buffer->input_buffer[i] =
gui_current_window->buffer->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->buffer->input_buffer_size--;
gui_current_window->buffer->input_buffer_pos--;
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
gui_draw_buffer_input (gui_current_window->buffer, 0);
gui_optimize_input_buffer_size (gui_current_window->buffer);
gui_current_window->buffer->completion.position = -1;
}
break;
/* Control + Backspace */
/* Control + Backspace or Control + W */
case 0x08:
gui_delete_previous_word (gui_current_window->buffer);
case 0x17:
if (!gui_current_window->buffer->dcc)
gui_delete_previous_word (gui_current_window->buffer);
break;
/* Control + L */
case 0x0C:
gui_curses_resize_handler ();
break;
/* erase char under cursor */
case KEY_DC:
if (gui_current_window->buffer->input_buffer_pos <
gui_current_window->buffer->input_buffer_size)
if (!gui_current_window->buffer->dcc)
{
i = gui_current_window->buffer->input_buffer_pos;
while (gui_current_window->buffer->input_buffer[i])
if (gui_current_window->buffer->input_buffer_pos <
gui_current_window->buffer->input_buffer_size)
{
gui_current_window->buffer->input_buffer[i] =
gui_current_window->buffer->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->buffer->input_buffer_size--;
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
gui_draw_buffer_input (gui_current_window->buffer, 0);
gui_optimize_input_buffer_size (gui_current_window->buffer);
gui_current_window->buffer->completion.position = -1;
}
break;
/* Tab : completion */
case '\t':
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)
if (!gui_current_window->buffer->dcc)
{
// 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';
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.diff_size > 0)
if (gui_current_window->buffer->completion.word_found)
{
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)
/* replace word with new completed word into input buffer */
if (gui_current_window->buffer->completion.diff_size > 0)
{
gui_current_window->buffer->input_buffer_size +=
gui_current_window->buffer->completion.diff_size;
gui_optimize_input_buffer_size (gui_current_window->buffer);
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
for (i = gui_current_window->buffer->input_buffer_size - 1;
i >= gui_current_window->buffer->completion.position_replace +
(int)strlen (gui_current_window->buffer->completion.word_found); i--)
gui_current_window->buffer->input_buffer[i] =
gui_current_window->buffer->input_buffer[i -
gui_current_window->buffer->completion.diff_size];
}
else
{
for (i = gui_current_window->buffer->completion.position_replace +
strlen (gui_current_window->buffer->completion.word_found);
i < gui_current_window->buffer->input_buffer_size; i++)
gui_current_window->buffer->input_buffer[i] =
gui_current_window->buffer->input_buffer[i -
gui_current_window->buffer->completion.diff_size];
gui_current_window->buffer->input_buffer_size +=
gui_current_window->buffer->completion.diff_size;
gui_optimize_input_buffer_size (gui_current_window->buffer);
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
}
strncpy (gui_current_window->buffer->input_buffer + gui_current_window->buffer->completion.position_replace,
gui_current_window->buffer->completion.word_found,
strlen (gui_current_window->buffer->completion.word_found));
gui_current_window->buffer->input_buffer_pos =
gui_current_window->buffer->completion.position_replace +
strlen (gui_current_window->buffer->completion.word_found);
/* position is < 0 this means only one word was found to complete,
so reinit to stop completion */
if (gui_current_window->buffer->completion.position >= 0)
gui_current_window->buffer->completion.position =
gui_current_window->buffer->input_buffer_pos;
/* add space or completor to the end of completion, if needed */
if ((gui_current_window->buffer->completion.context == COMPLETION_COMMAND)
|| (gui_current_window->buffer->completion.context == COMPLETION_COMMAND_ARG))
{
if (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++;
if (gui_current_window->buffer->completion.position >= 0)
gui_current_window->buffer->completion.position++;
gui_current_window->buffer->input_buffer_pos++;
}
else
{
/* add nick completor if position 0 and completing nick */
if ((gui_current_window->buffer->completion.base_word_pos == 0)
&& (gui_current_window->buffer->completion.context == COMPLETION_NICK))
{
if (strncmp (gui_current_window->buffer->input_buffer + gui_current_window->buffer->input_buffer_pos,
cfg_look_completor, strlen (cfg_look_completor)) != 0)
gui_buffer_insert_string (gui_current_window->buffer,
cfg_look_completor,
gui_current_window->buffer->input_buffer_pos);
if (gui_current_window->buffer->completion.position >= 0)
gui_current_window->buffer->completion.position += strlen (cfg_look_completor);
gui_current_window->buffer->input_buffer_pos += strlen (cfg_look_completor);
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
gui_buffer_insert_string (gui_current_window->buffer,
" ",
gui_current_window->buffer->input_buffer_pos);
if (gui_current_window->buffer->completion.position >= 0)
gui_current_window->buffer->completion.position++;
gui_current_window->buffer->input_buffer_pos++;
}
}
gui_draw_buffer_input (gui_current_window->buffer, 0);
}
gui_draw_buffer_input (gui_current_window->buffer, 0);
}
break;
/* escape code (for control-key) */
@@ -300,12 +405,14 @@ gui_read_keyb ()
if ((key = getch()) != ERR)
{
/*gui_printf (gui_current_window->buffer,
"[Debug] key pressed = %d, as octal: %o\n", key, key);*/
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
switch (key)
{
/* Alt + left arrow */
case KEY_LEFT:
gui_switch_to_previous_buffer (gui_current_window);
break;
/* Alt + right arrow */
case KEY_RIGHT:
gui_switch_to_next_buffer (gui_current_window);
break;
@@ -319,17 +426,19 @@ gui_read_keyb ()
{
/* Control + Right */
case 99:
gui_move_next_word (gui_current_window->buffer);
if (!gui_current_window->buffer->dcc)
gui_move_next_word (gui_current_window->buffer);
break;
/* Control + Left */
case 100:
gui_move_previous_word (gui_current_window->buffer);
if (!gui_current_window->buffer->dcc)
gui_move_previous_word (gui_current_window->buffer);
break;
}
}
}
break;
/* Alt-number */
/* Alt-number: jump to window by number */
case 48: /* Alt-0 */
case 49: /* Alt-1 */
case 50: /* Alt-2 */
@@ -342,7 +451,7 @@ gui_read_keyb ()
case 57: /* Alt-9 */
gui_switch_to_buffer_by_number (gui_current_window, (key == 48) ? 10 : key - 48);
break;
/* Alt-A */
/* Alt-A: jump to buffer with activity */
case 'a':
case 'A':
if (hotlist)
@@ -362,41 +471,191 @@ gui_read_keyb ()
}
}
break;
/* Alt-D: jump to DCC buffer */
case 'd':
case 'D':
if (gui_current_window->buffer->dcc)
{
if (buffer_before_dcc)
{
gui_switch_to_buffer (gui_current_window,
buffer_before_dcc);
gui_redraw_buffer (gui_current_window->buffer);
}
}
else
{
buffer_before_dcc = gui_current_window->buffer;
gui_switch_to_dcc_buffer ();
}
break;
/* Alt-R: clear hotlist */
case 'r':
case 'R':
if (hotlist)
{
hotlist_free_all ();
gui_redraw_buffer (gui_current_window->buffer);
}
hotlist_initial_buffer = gui_current_window->buffer;
break;
/* Alt-S: jump to server buffer */
case 's':
case 'S':
if (SERVER(gui_current_window->buffer)->buffer !=
gui_current_window->buffer)
{
gui_switch_to_buffer (gui_current_window,
SERVER(gui_current_window->buffer)->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
break;
/* Alt-X: jump to first channel/private of next server */
case 'x':
case 'X':
ptr_server = SERVER(gui_current_window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
while (ptr_server != SERVER(gui_current_window->buffer))
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
if (ptr_server != SERVER(gui_current_window->buffer))
{
ptr_buffer = (ptr_server->channels) ?
ptr_server->channels->buffer : ptr_server->buffer;
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
break;
}
}
break;
/* send command/message */
case '\n':
if (gui_current_window->buffer->input_buffer_size > 0)
if (!gui_current_window->buffer->dcc)
{
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';
if (gui_current_window->buffer->input_buffer_size > 0)
{
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
history_add (gui_current_window->buffer, gui_current_window->buffer->input_buffer);
gui_current_window->buffer->input_buffer_size = 0;
gui_current_window->buffer->input_buffer_pos = 0;
gui_current_window->buffer->input_buffer_1st_display = 0;
gui_current_window->buffer->completion.position = -1;
gui_current_window->buffer->ptr_history = NULL;
ptr_buffer = gui_current_window->buffer;
user_command (SERVER(gui_current_window->buffer),
gui_current_window->buffer,
gui_current_window->buffer->input_buffer);
if (ptr_buffer == gui_current_window->buffer)
{
ptr_buffer->input_buffer[0] = '\0';
gui_draw_buffer_input (ptr_buffer, 0);
}
}
}
break;
/* other key => add to input buffer */
default:
/*gui_printf (gui_current_window->buffer,
"[Debug] key pressed = %d, as octal: %o\n", 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;
if (gui_current_window->buffer->dcc)
{
dcc_selected = (gui_current_window->dcc_selected) ?
(t_irc_dcc *) gui_current_window->dcc_selected : dcc_list;
switch (key)
{
/* accept DCC */
case 'a':
case 'A':
if (dcc_selected
&& (DCC_IS_RECV(dcc_selected->status))
&& (dcc_selected->status == DCC_WAITING))
{
dcc_accept (dcc_selected);
}
break;
/* cancel DCC */
case 'c':
case 'C':
if (dcc_selected
&& (!DCC_ENDED(dcc_selected->status)))
{
dcc_close (dcc_selected, DCC_ABORTED);
gui_redraw_buffer (gui_current_window->buffer);
}
break;
/* purge old DCC */
case 'p':
case 'P':
gui_current_window->dcc_selected = NULL;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if (DCC_ENDED(ptr_dcc->status))
dcc_free (ptr_dcc);
}
gui_redraw_buffer (gui_current_window->buffer);
break;
/* close DCC window */
case 'q':
case 'Q':
if (buffer_before_dcc)
{
gui_buffer_free (gui_current_window->buffer, 1);
gui_switch_to_buffer (gui_current_window,
buffer_before_dcc);
}
else
gui_buffer_free (gui_current_window->buffer, 1);
gui_redraw_buffer (gui_current_window->buffer);
break;
/* remove from DCC list */
case 'r':
case 'R':
if (dcc_selected
&& (DCC_ENDED(dcc_selected->status)))
{
if (dcc_selected->next_dcc)
gui_current_window->dcc_selected = dcc_selected->next_dcc;
else
gui_current_window->dcc_selected = NULL;
dcc_free (dcc_selected);
gui_redraw_buffer (gui_current_window->buffer);
}
break;
}
}
else
{
/*gui_printf (gui_current_window->buffer,
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
new_char[0] = key;
new_char[1] = '\0';
decoded_string = NULL;
/* UTF-8 input */
if (key == 0xC3)
{
if ((key = getch()) != ERR)
{
new_char[1] = key;
new_char[2] = '\0';
decoded_string = weechat_convert_encoding (local_charset, cfg_look_charset_internal, new_char);
}
}
gui_buffer_insert_string (gui_current_window->buffer,
(decoded_string) ? decoded_string : new_char,
gui_current_window->buffer->input_buffer_pos);
gui_current_window->buffer->input_buffer_pos++;
gui_draw_buffer_input (gui_current_window->buffer, 0);
gui_current_window->buffer->completion.position = -1;
if (decoded_string)
free (decoded_string);
}
break;
}
}
@@ -410,15 +669,17 @@ void
gui_main_loop ()
{
fd_set read_fd;
static struct timeval timeout;
static struct timeval timeout, tv;
static struct timezone tz;
t_irc_server *ptr_server;
int old_min, old_sec;
int old_min, old_sec, diff;
time_t new_time;
struct tm *local_time;
quit_weechat = 0;
old_min = -1;
old_sec = -1;
check_away = 0;
while (!quit_weechat)
{
new_time = time (NULL);
@@ -431,44 +692,119 @@ gui_main_loop ()
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
/* second has changed ? => count down time for infobar, if needed */
/* second has changed ? */
if (local_time->tm_sec != old_sec)
{
old_sec = local_time->tm_sec;
/* infobar count down */
if (gui_infobar && gui_infobar->remaining_time > 0)
{
gui_infobar->remaining_time--;
if (gui_infobar->remaining_time == 0)
{
gui_infobar_remove ();
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
}
/* away check */
if (cfg_irc_away_check != 0)
{
check_away++;
if (check_away >= (cfg_irc_away_check * 60))
{
check_away = 0;
server_check_away ();
}
}
}
FD_ZERO (&read_fd);
FD_SET (STDIN_FILENO, &read_fd);
if (weechat_fifo != -1)
FD_SET (weechat_fifo, &read_fd);
timeout.tv_sec = 0;
timeout.tv_usec = 10000;
FD_ZERO (&read_fd);
FD_SET (STDIN_FILENO, &read_fd);
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (ptr_server->sock4 >= 0)
FD_SET (ptr_server->sock4, &read_fd);
/* check if reconnection is pending */
if ((!ptr_server->is_connected)
&& (ptr_server->reconnect_start > 0)
&& (new_time >= (ptr_server->reconnect_start + ptr_server->autoreconnect_delay)))
server_reconnect (ptr_server);
else
{
if (ptr_server->is_connected)
{
/* check for lag */
if ((ptr_server->lag_check_time.tv_sec == 0)
&& (new_time >= ptr_server->lag_next_check))
{
server_sendf (ptr_server, "PING %s\r\n", ptr_server->address);
gettimeofday (&(ptr_server->lag_check_time), &tz);
}
/* lag timeout => disconnect */
if ((ptr_server->lag_check_time.tv_sec != 0)
&& (cfg_irc_lag_disconnect > 0))
{
gettimeofday (&tv, &tz);
diff = (int) get_timeval_diff (&(ptr_server->lag_check_time), &tv);
if (diff / 1000 > cfg_irc_lag_disconnect * 60)
{
irc_display_prefix (ptr_server->buffer, PREFIX_ERROR);
gui_printf (ptr_server->buffer,
_("%s lag is high, disconnecting from server...\n"),
WEECHAT_WARNING);
server_disconnect (ptr_server, 1);
continue;
}
}
}
if (!ptr_server->is_connected && (ptr_server->child_pid > 0))
FD_SET (ptr_server->child_read, &read_fd);
else
{
if (ptr_server->sock >= 0)
FD_SET (ptr_server->sock, &read_fd);
}
}
}
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout))
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) > 0)
{
if (FD_ISSET (STDIN_FILENO, &read_fd))
{
gui_read_keyb ();
}
else
if ((weechat_fifo != -1) && (FD_ISSET (weechat_fifo, &read_fd)))
{
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
fifo_read ();
}
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (!ptr_server->is_connected && (ptr_server->child_pid > 0))
{
if ((ptr_server->sock4 >= 0) &&
(FD_ISSET (ptr_server->sock4, &read_fd)))
if (FD_ISSET (ptr_server->child_read, &read_fd))
server_child_read (ptr_server);
}
else
{
if ((ptr_server->sock >= 0) &&
(FD_ISSET (ptr_server->sock, &read_fd)))
server_recv (ptr_server);
}
}
}
/* manages active DCC */
dcc_handle ();
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
+287 -23
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -34,12 +34,15 @@
#include "../common/weechat.h"
#include "gui.h"
#include "../../common/weeconfig.h"
#include "../../common/hotlist.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 */
@@ -47,6 +50,7 @@ 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 */
@@ -96,6 +100,10 @@ gui_window_new (int x, int y, int width, int height)
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;
@@ -121,26 +129,27 @@ gui_window_new (int x, int y, int width, int height)
*/
t_gui_buffer *
gui_buffer_new (t_gui_window *window, void *server, void *channel, int switch_to_buffer)
gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
int switch_to_buffer)
{
t_gui_buffer *new_buffer;
#ifdef DEBUG
wee_log_printf ("creating new buffer\n");
#endif
if (gui_buffers)
/* use first buffer if no server was assigned to this buffer */
if (!dcc && gui_buffers && (!SERVER(gui_buffers)))
{
/* use first buffer if no server was assigned to this buffer */
if (!SERVER(gui_buffers))
{
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;
return gui_buffers;
}
if (server)
((t_irc_server *)(server))->buffer = gui_buffers;
if (channel)
((t_irc_channel *)(channel))->buffer = gui_buffers;
gui_buffers->server = server;
gui_buffers->channel = channel;
if (cfg_log_auto_server)
log_start (gui_buffers);
return gui_buffers;
}
if ((new_buffer = (t_gui_buffer *)(malloc (sizeof (t_gui_buffer)))))
@@ -149,8 +158,9 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int switch_to
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->server = server;
new_buffer->channel = channel;
new_buffer->dcc = dcc;
/* assign buffer to server and channel */
if (server && !channel)
SERVER(new_buffer)->buffer = new_buffer;
@@ -172,6 +182,17 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int switch_to
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);
@@ -278,17 +299,22 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
static char buffer[1024];
va_list argptr;
t_gui_infobar *ptr_infobar;
char *pos;
char *pos, *buf2;
va_start (argptr, message);
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
va_end (argptr);
buf2 = weechat_convert_encoding (cfg_look_charset_decode,
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
buffer);
ptr_infobar = (t_gui_infobar *)malloc (sizeof (t_gui_infobar));
if (ptr_infobar)
{
ptr_infobar->color = color;
ptr_infobar->text = strdup (buffer);
ptr_infobar->text = strdup (buf2);
pos = strchr (ptr_infobar->text, '\n');
if (pos)
pos[0] = '\0';
@@ -300,6 +326,31 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
else
wee_log_printf (_("%s not enough memory for infobar message\n"),
WEECHAT_ERROR);
free (buf2);
}
/*
* gui_window_free: delete a window
*/
void
gui_window_free (t_gui_window *window)
{
if (window->buffer && (window->buffer->num_displayed > 0))
window->buffer->num_displayed--;
/* 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);
}
/*
@@ -318,7 +369,6 @@ gui_infobar_remove ()
free (gui_infobar->text);
free (gui_infobar);
gui_infobar = new_infobar;
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
}
@@ -360,6 +410,9 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
if (hotlist_initial_buffer == buffer)
hotlist_initial_buffer = NULL;
if (buffer_before_dcc == buffer)
buffer_before_dcc = NULL;
if (switch_to_another)
{
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
@@ -383,11 +436,18 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
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));
history_buffer_free (buffer);
/* remove buffer from buffers list */
if (buffer->prev_buffer)
buffer->prev_buffer->next_buffer = buffer->next_buffer;
@@ -398,11 +458,17 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
if (last_gui_buffer == buffer)
last_gui_buffer = buffer->prev_buffer;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == buffer)
ptr_win->buffer = NULL;
}
free (buffer);
/* always at least one buffer */
if (!gui_buffers && create_new && switch_to_another)
(void) gui_buffer_new (gui_windows, NULL, NULL, 1);
(void) gui_buffer_new (gui_windows, NULL, NULL, 0, 1);
}
/*
@@ -418,6 +484,7 @@ gui_new_line (t_gui_buffer *buffer)
{
new_line->length = 0;
new_line->length_align = 0;
new_line->log_write = 1;
new_line->line_with_message = 0;
new_line->line_with_highlight = 0;
new_line->messages = NULL;
@@ -665,3 +732,200 @@ gui_switch_to_buffer_by_number (t_gui_window *window, int number)
/* 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);
}
/*
* gui_window_print_log: print window infos in log (usually for crash dump)
*/
void
gui_window_print_log (t_gui_window *window)
{
wee_log_printf ("[window (addr:0x%X)]\n", window);
wee_log_printf (" win_x . . . . . . . : %d\n", window->win_x);
wee_log_printf (" win_y . . . . . . . : %d\n", window->win_y);
wee_log_printf (" win_width . . . . . : %d\n", window->win_width);
wee_log_printf (" win_height. . . . . : %d\n", window->win_height);
wee_log_printf (" win_chat_x. . . . . : %d\n", window->win_chat_x);
wee_log_printf (" win_chat_y. . . . . : %d\n", window->win_chat_y);
wee_log_printf (" win_chat_width. . . : %d\n", window->win_chat_width);
wee_log_printf (" win_chat_height . . : %d\n", window->win_chat_height);
wee_log_printf (" win_chat_cursor_x . : %d\n", window->win_chat_cursor_x);
wee_log_printf (" win_chat_cursor_y . : %d\n", window->win_chat_cursor_y);
wee_log_printf (" win_nick_x. . . . . : %d\n", window->win_nick_x);
wee_log_printf (" win_nick_y. . . . . : %d\n", window->win_nick_y);
wee_log_printf (" win_nick_width. . . : %d\n", window->win_nick_width);
wee_log_printf (" win_nick_height . . : %d\n", window->win_nick_height);
wee_log_printf (" win_title . . . . . : 0x%X\n", window->win_title);
wee_log_printf (" win_chat. . . . . . : 0x%X\n", window->win_chat);
wee_log_printf (" win_nick. . . . . . : 0x%X\n", window->win_nick);
wee_log_printf (" win_status. . . . . : 0x%X\n", window->win_status);
wee_log_printf (" win_infobar . . . . : 0x%X\n", window->win_infobar);
wee_log_printf (" win_input . . . . . : 0x%X\n", window->win_input);
wee_log_printf (" win_separator . . . : 0x%X\n", window->win_separator);
wee_log_printf (" textview_chat . . . : 0x%X\n", window->textview_chat);
wee_log_printf (" textbuffer_chat . . : 0x%X\n", window->textbuffer_chat);
wee_log_printf (" texttag_chat. . . . : 0x%X\n", window->texttag_chat);
wee_log_printf (" textview_nicklist . : 0x%X\n", window->textview_nicklist);
wee_log_printf (" textbuffer_nicklist : 0x%X\n", window->textbuffer_nicklist);
wee_log_printf (" dcc_first . . . . . : 0x%X\n", window->dcc_first);
wee_log_printf (" dcc_selected. . . . : 0x%X\n", window->dcc_selected);
wee_log_printf (" dcc_last_displayed. : 0x%X\n", window->dcc_last_displayed);
wee_log_printf (" buffer. . . . . . . : 0x%X\n", window->buffer);
wee_log_printf (" first_line_displayed: %d\n", window->first_line_displayed);
wee_log_printf (" sub_lines . . . . . : %d\n", window->sub_lines);
wee_log_printf (" prev_window . . . . : 0x%X\n", window->prev_window);
wee_log_printf (" next_window . . . . : 0x%X\n", window->next_window);
}
/*
* gui_buffer_print_log: print buffer infos in log (usually for crash dump)
*/
void
gui_buffer_print_log (t_gui_buffer *buffer)
{
t_gui_line *ptr_line;
t_gui_message *ptr_message;
int num;
char buf[4096];
wee_log_printf ("[buffer (addr:0x%X)]\n", buffer);
wee_log_printf (" num_displayed. . . . : %d\n", buffer->num_displayed);
wee_log_printf (" number . . . . . . . : %d\n", buffer->number);
wee_log_printf (" server . . . . . . . : 0x%X\n", buffer->server);
wee_log_printf (" channel. . . . . . . : 0x%X\n", buffer->channel);
wee_log_printf (" dcc. . . . . . . . . : %d\n", buffer->dcc);
wee_log_printf (" lines. . . . . . . . : 0x%X\n", buffer->lines);
wee_log_printf (" last_line. . . . . . : 0x%X\n", buffer->last_line);
wee_log_printf (" num_lines. . . . . . : %d\n", buffer->num_lines);
wee_log_printf (" line_complete. . . . : %d\n", buffer->line_complete);
wee_log_printf (" notify_level . . . . : %d\n", buffer->notify_level);
wee_log_printf (" log_filename . . . . : '%s'\n", buffer->log_filename);
wee_log_printf (" log_file . . . . . . : 0x%X\n", buffer->log_file);
wee_log_printf (" input_buffer . . . . : '%s'\n", buffer->input_buffer);
wee_log_printf (" input_buffer_alloc . : %d\n", buffer->input_buffer_alloc);
wee_log_printf (" input_buffer_size. . : %d\n", buffer->input_buffer_size);
wee_log_printf (" input_buffer_pos . . : %d\n", buffer->input_buffer_pos);
wee_log_printf (" input_buffer_1st_disp: %d\n", buffer->input_buffer_1st_display);
wee_log_printf (" history. . . . . . . : 0x%X\n", buffer->history);
wee_log_printf (" last_history . . . . : 0x%X\n", buffer->last_history);
wee_log_printf (" ptr_history. . . . . : 0x%X\n", buffer->ptr_history);
wee_log_printf (" prev_buffer. . . . . : 0x%X\n", buffer->prev_buffer);
wee_log_printf (" next_buffer. . . . . : 0x%X\n", buffer->next_buffer);
wee_log_printf ("\n");
wee_log_printf (" => last 100 lines:\n");
num = 0;
ptr_line = buffer->last_line;
while (ptr_line && (num < 100))
{
num++;
ptr_line = ptr_line->prev_line;
}
if (!ptr_line)
ptr_line = buffer->lines;
else
ptr_line = ptr_line->next_line;
while (ptr_line)
{
buf[0] = '\0';
for (ptr_message = ptr_line->messages; ptr_message;
ptr_message = ptr_message->next_message)
{
if (strlen (buf) + strlen (ptr_message->message) + 1 >= sizeof (buf))
break;
strcat (buf, ptr_message->message);
}
num--;
wee_log_printf (" line N-%05d: %s\n", num, buf);
ptr_line = ptr_line->next_line;
}
}
+73 -21
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
#define INPUT_BUFFER_BLOCK_SIZE 256
#define NUM_COLORS 39
#define NUM_COLORS 49
#define COLOR_WIN_TITLE 1
#define COLOR_WIN_CHAT 2
#define COLOR_WIN_CHAT_TIME 3
@@ -50,15 +50,25 @@
#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_AWAY 24
#define COLOR_WIN_NICK_CHANOWNER 25
#define COLOR_WIN_NICK_CHANADMIN 26
#define COLOR_WIN_NICK_OP 27
#define COLOR_WIN_NICK_HALFOP 28
#define COLOR_WIN_NICK_VOICE 29
#define COLOR_WIN_NICK_SEP 30
#define COLOR_WIN_NICK_SELF 31
#define COLOR_WIN_NICK_PRIVATE 32
#define COLOR_WIN_NICK_FIRST 33
#define COLOR_WIN_NICK_LAST 42
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
#define COLOR_DCC_SELECTED 43
#define COLOR_DCC_WAITING 44
#define COLOR_DCC_CONNECTING 45
#define COLOR_DCC_ACTIVE 46
#define COLOR_DCC_DONE 47
#define COLOR_DCC_FAILED 48
#define COLOR_DCC_ABORTED 49
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
@@ -68,16 +78,24 @@
#define BUFFER_IS_PRIVATE(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_PRIVATE))
#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 MSG_TYPE_PREFIX 2
#define MSG_TYPE_NICK 4
#define MSG_TYPE_INFO 8
#define MSG_TYPE_MSG 16
#define MSG_TYPE_HIGHLIGHT 32
#define MSG_TYPE_NOLOG 64
#define gui_printf_color(buffer, color, fmt, argz...) \
gui_printf_color_type(buffer, MSG_TYPE_INFO, color, fmt, ##argz)
gui_printf_type_color(buffer, MSG_TYPE_INFO, color, fmt, ##argz)
#define gui_printf_type(buffer, type, fmt, argz...) \
gui_printf_type_color(buffer, type, -1, fmt, ##argz)
#define gui_printf(buffer, fmt, argz...) \
gui_printf_color_type(buffer, MSG_TYPE_INFO, -1, fmt, ##argz)
gui_printf_type_color(buffer, MSG_TYPE_INFO, -1, fmt, ##argz)
#define gui_printf_nolog(buffer, fmt, argz...) \
gui_printf_type_color(buffer, MSG_TYPE_INFO | MSG_TYPE_NOLOG, -1, fmt, ##argz)
typedef struct t_gui_message t_gui_message;
@@ -96,6 +114,7 @@ struct t_gui_line
{
int length; /* length of the line (in char) */
int length_align; /* alignment length (time or time/nick) */
int log_write; /* = 1 if line will be written to log */
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 */
@@ -135,6 +154,7 @@ struct t_gui_buffer
/* 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 */
@@ -142,6 +162,16 @@ struct t_gui_buffer
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 */
@@ -202,6 +232,11 @@ struct t_gui_window
/* windows for Qt GUI */
/* TODO: declare Qt 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 */
@@ -213,22 +248,24 @@ struct t_gui_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 (int, int, int, int);
extern t_gui_buffer *gui_buffer_new (t_gui_window *, void *, void *, 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_window_free (t_gui_window *);
extern void gui_infobar_remove ();
extern void gui_buffer_free (t_gui_buffer *, int);
extern t_gui_line *gui_new_line (t_gui_buffer *);
@@ -239,7 +276,12 @@ 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);
extern void gui_window_print_log (t_gui_window *);
extern void gui_buffer_print_log (t_gui_buffer *);
/* 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);
@@ -253,20 +295,30 @@ extern void gui_draw_buffer_infobar (t_gui_buffer *, int);
extern void gui_draw_buffer_input (t_gui_buffer *, int);
extern void gui_redraw_buffer (t_gui_buffer *);
extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *);
extern t_gui_buffer *gui_get_dcc_buffer ();
extern void gui_switch_to_dcc_buffer ();
extern void gui_switch_to_previous_buffer (t_gui_window *);
extern void gui_switch_to_next_buffer (t_gui_window *);
extern void gui_switch_to_previous_window (t_gui_window *);
extern void gui_switch_to_next_window (t_gui_window *);
extern void gui_move_page_up ();
extern void gui_move_page_down ();
extern void gui_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 int gui_window_merge_up (t_gui_window *);
extern int gui_window_merge_down (t_gui_window *);
extern int gui_window_merge_left (t_gui_window *);
extern int gui_window_merge_right (t_gui_window *);
extern void gui_window_merge_auto (t_gui_window *);
extern void gui_window_merge_all (t_gui_window *);
extern void gui_pre_init (int *, char **[]);
extern void gui_init_colors ();
extern void gui_set_window_title ();
extern void gui_init ();
extern void gui_end ();
extern void gui_printf_color_type (/*@null@*/ t_gui_buffer *, int, int, char *, ...);
extern void gui_printf_type_color (/*@null@*/ t_gui_buffer *, int, int, char *, ...);
extern void gui_main_loop ();
#endif /* gui.h */
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
+132 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -25,13 +25,13 @@
#endif
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "../common/weechat.h"
#include "irc.h"
t_irc_channel *current_channel = NULL;
char *channel_modes = "iklmnst";
@@ -54,12 +54,15 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name,
/* initialize new channel */
new_channel->type = channel_type;
new_channel->dcc_chat = NULL;
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_count = 0;
new_channel->checking_away = 0;
new_channel->nicks = NULL;
new_channel->last_nick = NULL;
@@ -72,7 +75,7 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name,
server->channels = new_channel;
server->last_channel = new_channel;
gui_buffer_new (gui_current_window, server, new_channel, switch_to_buffer);
gui_buffer_new (gui_current_window, server, new_channel, 0, switch_to_buffer);
/* all is ok, return address of new channel */
return new_channel;
@@ -101,6 +104,14 @@ channel_free (t_irc_server *server, t_irc_channel *channel)
if (channel->next_channel)
(channel->next_channel)->prev_channel = channel->prev_channel;
/* close DCC CHAT */
if ((t_irc_dcc *)(channel->dcc_chat) &&
(!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status)))
{
dcc_close ((t_irc_dcc *)(channel->dcc_chat), DCC_ABORTED);
dcc_redraw (1);
}
/* free data */
if (channel->name)
free (channel->name);
@@ -154,3 +165,121 @@ string_is_channel (char *string)
first_char[1] = '\0';
return (strpbrk (first_char, CHANNEL_PREFIX)) ? 1 : 0;
}
/*
* channel_remove_away: remove away for all nicks on a channel
*/
void
channel_remove_away (t_irc_channel *channel)
{
t_irc_nick *ptr_nick;
if (channel->type == CHAT_CHANNEL)
{
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
ptr_nick->is_away = 0;
}
gui_draw_buffer_nick (channel->buffer, 0);
}
}
/*
* channel_check_away: check for away on a channel
*/
void
channel_check_away (t_irc_server *server, t_irc_channel *channel)
{
if (channel->type == CHAT_CHANNEL)
{
channel->checking_away++;
server_sendf (server, "WHO %s\r\n", channel->name);
}
}
/*
* channel_set_away: set/unset away status for a channel
*/
void
channel_set_away (t_irc_channel *channel, char *nick, int is_away)
{
t_irc_nick *ptr_nick;
if (channel->type == CHAT_CHANNEL)
{
ptr_nick = nick_search (channel, nick);
if (ptr_nick)
nick_set_away (channel, ptr_nick, is_away);
}
}
/*
* channel_create_dcc: create DCC CHAT channel
*/
int
channel_create_dcc (t_irc_dcc *ptr_dcc)
{
t_irc_channel *ptr_channel;
ptr_channel = channel_search (ptr_dcc->server, ptr_dcc->nick);
if (!ptr_channel)
ptr_channel = channel_new (ptr_dcc->server, CHAT_PRIVATE,
ptr_dcc->nick, 0);
if (!ptr_channel)
return 0;
if (ptr_channel->dcc_chat &&
(!DCC_ENDED(((t_irc_dcc *)(ptr_channel->dcc_chat))->status)))
return 0;
ptr_channel->dcc_chat = ptr_dcc;
ptr_dcc->channel = ptr_channel;
gui_redraw_buffer (ptr_channel->buffer);
return 1;
}
/*
* channel_remove_dcc: remove a DCC CHAT
*/
void
channel_remove_dcc (t_irc_dcc *ptr_dcc)
{
t_irc_channel *ptr_channel;
for (ptr_channel = ptr_dcc->server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if ((t_irc_dcc *)(ptr_channel->dcc_chat) == ptr_dcc)
{
ptr_channel->dcc_chat = NULL;
gui_redraw_buffer (ptr_channel->buffer);
}
}
}
/*
* channel_print_log: print channel infos in log (usually for crash dump)
*/
void
channel_print_log (t_irc_channel *channel)
{
wee_log_printf ("=> channel %s (addr:0x%X)]\n", channel->name, channel);
wee_log_printf (" type . . . . : %d\n", channel->type);
wee_log_printf (" dcc_chat . . : 0x%X\n", channel->dcc_chat);
wee_log_printf (" topic. . . . : '%s'\n", channel->topic);
wee_log_printf (" modes. . . . : '%s'\n", channel->modes);
wee_log_printf (" limit. . . . : %d\n", channel->limit);
wee_log_printf (" key. . . . . : '%s'\n", channel->key);
wee_log_printf (" checking_away: %d\n", channel->checking_away);
wee_log_printf (" nicks. . . . : 0x%X\n", channel->nicks);
wee_log_printf (" last_nick. . : 0x%X\n", channel->last_nick);
wee_log_printf (" buffer . . . : 0x%X\n", channel->buffer);
wee_log_printf (" prev_channel : 0x%X\n", channel->prev_channel);
wee_log_printf (" next_channel : 0x%X\n", channel->next_channel);
}
+50 -25
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -40,26 +40,36 @@ t_irc_command irc_commands[] =
N_("-all: toggle away status on all connected servers\n"
"message: message for away (if no message is given, away status is removed)"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
{ "ban", N_("bans nicks or hosts"),
N_("[channel] [nickname [nickname ...]]"),
N_("channel: channel for ban\nnickname: user or host to ban"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_ban, NULL },
{ "ctcp", N_("send a ctcp message"),
N_("nickname type"),
N_("nickname: user to send ctcp to\ntype: \"action\" or \"version\""),
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"
{ "dcc", N_("starts DCC (file or chat) or close chat"),
N_("action [nickname [file]]"),
N_("action: 'send' (file) or 'chat' or 'close' (chat)\n"
"nickname: nickname to send file or chat\n"
"file: filename (on local host)"),
2, 3, 1, NULL, irc_cmd_send_dcc, NULL },
1, MAX_ARGS, 1, NULL, irc_cmd_send_dcc, NULL },
{ "dehalfop", N_("removes half channel operator status from nickname(s)"),
N_("nickname [nickname]"), "",
1, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
{ "deop", N_("removes channel operator status from nickname(s)"),
N_("nickname [nickname]"), "",
1, 1, 1, irc_cmd_send_deop, NULL, NULL },
1, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
{ "devoice", N_("removes voice from nickname(s)"),
N_("nickname [nickname]"), "",
1, 1, 1, irc_cmd_send_devoice, NULL, NULL },
1, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
{ "die", N_("shutdown the server"),
"", "",
0, 0, 1, NULL, irc_cmd_send_die, NULL },
{ "error", N_("error received from IRC server"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
{ "halfop", N_("gives half channel operator status to nickname(s)"),
N_("nickname [nickname]"), "",
1, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
{ "info", N_("get information describing the server"),
N_("[target]"),
N_("target: server name"),
@@ -67,7 +77,7 @@ t_irc_command irc_commands[] =
{ "invite", N_("invite a nick on a channel"),
N_("nickname channel"),
N_("nickname: nick to invite\nchannel: channel to invite"),
2, 2, 1, NULL, irc_cmd_send_invite, NULL },
1, 2, 1, irc_cmd_send_invite, NULL, irc_cmd_recv_invite },
{ "ison", N_("check if a nickname is currently on IRC"),
N_("nickname [nickname ...]"),
N_("nickname: nickname"),
@@ -80,20 +90,24 @@ t_irc_command irc_commands[] =
N_("[channel] nickname [comment]"),
N_("channel: channel where user is\nnickname: nickname to kick\ncomment: comment for kick"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_kick, irc_cmd_recv_kick },
{ "kickban", N_("kicks and bans a nick from a channel"),
N_("[channel] nickname [comment]"),
N_("channel: channel where user is\nnickname: nickname to kick and ban\ncomment: comment for kick"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_kickban, NULL },
{ "kill", N_("close client-server connection"),
N_("nickname comment"),
N_("nickname: nickname\ncomment: comment for kill"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, NULL },
{ "links", N_("list all servernames which are known by the server answering the query"),
N_("[[remove_server] server_mask]"),
N_("remote_server: this server should answer the query\n"
N_("[[server] server_mask]"),
N_("server: this server should answer the query\n"
"server_mask: list of servers must match this mask"),
0, 2, 1, NULL, irc_cmd_send_links, NULL },
{ "list", N_("list channels and their topic"),
N_("[channel[,channel] [server]]"),
N_("channel: channel to list\nserver: server name"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_list, NULL },
{ "lusers", N_("get statistics about ths size of the IRC network"),
{ "lusers", N_("get statistics about the size of the IRC network"),
N_("[mask [target]]"),
N_("mask: servers matching the mask only\n"
"target: server for forwarding request"),
@@ -101,10 +115,10 @@ t_irc_command irc_commands[] =
{ "me", N_("send a ctcp action to the current channel"),
N_("message"),
N_("message: message to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
{ "mode", N_("change channel or user mode"),
N_("{ channel {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask] } | "
"{ nickname {[+|-]|i|w|s|o}"),
"{ nickname {[+|-]|i|w|s|o} }"),
N_("channel modes:\n"
" channel: channel name to modify\n"
" o: give/take channel operator privileges\n"
@@ -123,7 +137,7 @@ t_irc_command irc_commands[] =
" i: mark a user as invisible\n"
" s: mark a user for receive server notices\n"
" w: user receives wallops\n"
" o: operator flag\n"),
" o: operator flag"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
{ "motd", N_("get the \"Message Of The Day\""),
N_("[target]"),
@@ -136,22 +150,23 @@ t_irc_command irc_commands[] =
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 },
0, 1, 1, NULL, irc_cmd_send_names, NULL },
{ "nick", N_("change current nickname"),
N_("nickname"), N_("nickname: new nickname for current IRC server"),
1, 1, 1, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
{ "notice", N_("send notice message to user"),
N_("nickname text"), N_("nickname: user to send notice to\ntext: text to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
{ "op", N_("gives channel operator status to nickname(s)"),
N_("nickname [nickname]"), "",
1, 1, 1, irc_cmd_send_op, NULL, NULL },
1, MAX_ARGS, 1, irc_cmd_send_op, NULL, NULL },
{ "oper", N_("get operator privileges"),
N_("user password"),
N_("user/password: used to get privileges on current IRC server"),
2, 2, 1, NULL, irc_cmd_send_oper, NULL },
{ "part", N_("leave a channel"),
N_("[channel[,channel]]"), N_("channel: channel name to leave"),
N_("[channel[,channel]] [part_message]"), N_("channel: channel name to leave\n"
"part_message: part message (displayed to other users)"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_part, irc_cmd_recv_part },
{ "ping", N_("ping server"),
N_("server1 [server2]"),
@@ -160,7 +175,7 @@ t_irc_command irc_commands[] =
{ "pong", N_("answer to a ping message"),
N_("daemon [daemon2]"), N_("daemon: daemon who has responded to Ping message\n"
"daemon2: forward message to this daemon"),
1, 2, 1, NULL, irc_cmd_send_pong, NULL },
1, 2, 1, NULL, irc_cmd_send_pong, irc_cmd_recv_pong },
{ "privmsg", N_("message received"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
@@ -169,7 +184,7 @@ t_irc_command irc_commands[] =
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),
{ "quit", N_("close all connections & quit"),
N_("[quit_message]"),
N_("quit_message: quit message (displayed to other users)"),
0, MAX_ARGS, 0, NULL, irc_cmd_send_quit, irc_cmd_recv_quit },
@@ -196,7 +211,7 @@ t_irc_command irc_commands[] =
N_("service text"), N_("service: name of service\ntext: text to send"),
2, 2, 1, NULL, irc_cmd_send_squery, NULL },
{ "squit", N_("disconnect server links"),
N_("server commnent"), N_("server: server name\ncomment: comment for quit"),
N_("server comment"), N_("server: server name\ncomment: comment for quit"),
2, 2, 1, NULL, irc_cmd_send_squit, NULL },
{ "stats", N_("query statistics about server"),
N_("[query [server]]"),
@@ -217,6 +232,10 @@ t_irc_command irc_commands[] =
{ "trace", N_("find the route to specific server"),
N_("[target]"), N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_trace, NULL },
{ "unban", N_("unbans nicks or hosts"),
N_("[channel] nickname [nickname ...]"),
N_("channel: channel for unban\nnickname: user or host to unban"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_unban, NULL },
{ "userhost", N_("return a list of information about nicknames"),
N_("nickname [nickname ...]"), N_("nickname: nickname"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_userhost, NULL },
@@ -228,14 +247,14 @@ t_irc_command irc_commands[] =
0, 1, 1, NULL, irc_cmd_send_version, NULL },
{ "voice", N_("gives voice to nickname(s)"),
N_("nickname [nickname]"), "",
1, 1, 1, irc_cmd_send_voice, NULL, NULL },
1, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
{ "wallops", N_("send a message to all currently connected users who have "
"set the 'w' user mode for themselves"),
N_("text"), N_("text to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
{ "who", N_("generate a query which returns a list of information"),
N_("[mask [\"o\"]]"), N_("mask: only information which match this mask\n"
"o: only operators are returned according to the mask supplied\n"),
"o: only operators are returned according to the mask supplied"),
0, 2, 1, NULL, irc_cmd_send_who, NULL },
{ "whois", N_("query information about user(s)"),
N_("[server] nickname[,nickname]"), N_("server: server name\n"
@@ -283,7 +302,7 @@ t_irc_command irc_commands[] =
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
{ "314", N_("whowas"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
{ "315", N_("end of /who list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "315", N_("end of /who list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
{ "317", N_("whois (idle)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
{ "318", N_("whois (end)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
{ "319", N_("whois (channels)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
@@ -310,6 +329,8 @@ t_irc_command irc_commands[] =
{ "364", N_("links"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "365", N_("end of /links list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "366", N_("end of /names list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
{ "367", N_("banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
{ "368", N_("end of banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
{ "369", N_("end of /whowas list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "371", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "372", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
@@ -336,6 +357,8 @@ t_irc_command irc_commands[] =
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "409", N_("no origin"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "410", N_("no services"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "411", N_("no recipient"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "412", N_("no text to send"),
@@ -354,12 +377,14 @@ t_irc_command irc_commands[] =
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "431", N_("no nickname given"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "432", N_("erroneus nickname"),
{ "432", N_("erroneous nickname"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "433", N_("nickname already in use"),
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_433 },
{ "436", N_("nickname collision"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "438", N_("not authorized to change nickname"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_438 },
{ "441", N_("user not in channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "442", N_("not on channel"),
+974 -5
View File
File diff suppressed because it is too large Load Diff
+97 -27
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -43,11 +43,18 @@
void
irc_display_prefix (t_gui_buffer *buffer, char *prefix)
{
int type;
type = MSG_TYPE_INFO | MSG_TYPE_PREFIX;
if (!cfg_log_plugin_msg && (prefix == PREFIX_PLUGIN))
type |= MSG_TYPE_NOLOG;
if (prefix[0] == 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]);
gui_printf_type_color (buffer, type, COLOR_WIN_CHAT_PREFIX1, "%c", prefix[0]);
gui_printf_type_color (buffer, type, COLOR_WIN_CHAT_PREFIX2, "%c", prefix[1]);
gui_printf_type_color (buffer, type, COLOR_WIN_CHAT_PREFIX1, "%c ", prefix[2]);
}
else
gui_printf_color (buffer, COLOR_WIN_CHAT_PREFIX1, "%s ", prefix);
@@ -63,41 +70,43 @@ 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 (buffer,
gui_printf_type_color (buffer,
message_type, COLOR_WIN_CHAT_DARK, "<");
if (cfg_look_nickmode)
{
if (nick->is_op)
gui_printf_color_type (buffer,
if (nick->is_chanowner)
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_NICK_OP, "~");
else if (nick->is_chanadmin)
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_NICK_OP, "&");
else if (nick->is_op)
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_NICK_OP, "@");
else if (nick->is_halfop)
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_NICK_HALFOP, "%%");
else if (nick->has_voice)
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_NICK_VOICE, "+");
else
{
if (nick->is_halfop)
gui_printf_color_type (buffer,
if (cfg_look_nickmode_empty && !no_nickmode)
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_NICK_HALFOP, "%%");
else
{
if (nick->has_voice)
gui_printf_color_type (buffer,
message_type,
COLOR_WIN_NICK_VOICE, "+");
else
if (cfg_look_nickmode_empty && !no_nickmode)
gui_printf_color_type (buffer,
message_type,
COLOR_WIN_CHAT, " ");
}
}
COLOR_WIN_CHAT, " ");
}
if (color_nick < 0)
gui_printf_color_type (buffer,
gui_printf_type_color (buffer,
message_type,
COLOR_WIN_CHAT_HIGHLIGHT,
"%s", nick->nick);
else
gui_printf_color_type (buffer,
gui_printf_type_color (buffer,
message_type,
(color_nick) ?
((cfg_look_color_nicks) ?
@@ -106,7 +115,7 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, int message_type,
"%s", nick->nick);
if (display_around)
gui_printf_color_type (buffer,
gui_printf_type_color (buffer,
message_type, COLOR_WIN_CHAT_DARK, "> ");
}
@@ -133,3 +142,64 @@ irc_display_mode (t_gui_buffer *buffer, char *channel_name, char set_flag,
else
gui_printf_color (buffer, COLOR_WIN_CHAT, " %s\n", message);
}
/*
* irc_display_server: display server description
*/
void
irc_display_server (t_irc_server *server)
{
gui_printf (NULL, "\n");
gui_printf_color (NULL, COLOR_WIN_CHAT, _("Server: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%s", server->name);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, " [");
gui_printf_color (NULL, COLOR_WIN_CHAT, "%s",
(server->is_connected) ?
_("connected") : _("not connected"));
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "]\n");
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_autoconnect : %s%s\n",
(server->autoconnect) ? _("yes") : _("no"),
(server->command_line) ?
_(" (temporary server, will not be saved)") : "");
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_autoreconnect . . .: %s\n",
(server->autoreconnect) ? _("yes") : _("no"));
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_autoreconnect_delay: %d seconds\n",
server->autoreconnect_delay);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_address . . . . . .: %s\n",
server->address);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_port . . . . . . .: %d\n",
server->port);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_password . . . . .: %s\n",
(server->password && server->password[0]) ?
_("(hidden)") : "");
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_nick1/2/3 . . . . .: %s", server->nick1);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, " / ");
gui_printf_color (NULL, COLOR_WIN_CHAT, "%s", server->nick2);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, " / ");
gui_printf_color (NULL, COLOR_WIN_CHAT, "%s\n", server->nick3);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_username . . . . .: %s\n",
server->username);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_realname . . . . .: %s\n",
server->realname);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_command . . . . . .: %s\n",
(server->command && server->command[0]) ?
server->command : "");
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_command_delay . . .: %d seconds\n",
server->command_delay);
gui_printf_color (NULL, COLOR_WIN_CHAT,
" server_autojoin . . . . .: %s\n",
(server->autojoin && server->autojoin[0]) ?
server->autojoin : "");
}
+54 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -64,8 +64,10 @@ nick_compare (t_irc_nick *nick1, t_irc_nick *nick2)
{
int score1, score2, comp;
score1 = - ( (nick1->is_op * 8) + (nick1->is_halfop * 4) + (nick1->has_voice * 2));
score2 = - ( (nick2->is_op * 8) + (nick2->is_halfop * 4) + (nick2->has_voice * 2));
score1 = - ( (nick1->is_chanowner * 32) + (nick1->is_chanadmin * 16) +
(nick1->is_op * 8) + (nick1->is_halfop * 4) + (nick1->has_voice * 2) );
score2 = - ( (nick2->is_chanowner * 32) + (nick2->is_chanadmin * 16) +
(nick2->is_op * 8) + (nick2->is_halfop * 4) + (nick2->has_voice * 2) );
comp = strcasecmp(nick1->nick, nick2->nick);
if (comp > 0)
@@ -149,7 +151,8 @@ nick_insert_sorted (t_irc_channel *channel, t_irc_nick *nick)
t_irc_nick *
nick_new (t_irc_channel *channel, char *nick_name,
int is_op, int is_halfop, int has_voice)
int is_chanowner, int is_chanadmin, int is_op, int is_halfop,
int has_voice)
{
t_irc_nick *new_nick;
@@ -157,6 +160,8 @@ nick_new (t_irc_channel *channel, char *nick_name,
if ((new_nick = nick_search (channel, nick_name)))
{
/* update nick */
new_nick->is_chanowner = is_chanowner;
new_nick->is_chanadmin = is_chanadmin;
new_nick->is_op = is_op;
new_nick->is_halfop = is_halfop;
new_nick->has_voice = has_voice;
@@ -173,9 +178,12 @@ nick_new (t_irc_channel *channel, char *nick_name,
/* initialize new nick */
new_nick->nick = strdup (nick_name);
new_nick->is_chanowner = is_chanowner;
new_nick->is_chanadmin = is_chanadmin;
new_nick->is_op = is_op;
new_nick->is_halfop = is_halfop;
new_nick->has_voice = has_voice;
new_nick->is_away = 0;
if (strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0)
new_nick->color = COLOR_WIN_NICK_SELF;
else
@@ -183,6 +191,8 @@ nick_new (t_irc_channel *channel, char *nick_name,
nick_insert_sorted (channel, new_nick);
channel->nicks_count++;
/* all is ok, return address of new nick */
return new_nick;
}
@@ -255,6 +265,8 @@ nick_free (t_irc_channel *channel, t_irc_nick *nick)
if (nick->next_nick)
(nick->next_nick)->prev_nick = nick->prev_nick;
channel->nicks_count--;
/* free data */
if (nick->nick)
free (nick->nick);
@@ -272,6 +284,9 @@ nick_free_all (t_irc_channel *channel)
/* remove all nicks for the channel */
while (channel->nicks)
nick_free (channel, channel->nicks);
/* sould be zero, but prevent any bug :D */
channel->nicks_count = 0;
}
/*
@@ -311,7 +326,7 @@ nick_count (t_irc_channel *channel, int *total, int *count_op,
ptr_nick = ptr_nick->next_nick)
{
(*total)++;
if (ptr_nick->is_op)
if ((ptr_nick->is_chanowner) || (ptr_nick->is_chanadmin) || (ptr_nick->is_op))
(*count_op)++;
else
{
@@ -339,8 +354,7 @@ nick_get_max_length (t_irc_channel *channel)
t_irc_nick *ptr_nick;
max_length = 0;
for (ptr_nick = channel->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
length = strlen (ptr_nick->nick);
if (length > max_length)
@@ -348,3 +362,36 @@ nick_get_max_length (t_irc_channel *channel)
}
return max_length;
}
/*
* nick_set_away: set/unset away status for a channel
*/
void
nick_set_away (t_irc_channel *channel, t_irc_nick *nick, int is_away)
{
if (nick->is_away != is_away)
{
nick->is_away = is_away;
gui_draw_buffer_nick (channel->buffer, 0);
}
}
/*
* nick_print_log: print nick infos in log (usually for crash dump)
*/
void
nick_print_log (t_irc_nick *nick)
{
wee_log_printf ("=> nick %s (addr:0x%X)]\n", nick->nick, nick);
wee_log_printf (" is_chanowner . : %d\n", nick->is_chanowner);
wee_log_printf (" is_chanadmin . : %d\n", nick->is_chanadmin);
wee_log_printf (" is_op. . . . . : %d\n", nick->is_op);
wee_log_printf (" is_halfop. . . : %d\n", nick->is_halfop);
wee_log_printf (" has_voice. . . : %d\n", nick->has_voice);
wee_log_printf (" is_away. . . . : %d\n", nick->is_away);
wee_log_printf (" color. . . . . : %d\n", nick->color);
wee_log_printf (" prev_nick. . . : 0x%X\n", nick->prev_nick);
wee_log_printf (" next_nick. . . : 0x%X\n", nick->next_nick);
}
+749 -141
View File
File diff suppressed because it is too large Load Diff
+680 -92
View File
File diff suppressed because it is too large Load Diff
+509 -141
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -27,30 +27,30 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "../common/weechat.h"
#include "irc.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"
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;
/* buffer containing beginning of message if not ending with \r\n */
char *unterminated_message = NULL;
int check_away = 0;
/*
* server_init: init server struct with default values
@@ -59,8 +59,11 @@ char *unterminated_message = NULL;
void
server_init (t_irc_server *server)
{
/* user choices */
server->name = NULL;
server->autoconnect = 0;
server->autoreconnect = 1;
server->autoreconnect_delay = 30;
server->command_line = 0;
server->address = NULL;
server->port = -1;
@@ -71,13 +74,26 @@ server_init (t_irc_server *server)
server->username = NULL;
server->realname = NULL;
server->command = NULL;
server->command_delay = 1;
server->autojoin = NULL;
server->nick = NULL;
server->autorejoin = 0;
/* internal vars */
server->child_pid = 0;
server->child_read = -1;
server->child_write = -1;
server->sock = -1;
server->is_connected = 0;
server->sock4 = -1;
server->unterminated_message = NULL;
server->nick = NULL;
server->reconnect_start = 0;
server->reconnect_join = 0;
server->is_away = 0;
server->server_read = -1;
server->server_write = -1;
server->away_time = 0;
server->lag = 0;
server->lag_check_time.tv_sec = 0;
server->lag_check_time.tv_usec = 0;
server->lag_next_check = time (NULL) + cfg_irc_lag_check;
server->buffer = NULL;
server->channels = NULL;
server->last_channel = NULL;
@@ -255,6 +271,10 @@ server_free (t_irc_server *server)
{
t_irc_server *new_irc_servers;
/* close any opened channel/private */
while (server->channels)
channel_free (server, server->channels);
/* remove server from queue */
if (last_irc_server == server)
last_irc_server = server->prev_server;
@@ -291,9 +311,11 @@ server_free_all ()
*/
t_irc_server *
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)
server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_delay,
int command_line, char *address, int port, char *password,
char *nick1, char *nick2, char *nick3, char *username,
char *realname, char *command, int command_delay, char *autojoin,
int autorejoin)
{
t_irc_server *new_server;
@@ -303,17 +325,20 @@ server_new (char *name, int autoconnect, int command_line, char *address,
#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->autoreconnect = autoreconnect;
new_server->autoreconnect_delay = autoreconnect_delay;
new_server->command_line = command_line;
new_server->address = strdup (address);
new_server->port = port;
@@ -327,8 +352,10 @@ server_new (char *name, int autoconnect, int command_line, char *address,
(realname) ? strdup (realname) : strdup ("realname");
new_server->command =
(command) ? strdup (command) : NULL;
new_server->command_delay = command_delay;
new_server->autojoin =
(autojoin) ? strdup (autojoin) : NULL;
new_server->autorejoin = autorejoin;
new_server->nick = strdup (new_server->nick1);
}
else
@@ -341,12 +368,12 @@ server_new (char *name, int autoconnect, int command_line, char *address,
*/
int
server_send (t_irc_server * server, char *buffer, int size_buf)
server_send (t_irc_server *server, char *buffer, int size_buf)
{
if (!server)
return -1;
return send (server->sock4, buffer, size_buf, 0);
return send (server->sock, buffer, size_buf, 0);
}
/*
@@ -354,33 +381,42 @@ server_send (t_irc_server * server, char *buffer, int size_buf)
*/
void
server_sendf (t_irc_server * server, char *fmt, ...)
server_sendf (t_irc_server *server, char *fmt, ...)
{
va_list args;
static char buffer[1024];
static char buffer[4096];
char *buf2;
int size_buf;
if (!server)
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;
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
buffer[size_buf - 2] = '\0';
gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer);
#endif
buffer[size_buf - 2] = '\r';
if (server_send (server, buffer, size_buf) <= 0)
#endif
buf2 = weechat_convert_encoding ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset,
cfg_look_charset_encode,
buffer);
if (server_send (server, buf2, strlen (buf2)) <= 0)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer, _("%s error sending data to IRC server\n"),
WEECHAT_ERROR);
}
free (buf2);
}
/*
@@ -395,27 +431,31 @@ server_msgq_add_msg (t_irc_server *server, char *msg)
message = (t_irc_message *) malloc (sizeof (t_irc_message));
if (!message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
return;
}
message->server = server;
if (unterminated_message)
if (server->unterminated_message)
{
message->data = (char *) malloc (strlen (unterminated_message) +
message->data = (char *) malloc (strlen (server->unterminated_message) +
strlen (msg) + 1);
if (!message->data)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
else
{
strcpy (message->data, unterminated_message);
strcpy (message->data, server->unterminated_message);
strcat (message->data, msg);
}
free (unterminated_message);
unterminated_message = NULL;
free (server->unterminated_message);
server->unterminated_message = NULL;
}
else
message->data = strdup (msg);
@@ -438,7 +478,7 @@ server_msgq_add_msg (t_irc_server *server, char *msg)
*/
void
server_msgq_add_buffer (t_irc_server * server, char *buffer)
server_msgq_add_buffer (t_irc_server *server, char *buffer)
{
char *pos;
@@ -453,23 +493,45 @@ server_msgq_add_buffer (t_irc_server * server, char *buffer)
}
else
{
pos = strchr (buffer, '\0');
pos = strstr (buffer, "\n");
if (pos)
{
unterminated_message =
(char *) realloc (unterminated_message,
strlen (buffer) + 1);
if (!unterminated_message)
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
pos[0] = '\0';
server_msgq_add_msg (server, buffer);
buffer = pos + 1;
}
else
{
if (server->unterminated_message)
{
server->unterminated_message =
(char *) realloc (server->unterminated_message,
strlen (server->unterminated_message) +
strlen (buffer) + 1);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
else
strcat (server->unterminated_message, buffer);
}
else
strcpy (unterminated_message, buffer);
{
server->unterminated_message = strdup (buffer);
if (!server->unterminated_message)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
}
}
return;
}
gui_printf (server->buffer,
_("%s unable to explode received buffer\n"),
WEECHAT_ERROR);
}
}
}
@@ -484,8 +546,7 @@ server_msgq_flush ()
t_irc_message *next;
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)
{
if (recv_msgq->data)
@@ -512,9 +573,9 @@ server_msgq_flush ()
if (ptr_data[0] == ':')
{
pos = strchr(ptr_data, ' ');
pos = strchr (ptr_data, ' ');
pos[0] = '\0';
host = ptr_data+1;
host = ptr_data + 1;
pos++;
}
else
@@ -524,15 +585,15 @@ server_msgq_flush ()
{
while (pos[0] == ' ')
pos++;
pos2 = strchr(pos, ' ');
pos2 = strchr (pos, ' ');
if (pos2 != NULL)
{
pos2[0] = '\0';
command = strdup(pos);
command = strdup (pos);
pos2++;
while (pos2[0] == ' ')
pos2++;
args = (pos2[0] == ':') ? pos2+1 : pos2;
args = (pos2[0] == ':') ? pos2 + 1 : pos2;
}
}
@@ -540,19 +601,25 @@ server_msgq_flush ()
command, args))
{
case -1:
irc_display_prefix (recv_msgq->server->buffer, PREFIX_ERROR);
gui_printf (recv_msgq->server->buffer,
_("Command '%s' failed!\n"), command);
_("%s Command '%s' failed!\n"), WEECHAT_ERROR, command);
break;
case -2:
irc_display_prefix (recv_msgq->server->buffer, PREFIX_ERROR);
gui_printf (recv_msgq->server->buffer,
_("No command to execute!\n"));
_("%s No command to execute!\n"), WEECHAT_ERROR);
break;
case -3:
irc_display_prefix (recv_msgq->server->buffer, PREFIX_ERROR);
gui_printf (recv_msgq->server->buffer,
_("Unknown command: cmd=%s, args=%s\n"),
command, args);
_("%s Unknown command: cmd=%s, args=%s\n"),
WEECHAT_WARNING, command, args);
break;
}
if (command)
free (command);
}
free (entire_line);
@@ -577,13 +644,189 @@ server_recv (t_irc_server *server)
static char buffer[4096 + 2];
int num_read;
num_read = recv (server->sock4, buffer, sizeof (buffer) - 2, 0);
num_read = recv (server->sock, buffer, sizeof (buffer) - 2, 0);
if (num_read > 0)
{
buffer[num_read] = '\0';
server_msgq_add_buffer (server, buffer);
server_msgq_flush ();
}
else
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot read data from socket, disconnecting from server...\n"),
WEECHAT_ERROR);
server_disconnect (server, 1);
}
}
/*
* server_kill_child: kill child process and close pipe
*/
void
server_kill_child (t_irc_server *server)
{
/* kill process */
if (server->child_pid > 0)
{
kill (server->child_pid, SIGKILL);
waitpid (server->child_pid, NULL, 0);
server->child_pid = 0;
}
/* close pipe used with child */
if (server->child_read != -1)
{
close (server->child_read);
server->child_read = -1;
}
if (server->child_write != -1)
{
close (server->child_write);
server->child_write = -1;
}
}
/*
* server_close_connection: close server connection (kill child, close socket/pipes)
*/
void
server_close_connection (t_irc_server *server)
{
server_kill_child (server);
/* close network socket */
if (server->sock != -1)
{
close (server->sock);
server->sock = -1;
}
/* free any pending message */
if (server->unterminated_message)
{
free (server->unterminated_message);
server->unterminated_message = NULL;
}
/* server is now disconnected */
server->is_connected = 0;
}
/*
* server_reconnect_schedule: schedule reconnect for a server
*/
void
server_reconnect_schedule (t_irc_server *server)
{
if (server->autoreconnect)
{
server->reconnect_start = time (NULL);
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer, _("%s: Reconnecting to server in %d seconds\n"),
PACKAGE_NAME, server->autoreconnect_delay);
}
else
server->reconnect_start = 0;
}
/*
* server_child_read: read connection progress from child process
*/
void
server_child_read (t_irc_server *server)
{
char buffer[1];
int num_read;
num_read = read (server->child_read, buffer, sizeof (buffer));
if (num_read != -1)
{
switch (buffer[0])
{
/* connection OK */
case '0':
server_kill_child (server);
irc_login (server);
break;
/* adress not found */
case '1':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* IP address not found */
case '2':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s IP address not found\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
/* connection refused */
case '3':
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s connection refused\n"), WEECHAT_ERROR);
server_close_connection (server);
server_reconnect_schedule (server);
break;
}
}
}
/*
* server_child: child process trying to connect to server
*/
int
server_child (t_irc_server *server)
{
struct hostent *ip4_hostent;
struct sockaddr_in addr;
char *ip_address;
int error;
/* bind to hostname */
ip4_hostent = gethostbyname (server->address);
if (!ip4_hostent)
{
write (server->child_write, "1", 1);
return 0;
}
memset (&addr, 0, sizeof (addr));
memcpy (&addr.sin_addr, ip4_hostent->h_addr, ip4_hostent->h_length);
addr.sin_port = htons (server->port);
addr.sin_family = AF_INET;
/* find IP address */
ip_address = inet_ntoa (addr.sin_addr);
if (!ip_address)
{
write (server->child_write, "2", 1);
return 0;
}
/* connect to server */
error = connect (server->sock, (struct sockaddr *) &addr, sizeof (addr));
if (error != 0)
{
write (server->child_write, "3", 1);
return 0;
}
/* connection OK */
write (server->child_write, "0", 1);
return 0;
}
/*
@@ -593,104 +836,100 @@ server_recv (t_irc_server *server)
int
server_connect (t_irc_server *server)
{
int set;
struct hostent *ip4_hostent;
struct sockaddr_in addr;
char *ip_address;
int error;
int server_pipe[2];
int child_pipe[2], set;
pid_t pid;
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer,
_("%s: connecting to %s:%d...\n"),
PACKAGE_NAME, server->address, server->port);
wee_log_printf (_("connecting to server %s:%d...\n"),
server->address, server->port);
server->is_connected = 0;
/* create pipe */
if (pipe (server_pipe) < 0)
/* close any opened connection and kill child process if running */
server_close_connection (server);
/* create pipe for child process */
if (pipe (child_pipe) < 0)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot create pipe\n"), WEECHAT_ERROR);
server_free (server);
return 0;
}
server->server_read = server_pipe[0];
server->server_write = server_pipe[1];
server->child_read = child_pipe[0];
server->child_write = child_pipe[1];
/* create socket and set options */
server->sock4 = socket (AF_INET, SOCK_STREAM, 0);
server->sock = socket (AF_INET, SOCK_STREAM, 0);
if (server->sock == -1)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot create socket\n"), WEECHAT_ERROR);
server_close_connection (server);
return 0;
}
/* set SO_REUSEADDR option for socket */
set = 1;
if (setsockopt
(server->sock4, SOL_SOCKET, SO_REUSEADDR, (char *) &set,
sizeof (set)) == -1)
if (setsockopt (server->sock, SOL_SOCKET, SO_REUSEADDR,
(void *) &set, sizeof (set)) == -1)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot set socket option \"SO_REUSEADDR\"\n"),
WEECHAT_ERROR);
WEECHAT_WARNING);
}
/* set SO_KEEPALIVE option for socket */
set = 1;
if (setsockopt
(server->sock4, SOL_SOCKET, SO_KEEPALIVE, (char *) &set,
sizeof (set)) == -1)
if (setsockopt (server->sock, SOL_SOCKET, SO_KEEPALIVE,
(void *) &set, sizeof (set)) == -1)
{
irc_display_prefix (server->buffer, PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot set socket option \"SO_KEEPALIVE\"\n"),
WEECHAT_ERROR);
/* bind to hostname */
ip4_hostent = gethostbyname (server->address);
if (!ip4_hostent)
{
gui_printf (server->buffer,
_("%s address \"%s\" not found\n"),
WEECHAT_ERROR, server->address);
close (server->server_read);
close (server->server_write);
close (server->sock4);
server->sock4 = -1;
return 0;
WEECHAT_WARNING);
}
memset (&addr, 0, sizeof (addr));
memcpy (&addr.sin_addr, ip4_hostent->h_addr, ip4_hostent->h_length);
addr.sin_port = htons (server->port);
addr.sin_family = AF_INET;
/*error = bind(server->sock4, (struct sockaddr *)(&addr), sizeof(addr));
if (error != 0)
switch (pid = fork ())
{
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->buffer,
_("%s IP address not found\n"), WEECHAT_ERROR);
close (server->server_read);
close (server->server_write);
close (server->sock4);
server->sock4 = -1;
return 0;
/* fork failed */
case -1:
server_close_connection (server);
return 0;
/* child process */
case 0:
setuid (getuid ());
server_child (server);
_exit (EXIT_SUCCESS);
}
/* connection to server */
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->buffer,
_("%s cannot connect to irc server\n"), WEECHAT_ERROR);
close (server->server_read);
close (server->server_write);
close (server->sock4);
server->sock4 = -1;
return 0;
}
current_irc_server = server;
/* parent process go on here */
server->child_pid = pid;
return 1;
}
/*
* server_reconnect: reconnect to a server (after disconnection)
*/
void
server_reconnect (t_irc_server *server)
{
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer, _("%s: Reconnecting to server...\n"),
PACKAGE_NAME);
server->reconnect_start = 0;
if (server_connect (server))
server->reconnect_join = 1;
else
server_reconnect_schedule (server);
}
/*
* server_auto_connect: auto-connect to servers (called at startup)
*/
@@ -706,9 +945,9 @@ server_auto_connect (int command_line)
if ( ((command_line) && (ptr_server->command_line))
|| ((!command_line) && (ptr_server->autoconnect)) )
{
(void) gui_buffer_new (gui_current_window, ptr_server, NULL, 1);
if (server_connect (ptr_server))
irc_login (ptr_server);
(void) gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1);
gui_redraw_buffer (gui_current_window->buffer);
server_connect (ptr_server);
}
}
}
@@ -718,7 +957,7 @@ server_auto_connect (int command_line)
*/
void
server_disconnect (t_irc_server *server)
server_disconnect (t_irc_server *server, int reconnect)
{
t_irc_channel *ptr_channel;
@@ -728,17 +967,33 @@ server_disconnect (t_irc_server *server)
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
nick_free_all (ptr_channel);
irc_display_prefix (ptr_channel->buffer, PREFIX_INFO);
gui_printf (ptr_channel->buffer, _("Disconnected from server!\n"));
}
/* close communication with server */
close (server->server_read);
close (server->server_write);
close (server->sock4);
server->is_connected = 0;
server->sock4 = -1;
}
server_close_connection (server);
if (server->buffer)
{
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer, _("Disconnected from server!\n"));
}
server->is_away = 0;
server->away_time = 0;
server->lag = 0;
server->lag_check_time.tv_sec = 0;
server->lag_check_time.tv_usec = 0;
server->lag_next_check = time (NULL) + cfg_irc_lag_check;
if ((reconnect) && (server->autoreconnect))
server_reconnect_schedule (server);
else
server->reconnect_start = 0;
gui_redraw_buffer (gui_current_window->buffer);
}
/*
@@ -751,7 +1006,7 @@ server_disconnect_all ()
t_irc_server *ptr_server;
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
server_disconnect (ptr_server);
server_disconnect (ptr_server, 0);
}
/*
@@ -808,3 +1063,116 @@ server_name_already_exists (char *name)
}
return 0;
}
/*
* server_remove_away: remove away for all chans/nicks (for all servers)
*/
void
server_remove_away ()
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (ptr_server->is_connected)
{
for (ptr_channel = ptr_server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->type == CHAT_CHANNEL)
channel_remove_away (ptr_channel);
}
}
}
}
/*
* server_check_away: check for away on all channels (for all servers)
*/
void
server_check_away ()
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (ptr_server->is_connected)
{
for (ptr_channel = ptr_server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->type == CHAT_CHANNEL)
channel_check_away (ptr_server, ptr_channel);
}
}
}
}
/*
* server_set_away: set/unset away status for a server (all channels)
*/
void
server_set_away (t_irc_server *server, char *nick, int is_away)
{
t_irc_channel *ptr_channel;
for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel)
{
if (server->is_connected)
{
if (ptr_channel->type == CHAT_CHANNEL)
channel_set_away (ptr_channel, nick, is_away);
}
}
}
/*
* server_print_log: print server infos in log (usually for crash dump)
*/
void
server_print_log (t_irc_server *server)
{
wee_log_printf ("[server %s (addr:0x%X)]\n", server->name, server);
wee_log_printf (" autoconnect . . . . : %d\n", server->autoconnect);
wee_log_printf (" autoreconnect . . . : %d\n", server->autoreconnect);
wee_log_printf (" autoreconnect_delay : %d\n", server->autoreconnect_delay);
wee_log_printf (" command_line. . . . : %d\n", server->command_line);
wee_log_printf (" address . . . . . . : '%s'\n", server->address);
wee_log_printf (" port. . . . . . . . : %d\n", server->port);
wee_log_printf (" password. . . . . . : '%s'\n",
(server->password && server->password[0]) ? "(hidden)" : server->password);
wee_log_printf (" nick1 . . . . . . . : '%s'\n", server->nick1);
wee_log_printf (" nick2 . . . . . . . : '%s'\n", server->nick2);
wee_log_printf (" nick3 . . . . . . . : '%s'\n", server->nick3);
wee_log_printf (" username. . . . . . : '%s'\n", server->username);
wee_log_printf (" realname. . . . . . : '%s'\n", server->realname);
wee_log_printf (" command . . . . . . : '%s'\n",
(server->command && server->command[0]) ? "(hidden)" : server->command);
wee_log_printf (" command_delay . . . : %d\n", server->command_delay);
wee_log_printf (" autojoin. . . . . . : '%s'\n", server->autojoin);
wee_log_printf (" autorejoin. . . . . : %d\n", server->autorejoin);
wee_log_printf (" child_pid . . . . . : %d\n", server->child_pid);
wee_log_printf (" child_read . . . . : %d\n", server->child_read);
wee_log_printf (" child_write . . . . : %d\n", server->child_write);
wee_log_printf (" sock. . . . . . . . : %d\n", server->sock);
wee_log_printf (" is_connected. . . . : %d\n", server->is_connected);
wee_log_printf (" unterminated_message: '%s'\n", server->unterminated_message);
wee_log_printf (" nick. . . . . . . . : '%s'\n", server->nick);
wee_log_printf (" reconnect_start . . : %ld\n", server->reconnect_start);
wee_log_printf (" reconnect_join. . . : %d\n", server->reconnect_join);
wee_log_printf (" is_away . . . . . . : %d\n", server->is_away);
wee_log_printf (" away_time . . . . . : %ld\n", server->away_time);
wee_log_printf (" lag . . . . . . . . : %d\n", server->lag);
wee_log_printf (" lag_check_time. . . : tv_sec:%d, tv_usec:%d\n",
server->lag_check_time.tv_sec, server->lag_check_time.tv_usec);
wee_log_printf (" lag_next_check. . . : %ld\n", server->lag_next_check);
wee_log_printf (" buffer. . . . . . . : 0x%X\n", server->buffer);
wee_log_printf (" channels. . . . . . : 0x%X\n", server->channels);
wee_log_printf (" last_channel. . . . : 0x%X\n", server->last_channel);
wee_log_printf (" prev_server . . . . : 0x%X\n", server->prev_server);
wee_log_printf (" next_server . . . . : 0x%X\n", server->next_server);
}
+131 -15
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -21,8 +21,13 @@
#ifndef __WEECHAT_IRC_H
#define __WEECHAT_IRC_H 1
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#include "../gui/gui.h"
/* prefixes for chat window */
#define PREFIX_SERVER "-@-"
#define PREFIX_INFO "-=-"
#define PREFIX_ACTION_ME "-*-"
@@ -34,6 +39,8 @@
#define CHANNEL_PREFIX "#&+!"
/* channel modes */
#define NUM_CHANNEL_MODES 7
#define CHANNEL_MODE_INVITE 0
#define CHANNEL_MODE_KEY 1
@@ -50,6 +57,28 @@
#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 */
#define DCC_IS_CHAT(type) ((type == DCC_CHAT_RECV) || (type == DCC_CHAT_SEND))
#define DCC_IS_FILE(type) ((type == DCC_FILE_RECV) || (type == DCC_FILE_SEND))
#define DCC_IS_RECV(type) ((type == DCC_CHAT_RECV) || (type == DCC_FILE_RECV))
#define DCC_IS_SEND(type) ((type == DCC_CHAT_SEND) || (type == DCC_FILE_SEND))
#define DCC_ENDED(status) ((status == DCC_DONE) || (status == DCC_FAILED) || \
(status == DCC_ABORTED))
/* nick types */
typedef struct t_irc_nick t_irc_nick;
@@ -57,10 +86,13 @@ typedef struct t_irc_nick t_irc_nick;
struct t_irc_nick
{
char *nick; /* nickname */
int is_chanowner; /* chan owner? (specific to unrealircd) */
int is_chanadmin; /* chan admin? (specific to unrealircd) */
int is_op; /* operator privileges? */
int is_halfop; /* half operaor privileges? */
int has_voice; /* nick has voice? */
int color; /* color for nickname */
int is_away; /* = 1 if nick is away, otherwise 0 */
int color; /* color for nickname in chat window */
t_irc_nick *prev_nick; /* link to previous nick on the channel */
t_irc_nick *next_nick; /* link to next nick on the channel */
};
@@ -76,11 +108,14 @@ typedef struct t_irc_channel t_irc_channel;
struct t_irc_channel
{
int type; /* channel type */
void *dcc_chat; /* DCC CHAT pointer (NULL if not DCC) */
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) */
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
int checking_away; /* = 1 if checking away with WHO cmd */
t_irc_nick *nicks; /* nicks on the channel */
t_irc_nick *last_nick; /* last nick on the channel */
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
@@ -97,6 +132,8 @@ struct t_irc_server
/* user choices */
char *name; /* name of server (only for display) */
int autoconnect; /* = 1 if auto connect at startup */
int autoreconnect; /* = 1 if auto reco when disconnected */
int autoreconnect_delay; /* delay before trying again reconnect */
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) */
@@ -107,15 +144,25 @@ struct t_irc_server
char *username; /* user name */
char *realname; /* real name */
char *command; /* command to run once connected */
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
/* internal vars */
char *nick; /* current nickname */
pid_t child_pid; /* pid of child process (connecting) */
int child_read; /* to read into child pipe */
int child_write; /* to write into child pipe */
int sock; /* socket for server */
int is_connected; /* 1 if WeeChat is connected to server */
int sock4; /* socket for server */
char *unterminated_message; /* beginning of a message in input buf */
char *nick; /* current nickname */
time_t reconnect_start; /* this time + delay = reconnect time */
int reconnect_join; /* 1 if channels opened to rejoin */
int is_away; /* 1 is user is marker as away */
int server_read; /* pipe for reading server data */
int server_write; /* pipe for sending data to server */
time_t away_time; /* time() when user marking as away */
int lag; /* lag (in milliseconds) */
struct timeval lag_check_time; /* last time lag was checked (ping sent)*/
time_t lag_next_check; /* time for next check */
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 */
@@ -143,6 +190,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
@@ -152,10 +201,39 @@ struct t_irc_message
t_irc_message *next_message; /* link to next message */
};
/* DCC */
typedef struct t_irc_dcc t_irc_dcc;
struct t_irc_dcc
{
t_irc_server *server; /* irc server */
t_irc_channel *channel; /* irc channel (for DCC chat only) */
int type; /* DCC type (send or receive) */
int status; /* DCC status (waiting, sending, ..) */
time_t start_time; /* the time when DCC started */
unsigned long addr; /* IP address */
int port; /* port */
char *nick; /* remote nick */
int sock; /* socket for connection */
char *unterminated_message; /* beginning of a message in input buf */
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 */
unsigned long ack; /* number of bytes received OK */
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
t_irc_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 int check_away;
extern t_irc_dcc *dcc_list;
extern char *dcc_status_string[6];
extern char *channel_modes;
/* server functions (irc-server.c) */
@@ -166,18 +244,25 @@ extern t_irc_server *server_alloc ();
extern void server_destroy (t_irc_server *);
extern void server_free (t_irc_server *);
extern void server_free_all ();
extern t_irc_server *server_new (char *, int, int, char *, int, char *, char *,
char *, char *, char *, char *, char *, char *);
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, char *,
char *, char *, char *, char *, char *, char *,
int, char *, int);
extern int server_send (t_irc_server *, char *, int);
extern void server_sendf (t_irc_server *, char *, ...);
extern void server_recv (t_irc_server *);
extern int server_connect ();
extern void server_child_read (t_irc_server *);
extern int server_connect (t_irc_server *);
extern void server_reconnect (t_irc_server *);
extern void server_auto_connect (int);
extern void server_disconnect (t_irc_server *);
extern void server_disconnect (t_irc_server *, int);
extern void server_disconnect_all ();
extern t_irc_server *server_search (char *);
extern int server_get_number_connected ();
extern int server_name_already_exists (char *);
extern void server_remove_away ();
extern void server_check_away ();
extern void server_set_away (t_irc_server *, char *, int);
extern void server_print_log (t_irc_server *);
/* channel functions (irc-channel.c) */
@@ -186,10 +271,16 @@ extern void channel_free (t_irc_server *, t_irc_channel *);
extern void channel_free_all (t_irc_server *);
extern t_irc_channel *channel_search (t_irc_server *, char *);
extern int string_is_channel (char *);
extern void channel_remove_away (t_irc_channel *);
extern void channel_check_away (t_irc_server *, t_irc_channel *);
extern void channel_set_away (t_irc_channel *, char *, int);
extern int channel_create_dcc (t_irc_dcc *);
extern void channel_remove_dcc (t_irc_dcc *);
extern void channel_print_log (t_irc_channel *);
/* nick functions (irc-nick.c) */
extern t_irc_nick *nick_new (t_irc_channel *, char *, int, int, int);
extern t_irc_nick *nick_new (t_irc_channel *, char *, int, int, int, int, int);
extern void nick_resort (t_irc_channel *, t_irc_nick *);
extern void nick_change (t_irc_channel *, t_irc_nick *, char *);
extern void nick_free (t_irc_channel *, t_irc_nick *);
@@ -197,10 +288,21 @@ extern void nick_free_all (t_irc_channel *);
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 *);
extern void nick_set_away (t_irc_channel *, t_irc_nick *, int);
extern void nick_print_log (t_irc_nick *);
/* DCC functions (irc-dcc.c) */
extern void dcc_send ();
extern void dcc_redraw (int);
extern void dcc_free (t_irc_dcc *);
extern void dcc_close (t_irc_dcc *, int);
extern void dcc_accept (t_irc_dcc *);
extern t_irc_dcc *dcc_add (t_irc_server *, int, unsigned long, int, char *, int,
char *, char *, unsigned long);
extern void dcc_send_request (t_irc_server *, int, char *, char *);
extern void dcc_chat_sendf (t_irc_dcc *, char *, ...);
extern void dcc_handle ();
extern void dcc_end ();
/* IRC display (irc-diplay.c) */
@@ -208,6 +310,7 @@ 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 *);
extern void irc_display_server (t_irc_server *ptr_server);
/* IRC protocol (irc-commands.c) */
@@ -216,20 +319,26 @@ extern void irc_login (t_irc_server *);
/* IRC commands issued by user */
extern int irc_cmd_send_admin (t_irc_server *, char *);
extern int irc_cmd_send_away (t_irc_server *, char *);
extern int irc_cmd_send_ban (t_irc_server *, char *);
extern int irc_cmd_send_ctcp (t_irc_server *, char *);
extern int irc_cmd_send_dcc (t_irc_server *, char *);
extern int irc_cmd_send_dehalfop (t_irc_server *, int, 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 *);
extern int irc_cmd_send_halfop (t_irc_server *, int, char **);
extern int irc_cmd_send_info (t_irc_server *, char *);
extern int irc_cmd_send_invite (t_irc_server *, char *);
extern int irc_cmd_send_invite (t_irc_server *, int, char **);
extern int irc_cmd_send_ison (t_irc_server *, char *);
extern int irc_cmd_send_join (t_irc_server *, char *);
extern int irc_cmd_send_kick (t_irc_server *, char *);
extern int irc_cmd_send_kickban (t_irc_server *, char *);
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_motd (t_irc_server *, char *);
@@ -256,6 +365,7 @@ extern int irc_cmd_send_summon (t_irc_server *, char *);
extern int irc_cmd_send_time (t_irc_server *, char *);
extern int irc_cmd_send_topic (t_irc_server *, char *);
extern int irc_cmd_send_trace (t_irc_server *, char *);
extern int irc_cmd_send_unban (t_irc_server *, char *);
extern int irc_cmd_send_userhost (t_irc_server *, char *);
extern int irc_cmd_send_users (t_irc_server *, char *);
extern int irc_cmd_send_version (t_irc_server *, char *);
@@ -266,6 +376,7 @@ extern int irc_cmd_send_whois (t_irc_server *, char *);
extern int irc_cmd_send_whowas (t_irc_server *, char *);
/* IRC commands executed when received from server */
extern int irc_cmd_recv_error (t_irc_server *, char *, char *);
extern int irc_cmd_recv_invite (t_irc_server *, char *, char *);
extern int irc_cmd_recv_join (t_irc_server *, char *, char *);
extern int irc_cmd_recv_kick (t_irc_server *, char *, char *);
extern int irc_cmd_recv_mode (t_irc_server *, char *, char *);
@@ -273,6 +384,7 @@ extern int irc_cmd_recv_nick (t_irc_server *, char *, char *);
extern int irc_cmd_recv_notice (t_irc_server *, char *, char *);
extern int irc_cmd_recv_part (t_irc_server *, char *, char *);
extern int irc_cmd_recv_ping (t_irc_server *, char *, char *);
extern int irc_cmd_recv_pong (t_irc_server *, char *, char *);
extern int irc_cmd_recv_privmsg (t_irc_server *, char *, char *);
extern int irc_cmd_recv_quit (t_irc_server *, char *, char *);
extern int irc_cmd_recv_server_msg (t_irc_server *, char *, char *);
@@ -289,6 +401,7 @@ extern int irc_cmd_recv_311 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_312 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_313 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_314 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_315 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_317 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_318 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_319 (t_irc_server *, char *, char *);
@@ -306,6 +419,9 @@ extern int irc_cmd_recv_352 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_353 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_365 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_366 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_367 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_368 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_433 (t_irc_server *, char *, char *);
extern int irc_cmd_recv_438 (t_irc_server *, char *, char *);
#endif /* irc.h */
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
+97 -18
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -28,6 +28,7 @@
#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>
#undef _
#include "../../common/weechat.h"
#include "../plugins.h"
#include "wee-perl.h"
@@ -226,6 +227,55 @@ static XS (XS_IRC_print_infobar)
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, ...)
*/
@@ -264,8 +314,8 @@ static XS (XS_IRC_add_command_handler)
name = SvPV (ST (0), integer);
function = SvPV (ST (1), integer);
if (!index_command_search (name))
index_command_new (name);
if (!weelist_search (index_commands, name))
weelist_add (&index_commands, &last_index_command, name);
ptr_plugin_handler = plugin_handler_search (plugin_cmd_handlers, name);
if (ptr_plugin_handler)
{
@@ -284,17 +334,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) )
@@ -303,7 +373,8 @@ 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) )
{
@@ -312,7 +383,8 @@ static XS (XS_IRC_get_info)
}
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) )
{
@@ -320,7 +392,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;
}
@@ -346,6 +418,7 @@ xs_init (pTHX)
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");
@@ -378,13 +451,13 @@ wee_perl_init ()
" my $content = wee_perl_load_file ($filename);"
" if ($content eq \"__WEECHAT_ERROR__\")"
" {"
" IRC::print \"" WEECHAT_ERROR " Perl script '$filename' not found.\\n\";"
" IRC::print \"WeeChat Error: Perl script '$filename' not found.\\n\";"
" return 1;"
" }"
" eval $content;"
" if ($@)"
" {"
" IRC::print \"" WEECHAT_ERROR " unable to load Perl script '$filename':\\n\";"
" IRC::print \"WeeChat error: unable to load Perl script '$filename':\\n\";"
" IRC::print \"$@\\n\";"
" return 2;"
" }"
@@ -424,9 +497,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;
@@ -435,8 +508,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;
@@ -480,7 +557,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, "");
}
/*
@@ -533,7 +612,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);
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -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 ();
+18 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -92,6 +92,7 @@ plugin_auto_load (int plugin_type, char *directory)
plugin_load (plugin_type, entry->d_name);
}
}
closedir (dir);
}
/* restore working directory */
@@ -138,6 +139,10 @@ plugin_load (int plugin_type, char *filename)
/* TODO: load Ruby script */
break;
}
#else
/* make gcc happy */
(void) plugin_type;
(void) filename;
#endif
}
@@ -273,7 +278,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;
@@ -285,7 +290,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
}
}
@@ -293,6 +298,7 @@ plugin_event_msg (char *irc_command, char *arguments)
/* make gcc happy */
(void) irc_command;
(void) arguments;
(void) server;
#endif
}
@@ -301,7 +307,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;
@@ -313,7 +319,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 */
@@ -324,6 +330,7 @@ plugin_exec_command (char *user_command, char *arguments)
/* make gcc happy */
(void) user_command;
(void) arguments;
(void) server;
#endif
/* no command executed */
@@ -337,6 +344,9 @@ plugin_exec_command (char *user_command, char *arguments)
void
plugin_unload (int plugin_type, char *scriptname)
{
/* make gcc happy */
(void) scriptname;
#ifdef PLUGINS
switch (plugin_type)
{
@@ -354,6 +364,9 @@ plugin_unload (int plugin_type, char *scriptname)
/* TODO: unload Ruby scripts */
break;
}
#else
/* make gcc happy */
(void) plugin_type;
#endif
}
+4 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
@@ -59,6 +59,7 @@ 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, /*@null@*/ char *);
@@ -67,8 +68,8 @@ 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 *, /*@null@*/ 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 */
+6 -6
View File
@@ -1,10 +1,10 @@
.TH WEECHAT 1 "August 2004" "FlashCode"
.TH WEECHAT 1 "February 2005" "FlashCode"
.SH NAME
weechat \- Wee Enhanced Environment for Chat
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
.SH SYNOPSIS
.B weechat
.B weechat-curses
.RI [ options... ]
or
.RI [ url... ]
@@ -41,8 +41,8 @@ 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:
irc://irc.freenode.net/weechat
Exemple to join WeeChat channel support with nick "FlashCode":
irc://FlashCode@irc.freenode.net/weechat
.SH FILES
.TP
@@ -57,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
+10 -2
View File
@@ -1,5 +1,5 @@
%define name weechat
%define version 0.0.7
%define version 0.1.1
%define release 1
Name: %{name}
@@ -37,10 +37,18 @@ rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(-,root,root,0755)
%doc AUTHORS BUGS ChangeLog COPYING FAQ FAQ.fr INSTALL NEWS README TODO
/usr/local/man/man1/weechat.1*
/usr/local/man/man1/weechat-curses.1*
/usr/local/bin/weechat-curses
%changelog
* Sat Mar 20 2005 FlashCode <flashcode@flashtux.org> 0.1.1-1
- Released version 0.1.1
* Sat Feb 12 2005 FlashCode <flashcode@flashtux.org> 0.1.0-1
- Released version 0.1.0
* Sat Jan 01 2005 FlashCode <flashcode@flashtux.org> 0.0.9-1
- Released version 0.0.9
* 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
+17 -11
View File
@@ -1,29 +1,35 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
Developers:
----------
All developers are connected to IRC:
server: irc.freenode.net, channel: #weechat
Developer:
---------
FlashCode <flashcode@flashtux.org>
Web : http://www.flashtux.org
IRC : nick is "FlashCode"
Web : http://weechat.flashtux.org
IRC : nick is "FlashCode" @ irc.freenode.net
Jabber: flashcode@jabber.org
ICQ : 160677660
AIM : FlashCode AIM
Yahoo : FlashCode_Y
Testers:
-------
Bounga <bounga@altern.org>
Web : http://bounga.ath.cx
IRC : nick is "Bounga"
IRC : nick is "Bounga" @ irc.freenode.net
Jabber: Bounga@jabber.org
ICQ : 178297842
Xahlexx <xahlexx@tuxisland.org>
Web : http://www.tuxisland.org
IRC : nick is "xahlexx"
Xahlexx <xahlexx@weeland.org>
Web : http://www.weeland.org
IRC : nick is "xahlexx" @ irc.freenode.net
=====
Whole team is connected to IRC:
server: irc.freenode.net, channel: #weechat
See README file for licence detail.
+3 -9
View File
@@ -1,21 +1,15 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2004-08-08
WeeChat known bugs, 2005-02-12
- ./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
- too much nicks in the channel (> height of window) => some nicks are hidden
- when quitting WeeChat term title is not restored (if look_set_title is ON)
- command name for /server can not contain spaces
- wrong alias is not created and not saved when quitting WeeChat
- when many WeeChat are launched, log file is not properly written (cleared by
each WeeChat at startup)
- display problems with old Konsole versions (Kde terminal)
- display problems with old Konsole versions (Kde terminal) (???)
+83 -1
View File
@@ -1,9 +1,91 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2004-08-08
ChangeLog - 2005-03-20
Version 0.1.1 (2005-03-20):
* added nicks count for channel buffers
* added FIFO pipe for remote control
* added crash dump when WeeChat receives SIGSEGV (Segmentation fault)
* added new display engine: doesn't cut words at end of lines
* added DCC send and DCC chat
* added /halfop & /dehalfop commands, fixed halfop display bug in nicklist
* added /ban, /unban and /kickban commands
* added spanish translation
* added --irc-commands and --weechat-commands command line options
* connection to IRC server is now made by child process (non blocking)
* added support for UnrealIrcd ("~" for chan owner, "&" for chan admin)
* new key for window switch (now: F5/F6=switch buffer, F7/F8=switch window)
* on server buffer, only server messages are logged
* improved /help command output
* plugins messages are logged with new config option (log_plugin_msg)
* fixed /kick command
* fixed /invite command (and now invite requests are displayed)
* fixed /buffer close command (now ok when disconnected from server)
* fixed display bugs when many windows are opened
Version 0.1.0 (2005-02-12):
* improved /window command: now split and merge are ok
* away nicks are now displayed with another color (new option: "irc_away_check")
* added away indicator in status bar
* added lag indicator (and auto-disconnect after a delay if important lag)
* improved completion: now completes commands arguments (IRC and internal),
when only one completion matches, completion mechanism is stoped (to
complete command arg for example)
* improved /set command: empty strings are allowed, new colors, server
options can be changed while WeeChat is running
* added default away/part/quit messages in config file
* new [irc] section in config file, option "look_display_away" moved to
"irc_display_away"
* server messages & errors are all prefixed (by 3 chars, like '-@-')
* added new options for charset (UTF-8 support): look_charset_decode,
look_charset_encode and look_charset_internal
* fixed many memory leaks
* fixed colors bug: removed "gray" color (replaced by "default"), colors are
ok when terminal has white (or light) background
* fixed crash when resizing terminal to small size
* fixed crash when multiple servers and big messages received from server
* fixed crash when closing some private buffers
* fixed crash when unknown section with option(s) in config file
* fixed /op, /deop, /voice, /devoice (now ok with many nicks)
* fixed /me command (now ok without parameter)
* fixed /away command (now ok if not away)
* logs are now disabled by default (server/channel/private)
Version 0.0.9 (2005-01-01):
* auto-reconnection to server (new options: server_autoreconnect (on/off),
server_autoreconnect_delay (in seconds))
* major bug fixed when socket is closed by server (100% CPU usage fixed),
and disconnections are now ok (all channels are "closed", history is still
visible, and buffer will be used again if reconnection to server)
* option "look_remove_colors_from_msgs" is now working
* fixed display of nick mode changes
* new command "/buffer close" (close any server/channel/private buffer)
* /notice command fixed (and display when received from server)
* new keys: Ctrl+A (=home), Ctrl+E (=end), Ctrl+W (=Ctrl+Backspace),
Alt-S (switch to server buffer), Alt-X (switch to first channel of next
server)
* added new config option: "server_command_delay" (delay in seconds after
startup command for each server)
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
+26 -14
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2004-05-31
WeeChat FAQ, 2005-02-06
=======================
Intended audience:
@@ -53,7 +53,7 @@ A: Because WeeChat is very light and has new features.
* developed from scratch (not based on any other IRC client)
* multi-platform
* 100% GPL and free
This is the "geekest Irc client" ;)
This is the "geekest" IRC client ;)
2.2
@@ -65,13 +65,24 @@ A: For help you can type /help. For help about a command, type /help command.
2.3
================================================================================
Q: How can I customize key bindings?
Q: I don't see come chars with accents, what can I do?
A: Today you can't do that. This will be available in a future version.
A: You have to setup charset used for decoding, encoding, and internal WeeChat
charset.
Change value of option "look_charset_decode" to "UTF-8".
Option "look_charset_internal" should not be changed (default is
"ISO-8859-1").
2.4
================================================================================
Q: How can I customize key bindings?
A: Today you can't do that. This is planed for a future version.
2.5
================================================================================
Q: How can I load Perl scripts?
Are Perl scripts compatible with X-chat or/and Irssi ?
@@ -79,21 +90,22 @@ 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.5
================================================================================
Q: How can I load Python scripts?
A: Today Python interface is not developed, so can't load any Python script.
WeeChat perl scripts are compatible with X-Chat, but not with Irssi,
sorry ;)
2.6
================================================================================
Q: How can I load Python scripts?
A: Today Python interface is not developed, so you can't load any Python script.
2.7
================================================================================
Q: How can I load Ruby scripts?
A: Today Ruby interface is not developed, so can't load any Ruby script.
A: Today Ruby interface is not developed, so you can't load any Ruby script.
3.1
@@ -154,4 +166,4 @@ A: There's many tasks to do (code, documentation, ...)
================================================================================
Q: Can I give money or other things to WeeChat developers?
A: No.
A: Beer is welcome :)
+18 -7
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2004-05-31
WeeChat FAQ, 2005-02-06
=======================
Public concerné :
@@ -57,7 +57,7 @@ R: Parce que WeeChat est tr
* 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" ;)
C'est le client IRC le plus "geek" ;)
2.2
@@ -70,13 +70,24 @@ R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
2.3
================================================================================
Q: Je ne vois pas bien certains accents dans WeeChat, que faire ?
R: Il faut configurer le charset utilisé pour le décodage, l'encodage ainsi que
le charset interne à WeeChat.
Modifiez la valeur de l'option "look_charset_decode" en "UTF-8".
L'option "look_charset_internal" ne devrait pas être modifiée (par défaut
"ISO-8859-1").
2.4
================================================================================
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
2.5
================================================================================
Q: Comment puis-je charger des scripts Perl ?
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
@@ -85,11 +96,11 @@ 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,
Les scripts Perl WeeChat sont compatibles avec X-Chat, mais pas Irssi,
désolé ;)
2.5
2.6
================================================================================
Q: Comment puis-je charger les scripts Python ?
@@ -97,7 +108,7 @@ R: Aujourd'hui l'interface Python n'est pas d
Vous ne pouvez donc charger aucun script Python.
2.6
2.7
================================================================================
Q: Comment puis-je charger des scripts Ruby ?
@@ -169,4 +180,4 @@ R: Il y a plusieurs choses
================================================================================
Q: Puis-je donner de l'argent ou d'autres choses aux développeurs WeeChat ?
R: Non.
R: La bière est la bienvenue :)
+4 -2
View File
@@ -2,9 +2,11 @@ WeeChat - Installation instructions
===================================
1) Run './configure'
options: --disable-curses : do not build Curses interface
options: --enable-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=X : X=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 ;)
+9 -3
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,6 +17,12 @@
SUBDIRS = po intl src
EXTRA_DIST = weechat.1 BUGS FAQ FAQ.fr
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
+16
View File
@@ -1,6 +1,22 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2005-03-20
WeeChat 0.1.1 released.
* FlashCode, 2005-02-12
WeeChat 0.1.0 released.
* FlashCode, 2005-01-01
WeeChat 0.0.9 released.
* FlashCode, 2004-10-30
WeeChat 0.0.8 released.
* FlashCode, 2004-08-08
WeeChat 0.0.7 released.
+3 -6
View File
@@ -22,10 +22,7 @@ Features
Copyright
---------
WeeChat (c) Copyright 2004
by: FlashCode <flashcode@flashtux.org>
Xahlexx <xahlex@tuxisland.org>
Bounga <bounga@altern.org>
WeeChat (c) Copyright 2003-2005 by FlashCode <flashcode@flashtux.org>
(see AUTHORS file if you want to contact authors)
WeeChat is distributed under GPL licence (see COPYING file for complete license):
@@ -46,6 +43,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
+13 -20
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2004-08-08
TODO - 2005-03-20
Legend:
# done
@@ -10,34 +10,30 @@ Legend:
? is this really necessary?
v0.0.8:
v0.1.1:
------
* General:
- Windows version
+ Windows version
+ Solaris version
+ *BSD version
* IRC protocol:
+ "/dcc" command (for chat and sending/receiving files)
# "/dcc send" command
# "/dcc chat" command (and incoming DCC chats)
- customizable CTCP version reply
* Interface:
+ "/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)
+ Gtk GUI
+ internationalization (traduce WeeChat in many languages)
* Configuration:
+ add missing options for config file
- add key bindings to config file
* TCP/IP communication:
# connect to server with child process (background)
Future versions:
---------------
* General:
- *BSD version
* IRC protocol:
- complete "/list" command: add regexp search, display only channels that
match regexp
@@ -61,18 +57,12 @@ Future versions:
- "/last": command to look for text in previous messages
* Interface:
+ Gtk GUI
- color for nicks (except own nick) when nick colors are disabled
- interpret special chars in messages (color & bold for example)
- add lag indicator
- improve completion (for example complete command parameters when possible)
- understand incomplete commands if unambigous (for example: /he for /help is ok)
- tab key with empty command line should switch to next window (like F7)
- log chats to file
? Qt GUI
* TCP/IP communication:
- connect to server with child process (background)
- proxy support
- SSL support
- IPv6 protocol implementation
@@ -82,3 +72,6 @@ Future versions:
- "/python load" and "/python unload" commands to (un)load Python scripts
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
* Configuration:
- add key bindings to config file
+29 -27
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2004 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.0.7, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.1, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.0.7])
AM_INIT_AUTOMAKE([weechat], [0.1.1])
# Checks for programs.
AC_PROG_CC
@@ -30,11 +30,11 @@ AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Gettext
ALL_LINGUAS="fr"
ALL_LINGUAS="fr es"
AM_GNU_GETTEXT
# Checks for libraries.
AC_CHECK_LIB([curses], [initscr], LIBCURSES_FOUND=1, LIBCURSES_FOUND=0)
AC_CHECK_LIB([ncurses], [initscr], LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0)
# Checks for header files.
AC_HEADER_STDC
@@ -45,8 +45,6 @@ AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday inet_ntoa memset mkdir select setlocale socket strcasecmp strchr strdup strncasecmp strpbrk strrchr strstr uname])
@@ -55,11 +53,11 @@ AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(curses, [ --disable-curses Turn off Curses interface (default=auto)],,enable_curses=yes)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=auto)],,enable_ncurses=yes)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no)],enable_gtk=yes,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no)],enable_qt=yes,enable_qt=no)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl plugins (default=no)],enable_perl=yes,enable_perl=no)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=0)],debug=$withval,debug=0)
enable_plugins="no"
enable_python="no"
@@ -67,19 +65,19 @@ PYTHON_CFLAGS=
enable_ruby="no"
RUBY_CFLAGS=
AM_CONDITIONAL(GUI_CURSES, test "$enable_curses" = "yes")
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
# AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
# AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
if test "x$enable_curses" = "xyes" ; then
if test "$LIBCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([Curses library not found! Install Curses library or run ./configure with --disable-curses parameter.])
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([ncurses library not found! Install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
CURSES_LIBS="-lcurses"
AC_SUBST(CURSES_LIBS)
NCURSES_LIBS="-lncurses"
AC_SUBST(NCURSES_LIBS)
fi
if test "x$enable_gtk" = "xyes" ; then
@@ -108,10 +106,14 @@ fi
AC_SUBST(PLUGINS_LIBS)
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
CFLAGS="-O2"
fi
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
CFLAGS="-Wall -W -pipe -O2 -g"
CFLAGS="-Wall -W $CFLAGS -pipe -g"
else
CFLAGS="-Wall -W -pipe -O2"
CFLAGS="-Wall -W $CFLAGS -pipe"
fi
if test "x$debug" = "x2" ; then
@@ -135,8 +137,8 @@ echo
echo $PACKAGE $VERSION
listgui=
if test "x$enable_curses" = "xyes" ; then
listgui="$listgui Curses"
if test "x$enable_ncurses" = "xyes" ; then
listgui="$listgui ncurses"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
@@ -146,16 +148,16 @@ if test "x$enable_qt" = "xyes" ; then
fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([No interface specified... Please specify at least Curses, Gtk or Qt.])
AC_MSG_ERROR([No interface specified... Please specify at least ncurses, Gtk or Qt.])
fi
msg_debug_compiler="No"
msg_debug_verbose="No"
msg_debug_compiler="no"
msg_debug_verbose="no"
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
msg_debug_compiler="Yes"
msg_debug_compiler="yes"
fi
if test "x$debug" = "x2" ; then
msg_debug_verbose="Yes"
msg_debug_verbose="yes"
fi
echo
+24
View File
@@ -1,3 +1,27 @@
weechat (0.1.1-1) unstable; urgency=low
* WeeChat version 0.1.1, see ChangeLog for detail.
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 20 Mar 2005 08:00:00 +0200
weechat (0.1.0-1) unstable; urgency=low
* WeeChat version 0.1.0, see ChangeLog for detail.
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 12 Feb 2005 12:00:00 +0200
weechat (0.0.9-1) unstable; urgency=low
* WeeChat version 0.0.9, see ChangeLog for detail.
-- FlashCode <flashcode@flashtux.org> Sat, 01 Jan 2005 13:00:00 +0200
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.
+4 -4
View File
@@ -1,13 +1,13 @@
Source: weechat
Section: net
Priority: optional
Maintainer: FlashCode <flashcode@flashtux.org>
Build-Depends: debhelper (>> 4.0.0), libncurses5 (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
Standards-Version: 3.5.8
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Build-Depends: debhelper (>> 4.0.0), libncurses5-dev (>= 5.2.20020112a-7), perl (>= 5.6.0-16), libperl-dev
Standards-Version: 3.6.1
Package: weechat
Architecture: all
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${Source-Version})
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version}), weechat-gtk (= ${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.
+2 -2
View File
@@ -1,9 +1,9 @@
This package was debianized by FlashCode <flashcode@flashtux.org> on
Sat, 08 Aug 2004 21:00:00 +0200.
Sat, 20 Mar 2005 08:00: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:
+20 -19
View File
@@ -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,8 @@ endif
configure: configure-stamp
configure-stamp:
dh_testdir
./configure --prefix=/usr --sysconfdir=/etc --enable-perl
./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man \
--enable-perl
touch configure-stamp
@@ -32,7 +30,7 @@ clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
-$(MAKE) clean
-$(MAKE) distclean
dh_clean
install: build
@@ -43,30 +41,33 @@ 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_testdir -pweechat-common -pweechat
dh_testroot -pweechat-common -pweechat
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
dh_shlibdeps -pweechat-common
dh_gencontrol -pweechat-common
dh_md5sums -pweechat-common
dh_builddeb -pweechat-common
dh_compress -pweechat-common -pweechat
dh_link -pweechat usr/share/doc/weechat-common usr/share/doc/weechat
dh_fixperms -pweechat-common -pweechat
dh_installdeb -pweechat-common -pweechat
dh_shlibdeps -pweechat-common -pweechat
dh_gencontrol -pweechat-common -pweechat
dh_md5sums -pweechat-common -pweechat
dh_builddeb -pweechat-common -pweechat
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_link -a
# dh_installchangelogs -a
# dh_installdocs -a
dh_installman weechat-curses.1 -pweechat-curses
dh_link -a usr/share/doc/weechat-common usr/share/doc/weechat-curses
dh_strip -a
dh_compress -a
dh_fixperms -a
-3
View File
@@ -1,10 +1,7 @@
AUTHORS
BUGS
ChangeLog
COPYING
FAQ
FAQ.fr
INSTALL
NEWS
README
TODO
+1
View File
@@ -0,0 +1 @@
usr/share/locale
+5 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2003 FlashCode <flashcode@flashtux.org>
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,15 +15,18 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
all: weechat_doc_fr.texi weechat_doc_en.texi weechat_doc_pt.texi
all: weechat_doc_fr.texi weechat_doc_en.texi weechat_doc_pt.texi weechat_doc_es.texi
export LANG=fr_FR && makeinfo --html --no-split --number-sections weechat_doc_fr.texi
export LANG=fr_FR && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_fr.texi >weechat_doc_fr.txt
export LANG=en_EN && makeinfo --html --no-split --number-sections weechat_doc_en.texi
export LANG=en_EN && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_en.texi >weechat_doc_en.txt
export LANG=es_ES && makeinfo --html --no-split --number-sections weechat_doc_es.texi
export LANG=es_ES && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_es.texi >weechat_doc_es.txt
export LANG=pt_PT && makeinfo --html --no-split --number-sections weechat_doc_pt.texi
export LANG=pt_PT && makeinfo --no-headers --no-warn --no-split --number-sections weechat_doc_pt.texi >weechat_doc_pt.txt
export LANG=fr_FR && texi2pdf weechat_doc_fr.texi
export LANG=en_EN && texi2pdf weechat_doc_en.texi
export LANG=es_ES && texi2pdf weechat_doc_es.texi
export LANG=pt_PT && texi2pdf weechat_doc_pt.texi
clean:
+699 -65
View File
@@ -6,7 +6,7 @@
@c WeeChat documentation (english version)
@c
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
@c Copyright (c) 2005 by FlashCode <flashcode@flashtux.org>
@c
@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
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.0.7 - July, 04 2004
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
@image{weechat_image}
@@ -46,9 +46,9 @@
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}@*
@uref{http://weechat.flashtux.org/doc.php}@*
@*
Copyright @copyright{} 2004 FlashCode
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
@*
This document may be used under the terms the GNU General Public License
@@ -209,6 +209,7 @@ Then follow instructions for source package - @xref{Source package}.
* Config file::
* Key bindings::
* WeeChat commands::
* FIFO pipe::
@end menu
@node Run WeeChat, Config file, Usage, Usage
@@ -244,9 +245,10 @@ set parameters with @kbd{/set} command in WeeChat - @xref{WeeChat commands}.
@node Config file, Key bindings, Run WeeChat, Usage
@section Config file
Here is a list of all options for config file:@*
List of options for config file:@*
@table @kbd
@item look_set_title
Set title for window (terminal for Curses GUI) with name & version@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -259,6 +261,15 @@ 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_charset_decode
Charset for decoding messages from server, examples: UTF-8, ISO-8859-1 (if empty, messages are not converted)@*
Type: string (any string), default value: 'UTF-8'@*
@item look_charset_encode
Charset for encoding messages sent to server, examples: UFT-8, ISO-8859-1 (if empty, local charset is used)@*
Type: string (any string), default value: ''@*
@item look_charset_internal
Internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)@*
Type: string (any string), default value: 'ISO-8859-1'@*
@item look_color_nicks
Display nick names with different colors@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -297,22 +308,22 @@ 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'@*
Type: string (any string), default value: '%B, %A %d %Y - %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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_chat_time
Color for time in chat window@*
Type: color (Curses or Gtk color), default value: 'gray'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_chat_time_sep
Color for time separator (chat window)@*
Type: color (Curses or Gtk color), default value: 'brown'@*
@@ -342,16 +353,19 @@ 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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@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: 'lightred'@*
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: 'yellow'@*
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: 'lightmagenta'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_status_more
Color for window with new data (status bar)@*
Type: color (Curses or Gtk color), default value: 'white'@*
@@ -369,7 +383,7 @@ 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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_input_channel
Color for input text (channel name)@*
Type: color (Curses or Gtk color), default value: 'white'@*
@@ -381,7 +395,16 @@ 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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_nick_away
Color for away nicknames@*
Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_nick_chanowner
Color for chan owner symbol (specific to unrealircd)@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_nick_chanadmin
Color for chan admin symbol (specific to unrealircd)@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_nick_op
Color for operator symbol@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@@ -399,55 +422,103 @@ 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'@*
Type: color (Curses or Gtk color), default value: 'default'@*
@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: 'lightcyan'@*
@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_channels
@item log_auto_server
Automatically log server messages@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item log_auto_channel
Automatically log channel chats@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item log_auto_private
Automatically log private chats@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item log_plugin_msg
Log messages from plugins (scripts)@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item log_path
Path for WeeChat log files@*
Type: string (any string), default value: '~/.weechat/logs/'@*
@item log_name
Name for log files (%S == irc server name, %N == channel name (or nickname if private chat)@*
Type: string (any string), default value: '%S,%N.weechatlog'@*
@item log_timestamp
Timestamp for log (see man strftime for date/time specifiers)@*
Type: string (any string), default value: '~'@*
@item log_start_string
Text written when starting new log file (see man strftime for date/time specifiers)@*
Type: string (any string), default value: '--- Log started %a %b %d %Y %H:%M:%s'@*
@item log_end_string
Text written when ending log file (see man strftime for date/time specifiers)@*
Type: string (any string), default value: '--- Log ended %a %b %d %Y %H:%M:%s'@*
Type: string (any string), default value: '%Y %b %d %H:%M:%S'@*
@item log_hide_nickserv_pwd
Hide password displayed by nickserv@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item irc_display_away
Display message to all channels when (un)marking as away@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item irc_default_msg_away
Default message when away@*
Type: string (any string), default value: 'away'@*
@item irc_default_msg_part
Default part message (leaving channel)@*
Type: string (any string), default value: ''@*
@item irc_default_msg_quit
Default quit message ('%v' will be replaced by WeeChat version in string)@*
Type: string (any string), default value: 'WeeChat %v'@*
@item irc_away_check
Interval between two checks for away (in minutes, 0 = never check)@*
Type: integer (values: between 0 and 2147483647), default value: 0@*
@item irc_lag_check
Interval between two checks for lag (in seconds)@*
Type: integer (values: between 30 and 2147483647), default value: 60@*
@item irc_lag_min_show
Minimum lag to show (in seconds)@*
Type: integer (values: between 0 and 2147483647), default value: 1@*
@item irc_lag_disconnect
Disconnect after important lag (in minutes, 0 = never disconnect)@*
Type: integer (values: between 0 and 2147483647), default value: 5@*
@item dcc_auto_accept_files
Automatically accept incoming dcc files@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item dcc_auto_accept_max_size
Maximum size for incoming file when automatically accepted@*
Type: integer (values: between 0 and 2147483647), default value: 0@*
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'@*
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@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: 65536)@*
Type: integer (values: between 1024 and 102400), default value: 65536@*
@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_convert_spaces
Convert spaces to underscores when sending files@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item dcc_auto_rename
Rename incoming files if already exists (add '.1', '.2', ...)@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -472,6 +543,12 @@ 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_autoreconnect
Automatically reconnect to server when disconnected@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item server_autoreconnect_delay
Delay (in seconds) before trying again to reconnect to server@*
Type: integer (values: between 0 and 65535), default value: 30@*
@item server_address
IP address or hostname of IRC server@*
Type: string (any string), default value: ''@*
@@ -499,9 +576,16 @@ 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_command_delay
Delay (in seconds) after command was executed (example: give some time for authentication)@*
Type: integer (values: between 0 and 5), default value: 0@*
@item server_autojoin
Comma separated list of channels to join when connected to server@*
Type: string (any string), default value: ''@*
@item server_autorejoin
Automatically rejoin channels when kicked@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@end table
Colors for Curses GUI are:@*
@@ -535,8 +619,6 @@ Colors for Curses GUI are:@*
@item
@kbd{lightcyan}: light cyan
@item
@kbd{gray}: gray
@item
@kbd{white}: white
@end itemize
@@ -550,13 +632,16 @@ Go to previous / next char in command line@*
@item Ctrl + left arrow / Ctrl + right arrow
Go to previous / next word in command line@*
@*
@item Home / End
Go to the beginning / end of command line@*
@item Home / Ctrl + A
Go to the beginning of command line@*
@*
@item End / Ctrl + E
Go to the end of command line@*
@*
@item Backspace / Delete
Erase previous / next char of command line@*
@*
@item Ctrl + Backspace
@item Ctrl + Backspace / Ctrl + W
Erase previous word of command line@*
@*
@item Tab
@@ -574,30 +659,563 @@ Call again last commands/messages@*
@item PageUp / PageDown
Show buffer history@*
@*
@item F6 / F7
@item F5 / F6
Switch to previous / next buffer@*
@*
@item F8
Switch to next window@*
@*
@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 + digit (1-9)
Switch to buffer by number@*
@item F7 / F8
Switch to previous / next window@*
@*
@item F10
Remove last infobar message@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@item Alt + left arrow / Alt + right arrow
Same as F5 / F6@*
@*
@item Alt + A
Switch to next buffer with activity (with priority: highlight, message, other)@*
@*
@item Alt + D
Display current DCC@*
@*
@item Alt + R
Clear hotlist (activity notification on other buffers)@*
@*
@item Alt + S
Switch to server buffer@*
@*
@item Alt + X
Switch to first channel of next server (or server buffer if no channel is opened)@*
@*
@item Alt + digit (1-9)
Switch to buffer by number@*
@*
@end table
@node WeeChat commands, , Key bindings, Usage
@node WeeChat commands, FIFO pipe, Key bindings, Usage
@section WeeChat commands
NOT WRITTEN!
WeeChat internal commands:@*
@table @kbd
@item alias [alias_name [command [arguments]]
@*
create an alias for a command@*
@*
alias_name: name of alias@*
command: command name (WeeChat or IRC command, without first '/')@*
arguments: arguments for command@*
@*
@item buffer [action | number]
@*
manage buffers@*
@*
action: action to do:@*
move: move buffer in the list (may be relative, for example -1)@*
close: close buffer (for channel: same as /part without part message)@*
list: list opened buffers (no parameter implies this list)@*
notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)@*
number: jump to buffer by number@*
@*
@item clear [-all]
@*
clear window(s)@*
@*
-all: clear all windows@*
@*
@item connect [servername]
@*
connect to a server@*
@*
servername: server name to connect@*
@*
@item disconnect [servername]
@*
disconnect from a server@*
@*
servername: server name to disconnect@*
@*
@item debug dump
@*
print debug messages@*
@*
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)@*
@*
@item help [command]
@*
display help about commands@*
@*
command: name of a WeeChat or IRC command@*
@*
@item perl [load filename] | [autoload] | [unload]
@*
list/load/unload Perl scripts@*
@*
filename: Perl script (file) to load@*
Without argument, /perl command lists all loaded Perl scripts.@*
@*
@item server [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
@*
list, add or remove servers@*
@*
servername: server name, for internal & display use@*
hostname: name or IP address of server@*
port: port for server (integer)@*
password: password for server@*
nick1: first nick for server@*
nick2: alternate nick for server@*
nick3: second alternate nick for server@*
username: user name@*
realname: real name of user@*
@*
@item save [file]
@*
save config to disk@*
@*
file: filename for writing config@*
@*
@item set [option[=value]]
@*
set config parameters@*
@*
option: name of an option@*
value: value for option@*
@*
@item unalias alias_name
@*
remove an alias@*
@*
alias_name: name of alias to remove@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
manage windows@*
@*
list: list opened windows (no parameter implies this list)@*
splith: split current window horizontally@*
splitv: split current window vertically@*
merge: merge window with another@*
@*
@end table
IRC commands:@*
@table @kbd
@item admin [target]
@*
find information about the administrator of the server@*
@*
target: server@*
@*
@item away [-all] [message]
@*
toggle away status@*
@*
-all: toggle away status on all connected servers@*
message: message for away (if no message is given, away status is removed)@*
@*
@item ban [channel] [nickname [nickname ...]]
@*
bans nicks or hosts@*
@*
channel: channel for ban@*
nickname: user or host to ban@*
@*
@item ctcp nickname type
@*
send a ctcp message@*
@*
nickname: user to send ctcp to@*
type: "action" or "version"@*
@*
@item dcc action [nickname [file]]
@*
starts DCC (file or chat) or close chat@*
@*
action: 'send' (file) or 'chat' or 'close' (chat)@*
nickname: nickname to send file or chat@*
file: filename (on local host)@*
@*
@item dehalfop nickname [nickname]
@*
removes half channel operator status from nickname(s)@*
@*
@item deop nickname [nickname]
@*
removes channel operator status from nickname(s)@*
@*
@item devoice nickname [nickname]
@*
removes voice from nickname(s)@*
@*
@item die
@*
shutdown the server@*
@*
@item halfop nickname [nickname]
@*
gives half channel operator status to nickname(s)@*
@*
@item info [target]
@*
get information describing the server@*
@*
target: server name@*
@*
@item invite nickname channel
@*
invite a nick on a channel@*
@*
nickname: nick to invite@*
channel: channel to invite@*
@*
@item ison nickname [nickname ...]
@*
check if a nickname is currently on IRC@*
@*
nickname: nickname@*
@*
@item join channel[,channel] [key[,key]]
@*
join a channel@*
@*
channel: channel name to join@*
key: key to join the channel@*
@*
@item kick [channel] nickname [comment]
@*
forcibly remove a user from a channel@*
@*
channel: channel where user is@*
nickname: nickname to kick@*
comment: comment for kick@*
@*
@item kickban [channel] nickname [comment]
@*
kicks and bans a nick from a channel@*
@*
channel: channel where user is@*
nickname: nickname to kick and ban@*
comment: comment for kick@*
@*
@item kill nickname comment
@*
close client-server connection@*
@*
nickname: nickname@*
comment: comment for kill@*
@*
@item links [[server] server_mask]
@*
list all servernames which are known by the server answering the query@*
@*
server: this server should answer the query@*
server_mask: list of servers must match this mask@*
@*
@item list [channel[,channel] [server]]
@*
list channels and their topic@*
@*
channel: channel to list@*
server: server name@*
@*
@item lusers [mask [target]]
@*
get statistics about the size of the IRC network@*
@*
mask: servers matching the mask only@*
target: server for forwarding request@*
@*
@item me message
@*
send a ctcp action to the current channel@*
@*
message: message to send@*
@*
@item mode @{ channel @{[+|-]|o|p|s|i|t|n|b|v@} [limit] [user] [ban mask] @} | @{ nickname @{[+|-]|i|w|s|o@} @}
@*
change channel or user mode@*
@*
channel modes:@*
channel: channel name to modify@*
o: give/take channel operator privileges@*
p: private channel flag@*
s: secret channel flag@*
i: invite-only channel flag@*
t: topic settable by channel operator only flag@*
n: no messages to channel from clients on the outside@*
m: moderated channel@*
l: set the user limit to channel@*
b: set a ban mask to keep users out@*
v: give/take the ability to speak on a moderated channel@*
k: set a channel key (password)@*
user modes:@*
nickname: nickname to modify@*
i: mark a user as invisible@*
s: mark a user for receive server notices@*
w: user receives wallops@*
o: operator flag@*
@*
@item motd [target]
@*
get the "Message Of The Day"@*
@*
target: server name@*
@*
@item msg receiver[,receiver] text
@*
send message to a nick or channel@*
@*
receiver: nick or channel (may be mask, '*' = current channel)@*
text: text to send@*
@*
@item names [channel[,channel]]
@*
list nicknames on channels@*
@*
channel: channel name@*
@*
@item nick nickname
@*
change current nickname@*
@*
nickname: new nickname for current IRC server@*
@*
@item notice nickname text
@*
send notice message to user@*
@*
nickname: user to send notice to@*
text: text to send@*
@*
@item op nickname [nickname]
@*
gives channel operator status to nickname(s)@*
@*
@item oper user password
@*
get operator privileges@*
@*
user/password: used to get privileges on current IRC server@*
@*
@item part [channel[,channel]] [part_message]
@*
leave a channel@*
@*
channel: channel name to leave@*
part_message: part message (displayed to other users)@*
@*
@item ping server1 [server2]
@*
ping server@*
@*
server1: server to ping@*
server2: forward ping to this server@*
@*
@item pong daemon [daemon2]
@*
answer to a ping message@*
@*
daemon: daemon who has responded to Ping message@*
daemon2: forward message to this daemon@*
@*
@item query nickname [text]
@*
send a private message to a nick@*
@*
nickname: nickname for private conversation@*
text: text to send@*
@*
@item quit [quit_message]
@*
close all connections & quit@*
@*
quit_message: quit message (displayed to other users)@*
@*
@item quote data
@*
send raw data to server without parsing@*
@*
data: raw data to send@*
@*
@item rehash
@*
tell the server to reload its config file@*
@*
@item restart
@*
tell the server to restart itself@*
@*
@item service nickname reserved distribution type reserved info
@*
register a new service@*
@*
distribution: visibility of service@*
type: reserved for future usage@*
@*
@item servlist [mask [type]]
@*
list services currently connected to the network@*
@*
mask: list only services matching this mask@*
type: list only services of this type@*
@*
@item squery service text
@*
deliver a message to a service@*
@*
service: name of service@*
text: text to send@*
@*
@item squit server comment
@*
disconnect server links@*
@*
server: server name@*
comment: comment for quit@*
@*
@item stats [query [server]]
@*
query statistics about server@*
@*
query: c/h/i/k/l/m/o/y/u (see RFC1459)@*
server: server name@*
@*
@item summon user [target [channel]]
@*
give users who are on a host running an IRC server a message asking them to please join IRC@*
@*
user: username@*
target: server name@*
channel: channel name@*
@*
@item time [target]
@*
query local time from server@*
@*
target: query time from specified server@*
@*
@item topic [channel] [topic]
@*
get/set channel topic@*
@*
channel: channel name@*
topic: new topic for channel (if topic is "-delete" then topic is deleted)@*
@*
@item trace [target]
@*
find the route to specific server@*
@*
target: server@*
@*
@item unban [channel] nickname [nickname ...]
@*
unbans nicks or hosts@*
@*
channel: channel for unban@*
nickname: user or host to unban@*
@*
@item userhost nickname [nickname ...]
@*
return a list of information about nicknames@*
@*
nickname: nickname@*
@*
@item users [target]
@*
list of users logged into the server@*
@*
target: server@*
@*
@item version [server | nickname]
@*
gives the version info of nick or server (current or specified)@*
@*
server: server name@*
nickname: nickname@*
@*
@item voice nickname [nickname]
@*
gives voice to nickname(s)@*
@*
@item wallops text
@*
send a message to all currently connected users who have set the 'w' user mode for themselves@*
@*
text to send@*
@*
@item who [mask ["o"]]
@*
generate a query which returns a list of information@*
@*
mask: only information which match this mask@*
o: only operators are returned according to the mask supplied@*
@*
@item whois [server] nickname[,nickname]
@*
query information about user(s)@*
@*
server: server name@*
nickname: nickname (may be a mask)@*
@*
@item whowas nickname [,nickname [,nickname ...]] [count [target]]
@*
ask for information about a nickname which no longer exists@*
@*
nickname: nickname to search@*
count: number of replies to return (full search if negative number)@*
target: reply should match this mask@*
@*
@end table
@node FIFO pipe, , WeeChat commands, Usage
@section FIFO pipe
You can remote control WeeChat, by sending commands or text to a FIFO pipe
(you have to enable option "irc_fifo_pipe", it is disabled by default).@*
The FIFO pipe is located in ~/.weechat/ and is called "weechat_fifo_xxxxx"
(where xxxxx is the process ID (PID) of running WeeChat).@*
So if many WeeChat are running, you have many FIFO pipe, one for each session.@*
@*
The syntax for the FIFO pipe commands/text is:@*
@command{server,channel *text or command here}@*
where server and channel are optional, but if channel is here, server should be too.@*
@*
Some examples:
@table @asis
@item @bullet{} change your nick on freenode to "mynick|out":
@*
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on #weechat channel:
@*
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
@*
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
You can write a script to send command to all running WeeChat at same time, for example:@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
for fifo in $(/bin/ls ~/.weechat/weechat_fifo_* 2>/dev/null); do
echo -e "$1" >$fifo
done
fi
@end verbatim
@*
If the script is called "auto_weechat_command", you can run it with:@*
@command{./auto_weechat_command "freenode,#weechat *hello"}
@c ******************************* Extensions *********************************
@@ -718,7 +1336,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{@} }@*
@@ -743,11 +1362,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
@@ -789,15 +1432,6 @@ WeeChat is developed by:@*
@item
FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@item
Bounga
<@email{bounga@@altern.org, bounga AT altern.org}>
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -840,7 +1474,7 @@ Look for WeeChat support page for detail:@*
This manual documents WeeChat IRC client, it is part of WeeChat.@*
Copyright @copyright{} 2004 FlashCode
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
@*
This document may be used under the terms the GNU General Public License
File diff suppressed because it is too large Load Diff
+703 -65
View File
@@ -6,7 +6,7 @@
@c WeeChat documentation (french version)
@c
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
@c Copyright (c) 2005 by FlashCode <flashcode@flashtux.org>
@c
@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
@@ -35,7 +35,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.0.7 - 04 juillet 2004
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
@image{weechat_image}
@@ -48,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{} 2004 FlashCode
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
@*
Ce document peut @^etre utilis@'e sous les termes de la licence GNU General Public
@@ -209,6 +209,7 @@ Suivez alors les instructions du paquet sources - @xref{Paquet source}.
* Fichier de configuration::
* Raccourcis clavier::
* Commandes WeeChat::
* Tube FIFO::
@end menu
@node Lancer WeeChat, Fichier de configuration, Utilisation, Utilisation
@@ -247,6 +248,7 @@ vous pouvez modifier les param@`etres dans WeeChat avec la commande @kbd{/set} -
Liste des options du fichier de configuration :@*
@table @kbd
@item look_set_title
D@'efinit le titre de la fen@^etre (terminal pour l'interface Curses) avec le nom et la version@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -259,6 +261,15 @@ 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_charset_decode
Jeu de caract@`eres pour d@'ecoder les messages du serveur, exemples: UTF-8, ISO-8859-1 (si non renseign@'e, les messages ne sont pas convertis)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'UTF-8'@*
@item look_charset_encode
Jeu de caract@`eres pour encoder les messages envoy@'es au serveur, exemples: UFT-8, ISO-8859-1 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item look_charset_internal
Jeu de caract@`eres interne @`a WeeChat, devrait @^etre ISO-xxxx m@^eme si la locale est UTF-8 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'ISO-8859-1'@*
@item look_color_nicks
Afficher les utilisateurs avec diff@'erentes couleurs@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -297,22 +308,22 @@ 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'@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%B, %A %d %Y - %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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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'@*
@@ -342,16 +353,19 @@ 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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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: 'lightred'@*
@item col_status_highlight
Color for window with highlight (status bar)@*
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: 'lightmagenta'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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'@*
@@ -369,7 +383,7 @@ 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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_input_channel
Couleur pour le texte saisi (nom du canal)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@@ -381,7 +395,16 @@ 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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_nick_away
Couleur pour les pseudos absents@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
@item col_nick_chanowner
Couleur pour le symbole du propri@'etaire du canal (sp@'ecifique @`a unrealircd)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_nick_chanadmin
Couleur pour le symbole administrateur du canal (sp@'ecifique @`a unrealircd)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_nick_op
Couleur pour le symbole op@'erateur@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@@ -399,55 +422,106 @@ 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'@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@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: 'lightcyan'@*
@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_channels
@item log_auto_server
Enregistrer automatiquement les messages du serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item log_auto_channel
Enregistrer automatiquement les conversations des canaux@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item log_auto_private
Enregistrer automatiquement les conversations priv@'ees@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item log_plugin_msg
Enregistrer les messages des plugins (scripts)@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@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_name
Nom des conversations saivegard@'ees (%S == nom du serveur irc, %N == nom du canal (ou pseudo si fen@^etre priv@'ee)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%S,%N.weechatlog'@*
@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: '~'@*
@item log_start_string
Texte @'ecrit en d@'emarrant la sauvegarde d'une discussion (voir man strftime pour le format de date/heure)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '--- Log started %a %b %d %Y %H:%M:%s'@*
@item log_end_string
Texte @'ecrit @`a la fin d'une discussion sauvegard@'ees (voir man strftime pour le format de date/heure)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '--- Log ended %a %b %d %Y %H:%M:%s'@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '%Y %b %d %H:%M:%S'@*
@item log_hide_nickserv_pwd
Masquer le mot de passe affich@'e par nickserv@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item irc_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 irc_default_msg_away
Message par d@'efaut pour l'absence@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'away'@*
@item irc_default_msg_part
Message par d@'efaut pour le part (quitte un canal)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item irc_default_msg_quit
Message de fin par d@'efaut ('%v' sera remplac@'e par la version de WeeChat dans la cha@^ine)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'WeeChat %v'@*
@item irc_away_check
Intervalle entre deux v@'erifications des absences (en minutes, 0 = ne jemais v@'erifier)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 0@*
@item irc_lag_check
Intervalle entre deux mesures de lag (en secondes)@*
Type: entier (valeurs: entre 30 et 2147483647), valeur par d@'efaut: 60@*
@item irc_lag_min_show
Lag minimum @`a afficher (en secondes)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 1@*
@item irc_lag_disconnect
D@'econnexion apr@`es un lag important (en minutes, 0 = ne jamais se d@'econnecter)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 5@*
@item irc_fifo_pipe
Cr@'eer un tube FIFO pour le contr@^ole @`a distance@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item dcc_auto_accept_files
Accepte automatiquement les fichiers dcc entrants@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item dcc_auto_accept_max_size
Taille maximum pour un fichier entrant lorsqu'il est accept@'e automatiquement@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 0@*
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'@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@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: 65536)@*
Type: entier (valeurs: entre 1024 et 102400), valeur par d@'efaut: 65536@*
@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_convert_spaces
Convertir les espaces en underscores lors d'envoi de fichiers@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@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'@*
@@ -472,6 +546,12 @@ 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_autoreconnect
Reconnexion automatique au serveur apr@`es une d@'econnexion@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item server_autoreconnect_delay
D@'elai (en secondes) avant de tenter une reconnexion au serveur@*
Type: entier (valeurs: entre 0 et 65535), valeur par d@'efaut: 30@*
@item server_address
Adresse IP ou nom du serveur IRC@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@@ -499,9 +579,16 @@ 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_command_delay
D@'elai (en secondes) apr@`es ex@'ecution de la commande (exemple: donner du temps pour l'authentification)@*
Type: entier (valeurs: entre 0 et 5), valeur par d@'efaut: 0@*
@item server_autojoin
Liste des canaux (s@'epar@'es par des virgules) @`a rejoindre lorsque connect@'e au serveur@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
@item server_autorejoin
Rejoindre automatiquement les canaux quand mis dehors@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@end table
Les couleurs pour l'interface Curses sont :@*
@@ -535,8 +622,6 @@ Les couleurs pour l'interface Curses sont :@*
@item
@kbd{lightcyan}: cyan clair
@item
@kbd{gray}: gris
@item
@kbd{white}: blanc
@end itemize
@@ -550,13 +635,16 @@ Aller au caract@`ere pr@'ec@'edent / suivant sur la ligne de commande@*
@item Ctrl + fl@`eche gauche / Ctrl + fl@`eche droite
Aller au mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@item Home / End
Aller au d@'ebut / @`a la fin de la ligne de commande@*
@item Home / Ctrl + A
Aller au d@'ebut de la ligne de commande@*
@*
@item End / Ctrl + E
Aller @`a la fin de la ligne de commande@*
@*
@item Backspace / Delete
Effacer le mot pr@'ec@'edent / suivant sur la ligne de commande@*
@*
@item Ctrl + Backspace
@item Ctrl + Backspace / Ctrl + W
Effacer le mot pr@'ec@'edent sur la ligne de commande@*
@*
@item Tab
@@ -574,30 +662,564 @@ Rappeler les derni@`eres commandes/messages@*
@item PageUp / PageDown
Afficher l'historique du tampon@*
@*
@item F6 / F7
Aller au tampon pr@'ec@'edent@*
@item F5 / F6
Aller au tampon pr@'ec@'edent / suivant@*
@*
@item F8
Aller @`a la fen@^etre suivante@*
@*
@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 + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@item F7 / F8
Aller @`a la fen@^etre pr@'ec@'edente / suivante@*
@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
Identique @`a F5 / F6@*
@*
@item Alt + A
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
@*
@item Alt + D
Afficher les DCC en cours@*
@*
@item Alt + R
Vide la hotlist (notification d'activité sur les autres tampons)@*
@*
@item Alt + S
Sauter au tampon du serveur@*
@*
@item Alt + X
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
@*
@item Alt + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@*
@end table
@node Commandes WeeChat, , Raccourcis clavier, Utilisation
@node Commandes WeeChat, Tube FIFO, Raccourcis clavier, Utilisation
@section Commandes WeeChat
NON ECRIT !
Commandes internes WeeChat :@*
@table @kbd
@item alias [nom_alias [commande [param@`etres]]
@*
cr@'eer un alias pour une commande@*
@*
nom_alias: nom de l'alias@*
commande: nom de la commande (commande WeeChat ou IRC, sans le premier '/')@*
param@`etres: param@`etres pour la commande@*
@*
@item buffer [action | nombre]
@*
gestion des buffers@*
@*
action: action @`a effectuer:@*
move: d@'eplacer le tampon dans la liste (peut @^etre relatif, par exemple -1)@*
close: fermer le tampon (pour un canal: @'equivalent @`a /part sans message de fin)@*
list: liste les tampons ouverts (pas de param@`etre affiche cette liste)@*
notify: fixer le niveau de notification (0=jamais, 1=highlight, 2=1+msg, 3=2+join/part)@*
nombre: sauter au tampon qui a ce num@'ero@*
@*
@item clear [-all]
@*
affacer la/les fen@^etre(s)@*
@*
-all: effacer toutes les fen@^etres@*
@*
@item connect [nom_serveur]
@*
se connecter @`a un serveur@*
@*
nom_serveur: nom du serveur pour se connecter@*
@*
@item disconnect [nom_serveur]
@*
se d@'econnecter d'un serveur@*
@*
nom_serveur: nom du serveur pour se d@'econnecter@*
@*
@item debug dump
@*
affiche des messages de debuggage@*
@*
dump: affiche les variables m@'emoire WeeChat dans le fichier log (les m@^emes messages sont affich@'es lorsque WeeChat plante)@*
@*
@item help [commande]
@*
afficher l'aide sur les commandes@*
@*
commande: nom d'une commande WeeChat ou IRC@*
@*
@item perl [load fichier] | [autoload] | [unload]
@*
liste/charge/d@'echarge des scripts Perl@*
@*
fichier: script Perl (fichier) @`a charger@*
Sans param@`etre, la commande /perl liste tous les scripts Perl charg@'es.@*
@*
@item server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-pwd mot_de_passe] [-nicks pseudo1 [pseudo2 [pseudo3]]] [-username nom_utilisateur] [-realname nom_r@'eel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]
@*
liste, ajoute ou retire des serveurs@*
@*
nom_serveur: nom du serveur, pour usage interne et affichage@*
nom/IP: nom ou adresse IP du serveur@*
port: port pour le serveur (nombre entier)@*
mot_de_passe: mot de passe pour le serveur@*
pseudo1: premier pseudo pour le serveur@*
pseudo2: pseudo alternatif pour le serveur@*
pseudo3: second pseudo alternatif pour le serveur@*
nom_utilisateur: nom d'utilisateur@*
nom_r@'eel: nom r@'eel de l'utilisateur@*
@*
@item save [fichier]
@*
sauvegarder la configuration sur disque@*
@*
fichier: fichier pour sauvegarder la configuration@*
@*
@item set [option[=valeur]]
@*
modifier des param@`etres de configuration@*
@*
option: nom d'une option@*
valeur: valeur pour l'option@*
@*
@item unalias nom_alias
@*
supprimer un alias@*
@*
nom_alias: nom de l'alias @`a supprimer@*
@*
@item window [list | splith | splitv | [merge [down | up | left | right | all]]]
@*
gestion des fen@^etres@*
@*
list: liste les fen@^etres ouvertes (pas de param@`etre affiche cette liste)@*
splith: @'eclate la fen@^etre en deux horizontalement@*
splitv: @'eclate la fen@^etre en deux verticalement@*
merge: fusionne la fen@^etre avec une autre@*
@*
@end table
Commandes IRC :@*
@table @kbd
@item admin [cible]
@*
trouver les informations sur l'administrateur du serveur@*
@*
cible: serveur@*
@*
@item away [-all] [message]
@*
basculer le statut absent@*
@*
-all: basculer le statut absent sur tous les serveurs connect@'es@*
message: message pour l'absence (si pas de message donn@'e, le statut d'absence est supprim@'e)@*
@*
@item ban [canal] [pseudo [pseudo ...]]
@*
bannit des pseudos ou masques@*
@*
canal: nom du canal pour le bannissement@*
pseudo: pseudo ou masque pour le bannissement@*
@*
@item ctcp pseudo type
@*
envoyer un message ctcp@*
@*
pseudo: utilisateur pour envoyer le ctcp@*
type: "action" ou "version"@*
@*
@item dcc action [pseudo [fichier]]
@*
d@'emarre le DCC (fichier ou discussion) ou ferme une discussion@*
@*
action: 'send' (envoi de fichier) ou 'chat' (discussion) ou 'close' (fermeture discussion)@*
pseudo: pseudo pour envoyer le fichier ou discuter@*
fichier: nom du fichier (sur la machine locale)@*
@*
@item dehalfop pseudo [pseudo]
@*
retire le statut de demi-op@'erateur du canal @`a/aux nick(s)@*
@*
@item deop pseudo [pseudo]
@*
retire le statut d'op@'erateur du canal @`a/aux nick(s)@*
@*
@item devoice pseudo [pseudo]
@*
retire la voix du/des pseudo(s)@*
@*
@item die
@*
arr@^eter le serveur@*
@*
@item halfop pseudo [pseudo]
@*
donner le statut de demi-op@'erateur @`a un/des utilisateur(s)@*
@*
@item info [cible]
@*
voir les informations d@'ecrivant le serveur@*
@*
cible: nom du serveur@*
@*
@item invite pseudo canal
@*
inviter un utilisateur sur un canal@*
@*
pseudo: utilisateur @`a inviter@*
channel: canal pour l'invitation@*
@*
@item ison pseudo [pseudo ...]
@*
v@'erifier si un utilisateur est actuellement sur IRC@*
@*
pseudo: pseudo@*
@*
@item join canal[,canal] [cl@'e[,cl@'e]]
@*
joindre un canal@*
@*
canal: nom du canal @`a rejoindre@*
cl@'e: cl@'e pour rejoindre le canal@*
@*
@item kick [canal] pseudo [commentaire]
@*
retirer par la force un utilisateur d'un canal@*
@*
canal: canal o@`u l'utilisateur se trouve@*
pseudo: utilisateur @`a @'eliminer@*
commentaire: commentaire pour l'@'elimination@*
@*
@item kickban [canal] pseudo [commentaire]
@*
retirer par la force un utilisateur d'un canal et le bannir@*
@*
canal: canal o@`u l'utilisateur se trouve@*
pseudo: utilisateur @`a @'eliminer et bannir@*
commentaire: commentaire pour l'@'elimination@*
@*
@item kill pseudo commentaire
@*
fermer la connexion client-serveur@*
@*
pseudo: utilisateur@*
commentaire: commentaire pour la mort@*
@*
@item links [[serveur] masque_serveur]
@*
lister tous les noms de serveurs connus du serveur qui r@'epondent @`a la requ@^ete@*
@*
serveur: ce serveur doit r@'epondre @`a la requ@^ete@*
masque_serveur: liste des serveurs correspondant au masque@*
@*
@item list [canal[,canall] [serveur]]
@*
lister les canaux et leur sujet@*
@*
canal: canal @`a lister@*
serveur: nom du serveur@*
@*
@item lusers [masque [cible]]
@*
obtenir des statistiques sur la taille du r@'eseau IRC@*
@*
masque: serveurs qui correspondent au masque seulement@*
cible: serveur pour faire suivre la requ@^ete@*
@*
@item me message
@*
envoyer une action ctcp au canal courant@*
@*
message: message @`a envoyer@*
@*
@item mode @{ canal @{[+|-]|o|p|s|i|t|n|b|v@} [limite] [utilisateur] [masque de banissement] @} | @{ nick @{[+|-]|i|w|s|o@} @}
@*
changer le mode du canal ou de l'utilisateur@*
@*
modes de canaux :@*
canal: nom du canal @`a modifier@*
o: donner/reprendre le statut privil@'egi@'e d'op@'erateur@*
p: indicateur de canal priv@'e@*
s: indicateur de canal secret@*
i: indicateur de canal avec invitation seulement@*
t: le titre est modifiable seulement par un op@'erateur du canal@*
n: aucun message au canal depuis l'ext@'erieur@*
m: canal mod@'er@'e@*
l: fixer la limite d'utilisateurs pour le canal@*
b: param@'etrer un masque de banissement pour garder des utilisateurs dehors@*
v: donner/reprendre la possibilit@'e de parler sur un canal mod@'er@'e@*
k: d@'efinir une cl@'e (mot de passe) pour acc@'eder au canal@*
modes utilisateur :@*
pseudo: utilisateur @`a modifier@*
i: marquer un utilisateur comme invisible@*
s: marquer un utilisateur pour recevoir les notices du serveur@*
w: l'utilisateur re@,{c}oit les wallops@*
o: drapeau op@'erateur@*
@*
@item motd [cible]
@*
obtenir le message du jour@*
@*
cible: nom du serveur@*
@*
@item msg cible[,cible] texte
@*
envoyer un message @`a un utilisateur ou canal@*
@*
cible: utilisateur ou canal (peut-@^etre un masque, '*' = canal courant)@*
texte: texte @`a envoyer@*
@*
@item names [canal[,canal]]
@*
lister les utilisateurs sur des canaux@*
@*
canal: nom du canal@*
@*
@item nick pseudo
@*
changer le pseudo courant@*
@*
pseudo: nouveau pseudo pour le serveur IRC courant@*
@*
@item notice pseudo texte
@*
envoyer un message notice @`a un utilisateur@*
@*
pseudo: utilisateur cible pour la notice@*
texte: texte @`a envoyer@*
@*
@item op pseudo [pseudo]
@*
donner le statut op@'erateur @`a un/des utilisateur(s)@*
@*
@item oper utilisateur mot_de_passe
@*
obtenir le statut d'op@'erateur@*
@*
utilisateur/mot_de_passe: utilis@'e pour obtenir les privil@`eges sur le serveur IRC courant@*
@*
@item part [canal[,canall] [message_de_fin]
@*
quitter un canal@*
@*
canal: canal @`a quitter@*
message_de_fin: message de fin (affich@'e aux autres utilisateurs)@*
@*
@item ping serveur1 [serveur2]
@*
pinguer un serveur@*
@*
serveur1: serveur @`a pinguer@*
serveur2: faire suivre le ping @`a ce serveur@*
@*
@item pong d@'emon [d@'emon2]
@*
r@'epondre @`a un message ping@*
@*
d@'emon: d@'emon qui a r@'epondu au message Ping@*
d@'emon2: faire suivre le message @`a ce d@'emon@*
@*
@item query pseudo [texte]
@*
envoyer un message priv@'e @`a un utilisateur@*
@*
pseudo: utilisateur pour la conversation priv@'ee@*
texte: texte @`a envoyer@*
@*
@item quit [message_de_fin]
@*
fermer toutes les connexions et quitter@*
@*
message_de_fin: message de fin (affich@'e aux autres utilisateurs)@*
@*
@item quote donn@'ees
@*
envoyer des donn@'ees brutes au serveur sans analyse@*
@*
donn@'ees: donn@'ees brutes @`a envoyer@*
@*
@item rehash
@*
demander au serveur de recharger son fichier de configuration@*
@*
@item restart
@*
demander au serveur de red@'emarrer@*
@*
@item service pseudo r@'eserv@'e distribution type r@'eserv@'e info
@*
enregister un nouveau service@*
@*
distribution: visibilit@'e du service@*
type: r@'eserv@'e pour une utilisation future@*
@*
@item servlist [masque [type]]
@*
lister les services actuellement connect@'es au r@'eseau@*
@*
masque: lister seulement les services qui correspondent @`a ce masque@*
type: lister seulement les services de ce type@*
@*
@item squery service texte
@*
envoyer un message @`a un service@*
@*
service: nom du service@*
texte: texte @`a envoyer@*
@*
@item squit serveur commentaire
@*
d@'econnecter les liens vers un serveur@*
@*
serveur: nom du serveur@*
commentaire: commentaire pour quitter@*
@*
@item stats [requ@^ete [serveur]]
@*
demander des statistiques sur le serveur@*
@*
requ@^ete: c/h/i/k/l/m/o/y/u (voir la RFC1459)@*
serveur: nom du serveur@*
@*
@item summon utilisateur [cible [canal]]
@*
envoyer aux utilisateurs d'un serveur IRC un message leur demandant de rejoindre IRC@*
@*
utilisateur: nom d'utilisateur@*
cible: nom du serveur@*
canal: nom du canal@*
@*
@item time [cible]
@*
demander l'heure locale de serveur@*
@*
cible: demander l'heure de ce serveur@*
@*
@item topic [canal] [titre]
@*
recevoir/d@'efinir le titre du canal@*
@*
canal: nom du canal@*
titre: nouveau titre pour le canal (si le titre est "-delete" alors le titre est supprim@'e)@*
@*
@item trace [cible]
@*
trouver le chemin jusqu'@`a un serveur sp@'ecifique@*
@*
cible: serveur@*
@*
@item unban [canal] pseudo [pseudo ...]
@*
supprime le bannissement sur des pseudos ou masques@*
@*
canal: nom du canal pour supprimer le bannissement@*
pseudo: pseudo ou masque pour supprimer le bannissement@*
@*
@item userhost pseudo [pseudo ...]
@*
retourne une liste d'informations sur des utilisateurs@*
@*
pseudo: pseudo@*
@*
@item users [cible]
@*
liste des utilisateurs connect@'es au serveur@*
@*
cible: serveur@*
@*
@item version [serveur | pseudo]
@*
retourne la version de l'utilisateur ou du serveur (courant ou sp@'ecifi@'e)@*
@*
serveur: nom du serveur@*
pseudo: utilisateur@*
@*
@item voice pseudo [pseudo]
@*
donne la voix @`a/aux utilisateur(s)@*
@*
@item wallops texte
@*
envoyer un message @`a tous les utilisateurs connect@'es qui ont activ@'e le mode utilisateur 'w' pour eux-m@^emes@*
@*
texte @`a envoyer@*
@*
@item who [masque ["o"]]
@*
g@'en@`ere une requ@^ete qui retourne une liste d'information@*
@*
masque: information qui correspond @`a ce masque uniquement@*
o: seul les op@'erateurs sont retourn@'es correspondant au masque fourni@*
@*
@item whois [serveur] pseudo[,pseudo]
@*
demande les informations sur le(s) utilisateur(s)@*
@*
serveur: nom du serveur@*
pseudo: utilisateur (peut @^etre un masque)@*
@*
@item whowas pseudo [,pseudo [,pseudo ...]] [nombre [cible]]
@*
demander de l'information sur un nick qui n'existe plus@*
@*
pseudo: pseudo @`a chercher@*
nombre: nombre de r@'eponses @`a retourner (recherche compl@`ete si nombre n@'egatif)@*
cible: la r@'eponse doit correspondre @`a ce masque@*
@*
@end table
@node Tube FIFO, , Commandes WeeChat, Utilisation
@section Tube FIFO
Vous pouvez contr@^oler WeeChat @`a distance, en envoyant des commandes ou du
texte dans un tube FIFO (l'option "irc_fifo_pipe" doit @^etre activ@'ee, elle
est d@'esactiv@'ee par d@'efaut).@*
Le tube FIFO est dans le r@'epertoire ~/.weechat/ et s'appelle "weechat_fifo_xxxxx"
(o@`u xxxxx est l'ID du processus (PID) du WeeChat qui tourne).@*
Donc si plusieurs WeeChat tournent, vous avez plusieurs tubes FIFO, un pour
chaque session.@*
@*
La syntaxe pour envoyer des commandes ou du texte dans le tube FIFO est la suivante :@*
@command{serveur,canal *texte ou commande ici}@*
o@`u le serveur et le canal sont facultatifs, mais si le canal est l@`a, le
serveur doit l'@^etre aussi.@*
@*
Quelques exemples :
@table @asis
@item @bullet{} changement du pseudo sur freenode en "pseudo|absent":
@command{echo "freenode */nick pseudo|absent" >~/.weechat/weechat_fifo_12345}
@item @bullet{} affichage de texte sur le canal #weechat :
@command{echo "freenode,#weechat *bonjour tout le monde !" >~/.weechat/weechat_fifo_12345}
@item @bullet{} affichage de texte sur le canal courant (le tampon affich@'e par WeeChat):
@command{echo "*bonjour !" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Attention :} ceci est dangereux et vous ne devriez pas le faire sauf si vous savez ce que vous faites !
@item @bullet{} envoyer deux commandes pour décharger/recharger les scripts Perl (vous devez les séparer par \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
Vous pouvez @'ecrire un script qui envoie les commandes @`a tous les WeeChat qui
tournent en m@^eme temps, par exemple :@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
for fifo in $(/bin/ls ~/.weechat/weechat_fifo_* 2>/dev/null); do
echo -e "$1" >$fifo
done
fi
@end verbatim
@*
Si le script s'appelle "auto_weechat_command", vous pouvez le lancer ainsi :@*
@command{./auto_weechat_command "freenode,#weechat *bonjour"}
@c ******************************* Extensions *********************************
@@ -719,7 +1341,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{@} }@*
@@ -744,11 +1367,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
@@ -789,15 +1436,6 @@ WeeChat est d@'evelopp@'e par :@*
@item
FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@item
Bounga
<@email{bounga@@altern.org, bounga AT altern.org}>
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -840,7 +1478,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{} 2004 FlashCode
Copyright @copyright{} 2005 FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>@*
@*
Ce document peut @^etre utilis@'e sous les termes de la licence GNU General Public
+107 -27
View File
@@ -6,7 +6,7 @@
@c WeeChat documentation (vers@~ao partuguesa)
@c
@c Copyright (c) 2004 by FlashCode <flashcode@flashtux.org>
@c Copyright (c) 2005 by FlashCode <flashcode@flashtux.org>
@c
@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
@@ -35,7 +35,7 @@
@title WeeChat - Guia do Utilizador
@subtitle Cliente de IRC rapido, leve e extencivel
@subtitle Documenta@,{c}@~ao do WeeChat v0.0.7 - 04 de Julho de 2004
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.1 - 20 de Mar@,{c}o de 2005
@image{weechat_image}
@@ -48,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{} 2004 FlashCode
Copyright @copyright{} 2005 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
@@ -206,6 +206,7 @@ Segue agora as instru@,{c}@~oes para compilar o c@'odigo fonte - @xref{Codigo Fo
* Invocar o WeeChat::
* Recursos de teclado::
* Comandos do WeeChat::
* FIFO pipe::
@end menu
@node Invocar o WeeChat, Recursos de teclado, Utilizacao, Utilizacao
@@ -247,13 +248,16 @@ Ir um caractere para traz / para a frente na linha de comando@*
@item Ctrl + Seta esquerda / Ctrl + Seta Direita
Ir uma palavra para traz / para a frente na linha de comando@*
@*
@item Home / End
Ir para o in@'icio / para o fim da linha de comando@*
@item Home / Ctrl + A
Ir para o in@'icio da linha de comando@*
@*
@item End / Ctrl + E
Ir para o fim da linha de comando@*
@*
@item Backspace / Delete
Apagar o caractere anterior / seguinte na linha de comando@*
@*
@item Ctrl + Backspace
@item Ctrl + Backspace / Ctrl + W
Apagar a palavra anterior na linha de comando
@*
@item Tab
@@ -271,28 +275,89 @@ Repetir os ultimos comandos/mensagens@*
@item PageUp / PageDown
Navegar no hist@'orico da janela@*
@*
@item F6 / F7
Ir para a janela anterior/seguinte@*
@item F5 / F6
Comute ao amortecedor 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 F7 / F8
Comute ao janela anterior / seguinte@*
@*
@item F10
Apagar a @'ultima mensagem da barra do info@*
@*
@item Ctrl + L
Redesenhe a janela inteira@*
@*
@item Alt + Seta da esquerda / Alt + Seta da direita
Identico a F5 / F6@*
@*
@item Alt + A
Comute ao amortecedor seguinte com atividade (com prioridade: destaque, mensagem, outra)@*
@*
@item Alt + D
Exposi@,{c}@~ao DCC atual@*
@*
@item Alt + R
Hotlist desobstru@'ido (notifica@,{c}@~ao da atividade em outros amortecedores)@*
@*
@item Alt + S
Comute ao amortecedor do servidor@*
@*
@item Alt + X
Comute @`a primeira canaleta do servidor seguinte (ou do amortecedor do servidor se nenhuma canaleta for aberta)@*
@*
@item Alt + d@'igito (1-9)
Comute ao amortecedor pelo n@'umero@*
@*
@end table
@node Comandos do WeeChat, , Recursos de teclado, Utilizacao
@node Comandos do WeeChat, FIFO pipe, Recursos de teclado, Utilizacao
@section Comandos do WeeChat
N@~AO ESCRITO !
@node FIFO pipe, , Comandos do WeeChat, Utilizacao
@section FIFO pipe
You can remote control WeeChat, by sending commands or text to a FIFO pipe
(you have to enable option "irc_fifo_pipe", it is disabled by default).@*
The FIFO pipe is located in ~/.weechat/ and is called "weechat_fifo_xxxxx"
(where xxxxx is the process ID (PID) of running WeeChat).@*
So if many WeeChat are running, you have many FIFO pipe, one for each session.@*
@*
The syntax for the FIFO pipe commands/text is:@*
@command{server,channel *text or command here}@*
where server and channel are optional, but if channel is here, server should be too.@*
@*
Some examples:
@table @asis
@item @bullet{} change your nick on freenode to "mynick|out":
@*
@command{echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on #weechat channel:
@*
@command{echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345}
@item @bullet{} display text on current channel (buffer displayed by WeeChat):
@*
@command{echo "*hello!" >~/.weechat/weechat_fifo_12345}@*
@*
@b{Warning:} this is dangerous and you should not do that except if you know what you do!
@item @bullet{} send 2 commands to unload/reload Perl scripts (you have to separate them with \n):
@command{echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345}
@end table
@*
You can write a script to send command to all running WeeChat at same time, for example:@*
@verbatim
#!/bin/sh
if [ $# -eq 1 ]; then
for fifo in $(/bin/ls ~/.weechat/weechat_fifo_* 2>/dev/null); do
echo -e "$1" >$fifo
done
fi
@end verbatim
@*
If the script is called "auto_weechat_command", you can run it with:@*
@command{./auto_weechat_command "freenode,#weechat *hello"}
@c ******************************* Extencoes *********************************
@@ -438,6 +503,30 @@ Este nome pode pertencer a um comando j
@code{@} }@*
@*
@item
@command{IRC::get_info ( [servidor,] nome );}@*
@*
Comece o v@'ario info sobre WeeChat, servidor ou usu@'ario.@*
@emph{Argumentos:}
@itemize @minus
@item @option{servidor}: nome interno da servidor
@item @option{nome}: nome do info a recuperar:
@itemize @minus
@item @option{0 ou version}: comece a vers@~ao de WeeChat
@item @option{1 ou nick}: comece o nickname
@item @option{2 ou channel}: comece o nome da canal
@item @option{3 ou server}: comece o nome do servidor
@item @option{4 ou weechatdir}: comece a WeeChat o diret@'orio home
@item @option{5 ou away}: comece a bandeira ausente para o servidor
@end itemize
@end itemize
@*
@emph{Exemplos:}@*
@code{$version = get_info("version");}@*
@code{$nick = get_info("freenode", "nick");}@*
@*
@end itemize
@node Scripts Python, Scripts Ruby, Scripts Perl, Extencoes
@@ -479,15 +568,6 @@ O WeeChat @'e desenvolvido por :@*
@item
FlashCode
<@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@item
Bounga
<@email{bounga@@altern.org, bounga AT altern.org}>
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -528,7 +608,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{} 2004 FlashCode
Copyright @copyright{} 2005 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}>@*
@*
Binary file not shown.

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