1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-21 02:16:38 +02:00

Compare commits

..

65 Commits

Author SHA1 Message Date
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
132 changed files with 9054 additions and 3748 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ Bounga <bounga@altern.org>
Jabber: Bounga@jabber.org
ICQ : 178297842
Xahlexx <xahlexx@tuxisland.org>
Web : http://www.tuxisland.org
Xahlexx <xahlexx@weeland.org>
Web : http://www.weeland.org
IRC : nick is "xahlexx"
+2 -5
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2004-08-08
WeeChat known bugs, 2005-01-01
- ./configure does not check that Curses headers are installed
- ./configure does not check that Gtk 2.0 libraries are installed
@@ -10,12 +10,9 @@ WeeChat known bugs, 2004-08-08
- problem when resizing terminal and that some windows are outside new term size
- some IRC commands are marked as 'unknown' when received
(IRC protocol is under dev!)
- too much opened channels => display bug
- when kicked, channel is not prefixed by '(' and sufixed by ')'
- when function key (non used by WeeChat) is pressed, prompt is deleted
- when quitting WeeChat term title is not restored (if look_set_title is ON)
- command name for /server can not contain spaces
- wrong alias is not created and not saved when quitting WeeChat
- when many WeeChat are launched, log file is not properly written (cleared by
each WeeChat at startup)
- display problems with old Konsole versions (Kde terminal)
- display problems with old Konsole versions (Kde terminal) (???)
+34 -1
View File
@@ -1,9 +1,42 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2004-08-08
ChangeLog - 2005-01-01
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
+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 : 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
+8
View File
@@ -1,6 +1,14 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* 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 -3
View File
@@ -24,7 +24,7 @@ Copyright
WeeChat (c) Copyright 2004
by: FlashCode <flashcode@flashtux.org>
Xahlexx <xahlex@tuxisland.org>
Xahlexx <xahlex@weeland.org>
Bounga <bounga@altern.org>
(see AUTHORS file if you want to contact authors)
@@ -46,6 +46,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
---
(1) only curses interface is available today
(2) plugin interfaces are not yet developed
(1) only Curses interface is available today
(2) only Perl interface is available today
(3) only GNU/Linux version is available today
+3 -6
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2004-08-08
TODO - 2005-01-01
Legend:
# done
@@ -10,7 +10,7 @@ Legend:
? is this really necessary?
v0.0.8:
v0.0.9:
------
* General:
@@ -21,8 +21,6 @@ v0.0.8:
+ "/dcc" command (for chat and sending/receiving files)
* 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)
+ internationalization (traduce WeeChat in many languages)
@@ -67,8 +65,7 @@ Future versions:
- 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
- tab key with empty command line should switch to next window (like F7)
? Qt GUI
* TCP/IP communication:
+9 -5
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.0.9, 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.0.9])
# Checks for programs.
AC_PROG_CC
@@ -108,10 +108,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
+12
View File
@@ -1,3 +1,15 @@
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.
+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, 01 Jan 2005 13: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:
+5 -6
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
@@ -50,10 +47,9 @@ install: build
binary-indep: build install
dh_testdir -pweechat-common
dh_testroot -pweechat-common
dh_installchangelogs -pweechat-common
dh_installchangelogs ChangeLog -pweechat-common
dh_installdocs -pweechat-common
dh_installexamples -pweechat-common
dh_installman weechat.1 -pweechat-common
dh_compress -pweechat-common
dh_fixperms -pweechat-common
dh_installdeb -pweechat-common
@@ -66,6 +62,9 @@ binary-indep: build install
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installchangelogs -a
dh_installdocs -a
dh_installman weechat-curses.1 -pweechat-curses
dh_link -a
dh_strip -a
dh_compress -a
-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
+109 -33
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.0.9 - January, 01 2005
@image{weechat_image}
@@ -48,7 +48,7 @@ This manual documents WeeChat IRC client, it is part of WeeChat.@*
Latest version of this document can be found on this page:@*
@uref{http://weechat.flashtux.org/doc.php?lang=en}@*
@*
Copyright @copyright{} 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
@@ -292,6 +292,9 @@ Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item look_nick_completor
The string inserted after nick completion@*
Type: string (any string), default value: ':'@*
@item look_display_away
Display message to all channels when (un)marking as away@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item look_infobar
Enable info bar@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -343,15 +346,18 @@ Type: color (Curses or Gtk color), default value: 'default'@*
@item col_status
Color for status bar@*
Type: color (Curses or Gtk color), default value: 'gray'@*
@item col_status_delimiters
Color for status bar delimiters@*
Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_status_data_msg
Color for window with new messages (status bar)@*
Type: color (Curses or Gtk color), default value: '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: 'gray'@*
@item col_status_more
Color for window with new data (status bar)@*
Type: color (Curses or Gtk color), default value: 'white'@*
@@ -403,13 +409,37 @@ Type: color (Curses or Gtk color), default value: 'gray'@*
@item col_nick_bg
Background for nicknames@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_chat_dcc_selected
Color for selected DCC (chat window)@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_dcc_waiting
Color for "waiting" dcc status@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_dcc_connecting
Color for "connecting" dcc status@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_dcc_active
Color for "active" dcc status@*
Type: color (Curses or Gtk color), default value: 'lightblue'@*
@item col_dcc_done
Color for "done" dcc status@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_dcc_failed
Color for "failed" dcc status@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_dcc_aborted
Color for "aborted" dcc status@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item history_max_lines
Maximum number of lines in history for one server/channel/private window (0 = unlimited)@*
Type: integer (values: between 0 and 2147483647), default value: 4096@*
@item history_max_commands
Maximum number of user commands in history (0 = unlimited)@*
Type: integer (values: between 0 and 2147483647), default value: 100@*
@item log_auto_channels
@item log_auto_server
Automatically log server messages@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item log_auto_channel
Automatically log channel chats@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item log_auto_private
@@ -418,30 +448,24 @@ Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item log_path
Path for WeeChat log files@*
Type: string (any string), default value: '~/.weechat/logs/'@*
@item log_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 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'@*
@item dcc_timeout
Timeout for dcc request (in seconds)@*
Type: integer (values: between 1 and 2147483647), default value: 300@*
@item dcc_blocksize
Block size for dcc packets in bytes (default: 1024)@*
Type: integer (values: between 1024 and 102400), default value: 1024@*
@item dcc_download_path
Path for writing incoming files with dcc (default: user home)@*
Type: string (any string), default value: '~'@*
@@ -472,6 +496,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 deconds) 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 +529,15 @@ 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 3600), default value: 1@*
@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:@*
@@ -550,13 +586,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
@@ -579,6 +618,12 @@ Switch to previous / next buffer@*
@*
@item F8
Switch to next window@*
@*
@item F10
Remove last infobar message@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@item Alt + left arrow / Alt + right arrow
Same as F6 / F7@*
@@ -586,12 +631,21 @@ Same as F6 / F7@*
@item Alt + A
Switch to next buffer with activity (with priority: highlight, message, other)@*
@*
@item Alt + D
Display current DCC@*
@*
@item Alt + R
Clear hotlist (activity notification on other buffers)@*
@*
@item Alt + 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@*
@*
@item F10
Remove last infobar message@*
@*
@end table
@node WeeChat commands, , Key bindings, Usage
@@ -718,7 +772,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 +798,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
@@ -795,9 +874,6 @@ Bounga
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -840,7 +916,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
+111 -35
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.0.9 - 1er Janvier 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
@@ -292,6 +292,9 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item look_nick_completor
La cha@^ine affich@'ee apr@`es la compl@'etion des utilisateurs@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ':'@*
@item look_display_away
Affiche un message sur tous les canaux pour l'absence/le retour@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item look_infobar
Active la barre d'infos@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -343,15 +346,18 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_status
Couleur pour la barre de statut@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
@item col_status_delimiters
Couleur pour les d@'elimiteurs de la barre de statut@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
@item col_status_data_msg
Couleur pour une fen@^etre avec de nouvelles infos (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: '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: 'gray'@*
@item col_status_more
Couleur pour une fen@^etre avec des nouvelles donn@'ees (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@@ -403,13 +409,37 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
@item col_nick_bg
Couleur de fond pour les pseudos@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_chat_dcc_selected
Couleur pour le DCC s@'electionn@'e (fen@^etre de discussion)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@item col_dcc_waiting
Couleur pour le statut dcc "attente"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@item col_dcc_connecting
Couleur pour le statut dcc "connexion"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_dcc_active
Couleur pour le statut dcc "actif"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightblue'@*
@item col_dcc_done
Couleur pour le statut dcc "termin@'e"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_dcc_failed
Couleur pour le statut dcc "@'echou@'e"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
@item col_dcc_aborted
Couleur pour le statut dcc "interrompu"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
@item history_max_lines
Nombre maximum de lignes dans l'historique pour un serveur/fen@^etre/fen@^etre priv@'ee (0 = sans limite)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 4096@*
@item history_max_commands
Nombre maximum de commandes utilisateur dans l'historique (0 = sans limite)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 100@*
@item log_auto_channels
@item log_auto_server
Enregistrer automatiquement les messages du serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item log_auto_channel
Enregistrer automatiquement les conversations des canaux@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item log_auto_private
@@ -418,30 +448,24 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item log_path
Chemin pour les conversations sauvegard@'ees par WeeChat@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~/.weechat/logs/'@*
@item log_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 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'@*
@item dcc_timeout
D@'elai d'attente pour les requ@^etes dcc (en secondes)@*
Type: entier (valeurs: entre 1 et 2147483647), valeur par d@'efaut: 300@*
@item dcc_blocksize
Taille de bloc pour les paquets dcc en octets (d@'efaut: 1024)@*
Type: entier (valeurs: entre 1024 et 102400), valeur par d@'efaut: 1024@*
@item dcc_download_path
Chemin pour @'ecrire les fichiers re@,{c}us par dcc (par d@'efaut: r@'epertoire de l'utilisateur)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~'@*
@@ -472,6 +496,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 +529,15 @@ 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 3600), valeur par d@'efaut: 1@*
@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 :@*
@@ -550,13 +586,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
@@ -579,19 +618,34 @@ Aller au tampon pr@'ec@'edent@*
@*
@item F8
Aller @`a la fen@^etre suivante@*
@*
@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
Identique @`a F6 / F7@*
@*
@item Alt + A
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
@*
@item Alt + D
Afficher les DCC en cours@*
@*
@item Alt + R
Vide la hotlist (notification d'activité sur les autres tampons)@*
@*
@item Alt + S
Sauter au tampon du serveur@*
@*
@item Alt + X
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
@*
@item Alt + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@end table
@node Commandes WeeChat, , Raccourcis clavier, Utilisation
@@ -719,7 +773,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 +799,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
@@ -795,9 +874,6 @@ Bounga
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -840,7 +916,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
+55 -13
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.0.9 - 1 de Janeiro 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
@@ -247,13 +247,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
@@ -274,18 +277,36 @@ Navegar no hist@'orico da janela@*
@item F6 / F7
Ir para a janela anterior/seguinte@*
@*
@item F8
Comute @`a janela 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 F6 / F7@*
@*
@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@*
@*
@item F10
Apagar a @'ultima mensagem da barra do info@*
@*
@end table
@node Comandos do WeeChat, , Recursos de teclado, Utilizacao
@@ -438,6 +459,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
@@ -485,9 +530,6 @@ Bounga
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -528,7 +570,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}>@*
@*
+2
View File
@@ -6,6 +6,7 @@
./src/irc/irc-display.c
./src/irc/irc-send.c
./src/irc/irc-recv.c
./src/irc/irc-dcc.c
./src/plugins/perl/wee-perl.c
./src/plugins/perl/wee-perl.h
./src/plugins/plugins.c
@@ -23,6 +24,7 @@
./src/common/command.h
./src/common/completion.h
./src/common/history.h
./src/common/log.c
./src/common/weechat.h
./src/common/weeconfig.c
./src/common/weeconfig.h
+868 -618
View File
File diff suppressed because it is too large Load Diff
+858 -610
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
+4 -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
@@ -30,4 +30,6 @@ lib_weechat_main_a_SOURCES = weechat.c \
history.c \
history.h \
hotlist.c \
hotlist.h
hotlist.h \
log.c \
log.h
+200 -43
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
@@ -46,8 +46,10 @@ t_weechat_command weechat_commands[] =
{ "buffer", N_("manage buffers"),
N_("[action | number]"),
N_("action: action to do:\n"
" move move buffer in the list (may be relative, for example -1)\n"
" list list opened buffers (no parameter implies this list)\n"
" move move buffer in the list (may be relative, for example -1)\n"
" close close buffer (for channel: same as /part without part message)\n"
" list list opened buffers (no parameter implies this list)\n"
" notify set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
"number: jump to buffer by number"),
0, MAX_ARGS, weechat_cmd_buffer, NULL },
{ "clear", N_("clear window(s)"),
@@ -66,7 +68,7 @@ t_weechat_command weechat_commands[] =
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
0, 1, weechat_cmd_help, NULL },
{ "perl", N_("list/load/unload Perl scripts"),
N_("[load filename] | [unload]"),
N_("[load filename] | [autoload] | [unload]"),
N_("filename: Perl script (file) to load\n"
"Without argument, /perl command lists all loaded Perl scripts."),
0, 2, weechat_cmd_perl, NULL },
@@ -539,7 +541,7 @@ exec_weechat_command (t_irc_server *server, char *string)
ptr_args = NULL;
}
if (!plugin_exec_command (command + 1, ptr_args))
if (!plugin_exec_command (command + 1, (server) ? server->name : "", ptr_args))
{
argv = explode_string (ptr_args, " ", 0, &argc);
@@ -832,37 +834,193 @@ weechat_cmd_alias (char *arguments)
int
weechat_cmd_buffer (int argc, char **argv)
{
int number;
t_gui_buffer *ptr_buffer;
t_irc_server *ptr_server;
long number;
char *error;
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
{
/* list opened bufferss */
gui_printf (NULL, "buffer list -- NOT DEVELOPED!\n");
/* list opened buffers */
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf (NULL, _("Opened buffers:\n"));
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "[");
gui_printf (NULL, "%d", ptr_buffer->number);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "] ");
if (ptr_buffer->dcc)
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "DCC\n");
else if (BUFFER_IS_SERVER (ptr_buffer))
{
gui_printf (NULL, _("Server: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
"%s\n", SERVER(ptr_buffer)->name);
}
else if (BUFFER_IS_CHANNEL (ptr_buffer))
{
gui_printf (NULL, _("Channel: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
"%s", CHANNEL(ptr_buffer)->name);
gui_printf (NULL, _(" (server: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
"%s", SERVER(ptr_buffer)->name);
gui_printf (NULL, ")\n");
}
else if (BUFFER_IS_PRIVATE (ptr_buffer))
{
gui_printf (NULL, _("Private with: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_NICK,
"%s", CHANNEL(ptr_buffer)->name);
gui_printf (NULL, _(" (server: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
"%s", SERVER(ptr_buffer)->name);
gui_printf (NULL, ")\n");
}
}
}
else
{
if (strcasecmp (argv[0], "move") == 0)
{
/* move buffer to another number in the list */
gui_printf (NULL, "buffer move -- NOT DEVELOPED!\n");
}
else
{
number = strtol (argv[0], &error, 10);
if (error)
if (argc < 2)
{
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"),
WEECHAT_ERROR, "buffer");
return -1;
}
error = NULL;
number = strtol (((argv[1][0] == '+') || (argv[1][0] == '-')) ? argv[1] + 1 : argv[1],
&error, 10);
if ((error) && (error[0] == '\0'))
{
if (argv[1][0] == '+')
gui_move_buffer_to_number (gui_current_window,
gui_current_window->buffer->number + ((int) number));
else if (argv[1][0] == '-')
gui_move_buffer_to_number (gui_current_window,
gui_current_window->buffer->number - ((int) number));
else
gui_move_buffer_to_number (gui_current_window, (int) number);
}
else
{
/* invalid number */
gui_printf (NULL, _("%s incorrect buffer number\n"),
WEECHAT_ERROR);
return -1;
}
if (!gui_switch_to_buffer_by_number (gui_current_window, number))
}
else if (strcasecmp (argv[0], "close") == 0)
{
/* close buffer (server or channel/private) */
if ((!gui_current_window->buffer->next_buffer)
&& (gui_current_window->buffer == gui_buffers))
{
gui_printf (NULL,
_("%s buffer \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, argv[0], "buffer");
gui_printf (gui_current_window->buffer,
_("%s can not close the single buffer\n"),
WEECHAT_ERROR);
return -1;
}
if (BUFFER_IS_SERVER(gui_current_window->buffer))
{
if (SERVER(gui_current_window->buffer)->channels)
{
gui_printf (gui_current_window->buffer,
_("%s can not close server buffer while channels "
"are opened\n"),
WEECHAT_ERROR);
return -1;
}
server_disconnect (SERVER(gui_current_window->buffer), 0);
ptr_server = SERVER(gui_current_window->buffer);
gui_buffer_free (gui_current_window->buffer, 1);
ptr_server->buffer = NULL;
}
else
irc_cmd_send_part (SERVER(gui_current_window->buffer), NULL);
}
else if (strcasecmp (argv[0], "notify") == 0)
{
/* set notify level for buffer */
if (argc < 2)
{
/* display notify level for all buffers */
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf (NULL, _("Notify levels: "));
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
gui_printf (NULL, "%d.%s:",
ptr_buffer->number,
(ptr_buffer->dcc) ? "DCC" :
((BUFFER_IS_SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
CHANNEL(ptr_buffer)->name));
if (ptr_buffer->dcc)
gui_printf (NULL, "-");
else
gui_printf (NULL, "%d", ptr_buffer->notify_level);
if (ptr_buffer->next_buffer)
gui_printf (NULL, " ");
}
gui_printf (NULL, "\n");
}
else
{
error = NULL;
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0'))
{
if ((number < 0) || (number > 3))
{
/* invalid highlight level */
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
WEECHAT_ERROR);
return -1;
}
gui_current_window->buffer->notify_level = number;
}
else
{
/* invalid number */
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
WEECHAT_ERROR);
return -1;
}
}
}
else
{
/* jump to buffer by number */
error = NULL;
number = strtol (argv[0], &error, 10);
if ((error) && (error[0] == '\0'))
{
if (!gui_switch_to_buffer_by_number (gui_current_window, (int) number))
{
gui_printf (NULL,
_("%s buffer \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, argv[0], "buffer");
return -1;
}
}
else
{
/* invalid number */
gui_printf (NULL, _("%s incorrect buffer number\n"),
WEECHAT_ERROR);
return -1;
}
}
}
return 0;
@@ -900,7 +1058,6 @@ int
weechat_cmd_connect (int argc, char **argv)
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
/* make gcc happy */
(void) argc;
@@ -917,18 +1074,14 @@ weechat_cmd_connect (int argc, char **argv)
}
if (!ptr_server->buffer)
{
if (!gui_buffer_new (gui_current_window, ptr_server, NULL, 1))
if (!gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1))
return -1;
}
if (server_connect (ptr_server))
{
ptr_server->reconnect_start = 0;
ptr_server->reconnect_join = (ptr_server->channels) ? 1 : 0;
irc_login (ptr_server);
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->type == CHAT_CHANNEL)
server_sendf (ptr_server, "JOIN %s\r\n", ptr_channel->name);
}
}
}
else
@@ -956,14 +1109,17 @@ weechat_cmd_disconnect (int argc, char **argv)
ptr_server = server_search (argv[0]);
if (ptr_server)
{
if (!ptr_server->is_connected)
if ((!ptr_server->is_connected) && (ptr_server->reconnect_start == 0))
{
gui_printf (NULL,
gui_printf (ptr_server->buffer,
_("%s not connected to server \"%s\"!\n"),
WEECHAT_ERROR, argv[0]);
return -1;
}
server_disconnect (ptr_server);
if (ptr_server->reconnect_start > 0)
gui_printf (ptr_server->buffer,
_("Auto-reconnection is cancelled\n"));
server_disconnect (ptr_server, 0);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
else
@@ -992,13 +1148,13 @@ weechat_cmd_help (int argc, char **argv)
for (i = 0; weechat_commands[i].command_name; i++)
gui_printf (NULL, " %s - %s\n",
weechat_commands[i].command_name,
weechat_commands[i].command_description);
_(weechat_commands[i].command_description));
gui_printf (NULL, _("> List of IRC commands:\n"));
for (i = 0; irc_commands[i].command_name; i++)
if (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
gui_printf (NULL, " %s - %s\n",
irc_commands[i].command_name,
irc_commands[i].command_description);
_(irc_commands[i].command_description));
}
if (argc == 1)
{
@@ -1013,14 +1169,12 @@ weechat_cmd_help (int argc, char **argv)
gui_printf (NULL,
_("Syntax: /%s %s\n"),
weechat_commands[i].command_name,
(weechat_commands[i].
arguments) ? weechat_commands[i].
arguments : "");
(weechat_commands[i].arguments) ?
_(weechat_commands[i].arguments) : "");
if (weechat_commands[i].arguments_description)
{
gui_printf (NULL, "%s\n",
weechat_commands[i].
arguments_description);
_(weechat_commands[i].arguments_description));
}
return 0;
}
@@ -1035,12 +1189,11 @@ weechat_cmd_help (int argc, char **argv)
gui_printf (NULL, _("Syntax: /%s %s\n"),
irc_commands[i].command_name,
(irc_commands[i].arguments) ?
irc_commands[i].arguments : "");
_(irc_commands[i].arguments) : "");
if (irc_commands[i].arguments_description)
{
gui_printf (NULL, "%s\n",
irc_commands[i].
arguments_description);
_(irc_commands[i].arguments_description));
}
return 0;
}
@@ -1137,6 +1290,8 @@ weechat_cmd_perl (int argc, char **argv)
break;
case 1:
if (strcmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
if (strcmp (argv[0], "unload") == 0)
{
/* unload all Perl scripts */
@@ -1475,11 +1630,13 @@ weechat_cmd_server (int argc, char **argv)
}
/* create new server */
new_server = server_new (server.name, server.autoconnect, 0,
server.address, server.port, server.password,
new_server = server_new (server.name, server.autoconnect,
server.autoreconnect,
server.autoreconnect_delay,
0, server.address, server.port, server.password,
server.nick1, server.nick2, server.nick3,
server.username, server.realname,
server.command, server.autojoin);
server.command, 1, server.autojoin, 1);
if (new_server)
{
irc_display_prefix (NULL, PREFIX_INFO);
@@ -1499,7 +1656,7 @@ weechat_cmd_server (int argc, char **argv)
if (new_server->autoconnect)
{
(void) gui_buffer_new (gui_current_window, new_server, NULL, 1);
(void) gui_buffer_new (gui_current_window, new_server, NULL, 0, 1);
if (server_connect (new_server))
irc_login (new_server);
}
+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,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 -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;
+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
+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 */
+149
View File
@@ -0,0 +1,149 @@
/*
* 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"
/*
* log_write_date: writes date to log file
*/
void
log_write_date (t_gui_buffer *buffer)
{
static char buf_time[256];
static time_t seconds;
struct tm *date_tmp;
if (buffer->log_file)
{
seconds = time (NULL);
date_tmp = localtime (&seconds);
if (date_tmp)
{
strftime (buf_time, sizeof (buf_time) - 1, cfg_log_timestamp, date_tmp);
fprintf (buffer->log_file, "%s ", buf_time);
fflush (buffer->log_file);
}
}
}
/*
* log_write: writes a message to log file
*/
void
log_write (t_gui_buffer *buffer, char *message)
{
if (buffer->log_file)
{
fprintf (buffer->log_file, "%s", message);
fflush (buffer->log_file);
}
}
/*
* log_start: starts a log
*/
void
log_start (t_gui_buffer *buffer)
{
int length;
char *ptr_home;
ptr_home = getenv ("HOME");
length = strlen (cfg_log_path) +
((cfg_log_path[0] == '~') ? strlen (ptr_home) : 0) +
64;
if (SERVER(buffer))
length += strlen (SERVER(buffer)->name);
if (CHANNEL(buffer))
length += strlen (CHANNEL(buffer)->name);
buffer->log_filename = (char *) malloc (length);
if (!buffer->log_filename)
{
wee_log_printf (_("Not enough memory to write log file for a buffer\n"));
return;
}
if (cfg_log_path[0] == '~')
{
strcpy (buffer->log_filename, ptr_home);
strcat (buffer->log_filename, cfg_log_path + 1);
}
else
strcpy (buffer->log_filename, cfg_log_path);
if (buffer->log_filename[strlen (buffer->log_filename) - 1] != DIR_SEPARATOR_CHAR)
strcat (buffer->log_filename, DIR_SEPARATOR);
if (SERVER(buffer))
{
strcat (buffer->log_filename, SERVER(buffer)->name);
strcat (buffer->log_filename, ".");
}
if (CHANNEL(buffer))
{
strcat (buffer->log_filename, CHANNEL(buffer)->name);
strcat (buffer->log_filename, ".");
}
strcat (buffer->log_filename, "weechatlog");
buffer->log_file = fopen (buffer->log_filename, "a");
if (!buffer->log_file)
{
wee_log_printf (_("Unable to write log file for a buffer\n"));
free (buffer->log_filename);
return;
}
log_write (buffer, _("**** Beginning of log "));
log_write_date (buffer);
log_write (buffer, "****\n");
}
/*
* log_end: ends a log
*/
void
log_end (t_gui_buffer *buffer)
{
if (buffer->log_file)
{
log_write (buffer, _("**** End of log "));
log_write_date (buffer);
log_write (buffer, "****\n");
fclose (buffer->log_file);
buffer->log_file = NULL;
}
if (buffer->log_filename)
free (buffer->log_filename);
}
+31
View File
@@ -0,0 +1,31 @@
/*
* 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"
extern void log_write_date (t_gui_buffer *);
extern void log_write (t_gui_buffer *, char *);
extern void log_start (t_gui_buffer *);
extern void log_end (t_gui_buffer *);
#endif /* log.h */
+25 -16
View File
@@ -10,13 +10,13 @@
* ### ###
* ### By: FlashCode <flashcode@flashtux.org> ###
* ### Bounga <bounga@altern.org> ###
* ### Xahlexx <xahlexx@tuxisland.org> ###
* ### Xahlexx <xahlexx@weeland.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
@@ -60,7 +60,7 @@
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
char *weechat_home; /* WeeChat home dir. (example: /home/toto/.weechat) */
FILE *log_file; /* WeeChat log file (~/.weechat/weechat.log) */
FILE *weechat_log_file; /* WeeChat log file (~/.weechat/weechat.log) */
int server_cmd_line; /* at least one server on WeeChat command line */
@@ -88,7 +88,7 @@ wee_log_printf (char *message, ...)
static time_t seconds;
struct tm *date_tmp;
if (!log_file)
if (!weechat_log_file)
return;
va_start (argptr, message);
@@ -98,13 +98,13 @@ 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);
}
/*
@@ -228,11 +228,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);
@@ -354,6 +356,15 @@ 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);
}
free (dir_name);
}
@@ -364,9 +375,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 +394,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);
@@ -440,10 +448,11 @@ weechat_welcome_message ()
void
wee_shutdown ()
{
dcc_end ();
server_free_all ();
gui_end ();
if (log_file)
fclose (log_file);
if (weechat_log_file)
fclose (weechat_log_file);
exit (EXIT_SUCCESS);
}
+9 -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
@@ -43,7 +43,7 @@
#endif
#define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2004 by Wee Team"
#define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2003-2005 by Wee Team"
#define WEECHAT_WEBSITE "http://weechat.flashtux.org"
#define WEECHAT_ERROR _(PACKAGE_NAME " Error:")
@@ -56,10 +56,10 @@
/* license */
#define WEE_LICENSE \
PACKAGE_STRING " (c) Copyright 2004, compiled on " __DATE__ " " __TIME__ \
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode <flashcode@flashtux.org>\n" \
" Bounga <bounga@altern.org>\n" \
" Xahlexx <xahlexx@tuxisland.org>\n" \
" Xahlexx <xahlexx@weeland.org>\n" \
"Website: " WEECHAT_WEBSITE "\n\n" \
"This program is free software; you can redistribute it and/or modify\n" \
"it under the terms of the GNU General Public License as published by\n" \
@@ -77,7 +77,7 @@
"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__ \
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode, Bounga and Xahlexx - " WEECHAT_WEBSITE "\n\n" \
"Usage: %s [options ...]\n" \
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
@@ -91,9 +91,11 @@
/* 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 */
+102 -42
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
@@ -73,6 +73,7 @@ int cfg_look_nickmode;
int cfg_look_nickmode_empty;
char *cfg_look_no_nickname;
char *cfg_look_completor;
int cfg_look_display_away;
int cfg_look_infobar;
char *cfg_look_infobar_timestamp;
int cfg_look_infobar_delay_highlight;
@@ -140,6 +141,10 @@ t_config_option weechat_options_look[] =
N_("the string inserted after nick completion"),
OPTION_TYPE_STRING, 0, 0, 0,
":", NULL, NULL, &cfg_look_completor, config_change_noop },
{ "look_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_look_display_away, NULL, config_change_noop },
{ "look_infobar", N_("enable info bar"),
N_("enable info bar"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -147,7 +152,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)"),
@@ -193,6 +198,13 @@ 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 */
@@ -347,6 +359,36 @@ t_config_option weechat_options_colors[] =
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,
"white", 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 }
};
@@ -370,19 +412,22 @@ t_config_option weechat_options_history[] =
/* config, log section */
int cfg_log_auto_channels;
int cfg_log_auto_server;
int cfg_log_auto_channel;
int cfg_log_auto_private;
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_TRUE,
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 },
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,
@@ -391,34 +436,23 @@ t_config_option weechat_options_log[] =
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 },
{ "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)"),
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)"),
OPTION_TYPE_STRING, 0, 0, 0,
"--- Log ended %a %b %d %Y %H:%M:%s", NULL, NULL, &cfg_log_end_string, NULL },
"%Y %b %d %H:%M:%S", NULL, NULL, &cfg_log_timestamp, NULL },
{ "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, NULL },
{ 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_auto_rename;
@@ -427,36 +461,36 @@ 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 },
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: 1024)"),
OPTION_TYPE_INT, 1024, 102400, 1024,
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_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 }
};
@@ -500,6 +534,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 deconds) 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 +578,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, 3600, 1,
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 }
};
@@ -773,10 +823,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,
@@ -952,7 +1004,7 @@ config_read ()
if (section == CONFIG_SECTION_ALIAS)
{
if (alias_new (line, pos))
index_command_new (pos);
index_command_new (line);
}
else
{
@@ -1137,6 +1189,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");
@@ -1206,6 +1259,7 @@ config_create_default ()
fprintf (file, "server_command=\n");
fprintf (file, "server_autojoin=\n");
fprintf (file, "server_autorejoin=on\n");
fclose (file);
free (filename);
@@ -1263,8 +1317,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 +1384,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,8 +1399,11 @@ 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");
}
}
+13 -6
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
@@ -88,6 +88,7 @@ extern int cfg_look_nickmode;
extern int cfg_look_nickmode_empty;
extern char *cfg_look_no_nickname;
extern char *cfg_look_completor;
extern int cfg_look_display_away;
extern int cfg_look_infobar;
extern char *cfg_look_infobar_timestamp;
extern int cfg_look_infobar_delay_highlight;
@@ -127,22 +128,28 @@ extern int cfg_col_nick_sep;
extern int cfg_col_nick_self;
extern int cfg_col_nick_private;
extern int cfg_col_nick_bg;
extern int cfg_col_dcc_selected;
extern int cfg_col_dcc_waiting;
extern int cfg_col_dcc_connecting;
extern int cfg_col_dcc_active;
extern int cfg_col_dcc_done;
extern int cfg_col_dcc_failed;
extern int cfg_col_dcc_aborted;
extern int cfg_history_max_lines;
extern int cfg_history_max_commands;
extern int cfg_log_auto_channels;
extern int cfg_log_auto_server;
extern int cfg_log_auto_channel;
extern int cfg_log_auto_private;
extern char *cfg_log_path;
extern char *cfg_log_name;
extern char *cfg_log_timestamp;
extern char *cfg_log_start_string;
extern char *cfg_log_end_string;
extern int cfg_log_hide_nickserv_pwd;
extern int cfg_dcc_auto_accept_files;
extern int cfg_dcc_auto_accept_max_size;
extern int cfg_dcc_auto_accept_chats;
extern int cfg_dcc_timeout;
extern int cfg_dcc_blocksize;
extern char *cfg_dcc_download_path;
extern char *cfg_dcc_upload_path;
extern int cfg_dcc_auto_rename;
+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
+375 -83
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
@@ -36,6 +36,7 @@
#include "../gui.h"
#include "../../common/weeconfig.h"
#include "../../common/hotlist.h"
#include "../../common/log.h"
#include "../../irc/irc.h"
@@ -174,6 +175,9 @@ gui_calculate_pos_size (t_gui_window *window)
int max_length, lines;
int num_nicks, num_op, num_halfop, num_voice, num_normal;
if (!gui_ok)
return;
/* init chat & nicklist settings */
if (cfg_look_nicklist && BUFFER_IS_CHANNEL(window->buffer))
{
@@ -288,6 +292,9 @@ gui_calculate_pos_size (t_gui_window *window)
void
gui_curses_window_clear (WINDOW *window)
{
if (!gui_ok)
return;
werase (window);
wmove (window, 0, 0);
}
@@ -302,6 +309,9 @@ gui_draw_buffer_title (t_gui_buffer *buffer, int erase)
t_gui_window *ptr_win;
char format[32];
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == buffer)
@@ -325,12 +335,15 @@ gui_draw_buffer_title (t_gui_buffer *buffer, int erase)
}
else
{
/* TODO: change this copyright as title? */
mvwprintw (ptr_win->win_title, 0, 0,
"%s", PACKAGE_STRING " - " WEECHAT_WEBSITE);
mvwprintw (ptr_win->win_title, 0,
ptr_win->win_width - strlen (WEECHAT_COPYRIGHT),
"%s", WEECHAT_COPYRIGHT);
if (!buffer->dcc)
{
/* TODO: change this copyright as title? */
mvwprintw (ptr_win->win_title, 0, 0,
"%s", PACKAGE_STRING " - " WEECHAT_WEBSITE);
mvwprintw (ptr_win->win_title, 0,
ptr_win->win_width - strlen (WEECHAT_COPYRIGHT),
"%s", WEECHAT_COPYRIGHT);
}
}
wrefresh (ptr_win->win_title);
refresh ();
@@ -550,8 +563,17 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
t_gui_line *ptr_line;
t_dcc *dcc_first, *dcc_selected, *ptr_dcc;
char format_empty[32];
int i, lines_used;
int i, j, lines_used, num_bars;
char *unit_name[] = { N_("bytes"), N_("Kb"), N_("Mb"), N_("Gb") };
char *unit_format[] = { "%.0Lf", "%.1Lf", "%.02Lf", "%.02Lf" };
long unit_divide[] = { 1, 1024, 1024*1024, 1024*1024,1024 };
int num_unit;
char format[32];
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
@@ -559,8 +581,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
{
if (erase)
{
if (has_colors ())
gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT);
gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT);
snprintf (format_empty, 32, "%%-%ds", ptr_win->win_chat_width);
for (i = 0; i < ptr_win->win_chat_height; i++)
@@ -569,52 +590,125 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
}
}
if (has_colors ())
gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT);
gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT);
ptr_line = buffer->last_line;
lines_used = 0;
while (ptr_line
&& (lines_used < (ptr_win->win_chat_height + ptr_win->sub_lines)))
if (buffer->dcc)
{
lines_used += gui_get_line_num_splits (ptr_win, ptr_line);
ptr_line = ptr_line->prev_line;
}
ptr_win->win_chat_cursor_x = 0;
ptr_win->win_chat_cursor_y = 0;
if (lines_used > (ptr_win->win_chat_height + ptr_win->sub_lines))
{
/* screen will be full (we'll display only end of 1st line) */
ptr_line = (ptr_line) ? ptr_line->next_line : buffer->lines;
gui_display_end_of_line (ptr_win, ptr_line,
gui_get_line_num_splits (ptr_win, ptr_line) -
(lines_used - (ptr_win->win_chat_height + ptr_win->sub_lines)));
ptr_line = ptr_line->next_line;
ptr_win->first_line_displayed = 0;
i = 0;
dcc_first = (ptr_win->dcc_first) ? (t_dcc *) ptr_win->dcc_first : dcc_list;
dcc_selected = (ptr_win->dcc_selected) ? (t_dcc *) ptr_win->dcc_selected : dcc_list;
for (ptr_dcc = dcc_first; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if (i >= ptr_win->win_chat_height - 1)
break;
if ((ptr_dcc->type == DCC_FILE_RECV)
|| (ptr_dcc->type == DCC_FILE_SEND))
{
gui_window_set_color (ptr_win->win_chat,
(ptr_dcc == dcc_selected) ?
COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
mvwprintw (ptr_win->win_chat, i, 0, "%s %-16s %s",
(ptr_dcc == dcc_selected) ? ">>" : " ",
ptr_dcc->nick, ptr_dcc->filename);
if (ptr_dcc->filename_suffix > 0)
wprintw (ptr_win->win_chat, " (.%d)",
ptr_dcc->filename_suffix);
gui_window_set_color (ptr_win->win_chat,
(ptr_dcc == dcc_selected) ?
COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
mvwprintw (ptr_win->win_chat, i + 1, 0, "%s %s ",
(ptr_dcc == dcc_selected) ? ">>" : " ",
(ptr_dcc->type == DCC_FILE_RECV) ?
"--->" : "<---");
gui_window_set_color (ptr_win->win_chat,
COLOR_DCC_WAITING + ptr_dcc->status);
wprintw (ptr_win->win_chat, "%-10s",
dcc_status_string[ptr_dcc->status]);
gui_window_set_color (ptr_win->win_chat,
(ptr_dcc == dcc_selected) ?
COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
wprintw (ptr_win->win_chat, " [",
dcc_status_string[ptr_dcc->status]);
if (ptr_dcc->size == 0)
num_bars = 10;
else
num_bars = (int)((((long double)(ptr_dcc->pos)/(long double)(ptr_dcc->size))*100) / 10);
for (j = 0; j < num_bars - 1; j++)
wprintw (ptr_win->win_chat, "=");
if (num_bars > 0)
wprintw (ptr_win->win_chat, ">");
for (j = 0; j < 10 - num_bars; j++)
wprintw (ptr_win->win_chat, " ");
if (ptr_dcc->size < 1024*10)
num_unit = 0;
else if (ptr_dcc->size < 1024*1024)
num_unit = 1;
else if (ptr_dcc->size < 1024*1024*1024)
num_unit = 2;
else
num_unit = 3;
wprintw (ptr_win->win_chat, "] %3lu%% ",
(unsigned long)(((long double)(ptr_dcc->pos)/(long double)(ptr_dcc->size))*100),
dcc_status_string[ptr_dcc->status]);
sprintf (format, "%s %%s / %s %%s",
unit_format[num_unit],
unit_format[num_unit]);
wprintw (ptr_win->win_chat, format,
((long double) ptr_dcc->pos) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit],
((long double) ptr_dcc->size) / ((long double)(unit_divide[num_unit])),
unit_name[num_unit]);
ptr_win->dcc_last_displayed = ptr_dcc;
i += 2;
}
}
}
else
{
/* all lines are displayed */
if (!ptr_line)
ptr_line = buffer->last_line;
lines_used = 0;
while (ptr_line
&& (lines_used < (ptr_win->win_chat_height + ptr_win->sub_lines)))
{
ptr_win->first_line_displayed = 1;
ptr_line = buffer->lines;
lines_used += gui_get_line_num_splits (ptr_win, ptr_line);
ptr_line = ptr_line->prev_line;
}
ptr_win->win_chat_cursor_x = 0;
ptr_win->win_chat_cursor_y = 0;
if (lines_used > (ptr_win->win_chat_height + ptr_win->sub_lines))
{
/* screen will be full (we'll display only end of 1st line) */
ptr_line = (ptr_line) ? ptr_line->next_line : buffer->lines;
gui_display_end_of_line (ptr_win, ptr_line,
gui_get_line_num_splits (ptr_win, ptr_line) -
(lines_used - (ptr_win->win_chat_height + ptr_win->sub_lines)));
ptr_line = ptr_line->next_line;
ptr_win->first_line_displayed = 0;
}
else
{
ptr_win->first_line_displayed = 0;
/* all lines are displayed */
if (!ptr_line)
{
ptr_win->first_line_displayed = 1;
ptr_line = buffer->lines;
}
else
{
ptr_win->first_line_displayed = 0;
ptr_line = ptr_line->next_line;
}
}
while (ptr_line)
{
if (!gui_display_line (ptr_win, ptr_line, 1))
break;
ptr_line = ptr_line->next_line;
}
/*if (ptr_win->win_chat_cursor_y <= ptr_win->win_chat_height - 1)
buffer->sub_lines = 0;*/
}
while (ptr_line)
{
if (!gui_display_line (ptr_win, ptr_line, 1))
break;
ptr_line = ptr_line->next_line;
}
/*if (ptr_win->win_chat_cursor_y <= ptr_win->win_chat_height - 1)
buffer->sub_lines = 0;*/
wrefresh (ptr_win->win_chat);
refresh ();
}
@@ -633,14 +727,16 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
char format[32], format_empty[32];
t_irc_nick *ptr_nick;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == buffer)
{
if (erase)
{
if (has_colors ())
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
snprintf (format_empty, 32, "%%-%ds", ptr_win->win_nick_width);
for (i = 0; i < ptr_win->win_nick_height; i++)
@@ -649,7 +745,7 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
}
}
if (CHANNEL(buffer) && CHANNEL(buffer)->nicks)
if (gui_buffer_has_nicklist (buffer))
{
max_length = nick_get_max_length (CHANNEL(buffer));
if ((buffer == gui_current_window->buffer) &&
@@ -668,8 +764,7 @@ gui_draw_buffer_nick (t_gui_buffer *buffer, int erase)
ptr_win->win_nick_x);
gui_draw_buffer_chat (buffer, 1);
if (has_colors ())
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
gui_window_set_color (ptr_win->win_nick, COLOR_WIN_NICK);
snprintf (format_empty, 32, "%%-%ds", ptr_win->win_nick_width);
for (i = 0; i < ptr_win->win_nick_height; i++)
@@ -793,6 +888,9 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
char format_more[32];
int i, first_mode;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (erase)
@@ -858,8 +956,13 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
wprintw (ptr_win->win_status, ":");
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS);
wprintw (ptr_win->win_status, "%s",
CHANNEL(ptr_win->buffer)->name);
if ((!CHANNEL(ptr_win->buffer)->nicks)
&& (CHANNEL(ptr_win->buffer)->type != CHAT_PRIVATE))
wprintw (ptr_win->win_status, "(%s)",
CHANNEL(ptr_win->buffer)->name);
else
wprintw (ptr_win->win_status, "%s",
CHANNEL(ptr_win->buffer)->name);
if (ptr_win->buffer == CHANNEL(ptr_win->buffer)->buffer)
{
/* display channel modes */
@@ -893,8 +996,12 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
if (!SERVER(ptr_win->buffer))
{
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
wprintw (ptr_win->win_status, _("%d:[not connected] "),
ptr_win->buffer->number);
if (ptr_win->buffer->dcc)
wprintw (ptr_win->win_status, "%d:<DCC> ",
ptr_win->buffer->number);
else
wprintw (ptr_win->win_status, _("%d:[not connected] "),
ptr_win->buffer->number);
}
/* display list of other active windows (if any) with numbers */
@@ -920,8 +1027,12 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
COLOR_WIN_STATUS_DATA_HIGHLIGHT);
break;
}
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
if (ptr_hotlist->buffer->dcc)
wprintw (ptr_win->win_status, "%d/DCC",
ptr_hotlist->buffer->number);
else
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS);
if (ptr_hotlist->next_hotlist)
@@ -961,6 +1072,9 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
struct tm *local_time;
char text[1024 + 1];
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == buffer)
@@ -1026,6 +1140,10 @@ gui_draw_buffer_input (t_gui_buffer *buffer, int erase)
char format[32];
char *ptr_nickname;
int input_width;
t_dcc *dcc_selected;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
@@ -1089,26 +1207,50 @@ gui_draw_buffer_input (t_gui_buffer *buffer, int erase)
}
else
{
if (SERVER(buffer))
if (buffer->dcc)
{
snprintf (format, 32, "%%s> %%-%ds", input_width);
if (SERVER(buffer) && (SERVER(buffer)->is_connected))
ptr_nickname = SERVER(buffer)->nick;
dcc_selected = (ptr_win->dcc_selected) ? (t_dcc *) ptr_win->dcc_selected : dcc_list;
if (dcc_selected)
{
switch (dcc_selected->status)
{
case DCC_WAITING:
if ((dcc_selected->type == DCC_CHAT_RECV)
|| (dcc_selected->type == DCC_FILE_RECV))
{
mvwprintw (ptr_win->win_input, 0, 0,
_(" [A] Accept"));
wprintw (ptr_win->win_input, _(" [C] Cancel"));
wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
}
else
{
mvwprintw (ptr_win->win_input, 0, 0,
_(" [C] Cancel"));
wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
}
break;
case DCC_CONNECTING:
case DCC_ACTIVE:
mvwprintw (ptr_win->win_input, 0, 0,
_(" [C] Cancel"));
wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
break;
case DCC_DONE:
case DCC_FAILED:
case DCC_ABORTED:
mvwprintw (ptr_win->win_input, 0, 0,
_(" [R] Remove"));
wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
break;
}
}
else
ptr_nickname = cfg_look_no_nickname;
if (ptr_win == gui_current_window)
mvwprintw (ptr_win->win_input, 0, 0, format,
ptr_nickname,
buffer->input_buffer + buffer->input_buffer_1st_display);
else
mvwprintw (ptr_win->win_input, 0, 0, format,
ptr_nickname,
"");
mvwprintw (ptr_win->win_input, 0, 0, _(" [Q] Close DCC view"));
wclrtoeol (ptr_win->win_input);
if (ptr_win == gui_current_window)
move (ptr_win->win_y + ptr_win->win_height - 1,
ptr_win->win_x + strlen (ptr_nickname) + 2 +
(buffer->input_buffer_pos - buffer->input_buffer_1st_display));
ptr_win->win_x);
}
else
{
@@ -1148,6 +1290,9 @@ gui_redraw_buffer (t_gui_buffer *buffer)
{
t_gui_window *ptr_win;
if (!gui_ok)
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == buffer)
@@ -1171,6 +1316,9 @@ gui_redraw_buffer (t_gui_buffer *buffer)
void
gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
{
if (!gui_ok)
return;
if (gui_current_window->buffer->num_displayed > 0)
gui_current_window->buffer->num_displayed--;
@@ -1248,11 +1396,61 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
else
window->win_status = newwin (1, window->win_width, window->win_y + window->win_height - 2, window->win_x);
window->sub_lines = 0;
buffer->num_displayed++;
hotlist_remove_buffer (buffer);
}
/*
* gui_get_dcc_buffer: get pointer to DCC buffer (DCC buffer created if not existing)
*/
t_gui_buffer *
gui_get_dcc_buffer ()
{
t_gui_buffer *ptr_buffer;
/* check if dcc buffer exists */
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (ptr_buffer->dcc)
break;
}
if (ptr_buffer)
return ptr_buffer;
else
return gui_buffer_new (gui_current_window, NULL, NULL, 1, 0);
}
/*
* gui_switch_to_dcc_buffer: switch to dcc buffer (create it if it does not exist)
*/
void
gui_switch_to_dcc_buffer ()
{
t_gui_buffer *ptr_buffer;
if (!gui_ok)
return;
/* check if dcc buffer exists */
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (ptr_buffer->dcc)
break;
}
if (ptr_buffer)
{
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (ptr_buffer);
}
else
gui_buffer_new (gui_current_window, NULL, NULL, 1, 1);
}
/*
* gui_switch_to_previous_buffer: switch to previous buffer
*/
@@ -1260,6 +1458,9 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
void
gui_switch_to_previous_buffer (t_gui_window *window)
{
if (!gui_ok)
return;
/* if only one buffer then return */
if (gui_buffers == last_gui_buffer)
return;
@@ -1279,6 +1480,9 @@ gui_switch_to_previous_buffer (t_gui_window *window)
void
gui_switch_to_next_buffer (t_gui_window *window)
{
if (!gui_ok)
return;
/* if only one buffer then return */
if (gui_buffers == last_gui_buffer)
return;
@@ -1298,6 +1502,9 @@ gui_switch_to_next_buffer (t_gui_window *window)
void
gui_switch_to_next_window (t_gui_window *window)
{
if (!gui_ok)
return;
/* if only one window then return */
if (gui_windows == last_gui_window)
return;
@@ -1314,6 +1521,9 @@ gui_switch_to_next_window (t_gui_window *window)
void
gui_move_page_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (!window->first_line_displayed)
{
window->sub_lines += window->win_chat_height - 1;
@@ -1329,6 +1539,9 @@ gui_move_page_up (t_gui_window *window)
void
gui_move_page_down (t_gui_window *window)
{
if (!gui_ok)
return;
if (window->sub_lines > 0)
{
window->sub_lines -= window->win_chat_height - 1;
@@ -1362,6 +1575,8 @@ gui_curses_resize_handler ()
/* TODO: manage when some windows are outside new term size */
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
ptr_win->dcc_first = NULL;
ptr_win->dcc_selected = NULL;
if (ptr_win->win_x + ptr_win->win_width == old_width)
ptr_win->win_width = new_width - ptr_win->win_x;
if (ptr_win->win_y + ptr_win->win_height == old_height)
@@ -1370,7 +1585,14 @@ gui_curses_resize_handler ()
}
gui_current_window = old_current_window;
gui_draw_buffer_input (gui_current_window->buffer, 1);
if ((new_width > 5) && (new_height > 5))
{
gui_ok = 1;
gui_calculate_pos_size (gui_current_window);
gui_redraw_buffer (gui_current_window->buffer);
}
else
gui_ok = 0;
}
/*
@@ -1398,6 +1620,9 @@ gui_window_split_horiz (t_gui_window *window)
t_gui_window *new_window;
int height1, height2;
if (!gui_ok)
return;
height1 = window->win_height / 2;
height2 = window->win_height - height1;
if ((new_window = gui_window_new (window->win_x, window->win_y,
@@ -1428,6 +1653,9 @@ gui_window_split_vertic (t_gui_window *window)
t_gui_window *new_window;
int width1, width2;
if (!gui_ok)
return;
width1 = window->win_width / 2;
width2 = window->win_width - width1 - 1;
if ((new_window = gui_window_new (window->win_x + width1 + 1, window->win_y,
@@ -1549,6 +1777,21 @@ gui_init_colors ()
color_attr[COLOR_WIN_NICK_FIRST + i - 1] =
(color & A_BOLD) ? A_BOLD : 0;
}
init_pair (COLOR_DCC_SELECTED,
cfg_col_dcc_selected & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_DCC_WAITING,
cfg_col_dcc_waiting & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_DCC_CONNECTING,
cfg_col_dcc_connecting & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_DCC_ACTIVE,
cfg_col_dcc_active & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_DCC_DONE,
cfg_col_dcc_done & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_DCC_FAILED,
cfg_col_dcc_failed & A_CHARTEXT, cfg_col_chat_bg);
init_pair (COLOR_DCC_ABORTED,
cfg_col_dcc_aborted & A_CHARTEXT, cfg_col_chat_bg);
color_attr[COLOR_WIN_TITLE - 1] = cfg_col_title & A_BOLD;
color_attr[COLOR_WIN_CHAT - 1] = cfg_col_chat & A_BOLD;
@@ -1580,6 +1823,13 @@ gui_init_colors ()
color_attr[COLOR_WIN_NICK_SEP - 1] = 0;
color_attr[COLOR_WIN_NICK_SELF - 1] = cfg_col_nick_self & A_BOLD;
color_attr[COLOR_WIN_NICK_PRIVATE - 1] = cfg_col_nick_private & A_BOLD;
color_attr[COLOR_DCC_SELECTED - 1] = cfg_col_dcc_selected & A_BOLD;
color_attr[COLOR_DCC_WAITING - 1] = cfg_col_dcc_waiting & A_BOLD;
color_attr[COLOR_DCC_CONNECTING - 1] = cfg_col_dcc_connecting & A_BOLD;
color_attr[COLOR_DCC_ACTIVE - 1] = cfg_col_dcc_active & A_BOLD;
color_attr[COLOR_DCC_DONE - 1] = cfg_col_dcc_done & A_BOLD;
color_attr[COLOR_DCC_FAILED - 1] = cfg_col_dcc_failed & A_BOLD;
color_attr[COLOR_DCC_ABORTED - 1] = cfg_col_dcc_aborted & A_BOLD;
}
}
@@ -1616,18 +1866,20 @@ gui_init ()
gui_infobar = NULL;
/* create a new buffer */
gui_ok = ((COLS > 5) && (LINES > 5));
/* create new window/buffer */
if (gui_window_new (0, 0, COLS, LINES))
{
gui_current_window = gui_windows;
gui_buffer_new (gui_windows, NULL, NULL, 1);
gui_buffer_new (gui_windows, NULL, NULL, 0, 1);
signal (SIGWINCH, gui_curses_resize_handler);
if (cfg_look_set_title)
gui_set_window_title ();
gui_ready = 1;
gui_init_ok = 1;
}
}
@@ -1719,10 +1971,15 @@ gui_add_message (t_gui_buffer *buffer, int type, int color, char *message)
}
if (buffer->num_displayed == 0)
{
hotlist_add (buffer->last_line->line_with_message +
buffer->last_line->line_with_highlight,
buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
if (3 - buffer->last_line->line_with_message -
buffer->last_line->line_with_highlight <=
buffer->notify_level)
{
hotlist_add (buffer->last_line->line_with_message +
buffer->last_line->line_with_highlight,
buffer);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
}
}
}
@@ -1736,12 +1993,13 @@ gui_printf_color_type (t_gui_buffer *buffer, int type, int color, char *message,
{
static char buf[8192];
char timestamp[16];
char *pos;
char *pos, *buf2;
int i, j;
va_list argptr;
static time_t seconds;
struct tm *date_tmp;
if (gui_ready)
if (gui_init_ok)
{
if (color == -1)
color = COLOR_WIN_CHAT;
@@ -1765,12 +2023,40 @@ gui_printf_color_type (t_gui_buffer *buffer, int type, int color, char *message,
vsnprintf (buf, sizeof (buf) - 1, message, argptr);
va_end (argptr);
if (gui_ready)
if (cfg_look_remove_colors_from_msgs)
{
buf2 = (char *) malloc (strlen (buf) + 2);
i = 0;
j = 0;
while (buf[i])
{
if (buf[i] == 0x02)
i++;
else
{
if (buf[i] == 0x03)
{
if ((buf[i+1] >= '0') && (buf[i+1] <= '9')
&& (buf[i+2] >= '0') && (buf[i+2] <= '9'))
i += 3;
else
i++;
}
else
buf2[j++] = buf[i++];
}
}
buf2[j] = '\0';
}
else
buf2 = strdup (buf);
if (gui_init_ok)
{
seconds = time (NULL);
date_tmp = localtime (&seconds);
pos = buf - 1;
pos = buf2 - 1;
while (pos)
{
/* TODO: read timestamp format from config! */
@@ -1786,8 +2072,12 @@ gui_printf_color_type (t_gui_buffer *buffer, int type, int color, char *message,
snprintf (timestamp, 16, "%02d", date_tmp->tm_sec);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "] ");
if (buffer->log_file)
log_write_date (buffer);
}
gui_add_message (buffer, type, color, pos + 1);
if (buffer->log_file)
log_write (buffer, pos + 1);
pos = strchr (pos + 1, '\n');
if (pos && !pos[1])
pos = NULL;
@@ -1797,5 +2087,7 @@ gui_printf_color_type (t_gui_buffer *buffer, int type, int color, char *message,
refresh ();*/
}
else
printf ("%s", buf);
printf ("%s", buf2);
free (buf2);
}
+390 -171
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
@@ -51,7 +51,9 @@ gui_read_keyb ()
{
int key, i;
t_gui_buffer *ptr_buffer;
t_irc_server *ptr_server;
char new_char[2];
t_dcc *dcc_selected;
key = getch ();
if (key != ERR)
@@ -60,8 +62,7 @@ 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):
@@ -91,199 +92,264 @@ gui_read_keyb ()
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_dcc *)(gui_current_window->dcc_selected))->prev_dcc)
{
if (gui_current_window->dcc_selected ==
gui_current_window->dcc_first)
gui_current_window->dcc_first =
((t_dcc *)(gui_current_window->dcc_first))->prev_dcc;
gui_current_window->dcc_selected =
((t_dcc *)(gui_current_window->dcc_selected))->prev_dcc;
gui_draw_buffer_chat (gui_current_window->buffer, 1);
gui_draw_buffer_input (gui_current_window->buffer, 1);
}
}
}
else
gui_current_window->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_dcc *)(gui_current_window->dcc_selected))->next_dcc)
{
if (gui_current_window->dcc_last_displayed
&& (gui_current_window->dcc_selected ==
gui_current_window->dcc_last_displayed))
{
if (gui_current_window->dcc_first)
gui_current_window->dcc_first =
((t_dcc *)(gui_current_window->dcc_first))->next_dcc;
else
gui_current_window->dcc_first =
dcc_list->next_dcc;
}
if (gui_current_window->dcc_selected)
gui_current_window->dcc_selected =
((t_dcc *)(gui_current_window->dcc_selected))->next_dcc;
else
gui_current_window->dcc_selected =
dcc_list->next_dcc;
gui_draw_buffer_chat (gui_current_window->buffer, 1);
gui_draw_buffer_input (gui_current_window->buffer, 1);
}
}
}
else
{
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';
if (gui_current_window->buffer->completion.diff_size > 0)
completion_search (&(gui_current_window->buffer->completion),
CHANNEL(gui_current_window->buffer),
gui_current_window->buffer->input_buffer,
gui_current_window->buffer->input_buffer_size,
gui_current_window->buffer->input_buffer_pos);
if (gui_current_window->buffer->completion.word_found)
{
for (i = gui_current_window->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 */
gui_current_window->buffer->input_buffer_size +=
gui_current_window->buffer->completion.diff_size;
gui_optimize_input_buffer_size (gui_current_window->buffer);
gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0';
if (gui_current_window->buffer->completion.diff_size > 0)
{
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 (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,
" ",
@@ -291,8 +357,27 @@ gui_read_keyb ()
gui_current_window->buffer->completion.position++;
gui_current_window->buffer->input_buffer_pos++;
}
else
{
if (gui_current_window->buffer->completion.base_word_pos == 0)
{
if (strncmp (gui_current_window->buffer->input_buffer + gui_current_window->buffer->input_buffer_pos,
cfg_look_completor, strlen (cfg_look_completor)) != 0)
gui_buffer_insert_string (gui_current_window->buffer,
cfg_look_completor,
gui_current_window->buffer->input_buffer_pos);
gui_current_window->buffer->completion.position += strlen (cfg_look_completor);
gui_current_window->buffer->input_buffer_pos += strlen (cfg_look_completor);
if (gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_pos] != ' ')
gui_buffer_insert_string (gui_current_window->buffer,
" ",
gui_current_window->buffer->input_buffer_pos);
gui_current_window->buffer->completion.position++;
gui_current_window->buffer->input_buffer_pos++;
}
}
gui_draw_buffer_input (gui_current_window->buffer, 0);
}
gui_draw_buffer_input (gui_current_window->buffer, 0);
}
break;
/* escape code (for control-key) */
@@ -300,12 +385,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 +406,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 +431,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 +451,162 @@ 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->input_buffer);
if (ptr_buffer == gui_current_window->buffer)
gui_draw_buffer_input (ptr_buffer, 0);
if (ptr_buffer)
ptr_buffer->input_buffer[0] = '\0';
}
}
break;
/* other key => add to input buffer */
default:
/*gui_printf (gui_current_window->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_dcc *) gui_current_window->dcc_selected : dcc_list;
switch (key)
{
/* accept DCC */
case 'a':
case 'A':
if (dcc_selected
&& (((dcc_selected->type == DCC_CHAT_RECV)
|| (dcc_selected->type == DCC_FILE_RECV))
&& (dcc_selected->status == DCC_WAITING)))
{
dcc_accept (dcc_selected);
}
break;
/* cancel DCC */
case 'c':
case 'C':
if (dcc_selected
&& ((dcc_selected->status == DCC_WAITING)
|| (dcc_selected->status == DCC_CONNECTING)
|| (dcc_selected->status == DCC_ACTIVE)))
{
dcc_close (dcc_selected, DCC_ABORTED);
gui_redraw_buffer (gui_current_window->buffer);
}
break;
/* close DCC window */
case 'q':
case 'Q':
gui_buffer_free (gui_current_window->buffer, 1);
gui_redraw_buffer (gui_current_window->buffer);
break;
/* remove from DCC list */
case 'r':
case 'R':
if (dcc_selected
&& (((dcc_selected->type == DCC_CHAT_RECV)
|| (dcc_selected->type == DCC_FILE_RECV))
&& ((dcc_selected->status == DCC_DONE)
|| (dcc_selected->status == DCC_FAILED)
|| (dcc_selected->status == DCC_ABORTED))))
{
if (dcc_selected->next_dcc)
gui_current_window->dcc_selected = dcc_selected->next_dcc;
else
gui_current_window->dcc_selected = NULL;
dcc_free (dcc_selected);
gui_redraw_buffer (gui_current_window->buffer);
}
break;
}
}
else
{
/*gui_printf (gui_current_window->buffer,
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
new_char[0] = key;
new_char[1] = '\0';
gui_buffer_insert_string (gui_current_window->buffer,
new_char,
gui_current_window->buffer->input_buffer_pos);
gui_current_window->buffer->input_buffer_pos++;
gui_draw_buffer_input (gui_current_window->buffer, 0);
gui_current_window->buffer->completion.position = -1;
}
break;
}
}
@@ -450,8 +660,14 @@ gui_main_loop ()
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->sock4 >= 0)
FD_SET (ptr_server->sock4, &read_fd);
}
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout))
{
@@ -470,5 +686,8 @@ gui_main_loop ()
}
}
}
/* 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
+129 -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
@@ -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;
SERVER(gui_buffers) = server;
CHANNEL(gui_buffers) = channel;
if (cfg_log_auto_server)
log_start (gui_buffers);
return gui_buffers;
}
if ((new_buffer = (t_gui_buffer *)(malloc (sizeof (t_gui_buffer)))))
@@ -151,6 +160,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int switch_to
/* assign server and channel to buffer */
SERVER(new_buffer) = server;
CHANNEL(new_buffer) = channel;
new_buffer->dcc = dcc;
/* assign buffer to server and channel */
if (server && !channel)
SERVER(new_buffer)->buffer = new_buffer;
@@ -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);
@@ -383,6 +404,11 @@ 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);
@@ -402,7 +428,7 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
/* 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);
}
/*
@@ -665,3 +691,88 @@ 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);
}
+33 -4
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 46
#define COLOR_WIN_TITLE 1
#define COLOR_WIN_CHAT 2
#define COLOR_WIN_CHAT_TIME 3
@@ -59,6 +59,13 @@
#define COLOR_WIN_NICK_FIRST 30
#define COLOR_WIN_NICK_LAST 39
#define COLOR_WIN_NICK_NUMBER (COLOR_WIN_NICK_LAST - COLOR_WIN_NICK_FIRST + 1)
#define COLOR_DCC_SELECTED 40
#define COLOR_DCC_WAITING 41
#define COLOR_DCC_CONNECTING 42
#define COLOR_DCC_ACTIVE 43
#define COLOR_DCC_DONE 44
#define COLOR_DCC_FAILED 45
#define COLOR_DCC_ABORTED 46
#define SERVER(buffer) ((t_irc_server *)(buffer->server))
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
@@ -135,6 +142,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 +150,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 +220,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,19 +236,21 @@ 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 *, ...);
@@ -239,6 +264,7 @@ extern void gui_move_previous_word (t_gui_buffer *);
extern void gui_move_next_word (t_gui_buffer *);
extern void gui_buffer_insert_string (t_gui_buffer *, char *, int);
extern t_gui_buffer *gui_switch_to_buffer_by_number (t_gui_window *, int);
extern void gui_move_buffer_to_number (t_gui_window *, int);
/* GUI dependant functions */
extern int gui_assign_color (int *, char *);
extern int gui_get_color_by_name (char *);
@@ -253,11 +279,14 @@ extern void gui_draw_buffer_infobar (t_gui_buffer *, int);
extern void gui_draw_buffer_input (t_gui_buffer *, int);
extern void gui_redraw_buffer (t_gui_buffer *);
extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *);
extern t_gui_buffer *gui_get_dcc_buffer ();
extern void gui_switch_to_dcc_buffer ();
extern void gui_switch_to_previous_buffer (t_gui_window *);
extern void gui_switch_to_next_buffer (t_gui_window *);
extern void gui_switch_to_next_window (t_gui_window *);
extern void gui_move_page_up ();
extern void gui_move_page_down ();
extern void gui_curses_resize_handler ();
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *);
extern void gui_window_split_vertic (t_gui_window *);
+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
+2 -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
@@ -31,7 +31,6 @@
#include "irc.h"
t_irc_channel *current_channel = NULL;
char *channel_modes = "iklmnst";
@@ -72,7 +71,7 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name,
server->channels = new_channel;
server->last_channel = new_channel;
gui_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;
+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
@@ -142,7 +142,7 @@ t_irc_command irc_commands[] =
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 },
@@ -151,7 +151,8 @@ t_irc_command irc_commands[] =
N_("user/password: used to get privileges on current IRC server"),
2, 2, 1, NULL, irc_cmd_send_oper, NULL },
{ "part", N_("leave a channel"),
N_("[channel[,channel]]"), 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]"),
+342 -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
@@ -24,17 +24,62 @@
#include "config.h"
#endif
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "../common/weechat.h"
#include "irc.h"
#include "../common/weeconfig.h"
#include "../common/hotlist.h"
#include "../gui/gui.h"
t_dcc *dcc_list = NULL; /* DCC files & chat list */
char *dcc_status_string[] = /* strings for DCC status */
{ N_("Waiting"), N_("Connecting"), N_("Active"), N_("Done"), N_("Failed"),
N_("Aborted") };
/*
* dcc_redraw: redraw DCC buffer (and add to hotlist)
*/
void
dcc_redraw (int highlight)
{
gui_redraw_buffer (gui_get_dcc_buffer ());
if (highlight)
{
hotlist_add (highlight, gui_get_dcc_buffer ());
gui_draw_buffer_status (gui_current_window->buffer, 0);
}
}
/*
* dcc_connect: connect to another host
*/
void
dcc_connect ()
dcc_connect (t_dcc *ptr_dcc)
{
struct sockaddr_in addr;
ptr_dcc->status = DCC_CONNECTING;
ptr_dcc->sock = socket (AF_INET, SOCK_STREAM, 0);
if (ptr_dcc->sock == -1)
return;
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (ptr_dcc->port);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK);
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
}
/*
@@ -45,3 +90,298 @@ void
dcc_send ()
{
}
/*
* dcc_free: free DCC struct and remove it from list
*/
void
dcc_free (t_dcc *ptr_dcc)
{
t_dcc *new_dcc_list;
if (ptr_dcc->prev_dcc)
{
(ptr_dcc->prev_dcc)->next_dcc = ptr_dcc->next_dcc;
new_dcc_list = dcc_list;
}
else
new_dcc_list = ptr_dcc->next_dcc;
if (ptr_dcc->next_dcc)
(ptr_dcc->next_dcc)->prev_dcc = ptr_dcc->prev_dcc;
if (ptr_dcc->nick)
free (ptr_dcc->nick);
if (ptr_dcc->filename)
free (ptr_dcc->filename);
free (ptr_dcc);
dcc_list = new_dcc_list;
}
/*
* dcc_close: close a DCC connection
*/
void
dcc_close (t_dcc *ptr_dcc, int status)
{
ptr_dcc->status = status;
if (ptr_dcc->sock != -1)
{
close (ptr_dcc->sock);
ptr_dcc->sock = -1;
}
if (ptr_dcc->file != -1)
{
close (ptr_dcc->file);
ptr_dcc->file = -1;
}
}
/*
* dcc_accept: accepts a DCC file or chat request
*/
void
dcc_accept (t_dcc *ptr_dcc)
{
char *ptr_home, *filename2;
dcc_connect (ptr_dcc);
if (ptr_dcc->sock == -1)
ptr_dcc->status = DCC_FAILED;
else
{
ptr_dcc->status = DCC_ACTIVE;
ptr_home = getenv ("HOME");
ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) +
strlen (ptr_dcc->nick) +
strlen (ptr_dcc->filename) +
((cfg_dcc_download_path[0] == '~') ?
strlen (ptr_home) : 0) +
4);
if (!ptr_dcc->local_filename)
{
ptr_dcc->status = DCC_FAILED;
dcc_redraw (1);
return;
}
if (cfg_dcc_download_path[0] == '~')
{
strcpy (ptr_dcc->local_filename, ptr_home);
strcat (ptr_dcc->local_filename, cfg_dcc_download_path + 1);
}
else
strcpy (ptr_dcc->local_filename, cfg_dcc_download_path);
if (ptr_dcc->local_filename[strlen (ptr_dcc->local_filename) - 1] != DIR_SEPARATOR_CHAR)
strcat (ptr_dcc->local_filename, DIR_SEPARATOR);
strcat (ptr_dcc->local_filename, ptr_dcc->nick);
strcat (ptr_dcc->local_filename, ".");
strcat (ptr_dcc->local_filename, ptr_dcc->filename);
/* file already exists? */
if (access (ptr_dcc->local_filename, F_OK) == 0)
{
/* if auto rename is not set, then abort DCC */
if (!cfg_dcc_auto_rename)
{
ptr_dcc->status = DCC_FAILED;
dcc_redraw (1);
return;
}
filename2 = (char *) malloc (strlen (ptr_dcc->local_filename) + 16);
if (!filename2)
{
ptr_dcc->status = DCC_FAILED;
dcc_redraw (1);
return;
}
ptr_dcc->filename_suffix = 0;
do
{
ptr_dcc->filename_suffix++;
sprintf (filename2, "%s.%d",
ptr_dcc->local_filename,
ptr_dcc->filename_suffix);
}
while (access (filename2, F_OK) == 0);
free (ptr_dcc->local_filename);
ptr_dcc->local_filename = strdup (filename2);
free (filename2);
}
ptr_dcc->file = open (ptr_dcc->local_filename,
O_CREAT | O_TRUNC | O_WRONLY,
0644);
}
dcc_redraw (1);
}
/*
* dcc_add: add a DCC file to queue
*/
t_dcc *
dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nick, char *filename,
unsigned int size)
{
t_dcc *new_dcc;
if ((new_dcc = (t_dcc *) malloc (sizeof (t_dcc))) == NULL)
{
gui_printf (NULL, _("%s not enough memory for new DCC\n"), WEECHAT_ERROR);
return NULL;
}
new_dcc->server = server;
new_dcc->type = type;
new_dcc->status = DCC_WAITING;
new_dcc->addr = addr;
new_dcc->port = port;
new_dcc->nick = strdup (nick);
new_dcc->sock = -1;
new_dcc->file = -1;
new_dcc->filename = strdup (filename);
new_dcc->local_filename = NULL;
new_dcc->filename_suffix = -1;
new_dcc->size = size;
new_dcc->pos = 0;
new_dcc->prev_dcc = NULL;
new_dcc->next_dcc = dcc_list;
if (dcc_list)
dcc_list->prev_dcc = new_dcc;
dcc_list = new_dcc;
gui_current_window->dcc_first = NULL;
gui_current_window->dcc_selected = NULL;
if (type == DCC_FILE_RECV)
{
irc_display_prefix (server->buffer, PREFIX_INFO);
gui_printf (server->buffer, _("Incoming DCC file from "));
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_NICK,
"%s",
nick);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK,
" (");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_HOST,
"%d.%d.%d.%d",
addr >> 24, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK,
")");
gui_printf (server->buffer, ": ");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_CHANNEL,
"%s",
filename);
gui_printf (server->buffer, ", ");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_CHANNEL,
"%lu",
size);
gui_printf (server->buffer, _(" bytes\n"));
}
if ( ( (type == DCC_CHAT_RECV) && (cfg_dcc_auto_accept_chats) )
|| ( (type == DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) )
dcc_accept (new_dcc);
else
dcc_redraw (2);
gui_draw_buffer_status (gui_current_window->buffer, 0);
return new_dcc;
}
/*
* dcc_handle: receive/send data for each active DCC
*/
void
dcc_handle ()
{
t_dcc *ptr_dcc;
int num;
char buffer[8192];
uint32_t pos;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if (ptr_dcc->status == DCC_ACTIVE)
{
if (ptr_dcc->type == DCC_FILE_RECV)
{
num = recv (ptr_dcc->sock, buffer, sizeof (buffer), 0);
if (num != -1)
{
if (num == 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
}
else
{
if (write (ptr_dcc->file, buffer, num) == -1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (1);
return;
}
ptr_dcc->pos += (unsigned long) num;
pos = htonl (ptr_dcc->pos);
send (ptr_dcc->sock, (char *) &pos, 4, 0);
if (ptr_dcc->pos >= ptr_dcc->size)
{
irc_display_prefix (ptr_dcc->server->buffer, PREFIX_INFO);
gui_printf (ptr_dcc->server->buffer, _("DCC: file "));
gui_printf_color (ptr_dcc->server->buffer,
COLOR_WIN_CHAT_CHANNEL,
"%s",
ptr_dcc->filename);
gui_printf (ptr_dcc->server->buffer, _(" (local filename: "));
gui_printf_color (ptr_dcc->server->buffer,
COLOR_WIN_CHAT_CHANNEL,
"%s",
ptr_dcc->local_filename);
gui_printf (ptr_dcc->server->buffer, _(") from "));
gui_printf_color (ptr_dcc->server->buffer,
COLOR_WIN_CHAT_NICK,
"%s",
ptr_dcc->nick);
gui_printf (ptr_dcc->server->buffer, _(": ok!\n"));
dcc_close (ptr_dcc, DCC_DONE);
dcc_redraw (1);
}
dcc_redraw (0);
}
}
}
}
}
}
/*
* dcc_end: close all opened sockets (called when WeeChat is exiting)
*/
void
dcc_end ()
{
t_dcc *ptr_dcc;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if (ptr_dcc->sock != -1)
{
if (ptr_dcc->status == DCC_ACTIVE)
wee_log_printf (_("aborting active DCC: \"%s\" from %s\n"),
ptr_dcc->filename, ptr_dcc->nick);
dcc_close (ptr_dcc, DCC_FAILED);
}
}
}
+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
+89 -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
@@ -76,7 +76,7 @@ irc_recv_command (t_irc_server *server, char *entire_line,
if (irc_commands[i].recv_function != NULL)
{
return_code = (int) (irc_commands[i].recv_function) (server, host, arguments);
plugin_event_msg (irc_commands[i].command_name, entire_line);
plugin_event_msg (irc_commands[i].command_name, server->name, entire_line);
return return_code;
}
@@ -99,7 +99,7 @@ irc_cmd_recv_error (t_irc_server *server, char *host, char *arguments)
if (strncmp (arguments, "Closing Link", 12) == 0)
{
server_disconnect (server);
server_disconnect (server, 1);
return 0;
}
@@ -262,11 +262,23 @@ irc_cmd_recv_kick (t_irc_server *server, char *host, char *arguments)
WEECHAT_ERROR, "kick");
return -1;
}
ptr_nick = nick_search (ptr_channel, pos_nick);
if (ptr_nick)
if (strcmp (pos_nick, server->nick) == 0)
{
nick_free (ptr_channel, ptr_nick);
/* my nick was kicked => free all nicks, channel is not active any more */
nick_free_all (ptr_channel);
gui_draw_buffer_nick (gui_current_window->buffer, 1);
gui_draw_buffer_status (gui_current_window->buffer, 1);
if (server->autorejoin)
irc_cmd_send_join (server, ptr_channel->name);
}
{
/* someone was kicked from channel (but not me) => remove only this nick */
ptr_nick = nick_search (ptr_channel, pos_nick);
if (ptr_nick)
{
nick_free (ptr_channel, ptr_nick);
gui_draw_buffer_nick (gui_current_window->buffer, 1);
}
}
return 0;
}
@@ -586,7 +598,14 @@ irc_cmd_recv_mode (t_irc_server *server, char *host, char *arguments)
else
{
/* nickname modes */
gui_printf (server->buffer, "(TODO!) nickname modes: channel=%s, args=%s\n", arguments, pos);
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, "[");
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, "%s", arguments);
gui_printf_color (server->buffer, COLOR_WIN_CHAT, "/");
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK,
"%s", (pos[0] == ':') ? pos + 1 : pos);
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, "] ");
gui_printf_color (server->buffer, COLOR_WIN_CHAT, _("mode changed by"));
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, " %s\n", host);
}
return 0;
}
@@ -685,16 +704,22 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
int
irc_cmd_recv_notice (t_irc_server *server, char *host, char *arguments)
{
char *pos, *pos2, *pos_usec;
char *host2, *pos, *pos2, *pos_usec;
struct timeval tv;
struct timezone tz;
long sec1, usec1, sec2, usec2, difftime;
host2 = NULL;
if (host)
{
pos = strchr (host, '!');
if (pos)
{
pos[0] = '\0';
host2 = pos + 1;
}
else
host2 = NULL;
}
pos = strchr (arguments, ' ');
@@ -766,7 +791,20 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *arguments)
}
else
{
irc_display_prefix (server->buffer, PREFIX_SERVER);
if (host)
{
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, "%s", host);
if (host2)
{
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, " (");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_HOST, "%s", host2);
gui_printf_color (server->buffer,
COLOR_WIN_CHAT_DARK, ")");
}
gui_printf_color (server->buffer, COLOR_WIN_CHAT, ": ");
}
gui_printf_color (server->buffer, COLOR_WIN_CHAT, "%s\n", pos);
}
}
@@ -1140,9 +1178,8 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments)
pos2--;
pos2[1] = '\0';
wee_log_printf ("Incoming DCC file (NOT DEVELOPED!): "
"\"%s\", address=\"%s\", port=\"%s\", size=\"%s\"\n",
pos_file, pos_addr, pos_port, pos_size);
dcc_add (server, DCC_FILE_RECV, (unsigned long) atol (pos_addr),
atoi (pos_port), host, pos_file, (unsigned int) atoi (pos_size));
return 0;
}
@@ -1467,6 +1504,7 @@ int
irc_cmd_recv_004 (t_irc_server *server, char *host, char *arguments)
{
char *pos;
t_irc_channel *ptr_channel;
/* make gcc happy */
(void) host;
@@ -1489,11 +1527,29 @@ irc_cmd_recv_004 (t_irc_server *server, char *host, char *arguments)
/* execute command once connected */
if (server->command && server->command[0])
{
user_command(server, server->command);
if (server->command_delay > 0)
sleep (server->command_delay);
}
/* autojoin */
if (server->autojoin && server->autojoin[0])
return irc_cmd_send_join (server, server->autojoin);
/* auto-join after disconnection (only rejoins opened channels) */
if (server->reconnect_join)
{
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->type == CHAT_CHANNEL)
server_sendf (server, "JOIN %s\r\n", ptr_channel->name);
}
server->reconnect_join = 0;
}
else
{
/* auto-join when connecting to server for first time */
if (server->autojoin && server->autojoin[0])
return irc_cmd_send_join (server, server->autojoin);
}
return 0;
}
@@ -2882,12 +2938,24 @@ irc_cmd_recv_433 (t_irc_server *server, char *host, char *arguments)
}
else
{
gui_printf (server->buffer,
_("%s: all declared nicknames are already in use, "
"closing connection with server!\n"),
PACKAGE_NAME);
server_disconnect (server);
return 0;
if (strcmp (server->nick, server->nick3) == 0)
{
gui_printf (server->buffer,
_("%s: all declared nicknames are already in use, "
"closing connection with server!\n"),
PACKAGE_NAME);
server_disconnect (server, 1);
return 0;
}
else
{
gui_printf (server->buffer,
_("%s: nickname \"%s\" is already in use, "
"trying 1st nickname \"%s\"\n"),
PACKAGE_NAME, server->nick, server->nick1);
free (server->nick);
server->nick = strdup (server->nick1);
}
}
}
+170 -12
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
@@ -89,6 +89,8 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
{
char *pos;
t_irc_server *ptr_server;
time_t elapsed;
char buffer[4096];
if (arguments && (strncmp (arguments, "-all", 4) == 0))
{
@@ -104,18 +106,62 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
if (ptr_server->is_connected)
{
if (pos)
{
ptr_server->is_away = 1;
ptr_server->away_time = time (NULL);
server_sendf (ptr_server, "AWAY :%s\r\n", pos);
if (cfg_look_display_away)
{
snprintf (buffer, sizeof (buffer), "is away: %s", pos);
irc_send_me_all_channels (ptr_server, buffer);
}
}
else
{
server_sendf (ptr_server, "AWAY\r\n");
ptr_server->is_away = 0;
elapsed = time (NULL) - ptr_server->away_time;
if (cfg_look_display_away)
{
snprintf (buffer, sizeof (buffer),
"is back (gone %.2ld:%.2ld:%.2ld)",
elapsed / 3600,
(elapsed / 60) % 60,
elapsed % 60);
irc_send_me_all_channels (ptr_server, buffer);
}
}
}
}
}
else
{
if (arguments)
{
server->is_away = 1;
server->away_time = time (NULL);
server_sendf (server, "AWAY :%s\r\n", arguments);
if (cfg_look_display_away)
{
snprintf (buffer, sizeof (buffer), "is away: %s", arguments);
irc_send_me_all_channels (server, buffer);
}
}
else
{
server_sendf (server, "AWAY\r\n");
server->is_away = 0;
elapsed = time (NULL) - server->away_time;
if (cfg_look_display_away)
{
snprintf (buffer, sizeof (buffer),
"is back (gone %.2ld:%.2ld:%.2ld)",
elapsed / 3600,
(elapsed / 60) % 60,
elapsed % 60);
irc_send_me_all_channels (server, buffer);
}
}
}
return 0;
}
@@ -306,15 +352,27 @@ irc_cmd_send_join (t_irc_server *server, char *arguments)
int
irc_cmd_send_kick (t_irc_server *server, char *arguments)
{
char *args, *pos;
if (string_is_channel (arguments))
server_sendf (server, "KICK %s\r\n", arguments);
else
{
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
{
server_sendf (server,
"KICK %s %s\r\n",
CHANNEL(gui_current_window->buffer)->name, arguments);
args = strdup (arguments);
pos = strchr (args, ' ');
if (pos)
pos[0] = '\0';
if (pos)
server_sendf (server,
"KICK %s %s :%s\r\n",
CHANNEL(gui_current_window->buffer)->name, args, pos + 1);
else
server_sendf (server,
"KICK %s %s\r\n",
CHANNEL(gui_current_window->buffer)->name, args);
free (args);
}
else
{
@@ -381,6 +439,41 @@ irc_cmd_send_lusers (t_irc_server *server, char *arguments)
return 0;
}
/*
* irc_send_me: send a ctcp action to a channel
*/
int
irc_send_me (t_irc_server *server, t_irc_channel *channel, char *arguments)
{
server_sendf (server, "PRIVMSG %s :\01ACTION %s\01\r\n",
channel->name, arguments);
irc_display_prefix (channel->buffer, PREFIX_ACTION_ME);
gui_printf_color (channel->buffer,
COLOR_WIN_CHAT_NICK, "%s", server->nick);
gui_printf_color (channel->buffer,
COLOR_WIN_CHAT, " %s\n", arguments);
return 0;
}
/*
* irc_send_me_all_channels: send a ctcp action to all channels of a server
*/
int
irc_send_me_all_channels (t_irc_server *server, char *arguments)
{
t_irc_channel *ptr_channel;
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->type == CHAT_CHANNEL)
irc_send_me (server, ptr_channel, arguments);
}
return 0;
}
/*
* irc_cmd_send_me: send a ctcp action to the current channel
*/
@@ -395,13 +488,7 @@ irc_cmd_send_me (t_irc_server *server, char *arguments)
WEECHAT_ERROR, "me");
return -1;
}
server_sendf (server, "PRIVMSG %s :\01ACTION %s\01\r\n",
CHANNEL(gui_current_window->buffer)->name, arguments);
irc_display_prefix (gui_current_window->buffer, PREFIX_ACTION_ME);
gui_printf_color (gui_current_window->buffer,
COLOR_WIN_CHAT_NICK, "%s", server->nick);
gui_printf_color (gui_current_window->buffer,
COLOR_WIN_CHAT, " %s\n", arguments);
irc_send_me (server, CHANNEL(gui_current_window->buffer), arguments);
return 0;
}
@@ -438,6 +525,7 @@ int
irc_cmd_send_msg (t_irc_server *server, char *arguments)
{
char *pos, *pos_comma;
char *msg_pwd_hidden, *pos_pwd;
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
@@ -507,6 +595,41 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
}
else
{
/* message to nickserv with identify ? */
if (strcmp (arguments, "nickserv") == 0)
{
msg_pwd_hidden = strdup (pos);
if (cfg_log_hide_nickserv_pwd)
{
pos_pwd = strstr (msg_pwd_hidden, "identify ");
if (!pos_pwd)
pos_pwd = strstr (msg_pwd_hidden, "register ");
if (pos_pwd)
{
pos_pwd += 9;
while (pos_pwd[0])
{
pos_pwd[0] = '*';
pos_pwd++;
}
}
}
gui_printf_color_type (server->buffer,
MSG_TYPE_NICK,
COLOR_WIN_CHAT_DARK, "-");
gui_printf_color_type (server->buffer,
MSG_TYPE_NICK,
COLOR_WIN_CHAT_NICK, "%s", arguments);
gui_printf_color_type (server->buffer,
MSG_TYPE_NICK,
COLOR_WIN_CHAT_DARK, "-");
gui_printf_color (server->buffer,
COLOR_WIN_CHAT, " %s\n", msg_pwd_hidden);
server_sendf (server, "PRIVMSG %s :%s\r\n", arguments, pos);
free (msg_pwd_hidden);
return 0;
}
ptr_channel = channel_search (server, arguments);
if (!ptr_channel)
{
@@ -596,7 +719,29 @@ irc_cmd_send_nick (t_irc_server *server, int argc, char **argv)
int
irc_cmd_send_notice (t_irc_server *server, char *arguments)
{
server_sendf (server, "NOTICE %s\r\n", arguments);
char *pos;
pos = strchr (arguments, ' ');
if (pos)
{
pos[0] = '\0';
pos++;
while (pos[0] == ' ')
pos++;
server_sendf (server, "NOTICE %s :%s\r\n", arguments, pos);
gui_printf_color (server->buffer, COLOR_WIN_CHAT, "notice");
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, "(");
gui_printf_color (server->buffer, COLOR_WIN_CHAT_NICK, "%s", arguments);
gui_printf_color (server->buffer, COLOR_WIN_CHAT_DARK, ")");
gui_printf_color (server->buffer, COLOR_WIN_CHAT, ": %s\n", pos);
}
else
{
gui_printf (server->buffer,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "notice");
return -1;
}
return 0;
}
@@ -734,6 +879,7 @@ irc_cmd_send_query (t_irc_server *server, char *arguments)
{
char *pos;
t_irc_channel *ptr_channel;
t_gui_buffer *ptr_buffer;
pos = strchr (arguments, ' ');
if (pos)
@@ -761,6 +907,18 @@ irc_cmd_send_query (t_irc_server *server, char *arguments)
}
gui_draw_buffer_title (ptr_channel->buffer, 1);
}
else
{
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (ptr_buffer->channel == ptr_channel)
{
gui_switch_to_buffer (gui_current_window, ptr_buffer);
gui_redraw_buffer (ptr_buffer);
break;
}
}
}
/* display text if given */
if (pos)
+107 -34
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
@@ -44,7 +44,6 @@
t_irc_server *irc_servers = NULL;
t_irc_server *last_irc_server = NULL;
t_irc_server *current_irc_server = NULL;
t_irc_message *recv_msgq, *msgq_last_msg;
@@ -60,7 +59,9 @@ void
server_init (t_irc_server *server)
{
server->name = NULL;
server->autoconnect = 0;
server->autoconnect = 1;
server->autoreconnect = 1;
server->autoreconnect_delay = 30;
server->command_line = 0;
server->address = NULL;
server->port = -1;
@@ -71,9 +72,12 @@ 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->is_connected = 0;
server->reconnect_start = 0;
server->reconnect_join = 0;
server->sock4 = -1;
server->is_away = 0;
server->server_read = -1;
@@ -291,9 +295,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 +309,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 +336,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
@@ -453,23 +464,33 @@ 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);
else
strcpy (unterminated_message, buffer);
return;
pos[0] = '\0';
server_msgq_add_msg (server, buffer);
buffer = pos + 1;
}
else
{
pos = strchr (buffer, '\0');
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);
else
strcpy (unterminated_message, buffer);
return;
}
gui_printf (server->buffer,
_("%s unable to explode received buffer\n"),
WEECHAT_ERROR);
}
gui_printf (server->buffer,
_("%s unable to explode received buffer\n"),
WEECHAT_ERROR);
}
}
}
@@ -584,6 +605,13 @@ server_recv (t_irc_server *server)
server_msgq_add_buffer (server, buffer);
server_msgq_flush ();
}
else
{
gui_printf (server->buffer,
_("%s cannot read data from socket, disconnecting from server...\n"),
WEECHAT_ERROR);
server_disconnect (server, 1);
}
}
/*
@@ -686,11 +714,34 @@ server_connect (t_irc_server *server)
server->sock4 = -1;
return 0;
}
current_irc_server = server;
return 1;
}
/*
* server_reconnect: reconnect to a server (after disconnection)
*/
void
server_reconnect (t_irc_server *server)
{
gui_printf (server->buffer, _("%s: Reconnecting to server...\n"),
PACKAGE_NAME);
server->reconnect_start = 0;
if (server_connect (server))
{
server->reconnect_join = 1;
irc_login (server);
}
else
{
server->reconnect_start = time (NULL);
gui_printf (server->buffer, _("%s: Reconnecting to server in %d seconds\n"),
PACKAGE_NAME, server->autoreconnect_delay);
}
}
/*
* server_auto_connect: auto-connect to servers (called at startup)
*/
@@ -706,7 +757,7 @@ 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);
(void) gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1);
if (server_connect (ptr_server))
irc_login (ptr_server);
}
@@ -718,7 +769,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 +779,39 @@ 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;
gui_draw_buffer_nick (gui_current_window->buffer, 1);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
/* close communication with server */
if (server->server_read >= 0)
close (server->server_read);
server->server_read = -1;
if (server->server_write >= 0)
close (server->server_write);
server->server_write = -1;
if (server->sock4 >= 0)
close (server->sock4);
server->sock4 = -1;
server->is_connected = 0;
server->is_away = 0;
if ((reconnect) && (server->autoreconnect))
{
server->reconnect_start = time (NULL);
gui_printf (server->buffer, _("%s: Reconnecting to server in %d seconds\n"),
PACKAGE_NAME, server->autoreconnect_delay);
}
else
server->reconnect_start = 0;
}
/*
@@ -751,7 +824,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);
}
/*
+70 -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,8 +21,11 @@
#ifndef __WEECHAT_IRC_H
#define __WEECHAT_IRC_H 1
#include <time.h>
#include "../gui/gui.h"
/* prefixes for chat window */
#define PREFIX_SERVER "-@-"
#define PREFIX_INFO "-=-"
#define PREFIX_ACTION_ME "-*-"
@@ -34,6 +37,8 @@
#define CHANNEL_PREFIX "#&+!"
/* channel modes */
#define NUM_CHANNEL_MODES 7
#define CHANNEL_MODE_INVITE 0
#define CHANNEL_MODE_KEY 1
@@ -50,6 +55,20 @@
#define DEFAULT_IRC_PORT 6667
/* DCC types & status */
#define DCC_CHAT_RECV 0 /* receiving DCC chat */
#define DCC_CHAT_SEND 1 /* sending DCC chat */
#define DCC_FILE_RECV 2 /* incoming DCC file */
#define DCC_FILE_SEND 3 /* sending DCC file */
#define DCC_WAITING 0 /* waiting for host answer */
#define DCC_CONNECTING 1 /* connecting to host */
#define DCC_ACTIVE 2 /* sending/receiving data */
#define DCC_DONE 3 /* transfer done */
#define DCC_FAILED 4 /* DCC failed */
#define DCC_ABORTED 5 /* DCC aborted by user */
/* nick types */
typedef struct t_irc_nick t_irc_nick;
@@ -97,6 +116,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,13 +128,18 @@ 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 */
int is_connected; /* 1 if WeeChat is connected to server */
time_t reconnect_start; /* this time + delay = reconnect time */
int reconnect_join; /* 1 if channels opened to rejoin */
int sock4; /* socket for server */
int is_away; /* 1 is user is marker as away */
time_t away_time; /* time() when user marking as away */
int server_read; /* pipe for reading server data */
int server_write; /* pipe for sending data to server */
t_gui_buffer *buffer; /* GUI buffer allocated for server */
@@ -143,6 +169,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 +180,34 @@ struct t_irc_message
t_irc_message *next_message; /* link to next message */
};
/* DCC */
typedef struct t_dcc t_dcc;
struct t_dcc
{
t_irc_server *server; /* irc server */
int type; /* DCC type (send or receive) */
int status; /* DCC status (waiting, sending, ..) */
unsigned long addr; /* IP address */
int port; /* port */
char *nick; /* remote nick */
int sock; /* socket for connection */
int file; /* local file (for reading or writing) */
char *filename; /* filename (given by sender) */
char *local_filename; /* local filename (with path) */
int filename_suffix; /* suffix (.1 for ex) if renaming file */
unsigned long size; /* file size */
unsigned long pos; /* number of bytes received/sent */
t_dcc *prev_dcc; /* link to previous dcc file/chat */
t_dcc *next_dcc; /* link to next dcc file/chat */
};
extern t_irc_command irc_commands[];
extern t_irc_server *irc_servers, *current_irc_server;
extern t_irc_server *irc_servers;
extern t_irc_message *recv_msgq, *msgq_last_msg;
extern t_irc_channel *current_channel;
extern t_dcc *dcc_list;
extern char *dcc_status_string[6];
extern char *channel_modes;
/* server functions (irc-server.c) */
@@ -166,14 +218,16 @@ 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 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 ();
@@ -201,6 +255,13 @@ extern int nick_get_max_length (t_irc_channel *);
/* DCC functions (irc-dcc.c) */
extern void dcc_send ();
extern void dcc_free (t_dcc *);
extern void dcc_close (t_dcc *, int);
extern void dcc_accept (t_dcc *);
extern t_dcc *dcc_add (t_irc_server *, int, unsigned long, int, char *, char *,
unsigned int);
extern void dcc_handle ();
extern void dcc_end ();
/* IRC display (irc-diplay.c) */
@@ -230,6 +291,8 @@ 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 *);
+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
+92 -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
@@ -226,6 +226,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, ...)
*/
@@ -284,17 +333,37 @@ static XS (XS_IRC_add_command_handler)
static XS (XS_IRC_get_info)
{
char *arg, *info = NULL;
char *arg, *info = NULL, *server;
t_irc_server *ptr_server;
int integer;
dXSARGS;
/* make gcc happy */
(void) items;
(void) cv;
arg = SvPV (ST (0), integer);
if (items == 2)
{
server = SvPV (ST (0), integer);
arg = SvPV (ST (1), integer);
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
if (strcasecmp (ptr_server->name, server) == 0)
break;
}
if (!ptr_server)
{
irc_display_prefix (NULL, PREFIX_ERROR);
gui_printf (NULL,
_("Perl error: server not found for IRC::get_info Perl function\n"));
}
}
else
{
ptr_server = SERVER(gui_current_window->buffer);
arg = SvPV (ST (0), integer);
}
if (arg)
if (ptr_server && arg)
{
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
@@ -303,7 +372,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 +382,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 +391,7 @@ static XS (XS_IRC_get_info)
}
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
{
XST_mIV (0, current_irc_server->is_away);
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
XSRETURN (1);
return;
}
@@ -346,6 +417,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");
@@ -424,9 +496,9 @@ wee_perl_search (char *name)
*/
int
wee_perl_exec (char *function, char *arguments)
wee_perl_exec (char *function, char *server, char *arguments)
{
char *argv[2];
char *argv[3];
int count, return_code;
SV *sv;
@@ -435,8 +507,12 @@ wee_perl_exec (char *function, char *arguments)
ENTER;
SAVETMPS;
PUSHMARK(sp);
argv[0] = arguments;
argv[1] = NULL;
if (!server)
argv[0] = strdup ("");
else
argv[0] = server;
argv[1] = arguments;
argv[2] = NULL;
count = perl_call_argv (function, G_EVAL | G_SCALAR, argv);
SPAGAIN;
@@ -480,7 +556,9 @@ wee_perl_load (char *filename)
{
/* execute Perl script */
wee_log_printf (_("loading Perl script \"%s\"\n"), filename);
return wee_perl_exec ("wee_perl_load_eval_file", filename);
irc_display_prefix (NULL, PREFIX_PLUGIN);
gui_printf (NULL, _("Loading Perl script \"%s\"\n"), filename);
return wee_perl_exec ("wee_perl_load_eval_file", filename, "");
}
/*
@@ -533,7 +611,7 @@ wee_perl_unload (t_plugin_script *ptr_perl_script)
/* call shutdown callback function */
if (ptr_perl_script->shutdown_func[0])
wee_perl_exec (ptr_perl_script->shutdown_func, "");
wee_perl_exec (ptr_perl_script->shutdown_func, "", "");
wee_perl_script_free (ptr_perl_script);
}
}
+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 ();
+5 -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
@@ -273,7 +273,7 @@ plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
*/
void
plugin_event_msg (char *irc_command, char *arguments)
plugin_event_msg (char *irc_command, char *arguments, char *server)
{
#ifdef PLUGINS
t_plugin_handler *ptr_plugin_handler;
@@ -285,7 +285,7 @@ plugin_event_msg (char *irc_command, char *arguments)
{
#ifdef PLUGIN_PERL
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
#endif
}
}
@@ -301,7 +301,7 @@ plugin_event_msg (char *irc_command, char *arguments)
*/
int
plugin_exec_command (char *user_command, char *arguments)
plugin_exec_command (char *user_command, char *arguments, char *server)
{
#ifdef PLUGINS
t_plugin_handler *ptr_plugin_handler;
@@ -313,7 +313,7 @@ plugin_exec_command (char *user_command, char *arguments)
{
#ifdef PLUGIN_PERL
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
wee_perl_exec (ptr_plugin_handler->function_name, arguments);
wee_perl_exec (ptr_plugin_handler->function_name, arguments, server);
#endif
/* command executed */
+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 "January 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
+6 -2
View File
@@ -1,5 +1,5 @@
%define name weechat
%define version 0.0.7
%define version 0.0.9
%define release 1
Name: %{name}
@@ -37,10 +37,14 @@ 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 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
+2 -2
View File
@@ -21,8 +21,8 @@ Bounga <bounga@altern.org>
Jabber: Bounga@jabber.org
ICQ : 178297842
Xahlexx <xahlexx@tuxisland.org>
Web : http://www.tuxisland.org
Xahlexx <xahlexx@weeland.org>
Web : http://www.weeland.org
IRC : nick is "xahlexx"
+2 -5
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2004-08-08
WeeChat known bugs, 2005-01-01
- ./configure does not check that Curses headers are installed
- ./configure does not check that Gtk 2.0 libraries are installed
@@ -10,12 +10,9 @@ WeeChat known bugs, 2004-08-08
- problem when resizing terminal and that some windows are outside new term size
- some IRC commands are marked as 'unknown' when received
(IRC protocol is under dev!)
- too much opened channels => display bug
- when kicked, channel is not prefixed by '(' and sufixed by ')'
- when function key (non used by WeeChat) is pressed, prompt is deleted
- when quitting WeeChat term title is not restored (if look_set_title is ON)
- command name for /server can not contain spaces
- wrong alias is not created and not saved when quitting WeeChat
- when many WeeChat are launched, log file is not properly written (cleared by
each WeeChat at startup)
- display problems with old Konsole versions (Kde terminal)
- display problems with old Konsole versions (Kde terminal) (???)
+34 -1
View File
@@ -1,9 +1,42 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2004-08-08
ChangeLog - 2005-01-01
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
+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 : 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
+8
View File
@@ -1,6 +1,14 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* 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 -3
View File
@@ -24,7 +24,7 @@ Copyright
WeeChat (c) Copyright 2004
by: FlashCode <flashcode@flashtux.org>
Xahlexx <xahlex@tuxisland.org>
Xahlexx <xahlex@weeland.org>
Bounga <bounga@altern.org>
(see AUTHORS file if you want to contact authors)
@@ -46,6 +46,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
---
(1) only curses interface is available today
(2) plugin interfaces are not yet developed
(1) only Curses interface is available today
(2) only Perl interface is available today
(3) only GNU/Linux version is available today
+3 -6
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2004-08-08
TODO - 2005-01-01
Legend:
# done
@@ -10,7 +10,7 @@ Legend:
? is this really necessary?
v0.0.8:
v0.0.9:
------
* General:
@@ -21,8 +21,6 @@ v0.0.8:
+ "/dcc" command (for chat and sending/receiving files)
* 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)
+ internationalization (traduce WeeChat in many languages)
@@ -67,8 +65,7 @@ Future versions:
- 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
- tab key with empty command line should switch to next window (like F7)
? Qt GUI
* TCP/IP communication:
+9 -5
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.0.9, 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.0.9])
# Checks for programs.
AC_PROG_CC
@@ -108,10 +108,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
+12
View File
@@ -1,3 +1,15 @@
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.
+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, 01 Jan 2005 13: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:
+5 -6
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
@@ -50,10 +47,9 @@ install: build
binary-indep: build install
dh_testdir -pweechat-common
dh_testroot -pweechat-common
dh_installchangelogs -pweechat-common
dh_installchangelogs ChangeLog -pweechat-common
dh_installdocs -pweechat-common
dh_installexamples -pweechat-common
dh_installman weechat.1 -pweechat-common
dh_compress -pweechat-common
dh_fixperms -pweechat-common
dh_installdeb -pweechat-common
@@ -66,6 +62,9 @@ binary-indep: build install
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installchangelogs -a
dh_installdocs -a
dh_installman weechat-curses.1 -pweechat-curses
dh_link -a
dh_strip -a
dh_compress -a
-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
+109 -33
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.0.9 - January, 01 2005
@image{weechat_image}
@@ -48,7 +48,7 @@ This manual documents WeeChat IRC client, it is part of WeeChat.@*
Latest version of this document can be found on this page:@*
@uref{http://weechat.flashtux.org/doc.php?lang=en}@*
@*
Copyright @copyright{} 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
@@ -292,6 +292,9 @@ Type: boolean (values: 'on' or 'off'), default value: 'off'@*
@item look_nick_completor
The string inserted after nick completion@*
Type: string (any string), default value: ':'@*
@item look_display_away
Display message to all channels when (un)marking as away@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item look_infobar
Enable info bar@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@@ -343,15 +346,18 @@ Type: color (Curses or Gtk color), default value: 'default'@*
@item col_status
Color for status bar@*
Type: color (Curses or Gtk color), default value: 'gray'@*
@item col_status_delimiters
Color for status bar delimiters@*
Type: color (Curses or Gtk color), default value: 'cyan'@*
@item col_status_data_msg
Color for window with new messages (status bar)@*
Type: color (Curses or Gtk color), default value: '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: 'gray'@*
@item col_status_more
Color for window with new data (status bar)@*
Type: color (Curses or Gtk color), default value: 'white'@*
@@ -403,13 +409,37 @@ Type: color (Curses or Gtk color), default value: 'gray'@*
@item col_nick_bg
Background for nicknames@*
Type: color (Curses or Gtk color), default value: 'default'@*
@item col_chat_dcc_selected
Color for selected DCC (chat window)@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_dcc_waiting
Color for "waiting" dcc status@*
Type: color (Curses or Gtk color), default value: 'white'@*
@item col_dcc_connecting
Color for "connecting" dcc status@*
Type: color (Curses or Gtk color), default value: 'yellow'@*
@item col_dcc_active
Color for "active" dcc status@*
Type: color (Curses or Gtk color), default value: 'lightblue'@*
@item col_dcc_done
Color for "done" dcc status@*
Type: color (Curses or Gtk color), default value: 'lightgreen'@*
@item col_dcc_failed
Color for "failed" dcc status@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item col_dcc_aborted
Color for "aborted" dcc status@*
Type: color (Curses or Gtk color), default value: 'lightred'@*
@item history_max_lines
Maximum number of lines in history for one server/channel/private window (0 = unlimited)@*
Type: integer (values: between 0 and 2147483647), default value: 4096@*
@item history_max_commands
Maximum number of user commands in history (0 = unlimited)@*
Type: integer (values: between 0 and 2147483647), default value: 100@*
@item log_auto_channels
@item log_auto_server
Automatically log server messages@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item log_auto_channel
Automatically log channel chats@*
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item log_auto_private
@@ -418,30 +448,24 @@ Type: boolean (values: 'on' or 'off'), default value: 'on'@*
@item log_path
Path for WeeChat log files@*
Type: string (any string), default value: '~/.weechat/logs/'@*
@item log_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 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'@*
@item dcc_timeout
Timeout for dcc request (in seconds)@*
Type: integer (values: between 1 and 2147483647), default value: 300@*
@item dcc_blocksize
Block size for dcc packets in bytes (default: 1024)@*
Type: integer (values: between 1024 and 102400), default value: 1024@*
@item dcc_download_path
Path for writing incoming files with dcc (default: user home)@*
Type: string (any string), default value: '~'@*
@@ -472,6 +496,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 deconds) 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 +529,15 @@ 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 3600), default value: 1@*
@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:@*
@@ -550,13 +586,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
@@ -579,6 +618,12 @@ Switch to previous / next buffer@*
@*
@item F8
Switch to next window@*
@*
@item F10
Remove last infobar message@*
@*
@item Ctrl + L
Redraw whole window@*
@*
@item Alt + left arrow / Alt + right arrow
Same as F6 / F7@*
@@ -586,12 +631,21 @@ Same as F6 / F7@*
@item Alt + A
Switch to next buffer with activity (with priority: highlight, message, other)@*
@*
@item Alt + D
Display current DCC@*
@*
@item Alt + R
Clear hotlist (activity notification on other buffers)@*
@*
@item Alt + 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@*
@*
@item F10
Remove last infobar message@*
@*
@end table
@node WeeChat commands, , Key bindings, Usage
@@ -718,7 +772,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 +798,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
@@ -795,9 +874,6 @@ Bounga
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -840,7 +916,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
+111 -35
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.0.9 - 1er Janvier 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
@@ -292,6 +292,9 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'off'@*
@item look_nick_completor
La cha@^ine affich@'ee apr@`es la compl@'etion des utilisateurs@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ':'@*
@item look_display_away
Affiche un message sur tous les canaux pour l'absence/le retour@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item look_infobar
Active la barre d'infos@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@@ -343,15 +346,18 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_status
Couleur pour la barre de statut@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
@item col_status_delimiters
Couleur pour les d@'elimiteurs de la barre de statut@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'cyan'@*
@item col_status_data_msg
Couleur pour une fen@^etre avec de nouvelles infos (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: '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: 'gray'@*
@item col_status_more
Couleur pour une fen@^etre avec des nouvelles donn@'ees (barre de statut)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@@ -403,13 +409,37 @@ Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'gray'@*
@item col_nick_bg
Couleur de fond pour les pseudos@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'default'@*
@item col_chat_dcc_selected
Couleur pour le DCC s@'electionn@'e (fen@^etre de discussion)@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@item col_dcc_waiting
Couleur pour le statut dcc "attente"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'white'@*
@item col_dcc_connecting
Couleur pour le statut dcc "connexion"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'yellow'@*
@item col_dcc_active
Couleur pour le statut dcc "actif"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightblue'@*
@item col_dcc_done
Couleur pour le statut dcc "termin@'e"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightgreen'@*
@item col_dcc_failed
Couleur pour le statut dcc "@'echou@'e"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
@item col_dcc_aborted
Couleur pour le statut dcc "interrompu"@*
Type: couleur (couleur Curses ou Gtk), valeur par d@'efaut: 'lightred'@*
@item history_max_lines
Nombre maximum de lignes dans l'historique pour un serveur/fen@^etre/fen@^etre priv@'ee (0 = sans limite)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 4096@*
@item history_max_commands
Nombre maximum de commandes utilisateur dans l'historique (0 = sans limite)@*
Type: entier (valeurs: entre 0 et 2147483647), valeur par d@'efaut: 100@*
@item log_auto_channels
@item log_auto_server
Enregistrer automatiquement les messages du serveur@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item log_auto_channel
Enregistrer automatiquement les conversations des canaux@*
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item log_auto_private
@@ -418,30 +448,24 @@ Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
@item log_path
Chemin pour les conversations sauvegard@'ees par WeeChat@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~/.weechat/logs/'@*
@item log_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 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'@*
@item dcc_timeout
D@'elai d'attente pour les requ@^etes dcc (en secondes)@*
Type: entier (valeurs: entre 1 et 2147483647), valeur par d@'efaut: 300@*
@item dcc_blocksize
Taille de bloc pour les paquets dcc en octets (d@'efaut: 1024)@*
Type: entier (valeurs: entre 1024 et 102400), valeur par d@'efaut: 1024@*
@item dcc_download_path
Chemin pour @'ecrire les fichiers re@,{c}us par dcc (par d@'efaut: r@'epertoire de l'utilisateur)@*
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '~'@*
@@ -472,6 +496,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 +529,15 @@ 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 3600), valeur par d@'efaut: 1@*
@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 :@*
@@ -550,13 +586,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
@@ -579,19 +618,34 @@ Aller au tampon pr@'ec@'edent@*
@*
@item F8
Aller @`a la fen@^etre suivante@*
@*
@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@item Ctrl + L
R@'eaffiche toute la fen@^etre@*
@*
@item Alt + fl@`eche gauche / Alt + fl@`eche droite
Identique @`a F6 / F7@*
@*
@item Alt + A
Sauter au tampon avec activit@'e (avec priorit@'e: highlight, message, autre)@*
@*
@item Alt + D
Afficher les DCC en cours@*
@*
@item Alt + R
Vide la hotlist (notification d'activité sur les autres tampons)@*
@*
@item Alt + S
Sauter au tampon du serveur@*
@*
@item Alt + X
Sauter au premier canal du serveur suivant (ou tampon du serveur si aucun canal ouvert)@*
@*
@item Alt + chiffre (1-9)
Sauter au tampon avec ce num@'ero@*
@*
@item F10
Effacer le dernier message de la barre d'infos@*
@*
@end table
@node Commandes WeeChat, , Raccourcis clavier, Utilisation
@@ -719,7 +773,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 +799,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
@@ -795,9 +874,6 @@ Bounga
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -840,7 +916,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
+55 -13
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.0.9 - 1 de Janeiro 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
@@ -247,13 +247,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
@@ -274,18 +277,36 @@ Navegar no hist@'orico da janela@*
@item F6 / F7
Ir para a janela anterior/seguinte@*
@*
@item F8
Comute @`a janela 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 F6 / F7@*
@*
@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@*
@*
@item F10
Apagar a @'ultima mensagem da barra do info@*
@*
@end table
@node Comandos do WeeChat, , Recursos de teclado, Utilizacao
@@ -438,6 +459,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
@@ -485,9 +530,6 @@ Bounga
@item
Xahlexx
<@email{xahlexx@@tuxfamily.org, xahlexx AT tuxfamily.org}>
@item
Crevetor
<@email{crevetor@@caramail.com, crevetor AT caramail.com}>
@end itemize
@@ -528,7 +570,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}>@*
@*
+2
View File
@@ -6,6 +6,7 @@
./src/irc/irc-display.c
./src/irc/irc-send.c
./src/irc/irc-recv.c
./src/irc/irc-dcc.c
./src/plugins/perl/wee-perl.c
./src/plugins/perl/wee-perl.h
./src/plugins/plugins.c
@@ -23,6 +24,7 @@
./src/common/command.h
./src/common/completion.h
./src/common/history.h
./src/common/log.c
./src/common/weechat.h
./src/common/weeconfig.c
./src/common/weeconfig.h
+868 -618
View File
File diff suppressed because it is too large Load Diff
+858 -610
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
+4 -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
@@ -30,4 +30,6 @@ lib_weechat_main_a_SOURCES = weechat.c \
history.c \
history.h \
hotlist.c \
hotlist.h
hotlist.h \
log.c \
log.h
+200 -43
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
@@ -46,8 +46,10 @@ t_weechat_command weechat_commands[] =
{ "buffer", N_("manage buffers"),
N_("[action | number]"),
N_("action: action to do:\n"
" move move buffer in the list (may be relative, for example -1)\n"
" list list opened buffers (no parameter implies this list)\n"
" move move buffer in the list (may be relative, for example -1)\n"
" close close buffer (for channel: same as /part without part message)\n"
" list list opened buffers (no parameter implies this list)\n"
" notify set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
"number: jump to buffer by number"),
0, MAX_ARGS, weechat_cmd_buffer, NULL },
{ "clear", N_("clear window(s)"),
@@ -66,7 +68,7 @@ t_weechat_command weechat_commands[] =
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
0, 1, weechat_cmd_help, NULL },
{ "perl", N_("list/load/unload Perl scripts"),
N_("[load filename] | [unload]"),
N_("[load filename] | [autoload] | [unload]"),
N_("filename: Perl script (file) to load\n"
"Without argument, /perl command lists all loaded Perl scripts."),
0, 2, weechat_cmd_perl, NULL },
@@ -539,7 +541,7 @@ exec_weechat_command (t_irc_server *server, char *string)
ptr_args = NULL;
}
if (!plugin_exec_command (command + 1, ptr_args))
if (!plugin_exec_command (command + 1, (server) ? server->name : "", ptr_args))
{
argv = explode_string (ptr_args, " ", 0, &argc);
@@ -832,37 +834,193 @@ weechat_cmd_alias (char *arguments)
int
weechat_cmd_buffer (int argc, char **argv)
{
int number;
t_gui_buffer *ptr_buffer;
t_irc_server *ptr_server;
long number;
char *error;
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
{
/* list opened bufferss */
gui_printf (NULL, "buffer list -- NOT DEVELOPED!\n");
/* list opened buffers */
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf (NULL, _("Opened buffers:\n"));
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "[");
gui_printf (NULL, "%d", ptr_buffer->number);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "] ");
if (ptr_buffer->dcc)
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "DCC\n");
else if (BUFFER_IS_SERVER (ptr_buffer))
{
gui_printf (NULL, _("Server: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
"%s\n", SERVER(ptr_buffer)->name);
}
else if (BUFFER_IS_CHANNEL (ptr_buffer))
{
gui_printf (NULL, _("Channel: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
"%s", CHANNEL(ptr_buffer)->name);
gui_printf (NULL, _(" (server: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
"%s", SERVER(ptr_buffer)->name);
gui_printf (NULL, ")\n");
}
else if (BUFFER_IS_PRIVATE (ptr_buffer))
{
gui_printf (NULL, _("Private with: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_NICK,
"%s", CHANNEL(ptr_buffer)->name);
gui_printf (NULL, _(" (server: "));
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
"%s", SERVER(ptr_buffer)->name);
gui_printf (NULL, ")\n");
}
}
}
else
{
if (strcasecmp (argv[0], "move") == 0)
{
/* move buffer to another number in the list */
gui_printf (NULL, "buffer move -- NOT DEVELOPED!\n");
}
else
{
number = strtol (argv[0], &error, 10);
if (error)
if (argc < 2)
{
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"),
WEECHAT_ERROR, "buffer");
return -1;
}
error = NULL;
number = strtol (((argv[1][0] == '+') || (argv[1][0] == '-')) ? argv[1] + 1 : argv[1],
&error, 10);
if ((error) && (error[0] == '\0'))
{
if (argv[1][0] == '+')
gui_move_buffer_to_number (gui_current_window,
gui_current_window->buffer->number + ((int) number));
else if (argv[1][0] == '-')
gui_move_buffer_to_number (gui_current_window,
gui_current_window->buffer->number - ((int) number));
else
gui_move_buffer_to_number (gui_current_window, (int) number);
}
else
{
/* invalid number */
gui_printf (NULL, _("%s incorrect buffer number\n"),
WEECHAT_ERROR);
return -1;
}
if (!gui_switch_to_buffer_by_number (gui_current_window, number))
}
else if (strcasecmp (argv[0], "close") == 0)
{
/* close buffer (server or channel/private) */
if ((!gui_current_window->buffer->next_buffer)
&& (gui_current_window->buffer == gui_buffers))
{
gui_printf (NULL,
_("%s buffer \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, argv[0], "buffer");
gui_printf (gui_current_window->buffer,
_("%s can not close the single buffer\n"),
WEECHAT_ERROR);
return -1;
}
if (BUFFER_IS_SERVER(gui_current_window->buffer))
{
if (SERVER(gui_current_window->buffer)->channels)
{
gui_printf (gui_current_window->buffer,
_("%s can not close server buffer while channels "
"are opened\n"),
WEECHAT_ERROR);
return -1;
}
server_disconnect (SERVER(gui_current_window->buffer), 0);
ptr_server = SERVER(gui_current_window->buffer);
gui_buffer_free (gui_current_window->buffer, 1);
ptr_server->buffer = NULL;
}
else
irc_cmd_send_part (SERVER(gui_current_window->buffer), NULL);
}
else if (strcasecmp (argv[0], "notify") == 0)
{
/* set notify level for buffer */
if (argc < 2)
{
/* display notify level for all buffers */
irc_display_prefix (NULL, PREFIX_INFO);
gui_printf (NULL, _("Notify levels: "));
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
gui_printf (NULL, "%d.%s:",
ptr_buffer->number,
(ptr_buffer->dcc) ? "DCC" :
((BUFFER_IS_SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
CHANNEL(ptr_buffer)->name));
if (ptr_buffer->dcc)
gui_printf (NULL, "-");
else
gui_printf (NULL, "%d", ptr_buffer->notify_level);
if (ptr_buffer->next_buffer)
gui_printf (NULL, " ");
}
gui_printf (NULL, "\n");
}
else
{
error = NULL;
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0'))
{
if ((number < 0) || (number > 3))
{
/* invalid highlight level */
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
WEECHAT_ERROR);
return -1;
}
gui_current_window->buffer->notify_level = number;
}
else
{
/* invalid number */
gui_printf (NULL, _("%s incorrect notify level (must be between 0 and 3)\n"),
WEECHAT_ERROR);
return -1;
}
}
}
else
{
/* jump to buffer by number */
error = NULL;
number = strtol (argv[0], &error, 10);
if ((error) && (error[0] == '\0'))
{
if (!gui_switch_to_buffer_by_number (gui_current_window, (int) number))
{
gui_printf (NULL,
_("%s buffer \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, argv[0], "buffer");
return -1;
}
}
else
{
/* invalid number */
gui_printf (NULL, _("%s incorrect buffer number\n"),
WEECHAT_ERROR);
return -1;
}
}
}
return 0;
@@ -900,7 +1058,6 @@ int
weechat_cmd_connect (int argc, char **argv)
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
/* make gcc happy */
(void) argc;
@@ -917,18 +1074,14 @@ weechat_cmd_connect (int argc, char **argv)
}
if (!ptr_server->buffer)
{
if (!gui_buffer_new (gui_current_window, ptr_server, NULL, 1))
if (!gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1))
return -1;
}
if (server_connect (ptr_server))
{
ptr_server->reconnect_start = 0;
ptr_server->reconnect_join = (ptr_server->channels) ? 1 : 0;
irc_login (ptr_server);
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (ptr_channel->type == CHAT_CHANNEL)
server_sendf (ptr_server, "JOIN %s\r\n", ptr_channel->name);
}
}
}
else
@@ -956,14 +1109,17 @@ weechat_cmd_disconnect (int argc, char **argv)
ptr_server = server_search (argv[0]);
if (ptr_server)
{
if (!ptr_server->is_connected)
if ((!ptr_server->is_connected) && (ptr_server->reconnect_start == 0))
{
gui_printf (NULL,
gui_printf (ptr_server->buffer,
_("%s not connected to server \"%s\"!\n"),
WEECHAT_ERROR, argv[0]);
return -1;
}
server_disconnect (ptr_server);
if (ptr_server->reconnect_start > 0)
gui_printf (ptr_server->buffer,
_("Auto-reconnection is cancelled\n"));
server_disconnect (ptr_server, 0);
gui_draw_buffer_status (gui_current_window->buffer, 1);
}
else
@@ -992,13 +1148,13 @@ weechat_cmd_help (int argc, char **argv)
for (i = 0; weechat_commands[i].command_name; i++)
gui_printf (NULL, " %s - %s\n",
weechat_commands[i].command_name,
weechat_commands[i].command_description);
_(weechat_commands[i].command_description));
gui_printf (NULL, _("> List of IRC commands:\n"));
for (i = 0; irc_commands[i].command_name; i++)
if (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
gui_printf (NULL, " %s - %s\n",
irc_commands[i].command_name,
irc_commands[i].command_description);
_(irc_commands[i].command_description));
}
if (argc == 1)
{
@@ -1013,14 +1169,12 @@ weechat_cmd_help (int argc, char **argv)
gui_printf (NULL,
_("Syntax: /%s %s\n"),
weechat_commands[i].command_name,
(weechat_commands[i].
arguments) ? weechat_commands[i].
arguments : "");
(weechat_commands[i].arguments) ?
_(weechat_commands[i].arguments) : "");
if (weechat_commands[i].arguments_description)
{
gui_printf (NULL, "%s\n",
weechat_commands[i].
arguments_description);
_(weechat_commands[i].arguments_description));
}
return 0;
}
@@ -1035,12 +1189,11 @@ weechat_cmd_help (int argc, char **argv)
gui_printf (NULL, _("Syntax: /%s %s\n"),
irc_commands[i].command_name,
(irc_commands[i].arguments) ?
irc_commands[i].arguments : "");
_(irc_commands[i].arguments) : "");
if (irc_commands[i].arguments_description)
{
gui_printf (NULL, "%s\n",
irc_commands[i].
arguments_description);
_(irc_commands[i].arguments_description));
}
return 0;
}
@@ -1137,6 +1290,8 @@ weechat_cmd_perl (int argc, char **argv)
break;
case 1:
if (strcmp (argv[0], "autoload") == 0)
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
if (strcmp (argv[0], "unload") == 0)
{
/* unload all Perl scripts */
@@ -1475,11 +1630,13 @@ weechat_cmd_server (int argc, char **argv)
}
/* create new server */
new_server = server_new (server.name, server.autoconnect, 0,
server.address, server.port, server.password,
new_server = server_new (server.name, server.autoconnect,
server.autoreconnect,
server.autoreconnect_delay,
0, server.address, server.port, server.password,
server.nick1, server.nick2, server.nick3,
server.username, server.realname,
server.command, server.autojoin);
server.command, 1, server.autojoin, 1);
if (new_server)
{
irc_display_prefix (NULL, PREFIX_INFO);
@@ -1499,7 +1656,7 @@ weechat_cmd_server (int argc, char **argv)
if (new_server->autoconnect)
{
(void) gui_buffer_new (gui_current_window, new_server, NULL, 1);
(void) gui_buffer_new (gui_current_window, new_server, NULL, 0, 1);
if (server_connect (new_server))
irc_login (new_server);
}
+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,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 -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;
+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
+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 */
+149
View File
@@ -0,0 +1,149 @@
/*
* 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"
/*
* log_write_date: writes date to log file
*/
void
log_write_date (t_gui_buffer *buffer)
{
static char buf_time[256];
static time_t seconds;
struct tm *date_tmp;
if (buffer->log_file)
{
seconds = time (NULL);
date_tmp = localtime (&seconds);
if (date_tmp)
{
strftime (buf_time, sizeof (buf_time) - 1, cfg_log_timestamp, date_tmp);
fprintf (buffer->log_file, "%s ", buf_time);
fflush (buffer->log_file);
}
}
}
/*
* log_write: writes a message to log file
*/
void
log_write (t_gui_buffer *buffer, char *message)
{
if (buffer->log_file)
{
fprintf (buffer->log_file, "%s", message);
fflush (buffer->log_file);
}
}
/*
* log_start: starts a log
*/
void
log_start (t_gui_buffer *buffer)
{
int length;
char *ptr_home;
ptr_home = getenv ("HOME");
length = strlen (cfg_log_path) +
((cfg_log_path[0] == '~') ? strlen (ptr_home) : 0) +
64;
if (SERVER(buffer))
length += strlen (SERVER(buffer)->name);
if (CHANNEL(buffer))
length += strlen (CHANNEL(buffer)->name);
buffer->log_filename = (char *) malloc (length);
if (!buffer->log_filename)
{
wee_log_printf (_("Not enough memory to write log file for a buffer\n"));
return;
}
if (cfg_log_path[0] == '~')
{
strcpy (buffer->log_filename, ptr_home);
strcat (buffer->log_filename, cfg_log_path + 1);
}
else
strcpy (buffer->log_filename, cfg_log_path);
if (buffer->log_filename[strlen (buffer->log_filename) - 1] != DIR_SEPARATOR_CHAR)
strcat (buffer->log_filename, DIR_SEPARATOR);
if (SERVER(buffer))
{
strcat (buffer->log_filename, SERVER(buffer)->name);
strcat (buffer->log_filename, ".");
}
if (CHANNEL(buffer))
{
strcat (buffer->log_filename, CHANNEL(buffer)->name);
strcat (buffer->log_filename, ".");
}
strcat (buffer->log_filename, "weechatlog");
buffer->log_file = fopen (buffer->log_filename, "a");
if (!buffer->log_file)
{
wee_log_printf (_("Unable to write log file for a buffer\n"));
free (buffer->log_filename);
return;
}
log_write (buffer, _("**** Beginning of log "));
log_write_date (buffer);
log_write (buffer, "****\n");
}
/*
* log_end: ends a log
*/
void
log_end (t_gui_buffer *buffer)
{
if (buffer->log_file)
{
log_write (buffer, _("**** End of log "));
log_write_date (buffer);
log_write (buffer, "****\n");
fclose (buffer->log_file);
buffer->log_file = NULL;
}
if (buffer->log_filename)
free (buffer->log_filename);
}
+31
View File
@@ -0,0 +1,31 @@
/*
* 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"
extern void log_write_date (t_gui_buffer *);
extern void log_write (t_gui_buffer *, char *);
extern void log_start (t_gui_buffer *);
extern void log_end (t_gui_buffer *);
#endif /* log.h */
+25 -16
View File
@@ -10,13 +10,13 @@
* ### ###
* ### By: FlashCode <flashcode@flashtux.org> ###
* ### Bounga <bounga@altern.org> ###
* ### Xahlexx <xahlexx@tuxisland.org> ###
* ### Xahlexx <xahlexx@weeland.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
@@ -60,7 +60,7 @@
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
char *weechat_home; /* WeeChat home dir. (example: /home/toto/.weechat) */
FILE *log_file; /* WeeChat log file (~/.weechat/weechat.log) */
FILE *weechat_log_file; /* WeeChat log file (~/.weechat/weechat.log) */
int server_cmd_line; /* at least one server on WeeChat command line */
@@ -88,7 +88,7 @@ wee_log_printf (char *message, ...)
static time_t seconds;
struct tm *date_tmp;
if (!log_file)
if (!weechat_log_file)
return;
va_start (argptr, message);
@@ -98,13 +98,13 @@ 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);
}
/*
@@ -228,11 +228,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);
@@ -354,6 +356,15 @@ 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);
}
free (dir_name);
}
@@ -364,9 +375,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 +394,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);
@@ -440,10 +448,11 @@ weechat_welcome_message ()
void
wee_shutdown ()
{
dcc_end ();
server_free_all ();
gui_end ();
if (log_file)
fclose (log_file);
if (weechat_log_file)
fclose (weechat_log_file);
exit (EXIT_SUCCESS);
}
+9 -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
@@ -43,7 +43,7 @@
#endif
#define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2004 by Wee Team"
#define WEECHAT_COPYRIGHT PACKAGE_NAME " (c) 2003-2005 by Wee Team"
#define WEECHAT_WEBSITE "http://weechat.flashtux.org"
#define WEECHAT_ERROR _(PACKAGE_NAME " Error:")
@@ -56,10 +56,10 @@
/* license */
#define WEE_LICENSE \
PACKAGE_STRING " (c) Copyright 2004, compiled on " __DATE__ " " __TIME__ \
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode <flashcode@flashtux.org>\n" \
" Bounga <bounga@altern.org>\n" \
" Xahlexx <xahlexx@tuxisland.org>\n" \
" Xahlexx <xahlexx@weeland.org>\n" \
"Website: " WEECHAT_WEBSITE "\n\n" \
"This program is free software; you can redistribute it and/or modify\n" \
"it under the terms of the GNU General Public License as published by\n" \
@@ -77,7 +77,7 @@
"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__ \
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
"\nDeveloped by FlashCode, Bounga and Xahlexx - " WEECHAT_WEBSITE "\n\n" \
"Usage: %s [options ...]\n" \
" or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n"
@@ -91,9 +91,11 @@
/* 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 */

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