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

Compare commits

...

87 Commits

Author SHA1 Message Date
Sebastien Helleu 1314c8e78e Version 0.1.8 2006-03-18 09:03:14 +00:00
Sebastien Helleu 0277a1eb62 Ruby changes forgotten in ChangeLog 2006-03-17 14:09:34 +00:00
Sebastien Helleu c4bafd3eef Fixed translations 2006-03-16 11:57:10 +00:00
Sebastien Helleu d006811b8e Fixed typos 2006-03-16 10:36:27 +00:00
Sebastien Helleu 2c894b89e7 Fixed /set command when internal server name contains one or many dots 2006-03-14 13:06:48 +00:00
Sebastien Helleu 02d4287ad0 Added missing IRC command "378" 2006-03-14 12:44:42 +00:00
Sebastien Helleu 7fa3dcbb2e Fixed plugin get_info bug when no server at all is opened 2006-03-14 12:43:02 +00:00
Sebastien Helleu 031fab21b0 Fixed display bug when top of buffer is displayed and first line is removed
(according to "history_max_lines" setting)
2006-03-11 07:33:54 +00:00
Sebastien Helleu ea06fca69c Fixed "+I" mode output 2006-03-10 23:19:11 +00:00
Sebastien Helleu 4181fa3f74 Fixed /mode command output 2006-03-10 22:44:21 +00:00
Julien Louis b9e247794e Fix typo in french translation 2006-03-10 20:11:41 +00:00
Sebastien Helleu d6e562ed7e Fixed completion for /away and /nick commands 2006-03-10 09:04:29 +00:00
Sebastien Helleu 227c05447f Improved alias completion (now uses target command for completion) 2006-03-08 15:31:26 +00:00
Sebastien Helleu 1005890db2 Fixed completion bug with commands in pv (nick completion, for example with /me) 2006-03-06 21:09:09 +00:00
Sebastien Helleu 8f714033ac Fixed chmod on home (now chmod is not executed when a directory is user's home) 2006-03-06 20:58:08 +00:00
Sebastien Helleu 1a510e1598 Added missing IRC command "487" 2006-03-04 23:20:41 +00:00
Sebastien Helleu 650805f204 Using new default value for DCC download dir (created at startup), fixed logs dir creation 2006-03-04 15:37:20 +00:00
Sebastien Helleu 919800c37c Added inactivity time, available for plugins via get_info("inactivity") 2006-03-04 14:27:14 +00:00
Sebastien Helleu 92db79989e Keys alt-{home|end} to scroll top/bottom, alt-{f11-f12} to scroll nicklist top/bottom 2006-03-03 10:40:43 +00:00
Sebastien Helleu 5d32ac0d57 Added special names for plugin message handlers: weechat_pv, weechat_highlight, weechat_ctcp, weechat_dcc 2006-03-02 21:54:33 +00:00
Sebastien Helleu bd1685a8fe Updated TODO 2006-03-02 21:54:00 +00:00
Sebastien Helleu 312ad619ae Fixed bug with dl library detection (for FreeBSD and maybe other systems) 2006-03-02 15:58:10 +00:00
Sebastien Helleu e4cc182105 Script plugins now load scripts in WeeChat system share directory 2006-02-28 21:11:34 +00:00
Sebastien Helleu 8c662f69f9 /msg command does not open any buffer any more 2006-02-28 15:59:33 +00:00
Sebastien Helleu 5c29def9d9 Fixed crash when using global history (when older entry is removed) 2006-02-26 11:27:43 +00:00
Sebastien Helleu c0a1673060 Added IRC raw data buffer 2006-02-22 11:58:11 +00:00
Emmanuel Bouthenot 3a79e32dbb fix minor bug and improve backtrace display on errors 2006-02-21 22:43:48 +00:00
Sebastien Helleu 349d9d1028 Fixed display bugs with /kill command 2006-02-21 10:23:35 +00:00
Sebastien Helleu 13ddcc3adc Added infobar_remove in C plugin API 2006-02-20 21:55:51 +00:00
Sebastien Helleu 9373a7a47e Added new plugin API function: remove_infobar 2006-02-20 17:01:18 +00:00
Sebastien Helleu e0c97562a5 Fixed bug in /lua command for timer handlers 2006-02-19 11:17:14 +00:00
Sebastien Helleu 3a213f38ec Added timer handler for plugins 2006-02-19 10:43:47 +00:00
Sebastien Helleu 484274d65f Plugin messages handlers now called when message is ignored; new behaviour for
messages ignored by a message handler: now WeeChat executes standard handler,
treating message as "ignored"
2006-02-18 13:35:06 +00:00
Sebastien Helleu 4f81254e40 Fixed message displayed when a command handler failed (now "failed" instead of
"command not found")
2006-02-18 12:50:55 +00:00
Sebastien Helleu da3f8ade08 Fixed Ruby function "log" (argument count) 2006-02-18 12:50:03 +00:00
Sebastien Helleu 271d1c905f Fixed scripts examples with server/channel/nick info 2006-02-17 15:00:00 +00:00
Sebastien Helleu ae0e17cfe2 Commands allowed when not connected to any server, fixed get_config: now needs exact option name to return value 2006-02-17 14:59:07 +00:00
Sebastien Helleu d69c634d2f Fixed typos 2006-02-17 14:58:01 +00:00
Emmanuel Bouthenot 14c9afb990 fix typo in parsing args for weechat_python_add_command_handler 2006-02-16 21:14:36 +00:00
Sebastien Helleu c491b39388 Updated doc, renamed functions in plugins API 2006-02-16 20:27:28 +00:00
Emmanuel Bouthenot 8855d39f44 make possible to log with plugins / scripts 2006-02-16 16:10:25 +00:00
Sebastien Helleu 91af3fe728 Updated translations 2006-02-16 10:19:07 +00:00
Emmanuel Bouthenot a62a002522 clean code while parsing commands in server_command and make possible to run many (irc or weechat) commands with alias 2006-02-16 09:51:08 +00:00
Sebastien Helleu f79653db8e Updated czech translations 2006-02-14 08:02:47 +00:00
Sebastien Helleu 0538215157 Updated doc for server_command setting 2006-02-12 22:12:05 +00:00
Emmanuel Bouthenot fa02f128ec make possible to run more than one command when connecting to server 2006-02-12 21:50:31 +00:00
Emmanuel Bouthenot 06ecdfdd35 fix some crash (unprotected code execution) and display some kind of backtrace when errors occurs 2006-02-12 01:33:36 +00:00
Emmanuel Bouthenot 00eef1c1bc clean some code 2006-02-12 01:31:35 +00:00
Sebastien Helleu e7fd1a0cb7 Auto-detect all components, and compile if found by default 2006-02-11 10:11:10 +00:00
Sebastien Helleu 321a8a65ad Added Lua 2006-02-11 10:10:26 +00:00
Sebastien Helleu e7f730387f Enable plugins compilation if Lua is enabled (like Perl/Python/Ruby) 2006-02-11 10:09:59 +00:00
Emmanuel Bouthenot e4eeaaf1dd clean code to avoid warning and errors when compiling with gcc-2.95 2006-02-10 12:44:10 +00:00
Sebastien Helleu 4c34ac5d8f Added Lua script plugin 2006-02-09 20:47:16 +00:00
Emmanuel Bouthenot 73990d8caa fix weechat_lua_remove_handler : now really use function args 2006-02-09 10:50:46 +00:00
Emmanuel Bouthenot d4e755a641 fix weechat_lua_add_message_handler : now really use function args 2006-02-09 10:33:48 +00:00
Sebastien Helleu 4a4daf6931 Added lua script plugin, new functions in plugins API 2006-02-08 21:37:17 +00:00
Emmanuel Bouthenot 8ddc5afb21 adding lua plugin/scripts support 2006-02-08 13:14:23 +00:00
Emmanuel Bouthenot a5cef6abde lua plugin/scripts support 2006-02-08 12:06:24 +00:00
Emmanuel Bouthenot 13a6d5b833 adding lua plugin/script 2006-02-08 11:49:04 +00:00
Sebastien Helleu 47b7b1d578 Added new API functions for scripts (list of servers, channels, nicks) 2006-02-08 11:13:49 +00:00
Sebastien Helleu c0a7e4445c Added hungarian translation (thanks to voroskoi) 2006-02-08 10:27:10 +00:00
Sebastien Helleu 80d6b1d952 Fixed XML typos 2006-02-07 21:10:11 +00:00
Sebastien Helleu 75eb47ee9e Added new plugins API functions (get_server_info, free_server_info, get_channel_info, free_channel_info, get_nick_info, free_nick_info) 2006-02-05 20:57:42 +00:00
Sebastien Helleu 6013e43292 Minor changes on server/channel/nick info API functions 2006-02-04 15:25:18 +00:00
Emmanuel Bouthenot 9150cff430 fix minor bugs while detecting lua 2006-02-03 08:31:15 +00:00
Sebastien Helleu 480974b8de Gtk GUI changes, now compile is ok 2006-02-03 00:36:03 +00:00
Emmanuel Bouthenot abeb5a2f48 Move previous GNU/hurd fix
Add lua script/plugin (detect libs and headers)
2006-02-03 00:29:38 +00:00
Emmanuel Bouthenot 4aac135244 fix a missing link in GNU/Hurd by force linking with pthread 2006-02-01 07:33:34 +00:00
Emmanuel Bouthenot f222a6ad7a extending plugins/scripts API by adding get_server_info, get_channel_info and get_nick_info 2006-01-31 13:54:27 +00:00
Sebastien Helleu fe5731dc84 Added options "look_open_near_server" and "look_nick_complete_first" (patch from Gwenn) 2006-01-30 20:42:53 +00:00
Sebastien Helleu 70ad116c0f Added options "look_open_near_server" and "look_nick_complete_first" (patch from Gwenn) 2006-01-30 20:22:40 +00:00
Sebastien Helleu 99a3434733 Fixed bug with elapsed time when away if computer clock was changed (displays 0 if elapsed time is negative) 2006-01-26 16:49:21 +00:00
Sebastien Helleu 0e91f0c208 Fixed bug with /upgrade when servers buffer (with one buffer for all servers) is moved to buffer # > 1 2006-01-26 13:57:27 +00:00
Sebastien Helleu 7711d548c0 Fixed typos 2006-01-26 11:18:59 +00:00
Sebastien Helleu a7479272f0 Fixed bug with "get_dcc_info" plugin interface function 2006-01-26 10:18:50 +00:00
Sebastien Helleu 2e1c6023d7 Fixed bug with option "irc_away_check_max_nicks" (now channels are refreshed when nicks count changed) 2006-01-26 10:04:57 +00:00
Sebastien Helleu 464fc8abdf Added new scroll keys for a few lines up/down (default: meta-pgup/pgdn) (patch from Pistos) 2006-01-25 17:52:11 +00:00
Sebastien Helleu 1e4c1a7073 Fixed compilation problem with debug messages 2006-01-25 17:09:24 +00:00
Sebastien Helleu 1607c44e75 Added new option "irc_away_check_max_nicks" to disable away check on channels with high number of nicks (patch from Gwenn) 2006-01-25 10:31:22 +00:00
Sebastien Helleu 364d774ded Added new command line argument for setting WeeChat homedir (-d or --dir) (patch from Gwenn) 2006-01-25 08:55:24 +00:00
Sebastien Helleu 6972b057d9 Fixed bug with charset in infobar highlights 2006-01-24 15:08:03 +00:00
Sebastien Helleu 8cd8410448 Fixed bugs: buffer detection in plugins/scripts commands, and /history command 2006-01-22 21:30:19 +00:00
Julien Louis 1cbdbffa40 Update debian packaging 2006-01-22 18:34:32 +00:00
Sebastien Helleu 3c16d49d2d Added some info for commands and options help 2006-01-21 21:26:24 +00:00
Sebastien Helleu 083ede73fd Added command line section in doc 2006-01-21 16:49:25 +00:00
Sebastien Helleu 5aeb7921fe Added option "irc_show_away_once", to show away message only once in pv 2006-01-21 11:56:58 +00:00
Sebastien Helleu e907b3b7a5 Version 0.1.8-cvs 2006-01-14 13:05:25 +00:00
146 changed files with 47526 additions and 13478 deletions
+1 -2
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2006-01-14
WeeChat known bugs, 2006-03-18
- display bugs with UTF-8 chars coded on more than 2 bytes
- divide long messages (> 512 bytes) into more messages so IRC server can
@@ -12,4 +12,3 @@ WeeChat known bugs, 2006-01-14
(cleared by each WeeChat at startup)
- WeeChat may crash if too much nicks in nicklist when position is top
or bottom
- ./configure does not check that Gtk 2.0 libraries are installed
+57 -11
View File
@@ -1,9 +1,55 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-01-14
ChangeLog - 2006-03-18
Version 0.1.8 (2006-03-18):
* improved Ruby plugin
* fixed /set command when internal server name contains one or many dots
* fixed get_info plugin API function when no server at all is opened
* fixed display bug when top of buffer is displayed and first line is
removed (according to "history_max_lines" setting)
* fixed /mode command output
* improved alias completion (now uses target command for completion)
* fixed completion problem in private with nicks
* added missing IRC command (487)
* added inactivity time, available for plugins via get_info("inactivity")
* keys alt-{home|end} to scroll top/bottom, alt-{f11-f12} to scroll
nicklist top/bottom
* added special names for plugin message handlers: weechat_pv,
weechat_highlight, weechat_ctcp, weechat_dcc
* script plugins now load scripts in WeeChat system share directory
* /msg command does not open any buffer any more
* fixed crash when using global history (when older entry is removed)
* added IRC raw data buffer (new key: alt-J + alt-R)
* fixed display bug with /kill command
* added new plugins functions: add_timer_handler, remove_timer_handler,
remove_infobar
* plugin messages handlers now called when message is ignored (by /ignore)
* new behaviour for messages ignored by a message handler: now WeeChat
executes standard handler, treating message as "ignored"
* many commands allowed for aliases
* many commands allowed when connecting to server
* added Lua script plugin
* added functions in plugins API: get_server_info, free_server_info,
get_channel_info, free_channel_info, get_nick_info, free_nick_info
* added option "look_nick_complete_first" (patch from Gwenn)
* added option "look_open_near_server" (patch from Gwenn)
* fixed bug with /upgrade and servers buffer
* fixed bug with "get_dcc_info" plugin interface function
* added new scroll keys for a few lines up/down (default: meta-pgup/pgdn)
(patch from Pistos)
* added new option "irc_away_check_max_nicks" to disable away check on
channels with high number of nicks (patch from Gwenn)
* added new command line argument for setting WeeChat homedir (-d or --dir)
(patch from Gwenn)
* fixed bug with charset in infobar highlights
* fixed bug with buffer detection in plugins/scripts commands
* fixed bug with /history command
* added option "irc_show_away_once", to show away message only once in pv
* added partial hungarian translation
Version 0.1.7 (2006-01-14):
* fixed msg command (now allowed in private buffer with "*" as target)
* removed "irc_default_msg_away" setting, for RFC 2812 conformity
@@ -22,7 +68,7 @@ Version 0.1.7 (2006-01-14):
* added server/channel arg to /buffer command for jumping to buffer
* fixed display bug in chat window when a message length equals to window
width
* added new keys for switching to other windows: alt-w followed by
* added new keys for switching to other windows: alt-W followed by
alt-{arrow}
* added new keys for scrolling to previous/next highlight: alt-P / alt-N
* added "read marker": an indicator for first unread line in a
@@ -97,7 +143,7 @@ Version 0.1.4 (2005-07-30):
* topic completion now decodes UTF-8 string
* fixed bug with IRC URL on command line (irc://)
* new keyboard management: keys are setup in config file, new command
/key was added and some new default keys were added, alt-k key is
/key was added and some new default keys were added, alt-K key is
used to grab key (useful for /key command)
* added seconds in infobar time (optional thanks to new setting)
* fixed some curses refreshs
@@ -123,14 +169,14 @@ Version 0.1.3 (2005-07-02):
* fixed plugins "print" and "prnt" functions: now ok for writing on server
buffers
* fixed color problem with new libcurses version
* fixed crash when using Alt-S or Alt-X on DCC buffer (Alt-D)
* fixed crash when using alt-S or alt-X on DCC buffer (alt-D)
* fixed startup crash when config file (~/.weechat/weechat.rc) is not found
* improved Perl/Python libs detection for ./configure script
Version 0.1.2 (2005-05-21):
* added Python plugin support, improved Perl interface (and now Perl/Python
libraries are checked by configure script)
* added nicklist scroll keys (Alt+{home/end/pgup/pgdn} or F11/F12)
* added nicklist scroll keys (alt+{home/end/pgup/pgdn} or F11/F12)
* added transfer rate for DCC files
* added "-all" option for /nick command
* buffers timestamp can now be changed (new option in config file)
@@ -199,8 +245,8 @@ Version 0.0.9 (2005-01-01):
* 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
* 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)
@@ -217,15 +263,15 @@ Version 0.0.8 (2004-10-30):
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)
* 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)
* added key for redrawing terminal (ctrl-L)
* added key for clearing hotlist (alt-R)
Version 0.0.7 (2004-08-08):
* new "col_status_delimiters" config option
* /buffer command added, buffers ordered by number, auto-jump to active
buffers (alt-a), jump to buffers by number (alt-number)
buffers (alt-A), jump to buffers by number (alt-number)
* /window command added, split terminal horizontally/vertically
* unique color for each nick (based on nickname)
* action messages are now considered as messages, not crappy joins/parts
+21 -6
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2006-01-14
WeeChat FAQ, 2006-03-18
=======================
Intended audience:
@@ -53,7 +53,7 @@ A: Because WeeChat is very light and has new features.
* many GUI (Curses, Gtk, wxWidgets, Qt)
* available in many languages
* nicklist available in all GUI
* extensible with scripts (Perl, Python, Ruby)
* extensible with plugins (C, Perl, Python, Ruby, Lua)
* horizontal and vertical window split
* infobar highlight
* FIFO pipe for remote control
@@ -95,42 +95,57 @@ A: Key bindings are customizable with /key command.
2.5
================================================================================
Q: How can I load Perl scripts?
Are Perl scripts compatible with X-chat or/and Irssi ?
Are Perl scripts compatible with other IRC clients ?
A: You can use /perl command to load scripts (default path is
~/.weechat/perl).
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
when WeeChat is starting up.
Perl scripts are not compatible with other IRC clients.
2.6
================================================================================
Q: How can I load Python scripts?
Are Python scripts compatible with X-chat or/and Irssi ?
Are Python scripts compatible with other IRC clients ?
A: You can use /python command to load scripts (default path is
~/.weechat/python).
Note that scripts in ~/.weechat/python/autoload are automatically loaded
when WeeChat is starting up.
Python scripts are not compatible with other IRC clients.
2.7
================================================================================
Q: How can I load Ruby scripts?
Are Ruby scripts compatible with other IRC clients ?
A: You can use /ruby command to load scripts (default path is
~/.weechat/ruby).
Note that scripts in ~/.weechat/ruby/autoload are automatically loaded
when WeeChat is starting up.
Ruby scripts are not compatible with other IRC clients.
2.8
================================================================================
Q: How can I load Lua scripts?
Are Lua scripts compatible with other IRC clients ?
A: You can use /lua command to load scripts (default path is
~/.weechat/lua).
Note that scripts in ~/.weechat/lua/autoload are automatically loaded
when WeeChat is starting up.
Lua scripts are not compatible with other IRC clients.
3.1
================================================================================
Q: How should I report bugs?
A: There is 3 ways to report bugs:
1. you can join us on IRC: irc.freenode.net, channel #weechat
2. you can submit your bug at this url:
2. you can submit your bug at this URL:
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
3. you can mail your problem, look at support page for developer's mails:
http://weechat.flashtux.org/support.php
@@ -143,7 +158,7 @@ Q: How should I submit patches?
A: There is 3 ways to submit patches:
1. you can join us on IRC: irc.freenode.net, channel #weechat
2. you can submit your patch at this url:
2. you can submit your patch at this URL:
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
3. you can mail your patch, look at support page for developer's mails:
http://weechat.flashtux.org/support.php
+21 -5
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2006-01-14
WeeChat FAQ, 2006-03-18
=======================
Public concerné :
@@ -56,7 +56,7 @@ R: Parce que WeeChat est tr
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt)
* disponible en plusieurs langues
* liste des pseudos disponible dans toutes les interfaces
* extensible par des scripts (Perl, Python, Ruby)
* extensible par des extensions (C, Perl, Python, Ruby, Lua)
* découpage de la fenêtre horizontalement et verticalement
* highlight dans la barre d'infos
* tube FIFO pour contrôle à distance
@@ -100,33 +100,49 @@ R: Les raccourcis clavier sont modifiables avec la commande /key.
2.5
================================================================================
Q: Comment puis-je charger des scripts Perl ?
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
Les scripts Perl sont-ils compatibles avec d'autres clients IRC ?
R: La commande /perl permet de charger les scripts Perl (le chemin par défaut
est ~/.weechat/perl).
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Perl ne sont pas compatibles avec d'autres clients IRC.
2.6
================================================================================
Q: Comment puis-je charger les scripts Python ?
Les scripts Python sont-ils compatibles avec X-chat et/ou Irssi ?
Les scripts Python sont-ils compatibles avec d'autres clients IRC ?
R: La commande /python permet de charger les scripts Python (le chemin par
défaut est ~/.weechat/python).
Notez que les scripts dans ~/.weechat/python/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Python ne sont pas compatibles avec d'autres clients IRC.
2.7
================================================================================
Q: Comment puis-je charger des scripts Ruby ?
Les scripts Ruby sont-ils compatibles avec d'autres clients IRC ?
R: La commande /ruby permet de charger les scripts Ruby (le chemin par
défaut est ~/.weechat/ruby).
Notez que les scripts dans ~/.weechat/ruby/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Ruby ne sont pas compatibles avec d'autres clients IRC.
2.8
================================================================================
Q: Comment puis-je charger des scripts Lua ?
Les scripts Lua sont-ils compatibles avec d'autres clients IRC ?
R: La commande /lua permet de charger les scripts Lua (le chemin par
défaut est ~/.weechat/lua).
Notez que les scripts dans ~/.weechat/lua/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Lua ne sont pas compatibles avec d'autres clients IRC.
3.1
@@ -137,7 +153,7 @@ R: Il y a 3 mani
1. vous pouvez nous joindre sur IRC: irc.freenode.net, canal #weechat
2. vous pouvez soumettre votre bug à cette adresse :
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
3. vous pouvez envoyer votre problem par mail, consultez la page
3. vous pouvez envoyer votre problème par mail, consultez la page
support pour les mails des développeurs :
http://weechat.flashtux.org/support.php
(vous pouvez souscrire et envoyer à la liste de diffusion
+2 -6
View File
@@ -2,11 +2,7 @@ WeeChat - Installation instructions
===================================
1) Run './configure'
options: --enable-perl : enable Perl scripts
--disable-curses : do not build Curses interface
--enable-gtk : build Gtk+ interface (under development!)
--enable-qt : build Qt interface (not developed!)
--with-debug=X : X=1 for debug compilation, 2 for debug messages
(./configure --help so see options)
2) Run 'make'
@@ -14,4 +10,4 @@ WeeChat - Installation instructions
4) Enjoy ! :-)
See AUTHORS for support, feel free to contact us for any problem ;)
See AUTHORS for support, feel free to contact us for any problem.
+18
View File
@@ -1,6 +1,24 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2006-03-03 (draft)
Important release notes for 0.1.8 (draft):
- it is recommended for users of version 0.1.7 (or any older), to
replace values in setup file (~/.weechat/weechat.rc) :
- option: log_path: replace "~/.weechat/logs" by "%h/logs"
- option: plugins_path: replace "~/.weechat/plugins" by "%h/plugins"
"%h" is replaced by WeeChat home (default: ~/.weechat, may be overriden
by new command line arg --dir)
- after installing 0.1.8 (or with /upgrade), issue both commands (if you
didn't redefined these keys (alt-home/end):
/key unbind meta-meta2-1~
/key unbind meta-meta2-4~
then launch again WeeChat (or issue /upgrade).
Alt-home/end were used for nicklist scroll, they're now replaced by
Alt-F11/F12.
* FlashCode, 2006-01-14
WeeChat 0.1.7 released.
+3 -4
View File
@@ -12,10 +12,10 @@ Features
* IRC chat client with multi-server connection
* many GUI (curses, Gtk, Qt) (1)
* small, fast and very light
* customizable and extensible with plugins (scripts Perl, Python, Ruby) (2)
* customizable and extensible with plugins (C, Perl, Python, Ruby, Lua)
* compliant with RFC 1459,2810,2811,2812,2813
* developed from scratch
* multi-platform (GNU/Linux, *BSD, Mac OS X, QNX, Windows & other) (3)
* multi-platform (GNU/Linux, *BSD, Mac OS X, QNX, Windows & other) (2)
* 100% GPL & free
@@ -44,5 +44,4 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
---
(1) only Curses interface is available today
(2) only Perl and Python plugins are available today
(3) Windows is under construction
(2) Windows version is under construction
+20 -22
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2006-01-14
TODO - 2006-03-18
Legend:
# done
@@ -19,8 +19,6 @@ Legend:
? Qt GUI
+ internationalization (traduce WeeChat in many languages)
- add dark colors (demi intensity)
# color for nicks (except own nick) when nick colors are disabled
# allow decode/encode charsets for servers or chan (not globally)
- understand incomplete commands if unambigous (for example: /he for /help is ok)
- interpret 'old-school' special chars in messages: *bold* _underline_ /italic/
- minimal width of nick in text area
@@ -28,28 +26,29 @@ Legend:
- add "*" on the side of message buffer when alt-j or other meta modifier is on
- completion with tab key for all words starting with "#" by opened chans names
- completion when input line is empty should add last nick that wrote to me
- open new channels near server (not at the end of buffers)
# open new channels near server (not at the end of buffers)
- add filename completion (for example with /dcc send)
- have only one info_bar common to all windows
- be able to search in history and global history (as with <Ctrl+r> in bash)
* WeeChat commands
- be able to bind a key on more than one command
- be able to make an alias running more than one command
# be able to make an alias running more than one command
- host with "*" possible with /ignore command
- "/completion" command: do shortcuts (for example when we type "u"
in the text bar it send it to the server as "you")
- "/last": command to look for text in previous messages
# completion system for scripts arguments
# "/upgrade" command: reload WeeChat himself without disconnecting from server
- get help on config settings with /help option instead of /set option (since
many options can be displayed and help is not displayed in this case)
- "/cycle": do a /part then /join on current channel
- be able to save the current buffer with a single command
(/buffer dump /path/to/file), or to make it possible to write a script
that does so (see plugins)
- "/reconnect": reconnect to all servers, without waiting for auto-reconnect delay after disconnection
- "/reconnect": reconnect to all servers, without waiting for
auto-reconnect delay after disconnection
- save hotlist when doing /upgrade
* IRC protocol:
# customizable CTCP version reply (possible by plugin script)
- complete "/list" command: add regexp search, display only channels that
match regexp
- when we're away, WeeChat should log all the lines begenning by our nick.
@@ -57,16 +56,17 @@ Legend:
- "/notify" and "/unnotify" command to be warn by WeeChat when a given
nick/host connect to the given irc network
- display one time away message of remote user in private (optional)
- add max number of nicks for away check (do not check away nicks on channels with high number of nicks)
# add max number of nicks for away check (do not check away nicks on
channels with high number of nicks)
- add anti-flood mechanism, when pasting more than N lines
- add mask for /ban command, and ban types (host, nick)
* Configuration:
- be able to launch more than one command when connecting to server
- use ~/.weechat/dcc by default for DCC incoming files (and create
# be able to launch more than one command when connecting to server
# use ~/.weechat/dcc by default for DCC incoming files (and create
directory at startup if not found)
- add global username/realname, used if server values are not filled
- add command line arg (--dir ?) to choose weechat home dir
# add command line arg (--dir) to choose weechat home dir
(~/.weechat by default)
- be able to set more than one server address for network
- save buffer numbers (order) to config file and restore them when
@@ -74,20 +74,18 @@ Legend:
* Plugins:
- allow print function to write on all buffers or all channels of a server
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
- add "outgoing" message event so scripts can edit user-input text before
it is sent to the channel
- add a timer function so scripts can do things like timeouts, delayed
# add a timer function so scripts can do things like timeouts, delayed
processing, etc.
- allow print function to write on all buffers or all channels of a server
- allow plugins to perform actions on "highlight" messages
- get_servers(), get_channels(server), get_nicks(server,channel)
- Lua plugin
- Tcl plugin
- Php plugin (maybe if possible)
# allow plugins to perform actions on "highlight" messages
# get_servers(), get_channels(server), get_nicks(server,channel)
# Lua plugin
? Tcl plugin
? Php plugin (maybe if possible)
? "fish" plugin (cf http://fish.sekure.us/)
- script plugins (perl, python, ruby, ..) should load scripts in system dir,
# script plugins (perl, python, ruby, ..) should load scripts in system dir,
not only ~/.weechat/xxxx/autoload/
- allow plugins to get the contents of a specified (or at least the
"current") buffer.
+283 -137
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.1.7, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.8, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.7])
AM_INIT_AUTOMAKE([weechat], [0.1.8])
# Checks for programs
AC_PROG_CC
@@ -46,7 +46,7 @@ solaris*)
esac
# Gettext
ALL_LINGUAS="fr es cs"
ALL_LINGUAS="fr es cs hu"
AM_GNU_GETTEXT
# Checks for libraries
@@ -89,6 +89,7 @@ AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([DEBUG], [#undef DEBUG])
@@ -96,24 +97,20 @@ AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=no wxwidgets)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no Gtk+)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=no Gtk)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no Qt)],enable_qt=$enableval,enable_qt=no)
AC_ARG_ENABLE(plugins, [ --disable-plugins Turn off plugins support (default=plugins enabled)],enable_plugins=$enableval,enable_plugins=yes)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl script plugin (default=no Perl plugin)],enable_perl=$enableval,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python script plugin (default=no Python plugin)],enable_python=$enableval,enable_python=no)
AC_ARG_ENABLE(ruby, [ --enable-ruby Turn on Ruby script plugin (default=no Ruby script)],enable_ruby=$enableval,enable_ruby=no)
AC_ARG_ENABLE(perl, [ --disable-perl Turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes)
AC_ARG_ENABLE(python, [ --disable-python Turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes)
AC_ARG_ENABLE(ruby, [ --disable-ruby Turn off Ruby script plugin (default=compiled if found)],enable_ruby=$enableval,enable_ruby=yes)
AC_ARG_ENABLE(lua, [ --disable-lua Turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes)
AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, Lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='')
AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, Lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='')
AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG Lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='')
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGINS, test "$enable_plugins" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
not_found=""
# ------------------------------------------------------------------------------
# GUI
@@ -122,14 +119,17 @@ AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSESW_FOUND" = "0" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([
AC_MSG_WARN([
*** ncurses library not found!
*** Please install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
AC_MSG_WARN([
*** WeeChat will be built without ncurses support.])
enable_ncurses="no"
not_found="$not_found ncurses"
else
AC_MSG_WARN([
*** ncursesw library not found! Falling back to "ncurses"
*** Be careful, UTF-8 display may not work properly if your locale is UTF-8.])
NCURSES_LIBS="-lncurses"
NCURSES_LIBS="-lncurses"
fi
else
NCURSES_LIBS="-lncursesw"
AC_CHECK_HEADERS(ncursesw/curses.h)
@@ -163,13 +163,19 @@ fi
#fi
if test "x$enable_gtk" = "xyes" ; then
#if test "$LIBGTK_FOUND" = "0" ; then
# AC_MSG_ERROR([Gtk+ library not found! Install Gtk+ (2.0 or higher) library or run ./configure without --enable-gtk parameter.])
#fi
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
GTK_LIBS=`pkg-config --libs gtk+-2.0`
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AM_PATH_GTK_2_0(2.4.0, LIBGTK_FOUND=1, LIBGTK_FOUND=0)
if test "$LIBGTK_FOUND" = "0" ; then
AC_MSG_WARN([
*** Gtk library not found!
*** WeeChat will be built without Gtk support.])
enable_gtk="no"
not_found="$not_found gtk"
else
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
GTK_LIBS=`pkg-config --libs gtk+-2.0`
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
fi
fi
# ------------------------------------------------------------------------------
@@ -183,40 +189,45 @@ if test "x$enable_perl" = "xyes" ; then
AC_PATH_PROGS(PERL, perl perl5)
if test -z $PERL ; then
AC_MSG_ERROR([
*** Perl must be installed on your system
*** but perl interpreter couldn't be found in path.
Please check that perl is in path, or install
it with your software package manager.])
fi
AC_MSG_CHECKING(for Perl headers files)
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
AC_MSG_WARN([
*** Perl must be installed on your system but perl interpreter couldn't be found in path.
*** Please check that perl is in path, or install it with your software package manager.
*** WeeChat will be built without Perl support.])
enable_perl="no"
not_found="$not_found perl"
else
AC_MSG_ERROR([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
else
AC_MSG_ERROR([
AC_MSG_CHECKING(for Perl headers files)
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
AC_MSG_RESULT(found)
else
AC_MSG_WARN([
*** Perl library couldn't be found in your system.
*** Try to install it with your software package manager.])
*** Try to install it with your software package manager.
*** WeeChat will be built without Perl support.])
enable_perl="no"
not_found="$not_found perl"
fi
else
AC_MSG_WARN([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.
*** WeeChat will be built without Perl support.])
enable_perl="no"
not_found="$not_found perl"
fi
fi
AC_MSG_RESULT(found)
fi
if test "x$enable_perl" = "xyes" ; then
AC_SUBST(PERL_CFLAGS)
AC_SUBST(PERL_LFLAGS)
AC_DEFINE(PLUGIN_PERL)
@@ -227,45 +238,53 @@ if test "x$enable_python" = "xyes" ; then
AC_PATH_PROGS(PYTHON, python python2.4 python2.3 python2.2)
if test -z $PYTHON ; then
AC_MSG_ERROR([
*** Python must be installed on your system
*** but python interpreter couldn't be found in path.
*** Please check that python is in path, or install
*** it with your software package manager.])
fi
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE=`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
AC_MSG_WARN([
*** Python must be installed on your system but python interpreter couldn't be found in path.
*** Please check that python is in path, or install it with your software package manager.
*** WeeChat will be built without Python support.])
enable_python="no"
not_found="$not_found python"
else
AC_MSG_ERROR([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.])
fi
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"`
PYTHON_LFLAGS="-lpython$PYTHON_VERSION "`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBS')+' '+distutils.sysconfig.get_config_var('SYSLIBS')+' '+distutils.sysconfig.get_config_var('LINKFORSHARED')"`
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
elif test -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_SYSPREFIX/lib/ $PYTHON_LFLAGS"
else
AC_MSG_ERROR([
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE=`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"`
PYTHON_LFLAGS="-lpython$PYTHON_VERSION "`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBS')+' '+distutils.sysconfig.get_config_var('SYSLIBS')+' '+distutils.sysconfig.get_config_var('LINKFORSHARED')"`
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
AC_MSG_RESULT(found)
elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
AC_MSG_RESULT(found)
elif test -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_SYSPREFIX/lib/ $PYTHON_LFLAGS"
AC_MSG_RESULT(found)
else
AC_MSG_WARN([
*** Python library couldn't be found in your system.
*** Try to install it with your software package manager.])
*** Try to install it with your software package manager.
*** WeeChat will be built without Python support.])
enable_python="no"
not_found="$not_found python"
fi
else
AC_MSG_WARN([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.
*** WeeChat will be built without Python support.])
enable_python="no"
not_found="$not_found python"
fi
fi
AC_MSG_RESULT(found)
fi
if test "x$enable_python" = "xyes" ; then
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LFLAGS)
AC_DEFINE(PLUGIN_PYTHON)
@@ -276,50 +295,153 @@ if test "x$enable_ruby" = "xyes" ; then
AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby1.9)
if test -z $RUBY ; then
AC_MSG_ERROR([
*** Ruby must be installed on your system
*** but ruby interpreter couldn't be found in path.
*** Please check that ruby is in path, or install
*** it with your software package manager.])
fi
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
AC_MSG_CHECKING(for Ruby header files)
if test -r "$RUBY_INCLUDE/ruby.h"; then
RUBY_CFLAGS="-I$RUBY_INCLUDE"
AC_MSG_WARN([
*** Ruby must be installed on your system but ruby interpreter couldn't be found in path.
*** Please check that ruby is in path, or install it with your software package manager.
*** WeeChat will be built without Ruby support.])
enable_ruby="no"
not_found="$not_found ruby"
else
AC_MSG_ERROR([
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
AC_MSG_CHECKING(for Ruby header files)
if test -r "$RUBY_INCLUDE/ruby.h"; then
RUBY_CFLAGS="-I$RUBY_INCLUDE"
else
AC_MSG_WARN([
*** Ruby header files couldn't be found in your system.
*** Try to install them with your software package manager.])
*** Try to install them with your software package manager.
*** WeeChat will be built without Ruby support.])
enable_ruby="no"
not_found="$not_found ruby"
fi
AC_MSG_RESULT(found)
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
fi
AC_MSG_RESULT(found)
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
fi
if test "x$enable_ruby" = "xyes" ; then
AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_LFLAGS)
AC_DEFINE(PLUGIN_RUBY)
fi
if test "x$enable_lua" = "xyes" ; then
enable_plugins="yes"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CFLAGS="$CFLAGS"
ac_save_LFLAGS="$LFLAGS"
LUA_CFLAGS=""
LUA_LFLAGS=""
if test -n "$lua_inc"; then
CFLAGS="$CFLAGS -I$lua_inc"
CPPFLAGS="$CPPFLAGS -I$lua_inc"
fi
if test -n "$lua_lib"; then
LFLAGS="$LFLAGS -L$lua_lib"
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
PKGCONFIG=""
AC_CHECK_PROGS(PKGCONFIG, pkg-config)
if test "x$PKGCONFIG" != "x"; then
AC_MSG_CHECKING(for Lua headers and librairies with pkg-config)
for l in "$lua_suffix" "" "50" "5.0" ; do
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l && $PKGCONFIG --exists lualib$l`
if test "x$?" = "x0" ; then
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lua$l`
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lua$l`
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lualib$l`
break
fi
done
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
AC_MSG_RESULT(found)
fi
fi
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
LUACONFIG=""
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config50 lua-config5.0)
if test "x$LUACONFIG" != "x" ; then
AC_MSG_CHECKING(for Lua headers and librairies with lua-config)
LUA_CFLAGS=`$LUACONFIG --include`
LUA_LFLAGS=`$LUACONFIG --libs`
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
AC_MSG_RESULT(found)
fi
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
AC_MSG_CHECKING(for Lua headers and librairies)
AC_CHECK_HEADER(lua.h,ac_found_lua_header="yes",ac_found_lua_header="no")
AC_CHECK_HEADER(lualib.h,ac_found_liblua_header="yes",ac_found_liblua_header="no")
if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then
LUA_CFLAGS="$CFLAGS"
fi
for l in "$lua_suffix" "" "50" "5.0" ; do
AC_CHECK_LIB(lua$l,lua_open,ac_found_lua_lib="yes",ac_found_lua_lib="no")
AC_CHECK_LIB(lualib$l,luaopen_base,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
if test "x$ac_found_lua_lib" = "xyes" ; then
LUA_LFLAGS="$LFLAGS -llua$l"
break
fi
if test "x$ac_found_liblua_lib" = "xyes" ; then
LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
break
fi
done
fi
CFLAGS="$ac_save_CFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS"
LFLAGS="$ac_save_LFLAGS"
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
AC_MSG_WARN([
*** Lua (>=5.0) headers and librairies couldn't be found in your system.
*** Try to install liblua, liblualib and liblua-dev with your software package manager.
*** WeeChat will be built without Lua support.])
enable_lua="no"
not_found="$not_found lua"
else
AC_MSG_RESULT(found)
fi
fi
if test "x$enable_lua" = "xyes" ; then
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LFLAGS)
AC_DEFINE(PLUGIN_LUA)
fi
if test "x$enable_plugins" = "xyes" ; then
AC_CHECK_FUNCS(dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
if test "$LIBDL_FOUND" != "yes"; then
AC_CHECK_LIB(dl, dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
if test "$LIBDL_FOUND" = "yes"; then
PLUGINS_LIBS="-ldl"
else
AC_MSG_ERROR([
*** "dl" library (dynamic library loader) couldn't be found in your system.
*** Try to install it with your software package manager or disable plugins.])
fi
AC_CHECK_LIB(dl, dlopen, [LIBDL_FOUND=yes; PLUGINS_LIBS=-ldl], LIBDL_FOUND=no)
fi
if test "$LIBDL_FOUND" = "yes"; then
AC_DEFINE(PLUGINS)
AC_SUBST(PLUGINS_LIBS)
else
AC_MSG_WARN([
*** "dl" library (dynamic library loader) couldn't be found in your system.
*** Try to install it with your software package manager or disable plugins.
*** WeeChat will be built without any plugin.])
enable_plugins="no"
enable_perl="no"
enable_python="no"
enable_ruby="no"
enable_lua="no"
not_found="$not_found plugins"
fi
AC_DEFINE(PLUGINS)
fi
AC_SUBST(PLUGINS_LIBS)
# ------------------------------------------------------------------------------
# gnutls
# ------------------------------------------------------------------------------
@@ -327,8 +449,7 @@ AC_SUBST(PLUGINS_LIBS)
if test "x$enable_gnutls" = "xyes" ; then
found_gnutls="no"
AM_PATH_LIBGNUTLS( 1.0.0, found_gnutls=yes, AC_MSG_WARN([[
*** libgnutls was not found. You may want to get it from
*** ftp://ftp.gnutls.org/pub/gnutls/
*** libgnutls was not found. You may want to get it from ftp://ftp.gnutls.org/pub/gnutls/
*** WeeChat will be built without GnuTLS support.]]))
if test "x$found_gnutls" = "xyes" ; then
GNUTLS_CFLAGS=`libgnutls-config --cflags`
@@ -338,6 +459,7 @@ if test "x$enable_gnutls" = "xyes" ; then
AC_DEFINE(HAVE_GNUTLS)
else
enable_gnutls="no"
not_found="$not_found gnutls"
fi
fi
@@ -392,6 +514,11 @@ openbsd*)
CFLAGS="$CFLAGS -pthread"
fi
;;
gnu*)
if test "x$enable_plugins" = "xyes" ; then
LDFLAGS="$LDFLAGS -lpthread"
fi
;;
*)
;;
esac
@@ -400,6 +527,17 @@ esac
# output Makefiles
# ------------------------------------------------------------------------------
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGINS, test "$enable_plugins" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
AC_OUTPUT([Makefile
doc/Makefile
doc/fr/Makefile
@@ -412,6 +550,7 @@ AC_OUTPUT([Makefile
src/plugins/scripts/perl/Makefile
src/plugins/scripts/python/Makefile
src/plugins/scripts/ruby/Makefile
src/plugins/scripts/lua/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
@@ -424,7 +563,7 @@ AC_OUTPUT([Makefile
# end message
# ------------------------------------------------------------------------------
listgui=
listgui=""
if test "x$enable_ncurses" = "xyes" ; then
listgui="$listgui ncurses"
fi
@@ -432,7 +571,7 @@ if test "x$enable_wxwidgets" = "xyes"; then
listgui="$listgui WxWidgets"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
listgui="$listgui Gtk"
fi
if test "x$enable_qt" = "xyes" ; then
listgui="$listgui Qt"
@@ -441,7 +580,13 @@ fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([
*** No interface specified...
*** Please specify at least ncurses, WxWidgets, Gtk or Qt.])
*** Please enable at least ncurses, WxWidgets, Gtk or Qt.])
fi
if test "x$not_found" != "x" ; then
echo ""
echo "Following components were asked but not found, they will not be built:"
echo "$not_found"
fi
msg_debug_compiler="no"
@@ -454,14 +599,15 @@ if test "x$debug" = "x2" ; then
fi
echo ""
echo "Interfaces.................................... :$listgui"
echo "Build with GNUtls support..................... : $enable_gnutls"
echo "Build with Plugin support..................... : $enable_plugins"
echo " Perl plugin..................... : $enable_perl"
echo " Python plugin................... : $enable_python"
echo " Ruby plugin..................... : $enable_ruby"
echo "Compile with debug info....................... : $msg_debug_compiler"
echo "Print debugging messages...................... : $msg_debug_verbose"
echo "Interfaces........................ :$listgui"
echo "Build with GNUtls support......... : $enable_gnutls"
echo "Build with Plugin support......... : $enable_plugins"
echo " Perl plugin......... : $enable_perl"
echo " Python plugin....... : $enable_python"
echo " Ruby plugin......... : $enable_ruby"
echo " Lua plugin.......... : $enable_lua"
echo "Compile with debug info........... : $msg_debug_compiler"
echo "Print debugging messages.......... : $msg_debug_verbose"
echo ""
eval echo "WeeChat will be installed in $bindir."
echo ""
+6
View File
@@ -1,3 +1,9 @@
weechat (0.1.7-1) unstable; urgency=low
* New upstream release
-- Julien Louis <ptitlouis@sysif.net> Sat, 14 Jan 2006 14:14:29 +0100
weechat (0.1.6-2) unstable; urgency=low
* Apply path to fix segfault when removing server.
+1 -1
View File
@@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.0), libncursesw5-dev (>= 5.2.20020112a-7), ruby1.8-dev, libperl-dev, python-dev, libgnutls-dev, libtool, texinfo
Build-Depends: debhelper (>> 4.0.0), libncursesw5-dev, ruby, ruby1.8-dev, libperl-dev, python-dev, libgnutls-dev, libtool, xsltproc, docbook-xsl
Standards-Version: 3.6.2
Package: weechat
+1
View File
@@ -1 +1,2 @@
debian/tmp/usr/share/locale/
debian/tmp/usr/share/doc/weechat/html usr/share/doc/weechat-common
+7 -1
View File
@@ -32,11 +32,14 @@
"en_US" => "values",
"es_ES" => "valores");
%all_default = ("fr_FR" => "valeur par défaut",
"en_US" => "default values",
"en_US" => "default value",
"es_ES" => "valor por defecto");
%all_desc = ("fr_FR" => "description",
"en_US" => "description",
"es_ES" => "descripción");
$warning_do_not_edit = "\n<!-- ********* WARNING! *********\n\n"
." This file is automatically built with a Perl script. DO NOT EDIT!\n"
."-->\n\n";
foreach $lng (@all_lang)
{
@@ -61,6 +64,7 @@ sub create_commands
print "Creating $lang2/$file.xml ($lang)...\n";
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
print XML $warning_do_not_edit;
$started = 0;
$ENV{"LANG"} = $lang;
@@ -94,6 +98,7 @@ sub create_key_func
print "Creating $lang2/$file.xml ($lang)...\n";
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
print XML $warning_do_not_edit;
$ENV{"LANG"} = $lang;
foreach (`$command`)
@@ -120,6 +125,7 @@ sub create_config
print "Creating $lang2/$file.xml ($lang)...\n";
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
print XML $warning_do_not_edit;
$type = "";
$values = "";
$default = "";
+208 -167
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>admin [target]</command>
<programlisting>
find information about the administrator of the server
+26
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><literal>return</literal></entry>
<entry>terminate line</entry>
@@ -91,6 +97,22 @@
<entry><literal>page_down</literal></entry>
<entry>scroll one page down</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>scroll a few lines up</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>scroll a few lines down</entry>
</row>
<row>
<entry><literal>scroll_top</literal></entry>
<entry>scroll to top of buffer</entry>
</row>
<row>
<entry><literal>scroll_bottom</literal></entry>
<entry>scroll to bottom of buffer</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>display beginning of nicklist</entry>
@@ -115,6 +137,10 @@
<entry><literal>jump_dcc</literal></entry>
<entry>jump to DCC buffer</entry>
</row>
<row>
<entry><literal>jump_raw_data</literal></entry>
<entry>jump to raw IRC data buffer</entry>
</row>
<row>
<entry><literal>jump_last_buffer</literal></entry>
<entry>jump to last buffer</entry>
+2130 -166
View File
File diff suppressed because it is too large Load Diff
+8
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>alias [alias_name [command [arguments]]</command>
<programlisting>
create an alias for a command
@@ -167,6 +173,8 @@ Without argument, /unignore command lists all defined ignore.
<programlisting>
upgrade WeeChat without disconnecting from servers
This command run again WeeChat binary, so it should have been compiled installed with a package manager before running this command.
</programlisting>
<command>uptime [-o]</command>
<programlisting>
+48 -7
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><option>look_set_title</option></entry>
<entry>booléen</entry>
@@ -62,6 +68,20 @@
<entry>'off'</entry>
<entry>Utiliser le même tampon pour tous les serveurs</entry>
</row>
<row>
<entry><option>look_open_near_server</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'off'</entry>
<entry>Ouvrir les nouveaux canaux/privés près du serveur</entry>
</row>
<row>
<entry><option>look_scroll_amount</option></entry>
<entry>entier</entry>
<entry>entre 1 et 2147483647</entry>
<entry>3</entry>
<entry>Nombre de lignes pour le défilement avec scroll_up et scroll_down</entry>
</row>
<row>
<entry><option>look_buffer_timestamp</option></entry>
<entry>chaîne</entry>
@@ -146,6 +166,13 @@
<entry>'[]-^'</entry>
<entry>Caractères à ignorer pour la complétion des pseudos</entry>
</row>
<row>
<entry><option>look_nick_complete_first</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'off'</entry>
<entry>Compléter seulement avec le premier pseudo trouvé</entry>
</row>
<row>
<entry><option>look_infobar</option></entry>
<entry>booléen</entry>
@@ -738,8 +765,8 @@
<entry><option>log_path</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'~/.weechat/logs/'</entry>
<entry>Chemin pour les conversations sauvegardées par WeeChat</entry>
<entry>'%h/logs/'</entry>
<entry>Chemin pour les conversations sauvegardées par WeeChat ('%h' sera remplacé par le répertoire de base WeeChat, par défaut: ~/.weechat)</entry>
</row>
<row>
<entry><option>log_timestamp</option></entry>
@@ -762,12 +789,19 @@
<entry>'off'</entry>
<entry>Affiche un message pour l'absence/le retour</entry>
</row>
<row>
<entry><option>irc_show_away_once</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>Voir le message d'absence distant une seule fois en privé</entry>
</row>
<row>
<entry><option>irc_default_msg_part</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'WeeChat %v'</entry>
<entry>Message par défaut pour le part (quitte un canal)</entry>
<entry>Message par défaut pour le part (quitte un canal) ('%v' sera remplacé par la version de WeeChat dans la chaîne)</entry>
</row>
<row>
<entry><option>irc_default_msg_quit</option></entry>
@@ -790,6 +824,13 @@
<entry>0</entry>
<entry>Intervalle entre deux vérifications des absences (en minutes, 0 = ne jemais vérifier)</entry>
</row>
<row>
<entry><option>irc_away_check_max_nicks</option></entry>
<entry>entier</entry>
<entry>entre 0 et 2147483647</entry>
<entry>0</entry>
<entry>Ne pas vérifier les pseudos absents lorsqu'il y a un nombre important de pseudos (0 = pas de limite)</entry>
</row>
<row>
<entry><option>irc_lag_check</option></entry>
<entry>entier</entry>
@@ -885,7 +926,7 @@
<entry><option>dcc_download_path</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'~'</entry>
<entry>'%h/dcc'</entry>
<entry>Chemin pour écrire les fichiers reçus par dcc (par défaut: répertoire de l'utilisateur)</entry>
</row>
<row>
@@ -969,8 +1010,8 @@
<entry><option>plugins_path</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'~/.weechat/plugins'</entry>
<entry>Chemin de recherche des extensions</entry>
<entry>'%h/plugins'</entry>
<entry>Chemin de recherche des extensions ('%h' sera remplacé par le répertoire de base WeeChat, par défaut: ~/.weechat)</entry>
</row>
<row>
<entry><option>plugins_autoload</option></entry>
@@ -1089,7 +1130,7 @@
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>''</entry>
<entry>Commande à exécuter en premier lorsque connecté au serveur</entry>
<entry>Commande(s) à exécuter lorsque connecté au serveur (plusieurs commandes doivent être séparées par ';', utilisez '\;' pour un point-virgule)</entry>
</row>
<row>
<entry><option>server_command_delay</option></entry>
+6
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>admin [cible]</command>
<programlisting>
trouver les informations sur l'administrateur du serveur
+26
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><literal>return</literal></entry>
<entry>terminer la ligne</entry>
@@ -91,6 +97,22 @@
<entry><literal>page_down</literal></entry>
<entry>faire défiler d'une page vers le bas</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>faire défiler de quelques lignes vers le haut</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>faire défiler de quelques lignes vers le bas</entry>
</row>
<row>
<entry><literal>scroll_top</literal></entry>
<entry>faire défiler jusqu'au début du tampon</entry>
</row>
<row>
<entry><literal>scroll_bottom</literal></entry>
<entry>faire défiler jusqu'à la fin du tampon</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>afficher le début de la liste des pseudos</entry>
@@ -115,6 +137,10 @@
<entry><literal>jump_dcc</literal></entry>
<entry>sauter au tampon DCC</entry>
</row>
<row>
<entry><literal>jump_raw_data</literal></entry>
<entry>sauter au tampon IRC brut</entry>
</row>
<row>
<entry><literal>jump_last_buffer</literal></entry>
<entry>sauter au dernier tampon</entry>
+2143 -146
View File
File diff suppressed because it is too large Load Diff
+8
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>alias [nom_alias [commande [paramètres]]</command>
<programlisting>
créer un alias pour une commande
@@ -167,6 +173,8 @@ Sans param
<programlisting>
mettre à jour WeeChat sans se déconnecter des serveurs
Cette commande lance à nouveau le binaire WeeChat, il doit donc avoir été compilé ou installé via un gestionnaire de paquet avant de lancer cette commande.
</programlisting>
<command>uptime [-o]</command>
<programlisting>
+5 -1
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "January 2006" "FlashCode"
.TH WEECHAT 1 "March 2006" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
@@ -27,6 +27,10 @@ disable auto-connect to servers at startup
.br
display config file help (list of options)
.TP
.B \-d, \-\-dir <dir>
.br
set WeeChat home dir
.TP
.B \-f, \-\-key\-functions
.br
display internal functions for keys
+1009 -882
View File
File diff suppressed because it is too large Load Diff
+1003 -872
View File
File diff suppressed because it is too large Load Diff
+1011 -875
View File
File diff suppressed because it is too large Load Diff
+5331
View File
File diff suppressed because it is too large Load Diff
+972 -852
View File
File diff suppressed because it is too large Load Diff
+696 -435
View File
File diff suppressed because it is too large Load Diff
+29 -24
View File
@@ -38,9 +38,9 @@ struct t_weechat_command
char *completion_template; /* template for completion */
/* NULL=no completion, ""=default (nick) */
int min_arg, max_arg; /* min & max number of arguments */
int (*cmd_function_args)(t_gui_window *, int, char **);
int (*cmd_function_args)(t_irc_server *, t_irc_channel *, int, char **);
/* function called when user enters cmd */
int (*cmd_function_1arg)(t_gui_window *, char *);
int (*cmd_function_1arg)(t_irc_server *, t_irc_channel *, char *);
/* function called when user enters cmd */
};
@@ -50,6 +50,7 @@ struct t_weechat_alias
{
char *alias_name;
char *alias_command;
int running;
t_weechat_alias *prev_alias;
t_weechat_alias *next_alias;
};
@@ -62,32 +63,36 @@ extern t_weelist *last_index_command;
extern void command_index_build ();
extern void command_index_free ();
extern t_weechat_alias *alias_search (char *);
extern t_weechat_alias *alias_new (char *, char *);
extern char *alias_get_final_command (t_weechat_alias *);
extern void alias_free_all ();
extern char **explode_string (char *, char *, int, int *);
extern void free_exploded_string (char **);
extern int exec_weechat_command (t_gui_window *, t_irc_server *, char *);
extern void user_command (t_gui_buffer *, t_irc_server *, char *);
extern int weechat_cmd_alias (t_gui_window *, char *);
extern int weechat_cmd_buffer (t_gui_window *, int, char **);
extern int weechat_cmd_charset (t_gui_window *, int, char **);
extern int weechat_cmd_clear (t_gui_window *, int, char **);
extern int weechat_cmd_connect (t_gui_window *, int, char **);
extern int weechat_cmd_debug (t_gui_window *, int, char **);
extern int weechat_cmd_disconnect (t_gui_window *, int, char **);
extern int weechat_cmd_help (t_gui_window *, int, char **);
extern int weechat_cmd_history (t_gui_window *, int, char **);
extern char **split_multi_command (char *, char);
extern void free_multi_command (char **);
extern int exec_weechat_command (t_irc_server *, t_irc_channel *, char *);
extern void user_command (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_alias (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_buffer (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_charset (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_clear (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_connect (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_debug (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_disconnect (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_help (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_history (t_irc_server *, t_irc_channel *, int, char **);
extern void weechat_cmd_ignore_display (char *, t_irc_ignore *);
extern int weechat_cmd_ignore (t_gui_window *, int, char **);
extern int weechat_cmd_key (t_gui_window *, char *);
extern int weechat_cmd_plugin (t_gui_window *, int, char **);
extern int weechat_cmd_save (t_gui_window *, int, char **);
extern int weechat_cmd_server (t_gui_window *, int, char **);
extern int weechat_cmd_set (t_gui_window *, char *);
extern int weechat_cmd_unalias (t_gui_window *, char *);
extern int weechat_cmd_unignore (t_gui_window *, int, char **);
extern int weechat_cmd_upgrade (t_gui_window *, int, char **);
extern int weechat_cmd_uptime (t_gui_window *, int, char **);
extern int weechat_cmd_window (t_gui_window *, int, char **);
extern int weechat_cmd_ignore (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_key (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_plugin (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_save (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_server (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_set (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_unalias (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_unignore (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_upgrade (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_uptime (t_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_window (t_irc_server *, t_irc_channel *, int, char **);
#endif /* command.h */
+32 -3
View File
@@ -107,6 +107,8 @@ void
completion_get_command_infos (t_completion *completion,
char **template, int *max_arg)
{
t_weechat_alias *ptr_alias;
char *ptr_command;
int i;
#ifdef PLUGINS
t_weechat_plugin *ptr_plugin;
@@ -116,6 +118,16 @@ completion_get_command_infos (t_completion *completion,
*template = NULL;
*max_arg = MAX_ARGS;
ptr_alias = alias_search (completion->base_command);
if (ptr_alias)
{
ptr_command = alias_get_final_command (ptr_alias);
if (!ptr_command)
return;
}
else
ptr_command = completion->base_command;
#ifdef PLUGINS
/* look for plugin command handler */
for (ptr_plugin = weechat_plugins; ptr_plugin;
@@ -126,7 +138,7 @@ completion_get_command_infos (t_completion *completion,
{
if ((ptr_handler->type == HANDLER_COMMAND)
&& (ascii_strcasecmp (ptr_handler->command,
completion->base_command) == 0))
ptr_command) == 0))
{
*template = ptr_handler->completion_template;
*max_arg = MAX_ARGS;
@@ -140,7 +152,7 @@ completion_get_command_infos (t_completion *completion,
for (i = 0; weechat_commands[i].command_name; i++)
{
if (ascii_strcasecmp (weechat_commands[i].command_name,
completion->base_command) == 0)
ptr_command) == 0)
{
*template = weechat_commands[i].completion_template;
*max_arg = weechat_commands[i].max_arg;
@@ -153,7 +165,7 @@ completion_get_command_infos (t_completion *completion,
{
if ((irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
&& (ascii_strcasecmp (irc_commands[i].command_name,
completion->base_command) == 0))
ptr_command) == 0))
{
*template = irc_commands[i].completion_template;
*max_arg = irc_commands[i].max_arg;
@@ -1044,6 +1056,15 @@ completion_nick (t_completion *completion)
if (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
{
if (!(completion->completion_list))
{
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_channel *)(completion->channel))->name);
weelist_add (&completion->completion_list,
&completion->last_completion,
((t_irc_server *)(completion->server))->nick);
}
completion_command_arg (completion, 1);
return;
}
@@ -1051,6 +1072,7 @@ completion_nick (t_completion *completion)
length = strlen (completion->base_word);
word_found_seen = 0;
other_completion = 0;
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
ptr_nick; ptr_nick = ptr_nick->next_nick)
{
@@ -1059,6 +1081,11 @@ completion_nick (t_completion *completion)
if ((!completion->word_found) || word_found_seen)
{
completion->word_found = ptr_nick->nick;
if (cfg_look_nick_complete_first)
{
completion->position = -1;
return;
}
for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
ptr_nick2 = ptr_nick2->next_nick)
{
@@ -1070,8 +1097,10 @@ completion_nick (t_completion *completion)
if (other_completion == 0)
completion->position = -1;
else
{
if (completion->position < 0)
completion->position = 0;
}
return;
}
other_completion++;
+12 -14
View File
@@ -54,7 +54,7 @@ fifo_create ()
if (cfg_irc_fifo_pipe)
{
/* build FIFO filename: "~/.weechat/weechat_fifo_" + process PID */
/* build FIFO filename: "<weechat_home>/weechat_fifo_" + process PID */
if (!weechat_fifo_filename)
{
filename_length = strlen (weechat_home) + 64;
@@ -101,20 +101,26 @@ fifo_exec (char *text)
char *pos_msg, *pos;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_gui_buffer *ptr_buffer;
pos = NULL;
ptr_server = NULL;
ptr_channel = NULL;
ptr_buffer = NULL;
/* look for server/channel at beginning of text */
/* text may be: "server,channel *text" or "server *text" or "*text" */
if (text[0] == '*')
{
pos_msg = text + 1;
ptr_buffer = (gui_current_window->buffer->has_input) ? gui_current_window->buffer : gui_buffers;
ptr_server = SERVER(ptr_buffer);
if (gui_current_window->buffer->has_input)
{
ptr_server = SERVER(gui_current_window->buffer);
ptr_channel = CHANNEL(gui_current_window->buffer);
}
else
{
ptr_server = SERVER(gui_buffers);
ptr_channel = NULL;
}
}
else
{
@@ -163,15 +169,7 @@ fifo_exec (char *text)
}
}
if (!ptr_buffer)
{
if (ptr_channel)
ptr_buffer = ptr_channel->buffer;
else
ptr_buffer = gui_buffers;
}
user_command (ptr_buffer, ptr_server, pos_msg);
user_command (ptr_server, ptr_channel, pos_msg);
}
/*
+4
View File
@@ -99,6 +99,8 @@ history_buffer_add (void *buffer, char *string)
&& (((t_gui_buffer *)(buffer))->num_history > cfg_history_max_commands))
{
ptr_history = ((t_gui_buffer *)buffer)->last_history->prev_history;
if (((t_gui_buffer *)buffer)->ptr_history == ((t_gui_buffer *)buffer)->last_history)
((t_gui_buffer *)buffer)->ptr_history = ptr_history;
((t_gui_buffer *)buffer)->last_history->prev_history->next_history = NULL;
if (((t_gui_buffer *)buffer)->last_history->text)
free (((t_gui_buffer *)buffer)->last_history->text);
@@ -144,6 +146,8 @@ history_global_add (char *string)
&& (num_history_global > cfg_history_max_commands))
{
ptr_history = history_global_last->prev_history;
if (history_global_ptr == history_global_last)
history_global_ptr = ptr_history;
history_global_last->prev_history->next_history = NULL;
if (history_global_last->text)
free (history_global_last->text);
+24 -12
View File
@@ -107,29 +107,41 @@ void
log_start (t_gui_buffer *buffer)
{
int length;
char *ptr_home;
char *log_path, *log_path2;
ptr_home = getenv ("HOME");
length = strlen (cfg_log_path) +
((cfg_log_path[0] == '~') ? strlen (ptr_home) : 0) +
64;
log_path = weechat_strreplace (cfg_log_path, "~", getenv ("HOME"));
log_path2 = weechat_strreplace (log_path, "%h", weechat_home);
if (!log_path || !log_path2)
{
weechat_log_printf (_("Not enough memory to write log file for a buffer\n"));
if (log_path)
free (log_path);
if (log_path2)
free (log_path2);
return;
}
length = strlen (log_path2) + 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)
{
weechat_log_printf (_("Not enough memory to write log file for a buffer\n"));
if (log_path)
free (log_path);
if (log_path2)
free (log_path2);
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);
strcpy (buffer->log_filename, log_path2);
if (log_path)
free (log_path);
if (log_path2)
free (log_path2);
if (buffer->log_filename[strlen (buffer->log_filename) - 1] != DIR_SEPARATOR_CHAR)
strcat (buffer->log_filename, DIR_SEPARATOR);
+20 -9
View File
@@ -171,6 +171,7 @@ session_save_channel (FILE *file, t_irc_channel *channel)
rc = rc && (session_write_str (file, SESSION_CHAN_KEY, channel->key));
rc = rc && (session_write_int (file, SESSION_CHAN_NICKS_COUNT, channel->nicks_count));
rc = rc && (session_write_int (file, SESSION_CHAN_CHECKING_AWAY, channel->checking_away));
rc = rc && (session_write_str (file, SESSION_CHAN_AWAY_MESSAGE, channel->away_message));
rc = rc && (session_write_id (file, SESSION_CHAN_END));
if (!rc)
@@ -385,7 +386,8 @@ session_save_buffers (FILE *file)
rc = rc && (session_write_id (file, SESSION_OBJ_BUFFER));
rc = rc && (session_write_str (file, SESSION_BUFF_SERVER, SERVER(ptr_buffer) ? SERVER(ptr_buffer)->name : NULL));
rc = rc && (session_write_str (file, SESSION_BUFF_CHANNEL, CHANNEL(ptr_buffer) ? CHANNEL(ptr_buffer)->name : NULL));
rc = rc && (session_write_int (file, SESSION_BUFF_DCC, ptr_buffer->dcc));
rc = rc && (session_write_int (file, SESSION_BUFF_TYPE, ptr_buffer->type));
rc = rc && (session_write_int (file, SESSION_BUFF_ALL_SERVERS, ptr_buffer->all_servers));
rc = rc && (session_write_id (file, SESSION_BUFF_END));
if (!rc)
@@ -473,10 +475,12 @@ session_crash (FILE *file, char *message, ...)
session_last_read_pos,
session_last_read_length);
fprintf (stderr,
_("Please send ~/.weechat/%s, ~/.weechat/%s and "
_("Please send %s/%s, %s/%s and "
"above messages to WeeChat developers for support.\n"
"Be careful, private info may be in these files.\n"),
weechat_home,
WEECHAT_LOG_NAME,
weechat_home,
WEECHAT_SESSION_NAME);
exit (EXIT_FAILURE);
}
@@ -1038,6 +1042,9 @@ session_load_channel (FILE *file)
case SESSION_CHAN_CHECKING_AWAY:
rc = rc && (session_read_int (file, &(session_current_channel->checking_away)));
break;
case SESSION_CHAN_AWAY_MESSAGE:
rc = rc && (session_read_str (file, &(session_current_channel->away_message)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"channel (object id: %d)\n"));
@@ -1328,7 +1335,7 @@ session_load_buffer (FILE *file)
{
int object_id, rc;
char *server_name, *channel_name;
int dcc;
int buffer_type;
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
@@ -1348,18 +1355,18 @@ session_load_buffer (FILE *file)
return 0;
}
/* read dcc */
if (!session_read_object (file, SESSION_BUFF_DCC, SESSION_TYPE_INT, &dcc, 0))
/* read buffer type */
if (!session_read_object (file, SESSION_BUFF_TYPE, SESSION_TYPE_INT, &buffer_type, 0))
{
session_crash (file, _("dcc flag not found for buffer"));
session_crash (file, _("buffer type not found"));
return 0;
}
/* allocate buffer */
weechat_log_printf (_("session: loading buffer (server: %s, channel: %s, dcc: %d)\n"),
weechat_log_printf (_("session: loading buffer (server: %s, channel: %s, type: %d)\n"),
(server_name) ? server_name : "-",
(channel_name) ? channel_name : "-",
dcc);
buffer_type);
ptr_server = NULL;
ptr_channel = NULL;
if (server_name)
@@ -1382,7 +1389,8 @@ session_load_buffer (FILE *file)
}
}
session_current_buffer = gui_buffer_new (gui_windows, ptr_server, ptr_channel, dcc, 1);
session_current_buffer = gui_buffer_new (gui_windows, ptr_server,
ptr_channel, buffer_type, 1);
if (!session_current_buffer)
{
session_crash (file, _("can't create new buffer"));
@@ -1407,6 +1415,9 @@ session_load_buffer (FILE *file)
{
case SESSION_BUFF_END:
return 1;
case SESSION_BUFF_ALL_SERVERS:
rc = rc && (session_read_int (file, &(session_current_buffer->all_servers)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"buffer (object id: %d)\n"));
+4 -2
View File
@@ -101,7 +101,8 @@ enum t_session_channel
SESSION_CHAN_LIMIT,
SESSION_CHAN_KEY,
SESSION_CHAN_NICKS_COUNT,
SESSION_CHAN_CHECKING_AWAY
SESSION_CHAN_CHECKING_AWAY,
SESSION_CHAN_AWAY_MESSAGE
};
enum t_session_nick
@@ -152,7 +153,8 @@ enum t_session_buffer
SESSION_BUFF_END = 0,
SESSION_BUFF_SERVER,
SESSION_BUFF_CHANNEL,
SESSION_BUFF_DCC
SESSION_BUFF_TYPE,
SESSION_BUFF_ALL_SERVERS
};
enum t_session_line
+141 -39
View File
@@ -166,7 +166,7 @@ ascii_strncasecmp (char *string1, char *string2, int max)
}
/*
* weechat_log_printf: displays a message in WeeChat log (~/.weechat/weechat.log)
* weechat_log_printf: displays a message in WeeChat log (<weechat_home>/weechat.log)
*/
void
@@ -262,6 +262,62 @@ weechat_iconv (char *from_code, char *to_code, char *string)
return outbuf;
}
/*
* weechat_strreplace: replace a string by new one in a string
* note: returned value has to be free() after use
*/
char *
weechat_strreplace (char *string, char *search, char *replace)
{
char *pos, *new_string;
int length1, length2, length_new, count;
if (!string || !search || !replace)
return NULL;
length1 = strlen (search);
length2 = strlen (replace);
/* count number of strings to replace */
count = 0;
pos = string;
while (pos && pos[0] && (pos = strstr (pos, search)))
{
count++;
pos += length1;
}
/* easy: no string to replace! */
if (count == 0)
return strdup (string);
/* compute needed memory for new string */
length_new = strlen (string) - (count * length1) + (count * length2) + 1;
/* allocate new string */
new_string = (char *)malloc (length_new * sizeof (char));
if (!new_string)
return strdup (string);
/* replace all occurences */
new_string[0] = '\0';
while (string && string[0])
{
pos = strstr (string, search);
if (pos)
{
strncat (new_string, string, pos - string);
strcat (new_string, replace);
pos += length1;
}
else
strcat (new_string, string);
string = pos;
}
return new_string;
}
/*
* get_timeval_diff: calculates difference between two times (return in milliseconds)
*/
@@ -300,6 +356,7 @@ weechat_display_usage (char *exec_name)
printf ("\n\n");
printf (_(" -a, --no-connect disable auto-connect to servers at startup\n"
" -c, --config display config file options\n"
" -d, --dir <path> set WeeChat home directory (default: ~/.weechat)\n"
" -f, --key-functions display WeeChat internal functions for keys\n"
" -h, --help this help\n"
" -i, --irc-commands display IRC commands\n"
@@ -320,7 +377,7 @@ weechat_display_config_options ()
{
int i, j, k;
printf (_("WeeChat configuration options (~/.weechat/weechat.rc):\n\n"));
printf (_("WeeChat configuration options (<weechat_home>/weechat.rc):\n\n"));
for (i = 0; i < CONFIG_NUMBER_SECTIONS; i++)
{
if (weechat_options[i])
@@ -498,6 +555,7 @@ weechat_parse_args (int argc, char *argv[])
weechat_argv0 = strdup (argv[0]);
weechat_session = NULL;
weechat_home = NULL;
server_cmd_line = 0;
auto_connect = 1;
auto_load_plugins = 1;
@@ -513,6 +571,19 @@ weechat_parse_args (int argc, char *argv[])
weechat_display_config_options ();
weechat_shutdown (EXIT_SUCCESS, 0);
}
else if ((strcmp (argv[i], "-d") == 0)
|| (strcmp (argv[i], "--dir") == 0))
{
if (i + 1 < argc)
weechat_home = strdup (argv[++i]);
else
{
fprintf (stderr,
_("%s missing argument for --dir option\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
}
}
else if ((strcmp (argv[i], "-f") == 0)
|| (strcmp (argv[i], "--key-functions") == 0))
{
@@ -626,56 +697,86 @@ weechat_create_dir (char *directory)
}
/*
* weechat_create_home_dirs: create WeeChat directories (if not found)
* weechat_create_home_dirs: create WeeChat directories
*/
void
weechat_create_home_dirs ()
{
char *ptr_home, *dir_name;
char *ptr_home;
int dir_length;
ptr_home = getenv ("HOME");
if (!ptr_home)
{
fprintf (stderr, _("%s unable to get HOME directory\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
}
dir_length = strlen (ptr_home) + 10;
weechat_home =
(char *) malloc (dir_length * sizeof (char));
if (!weechat_home)
{
fprintf (stderr, _("%s not enough memory for home directory\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
ptr_home = getenv ("HOME");
if (!ptr_home)
{
fprintf (stderr, _("%s unable to get HOME directory\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
}
dir_length = strlen (ptr_home) + 10;
weechat_home =
(char *) malloc (dir_length * sizeof (char));
if (!weechat_home)
{
fprintf (stderr, _("%s not enough memory for home directory\n"),
WEECHAT_ERROR);
weechat_shutdown (EXIT_FAILURE, 0);
}
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
DIR_SEPARATOR);
}
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
DIR_SEPARATOR);
/* create home directory "~/.weechat" ; error is fatal */
/* create home directory; error is fatal */
if (!weechat_create_dir (weechat_home))
{
fprintf (stderr, _("%s unable to create ~/.weechat directory\n"),
WEECHAT_ERROR);
fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
WEECHAT_ERROR, weechat_home);
weechat_shutdown (EXIT_FAILURE, 0);
}
}
/*
* weechat_create_config_dirs: create config directories (read from config file)
*/
void
weechat_create_config_dirs ()
{
char *dir1, *dir2;
dir_length = strlen (weechat_home) + 64;
dir_name = (char *) malloc (dir_length * sizeof (char));
/* create "~/.weechat/logs" */
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
"logs");
if (!weechat_create_dir (dir_name))
/* create logs directory" */
dir1 = weechat_strreplace (cfg_log_path, "~", getenv ("HOME"));
dir2 = weechat_strreplace (dir1, "%h", weechat_home);
if (weechat_create_dir (dir2))
{
fprintf (stderr, _("%s unable to create ~/.weechat/logs directory\n"),
WEECHAT_WARNING);
if (strcmp (dir2, getenv ("HOME")) != 0)
chmod (dir2, 0700);
}
chmod (dir_name, 0700);
else
fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
WEECHAT_WARNING, dir2);
if (dir1)
free (dir1);
if (dir2)
free (dir2);
free (dir_name);
/* create DCC download directory */
dir1 = weechat_strreplace (cfg_dcc_download_path, "~", getenv ("HOME"));
dir2 = weechat_strreplace (dir1, "%h", weechat_home);
if (weechat_create_dir (dir2))
{
if (strcmp (dir2, getenv ("HOME")) != 0)
chmod (dir2, 0700);
}
else
fprintf (stderr, _("%s unable to create \"%s\" directory\n"),
WEECHAT_WARNING, dir2);
if (dir1)
free (dir1);
if (dir2)
free (dir2);
}
/*
@@ -716,8 +817,8 @@ weechat_init_log ()
snprintf (filename, filename_length, "%s/" WEECHAT_LOG_NAME, weechat_home);
if ((weechat_log_file = fopen (filename, "wt")) == NULL)
fprintf (stderr,
_("%s unable to create/append to log file (~/.weechat/%s)"),
WEECHAT_WARNING, WEECHAT_LOG_NAME);
_("%s unable to create/append to log file (%s/%s)"),
WEECHAT_WARNING, weechat_home, WEECHAT_LOG_NAME);
free (filename);
}
@@ -921,7 +1022,7 @@ weechat_dump (int crash)
}
/*
* weechat_sigsegv: SIGSEGV handler: save crash log to ~/.weechat/weechat.log and exit
* weechat_sigsegv: SIGSEGV handler: save crash log to <weechat_home>/weechat.log and exit
*/
void
@@ -933,7 +1034,7 @@ weechat_sigsegv ()
gui_end ();
fprintf (stderr, "\n");
fprintf (stderr, "*** Very bad! WeeChat has crashed (SIGSEGV received)\n");
fprintf (stderr, "*** Full crash dump was saved to ~/.weechat/weechat.log file\n");
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file\n", weechat_home);
fprintf (stderr, "*** Please send this file to WeeChat developers.\n");
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
@@ -969,12 +1070,13 @@ main (int argc, char *argv[])
weechat_init_log (); /* init log file */
command_index_build (); /* build cmd index for completion */
weechat_config_read (); /* read configuration */
weechat_create_config_dirs (); /* create config directories */
utf8_init (); /* init UTF-8 in WeeChat */
gui_init (); /* init WeeChat interface */
weechat_welcome_message (); /* display WeeChat welcome message */
fifo_create (); /* FIFO pipe for remote control */
if (weechat_session)
session_load (weechat_session); /* load previous session if asked */
weechat_welcome_message (); /* display WeeChat welcome message */
#ifdef PLUGINS
plugin_init (auto_load_plugins); /* init plugin interface(s) */
#endif
+2 -1
View File
@@ -108,8 +108,9 @@ extern gnutls_certificate_credentials gnutls_xcred;
extern int ascii_strcasecmp (char *, char *);
extern int ascii_strncasecmp (char *, char *, int);
extern void weechat_log_printf (char *, ...);
extern void weechat_dump (int);
extern char *weechat_iconv (char *, char *, char *);
extern char *weechat_strreplace (char *, char *, char *);
extern void weechat_dump (int);
extern long get_timeval_diff (struct timeval *, struct timeval *);
extern void weechat_shutdown (int, int);
+39 -10
View File
@@ -73,6 +73,8 @@ char *cfg_look_charset_decode_utf;
char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
int cfg_look_one_server_buffer;
int cfg_look_scroll_amount;
int cfg_look_open_near_server;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks_number;
int cfg_look_color_actions;
@@ -87,6 +89,7 @@ int cfg_look_nickmode_empty;
char *cfg_look_no_nickname;
char *cfg_look_completor;
char *cfg_look_nick_completion_ignore;
int cfg_look_nick_complete_first;
int cfg_look_infobar;
char *cfg_look_infobar_timestamp;
int cfg_look_infobar_seconds;
@@ -137,6 +140,14 @@ t_config_option weechat_options_look[] =
N_("use same buffer for all servers"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_one_server_buffer, NULL, config_change_one_server_buffer },
{ "look_open_near_server", N_("open new channels/privates near server"),
N_("open new channels/privates near server"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_open_near_server, NULL, config_change_noop },
{ "look_scroll_amount", N_("how many lines to scroll by with scroll_up and scroll_down"),
N_("how many lines to scroll by with scroll_up and scroll_down"),
OPTION_TYPE_INT, 1, INT_MAX, 3,
NULL, NULL, &cfg_look_scroll_amount, NULL, config_change_buffer_content },
{ "look_buffer_timestamp", N_("timestamp for buffers"),
N_("timestamp for buffers"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -187,6 +198,10 @@ t_config_option weechat_options_look[] =
N_("chars ignored for nick completion"),
OPTION_TYPE_STRING, 0, 0, 0,
"[]-^", NULL, NULL, &cfg_look_nick_completion_ignore, config_change_noop },
{ "look_nick_complete_first", N_("complete only with first nick found"),
N_("complete only with first nick found"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_nick_complete_first, NULL, config_change_noop },
{ "look_infobar", N_("enable info bar"),
N_("enable info bar"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
@@ -633,9 +648,10 @@ t_config_option weechat_options_log[] =
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_log_plugin_msg, NULL, &config_change_noop },
{ "log_path", N_("path for log files"),
N_("path for WeeChat log files"),
N_("path for WeeChat log files ('%h' will be replaced by WeeChat home, "
"~/.weechat by default)"),
OPTION_TYPE_STRING, 0, 0, 0,
"~/.weechat/logs/", NULL, NULL, &cfg_log_path, &config_change_noop },
"%h/logs/", NULL, NULL, &cfg_log_path, &config_change_noop },
{ "log_timestamp", N_("timestamp for log"),
N_("timestamp for log (see man strftime for date/time specifiers)"),
OPTION_TYPE_STRING, 0, 0, 0,
@@ -650,12 +666,14 @@ t_config_option weechat_options_log[] =
/* config, irc section */
int cfg_irc_display_away;
int cfg_irc_show_away_once;
char *cfg_irc_display_away_values[] =
{ "off", "local", "channel", NULL };
char *cfg_irc_default_msg_part;
char *cfg_irc_default_msg_quit;
int cfg_irc_notice_as_pv;
int cfg_irc_away_check;
int cfg_irc_away_check_max_nicks;
int cfg_irc_lag_check;
int cfg_irc_lag_min_show;
int cfg_irc_lag_disconnect;
@@ -669,8 +687,13 @@ t_config_option weechat_options_irc[] =
N_("display message when (un)marking as away"),
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
"off", cfg_irc_display_away_values, &cfg_irc_display_away, NULL, &config_change_noop },
{ "irc_show_away_once", N_("show remote away message only once in private"),
N_("show remote away message only once in private"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_irc_show_away_once, NULL, &config_change_noop },
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
N_("default part message (leaving channel)"),
N_("default part message (leaving channel) ('%v' will be replaced by "
"WeeChat version in string)"),
OPTION_TYPE_STRING, 0, 0, 0,
"WeeChat %v", NULL, NULL, &cfg_irc_default_msg_part, &config_change_noop },
{ "irc_default_msg_quit", N_("default quit message"),
@@ -685,6 +708,10 @@ t_config_option weechat_options_irc[] =
N_("interval between two checks for away (in minutes, 0 = never check)"),
OPTION_TYPE_INT, 0, INT_MAX, 0,
NULL, NULL, &cfg_irc_away_check, NULL, &config_change_away_check },
{ "irc_away_check_max_nicks", N_("max number of nicks for away check"),
N_("do not check away nicks on channels with high number of nicks (0 = unlimited)"),
OPTION_TYPE_INT, 0, INT_MAX, 0,
NULL, NULL, &cfg_irc_away_check_max_nicks, NULL, &config_change_away_check },
{ "irc_lag_check", N_("interval between two checks for lag"),
N_("interval between two checks for lag (in seconds)"),
OPTION_TYPE_INT, 30, INT_MAX, 60,
@@ -764,7 +791,7 @@ t_config_option weechat_options_dcc[] =
{ "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, &config_change_noop },
"%h/dcc", 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, "~",
@@ -836,9 +863,10 @@ char *cfg_plugins_extension;
t_config_option weechat_options_plugins[] =
{ { "plugins_path", N_("path for searching plugins"),
N_("path for searching plugins"),
N_("path for searching plugins ('%h' will be replaced by WeeChat home, "
"~/.weechat by default)"),
OPTION_TYPE_STRING, 0, 0, 0,
"~/.weechat/plugins", NULL, NULL, &cfg_plugins_path, &config_change_noop },
"%h/plugins", NULL, NULL, &cfg_plugins_path, &config_change_noop },
{ "plugins_autoload", N_("list of plugins to load automatically"),
N_("comma separated list of plugins to load automatically at startup, "
"\"*\" means all plugins found "
@@ -919,8 +947,9 @@ t_config_option weechat_options_server[] =
N_("real name to use on IRC server"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.realname), NULL },
{ "server_command", N_("first command to run when connected to server"),
N_("first command to run when connected to server"),
{ "server_command", N_("command(s) to run when connected to server"),
N_("command(s) to run when connected to server (many commands should be "
"separated by ';', use '\\;' for a semicolon)"),
OPTION_TYPE_STRING, 0, 0, 0,
"", NULL, NULL, &(cfg_server.command), NULL },
{ "server_command_delay", N_("delay (in seconds) after command was executed"),
@@ -1146,12 +1175,12 @@ config_change_nicks_colors ()
void
config_change_away_check ()
{
check_away = 0;
if (cfg_irc_away_check == 0)
{
/* reset away flag for all nicks/chans/servers */
server_remove_away ();
}
check_away = cfg_irc_away_check * 60;
}
/*
@@ -2338,7 +2367,7 @@ config_write (char *config_name)
ptr_alias = ptr_alias->next_alias)
{
fprintf (file, "%s = \"%s\"\n",
ptr_alias->alias_name, ptr_alias->alias_command + 1);
ptr_alias->alias_name, ptr_alias->alias_command);
}
/* ignore section */
+5
View File
@@ -92,6 +92,8 @@ extern char *cfg_look_charset_decode_utf;
extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern int cfg_look_one_server_buffer;
extern int cfg_look_open_near_server;
extern int cfg_look_scroll_amount;
extern char *cfg_look_buffer_timestamp;
extern int cfg_look_color_nicks_number;
extern int cfg_look_color_actions;
@@ -104,6 +106,7 @@ extern int cfg_look_nickmode_empty;
extern char *cfg_look_no_nickname;
extern char *cfg_look_completor;
extern char *cfg_look_nick_completion_ignore;
extern int cfg_look_nick_complete_first;
extern int cfg_look_infobar;
extern char *cfg_look_infobar_timestamp;
extern int cfg_look_infobar_seconds;
@@ -187,10 +190,12 @@ extern char *cfg_log_timestamp;
extern int cfg_log_hide_nickserv_pwd;
extern int cfg_irc_display_away;
extern int cfg_irc_show_away_once;
extern char *cfg_irc_default_msg_part;
extern char *cfg_irc_default_msg_quit;
extern int cfg_irc_notice_as_pv;
extern int cfg_irc_away_check;
extern int cfg_irc_away_check_max_nicks;
extern int cfg_irc_lag_check;
extern int cfg_irc_lag_min_show;
extern int cfg_irc_lag_disconnect;
+316 -194
View File
@@ -826,7 +826,7 @@ gui_draw_buffer_title (t_gui_buffer *buffer, int erase)
}
else
{
if (!buffer->dcc)
if (buffer->type == BUFFER_TYPE_STANDARD)
{
mvwprintw (ptr_win->win_title, 0, 0,
format,
@@ -843,12 +843,12 @@ gui_draw_buffer_title (t_gui_buffer *buffer, int erase)
}
/*
* gui_display_new_line: display a new line
* gui_curses_display_new_line: display a new line
*/
void
gui_display_new_line (t_gui_window *window, int num_lines, int count,
int *lines_displayed, int simulate)
gui_curses_display_new_line (t_gui_window *window, int num_lines, int count,
int *lines_displayed, int simulate)
{
if ((count == 0) || (*lines_displayed >= num_lines - count))
{
@@ -1147,8 +1147,8 @@ gui_display_word (t_gui_window *window,
(((simulate) ||
(window->win_chat_cursor_y <= window->win_chat_height - 1)) &&
(window->win_chat_cursor_x > (window->win_chat_width - 1))))
gui_display_new_line (window, num_lines, count,
lines_displayed, simulate);
gui_curses_display_new_line (window, num_lines, count,
lines_displayed, simulate);
if ((data >= end_line) ||
((!simulate) && (window->win_chat_cursor_y >= window->win_chat_height)))
@@ -1220,16 +1220,19 @@ gui_get_word_info (t_gui_window *window,
}
/*
* gui_display_line: display a line in the chat window
* if count == 0, display whole line
* if count > 0, display 'count' lines (beginning from the end)
* if simulate == 1, nothing is displayed (for counting how
* many lines would have been lines displayed)
* returns: number of lines displayed (or simulated)
* gui_curses_display_line: display a line in the chat window
* if count == 0, display whole line
* if count > 0, display 'count' lines
* (beginning from the end)
* if simulate == 1, nothing is displayed
* (for counting how many lines would have been
* lines displayed)
* returns: number of lines displayed (or simulated)
*/
int
gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulate)
gui_curses_display_line (t_gui_window *window, t_gui_line *line, int count,
int simulate)
{
int num_lines, x, y, lines_displayed;
int read_marker_x, read_marker_y;
@@ -1252,7 +1255,7 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
return 0;
x = window->win_chat_cursor_x;
y = window->win_chat_cursor_y;
num_lines = gui_display_line (window, line, 0, 1);
num_lines = gui_curses_display_line (window, line, 0, 1);
window->win_chat_cursor_x = x;
window->win_chat_cursor_y = y;
}
@@ -1290,8 +1293,8 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
if ((window->win_chat_cursor_x + word_length_with_spaces > window->win_chat_width)
&& (word_length <= window->win_chat_width - line->length_align))
{
gui_display_new_line (window, num_lines, count,
&lines_displayed, simulate);
gui_curses_display_new_line (window, num_lines, count,
&lines_displayed, simulate);
/* apply styles before jumping to start of word */
if (!simulate && (word_start_offset > 0))
{
@@ -1341,8 +1344,8 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat
}
else
{
gui_display_new_line (window, num_lines, count,
&lines_displayed, simulate);
gui_curses_display_new_line (window, num_lines, count,
&lines_displayed, simulate);
ptr_data = NULL;
}
}
@@ -1392,7 +1395,7 @@ gui_calculate_line_diff (t_gui_window *window, t_gui_line **line, int *line_pos,
*line = window->buffer->last_line;
if (!(*line))
return;
current_size = gui_display_line (window, *line, 0, 1);
current_size = gui_curses_display_line (window, *line, 0, 1);
if (current_size == 0)
current_size = 1;
*line_pos = current_size - 1;
@@ -1404,11 +1407,11 @@ gui_calculate_line_diff (t_gui_window *window, t_gui_line **line, int *line_pos,
if (!(*line))
return;
*line_pos = 0;
current_size = gui_display_line (window, *line, 0, 1);
current_size = gui_curses_display_line (window, *line, 0, 1);
}
}
else
current_size = gui_display_line (window, *line, 0, 1);
current_size = gui_curses_display_line (window, *line, 0, 1);
while ((*line) && (difference != 0))
{
@@ -1422,7 +1425,7 @@ gui_calculate_line_diff (t_gui_window *window, t_gui_line **line, int *line_pos,
*line = (*line)->prev_line;
if (*line)
{
current_size = gui_display_line (window, *line, 0, 1);
current_size = gui_curses_display_line (window, *line, 0, 1);
if (current_size == 0)
current_size = 1;
*line_pos = current_size - 1;
@@ -1440,7 +1443,7 @@ gui_calculate_line_diff (t_gui_window *window, t_gui_line **line, int *line_pos,
*line = (*line)->next_line;
if (*line)
{
current_size = gui_display_line (window, *line, 0, 1);
current_size = gui_curses_display_line (window, *line, 0, 1);
if (current_size == 0)
current_size = 1;
*line_pos = 0;
@@ -1506,7 +1509,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
gui_window_set_weechat_color (ptr_win->win_chat, COLOR_WIN_CHAT);
if (buffer->dcc)
if (buffer->type == BUFFER_TYPE_DCC)
{
i = 0;
dcc_first = (ptr_win->dcc_first) ? (t_irc_dcc *) ptr_win->dcc_first : dcc_list;
@@ -1648,9 +1651,11 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
if (line_pos > 0)
{
/* display end of first line at top of screen */
gui_display_line (ptr_win, ptr_line,
gui_display_line (ptr_win, ptr_line, 0, 1) -
line_pos, 0);
gui_curses_display_line (ptr_win, ptr_line,
gui_curses_display_line (ptr_win,
ptr_line,
0, 1) -
line_pos, 0);
ptr_line = ptr_line->next_line;
ptr_win->first_line_displayed = 0;
}
@@ -1662,7 +1667,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
count = 0;
while (ptr_line && (ptr_win->win_chat_cursor_y <= ptr_win->win_chat_height - 1))
{
count = gui_display_line (ptr_win, ptr_line, 0, 0);
count = gui_curses_display_line (ptr_win, ptr_line, 0, 0);
ptr_line = ptr_line->next_line;
}
@@ -1672,7 +1677,7 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
/* if so, disable scroll indicator */
if (!ptr_line && ptr_win->scroll)
{
if (count == gui_display_line (ptr_win, ptr_win->buffer->last_line, 0, 1))
if (count == gui_curses_display_line (ptr_win, ptr_win->buffer->last_line, 0, 1))
{
ptr_win->scroll = 0;
ptr_win->start_line = NULL;
@@ -1699,6 +1704,19 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase)
}
}
/*
* gui_draw_buffer_chat_line: add a line to chat window for a buffer
*/
void
gui_draw_buffer_chat_line (t_gui_buffer *buffer, t_gui_line *line)
{
/* This function does nothing in Curses GUI,
line will be displayed by gui_buffer_draw_chat() */
(void) buffer;
(void) line;
}
/*
* gui_draw_buffer_nick: draw nick window for a buffer
*/
@@ -2087,10 +2105,18 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
gui_window_set_weechat_color (ptr_win->win_status, COLOR_WIN_STATUS_DELIMITERS);
wprintw (ptr_win->win_status, ":");
gui_window_set_weechat_color (ptr_win->win_status, COLOR_WIN_STATUS_CHANNEL);
if (ptr_win->buffer->dcc)
wprintw (ptr_win->win_status, "<DCC> ");
else
wprintw (ptr_win->win_status, _("[not connected] "));
switch (ptr_win->buffer->type)
{
case BUFFER_TYPE_STANDARD:
wprintw (ptr_win->win_status, _("[not connected] "));
break;
case BUFFER_TYPE_DCC:
wprintw (ptr_win->win_status, "<DCC> ");
break;
case BUFFER_TYPE_RAW_DATA:
wprintw (ptr_win->win_status, _("<RAW_IRC> "));
break;
}
}
/* display list of other active windows (if any) with numbers */
@@ -2132,46 +2158,57 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
display_name = 0;
break;
}
if (ptr_hotlist->buffer->dcc)
switch (ptr_hotlist->buffer->type)
{
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_weechat_color (ptr_win->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (ptr_win->win_status, ":");
gui_window_set_weechat_color (ptr_win->win_status,
COLOR_WIN_STATUS);
wprintw (ptr_win->win_status, "DCC");
}
else
{
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
if (display_name && (cfg_look_hotlist_names_count != 0)
&& (names_count < cfg_look_hotlist_names_count))
{
names_count++;
case BUFFER_TYPE_STANDARD:
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
if (display_name && (cfg_look_hotlist_names_count != 0)
&& (names_count < cfg_look_hotlist_names_count))
{
names_count++;
gui_window_set_weechat_color (ptr_win->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (ptr_win->win_status, ":");
gui_window_set_weechat_color (ptr_win->win_status,
COLOR_WIN_STATUS);
if (cfg_look_hotlist_names_length == 0)
snprintf (format, sizeof (format) - 1, "%%s");
else
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length);
if (BUFFER_IS_SERVER(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format,
(ptr_hotlist->server) ?
ptr_hotlist->server->name :
SERVER(ptr_hotlist->buffer)->name);
else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
|| BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, CHANNEL(ptr_hotlist->buffer)->name);
}
break;
case BUFFER_TYPE_DCC:
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_weechat_color (ptr_win->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (ptr_win->win_status, ":");
gui_window_set_weechat_color (ptr_win->win_status,
COLOR_WIN_STATUS);
if (cfg_look_hotlist_names_length == 0)
snprintf (format, sizeof (format) - 1, "%%s");
else
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length);
if (BUFFER_IS_SERVER(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format,
(ptr_hotlist->server) ?
ptr_hotlist->server->name :
SERVER(ptr_hotlist->buffer)->name);
else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
|| BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, CHANNEL(ptr_hotlist->buffer)->name);
}
wprintw (ptr_win->win_status, "DCC");
break;
case BUFFER_TYPE_RAW_DATA:
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_weechat_color (ptr_win->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (ptr_win->win_status, ":");
gui_window_set_weechat_color (ptr_win->win_status,
COLOR_WIN_STATUS);
wprintw (ptr_win->win_status, _("RAW_IRC"));
break;
}
if (ptr_hotlist->next_hotlist)
@@ -2370,124 +2407,133 @@ gui_draw_buffer_input (t_gui_buffer *buffer, int erase)
if (erase)
gui_curses_window_clear (ptr_win->win_input, COLOR_WIN_INPUT);
if (buffer->dcc)
switch (buffer->type)
{
dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : dcc_list;
wmove (ptr_win->win_input, 0, 0);
if (dcc_selected)
{
switch (dcc_selected->status)
case BUFFER_TYPE_STANDARD:
if (buffer->has_input)
{
case DCC_WAITING:
if (DCC_IS_RECV(dcc_selected->type))
wprintw (ptr_win->win_input, _(" [A] Accept"));
wprintw (ptr_win->win_input, _(" [C] Cancel"));
break;
case DCC_CONNECTING:
case DCC_ACTIVE:
wprintw (ptr_win->win_input, _(" [C] Cancel"));
break;
case DCC_DONE:
case DCC_FAILED:
case DCC_ABORTED:
wprintw (ptr_win->win_input, _(" [R] Remove"));
break;
}
}
wprintw (ptr_win->win_input, _(" [P] Purge old DCC"));
wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
wclrtoeol (ptr_win->win_input);
ptr_win->win_input_x = 0;
if (ptr_win == gui_current_window)
move (ptr_win->win_y + ptr_win->win_height - 1,
ptr_win->win_x);
}
else if (buffer->has_input)
{
if (buffer->input_buffer_length == 0)
buffer->input_buffer[0] = '\0';
if (SERVER(buffer))
ptr_nickname = (SERVER(buffer)->nick) ?
SERVER(buffer)->nick : SERVER(buffer)->nick1;
else
ptr_nickname = cfg_look_no_nickname;
input_width = gui_get_input_width (ptr_win, ptr_nickname);
if (buffer->input_buffer_pos - buffer->input_buffer_1st_display + 1 >
input_width)
buffer->input_buffer_1st_display = buffer->input_buffer_pos -
input_width + 1;
else
{
if (buffer->input_buffer_pos < buffer->input_buffer_1st_display)
buffer->input_buffer_1st_display = buffer->input_buffer_pos;
else
{
if ((buffer->input_buffer_1st_display > 0) &&
(buffer->input_buffer_pos -
buffer->input_buffer_1st_display + 1) < input_width)
if (buffer->input_buffer_length == 0)
buffer->input_buffer[0] = '\0';
if (SERVER(buffer))
ptr_nickname = (SERVER(buffer)->nick) ?
SERVER(buffer)->nick : SERVER(buffer)->nick1;
else
ptr_nickname = cfg_look_no_nickname;
input_width = gui_get_input_width (ptr_win, ptr_nickname);
if (buffer->input_buffer_pos - buffer->input_buffer_1st_display + 1 >
input_width)
buffer->input_buffer_1st_display = buffer->input_buffer_pos -
input_width + 1;
else
{
buffer->input_buffer_1st_display =
buffer->input_buffer_pos - input_width + 1;
if (buffer->input_buffer_1st_display < 0)
buffer->input_buffer_1st_display = 0;
if (buffer->input_buffer_pos < buffer->input_buffer_1st_display)
buffer->input_buffer_1st_display = buffer->input_buffer_pos;
else
{
if ((buffer->input_buffer_1st_display > 0) &&
(buffer->input_buffer_pos -
buffer->input_buffer_1st_display + 1) < input_width)
{
buffer->input_buffer_1st_display =
buffer->input_buffer_pos - input_width + 1;
if (buffer->input_buffer_1st_display < 0)
buffer->input_buffer_1st_display = 0;
}
}
}
if (CHANNEL(buffer))
{
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_DELIMITERS);
mvwprintw (ptr_win->win_input, 0, 0, "[");
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_CHANNEL);
wprintw (ptr_win->win_input, "%s ", CHANNEL(buffer)->name);
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_NICK);
wprintw (ptr_win->win_input, "%s", ptr_nickname);
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_DELIMITERS);
wprintw (ptr_win->win_input, "] ");
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT);
snprintf (format, 32, "%%-%ds", input_width);
if (ptr_win == gui_current_window)
wprintw (ptr_win->win_input, format,
utf8_add_offset (buffer->input_buffer,
buffer->input_buffer_1st_display));
else
wprintw (ptr_win->win_input, format, "");
wclrtoeol (ptr_win->win_input);
ptr_win->win_input_x = utf8_strlen (CHANNEL(buffer)->name) +
utf8_strlen (SERVER(buffer)->nick) + 4 +
(buffer->input_buffer_pos - buffer->input_buffer_1st_display);
if (ptr_win == gui_current_window)
move (ptr_win->win_y + ptr_win->win_height - 1,
ptr_win->win_x + ptr_win->win_input_x);
}
else
{
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_DELIMITERS);
mvwprintw (ptr_win->win_input, 0, 0, "[");
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_NICK);
wprintw (ptr_win->win_input, "%s", ptr_nickname);
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_DELIMITERS);
wprintw (ptr_win->win_input, "] ");
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT);
snprintf (format, 32, "%%-%ds", input_width);
if (ptr_win == gui_current_window)
wprintw (ptr_win->win_input, format,
utf8_add_offset (buffer->input_buffer,
buffer->input_buffer_1st_display));
else
wprintw (ptr_win->win_input, format, "");
wclrtoeol (ptr_win->win_input);
ptr_win->win_input_x = utf8_strlen (ptr_nickname) + 3 +
(buffer->input_buffer_pos - buffer->input_buffer_1st_display);
if (ptr_win == gui_current_window)
move (ptr_win->win_y + ptr_win->win_height - 1,
ptr_win->win_x + ptr_win->win_input_x);
}
}
}
if (CHANNEL(buffer))
{
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_DELIMITERS);
mvwprintw (ptr_win->win_input, 0, 0, "[");
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_CHANNEL);
wprintw (ptr_win->win_input, "%s ", CHANNEL(buffer)->name);
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_NICK);
wprintw (ptr_win->win_input, "%s", ptr_nickname);
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_DELIMITERS);
wprintw (ptr_win->win_input, "] ");
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT);
snprintf (format, 32, "%%-%ds", input_width);
if (ptr_win == gui_current_window)
wprintw (ptr_win->win_input, format,
utf8_add_offset (buffer->input_buffer,
buffer->input_buffer_1st_display));
else
wprintw (ptr_win->win_input, format,
"");
break;
case BUFFER_TYPE_DCC:
dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : dcc_list;
wmove (ptr_win->win_input, 0, 0);
if (dcc_selected)
{
switch (dcc_selected->status)
{
case DCC_WAITING:
if (DCC_IS_RECV(dcc_selected->type))
wprintw (ptr_win->win_input, _(" [A] Accept"));
wprintw (ptr_win->win_input, _(" [C] Cancel"));
break;
case DCC_CONNECTING:
case DCC_ACTIVE:
wprintw (ptr_win->win_input, _(" [C] Cancel"));
break;
case DCC_DONE:
case DCC_FAILED:
case DCC_ABORTED:
wprintw (ptr_win->win_input, _(" [R] Remove"));
break;
}
}
wprintw (ptr_win->win_input, _(" [P] Purge old DCC"));
wprintw (ptr_win->win_input, _(" [Q] Close DCC view"));
wclrtoeol (ptr_win->win_input);
ptr_win->win_input_x = utf8_strlen (CHANNEL(buffer)->name) +
utf8_strlen (SERVER(buffer)->nick) + 4 +
(buffer->input_buffer_pos - buffer->input_buffer_1st_display);
ptr_win->win_input_x = 0;
if (ptr_win == gui_current_window)
move (ptr_win->win_y + ptr_win->win_height - 1,
ptr_win->win_x + ptr_win->win_input_x);
}
else
{
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_DELIMITERS);
mvwprintw (ptr_win->win_input, 0, 0, "[");
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_NICK);
wprintw (ptr_win->win_input, "%s", ptr_nickname);
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT_DELIMITERS);
wprintw (ptr_win->win_input, "] ");
gui_window_set_weechat_color (ptr_win->win_input, COLOR_WIN_INPUT);
snprintf (format, 32, "%%-%ds", input_width);
if (ptr_win == gui_current_window)
wprintw (ptr_win->win_input, format,
utf8_add_offset (buffer->input_buffer,
buffer->input_buffer_1st_display));
else
wprintw (ptr_win->win_input, format,
"");
ptr_win->win_x);
break;
case BUFFER_TYPE_RAW_DATA:
mvwprintw (ptr_win->win_input, 0, 0, _(" [Q] Close raw data view"));
wclrtoeol (ptr_win->win_input);
ptr_win->win_input_x = utf8_strlen (ptr_nickname) + 3 +
(buffer->input_buffer_pos - buffer->input_buffer_1st_display);
ptr_win->win_input_x = 0;
if (ptr_win == gui_current_window)
move (ptr_win->win_y + ptr_win->win_height - 1,
ptr_win->win_x + ptr_win->win_input_x);
}
ptr_win->win_x);
break;
}
doupdate ();
wrefresh (ptr_win->win_input);
refresh ();
@@ -2632,27 +2678,6 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
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_window *window)
{
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 (window, NULL, NULL, 1, 0);
}
/*
* gui_window_page_up: display previous page on buffer
*/
@@ -2711,6 +2736,103 @@ gui_window_page_down (t_gui_window *window)
}
}
/*
* gui_window_scroll_up: display previous few lines in buffer
*/
void
gui_window_scroll_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (!window->first_line_displayed)
{
gui_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
(window->start_line) ?
(-1) * cfg_look_scroll_amount :
(-1) * ( (window->win_chat_height - 1) + cfg_look_scroll_amount));
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
/*
* gui_window_scroll_down: display next few lines in buffer
*/
void
gui_window_scroll_down (t_gui_window *window)
{
t_gui_line *ptr_line;
int line_pos;
if (!gui_ok)
return;
if (window->start_line)
{
gui_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
cfg_look_scroll_amount);
/* check if we can display all */
ptr_line = window->start_line;
line_pos = window->start_line_pos;
gui_calculate_line_diff (window, &ptr_line,
&line_pos,
window->win_chat_height - 1);
if (!ptr_line)
{
window->start_line = NULL;
window->start_line_pos = 0;
}
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
/*
* gui_window_scroll_top: scroll to top of buffer
*/
void
gui_window_scroll_top (t_gui_window *window)
{
if (!gui_ok)
return;
if (!window->first_line_displayed)
{
window->start_line = window->buffer->lines;
window->start_line_pos = 0;
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
/*
* gui_window_scroll_bottom: scroll to bottom of buffer
*/
void
gui_window_scroll_bottom (t_gui_window *window)
{
if (!gui_ok)
return;
if (window->start_line)
{
window->start_line = NULL;
window->start_line_pos = 0;
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
/*
* gui_window_nick_beginning: go to beginning of nicklist
*/
@@ -3520,7 +3642,7 @@ gui_init ()
if (gui_window_new (NULL, 0, 0, COLS, LINES, 100, 100))
{
gui_current_window = gui_windows;
gui_buffer_new (gui_windows, NULL, NULL, 0, 1);
gui_buffer_new (gui_windows, NULL, NULL, BUFFER_TYPE_STANDARD, 1);
signal (SIGWINCH, gui_refresh_screen_sigwinch);
+28 -10
View File
@@ -46,6 +46,7 @@
#include "../../common/fifo.h"
#include "../../common/utf8.h"
#include "../../irc/irc.h"
#include "../../plugins/plugins.h"
/*
@@ -86,11 +87,15 @@ gui_input_default_key_bindings ()
gui_key_bind ( /* ^down */ "meta-Ob", "down_global");
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
gui_key_bind ( /* m-pgup */ "meta-meta2-5~", "scroll_up");
gui_key_bind ( /* m-pgdn */ "meta-meta2-6~", "scroll_down");
gui_key_bind ( /* m-home */ "meta-meta2-1~", "scroll_top");
gui_key_bind ( /* m-end */ "meta-meta2-4~", "scroll_bottom");
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
gui_key_bind ( /* F11 */ "meta2-23~", "nick_page_up");
gui_key_bind ( /* F12 */ "meta2-24~", "nick_page_down");
gui_key_bind ( /* m-F11 */ "meta-meta2-1~", "nick_beginning");
gui_key_bind ( /* m-F12 */ "meta-meta2-4~", "nick_end");
gui_key_bind ( /* m-F11 */ "meta-meta2-23~", "nick_beginning");
gui_key_bind ( /* m-F12 */ "meta-meta2-24~", "nick_end");
gui_key_bind ( /* ^L */ "ctrl-L", "refresh");
gui_key_bind ( /* m-a */ "meta-a", "jump_smart");
gui_key_bind ( /* m-b */ "meta-b", "previous_word");
@@ -103,6 +108,7 @@ gui_input_default_key_bindings ()
gui_key_bind ( /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer");
gui_key_bind ( /* m-j,m-s */ "meta-jmeta-s", "jump_server");
gui_key_bind ( /* m-j,m-x */ "meta-jmeta-x", "jump_next_server");
gui_key_bind ( /* m-j,m-r */ "meta-jmeta-r", "jump_raw_data");
gui_key_bind ( /* m-k */ "meta-k", "grab_key");
gui_key_bind ( /* m-n */ "meta-n", "scroll_next_highlight");
gui_key_bind ( /* m-p */ "meta-p", "scroll_previous_highlight");
@@ -203,6 +209,8 @@ gui_input_read ()
gui_refresh_screen ();
continue;
}
gui_last_activity_time = time (NULL);
if (key < 32)
{
@@ -272,14 +280,20 @@ gui_input_read ()
if (strcmp (key_str, "^^") == 0)
key_str[1] = '\0';
if (gui_current_window->buffer->dcc)
gui_exec_action_dcc (gui_current_window, key_str);
else
switch (gui_current_window->buffer->type)
{
gui_insert_string_input (gui_current_window, key_str, -1);
gui_current_window->buffer->input_buffer_pos += utf8_strlen (key_str);
gui_draw_buffer_input (gui_current_window->buffer, 0);
gui_current_window->buffer->completion.position = -1;
case BUFFER_TYPE_STANDARD:
gui_insert_string_input (gui_current_window, key_str, -1);
gui_current_window->buffer->input_buffer_pos += utf8_strlen (key_str);
gui_draw_buffer_input (gui_current_window->buffer, 0);
gui_current_window->buffer->completion.position = -1;
break;
case BUFFER_TYPE_DCC:
gui_exec_action_dcc (gui_current_window, key_str);
break;
case BUFFER_TYPE_RAW_DATA:
gui_exec_action_raw_data (gui_current_window, key_str);
break;
}
}
@@ -307,6 +321,7 @@ gui_main_loop ()
quit_weechat = 0;
new_time = time (NULL);
gui_last_activity_time = new_time;
local_time = localtime (&new_time);
old_day = local_time->tm_mday;
@@ -333,7 +348,7 @@ gui_main_loop ()
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
if (!ptr_buffer->dcc)
if (ptr_buffer->type == BUFFER_TYPE_STANDARD)
gui_printf_nolog_notime (ptr_buffer,
_("Day changed to %s\n"),
text_time);
@@ -377,6 +392,9 @@ gui_main_loop ()
server_check_away ();
}
}
/* call timer handlers */
plugin_timer_handler_exec ();
}
FD_ZERO (&read_fd);
+16 -3
View File
@@ -19,11 +19,24 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GTK_CFLAGS)
bin_PROGRAMS = weechat-gtk
weechat_gtk_LDADD = ../lib_weechat_gui_common.a \
if PLUGINS
weechat_gtk_LDADD = ../gui-common.o ../gui-keyboard.o \
../gui-action.o \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
../../plugins/lib_weechat_plugins.a \
$(PLUGINS_LIBS) \
$(GTK_LIBS) \
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
$(GNUTLS_LFLAGS)
else
weechat_gtk_LDADD = ../gui-common.o ../gui-keyboard.o \
../gui-action.o \
../../common/lib_weechat_main.a \
../../irc/lib_weechat_irc.a \
$(PLUGINS_LIBS) \
$(GTK_LIBS) \
$(GNUTLS_LFLAGS)
endif
weechat_gtk_SOURCES = gui-display.c \
gui-input.c
gui-input.c
+1998 -464
View File
File diff suppressed because it is too large Load Diff
+133 -5
View File
@@ -37,26 +37,154 @@
#include "../gui.h"
#include "../../common/weeconfig.h"
#include "../../common/command.h"
#include "../../common/hotlist.h"
#include "../../common/fifo.h"
#include "../../common/utf8.h"
#include "../../irc/irc.h"
/*
* gui_read_keyb: read keyboard line
* gui_input_default_key_bindings: create default key bindings
*/
void
gui_read_keyb ()
gui_input_default_key_bindings ()
{
/* TODO: read keyboard for Gtk GUI */
int i;
char key_str[32], command[32];
/* keys binded with internal functions */
gui_key_bind ( /* RC */ "ctrl-M", "return");
gui_key_bind ( /* RC */ "ctrl-J", "return");
gui_key_bind ( /* tab */ "ctrl-I", "tab");
gui_key_bind ( /* basckp */ "ctrl-H", "backspace");
gui_key_bind ( /* basckp */ "ctrl-?", "backspace");
gui_key_bind ( /* del */ "meta2-3~", "delete");
gui_key_bind ( /* ^K */ "ctrl-K", "delete_end_line");
gui_key_bind ( /* ^U */ "ctrl-U", "delete_beginning_line");
gui_key_bind ( /* ^W */ "ctrl-W", "delete_previous_word");
gui_key_bind ( /* ^Y */ "ctrl-Y", "clipboard_paste");
gui_key_bind ( /* ^T */ "ctrl-T", "transpose_chars");
gui_key_bind ( /* home */ "meta2-1~", "home");
gui_key_bind ( /* home */ "meta2-H", "home");
gui_key_bind ( /* home */ "meta2-7~", "home");
gui_key_bind ( /* ^A */ "ctrl-A", "home");
gui_key_bind ( /* end */ "meta2-4~", "end");
gui_key_bind ( /* end */ "meta2-F", "end");
gui_key_bind ( /* end */ "meta2-8~", "end");
gui_key_bind ( /* ^E */ "ctrl-E", "end");
gui_key_bind ( /* left */ "meta2-D", "left");
gui_key_bind ( /* right */ "meta2-C", "right");
gui_key_bind ( /* up */ "meta2-A", "up");
gui_key_bind ( /* ^up */ "meta-Oa", "up_global");
gui_key_bind ( /* down */ "meta2-B", "down");
gui_key_bind ( /* ^down */ "meta-Ob", "down_global");
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
gui_key_bind ( /* m-pgup */ "meta-meta2-5~", "scroll_up");
gui_key_bind ( /* m-pgdn */ "meta-meta2-6~", "scroll_down");
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
gui_key_bind ( /* F11 */ "meta2-23~", "nick_page_up");
gui_key_bind ( /* F12 */ "meta2-24~", "nick_page_down");
gui_key_bind ( /* m-F11 */ "meta-meta2-1~", "nick_beginning");
gui_key_bind ( /* m-F12 */ "meta-meta2-4~", "nick_end");
gui_key_bind ( /* ^L */ "ctrl-L", "refresh");
gui_key_bind ( /* m-a */ "meta-a", "jump_smart");
gui_key_bind ( /* m-b */ "meta-b", "previous_word");
gui_key_bind ( /* ^left */ "meta-Od", "previous_word");
gui_key_bind ( /* m-d */ "meta-d", "delete_next_word");
gui_key_bind ( /* m-f */ "meta-f", "next_word");
gui_key_bind ( /* ^right */ "meta-Oc", "next_word");
gui_key_bind ( /* m-h */ "meta-h", "hotlist_clear");
gui_key_bind ( /* m-j,m-d */ "meta-jmeta-d", "jump_dcc");
gui_key_bind ( /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer");
gui_key_bind ( /* m-j,m-s */ "meta-jmeta-s", "jump_server");
gui_key_bind ( /* m-j,m-x */ "meta-jmeta-x", "jump_next_server");
gui_key_bind ( /* m-k */ "meta-k", "grab_key");
gui_key_bind ( /* m-n */ "meta-n", "scroll_next_highlight");
gui_key_bind ( /* m-p */ "meta-p", "scroll_previous_highlight");
gui_key_bind ( /* m-r */ "meta-r", "delete_line");
gui_key_bind ( /* m-s */ "meta-s", "switch_server");
gui_key_bind ( /* m-u */ "meta-u", "scroll_unread");
/* keys binded with commands */
gui_key_bind ( /* m-left */ "meta-meta2-D", "/buffer -1");
gui_key_bind ( /* F5 */ "meta2-15~", "/buffer -1");
gui_key_bind ( /* m-right */ "meta-meta2-C", "/buffer +1");
gui_key_bind ( /* F6 */ "meta2-17~", "/buffer +1");
gui_key_bind ( /* F7 */ "meta2-18~", "/window -1");
gui_key_bind ( /* F8 */ "meta2-19~", "/window +1");
gui_key_bind ( /* m-w,m-up */ "meta-wmeta-meta2-A", "/window up");
gui_key_bind ( /* m-w,m-down */ "meta-wmeta-meta2-B", "/window down");
gui_key_bind ( /* m-w,m-left */ "meta-wmeta-meta2-D", "/window left");
gui_key_bind ( /* m-w,m-right */ "meta-wmeta-meta2-C", "/window right");
gui_key_bind ( /* m-0 */ "meta-0", "/buffer 10");
gui_key_bind ( /* m-1 */ "meta-1", "/buffer 1");
gui_key_bind ( /* m-2 */ "meta-2", "/buffer 2");
gui_key_bind ( /* m-3 */ "meta-3", "/buffer 3");
gui_key_bind ( /* m-4 */ "meta-4", "/buffer 4");
gui_key_bind ( /* m-5 */ "meta-5", "/buffer 5");
gui_key_bind ( /* m-6 */ "meta-6", "/buffer 6");
gui_key_bind ( /* m-7 */ "meta-7", "/buffer 7");
gui_key_bind ( /* m-8 */ "meta-8", "/buffer 8");
gui_key_bind ( /* m-9 */ "meta-9", "/buffer 9");
/* bind meta-j + {01..99} to switch to buffers # > 10 */
for (i = 1; i < 100; i++)
{
sprintf (key_str, "meta-j%02d", i);
sprintf (command, "/buffer %d", i);
gui_key_bind (key_str, command);
}
}
/*
* gui_main_loop: main loop for WeeChat with Gtk GUI
* gui_input_grab_end: insert grabbed key in input buffer
*/
void
gui_input_grab_end ()
{
char *expanded_key;
/* get expanded name (for example: ^U => ctrl-u) */
expanded_key = gui_key_get_expanded_name (gui_key_buffer);
if (expanded_key)
{
if (gui_current_window->buffer->has_input)
{
gui_insert_string_input (gui_current_window, expanded_key, -1);
gui_current_window->buffer->input_buffer_pos += utf8_strlen (expanded_key);
gui_draw_buffer_input (gui_current_window->buffer, 1);
}
free (expanded_key);
}
/* end grab mode */
gui_key_grab = 0;
gui_key_grab_count = 0;
gui_key_buffer[0] = '\0';
}
/*
* gui_input_read: read keyboard chars
*/
void
gui_input_read ()
{
/* TODO: write this function for Gtk */
}
/*
* gui_main_loop: main loop for WeeChat with ncurses GUI
*/
void
gui_main_loop ()
{
/* TODO: main loop function for Gtk GUI */
/* TODO: write this function for Gtk */
gtk_main ();
}
+74 -10
View File
@@ -108,7 +108,8 @@ gui_action_return (t_gui_window *window)
window->buffer->completion.position = -1;
window->buffer->ptr_history = NULL;
gui_draw_buffer_input (window->buffer, 0);
user_command (window->buffer, SERVER(window->buffer), command);
user_command (SERVER(window->buffer), CHANNEL(window->buffer),
command);
free (command);
}
}
@@ -653,7 +654,7 @@ gui_action_next_word (t_gui_window *window)
void
gui_action_up (t_gui_window *window)
{
if (window->buffer->dcc)
if (window->buffer->type == BUFFER_TYPE_DCC)
{
if (dcc_list)
{
@@ -762,7 +763,7 @@ gui_action_up_global (t_gui_window *window)
void
gui_action_down (t_gui_window *window)
{
if (window->buffer->dcc)
if (window->buffer->type == BUFFER_TYPE_DCC)
{
if (dcc_list)
{
@@ -877,6 +878,46 @@ gui_action_page_down (t_gui_window *window)
gui_window_page_down (window);
}
/*
* gui_action_scroll_up: display previous few lines in buffer
*/
void
gui_action_scroll_up (t_gui_window *window)
{
gui_window_scroll_up (window);
}
/*
* gui_action_scroll_down: display next few lines in buffer
*/
void
gui_action_scroll_down (t_gui_window *window)
{
gui_window_scroll_down (window);
}
/*
* gui_action_scroll_top: scroll to top of buffer
*/
void
gui_action_scroll_top (t_gui_window *window)
{
gui_window_scroll_top (window);
}
/*
* gui_action_scroll_bottom: scroll to bottom of buffer
*/
void
gui_action_scroll_bottom (t_gui_window *window)
{
gui_window_scroll_bottom (window);
}
/*
* gui_action_nick_beginning: go to beginning of nicklist
*/
@@ -949,22 +990,45 @@ gui_action_jump_smart (t_gui_window *window)
void
gui_action_jump_dcc (t_gui_window *window)
{
if (window->buffer->dcc)
if (window->buffer->type == BUFFER_TYPE_DCC)
{
if (buffer_before_dcc)
if (gui_buffer_before_dcc)
{
gui_switch_to_buffer (window,
buffer_before_dcc);
gui_buffer_before_dcc);
gui_redraw_buffer (window->buffer);
}
}
else
{
buffer_before_dcc = window->buffer;
gui_buffer_before_dcc = window->buffer;
gui_buffer_switch_dcc (window);
}
}
/*
* gui_action_jump_raw_data: jump to raw IRC data buffer
*/
void
gui_action_jump_raw_data (t_gui_window *window)
{
if (window->buffer->type == BUFFER_TYPE_RAW_DATA)
{
if (gui_buffer_before_raw_data)
{
gui_switch_to_buffer (window,
gui_buffer_before_raw_data);
gui_redraw_buffer (window->buffer);
}
}
else
{
gui_buffer_before_raw_data = window->buffer;
gui_buffer_switch_raw_data (window);
}
}
/*
* gui_action_jump_last_buffer: jump to last buffer
*/
@@ -1057,7 +1121,7 @@ gui_action_scroll_previous_highlight (t_gui_window *window)
{
t_gui_line *ptr_line;
if (!window->buffer->dcc)
if (window->buffer->type == BUFFER_TYPE_STANDARD)
{
if (window->buffer->lines)
{
@@ -1090,7 +1154,7 @@ gui_action_scroll_next_highlight (t_gui_window *window)
{
t_gui_line *ptr_line;
if (!window->buffer->dcc)
if (window->buffer->type == BUFFER_TYPE_STANDARD)
{
if (window->buffer->lines)
{
@@ -1123,7 +1187,7 @@ gui_action_scroll_unread (t_gui_window *window)
{
if (cfg_look_read_marker &&
cfg_look_read_marker[0] &&
!window->buffer->dcc &&
(window->buffer->type == BUFFER_TYPE_STANDARD) &&
window->buffer->last_read_line &&
window->buffer->last_read_line != window->buffer->last_line)
{
+402 -215
View File
@@ -58,11 +58,16 @@ t_gui_window_tree *gui_windows_tree = NULL; /* pointer to windows tree */
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_buffer *gui_buffer_before_dcc = NULL; /* buffer before dcc switch */
t_gui_buffer *gui_buffer_raw_data = NULL; /* buffer with raw IRC data */
t_gui_buffer *gui_buffer_before_raw_data = NULL; /* buffer before raw switch*/
t_gui_infobar *gui_infobar; /* pointer to infobar content */
char *gui_input_clipboard = NULL; /* clipboard content */
time_t gui_last_activity_time = 0; /* last activity time */
/* (key pressed) */
/*
* gui_window_tree_init: create first entry in windows tree
@@ -136,10 +141,10 @@ gui_window_new (t_gui_window *parent, int x, int y, int width, int height,
t_gui_window *new_window;
t_gui_window_tree *ptr_tree, *child1, *child2, *ptr_leaf;
#ifdef DEBUG
#ifdef DEBUG
weechat_log_printf ("Creating new window (x:%d, y:%d, width:%d, height:%d)\n",
x, y, width, height);
#endif
#endif
if (parent)
{
@@ -264,6 +269,181 @@ gui_window_new (t_gui_window *parent, int x, int y, int width, int height,
return new_window;
}
/*
* gui_buffer_servers_search: search servers buffer
* (when same buffer is used for all servers)
*/
t_gui_buffer *
gui_buffer_servers_search ()
{
t_gui_buffer *ptr_buffer;
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
if (ptr_buffer->all_servers)
return ptr_buffer;
}
/* buffer not found */
return NULL;
}
/*
* gui_buffer_new: create a new buffer in current window
*/
t_gui_buffer *
gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
int switch_to_buffer)
{
t_gui_buffer *new_buffer, *ptr_buffer;
#ifdef DEBUG
weechat_log_printf ("Creating new buffer\n");
#endif
/* use first buffer if no server was assigned to this buffer */
if ((type == BUFFER_TYPE_STANDARD) && gui_buffers && (!SERVER(gui_buffers)))
{
if (server)
((t_irc_server *)(server))->buffer = gui_buffers;
if (channel)
((t_irc_channel *)(channel))->buffer = gui_buffers;
gui_buffers->server = server;
gui_buffers->channel = channel;
if (cfg_look_one_server_buffer && server && !channel)
gui_buffers->all_servers = 1;
if (cfg_log_auto_server)
log_start (gui_buffers);
return gui_buffers;
}
if (cfg_look_one_server_buffer && (type == BUFFER_TYPE_STANDARD) &&
gui_buffers && server && !channel)
{
ptr_buffer = gui_buffer_servers_search ();
if (ptr_buffer)
{
((t_irc_server *)(server))->buffer = gui_buffers;
gui_buffers->server = server;
if (switch_to_buffer)
gui_switch_to_buffer (window, gui_buffers);
gui_redraw_buffer (gui_buffers);
return gui_buffers;
}
}
if ((new_buffer = (t_gui_buffer *)(malloc (sizeof (t_gui_buffer)))))
{
new_buffer->num_displayed = 0;
new_buffer->number = (last_gui_buffer) ? last_gui_buffer->number + 1 : 1;
/* assign server and channel to buffer */
new_buffer->server = server;
new_buffer->all_servers = 0;
new_buffer->channel = channel;
new_buffer->type = type;
if (new_buffer->type == BUFFER_TYPE_RAW_DATA)
gui_buffer_raw_data = new_buffer;
/* assign buffer to server and channel */
if (server && !channel)
{
SERVER(new_buffer)->buffer = new_buffer;
new_buffer->all_servers = (cfg_look_one_server_buffer) ? 1 : 0;
}
if (!gui_buffers && cfg_look_one_server_buffer)
new_buffer->all_servers = 1;
if (channel)
CHANNEL(new_buffer)->buffer = new_buffer;
if (!window->buffer)
{
window->buffer = new_buffer;
window->first_line_displayed = 1;
window->start_line = NULL;
window->start_line_pos = 0;
gui_calculate_pos_size (window);
gui_window_init_subwindows (window);
}
/* init lines */
new_buffer->lines = NULL;
new_buffer->last_line = NULL;
new_buffer->last_read_line = NULL;
new_buffer->num_lines = 0;
new_buffer->line_complete = 1;
/* notify level */
new_buffer->notify_level = channel_get_notify_level (server, channel);
/* 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->has_input = (new_buffer->type == BUFFER_TYPE_STANDARD) ? 1 : 0;
if (new_buffer->has_input)
{
new_buffer->input_buffer_alloc = INPUT_BUFFER_BLOCK_SIZE;
new_buffer->input_buffer = (char *) malloc (INPUT_BUFFER_BLOCK_SIZE);
new_buffer->input_buffer[0] = '\0';
}
else
new_buffer->input_buffer = NULL;
new_buffer->input_buffer_size = 0;
new_buffer->input_buffer_length = 0;
new_buffer->input_buffer_pos = 0;
new_buffer->input_buffer_1st_display = 0;
/* init completion */
completion_init (&(new_buffer->completion), server, channel);
/* init history */
new_buffer->history = NULL;
new_buffer->last_history = NULL;
new_buffer->ptr_history = NULL;
new_buffer->num_history = 0;
/* add buffer to buffers queue */
new_buffer->prev_buffer = last_gui_buffer;
if (gui_buffers)
last_gui_buffer->next_buffer = new_buffer;
else
gui_buffers = new_buffer;
last_gui_buffer = new_buffer;
new_buffer->next_buffer = NULL;
/* move buffer next to server */
if (server && cfg_look_open_near_server && (!cfg_look_one_server_buffer))
{
ptr_buffer = SERVER(new_buffer)->buffer;
while (ptr_buffer && (ptr_buffer->server == server))
{
ptr_buffer = ptr_buffer->next_buffer;
}
if (ptr_buffer)
gui_buffer_move_to_number (new_buffer, ptr_buffer->number);
}
/* switch to new buffer */
if (switch_to_buffer)
gui_switch_to_buffer (window, new_buffer);
/* redraw buffer */
gui_redraw_buffer (new_buffer);
}
else
return NULL;
return new_buffer;
}
/*
* gui_buffer_search: search a buffer by server and channel name
*/
@@ -318,7 +498,8 @@ gui_buffer_search (char *server, char *channel)
if (!ptr_buffer)
return NULL;
return (ptr_buffer->dcc) ? gui_buffers : ptr_buffer;
return (ptr_buffer->type != BUFFER_TYPE_STANDARD) ?
gui_buffers : ptr_buffer;
}
/*
@@ -345,163 +526,24 @@ gui_buffer_find_window (t_gui_buffer *buffer)
}
/*
* gui_buffer_servers_search: search servers buffer
* (when same buffer is used for all servers)
* gui_get_dcc_buffer: get pointer to DCC buffer (DCC buffer created if not existing)
*/
t_gui_buffer *
gui_buffer_servers_search ()
gui_get_dcc_buffer (t_gui_window *window)
{
t_gui_buffer *ptr_buffer;
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
/* check if dcc buffer exists */
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (ptr_buffer->all_servers)
return ptr_buffer;
}
/* buffer not found */
return NULL;
}
/*
* gui_buffer_new: create a new buffer in current window
*/
t_gui_buffer *
gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
int switch_to_buffer)
{
t_gui_buffer *new_buffer, *ptr_buffer;
#ifdef DEBUG
weechat_log_printf ("Creating new buffer\n");
#endif
/* use first buffer if no server was assigned to this buffer */
if (!dcc && gui_buffers && (!SERVER(gui_buffers)))
{
if (server)
((t_irc_server *)(server))->buffer = gui_buffers;
if (channel)
((t_irc_channel *)(channel))->buffer = gui_buffers;
gui_buffers->server = server;
gui_buffers->channel = channel;
if (cfg_look_one_server_buffer && server && !channel)
gui_buffers->all_servers = 1;
if (cfg_log_auto_server)
log_start (gui_buffers);
return gui_buffers;
}
if (cfg_look_one_server_buffer && !dcc && gui_buffers && server && !channel)
{
ptr_buffer = gui_buffer_servers_search ();
if (ptr_buffer)
{
((t_irc_server *)(server))->buffer = gui_buffers;
gui_buffers->server = server;
if (switch_to_buffer)
gui_switch_to_buffer (window, gui_buffers);
gui_redraw_buffer (gui_buffers);
return gui_buffers;
}
}
if ((new_buffer = (t_gui_buffer *)(malloc (sizeof (t_gui_buffer)))))
{
new_buffer->num_displayed = 0;
new_buffer->number = (last_gui_buffer) ? last_gui_buffer->number + 1 : 1;
/* assign server and channel to buffer */
new_buffer->server = server;
new_buffer->all_servers = 0;
new_buffer->channel = channel;
new_buffer->dcc = dcc;
/* assign buffer to server and channel */
if (server && !channel)
{
SERVER(new_buffer)->buffer = new_buffer;
new_buffer->all_servers = (cfg_look_one_server_buffer) ? 1 : 0;
}
if (!gui_buffers && cfg_look_one_server_buffer)
new_buffer->all_servers = 1;
if (channel)
CHANNEL(new_buffer)->buffer = new_buffer;
if (!window->buffer)
{
window->buffer = new_buffer;
window->first_line_displayed = 1;
window->start_line = NULL;
window->start_line_pos = 0;
gui_calculate_pos_size (window);
gui_window_init_subwindows (window);
}
/* init lines */
new_buffer->lines = NULL;
new_buffer->last_line = NULL;
new_buffer->last_read_line = NULL;
new_buffer->num_lines = 0;
new_buffer->line_complete = 1;
/* notify level */
new_buffer->notify_level = channel_get_notify_level (server, channel);
/* 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->has_input = (new_buffer->dcc) ? 0 : 1;
if (new_buffer->has_input)
{
new_buffer->input_buffer_alloc = INPUT_BUFFER_BLOCK_SIZE;
new_buffer->input_buffer = (char *) malloc (INPUT_BUFFER_BLOCK_SIZE);
new_buffer->input_buffer[0] = '\0';
}
else
new_buffer->input_buffer = NULL;
new_buffer->input_buffer_size = 0;
new_buffer->input_buffer_length = 0;
new_buffer->input_buffer_pos = 0;
new_buffer->input_buffer_1st_display = 0;
/* init completion */
completion_init (&(new_buffer->completion), server, channel);
/* init history */
new_buffer->history = NULL;
new_buffer->last_history = NULL;
new_buffer->ptr_history = NULL;
new_buffer->num_history = 0;
/* add buffer to buffers queue */
new_buffer->prev_buffer = last_gui_buffer;
if (gui_buffers)
last_gui_buffer->next_buffer = new_buffer;
else
gui_buffers = new_buffer;
last_gui_buffer = new_buffer;
new_buffer->next_buffer = NULL;
/* switch to new buffer */
if (switch_to_buffer)
gui_switch_to_buffer (window, new_buffer);
/* redraw buffer */
gui_redraw_buffer (new_buffer);
if (ptr_buffer->type == BUFFER_TYPE_DCC)
break;
}
if (ptr_buffer)
return ptr_buffer;
else
return NULL;
return new_buffer;
return gui_buffer_new (window, NULL, NULL, BUFFER_TYPE_DCC, 0);
}
/*
@@ -591,8 +633,10 @@ gui_line_free (t_gui_line *line)
{
if (ptr_win->start_line == line)
{
ptr_win->start_line = NULL;
ptr_win->start_line = ptr_win->start_line->next_line;
ptr_win->start_line_pos = 0;
gui_draw_buffer_chat (ptr_win->buffer, 0);
gui_draw_buffer_status (ptr_win->buffer, 0);
}
}
if (line->data)
@@ -619,8 +663,14 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
if (hotlist_initial_buffer == buffer)
hotlist_initial_buffer = NULL;
if (buffer_before_dcc == buffer)
buffer_before_dcc = NULL;
if (gui_buffer_before_dcc == buffer)
gui_buffer_before_dcc = NULL;
if (gui_buffer_before_raw_data == buffer)
gui_buffer_before_raw_data = NULL;
if (buffer->type == BUFFER_TYPE_RAW_DATA)
gui_buffer_raw_data = NULL;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
@@ -684,7 +734,8 @@ 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, 0, 1);
(void) gui_buffer_new (gui_windows, NULL, NULL,
BUFFER_TYPE_STANDARD, 1);
}
/*
@@ -836,7 +887,10 @@ gui_add_to_line (t_gui_buffer *buffer, int type, char *message)
{
pos[0] = '\n';
if (buffer->num_displayed > 0)
{
gui_draw_buffer_chat_line (buffer, buffer->last_line);
gui_draw_buffer_chat (buffer, 0);
}
if (gui_add_hotlist && (buffer->num_displayed == 0))
{
if (3 - buffer->last_line->line_with_message -
@@ -896,7 +950,7 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type, char *mes
else
buffer = gui_current_window->buffer;
if (!buffer || buffer->dcc)
if (!buffer || (buffer->type != BUFFER_TYPE_STANDARD))
buffer = gui_buffers;
}
@@ -907,10 +961,10 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type, char *mes
return;
}
if (buffer->dcc)
if (buffer->type == BUFFER_TYPE_DCC)
buffer = gui_buffers;
if (buffer->dcc)
if (buffer->type == BUFFER_TYPE_DCC)
return;
}
@@ -1015,6 +1069,43 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type, char *mes
free (buf2);
}
/*
* gui_printf_raw_data: display raw IRC data (only if raw IRC data buffer exists)
*/
void
gui_printf_raw_data (void *server, int send, char *message)
{
char *pos;
if (gui_buffer_raw_data)
{
while (message && message[0])
{
pos = strstr (message, "\r\n");
if (pos)
pos[0] = '\0';
gui_printf_nolog (gui_buffer_raw_data,
"%s[%s%s%s] %s%s%s %s\n",
GUI_COLOR(COLOR_WIN_CHAT_DARK),
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
((t_irc_server *)server)->name,
GUI_COLOR(COLOR_WIN_CHAT_DARK),
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
(send) ? "<<--" : "-->>",
GUI_COLOR(COLOR_WIN_CHAT),
message);
if (pos)
{
pos[0] = '\r';
message = pos + 2;
}
else
message = NULL;
}
}
}
/*
* gui_infobar_printf: display message in infobar
*/
@@ -1022,40 +1113,59 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type, char *mes
void
gui_infobar_printf (int time_displayed, int color, char *message, ...)
{
static char buffer[1024];
static char buf[1024];
va_list argptr;
t_gui_infobar *ptr_infobar;
char *pos, *buf2, *buf3;
char *pos;
va_start (argptr, message);
vsnprintf (buffer, sizeof (buffer) - 1, message, argptr);
vsnprintf (buf, sizeof (buf) - 1, message, argptr);
va_end (argptr);
buf2 = (char *)gui_color_decode ((unsigned char *)buffer, 0);
ptr_infobar = (t_gui_infobar *)malloc (sizeof (t_gui_infobar));
if (ptr_infobar)
{
ptr_infobar->color = color;
ptr_infobar->text = strdup (buf);
pos = strchr (ptr_infobar->text, '\n');
if (pos)
pos[0] = '\0';
ptr_infobar->remaining_time = (time_displayed <= 0) ? -1 : time_displayed;
ptr_infobar->next_infobar = gui_infobar;
gui_infobar = ptr_infobar;
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
else
weechat_log_printf (_("Not enough memory for infobar message\n"));
}
/*
* gui_infobar_printf_from_buffer: remove color, convert charset, then
* display message in infobar
*/
void
gui_infobar_printf_from_buffer (t_gui_buffer *buffer, int time_displayed,
int color, char *message1, char *message, ...)
{
static char buf[1024];
va_list argptr;
char *buf2, *buf3;
va_start (argptr, message);
vsnprintf (buf, sizeof (buf) - 1, message, argptr);
va_end (argptr);
buf2 = (char *)gui_color_decode ((unsigned char *)buf, 0);
if (buf2)
buf3 = channel_iconv_decode (NULL, NULL, buf2);
buf3 = channel_iconv_decode (SERVER(buffer), CHANNEL(buffer), buf2);
else
buf3 = NULL;
if (buf3)
{
ptr_infobar = (t_gui_infobar *)malloc (sizeof (t_gui_infobar));
if (ptr_infobar)
{
ptr_infobar->color = color;
ptr_infobar->text = strdup (buf3);
pos = strchr (ptr_infobar->text, '\n');
if (pos)
pos[0] = '\0';
ptr_infobar->remaining_time = (time_displayed <= 0) ? -1 : time_displayed;
ptr_infobar->next_infobar = gui_infobar;
gui_infobar = ptr_infobar;
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
else
weechat_log_printf (_("Not enough memory for infobar message\n"));
}
gui_infobar_printf (time_displayed, color,
"%s%s", message1,
(buf3) ? buf3 : ((buf2) ? buf2 : buf));
if (buf2)
free (buf2);
@@ -1082,6 +1192,19 @@ gui_infobar_remove ()
}
}
/*
* gui_infobar_remove_all: remove last displayed message in infobar
*/
void
gui_infobar_remove_all ()
{
while (gui_infobar)
{
gui_infobar_remove ();
}
}
/*
* gui_optimize_input_buffer_size: optimize input buffer size by adding
* or deleting data block (predefined size)
@@ -1106,7 +1229,8 @@ gui_optimize_input_buffer_size (t_gui_buffer *buffer)
/*
* gui_exec_action_dcc: execute an action on a DCC after a user input
* return -1 if DCC buffer was closed due to action, 0 otherwise
* return -1 if DCC buffer was closed due to action,
* 0 otherwise
*/
void
@@ -1144,7 +1268,7 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
gui_redraw_buffer (window->buffer);
}
break;
/* purge old DCC */
/* purge old DCC */
case 'p':
case 'P':
window->dcc_selected = NULL;
@@ -1158,13 +1282,13 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
}
gui_redraw_buffer (window->buffer);
break;
/* close DCC window */
/* close DCC window */
case 'q':
case 'Q':
if (buffer_before_dcc)
if (gui_buffer_before_dcc)
{
ptr_buffer = window->buffer;
gui_switch_to_buffer (window, buffer_before_dcc);
gui_switch_to_buffer (window, gui_buffer_before_dcc);
gui_buffer_free (ptr_buffer, 0);
}
else
@@ -1172,7 +1296,7 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
gui_redraw_buffer (window->buffer);
return;
break;
/* remove from DCC list */
/* remove from DCC list */
case 'r':
case 'R':
if (dcc_selected
@@ -1192,6 +1316,44 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
}
}
/*
* gui_exec_action_raw_data: execute an action on raw IRC data
* return -1 if raw IRC data was closed due to action,
* 0 otherwise
*/
void
gui_exec_action_raw_data (t_gui_window *window, char *actions)
{
t_gui_buffer *ptr_buffer;
while (actions[0])
{
if (actions[0] >= 32)
{
switch (actions[0])
{
/* close raw IRC data */
case 'q':
case 'Q':
if (gui_buffer_before_raw_data)
{
ptr_buffer = window->buffer;
gui_switch_to_buffer (window,
gui_buffer_before_raw_data);
gui_buffer_free (ptr_buffer, 0);
}
else
gui_buffer_free (window->buffer, 1);
gui_redraw_buffer (window->buffer);
return;
break;
}
}
actions = utf8_next_char (actions);
}
}
/*
* gui_insert_string_input: insert a string into the input buffer
* if pos == -1, string is inserted at cursor position
@@ -1317,7 +1479,8 @@ gui_split_server (t_gui_window *window)
&& (ptr_server->buffer == ptr_buffer))
{
ptr_server->buffer = NULL;
gui_buffer_new (window, ptr_server, NULL, 0, 0);
gui_buffer_new (window, ptr_server, NULL,
BUFFER_TYPE_STANDARD, 0);
}
}
}
@@ -1489,7 +1652,7 @@ gui_buffer_switch_dcc (t_gui_window *window)
/* check if dcc buffer exists */
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (ptr_buffer->dcc)
if (ptr_buffer->type == BUFFER_TYPE_DCC)
break;
}
if (ptr_buffer)
@@ -1498,7 +1661,31 @@ gui_buffer_switch_dcc (t_gui_window *window)
gui_redraw_buffer (ptr_buffer);
}
else
gui_buffer_new (window, NULL, NULL, 1, 1);
gui_buffer_new (window, NULL, NULL, BUFFER_TYPE_DCC, 1);
}
/*
* gui_buffer_switch_raw_data: switch to rax IRC data buffer (create it if it does not exist)
*/
void
gui_buffer_switch_raw_data (t_gui_window *window)
{
t_gui_buffer *ptr_buffer;
/* check if raw IRC data buffer exists */
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
if (ptr_buffer->type == BUFFER_TYPE_RAW_DATA)
break;
}
if (ptr_buffer)
{
gui_switch_to_buffer (window, ptr_buffer);
gui_redraw_buffer (ptr_buffer);
}
else
gui_buffer_new (window, NULL, NULL, BUFFER_TYPE_RAW_DATA, 1);
}
/*
@@ -1538,7 +1725,7 @@ gui_buffer_switch_by_number (t_gui_window *window, int number)
*/
void
gui_buffer_move_to_number (t_gui_window *window, int number)
gui_buffer_move_to_number (t_gui_buffer *buffer, int number)
{
t_gui_buffer *ptr_buffer;
int i;
@@ -1548,34 +1735,34 @@ gui_buffer_move_to_number (t_gui_window *window, int number)
return;
/* buffer number is already ok ? */
if (number == window->buffer->number)
if (number == buffer->number)
return;
if (number < 1)
number = 1;
/* remove buffer from list */
if (window->buffer == gui_buffers)
if (buffer == gui_buffers)
{
gui_buffers = window->buffer->next_buffer;
gui_buffers = buffer->next_buffer;
gui_buffers->prev_buffer = NULL;
}
if (window->buffer == last_gui_buffer)
if (buffer == last_gui_buffer)
{
last_gui_buffer = window->buffer->prev_buffer;
last_gui_buffer = 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 (buffer->prev_buffer)
(buffer->prev_buffer)->next_buffer = buffer->next_buffer;
if (buffer->next_buffer)
(buffer->next_buffer)->prev_buffer = 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;
gui_buffers->prev_buffer = buffer;
buffer->prev_buffer = NULL;
buffer->next_buffer = gui_buffers;
gui_buffers = buffer;
}
else
{
@@ -1595,19 +1782,19 @@ gui_buffer_move_to_number (t_gui_window *window, int number)
if (ptr_buffer)
{
/* insert before buffer found */
window->buffer->prev_buffer = ptr_buffer->prev_buffer;
window->buffer->next_buffer = ptr_buffer;
buffer->prev_buffer = ptr_buffer->prev_buffer;
buffer->next_buffer = ptr_buffer;
if (ptr_buffer->prev_buffer)
(ptr_buffer->prev_buffer)->next_buffer = window->buffer;
ptr_buffer->prev_buffer = window->buffer;
(ptr_buffer->prev_buffer)->next_buffer = buffer;
ptr_buffer->prev_buffer = 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;
buffer->prev_buffer = last_gui_buffer;
buffer->next_buffer = NULL;
last_gui_buffer->next_buffer = buffer;
last_gui_buffer = buffer;
}
}
@@ -1619,7 +1806,7 @@ gui_buffer_move_to_number (t_gui_window *window, int number)
ptr_buffer->number = i++;
}
gui_redraw_buffer (window->buffer);
gui_redraw_buffer (buffer);
}
/*
@@ -1687,7 +1874,7 @@ gui_buffer_print_log (t_gui_buffer *buffer)
weechat_log_printf (" server . . . . . . . : 0x%X\n", buffer->server);
weechat_log_printf (" all_servers. . . . . : %d\n", buffer->all_servers);
weechat_log_printf (" channel. . . . . . . : 0x%X\n", buffer->channel);
weechat_log_printf (" dcc. . . . . . . . . : %d\n", buffer->dcc);
weechat_log_printf (" type . . . . . . . . : %d\n", buffer->type);
weechat_log_printf (" lines. . . . . . . . : 0x%X\n", buffer->lines);
weechat_log_printf (" last_line. . . . . . : 0x%X\n", buffer->last_line);
weechat_log_printf (" last_read_line . . . : 0x%X\n", buffer->last_read_line);
+12 -2
View File
@@ -87,6 +87,14 @@ t_gui_key_function gui_key_functions[] =
N_("scroll one page up") },
{ "page_down", gui_action_page_down,
N_("scroll one page down") },
{ "scroll_up", gui_action_scroll_up,
N_("scroll a few lines up") },
{ "scroll_down", gui_action_scroll_down,
N_("scroll a few lines down") },
{ "scroll_top", gui_action_scroll_top,
N_("scroll to top of buffer") },
{ "scroll_bottom", gui_action_scroll_bottom,
N_("scroll to bottom of buffer") },
{ "nick_beginning", gui_action_nick_beginning,
N_("display beginning of nicklist") },
{ "nick_end", gui_action_nick_end,
@@ -99,6 +107,8 @@ t_gui_key_function gui_key_functions[] =
N_("jump to buffer with activity") },
{ "jump_dcc", gui_action_jump_dcc,
N_("jump to DCC buffer") },
{ "jump_raw_data", gui_action_jump_raw_data,
N_("jump to raw IRC data buffer") },
{ "jump_last_buffer", gui_action_jump_last_buffer,
N_("jump to last buffer") },
{ "jump_server", gui_action_jump_server,
@@ -517,8 +527,8 @@ gui_key_pressed (char *key_str)
/* exact combo found => execute function or command */
gui_key_buffer[0] = '\0';
if (ptr_key->command)
user_command (gui_current_window->buffer,
SERVER(gui_current_window->buffer),
user_command (SERVER(gui_current_window->buffer),
CHANNEL(gui_current_window->buffer),
ptr_key->command);
else
(void)(ptr_key->function)(gui_current_window);
+29 -6
View File
@@ -169,6 +169,10 @@ enum t_weechat_color
#define WINDOW_MIN_WIDTH 10
#define WINDOW_MIN_HEIGHT 5
#define BUFFER_TYPE_STANDARD 0
#define BUFFER_TYPE_DCC 1
#define BUFFER_TYPE_RAW_DATA 2
#define NOTIFY_LEVEL_MIN 0
#define NOTIFY_LEVEL_MAX 3
#define NOTIFY_LEVEL_DEFAULT NOTIFY_LEVEL_MAX
@@ -225,7 +229,8 @@ struct t_gui_buffer
void *server; /* buffer's server */
int all_servers; /* =1 if all servers are displayed here */
void *channel; /* buffer's channel */
int dcc; /* buffer is dcc status */
int type; /* type: standard (server/channel/pv), */
/* dcc or raw data */
/* chat content (lines, line is composed by many messages) */
t_gui_line *lines; /* lines of chat window */
@@ -384,7 +389,9 @@ extern t_gui_window *gui_current_window;
extern t_gui_window_tree *gui_windows_tree;
extern t_gui_buffer *gui_buffers;
extern t_gui_buffer *last_gui_buffer;
extern t_gui_buffer *buffer_before_dcc;
extern t_gui_buffer *gui_buffer_before_dcc;
extern t_gui_buffer *gui_buffer_raw_data;
extern t_gui_buffer *gui_buffer_before_raw_data;
extern t_gui_infobar *gui_infobar;
extern t_gui_key *gui_keys;
extern t_gui_key *last_gui_key;
@@ -393,6 +400,7 @@ extern char gui_key_buffer[128];
extern int gui_key_grab;
extern int gui_key_grab_count;
extern char *gui_input_clipboard;
extern time_t gui_last_activity_time;
extern t_gui_color *gui_color[NUM_COLORS];
@@ -402,21 +410,26 @@ extern int gui_window_tree_init (t_gui_window *);
extern void gui_window_tree_node_to_leaf (t_gui_window_tree *, t_gui_window *);
extern void gui_window_tree_free (t_gui_window_tree **);
extern t_gui_window *gui_window_new (t_gui_window *, int, int, int, int, int, int);
extern t_gui_buffer *gui_buffer_new (t_gui_window *, void *, void *, int, int);
extern t_gui_buffer *gui_buffer_search (char *, char *);
extern t_gui_window *gui_buffer_find_window (t_gui_buffer *);
extern t_gui_buffer *gui_buffer_new (t_gui_window *, void *, void *, int, int);
extern t_gui_buffer *gui_get_dcc_buffer (t_gui_window *);
extern void gui_buffer_clear (t_gui_buffer *);
extern void gui_buffer_clear_all ();
extern void gui_infobar_printf (int, int, char *, ...);
extern void gui_window_free (t_gui_window *);
extern void gui_infobar_printf (int, int, char *, ...);
extern void gui_infobar_printf_from_buffer (t_gui_buffer *, int, int, char *, char *, ...);
extern void gui_infobar_remove ();
extern void gui_infobar_remove_all ();
extern void gui_buffer_free (t_gui_buffer *, int);
extern t_gui_line *gui_line_new (t_gui_buffer *);
extern int gui_word_strlen (t_gui_window *, char *);
extern int gui_word_real_pos (t_gui_window *, char *, int);
extern void gui_printf_internal (t_gui_buffer *, int, int, char *, ...);
extern void gui_printf_raw_data (void *, int, char *);
extern void gui_optimize_input_buffer_size (t_gui_buffer *);
extern void gui_exec_action_dcc (t_gui_window *, char *);
extern void gui_exec_action_raw_data (t_gui_window *, char *);
extern int gui_insert_string_input (t_gui_window *, char *, int);
extern void gui_merge_servers (t_gui_window *);
extern void gui_split_server (t_gui_window *);
@@ -427,8 +440,9 @@ extern void gui_window_switch_previous (t_gui_window *);
extern void gui_window_switch_next (t_gui_window *);
extern void gui_window_switch_by_buffer (t_gui_window *, int);
extern void gui_buffer_switch_dcc (t_gui_window *);
extern void gui_buffer_switch_raw_data (t_gui_window *);
extern t_gui_buffer *gui_buffer_switch_by_number (t_gui_window *, int);
extern void gui_buffer_move_to_number (t_gui_window *, int);
extern void gui_buffer_move_to_number (t_gui_buffer *, int);
extern void gui_window_print_log (t_gui_window *);
extern void gui_buffer_print_log (t_gui_buffer *);
@@ -458,12 +472,17 @@ extern void gui_action_down (t_gui_window *);
extern void gui_action_down_global (t_gui_window *);
extern void gui_action_page_up (t_gui_window *);
extern void gui_action_page_down (t_gui_window *);
extern void gui_action_scroll_up (t_gui_window *);
extern void gui_action_scroll_down (t_gui_window *);
extern void gui_action_scroll_top (t_gui_window *);
extern void gui_action_scroll_bottom (t_gui_window *);
extern void gui_action_nick_beginning (t_gui_window *);
extern void gui_action_nick_end (t_gui_window *);
extern void gui_action_nick_page_up (t_gui_window *);
extern void gui_action_nick_page_down (t_gui_window *);
extern void gui_action_jump_smart (t_gui_window *);
extern void gui_action_jump_dcc (t_gui_window *);
extern void gui_action_jump_raw_data (t_gui_window *);
extern void gui_action_jump_last_buffer (t_gui_window *);
extern void gui_action_jump_server (t_gui_window *);
extern void gui_action_jump_next_server (t_gui_window *);
@@ -502,6 +521,7 @@ extern void gui_calculate_pos_size (t_gui_window *);
extern void gui_draw_buffer_title (t_gui_buffer *, int);
extern char *gui_word_get_next_char (t_gui_window *, unsigned char *, int);
extern void gui_draw_buffer_chat (t_gui_buffer *, int);
extern void gui_draw_buffer_chat_line (t_gui_buffer *, t_gui_line *);
extern void gui_draw_buffer_nick (t_gui_buffer *, int);
extern void gui_draw_buffer_status (t_gui_buffer *, int);
extern void gui_draw_buffer_infobar_time (t_gui_buffer *);
@@ -509,9 +529,12 @@ 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 (t_gui_window *);
extern void gui_window_page_up (t_gui_window *);
extern void gui_window_page_down (t_gui_window *);
extern void gui_window_scroll_up (t_gui_window *);
extern void gui_window_scroll_down (t_gui_window *);
extern void gui_window_scroll_top (t_gui_window *);
extern void gui_window_scroll_bottom (t_gui_window *);
extern void gui_window_nick_beginning (t_gui_window *);
extern void gui_window_nick_end (t_gui_window *);
extern void gui_window_nick_page_up (t_gui_window *);
+14 -3
View File
@@ -66,6 +66,7 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name)
new_channel->key = NULL;
new_channel->nicks_count = 0;
new_channel->checking_away = 0;
new_channel->away_message = NULL;
new_channel->nicks = NULL;
new_channel->last_nick = NULL;
@@ -119,6 +120,8 @@ channel_free (t_irc_server *server, t_irc_channel *channel)
if (channel->topic)
free (channel->topic);
nick_free_all (channel);
if (channel->away_message)
free (channel->away_message);
free (channel);
server->channels = new_channels;
}
@@ -338,8 +341,14 @@ channel_check_away (t_irc_server *server, t_irc_channel *channel)
{
if (channel->type == CHANNEL_TYPE_CHANNEL)
{
channel->checking_away++;
server_sendf (server, "WHO %s\r\n", channel->name);
if ((cfg_irc_away_check_max_nicks == 0) ||
(channel->nicks_count <= cfg_irc_away_check_max_nicks))
{
channel->checking_away++;
server_sendf (server, "WHO %s\r\n", channel->name);
}
else
channel_remove_away (channel);
}
}
@@ -375,7 +384,8 @@ channel_create_dcc (t_irc_dcc *ptr_dcc)
ptr_dcc->nick);
if (!ptr_channel)
return 0;
gui_buffer_new (gui_current_window, ptr_dcc->server, ptr_channel, 0, 0);
gui_buffer_new (gui_current_window, ptr_dcc->server, ptr_channel,
BUFFER_TYPE_STANDARD, 0);
if (ptr_channel->dcc_chat &&
(!DCC_ENDED(((t_irc_dcc *)(ptr_channel->dcc_chat))->status)))
@@ -481,6 +491,7 @@ channel_print_log (t_irc_channel *channel)
weechat_log_printf (" limit. . . . : %d\n", channel->limit);
weechat_log_printf (" key. . . . . : '%s'\n", channel->key);
weechat_log_printf (" checking_away: %d\n", channel->checking_away);
weechat_log_printf (" away_message : '%s'\n", channel->away_message);
weechat_log_printf (" nicks. . . . : 0x%X\n", channel->nicks);
weechat_log_printf (" last_nick. . : 0x%X\n", channel->last_nick);
weechat_log_printf (" buffer . . . : 0x%X\n", channel->buffer);
+6 -2
View File
@@ -47,7 +47,7 @@ t_irc_command irc_commands[] =
N_("[-all] [message]"),
N_(" -all: toggle away status on all connected servers\n"
"message: message for away (if no message is given, away status is removed)"),
"%y", 0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
"-all", 0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
{ "ban", N_("bans nicks or hosts"),
N_("[channel] [nickname [nickname ...]]"),
N_(" channel: channel for ban\n"
@@ -175,7 +175,7 @@ t_irc_command irc_commands[] =
N_("[-all] nickname"),
N_(" -all: set new nickname for all connected servers\n"
"nickname: new nickname"),
NULL, 1, 2, 0, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
"-all", 1, 2, 0, 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\n"
@@ -460,6 +460,8 @@ t_irc_command irc_commands[] =
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "376", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "378", N_("connecting from"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_378 },
{ "381", N_("you are now an IRC operator"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "382", N_("rehashing"), "", "",
@@ -562,6 +564,8 @@ t_irc_command irc_commands[] =
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "487", N_("network split"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "501", N_("unknown mode flag"), "", "",
+36 -28
View File
@@ -146,34 +146,39 @@ dcc_file_is_resumable (t_irc_dcc *ptr_dcc, char *filename)
void
dcc_find_filename (t_irc_dcc *ptr_dcc)
{
char *ptr_home, *filename2;
char *dir1, *dir2, *filename2;
if (!DCC_IS_FILE(ptr_dcc->type))
return;
ptr_home = getenv ("HOME");
ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) +
dir1 = weechat_strreplace (cfg_dcc_download_path, "~", getenv ("HOME"));
if (!dir1)
return;
dir2 = weechat_strreplace (dir1, "%h", weechat_home);
if (!dir2)
{
free (dir1);
return;
}
ptr_dcc->local_filename = (char *) malloc (strlen (dir2) +
strlen (ptr_dcc->nick) +
strlen (ptr_dcc->filename) +
((cfg_dcc_download_path[0] == '~') ?
strlen (ptr_home) : 0) +
4);
strlen (ptr_dcc->filename) + 4);
if (!ptr_dcc->local_filename)
return;
if (cfg_dcc_download_path[0] == '~')
{
strcpy (ptr_dcc->local_filename, ptr_home);
strcat (ptr_dcc->local_filename, cfg_dcc_download_path + 1);
}
else
strcpy (ptr_dcc->local_filename, cfg_dcc_download_path);
strcpy (ptr_dcc->local_filename, dir2);
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);
if (dir1)
free (dir1);
if (dir2 )
free (dir2);
/* file already exists? */
if (access (ptr_dcc->local_filename, F_OK) == 0)
{
@@ -847,7 +852,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
void
dcc_send_request (t_irc_server *server, int type, char *nick, char *filename)
{
char *ptr_home, *filename2, *short_filename, *pos;
char *dir1, *dir2, *filename2, *short_filename, *pos;
int spaces, args, port_start, port_end;
struct stat st;
int sock, port;
@@ -872,12 +877,17 @@ dcc_send_request (t_irc_server *server, int type, char *nick, char *filename)
filename2 = strdup (filename);
else
{
ptr_home = getenv ("HOME");
filename2 = (char *) malloc (strlen (cfg_dcc_upload_path) +
strlen (filename) +
((cfg_dcc_upload_path[0] == '~') ?
strlen (ptr_home) : 0) +
4);
dir1 = weechat_strreplace (cfg_dcc_upload_path, "~", getenv ("HOME"));
if (!dir1)
return;
dir2 = weechat_strreplace (dir1, "%h", weechat_home);
if (!dir2)
{
free (dir1);
return;
}
filename2 = (char *) malloc (strlen (dir2) +
strlen (filename) + 4);
if (!filename2)
{
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
@@ -886,16 +896,14 @@ dcc_send_request (t_irc_server *server, int type, char *nick, char *filename)
WEECHAT_ERROR);
return;
}
if (cfg_dcc_upload_path[0] == '~')
{
strcpy (filename2, ptr_home);
strcat (filename2, cfg_dcc_upload_path + 1);
}
else
strcpy (filename2, cfg_dcc_upload_path);
strcpy (filename2, dir2);
if (filename2[strlen (filename2) - 1] != DIR_SEPARATOR_CHAR)
strcat (filename2, DIR_SEPARATOR);
strcat (filename2, filename);
if (dir1)
free (dir1);
if (dir2)
free (dir2);
}
#endif
+48
View File
@@ -35,6 +35,54 @@
#include "../gui/gui.h"
/*
* irc_find_context: find window/buffer for a server/channel
*/
void
irc_find_context (t_irc_server *server, t_irc_channel *channel,
t_gui_window **window, t_gui_buffer **buffer)
{
t_gui_window *ptr_win;
if (!buffer)
return;
/* first find buffer */
*buffer = NULL;
if (channel && channel->buffer)
*buffer = channel->buffer;
else
{
if (server && server->buffer)
*buffer = server->buffer;
else
*buffer = gui_current_window->buffer;
}
/* then find first window displaying this buffer */
if (window)
{
*window = NULL;
if (gui_current_window->buffer == *buffer)
*window = gui_current_window;
else
{
for (ptr_win = gui_windows; ptr_win;
ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == *buffer)
{
*window = ptr_win;
break;
}
}
if (!*window)
*window = gui_current_window;
}
}
}
/*
* irc_display_prefix: display a prefix for action/info/error msg
* prefix must be 3 chars length
+3 -2
View File
@@ -199,8 +199,9 @@ ignore_add (char *mask, char *type, char *channel_name, char *server_name)
}
#ifdef DEBUG
wee_log_printf ("Adding ignore: mask:'%s', type:'%s', channel:'%s', server:'%s'\n",
mask, type, channel_name, server_name);
weechat_log_printf ("Adding ignore: mask:'%s', type:'%s', channel:'%s', "
"server:'%s'\n",
mask, type, channel_name, server_name);
#endif
type_index = -1;
+348 -92
View File
@@ -43,6 +43,7 @@
#include "../plugins/plugins.h"
char *irc_last_command_received = NULL;
int command_ignored;
@@ -204,8 +205,9 @@ irc_recv_command (t_irc_server *server, char *entire_line,
{
int i, cmd_found, return_code;
char *pos, *nick, *args_after_color;
char *dup_entire_line, *dup_host, *dup_arguments;
if (command == NULL)
if (!command)
return -2;
/* look for IRC command */
@@ -225,37 +227,44 @@ irc_recv_command (t_irc_server *server, char *entire_line,
if (irc_commands[i].recv_function != NULL)
{
command_ignored = ignore_check (host, irc_commands[i].command_name, NULL, server->name);
dup_entire_line = (entire_line) ? strdup (entire_line) : NULL;
dup_host = (host) ? strdup (host) : NULL;
dup_arguments = (arguments) ? strdup (arguments) : NULL;
command_ignored = ignore_check (dup_host, irc_commands[i].command_name, NULL, server->name);
#ifdef PLUGINS
if (!command_ignored)
{
return_code = plugin_msg_handler_exec (server->name,
irc_commands[i].command_name,
entire_line);
/* plugin handler choosed to discard message for WeeChat,
so we don't execute WeeChat standard handler for IRC message! */
if (return_code & PLUGIN_RC_OK_IGNORE_WEECHAT)
return 0;
}
#else
/* make gcc happy */
(void) entire_line;
return_code = plugin_msg_handler_exec (server->name,
irc_commands[i].command_name,
dup_entire_line);
/* plugin handler choosed to discard message for WeeChat,
so we ignore this message in standard handler */
if (return_code & PLUGIN_RC_OK_IGNORE_WEECHAT)
command_ignored = 1;
#endif
pos = (host) ? strchr (host, '!') : NULL;
pos = (dup_host) ? strchr (dup_host, '!') : NULL;
if (pos)
pos[0] = '\0';
nick = (host) ? strdup (host) : NULL;
nick = (dup_host) ? strdup (dup_host) : NULL;
if (pos)
pos[0] = '!';
args_after_color = (char *)gui_color_decode ((unsigned char *)arguments,
args_after_color = (char *)gui_color_decode ((unsigned char *)dup_arguments,
cfg_irc_colors_receive);
return_code = (int) (irc_commands[i].recv_function) (server, host, nick,
irc_last_command_received = strdup (dup_entire_line);
return_code = (int) (irc_commands[i].recv_function) (server, dup_host, nick,
(args_after_color) ?
args_after_color : arguments);
args_after_color : dup_arguments);
if (irc_last_command_received)
free (irc_last_command_received);
if (args_after_color)
free (args_after_color);
if (nick)
free (nick);
if (dup_entire_line)
free (dup_entire_line);
if (dup_host)
free (dup_host);
if (dup_arguments)
free (dup_arguments);
return return_code;
}
@@ -405,7 +414,8 @@ irc_cmd_recv_join (t_irc_server *server, char *host, char *nick, char *arguments
WEECHAT_ERROR, arguments);
return -1;
}
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 1);
gui_buffer_new (gui_current_window, server, ptr_channel,
BUFFER_TYPE_STANDARD, 1);
}
if (!command_ignored)
@@ -509,7 +519,7 @@ irc_cmd_recv_kick (t_irc_server *server, char *host, char *nick, char *arguments
gui_draw_buffer_nick (ptr_channel->buffer, 1);
gui_draw_buffer_status (ptr_channel->buffer, 1);
if (server->autorejoin)
irc_cmd_send_join (server, ptr_channel->name);
irc_cmd_send_join (server, NULL, ptr_channel->name);
}
{
/* someone was kicked from channel (but not me) => remove only this nick */
@@ -542,15 +552,20 @@ irc_cmd_recv_kill (t_irc_server *server, char *host, char *nick, char *arguments
while (pos_host2[0] == ' ')
pos_host2++;
pos_comment = strchr (pos_host2, ' ');
if (pos_comment)
if (pos_host2[0] == ':')
pos_comment = pos_host2 + 1;
else
{
pos_comment[0] = '\0';
pos_comment++;
while (pos_comment[0] == ' ')
pos_comment++;
if (pos_comment[0] == ':')
pos_comment = strchr (pos_host2, ' ');
if (pos_comment)
{
pos_comment[0] = '\0';
pos_comment++;
while (pos_comment[0] == ' ')
pos_comment++;
if (pos_comment[0] == ':')
pos_comment++;
}
}
for (ptr_channel = server->channels; ptr_channel;
@@ -597,7 +612,7 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
char *channel_name,
char *nick_host, char *modes, char *parm)
{
char *pos, set_flag;
char *pos, set_flag, unknown_mode[3];
t_irc_nick *ptr_nick;
set_flag = '+';
@@ -627,6 +642,31 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
_("removes ban on"),
(parm) ? parm : NULL);
/* look for next parameter */
if (parm && pos)
{
pos++;
while (pos[0] == ' ')
pos++;
parm = pos;
}
break;
case 'd':
pos = NULL;
if (parm)
{
pos = strchr (parm, ' ');
if (pos)
pos[0] = '\0';
}
if (nick_host)
irc_display_mode (server, ptr_channel->buffer,
channel_name, set_flag, "d", nick_host,
(set_flag == '+') ?
_("sets realname ban on") :
_("removes realname ban on"),
(parm) ? parm : NULL);
/* look for next parameter */
if (parm && pos)
{
@@ -648,8 +688,8 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
irc_display_mode (server, ptr_channel->buffer,
channel_name, set_flag, "e", nick_host,
(set_flag == '+') ?
_("sets exception on") :
_("removes exception on"),
_("sets ban exemtion on") :
_("removes ban exemption on"),
(parm) ? parm : NULL);
/* look for next parameter */
@@ -732,6 +772,31 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'),
CHANNEL_MODE_INVITE);
break;
case 'I':
pos = NULL;
if (parm)
{
pos = strchr (parm, ' ');
if (pos)
pos[0] = '\0';
}
if (nick_host)
irc_display_mode (server, ptr_channel->buffer,
channel_name, set_flag, "I", nick_host,
(set_flag == '+') ?
_("sets invite-only exemption on") :
_("removes invite-only exemption on"),
(parm) ? parm : NULL);
/* look for next parameter */
if (parm && pos)
{
pos++;
while (pos[0] == ' ')
pos++;
parm = pos;
}
break;
case 'k':
pos = NULL;
if (parm)
@@ -936,6 +1001,35 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
}
}
/* look for next parameter */
if (parm && pos)
{
pos++;
while (pos[0] == ' ')
pos++;
parm = pos;
}
break;
default: /* unknown mode received */
pos = NULL;
if (parm)
{
pos = strchr (parm, ' ');
if (pos)
pos[0] = '\0';
}
if (nick_host)
{
unknown_mode[0] = set_flag;
unknown_mode[1] = modes[0];
unknown_mode[2] = '\0';
irc_display_mode (server, ptr_channel->buffer,
channel_name, set_flag, unknown_mode + 1,
nick_host,
unknown_mode,
(parm) ? parm : NULL);
}
/* look for next parameter */
if (parm && pos)
{
@@ -1134,6 +1228,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
struct timezone tz;
long sec1, usec1, sec2, usec2, difftime;
t_irc_channel *ptr_channel;
int highlight;
host2 = NULL;
if (host)
@@ -1232,7 +1327,8 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
WEECHAT_ERROR, nick);
return -1;
}
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 0);
gui_buffer_new (gui_current_window, server, ptr_channel,
BUFFER_TYPE_STANDARD, 0);
}
if (!ptr_channel->topic)
ptr_channel->topic = strdup ((host2) ? host2 : "");
@@ -1249,16 +1345,21 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
nick);
if ( (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Private %s> %s"),
nick, pos);
gui_infobar_printf_from_buffer (ptr_channel->buffer,
cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Private"), " %s> %s",
nick, pos);
highlight = 1;
}
else
{
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s%s",
GUI_COLOR(COLOR_WIN_NICK_PRIVATE),
nick);
highlight = 0;
}
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s> ",
GUI_COLOR(COLOR_WIN_CHAT_DARK));
@@ -1266,6 +1367,12 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
"%s%s\n",
GUI_COLOR(COLOR_WIN_CHAT),
pos);
#ifdef PLUGINS
if (highlight)
(void) plugin_msg_handler_exec (server->name,
"weechat_highlight",
irc_last_command_received);
#endif
}
else
{
@@ -1457,6 +1564,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
struct utsname *buf;
int highlight;
/* no host => we can't identify sender of message! */
if (host == NULL)
@@ -1510,19 +1618,29 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("On %s: * %s %s"),
ptr_channel->name,
nick, pos);
gui_infobar_printf_from_buffer (ptr_channel->buffer,
cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Channel"), " %s: * %s %s",
ptr_channel->name,
nick, pos);
gui_printf (ptr_channel->buffer, " %s%s\n",
GUI_COLOR(COLOR_WIN_CHAT), pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_highlight",
irc_last_command_received);
#endif
}
else
{
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
"%s%s",
GUI_COLOR(COLOR_WIN_CHAT_NICK),
nick);
gui_printf (ptr_channel->buffer, " %s%s\n",
GUI_COLOR(COLOR_WIN_CHAT), pos);
gui_printf (ptr_channel->buffer, " %s%s\n",
GUI_COLOR(COLOR_WIN_CHAT), pos);
}
}
return 0;
}
@@ -1626,18 +1744,28 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("On %s: %s> %s"),
ptr_channel->name,
nick, pos);
gui_infobar_printf_from_buffer (ptr_channel->buffer,
cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Channel"), " %s: %s> %s",
ptr_channel->name,
nick, pos);
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
"%s\n", pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_highlight",
irc_last_command_received);
#endif
}
else
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : nick,
MSG_TYPE_NICK, 1, 1, 0);
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
"%s\n", pos);
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
"%s\n", pos);
}
}
}
else
@@ -1710,6 +1838,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2);
else
gui_printf (server->buffer, "\n");
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_ctcp",
irc_last_command_received);
#endif
}
return 0;
}
@@ -1743,6 +1876,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
GUI_COLOR(COLOR_WIN_CHAT),
GUI_COLOR(COLOR_WIN_CHAT_NICK),
nick);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_ctcp",
irc_last_command_received);
#endif
}
return 0;
}
@@ -1822,6 +1960,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
dcc_add (server, DCC_FILE_RECV, strtoul (pos_addr, NULL, 10),
atoi (pos_port), nick, -1, pos_file, NULL,
strtoul (pos_size, NULL, 10));
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_dcc",
irc_last_command_received);
#endif
}
return 0;
}
@@ -1884,6 +2027,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
dcc_accept_resume (server, pos_file, atoi (pos_port),
strtoul (pos_start_resume, NULL, 10));
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_dcc",
irc_last_command_received);
#endif
}
return 0;
}
@@ -1946,6 +2094,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
dcc_start_resume (server, pos_file, atoi (pos_port),
strtoul (pos_start_resume, NULL, 10));
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_dcc",
irc_last_command_received);
#endif
}
return 0;
}
@@ -2020,6 +2173,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
dcc_add (server, DCC_CHAT_RECV, strtoul (pos_addr, NULL, 10),
atoi (pos_port), nick, -1, NULL, NULL, 0);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_dcc",
irc_last_command_received);
#endif
}
return 0;
}
@@ -2045,7 +2203,8 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
WEECHAT_ERROR, nick);
return -1;
}
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 0);
gui_buffer_new (gui_current_window, server, ptr_channel,
BUFFER_TYPE_STANDARD, 0);
}
if (!ptr_channel->topic)
ptr_channel->topic = strdup (host2);
@@ -2065,19 +2224,34 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("On %s: * %s %s"),
ptr_channel->name,
nick, pos);
gui_infobar_printf_from_buffer (ptr_channel->buffer,
cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Channel"), " %s: * %s %s",
ptr_channel->name,
nick, pos);
gui_printf (ptr_channel->buffer, " %s%s\n",
GUI_COLOR(COLOR_WIN_CHAT), pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_highlight",
irc_last_command_received);
#endif
}
else
{
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
"%s%s",
GUI_COLOR(COLOR_WIN_CHAT_NICK),
nick);
gui_printf (ptr_channel->buffer, " %s%s\n",
GUI_COLOR(COLOR_WIN_CHAT), pos);
gui_printf (ptr_channel->buffer, " %s%s\n",
GUI_COLOR(COLOR_WIN_CHAT), pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_pv",
irc_last_command_received);
#endif
}
}
}
else
@@ -2116,6 +2290,11 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2);
else
gui_printf (server->buffer, "\n");
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_ctcp",
irc_last_command_received);
#endif
}
return 0;
}
@@ -2136,7 +2315,8 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
WEECHAT_ERROR, nick);
return -1;
}
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 0);
gui_buffer_new (gui_current_window, server, ptr_channel,
BUFFER_TYPE_STANDARD, 0);
}
if (!ptr_channel->topic)
ptr_channel->topic = strdup (host2);
@@ -2153,16 +2333,21 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
nick);
if ( (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Private %s> %s"),
nick, pos);
gui_infobar_printf_from_buffer (ptr_channel->buffer,
cfg_look_infobar_delay_highlight,
COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Private"), " %s> %s",
nick, pos);
highlight = 1;
}
else
{
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s%s",
GUI_COLOR(COLOR_WIN_NICK_PRIVATE),
nick);
highlight = 0;
}
gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
"%s> ",
GUI_COLOR(COLOR_WIN_CHAT_DARK));
@@ -2170,6 +2355,15 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
"%s%s\n",
GUI_COLOR(COLOR_WIN_CHAT),
pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_pv",
irc_last_command_received);
if (highlight)
(void) plugin_msg_handler_exec (server->name,
"weechat_highlight",
irc_last_command_received);
#endif
}
}
}
@@ -2259,20 +2453,19 @@ irc_cmd_recv_server_msg (t_irc_server *server, char *host, char *nick, char *arg
(void) host;
(void) nick;
/* skip nickname if at beginning of server message */
if (strncmp (server->nick, arguments, strlen (server->nick)) == 0)
{
arguments += strlen (server->nick) + 1;
while (arguments[0] == ' ')
arguments++;
}
if (arguments[0] == ':')
arguments++;
/* display server message */
if (!command_ignored)
{
/* skip nickname if at beginning of server message */
if (strncmp (server->nick, arguments, strlen (server->nick)) == 0)
{
arguments += strlen (server->nick) + 1;
while (arguments[0] == ' ')
arguments++;
}
if (arguments[0] == ':')
arguments++;
irc_display_prefix (server, server->buffer, PREFIX_SERVER);
gui_printf (server->buffer, "%s%s\n",
GUI_COLOR(COLOR_WIN_CHAT), arguments);
@@ -2427,7 +2620,8 @@ int
irc_cmd_recv_004 (t_irc_server *server, char *host, char *nick, char *arguments)
{
char *pos;
t_irc_channel *ptr_channel;
char **commands, **ptr;
t_irc_channel *ptr_channel;
pos = strchr (arguments, ' ');
if (pos)
@@ -2448,12 +2642,20 @@ irc_cmd_recv_004 (t_irc_server *server, char *host, char *nick, char *arguments)
/* execute command once connected */
if (server->command && server->command[0])
{
user_command(NULL, server, server->command);
if (server->command_delay > 0)
sleep (server->command_delay);
{
/* splitting command on ';' which can be escaped with '\;' */
commands = split_multi_command (server->command, ';');
if (commands)
{
for (ptr=commands; *ptr; ptr++)
user_command (server, NULL, *ptr);
free_multi_command (commands);
}
if (server->command_delay > 0)
sleep (server->command_delay);
}
/* auto-join after disconnection (only rejoins opened channels) */
if (server->reconnect_join && server->channels)
{
@@ -2476,7 +2678,7 @@ irc_cmd_recv_004 (t_irc_server *server, char *host, char *nick, char *arguments)
{
/* auto-join when connecting to server for first time */
if (server->autojoin && server->autojoin[0])
return irc_cmd_send_join (server, server->autojoin);
return irc_cmd_send_join (server, NULL, server->autojoin);
}
return 0;
@@ -2564,14 +2766,25 @@ irc_cmd_recv_301 (t_irc_server *server, char *host, char *nick, char *arguments)
{
/* look for private buffer to display message */
ptr_channel = channel_search (server, pos_nick);
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
gui_printf (ptr_buffer,
_("%s%s%s is away: %s\n"),
GUI_COLOR(COLOR_WIN_CHAT_NICK),
pos_nick,
GUI_COLOR(COLOR_WIN_CHAT),
pos_message);
if (!cfg_irc_show_away_once || !ptr_channel ||
!(ptr_channel->away_message) ||
(strcmp (ptr_channel->away_message, pos_message) != 0))
{
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
gui_printf (ptr_buffer,
_("%s%s%s is away: %s\n"),
GUI_COLOR(COLOR_WIN_CHAT_NICK),
pos_nick,
GUI_COLOR(COLOR_WIN_CHAT),
pos_message);
if (ptr_channel)
{
if (ptr_channel->away_message)
free (ptr_channel->away_message);
ptr_channel->away_message = strdup (pos_message);
}
}
}
}
}
@@ -4433,7 +4646,7 @@ irc_cmd_recv_366 (t_irc_server *server, char *host, char *nick, char *arguments)
_("normal"),
GUI_COLOR(COLOR_WIN_CHAT_DARK));
}
irc_cmd_send_mode (server, ptr_channel->name);
irc_cmd_send_mode (server, NULL, ptr_channel->name);
if (cfg_irc_away_check > 0)
channel_check_away (server, ptr_channel);
}
@@ -4641,6 +4854,49 @@ irc_cmd_recv_368 (t_irc_server *server, char *host, char *nick, char *arguments)
return 0;
}
/*
* irc_cmd_recv_378: '378' command received (connecting from)
*/
int
irc_cmd_recv_378 (t_irc_server *server, char *host, char *nick, char *arguments)
{
char *pos, *pos2;
/* make gcc happy */
(void) host;
(void) nick;
if (!command_ignored)
{
/* skip nickname if at beginning of server message */
if (strncmp (server->nick, arguments, strlen (server->nick)) == 0)
{
arguments += strlen (server->nick) + 1;
while (arguments[0] == ' ')
arguments++;
}
irc_display_prefix (server, server->buffer, PREFIX_SERVER);
pos = strchr (arguments, ':');
if (pos)
{
pos[0] = '\0';
pos2 = pos - 1;
while (pos2[0] == ' ')
pos2--;
pos2[1] = '\0';
gui_printf (server->buffer, "%s%s%s\n",
GUI_COLOR(COLOR_WIN_CHAT), arguments, pos + 1);
}
else
gui_printf (server->buffer, "%s%s\n",
GUI_COLOR(COLOR_WIN_CHAT), arguments);
}
return 0;
}
/*
* irc_cmd_recv_433: '433' command received (nickname already in use)
*/
+417 -191
View File
File diff suppressed because it is too large Load Diff
+8 -3
View File
@@ -552,11 +552,14 @@ server_sendf (t_irc_server *server, char *fmt, ...)
buffer[sizeof (buffer) - 1] = '\0';
if ((size_buf < 0) || (size_buf > (int) (sizeof (buffer) - 1)))
size_buf = strlen (buffer);
#ifdef DEBUG
buffer[size_buf - 2] = '\0';
gui_printf_raw_data (server, 1, buffer);
#ifdef DEBUG
gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer);
buffer[size_buf - 2] = '\r';
#endif
buffer[size_buf - 2] = '\r';
if (server_send (server, buffer, strlen (buffer)) <= 0)
{
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
@@ -726,6 +729,7 @@ server_msgq_flush ()
if (ptr_data && ptr_data[0])
{
gui_printf_raw_data (recv_msgq->server, 0, ptr_data);
#ifdef DEBUG
gui_printf (NULL, "[DEBUG] data received from server: %s\n", ptr_data);
#endif
@@ -1633,7 +1637,8 @@ server_auto_connect (int auto_connect, int command_line)
if ( ((command_line) && (ptr_server->command_line))
|| ((!command_line) && (auto_connect) && (ptr_server->autoconnect)) )
{
(void) gui_buffer_new (gui_current_window, ptr_server, NULL, 0, 1);
(void) gui_buffer_new (gui_current_window, ptr_server, NULL,
BUFFER_TYPE_STANDARD, 1);
gui_redraw_buffer (gui_current_window->buffer);
if (!server_connect (ptr_server))
server_reconnect_schedule (ptr_server);
+63 -61
View File
@@ -110,6 +110,7 @@ struct t_irc_channel
char *key; /* channel key (NULL if no key is set) */
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
int checking_away; /* = 1 if checking away with WHO cmd */
char *away_message; /* to display away only once in private */
t_irc_nick *nicks; /* nicks on the channel */
t_irc_nick *last_nick; /* last nick on the channel */
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
@@ -189,9 +190,9 @@ struct t_irc_command
/* NULL=no completion, ""=default (nick) */
int min_arg, max_arg; /* min & max number of arguments */
int need_connection; /* = 1 if cmd needs server connection */
int (*cmd_function_args)(t_irc_server *, int, char **);
int (*cmd_function_args)(t_irc_server *, t_irc_channel *, int, char **);
/* function called when user enters cmd */
int (*cmd_function_1arg)(t_irc_server *, char *);
int (*cmd_function_1arg)(t_irc_server *, t_irc_channel *, char *);
/* function called when user enters cmd */
int (*recv_function)(t_irc_server *, char *, char *, char *);
/* function called when cmd is received */
@@ -394,6 +395,8 @@ extern void dcc_print_log (t_irc_dcc *);
/* IRC display (irc-diplay.c) */
extern void irc_find_context (t_irc_server *, t_irc_channel *,
t_gui_window **, t_gui_buffer **);
extern void irc_display_prefix (t_irc_server *, t_gui_buffer *, char *);
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, char *, int,
int, int, int);
@@ -405,65 +408,63 @@ extern void irc_display_server (t_irc_server *ptr_server);
/* IRC commands issued by user (irc-send.c) */
extern void irc_login (t_irc_server *);
extern int irc_cmd_send_admin (t_irc_server *, char *);
extern int irc_cmd_send_ame (t_irc_server *, char *);
extern int irc_cmd_send_amsg (t_irc_server *, char *);
extern int irc_cmd_send_away (t_irc_server *, char *);
extern int irc_cmd_send_ban (t_irc_server *, char *);
extern int irc_cmd_send_ctcp (t_irc_server *, char *);
extern int irc_cmd_send_dcc (t_irc_server *, char *);
extern int irc_cmd_send_dehalfop (t_irc_server *, int, char **);
extern int irc_cmd_send_deop (t_irc_server *, int, char **);
extern int irc_cmd_send_devoice (t_irc_server *, int, char **);
extern int irc_cmd_send_die (t_irc_server *, char *);
extern int irc_cmd_send_halfop (t_irc_server *, int, char **);
extern int irc_cmd_send_info (t_irc_server *, char *);
extern int irc_cmd_send_invite (t_irc_server *, int, char **);
extern int irc_cmd_send_ison (t_irc_server *, char *);
extern int irc_cmd_send_join (t_irc_server *, char *);
extern int irc_cmd_send_kick (t_irc_server *, char *);
extern int irc_cmd_send_kickban (t_irc_server *, char *);
extern int irc_cmd_send_kill (t_irc_server *, char *);
extern int irc_cmd_send_links (t_irc_server *, char *);
extern int irc_cmd_send_list (t_irc_server *, char *);
extern int irc_cmd_send_lusers (t_irc_server *, char *);
extern int irc_send_me (t_irc_server *, t_irc_channel *, char *);
extern int irc_send_me_all_channels (t_irc_server *, char *);
extern int irc_cmd_send_me (t_irc_server *, char *);
extern int irc_cmd_send_mode (t_irc_server *, char *);
extern int irc_cmd_send_motd (t_irc_server *, char *);
extern int irc_cmd_send_msg (t_irc_server *, char *);
extern int irc_cmd_send_names (t_irc_server *, char *);
extern int irc_cmd_send_nick (t_irc_server *, int, char **);
extern int irc_cmd_send_notice (t_irc_server *, char *);
extern int irc_cmd_send_op (t_irc_server *, int, char **);
extern int irc_cmd_send_oper (t_irc_server *, char *);
extern int irc_cmd_send_part (t_irc_server *, char *);
extern int irc_cmd_send_ping (t_irc_server *, char *);
extern int irc_cmd_send_pong (t_irc_server *, char *);
extern int irc_cmd_send_query (t_irc_server *, char *);
extern int irc_cmd_send_quit (t_irc_server *, char *);
extern int irc_cmd_send_quote (t_irc_server *, char *);
extern int irc_cmd_send_rehash (t_irc_server *, char *);
extern int irc_cmd_send_restart (t_irc_server *, char *);
extern int irc_cmd_send_service (t_irc_server *, char *);
extern int irc_cmd_send_servlist (t_irc_server *, char *);
extern int irc_cmd_send_squery (t_irc_server *, char *);
extern int irc_cmd_send_squit (t_irc_server *, char *);
extern int irc_cmd_send_stats (t_irc_server *, char *);
extern int irc_cmd_send_summon (t_irc_server *, char *);
extern int irc_cmd_send_time (t_irc_server *, char *);
extern int irc_cmd_send_topic (t_irc_server *, char *);
extern int irc_cmd_send_trace (t_irc_server *, char *);
extern int irc_cmd_send_unban (t_irc_server *, char *);
extern int irc_cmd_send_userhost (t_irc_server *, char *);
extern int irc_cmd_send_users (t_irc_server *, char *);
extern int irc_cmd_send_version (t_irc_server *, char *);
extern int irc_cmd_send_voice (t_irc_server *, int, char **);
extern int irc_cmd_send_wallops (t_irc_server *, char *);
extern int irc_cmd_send_who (t_irc_server *, char *);
extern int irc_cmd_send_whois (t_irc_server *, char *);
extern int irc_cmd_send_whowas (t_irc_server *, char *);
extern int irc_cmd_send_admin (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_ame (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_amsg (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_away (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_ban (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_ctcp (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_dcc (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_dehalfop (t_irc_server *, t_irc_channel *, int, char **);
extern int irc_cmd_send_deop (t_irc_server *, t_irc_channel *, int, char **);
extern int irc_cmd_send_devoice (t_irc_server *, t_irc_channel *, int, char **);
extern int irc_cmd_send_die (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_halfop (t_irc_server *, t_irc_channel *, int, char **);
extern int irc_cmd_send_info (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_invite (t_irc_server *, t_irc_channel *, int, char **);
extern int irc_cmd_send_ison (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_join (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_kick (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_kickban (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_kill (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_links (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_list (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_lusers (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_me (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_mode (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_motd (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_msg (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_names (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_nick (t_irc_server *, t_irc_channel *, int, char **);
extern int irc_cmd_send_notice (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_op (t_irc_server *, t_irc_channel *, int, char **);
extern int irc_cmd_send_oper (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_part (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_ping (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_pong (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_query (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_quit (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_quote (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_rehash (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_restart (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_service (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_servlist (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_squery (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_squit (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_stats (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_summon (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_time (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_topic (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_trace (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_unban (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_userhost (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_users (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_version (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_voice (t_irc_server *, t_irc_channel *, int, char **);
extern int irc_cmd_send_wallops (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_who (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_whois (t_irc_server *, t_irc_channel *, char *);
extern int irc_cmd_send_whowas (t_irc_server *, t_irc_channel *, char *);
/* IRC commands executed when received from server (irc-recv.c) */
@@ -523,6 +524,7 @@ extern int irc_cmd_recv_365 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_366 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_367 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_368 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_378 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_433 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_438 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_671 (t_irc_server *, char *, char *, char *);
+4
View File
@@ -29,6 +29,10 @@ if PLUGIN_RUBY
script_dir = scripts
endif
if PLUGIN_LUA
script_dir = scripts
endif
SUBDIRS = $(script_dir)
noinst_LIBRARIES = lib_weechat_plugins.a
+383 -23
View File
@@ -35,6 +35,7 @@
#include "plugins.h"
#include "plugins-config.h"
#include "../common/command.h"
#include "../common/log.h"
#include "../common/weeconfig.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@@ -152,12 +153,12 @@ weechat_plugin_exec_on_files (t_weechat_plugin *plugin, char *directory,
}
/*
* weechat_plugin_printf: print a message on a server or channel buffer
* weechat_plugin_print: print a message on a server or channel buffer
*/
void
weechat_plugin_printf (t_weechat_plugin *plugin,
char *server, char *channel, char *message, ...)
weechat_plugin_print (t_weechat_plugin *plugin,
char *server, char *channel, char *message, ...)
{
t_gui_buffer *ptr_buffer;
va_list argptr;
@@ -175,11 +176,11 @@ weechat_plugin_printf (t_weechat_plugin *plugin,
}
/*
* weechat_plugin_printf_server: print a message on server buffer
* weechat_plugin_print_server: print a message on server buffer
*/
void
weechat_plugin_printf_server (t_weechat_plugin *plugin, char *message, ...)
weechat_plugin_print_server (t_weechat_plugin *plugin, char *message, ...)
{
va_list argptr;
static char buf[8192];
@@ -195,11 +196,11 @@ weechat_plugin_printf_server (t_weechat_plugin *plugin, char *message, ...)
}
/*
* weechat_plugin_infobar_printf: print a message in infobar
* weechat_plugin_print_infobar: print a message in infobar
*/
void
weechat_plugin_infobar_printf (t_weechat_plugin *plugin, int time_displayed, char *message, ...)
weechat_plugin_print_infobar (t_weechat_plugin *plugin, int time_displayed, char *message, ...)
{
va_list argptr;
static char buf[1024];
@@ -213,6 +214,54 @@ weechat_plugin_infobar_printf (t_weechat_plugin *plugin, int time_displayed, cha
gui_infobar_printf (time_displayed, COLOR_WIN_INFOBAR, "%s", buf);
}
/*
* weechat_plugin_infobar_remove: remove message(s) in infobar
*/
void
weechat_plugin_infobar_remove (t_weechat_plugin *plugin, int how_many)
{
if (!plugin)
return;
if (how_many <= 0)
gui_infobar_remove_all ();
else
{
while ((gui_infobar) && (how_many > 0))
{
gui_infobar_remove ();
how_many--;
}
}
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
}
/*
* weechat_plugin_log: add a message on logs
*/
void
weechat_plugin_log (t_weechat_plugin *plugin,
char *server, char *channel, char *message, ...)
{
t_gui_buffer *ptr_buffer;
va_list argptr;
static char buf[8192];
if (!plugin || !message)
return;
ptr_buffer = gui_buffer_search (server, channel);
if (ptr_buffer)
{
va_start (argptr, message);
vsnprintf (buf, sizeof (buf) - 1, message, argptr);
va_end (argptr);
log_write_line (ptr_buffer, buf);
}
}
/*
* weechat_plugin_msg_handler_add: add a message handler
*/
@@ -251,6 +300,22 @@ weechat_plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
return NULL;
}
/*
* weechat_plugin_timer_handler_add: add a timer handler
*/
t_plugin_handler *
weechat_plugin_timer_handler_add (t_weechat_plugin *plugin, int interval,
t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)
{
if (plugin && (interval >= 1) && handler_func)
return plugin_timer_handler_add (plugin, interval, handler_func,
handler_args, handler_pointer);
return NULL;
}
/*
* weechat_plugin_handler_remove: remove a WeeChat handler
*/
@@ -288,13 +353,24 @@ weechat_plugin_exec_command (t_weechat_plugin *plugin,
if (!plugin || !command)
return;
plugin_find_server_channel (server, channel, &ptr_server, &ptr_channel);
if (ptr_server && ptr_channel)
user_command (ptr_channel->buffer, ptr_server, command);
else if (ptr_server && (ptr_server->buffer))
user_command (ptr_server->buffer, ptr_server, command);
if (plugin_find_server_channel (server, channel, &ptr_server, &ptr_channel) < 0)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s server/channel (%s/%s) not found for plugin "
"exec command\n"),
WEECHAT_ERROR,
(server) ? server : "", (channel) ? channel : "");
}
else
user_command (gui_buffers, NULL, command);
{
if (ptr_server && ptr_channel)
user_command (ptr_server, ptr_channel, command);
else if (ptr_server && (ptr_server->buffer))
user_command (ptr_server, NULL, command);
else
user_command (NULL, NULL, command);
}
}
/*
@@ -308,6 +384,8 @@ weechat_plugin_get_info (t_weechat_plugin *plugin, char *info, char *server)
{
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
time_t inactivity;
char *inactivity_str;
if (!plugin || !info)
return NULL;
@@ -336,16 +414,26 @@ weechat_plugin_get_info (t_weechat_plugin *plugin, char *info, char *server)
{
return strdup (WEECHAT_SHAREDIR);
}
else if (ascii_strcasecmp (info, "inactivity") == 0)
{
if (gui_last_activity_time == 0)
inactivity = 0;
else
inactivity = time (NULL) - gui_last_activity_time;
inactivity_str = (char *) malloc (128);
if (!inactivity_str)
return NULL;
snprintf (inactivity_str, 128, "%ld", inactivity);
return inactivity_str;
}
/* below are infos that need server to return value */
plugin_find_server_channel (server, NULL, &ptr_server, &ptr_channel);
if (!ptr_server)
return NULL;
if (ascii_strcasecmp (info, "nick") == 0)
{
if (ptr_server->is_connected && ptr_server->nick)
if (ptr_server && ptr_server->is_connected && ptr_server->nick)
return strdup (ptr_server->nick);
}
else if (ascii_strcasecmp (info, "channel") == 0)
@@ -355,12 +443,12 @@ weechat_plugin_get_info (t_weechat_plugin *plugin, char *info, char *server)
}
else if (ascii_strcasecmp (info, "server") == 0)
{
if (ptr_server->is_connected && ptr_server->name)
if (ptr_server && ptr_server->is_connected && ptr_server->name)
return strdup (ptr_server->name);
}
else if (ascii_strcasecmp (info, "away") == 0)
{
if (ptr_server->is_connected && ptr_server->is_away)
if (ptr_server && ptr_server->is_connected && ptr_server->is_away)
return strdup ("1");
else
return strdup ("0");
@@ -412,12 +500,10 @@ weechat_plugin_get_dcc_info (t_weechat_plugin *plugin)
new_dcc_info->prev_dcc = last_dcc_info;
new_dcc_info->next_dcc = NULL;
if (!dcc_info)
{
dcc_info = new_dcc_info;
last_dcc_info = new_dcc_info;
}
else
last_dcc_info->next_dcc = new_dcc_info;
last_dcc_info = new_dcc_info;
}
}
@@ -527,7 +613,7 @@ weechat_plugin_get_config (t_weechat_plugin *plugin, char *option)
{
if ((!option) ||
((option) && (option[0])
&& (strstr (weechat_options[i][j].option_name, option) != NULL)))
&& (ascii_strcasecmp (weechat_options[i][j].option_name, option) == 0)))
{
return weechat_plugin_get_config_str_value (&weechat_options[i][j], NULL);
}
@@ -544,7 +630,7 @@ weechat_plugin_get_config (t_weechat_plugin *plugin, char *option)
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
if ((!option) ||
((option) && (option[0])
&& (strstr (option_name, option) != NULL)))
&& (ascii_strcasecmp (option_name, option) == 0)))
{
ptr_option_value = config_get_server_option_ptr (ptr_server,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
@@ -649,3 +735,277 @@ weechat_plugin_set_plugin_config (t_weechat_plugin *plugin, char *option, char *
}
return 0;
}
/*
* weechat_plugin_get_server_info: get list of server info
*/
t_plugin_server_info *
weechat_plugin_get_server_info (t_weechat_plugin *plugin)
{
t_plugin_server_info *server_info, *last_server_info, *new_server_info;
t_irc_server *ptr_server;
if (!plugin)
return NULL;
if (irc_servers)
{
server_info = NULL;
last_server_info = NULL;
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
{
new_server_info = (t_plugin_server_info *) malloc (sizeof (t_plugin_server_info));
if (new_server_info)
{
new_server_info->name = (ptr_server->name) ? strdup (ptr_server->name) : strdup ("");
new_server_info->autoconnect = ptr_server->autoconnect;
new_server_info->autoreconnect = ptr_server->autoreconnect;
new_server_info->autoreconnect_delay = ptr_server->autoreconnect_delay;
new_server_info->command_line = ptr_server->command_line;
new_server_info->address = (ptr_server->address) ? strdup (ptr_server->address) : strdup ("");
new_server_info->port = ptr_server->port;
new_server_info->ipv6 = ptr_server->ipv6;
new_server_info->ssl = ptr_server->ssl;
new_server_info->password = (ptr_server->password) ? strdup (ptr_server->password) : strdup ("");
new_server_info->nick1 = (ptr_server->nick1) ? strdup (ptr_server->nick1) : strdup ("");
new_server_info->nick2 = (ptr_server->nick2) ? strdup (ptr_server->nick2) : strdup ("");
new_server_info->nick3 = (ptr_server->nick3) ? strdup (ptr_server->nick3) : strdup ("");
new_server_info->username = (ptr_server->username) ? strdup (ptr_server->username) : strdup ("");
new_server_info->realname = (ptr_server->realname) ? strdup (ptr_server->realname) : strdup ("");
new_server_info->command = (ptr_server->command) ? strdup (ptr_server->command) : strdup ("");
new_server_info->command_delay = ptr_server->command_delay;
new_server_info->autojoin = (ptr_server->autojoin) ? strdup (ptr_server->autojoin) : strdup ("");
new_server_info->autorejoin = ptr_server->autorejoin;
new_server_info->notify_levels = (ptr_server->notify_levels) ? strdup (ptr_server->notify_levels) : strdup ("");
new_server_info->charset_decode_iso = (ptr_server->charset_decode_iso) ? strdup (ptr_server->charset_decode_iso) : strdup ("");
new_server_info->charset_decode_utf = (ptr_server->charset_decode_utf) ? strdup (ptr_server->charset_decode_utf) : strdup ("");
new_server_info->charset_encode = (ptr_server->charset_encode) ? strdup (ptr_server->charset_encode) : strdup ("");
new_server_info->is_connected = ptr_server->is_connected;
new_server_info->ssl_connected = ptr_server->ssl_connected;
new_server_info->nick = (ptr_server->nick) ? strdup (ptr_server->nick) : strdup ("");
new_server_info->is_away = ptr_server->is_away;
new_server_info->away_time = ptr_server->away_time;
new_server_info->lag = ptr_server->lag;
new_server_info->prev_server = last_server_info;
new_server_info->next_server = NULL;
if (!server_info)
server_info = new_server_info;
else
last_server_info->next_server = new_server_info;
last_server_info = new_server_info;
}
}
return server_info;
}
return NULL;
}
/*
* weechat_plugin_free_server_info: free server info struct list
*/
void
weechat_plugin_free_server_info (t_weechat_plugin *plugin, t_plugin_server_info *server_info)
{
t_plugin_server_info *new_server_info;
if (!plugin || !server_info)
return;
while (server_info)
{
if (server_info->name)
free (server_info->name);
if (server_info->address)
free (server_info->address);
if (server_info->password)
free (server_info->password);
if (server_info->nick1)
free (server_info->nick1);
if (server_info->nick2)
free (server_info->nick2);
if (server_info->nick3)
free (server_info->nick3);
if (server_info->username)
free (server_info->username);
if (server_info->realname)
free (server_info->realname);
if (server_info->command)
free (server_info->command);
if (server_info->autojoin)
free (server_info->autojoin);
if (server_info->notify_levels)
free (server_info->notify_levels);
if (server_info->charset_decode_iso)
free (server_info->charset_decode_iso);
if (server_info->charset_decode_utf)
free (server_info->charset_decode_utf);
if (server_info->charset_encode)
free (server_info->charset_encode);
if (server_info->nick)
free (server_info->nick);
new_server_info = server_info->next_server;
free (server_info);
server_info = new_server_info;
}
}
/*
* weechat_plugin_get_channel_info: get list of channel info from a server
*/
t_plugin_channel_info *
weechat_plugin_get_channel_info (t_weechat_plugin *plugin, char *server)
{
t_plugin_channel_info *channel_info, *last_channel_info, *new_channel_info;
t_irc_channel *ptr_channel, *ptr_channels;
t_irc_server *ptr_server;
if (!plugin || !server || !server[0])
return NULL;
ptr_server = server_search (server);
if (!ptr_server)
return NULL;
ptr_channels = ptr_server->channels;
if (ptr_channels)
{
channel_info = NULL;
last_channel_info = NULL;
for (ptr_channel = ptr_channels; ptr_channel; ptr_channel = ptr_channel->next_channel)
{
new_channel_info = (t_plugin_channel_info *) malloc (sizeof (t_plugin_channel_info));
if (new_channel_info)
{
new_channel_info->type = ptr_channel->type;
new_channel_info->name = (ptr_channel->name) ? strdup (ptr_channel->name) : strdup ("");
new_channel_info->topic = (ptr_channel->topic) ? strdup (ptr_channel->topic) : strdup ("");
new_channel_info->modes = (ptr_channel->modes) ? strdup (ptr_channel->modes) : strdup ("");
new_channel_info->limit = ptr_channel->limit;
new_channel_info->key = (ptr_channel->key) ? strdup (ptr_channel->key) : strdup ("");
new_channel_info->nicks_count = ptr_channel->nicks_count;
new_channel_info->prev_channel = last_channel_info;
new_channel_info->next_channel = NULL;
if (!channel_info)
channel_info = new_channel_info;
else
last_channel_info->next_channel = new_channel_info;
last_channel_info = new_channel_info;
}
}
return channel_info;
}
return NULL;
}
/*
* weechat_plugin_free_channel_info: free channel info struct list
*/
void
weechat_plugin_free_channel_info (t_weechat_plugin *plugin, t_plugin_channel_info *channel_info)
{
t_plugin_channel_info *new_channel_info;
if (!plugin || !channel_info)
return;
while (channel_info)
{
if (channel_info->name)
free (channel_info->name);
if (channel_info->topic)
free (channel_info->topic);
if (channel_info->modes)
free (channel_info->modes);
if (channel_info->key)
free (channel_info->key);
new_channel_info = channel_info->next_channel;
free (channel_info);
channel_info = new_channel_info;
}
}
/*
* weechat_plugin_get_nick_info: get list of nick info from a server/channel
*/
t_plugin_nick_info *
weechat_plugin_get_nick_info (t_weechat_plugin *plugin, char *server, char *channel)
{
t_plugin_nick_info *nick_info, *last_nick_info, *new_nick_info;
t_irc_nick *ptr_nick, *ptr_nicks;
t_irc_channel *ptr_channel;
t_irc_server *ptr_server;
if (!plugin || !server || !server[0] || !channel || !channel[0])
return NULL;
ptr_server = server_search (server);
if (!ptr_server)
return NULL;
ptr_channel = channel_search (ptr_server, channel);
if (!ptr_channel)
return NULL;
ptr_nicks = ptr_channel->nicks;
if (ptr_nicks)
{
nick_info = NULL;
last_nick_info = NULL;
for (ptr_nick = ptr_nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
new_nick_info = (t_plugin_nick_info *) malloc (sizeof (t_plugin_nick_info));
if (new_nick_info)
{
new_nick_info->nick = (ptr_nick->nick) ? strdup (ptr_nick->nick) : strdup ("");
new_nick_info->flags = ptr_nick->flags;
new_nick_info->prev_nick = last_nick_info;
new_nick_info->next_nick = NULL;
if (!nick_info)
nick_info = new_nick_info;
else
last_nick_info->next_nick = new_nick_info;
last_nick_info = new_nick_info;
}
}
return nick_info;
}
return NULL;
}
/*
* weechat_plugin_free_nick_info: free nick info struct list
*/
void
weechat_plugin_free_nick_info (t_weechat_plugin *plugin, t_plugin_nick_info *nick_info)
{
t_plugin_nick_info *new_nick_info;
if (!plugin || !nick_info)
return;
while (nick_info)
{
if (nick_info->nick)
free (nick_info->nick);
new_nick_info = nick_info->next_nick;
free (nick_info);
nick_info = new_nick_info;
}
}
+143 -21
View File
@@ -51,7 +51,7 @@ t_weechat_plugin *last_weechat_plugin = NULL;
* plugin_find_server_channel: find server/channel for command execution
*/
void
int
plugin_find_server_channel (char *server, char *channel,
t_irc_server **ptr_server,
t_irc_channel **ptr_channel)
@@ -70,7 +70,11 @@ plugin_find_server_channel (char *server, char *channel,
else
{
if (server && server[0])
{
(*ptr_server) = server_search (server);
if (!(*ptr_server))
return -1;
}
else
{
(*ptr_server) = SERVER(gui_current_window->buffer);
@@ -82,8 +86,11 @@ plugin_find_server_channel (char *server, char *channel,
{
if ((*ptr_server))
(*ptr_channel) = channel_search ((*ptr_server), channel);
if (!(*ptr_channel))
return -1;
}
}
return 0;
}
/*
@@ -192,6 +199,9 @@ plugin_msg_handler_add (t_weechat_plugin *plugin, char *irc_command,
new_handler->description = NULL;
new_handler->arguments = NULL;
new_handler->arguments_description = NULL;
new_handler->completion_template = NULL;
new_handler->interval = 0;
new_handler->remaining = 0;
new_handler->handler = handler_func;
new_handler->handler_args = (handler_args) ? strdup (handler_args) : NULL;
new_handler->handler_pointer = handler_pointer;
@@ -263,6 +273,8 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
new_handler->arguments = (arguments) ? strdup (arguments) : NULL;
new_handler->arguments_description = (arguments_description) ? strdup (arguments_description) : NULL;
new_handler->completion_template = (completion_template) ? strdup (completion_template) : NULL;
new_handler->interval = 0;
new_handler->remaining = 0;
new_handler->handler = handler_func;
new_handler->handler_args = (handler_args) ? strdup (handler_args) : NULL;
new_handler->handler_pointer = handler_pointer;
@@ -292,6 +304,62 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
return new_handler;
}
/*
* plugin_timer_handler_add: add a timer handler
* arguments:
* 1. the plugin pointer
* 2. the interval between two calls
* 3. the handler function
* 4. handler args: a string given to
* handler when called (used by scripts)
* 5. handler pointer: a pointer given to
* handler when called (used by scripts)
*/
t_plugin_handler *
plugin_timer_handler_add (t_weechat_plugin *plugin, int interval,
t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)
{
t_plugin_handler *new_handler;
new_handler = (t_plugin_handler *)malloc (sizeof (t_plugin_handler));
if (new_handler)
{
new_handler->type = HANDLER_TIMER;
new_handler->irc_command = NULL;
new_handler->command = NULL;
new_handler->description = NULL;
new_handler->arguments = NULL;
new_handler->arguments_description = NULL;
new_handler->completion_template = NULL;
new_handler->interval = interval;
new_handler->remaining = interval;
new_handler->handler = handler_func;
new_handler->handler_args = (handler_args) ? strdup (handler_args) : NULL;
new_handler->handler_pointer = handler_pointer;
new_handler->running = 0;
/* add new handler to list */
new_handler->prev_handler = plugin->last_handler;
new_handler->next_handler = NULL;
if (plugin->handlers)
(plugin->last_handler)->next_handler = new_handler;
else
plugin->handlers = new_handler;
plugin->last_handler = new_handler;
}
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin %s: unable to add timer handler (not enough memory)\n"),
WEECHAT_ERROR, plugin->name);
return NULL;
}
return new_handler;
}
/*
* plugin_msg_handler_exec: execute a message handler
* return: code for informing WeeChat whether message
@@ -344,7 +412,8 @@ plugin_msg_handler_exec (char *server, char *irc_command, char *irc_message)
/*
* plugin_cmd_handler_exec: execute a command handler
* return: 1 if handler executed, 0 if no handler found
* return: 1 if handler executed, 0 if failed,
* -1 if no handler found
*/
int
@@ -379,7 +448,50 @@ plugin_cmd_handler_exec (char *server, char *command, char *arguments)
}
}
return 0;
return -1;
}
/*
* plugin_timer_handler_exec: check timer handlers and execute functions if needed
* return: PLUGIN_RC_OK if all ok
* PLUGIN_RC_KO if at least one handler failed
*/
int
plugin_timer_handler_exec ()
{
t_weechat_plugin *ptr_plugin;
t_plugin_handler *ptr_handler;
int return_code, final_return_code;
final_return_code = PLUGIN_RC_OK;
for (ptr_plugin = weechat_plugins; ptr_plugin;
ptr_plugin = ptr_plugin->next_plugin)
{
for (ptr_handler = ptr_plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
{
if (ptr_handler->type == HANDLER_TIMER)
{
ptr_handler->remaining--;
if (ptr_handler->remaining <= 0)
{
return_code = ((int) (ptr_handler->handler) (ptr_plugin,
"",
"",
"",
ptr_handler->handler_args,
ptr_handler->handler_pointer));
ptr_handler->remaining = ptr_handler->interval;
if (return_code == PLUGIN_RC_KO)
final_return_code = PLUGIN_RC_KO;
}
}
}
}
return final_return_code;
}
/*
@@ -613,11 +725,14 @@ plugin_load (char *filename)
new_plugin->exec_on_files = &weechat_plugin_exec_on_files;
new_plugin->msg_handler_add = &weechat_plugin_msg_handler_add;
new_plugin->cmd_handler_add = &weechat_plugin_cmd_handler_add;
new_plugin->timer_handler_add = &weechat_plugin_timer_handler_add;
new_plugin->handler_remove = &weechat_plugin_handler_remove;
new_plugin->handler_remove_all = &weechat_plugin_handler_remove_all;
new_plugin->printf = &weechat_plugin_printf;
new_plugin->printf_server = &weechat_plugin_printf_server;
new_plugin->infobar_printf = &weechat_plugin_infobar_printf;
new_plugin->print = &weechat_plugin_print;
new_plugin->print_server = &weechat_plugin_print_server;
new_plugin->print_infobar = &weechat_plugin_print_infobar;
new_plugin->infobar_remove = &weechat_plugin_infobar_remove;
new_plugin->log = &weechat_plugin_log;
new_plugin->exec_command = &weechat_plugin_exec_command;
new_plugin->get_info = &weechat_plugin_get_info;
new_plugin->get_dcc_info = &weechat_plugin_get_dcc_info;
@@ -626,6 +741,12 @@ plugin_load (char *filename)
new_plugin->set_config = &weechat_plugin_set_config;
new_plugin->get_plugin_config = &weechat_plugin_get_plugin_config;
new_plugin->set_plugin_config = &weechat_plugin_set_plugin_config;
new_plugin->get_server_info = &weechat_plugin_get_server_info;
new_plugin->free_server_info = &weechat_plugin_free_server_info;
new_plugin->get_channel_info = &weechat_plugin_get_channel_info;
new_plugin->free_channel_info = &weechat_plugin_free_channel_info;
new_plugin->get_nick_info = &weechat_plugin_get_nick_info;
new_plugin->free_nick_info = &weechat_plugin_free_nick_info;
/* handlers */
new_plugin->handlers = NULL;
@@ -709,7 +830,8 @@ int plugin_auto_load_file (t_weechat_plugin *plugin, char *filename)
void plugin_auto_load ()
{
char *ptr_home, *dir_name, *list_plugins, *pos, *pos2;
char *ptr_home, *dir_name, *plugins_path, *plugins_path2;
char *list_plugins, *pos, *pos2;
if (cfg_plugins_autoload && cfg_plugins_autoload[0])
{
@@ -718,20 +840,20 @@ void plugin_auto_load ()
/* auto-load plugins in WeeChat home dir */
if (cfg_plugins_path && cfg_plugins_path[0])
{
if (cfg_plugins_path[0] == '~')
{
ptr_home = getenv ("HOME");
dir_name = (char *)malloc (strlen (cfg_plugins_path) + strlen (ptr_home) + 2);
if (dir_name)
{
strcpy (dir_name, ptr_home);
strcat (dir_name, cfg_plugins_path + 1);
plugin_exec_on_files (NULL, dir_name, &plugin_auto_load_file);
free (dir_name);
}
}
else
plugin_exec_on_files (NULL, cfg_plugins_path, &plugin_auto_load_file);
ptr_home = getenv ("HOME");
plugins_path = weechat_strreplace (cfg_plugins_path, "~", ptr_home);
plugins_path2 = weechat_strreplace ((plugins_path) ?
plugins_path : cfg_plugins_path,
"%h", weechat_home);
plugin_exec_on_files (NULL,
(plugins_path2) ?
plugins_path2 : ((plugins_path) ?
plugins_path : cfg_plugins_path),
&plugin_auto_load_file);
if (plugins_path)
free (plugins_path);
if (plugins_path2)
free (plugins_path2);
}
/* auto-load plugins in WeeChat global lib dir */
+6 -2
View File
@@ -31,8 +31,8 @@ typedef void (t_weechat_end_func) (t_weechat_plugin *);
extern t_weechat_plugin *weechat_plugins;
extern t_weechat_plugin *last_weechat_plugin;
extern void plugin_find_server_channel (char *, char *,
t_irc_server **, t_irc_channel **);
extern int plugin_find_server_channel (char *, char *,
t_irc_server **, t_irc_channel **);
extern void plugin_exec_on_files (t_weechat_plugin *, char *,
int (*)(t_weechat_plugin *, char *));
extern t_weechat_plugin *plugin_search (char *);
@@ -44,8 +44,12 @@ extern t_plugin_handler *plugin_cmd_handler_add (t_weechat_plugin *, char *,
char *,
t_plugin_handler_func *,
char *, void *);
extern t_plugin_handler *plugin_timer_handler_add (t_weechat_plugin *, int,
t_plugin_handler_func *,
char *, void *);
extern int plugin_msg_handler_exec (char *, char *, char *);
extern int plugin_cmd_handler_exec (char *, char *, char *);
extern int plugin_timer_handler_exec ();
extern void plugin_handler_remove (t_weechat_plugin *,
t_plugin_handler *);
extern void plugin_handler_remove_all (t_weechat_plugin *);
+5 -1
View File
@@ -34,4 +34,8 @@ if PLUGIN_RUBY
ruby_dir = ruby
endif
SUBDIRS = . $(perl_dir) $(python_dir) $(ruby_dir)
if PLUGIN_LUA
lua_dir = lua
endif
SUBDIRS = . $(perl_dir) $(python_dir) $(ruby_dir) $(lua_dir)
+26
View File
@@ -0,0 +1,26 @@
# Copyright (c) 2003-2006 FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(LUA_CFLAGS)
libdir = ${weechat_libdir}/plugins
lib_LTLIBRARIES = liblua.la
liblua_la_SOURCES = weechat-lua.c
liblua_la_LDFLAGS = -module
liblua_la_LIBADD = ../lib_weechat_plugins_scripts.la $(LUA_LFLAGS)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+84 -1
View File
@@ -84,6 +84,62 @@ weechat_script_search (t_weechat_plugin *plugin,
return NULL;
}
/*
* weechat_script_search_full_name: search the full path name of a script
*/
char *
weechat_script_search_full_name (t_weechat_plugin *plugin,
char *language, char *filename)
{
char *final_name, *dir_home, *dir_system;
int length;
struct stat st;
if ((strstr(filename, "/")) || (strstr(filename, "\\")))
return strdup(filename);
/* try WeeChat user's dir */
dir_home = plugin->get_info (plugin, "weechat_dir", NULL);
if (dir_home)
{
length = strlen (dir_home) + strlen (language) + strlen (filename) + 16;
final_name = (char *) malloc (length);
if (final_name)
{
snprintf (final_name, length, "%s/%s/%s", dir_home, language, filename);
if ((stat (final_name, &st) == 0) && (st.st_size > 0))
{
free (dir_home);
return final_name;
}
free (final_name);
}
free (dir_home);
}
/* try WeeChat system dir */
dir_system = plugin->get_info (plugin, "weechat_sharedir", NULL);
if (dir_system)
{
length = strlen (dir_system) + strlen (dir_system) + strlen (filename) + 16;
final_name = (char *) malloc (length);
if (final_name)
{
snprintf (final_name,length, "%s/%s/%s", dir_system, language, filename);
if ((stat (final_name, &st) == 0) && (st.st_size > 0))
{
free (dir_system);
return final_name;
}
free (final_name);
}
free (dir_system);
}
return NULL;
}
/*
* weechat_script_add: add a script to list of scripts
*/
@@ -184,7 +240,7 @@ weechat_script_remove_handler (t_weechat_plugin *plugin,
t_plugin_handler *ptr_handler, *next_handler;
char *ptr_arg1;
/* search and remove message handlers */
/* search and remove handlers */
ptr_handler = plugin->handlers;
while (ptr_handler)
{
@@ -208,6 +264,33 @@ weechat_script_remove_handler (t_weechat_plugin *plugin,
}
}
/*
* weechat_script_remove_timer_handler: remove a timer handler for a script
*/
void
weechat_script_remove_timer_handler (t_weechat_plugin *plugin,
t_plugin_script *script,
char *function)
{
t_plugin_handler *ptr_handler, *next_handler;
/* search and remove timer handlers */
ptr_handler = plugin->handlers;
while (ptr_handler)
{
if (((t_plugin_script *)ptr_handler->handler_pointer == script)
&& (plugin->ascii_strcasecmp (plugin, ptr_handler->handler_args, function) == 0))
{
next_handler = ptr_handler->next_handler;
plugin->handler_remove (plugin, ptr_handler);
ptr_handler = next_handler;
}
else
ptr_handler = ptr_handler->next_handler;
}
}
/*
* weechat_script_get_plugin_config: get a value of a script option
* format in file is: plugin.script.option=value
+5
View File
@@ -43,6 +43,8 @@ extern void weechat_script_auto_load (t_weechat_plugin *, char *,
int (*)(t_weechat_plugin *, char *));
extern t_plugin_script *weechat_script_search (t_weechat_plugin *,
t_plugin_script **, char *);
extern char *weechat_script_search_full_name (t_weechat_plugin *,
char *, char *);
extern t_plugin_script *weechat_script_add (t_weechat_plugin *,
t_plugin_script **, char *, char *,
char *, char *, char *);
@@ -51,6 +53,9 @@ extern void weechat_script_remove (t_weechat_plugin *,
extern void weechat_script_remove_handler (t_weechat_plugin *,
t_plugin_script *,
char *, char *);
extern void weechat_script_remove_timer_handler (t_weechat_plugin *,
t_plugin_script *,
char *);
extern char *weechat_script_get_plugin_config (t_weechat_plugin *,
t_plugin_script *,
char *);
+101 -8
View File
@@ -60,6 +60,69 @@ struct t_plugin_dcc_info
t_plugin_dcc_info *next_dcc; /* link to next dcc file/chat */
};
typedef struct t_plugin_server_info t_plugin_server_info;
struct t_plugin_server_info
{
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) */
int ipv6; /* use IPv6 protocol */
int ssl; /* SSL protocol */
char *password; /* password for server */
char *nick1; /* first nickname for the server */
char *nick2; /* alternate nickname */
char *nick3; /* 2nd alternate nickname */
char *username; /* user name */
char *realname; /* real name */
char *command; /* command to run once connected */
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
char *notify_levels; /* channels notify levels */
char *charset_decode_iso; /* channels charsets for decoding ISO */
char *charset_decode_utf; /* channels charsets for decoding UTF */
char *charset_encode; /* channels charsets for encoding msgs */
int is_connected; /* 1 if WeeChat is connected to server */
int ssl_connected; /* = 1 if connected with SSL */
char *nick; /* current nickname */
int is_away; /* 1 is user is marker as away */
time_t away_time; /* time() when user marking as away */
int lag; /* lag (in milliseconds) */
t_plugin_server_info *prev_server; /* link to previous server info */
t_plugin_server_info *next_server; /* link to next server info */
};
typedef struct t_plugin_channel_info t_plugin_channel_info;
struct t_plugin_channel_info
{
int type; /* channel type */
char *name; /* name of channel (exemple: "#abc") */
char *topic; /* topic of channel (host for private) */
char *modes; /* channel modes */
int limit; /* user limit (0 is limit not set) */
char *key; /* channel key (NULL if no key is set) */
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
t_plugin_channel_info *prev_channel; /* link to previous channel info */
t_plugin_channel_info *next_channel; /* link to next channel info */
};
typedef struct t_plugin_nick_info t_plugin_nick_info;
struct t_plugin_nick_info
{
char *nick; /* nickname */
int flags; /* chanowner/chanadmin (unrealircd), */
/* op, halfop, voice, away */
t_plugin_nick_info *prev_nick; /* link to previous nick */
t_plugin_nick_info *next_nick; /* link to next nick */
};
typedef struct t_weechat_plugin t_weechat_plugin;
typedef int (t_plugin_handler_func) (t_weechat_plugin *, char *, char *, char *, char *, void *);
@@ -70,8 +133,9 @@ typedef enum t_handler_type t_handler_type;
enum t_handler_type
{
HANDLER_MESSAGE,
HANDLER_COMMAND
HANDLER_MESSAGE = 0, /* IRC message handler */
HANDLER_COMMAND, /* command handler */
HANDLER_TIMER /* timer handler */
};
typedef struct t_plugin_handler t_plugin_handler;
@@ -90,6 +154,10 @@ struct t_plugin_handler
char *arguments_description; /* (for /help) args long description */
char *completion_template; /* template for completion */
/* data for timer handler */
int interval; /* interval between two calls to fct */
int remaining; /* seconds remaining before next call */
/* data common to all handlers */
t_plugin_handler_func *handler; /* pointer to handler */
char *handler_args; /* arguments sent to handler */
@@ -135,9 +203,10 @@ struct t_weechat_plugin
void (*exec_on_files) (t_weechat_plugin *, char *,
int (*)(t_weechat_plugin *, char *));
void (*printf) (t_weechat_plugin *, char *, char *, char *, ...);
void (*printf_server) (t_weechat_plugin *, char *, ...);
void (*infobar_printf) (t_weechat_plugin *, int, char *, ...);
void (*print) (t_weechat_plugin *, char *, char *, char *, ...);
void (*print_server) (t_weechat_plugin *, char *, ...);
void (*print_infobar) (t_weechat_plugin *, int, char *, ...);
void (*infobar_remove) (t_weechat_plugin *, int);
t_plugin_handler *(*msg_handler_add) (t_weechat_plugin *, char *,
t_plugin_handler_func *,
@@ -147,6 +216,9 @@ struct t_weechat_plugin
char *,
t_plugin_handler_func *,
char *, void *);
t_plugin_handler *(*timer_handler_add) (t_weechat_plugin *, int,
t_plugin_handler_func *,
char *, void *);
void (*handler_remove) (t_weechat_plugin *, t_plugin_handler *);
void (*handler_remove_all) (t_weechat_plugin *);
@@ -158,6 +230,14 @@ struct t_weechat_plugin
int (*set_config) (t_weechat_plugin *, char *, char *);
char *(*get_plugin_config) (t_weechat_plugin *, char *);
int (*set_plugin_config) (t_weechat_plugin *, char *, char *);
t_plugin_server_info *(*get_server_info) (t_weechat_plugin *);
void (*free_server_info) (t_weechat_plugin *, t_plugin_server_info *);
t_plugin_channel_info *(*get_channel_info) (t_weechat_plugin *, char *);
void (*free_channel_info) (t_weechat_plugin *, t_plugin_channel_info *);
t_plugin_nick_info *(*get_nick_info) (t_weechat_plugin *, char*, char*);
void (*free_nick_info) (t_weechat_plugin *, t_plugin_nick_info *);
void (*log) (t_weechat_plugin *, char *, char *, char *, ...);
/* WeeChat developers: ALWAYS add new functions at the end */
};
@@ -172,9 +252,13 @@ extern void weechat_plugin_exec_on_files (t_weechat_plugin *, char *,
int (*)(t_weechat_plugin *, char *));
/* display functions */
extern void weechat_plugin_printf (t_weechat_plugin *, char *, char *, char *, ...);
extern void weechat_plugin_printf_server (t_weechat_plugin *, char *, ...);
extern void weechat_plugin_infobar_printf (t_weechat_plugin *, int, char *, ...);
extern void weechat_plugin_print (t_weechat_plugin *, char *, char *, char *, ...);
extern void weechat_plugin_print_server (t_weechat_plugin *, char *, ...);
extern void weechat_plugin_print_infobar (t_weechat_plugin *, int, char *, ...);
extern void weechat_plugin_infobar_remove (t_weechat_plugin *, int);
/* log functions */
extern void weechat_plugin_log (t_weechat_plugin *, char *, char *, char *, ...);
/* handler functions */
extern t_plugin_handler *weechat_plugin_msg_handler_add (t_weechat_plugin *, char *,
@@ -185,6 +269,9 @@ extern t_plugin_handler *weechat_plugin_cmd_handler_add (t_weechat_plugin *, cha
char *,
t_plugin_handler_func *,
char *, void *);
extern t_plugin_handler *weechat_plugin_timer_handler_add (t_weechat_plugin *, int,
t_plugin_handler_func *,
char *, void *);
extern void weechat_plugin_handler_remove (t_weechat_plugin *, t_plugin_handler *);
extern void weechat_plugin_handler_remove_all (t_weechat_plugin *);
@@ -197,5 +284,11 @@ extern char *weechat_plugin_get_config (t_weechat_plugin *, char *);
extern int weechat_plugin_set_config (t_weechat_plugin *, char *, char *);
extern char *weechat_plugin_get_plugin_config (t_weechat_plugin *, char *);
extern int weechat_plugin_set_plugin_config (t_weechat_plugin *, char *, char *);
extern t_plugin_server_info *weechat_plugin_get_server_info (t_weechat_plugin *);
extern void weechat_plugin_free_server_info (t_weechat_plugin *, t_plugin_server_info *);
extern t_plugin_channel_info *weechat_plugin_get_channel_info (t_weechat_plugin *, char *);
extern void weechat_plugin_free_channel_info (t_weechat_plugin *, t_plugin_channel_info *);
extern t_plugin_nick_info *weechat_plugin_get_nick_info (t_weechat_plugin *, char *, char *);
extern void weechat_plugin_free_nick_info (t_weechat_plugin *, t_plugin_nick_info *);
#endif /* weechat-plugin.h */
+4 -2
View File
@@ -18,7 +18,7 @@
#
%define name weechat
%define version 0.1.7
%define version 0.1.8
%define release 1
Name: %{name}
@@ -44,7 +44,7 @@ rm -rf $RPM_BUILD_ROOT
%setup
%build
./configure --prefix=/usr --mandir=/usr/share/man --enable-perl --enable-python --enable-ruby --with-debug=0
./configure --prefix=/usr --mandir=/usr/share/man --with-debug=0
make
%install
@@ -66,6 +66,8 @@ rm -rf $RPM_BUILD_ROOT
%{_docdir}/%{name}/html/*
%changelog
* Sat Mar 18 2006 FlashCode <flashcode@flashtux.org> 0.1.8-1
- Released version 0.1.8
* Sat Jan 14 2006 FlashCode <flashcode@flashtux.org> 0.1.7-1
- Released version 0.1.7
* Fri Nov 11 2005 FlashCode <flashcode@flashtux.org> 0.1.6-1
+1 -2
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2006-01-14
WeeChat known bugs, 2006-03-18
- display bugs with UTF-8 chars coded on more than 2 bytes
- divide long messages (> 512 bytes) into more messages so IRC server can
@@ -12,4 +12,3 @@ WeeChat known bugs, 2006-01-14
(cleared by each WeeChat at startup)
- WeeChat may crash if too much nicks in nicklist when position is top
or bottom
- ./configure does not check that Gtk 2.0 libraries are installed
+57 -11
View File
@@ -1,9 +1,55 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-01-14
ChangeLog - 2006-03-18
Version 0.1.8 (2006-03-18):
* improved Ruby plugin
* fixed /set command when internal server name contains one or many dots
* fixed get_info plugin API function when no server at all is opened
* fixed display bug when top of buffer is displayed and first line is
removed (according to "history_max_lines" setting)
* fixed /mode command output
* improved alias completion (now uses target command for completion)
* fixed completion problem in private with nicks
* added missing IRC command (487)
* added inactivity time, available for plugins via get_info("inactivity")
* keys alt-{home|end} to scroll top/bottom, alt-{f11-f12} to scroll
nicklist top/bottom
* added special names for plugin message handlers: weechat_pv,
weechat_highlight, weechat_ctcp, weechat_dcc
* script plugins now load scripts in WeeChat system share directory
* /msg command does not open any buffer any more
* fixed crash when using global history (when older entry is removed)
* added IRC raw data buffer (new key: alt-J + alt-R)
* fixed display bug with /kill command
* added new plugins functions: add_timer_handler, remove_timer_handler,
remove_infobar
* plugin messages handlers now called when message is ignored (by /ignore)
* new behaviour for messages ignored by a message handler: now WeeChat
executes standard handler, treating message as "ignored"
* many commands allowed for aliases
* many commands allowed when connecting to server
* added Lua script plugin
* added functions in plugins API: get_server_info, free_server_info,
get_channel_info, free_channel_info, get_nick_info, free_nick_info
* added option "look_nick_complete_first" (patch from Gwenn)
* added option "look_open_near_server" (patch from Gwenn)
* fixed bug with /upgrade and servers buffer
* fixed bug with "get_dcc_info" plugin interface function
* added new scroll keys for a few lines up/down (default: meta-pgup/pgdn)
(patch from Pistos)
* added new option "irc_away_check_max_nicks" to disable away check on
channels with high number of nicks (patch from Gwenn)
* added new command line argument for setting WeeChat homedir (-d or --dir)
(patch from Gwenn)
* fixed bug with charset in infobar highlights
* fixed bug with buffer detection in plugins/scripts commands
* fixed bug with /history command
* added option "irc_show_away_once", to show away message only once in pv
* added partial hungarian translation
Version 0.1.7 (2006-01-14):
* fixed msg command (now allowed in private buffer with "*" as target)
* removed "irc_default_msg_away" setting, for RFC 2812 conformity
@@ -22,7 +68,7 @@ Version 0.1.7 (2006-01-14):
* added server/channel arg to /buffer command for jumping to buffer
* fixed display bug in chat window when a message length equals to window
width
* added new keys for switching to other windows: alt-w followed by
* added new keys for switching to other windows: alt-W followed by
alt-{arrow}
* added new keys for scrolling to previous/next highlight: alt-P / alt-N
* added "read marker": an indicator for first unread line in a
@@ -97,7 +143,7 @@ Version 0.1.4 (2005-07-30):
* topic completion now decodes UTF-8 string
* fixed bug with IRC URL on command line (irc://)
* new keyboard management: keys are setup in config file, new command
/key was added and some new default keys were added, alt-k key is
/key was added and some new default keys were added, alt-K key is
used to grab key (useful for /key command)
* added seconds in infobar time (optional thanks to new setting)
* fixed some curses refreshs
@@ -123,14 +169,14 @@ Version 0.1.3 (2005-07-02):
* fixed plugins "print" and "prnt" functions: now ok for writing on server
buffers
* fixed color problem with new libcurses version
* fixed crash when using Alt-S or Alt-X on DCC buffer (Alt-D)
* fixed crash when using alt-S or alt-X on DCC buffer (alt-D)
* fixed startup crash when config file (~/.weechat/weechat.rc) is not found
* improved Perl/Python libs detection for ./configure script
Version 0.1.2 (2005-05-21):
* added Python plugin support, improved Perl interface (and now Perl/Python
libraries are checked by configure script)
* added nicklist scroll keys (Alt+{home/end/pgup/pgdn} or F11/F12)
* added nicklist scroll keys (alt+{home/end/pgup/pgdn} or F11/F12)
* added transfer rate for DCC files
* added "-all" option for /nick command
* buffers timestamp can now be changed (new option in config file)
@@ -199,8 +245,8 @@ Version 0.0.9 (2005-01-01):
* 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
* 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)
@@ -217,15 +263,15 @@ Version 0.0.8 (2004-10-30):
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)
* 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)
* added key for redrawing terminal (ctrl-L)
* added key for clearing hotlist (alt-R)
Version 0.0.7 (2004-08-08):
* new "col_status_delimiters" config option
* /buffer command added, buffers ordered by number, auto-jump to active
buffers (alt-a), jump to buffers by number (alt-number)
buffers (alt-A), jump to buffers by number (alt-number)
* /window command added, split terminal horizontally/vertically
* unique color for each nick (based on nickname)
* action messages are now considered as messages, not crappy joins/parts
+21 -6
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2006-01-14
WeeChat FAQ, 2006-03-18
=======================
Intended audience:
@@ -53,7 +53,7 @@ A: Because WeeChat is very light and has new features.
* many GUI (Curses, Gtk, wxWidgets, Qt)
* available in many languages
* nicklist available in all GUI
* extensible with scripts (Perl, Python, Ruby)
* extensible with plugins (C, Perl, Python, Ruby, Lua)
* horizontal and vertical window split
* infobar highlight
* FIFO pipe for remote control
@@ -95,42 +95,57 @@ A: Key bindings are customizable with /key command.
2.5
================================================================================
Q: How can I load Perl scripts?
Are Perl scripts compatible with X-chat or/and Irssi ?
Are Perl scripts compatible with other IRC clients ?
A: You can use /perl command to load scripts (default path is
~/.weechat/perl).
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
when WeeChat is starting up.
Perl scripts are not compatible with other IRC clients.
2.6
================================================================================
Q: How can I load Python scripts?
Are Python scripts compatible with X-chat or/and Irssi ?
Are Python scripts compatible with other IRC clients ?
A: You can use /python command to load scripts (default path is
~/.weechat/python).
Note that scripts in ~/.weechat/python/autoload are automatically loaded
when WeeChat is starting up.
Python scripts are not compatible with other IRC clients.
2.7
================================================================================
Q: How can I load Ruby scripts?
Are Ruby scripts compatible with other IRC clients ?
A: You can use /ruby command to load scripts (default path is
~/.weechat/ruby).
Note that scripts in ~/.weechat/ruby/autoload are automatically loaded
when WeeChat is starting up.
Ruby scripts are not compatible with other IRC clients.
2.8
================================================================================
Q: How can I load Lua scripts?
Are Lua scripts compatible with other IRC clients ?
A: You can use /lua command to load scripts (default path is
~/.weechat/lua).
Note that scripts in ~/.weechat/lua/autoload are automatically loaded
when WeeChat is starting up.
Lua scripts are not compatible with other IRC clients.
3.1
================================================================================
Q: How should I report bugs?
A: There is 3 ways to report bugs:
1. you can join us on IRC: irc.freenode.net, channel #weechat
2. you can submit your bug at this url:
2. you can submit your bug at this URL:
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
3. you can mail your problem, look at support page for developer's mails:
http://weechat.flashtux.org/support.php
@@ -143,7 +158,7 @@ Q: How should I submit patches?
A: There is 3 ways to submit patches:
1. you can join us on IRC: irc.freenode.net, channel #weechat
2. you can submit your patch at this url:
2. you can submit your patch at this URL:
http://savannah.nongnu.org/patch/?func=addpatch&group=weechat
3. you can mail your patch, look at support page for developer's mails:
http://weechat.flashtux.org/support.php
+21 -5
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2006-01-14
WeeChat FAQ, 2006-03-18
=======================
Public concerné :
@@ -56,7 +56,7 @@ R: Parce que WeeChat est tr
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt)
* disponible en plusieurs langues
* liste des pseudos disponible dans toutes les interfaces
* extensible par des scripts (Perl, Python, Ruby)
* extensible par des extensions (C, Perl, Python, Ruby, Lua)
* découpage de la fenêtre horizontalement et verticalement
* highlight dans la barre d'infos
* tube FIFO pour contrôle à distance
@@ -100,33 +100,49 @@ R: Les raccourcis clavier sont modifiables avec la commande /key.
2.5
================================================================================
Q: Comment puis-je charger des scripts Perl ?
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
Les scripts Perl sont-ils compatibles avec d'autres clients IRC ?
R: La commande /perl permet de charger les scripts Perl (le chemin par défaut
est ~/.weechat/perl).
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Perl ne sont pas compatibles avec d'autres clients IRC.
2.6
================================================================================
Q: Comment puis-je charger les scripts Python ?
Les scripts Python sont-ils compatibles avec X-chat et/ou Irssi ?
Les scripts Python sont-ils compatibles avec d'autres clients IRC ?
R: La commande /python permet de charger les scripts Python (le chemin par
défaut est ~/.weechat/python).
Notez que les scripts dans ~/.weechat/python/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Python ne sont pas compatibles avec d'autres clients IRC.
2.7
================================================================================
Q: Comment puis-je charger des scripts Ruby ?
Les scripts Ruby sont-ils compatibles avec d'autres clients IRC ?
R: La commande /ruby permet de charger les scripts Ruby (le chemin par
défaut est ~/.weechat/ruby).
Notez que les scripts dans ~/.weechat/ruby/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Ruby ne sont pas compatibles avec d'autres clients IRC.
2.8
================================================================================
Q: Comment puis-je charger des scripts Lua ?
Les scripts Lua sont-ils compatibles avec d'autres clients IRC ?
R: La commande /lua permet de charger les scripts Lua (le chemin par
défaut est ~/.weechat/lua).
Notez que les scripts dans ~/.weechat/lua/autoload sont automatiquement
chargés par WeeChat lorsqu'il démarre.
Les scripts Lua ne sont pas compatibles avec d'autres clients IRC.
3.1
@@ -137,7 +153,7 @@ R: Il y a 3 mani
1. vous pouvez nous joindre sur IRC: irc.freenode.net, canal #weechat
2. vous pouvez soumettre votre bug à cette adresse :
http://savannah.nongnu.org/bugs/?func=addbug&group=weechat
3. vous pouvez envoyer votre problem par mail, consultez la page
3. vous pouvez envoyer votre problème par mail, consultez la page
support pour les mails des développeurs :
http://weechat.flashtux.org/support.php
(vous pouvez souscrire et envoyer à la liste de diffusion
+2 -6
View File
@@ -2,11 +2,7 @@ WeeChat - Installation instructions
===================================
1) Run './configure'
options: --enable-perl : enable Perl scripts
--disable-curses : do not build Curses interface
--enable-gtk : build Gtk+ interface (under development!)
--enable-qt : build Qt interface (not developed!)
--with-debug=X : X=1 for debug compilation, 2 for debug messages
(./configure --help so see options)
2) Run 'make'
@@ -14,4 +10,4 @@ WeeChat - Installation instructions
4) Enjoy ! :-)
See AUTHORS for support, feel free to contact us for any problem ;)
See AUTHORS for support, feel free to contact us for any problem.
+18
View File
@@ -1,6 +1,24 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2006-03-03 (draft)
Important release notes for 0.1.8 (draft):
- it is recommended for users of version 0.1.7 (or any older), to
replace values in setup file (~/.weechat/weechat.rc) :
- option: log_path: replace "~/.weechat/logs" by "%h/logs"
- option: plugins_path: replace "~/.weechat/plugins" by "%h/plugins"
"%h" is replaced by WeeChat home (default: ~/.weechat, may be overriden
by new command line arg --dir)
- after installing 0.1.8 (or with /upgrade), issue both commands (if you
didn't redefined these keys (alt-home/end):
/key unbind meta-meta2-1~
/key unbind meta-meta2-4~
then launch again WeeChat (or issue /upgrade).
Alt-home/end were used for nicklist scroll, they're now replaced by
Alt-F11/F12.
* FlashCode, 2006-01-14
WeeChat 0.1.7 released.
+3 -4
View File
@@ -12,10 +12,10 @@ Features
* IRC chat client with multi-server connection
* many GUI (curses, Gtk, Qt) (1)
* small, fast and very light
* customizable and extensible with plugins (scripts Perl, Python, Ruby) (2)
* customizable and extensible with plugins (C, Perl, Python, Ruby, Lua)
* compliant with RFC 1459,2810,2811,2812,2813
* developed from scratch
* multi-platform (GNU/Linux, *BSD, Mac OS X, QNX, Windows & other) (3)
* multi-platform (GNU/Linux, *BSD, Mac OS X, QNX, Windows & other) (2)
* 100% GPL & free
@@ -44,5 +44,4 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
---
(1) only Curses interface is available today
(2) only Perl and Python plugins are available today
(3) Windows is under construction
(2) Windows version is under construction
+20 -22
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
TODO - 2006-01-14
TODO - 2006-03-18
Legend:
# done
@@ -19,8 +19,6 @@ Legend:
? Qt GUI
+ internationalization (traduce WeeChat in many languages)
- add dark colors (demi intensity)
# color for nicks (except own nick) when nick colors are disabled
# allow decode/encode charsets for servers or chan (not globally)
- understand incomplete commands if unambigous (for example: /he for /help is ok)
- interpret 'old-school' special chars in messages: *bold* _underline_ /italic/
- minimal width of nick in text area
@@ -28,28 +26,29 @@ Legend:
- add "*" on the side of message buffer when alt-j or other meta modifier is on
- completion with tab key for all words starting with "#" by opened chans names
- completion when input line is empty should add last nick that wrote to me
- open new channels near server (not at the end of buffers)
# open new channels near server (not at the end of buffers)
- add filename completion (for example with /dcc send)
- have only one info_bar common to all windows
- be able to search in history and global history (as with <Ctrl+r> in bash)
* WeeChat commands
- be able to bind a key on more than one command
- be able to make an alias running more than one command
# be able to make an alias running more than one command
- host with "*" possible with /ignore command
- "/completion" command: do shortcuts (for example when we type "u"
in the text bar it send it to the server as "you")
- "/last": command to look for text in previous messages
# completion system for scripts arguments
# "/upgrade" command: reload WeeChat himself without disconnecting from server
- get help on config settings with /help option instead of /set option (since
many options can be displayed and help is not displayed in this case)
- "/cycle": do a /part then /join on current channel
- be able to save the current buffer with a single command
(/buffer dump /path/to/file), or to make it possible to write a script
that does so (see plugins)
- "/reconnect": reconnect to all servers, without waiting for auto-reconnect delay after disconnection
- "/reconnect": reconnect to all servers, without waiting for
auto-reconnect delay after disconnection
- save hotlist when doing /upgrade
* IRC protocol:
# customizable CTCP version reply (possible by plugin script)
- complete "/list" command: add regexp search, display only channels that
match regexp
- when we're away, WeeChat should log all the lines begenning by our nick.
@@ -57,16 +56,17 @@ Legend:
- "/notify" and "/unnotify" command to be warn by WeeChat when a given
nick/host connect to the given irc network
- display one time away message of remote user in private (optional)
- add max number of nicks for away check (do not check away nicks on channels with high number of nicks)
# add max number of nicks for away check (do not check away nicks on
channels with high number of nicks)
- add anti-flood mechanism, when pasting more than N lines
- add mask for /ban command, and ban types (host, nick)
* Configuration:
- be able to launch more than one command when connecting to server
- use ~/.weechat/dcc by default for DCC incoming files (and create
# be able to launch more than one command when connecting to server
# use ~/.weechat/dcc by default for DCC incoming files (and create
directory at startup if not found)
- add global username/realname, used if server values are not filled
- add command line arg (--dir ?) to choose weechat home dir
# add command line arg (--dir) to choose weechat home dir
(~/.weechat by default)
- be able to set more than one server address for network
- save buffer numbers (order) to config file and restore them when
@@ -74,20 +74,18 @@ Legend:
* Plugins:
- allow print function to write on all buffers or all channels of a server
- Ruby plugin
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
- add "outgoing" message event so scripts can edit user-input text before
it is sent to the channel
- add a timer function so scripts can do things like timeouts, delayed
# add a timer function so scripts can do things like timeouts, delayed
processing, etc.
- allow print function to write on all buffers or all channels of a server
- allow plugins to perform actions on "highlight" messages
- get_servers(), get_channels(server), get_nicks(server,channel)
- Lua plugin
- Tcl plugin
- Php plugin (maybe if possible)
# allow plugins to perform actions on "highlight" messages
# get_servers(), get_channels(server), get_nicks(server,channel)
# Lua plugin
? Tcl plugin
? Php plugin (maybe if possible)
? "fish" plugin (cf http://fish.sekure.us/)
- script plugins (perl, python, ruby, ..) should load scripts in system dir,
# script plugins (perl, python, ruby, ..) should load scripts in system dir,
not only ~/.weechat/xxxx/autoload/
- allow plugins to get the contents of a specified (or at least the
"current") buffer.
+283 -137
View File
@@ -19,10 +19,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT(WeeChat, 0.1.7, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.1.8, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.7])
AM_INIT_AUTOMAKE([weechat], [0.1.8])
# Checks for programs
AC_PROG_CC
@@ -46,7 +46,7 @@ solaris*)
esac
# Gettext
ALL_LINGUAS="fr es cs"
ALL_LINGUAS="fr es cs hu"
AM_GNU_GETTEXT
# Checks for libraries
@@ -89,6 +89,7 @@ AH_VERBATIM([PLUGINS], [#undef PLUGINS])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([DEBUG], [#undef DEBUG])
@@ -96,24 +97,20 @@ AH_VERBATIM([DEBUG], [#undef DEBUG])
AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes)
AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=no wxwidgets)],enable_wxwidgets=$enableval,enable_wxwidgets=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk+ interface (default=no Gtk+)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=no Gtk)],enable_gtk=$enableval,enable_gtk=no)
AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=no Qt)],enable_qt=$enableval,enable_qt=no)
AC_ARG_ENABLE(plugins, [ --disable-plugins Turn off plugins support (default=plugins enabled)],enable_plugins=$enableval,enable_plugins=yes)
AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl script plugin (default=no Perl plugin)],enable_perl=$enableval,enable_perl=no)
AC_ARG_ENABLE(python, [ --enable-python Turn on Python script plugin (default=no Python plugin)],enable_python=$enableval,enable_python=no)
AC_ARG_ENABLE(ruby, [ --enable-ruby Turn on Ruby script plugin (default=no Ruby script)],enable_ruby=$enableval,enable_ruby=no)
AC_ARG_ENABLE(perl, [ --disable-perl Turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes)
AC_ARG_ENABLE(python, [ --disable-python Turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes)
AC_ARG_ENABLE(ruby, [ --disable-ruby Turn off Ruby script plugin (default=compiled if found)],enable_ruby=$enableval,enable_ruby=yes)
AC_ARG_ENABLE(lua, [ --disable-lua Turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes)
AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, Lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='')
AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, Lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='')
AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG Lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='')
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGINS, test "$enable_plugins" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
not_found=""
# ------------------------------------------------------------------------------
# GUI
@@ -122,14 +119,17 @@ AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
if test "x$enable_ncurses" = "xyes" ; then
if test "$LIBNCURSESW_FOUND" = "0" ; then
if test "$LIBNCURSES_FOUND" = "0" ; then
AC_MSG_ERROR([
AC_MSG_WARN([
*** ncurses library not found!
*** Please install ncurses library or run ./configure with --disable-ncurses parameter.])
fi
AC_MSG_WARN([
*** WeeChat will be built without ncurses support.])
enable_ncurses="no"
not_found="$not_found ncurses"
else
AC_MSG_WARN([
*** ncursesw library not found! Falling back to "ncurses"
*** Be careful, UTF-8 display may not work properly if your locale is UTF-8.])
NCURSES_LIBS="-lncurses"
NCURSES_LIBS="-lncurses"
fi
else
NCURSES_LIBS="-lncursesw"
AC_CHECK_HEADERS(ncursesw/curses.h)
@@ -163,13 +163,19 @@ fi
#fi
if test "x$enable_gtk" = "xyes" ; then
#if test "$LIBGTK_FOUND" = "0" ; then
# AC_MSG_ERROR([Gtk+ library not found! Install Gtk+ (2.0 or higher) library or run ./configure without --enable-gtk parameter.])
#fi
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
GTK_LIBS=`pkg-config --libs gtk+-2.0`
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AM_PATH_GTK_2_0(2.4.0, LIBGTK_FOUND=1, LIBGTK_FOUND=0)
if test "$LIBGTK_FOUND" = "0" ; then
AC_MSG_WARN([
*** Gtk library not found!
*** WeeChat will be built without Gtk support.])
enable_gtk="no"
not_found="$not_found gtk"
else
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
GTK_LIBS=`pkg-config --libs gtk+-2.0`
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
fi
fi
# ------------------------------------------------------------------------------
@@ -183,40 +189,45 @@ if test "x$enable_perl" = "xyes" ; then
AC_PATH_PROGS(PERL, perl perl5)
if test -z $PERL ; then
AC_MSG_ERROR([
*** Perl must be installed on your system
*** but perl interpreter couldn't be found in path.
Please check that perl is in path, or install
it with your software package manager.])
fi
AC_MSG_CHECKING(for Perl headers files)
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
AC_MSG_WARN([
*** Perl must be installed on your system but perl interpreter couldn't be found in path.
*** Please check that perl is in path, or install it with your software package manager.
*** WeeChat will be built without Perl support.])
enable_perl="no"
not_found="$not_found perl"
else
AC_MSG_ERROR([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.])
fi
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
else
AC_MSG_ERROR([
AC_MSG_CHECKING(for Perl headers files)
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_HEADER_TEST" = "x0" ; then
PERL_CFLAGS=`$PERL -MExtUtils::Embed -e ccopts`
AC_MSG_RESULT(found)
AC_MSG_CHECKING(for Perl library)
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
if test "x$PERL_LIB_TEST" = "x0" ; then
PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
AC_MSG_RESULT(found)
else
AC_MSG_WARN([
*** Perl library couldn't be found in your system.
*** Try to install it with your software package manager.])
*** Try to install it with your software package manager.
*** WeeChat will be built without Perl support.])
enable_perl="no"
not_found="$not_found perl"
fi
else
AC_MSG_WARN([
*** Perl headers couldn't be found in your system.
*** Try to install it with your software package manager.
*** WeeChat will be built without Perl support.])
enable_perl="no"
not_found="$not_found perl"
fi
fi
AC_MSG_RESULT(found)
fi
if test "x$enable_perl" = "xyes" ; then
AC_SUBST(PERL_CFLAGS)
AC_SUBST(PERL_LFLAGS)
AC_DEFINE(PLUGIN_PERL)
@@ -227,45 +238,53 @@ if test "x$enable_python" = "xyes" ; then
AC_PATH_PROGS(PYTHON, python python2.4 python2.3 python2.2)
if test -z $PYTHON ; then
AC_MSG_ERROR([
*** Python must be installed on your system
*** but python interpreter couldn't be found in path.
*** Please check that python is in path, or install
*** it with your software package manager.])
fi
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE=`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
AC_MSG_WARN([
*** Python must be installed on your system but python interpreter couldn't be found in path.
*** Please check that python is in path, or install it with your software package manager.
*** WeeChat will be built without Python support.])
enable_python="no"
not_found="$not_found python"
else
AC_MSG_ERROR([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.])
fi
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"`
PYTHON_LFLAGS="-lpython$PYTHON_VERSION "`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBS')+' '+distutils.sysconfig.get_config_var('SYSLIBS')+' '+distutils.sysconfig.get_config_var('LINKFORSHARED')"`
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
elif test -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_SYSPREFIX/lib/ $PYTHON_LFLAGS"
else
AC_MSG_ERROR([
PYTHON_SYSPREFIX=`$PYTHON -c 'import sys; print "%s" % sys.prefix'`
PYTHON_VERSION=`$PYTHON -c 'import sys ; print sys.version[[:3]]'`
PYTHON_INCLUDE=`$PYTHON -c "import distutils.sysconfig,string; print distutils.sysconfig.get_config_var('CONFINCLUDEPY')"`
AC_MSG_CHECKING(for Python header files)
if test -r "$PYTHON_INCLUDE/Python.h"; then
PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
AC_MSG_RESULT(found)
PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"`
PYTHON_LFLAGS="-lpython$PYTHON_VERSION "`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBS')+' '+distutils.sysconfig.get_config_var('SYSLIBS')+' '+distutils.sysconfig.get_config_var('LINKFORSHARED')"`
AC_MSG_CHECKING(for Python library)
if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
AC_MSG_RESULT(found)
elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
AC_MSG_RESULT(found)
elif test -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
PYTHON_LFLAGS="-L$PYTHON_SYSPREFIX/lib/ $PYTHON_LFLAGS"
AC_MSG_RESULT(found)
else
AC_MSG_WARN([
*** Python library couldn't be found in your system.
*** Try to install it with your software package manager.])
*** Try to install it with your software package manager.
*** WeeChat will be built without Python support.])
enable_python="no"
not_found="$not_found python"
fi
else
AC_MSG_WARN([
*** Python header files couldn't be found in your system.
*** Try to install them with your software package manager.
*** WeeChat will be built without Python support.])
enable_python="no"
not_found="$not_found python"
fi
fi
AC_MSG_RESULT(found)
fi
if test "x$enable_python" = "xyes" ; then
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LFLAGS)
AC_DEFINE(PLUGIN_PYTHON)
@@ -276,50 +295,153 @@ if test "x$enable_ruby" = "xyes" ; then
AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby1.9)
if test -z $RUBY ; then
AC_MSG_ERROR([
*** Ruby must be installed on your system
*** but ruby interpreter couldn't be found in path.
*** Please check that ruby is in path, or install
*** it with your software package manager.])
fi
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
AC_MSG_CHECKING(for Ruby header files)
if test -r "$RUBY_INCLUDE/ruby.h"; then
RUBY_CFLAGS="-I$RUBY_INCLUDE"
AC_MSG_WARN([
*** Ruby must be installed on your system but ruby interpreter couldn't be found in path.
*** Please check that ruby is in path, or install it with your software package manager.
*** WeeChat will be built without Ruby support.])
enable_ruby="no"
not_found="$not_found ruby"
else
AC_MSG_ERROR([
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
AC_MSG_CHECKING(for Ruby header files)
if test -r "$RUBY_INCLUDE/ruby.h"; then
RUBY_CFLAGS="-I$RUBY_INCLUDE"
else
AC_MSG_WARN([
*** Ruby header files couldn't be found in your system.
*** Try to install them with your software package manager.])
*** Try to install them with your software package manager.
*** WeeChat will be built without Ruby support.])
enable_ruby="no"
not_found="$not_found ruby"
fi
AC_MSG_RESULT(found)
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
fi
AC_MSG_RESULT(found)
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
fi
if test "x$enable_ruby" = "xyes" ; then
AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_LFLAGS)
AC_DEFINE(PLUGIN_RUBY)
fi
if test "x$enable_lua" = "xyes" ; then
enable_plugins="yes"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CFLAGS="$CFLAGS"
ac_save_LFLAGS="$LFLAGS"
LUA_CFLAGS=""
LUA_LFLAGS=""
if test -n "$lua_inc"; then
CFLAGS="$CFLAGS -I$lua_inc"
CPPFLAGS="$CPPFLAGS -I$lua_inc"
fi
if test -n "$lua_lib"; then
LFLAGS="$LFLAGS -L$lua_lib"
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
PKGCONFIG=""
AC_CHECK_PROGS(PKGCONFIG, pkg-config)
if test "x$PKGCONFIG" != "x"; then
AC_MSG_CHECKING(for Lua headers and librairies with pkg-config)
for l in "$lua_suffix" "" "50" "5.0" ; do
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l && $PKGCONFIG --exists lualib$l`
if test "x$?" = "x0" ; then
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lua$l`
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lua$l`
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lualib$l`
break
fi
done
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
AC_MSG_RESULT(found)
fi
fi
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
LUACONFIG=""
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config50 lua-config5.0)
if test "x$LUACONFIG" != "x" ; then
AC_MSG_CHECKING(for Lua headers and librairies with lua-config)
LUA_CFLAGS=`$LUACONFIG --include`
LUA_LFLAGS=`$LUACONFIG --libs`
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
AC_MSG_RESULT(found)
fi
fi
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
AC_MSG_CHECKING(for Lua headers and librairies)
AC_CHECK_HEADER(lua.h,ac_found_lua_header="yes",ac_found_lua_header="no")
AC_CHECK_HEADER(lualib.h,ac_found_liblua_header="yes",ac_found_liblua_header="no")
if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then
LUA_CFLAGS="$CFLAGS"
fi
for l in "$lua_suffix" "" "50" "5.0" ; do
AC_CHECK_LIB(lua$l,lua_open,ac_found_lua_lib="yes",ac_found_lua_lib="no")
AC_CHECK_LIB(lualib$l,luaopen_base,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
if test "x$ac_found_lua_lib" = "xyes" ; then
LUA_LFLAGS="$LFLAGS -llua$l"
break
fi
if test "x$ac_found_liblua_lib" = "xyes" ; then
LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
break
fi
done
fi
CFLAGS="$ac_save_CFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS"
LFLAGS="$ac_save_LFLAGS"
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
AC_MSG_WARN([
*** Lua (>=5.0) headers and librairies couldn't be found in your system.
*** Try to install liblua, liblualib and liblua-dev with your software package manager.
*** WeeChat will be built without Lua support.])
enable_lua="no"
not_found="$not_found lua"
else
AC_MSG_RESULT(found)
fi
fi
if test "x$enable_lua" = "xyes" ; then
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LFLAGS)
AC_DEFINE(PLUGIN_LUA)
fi
if test "x$enable_plugins" = "xyes" ; then
AC_CHECK_FUNCS(dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
if test "$LIBDL_FOUND" != "yes"; then
AC_CHECK_LIB(dl, dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
if test "$LIBDL_FOUND" = "yes"; then
PLUGINS_LIBS="-ldl"
else
AC_MSG_ERROR([
*** "dl" library (dynamic library loader) couldn't be found in your system.
*** Try to install it with your software package manager or disable plugins.])
fi
AC_CHECK_LIB(dl, dlopen, [LIBDL_FOUND=yes; PLUGINS_LIBS=-ldl], LIBDL_FOUND=no)
fi
if test "$LIBDL_FOUND" = "yes"; then
AC_DEFINE(PLUGINS)
AC_SUBST(PLUGINS_LIBS)
else
AC_MSG_WARN([
*** "dl" library (dynamic library loader) couldn't be found in your system.
*** Try to install it with your software package manager or disable plugins.
*** WeeChat will be built without any plugin.])
enable_plugins="no"
enable_perl="no"
enable_python="no"
enable_ruby="no"
enable_lua="no"
not_found="$not_found plugins"
fi
AC_DEFINE(PLUGINS)
fi
AC_SUBST(PLUGINS_LIBS)
# ------------------------------------------------------------------------------
# gnutls
# ------------------------------------------------------------------------------
@@ -327,8 +449,7 @@ AC_SUBST(PLUGINS_LIBS)
if test "x$enable_gnutls" = "xyes" ; then
found_gnutls="no"
AM_PATH_LIBGNUTLS( 1.0.0, found_gnutls=yes, AC_MSG_WARN([[
*** libgnutls was not found. You may want to get it from
*** ftp://ftp.gnutls.org/pub/gnutls/
*** libgnutls was not found. You may want to get it from ftp://ftp.gnutls.org/pub/gnutls/
*** WeeChat will be built without GnuTLS support.]]))
if test "x$found_gnutls" = "xyes" ; then
GNUTLS_CFLAGS=`libgnutls-config --cflags`
@@ -338,6 +459,7 @@ if test "x$enable_gnutls" = "xyes" ; then
AC_DEFINE(HAVE_GNUTLS)
else
enable_gnutls="no"
not_found="$not_found gnutls"
fi
fi
@@ -392,6 +514,11 @@ openbsd*)
CFLAGS="$CFLAGS -pthread"
fi
;;
gnu*)
if test "x$enable_plugins" = "xyes" ; then
LDFLAGS="$LDFLAGS -lpthread"
fi
;;
*)
;;
esac
@@ -400,6 +527,17 @@ esac
# output Makefiles
# ------------------------------------------------------------------------------
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGINS, test "$enable_plugins" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
AC_OUTPUT([Makefile
doc/Makefile
doc/fr/Makefile
@@ -412,6 +550,7 @@ AC_OUTPUT([Makefile
src/plugins/scripts/perl/Makefile
src/plugins/scripts/python/Makefile
src/plugins/scripts/ruby/Makefile
src/plugins/scripts/lua/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
@@ -424,7 +563,7 @@ AC_OUTPUT([Makefile
# end message
# ------------------------------------------------------------------------------
listgui=
listgui=""
if test "x$enable_ncurses" = "xyes" ; then
listgui="$listgui ncurses"
fi
@@ -432,7 +571,7 @@ if test "x$enable_wxwidgets" = "xyes"; then
listgui="$listgui WxWidgets"
fi
if test "x$enable_gtk" = "xyes" ; then
listgui="$listgui Gtk+"
listgui="$listgui Gtk"
fi
if test "x$enable_qt" = "xyes" ; then
listgui="$listgui Qt"
@@ -441,7 +580,13 @@ fi
if test "x$listgui" = "x" ; then
AC_MSG_ERROR([
*** No interface specified...
*** Please specify at least ncurses, WxWidgets, Gtk or Qt.])
*** Please enable at least ncurses, WxWidgets, Gtk or Qt.])
fi
if test "x$not_found" != "x" ; then
echo ""
echo "Following components were asked but not found, they will not be built:"
echo "$not_found"
fi
msg_debug_compiler="no"
@@ -454,14 +599,15 @@ if test "x$debug" = "x2" ; then
fi
echo ""
echo "Interfaces.................................... :$listgui"
echo "Build with GNUtls support..................... : $enable_gnutls"
echo "Build with Plugin support..................... : $enable_plugins"
echo " Perl plugin..................... : $enable_perl"
echo " Python plugin................... : $enable_python"
echo " Ruby plugin..................... : $enable_ruby"
echo "Compile with debug info....................... : $msg_debug_compiler"
echo "Print debugging messages...................... : $msg_debug_verbose"
echo "Interfaces........................ :$listgui"
echo "Build with GNUtls support......... : $enable_gnutls"
echo "Build with Plugin support......... : $enable_plugins"
echo " Perl plugin......... : $enable_perl"
echo " Python plugin....... : $enable_python"
echo " Ruby plugin......... : $enable_ruby"
echo " Lua plugin.......... : $enable_lua"
echo "Compile with debug info........... : $msg_debug_compiler"
echo "Print debugging messages.......... : $msg_debug_verbose"
echo ""
eval echo "WeeChat will be installed in $bindir."
echo ""
+6
View File
@@ -1,3 +1,9 @@
weechat (0.1.7-1) unstable; urgency=low
* New upstream release
-- Julien Louis <ptitlouis@sysif.net> Sat, 14 Jan 2006 14:14:29 +0100
weechat (0.1.6-2) unstable; urgency=low
* Apply path to fix segfault when removing server.
+1 -1
View File
@@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: debhelper (>> 4.0.0), libncursesw5-dev (>= 5.2.20020112a-7), ruby1.8-dev, libperl-dev, python-dev, libgnutls-dev, libtool, texinfo
Build-Depends: debhelper (>> 4.0.0), libncursesw5-dev, ruby, ruby1.8-dev, libperl-dev, python-dev, libgnutls-dev, libtool, xsltproc, docbook-xsl
Standards-Version: 3.6.2
Package: weechat
+1
View File
@@ -1 +1,2 @@
debian/tmp/usr/share/locale/
debian/tmp/usr/share/doc/weechat/html usr/share/doc/weechat-common
+7 -1
View File
@@ -32,11 +32,14 @@
"en_US" => "values",
"es_ES" => "valores");
%all_default = ("fr_FR" => "valeur par défaut",
"en_US" => "default values",
"en_US" => "default value",
"es_ES" => "valor por defecto");
%all_desc = ("fr_FR" => "description",
"en_US" => "description",
"es_ES" => "descripción");
$warning_do_not_edit = "\n<!-- ********* WARNING! *********\n\n"
." This file is automatically built with a Perl script. DO NOT EDIT!\n"
."-->\n\n";
foreach $lng (@all_lang)
{
@@ -61,6 +64,7 @@ sub create_commands
print "Creating $lang2/$file.xml ($lang)...\n";
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
print XML $warning_do_not_edit;
$started = 0;
$ENV{"LANG"} = $lang;
@@ -94,6 +98,7 @@ sub create_key_func
print "Creating $lang2/$file.xml ($lang)...\n";
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
print XML $warning_do_not_edit;
$ENV{"LANG"} = $lang;
foreach (`$command`)
@@ -120,6 +125,7 @@ sub create_config
print "Creating $lang2/$file.xml ($lang)...\n";
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
print XML $warning_do_not_edit;
$type = "";
$values = "";
$default = "";
+208 -167
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>admin [target]</command>
<programlisting>
find information about the administrator of the server
+26
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><literal>return</literal></entry>
<entry>terminate line</entry>
@@ -91,6 +97,22 @@
<entry><literal>page_down</literal></entry>
<entry>scroll one page down</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>scroll a few lines up</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>scroll a few lines down</entry>
</row>
<row>
<entry><literal>scroll_top</literal></entry>
<entry>scroll to top of buffer</entry>
</row>
<row>
<entry><literal>scroll_bottom</literal></entry>
<entry>scroll to bottom of buffer</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>display beginning of nicklist</entry>
@@ -115,6 +137,10 @@
<entry><literal>jump_dcc</literal></entry>
<entry>jump to DCC buffer</entry>
</row>
<row>
<entry><literal>jump_raw_data</literal></entry>
<entry>jump to raw IRC data buffer</entry>
</row>
<row>
<entry><literal>jump_last_buffer</literal></entry>
<entry>jump to last buffer</entry>
File diff suppressed because it is too large Load Diff
+8
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>alias [alias_name [command [arguments]]</command>
<programlisting>
create an alias for a command
@@ -167,6 +173,8 @@ Without argument, /unignore command lists all defined ignore.
<programlisting>
upgrade WeeChat without disconnecting from servers
This command run again WeeChat binary, so it should have been compiled installed with a package manager before running this command.
</programlisting>
<command>uptime [-o]</command>
<programlisting>
+48 -7
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><option>look_set_title</option></entry>
<entry>booléen</entry>
@@ -62,6 +68,20 @@
<entry>'off'</entry>
<entry>Utiliser le même tampon pour tous les serveurs</entry>
</row>
<row>
<entry><option>look_open_near_server</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'off'</entry>
<entry>Ouvrir les nouveaux canaux/privés près du serveur</entry>
</row>
<row>
<entry><option>look_scroll_amount</option></entry>
<entry>entier</entry>
<entry>entre 1 et 2147483647</entry>
<entry>3</entry>
<entry>Nombre de lignes pour le défilement avec scroll_up et scroll_down</entry>
</row>
<row>
<entry><option>look_buffer_timestamp</option></entry>
<entry>chaîne</entry>
@@ -146,6 +166,13 @@
<entry>'[]-^'</entry>
<entry>Caractères à ignorer pour la complétion des pseudos</entry>
</row>
<row>
<entry><option>look_nick_complete_first</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'off'</entry>
<entry>Compléter seulement avec le premier pseudo trouvé</entry>
</row>
<row>
<entry><option>look_infobar</option></entry>
<entry>booléen</entry>
@@ -738,8 +765,8 @@
<entry><option>log_path</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'~/.weechat/logs/'</entry>
<entry>Chemin pour les conversations sauvegardées par WeeChat</entry>
<entry>'%h/logs/'</entry>
<entry>Chemin pour les conversations sauvegardées par WeeChat ('%h' sera remplacé par le répertoire de base WeeChat, par défaut: ~/.weechat)</entry>
</row>
<row>
<entry><option>log_timestamp</option></entry>
@@ -762,12 +789,19 @@
<entry>'off'</entry>
<entry>Affiche un message pour l'absence/le retour</entry>
</row>
<row>
<entry><option>irc_show_away_once</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>Voir le message d'absence distant une seule fois en privé</entry>
</row>
<row>
<entry><option>irc_default_msg_part</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'WeeChat %v'</entry>
<entry>Message par défaut pour le part (quitte un canal)</entry>
<entry>Message par défaut pour le part (quitte un canal) ('%v' sera remplacé par la version de WeeChat dans la chaîne)</entry>
</row>
<row>
<entry><option>irc_default_msg_quit</option></entry>
@@ -790,6 +824,13 @@
<entry>0</entry>
<entry>Intervalle entre deux vérifications des absences (en minutes, 0 = ne jemais vérifier)</entry>
</row>
<row>
<entry><option>irc_away_check_max_nicks</option></entry>
<entry>entier</entry>
<entry>entre 0 et 2147483647</entry>
<entry>0</entry>
<entry>Ne pas vérifier les pseudos absents lorsqu'il y a un nombre important de pseudos (0 = pas de limite)</entry>
</row>
<row>
<entry><option>irc_lag_check</option></entry>
<entry>entier</entry>
@@ -885,7 +926,7 @@
<entry><option>dcc_download_path</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'~'</entry>
<entry>'%h/dcc'</entry>
<entry>Chemin pour écrire les fichiers reçus par dcc (par défaut: répertoire de l'utilisateur)</entry>
</row>
<row>
@@ -969,8 +1010,8 @@
<entry><option>plugins_path</option></entry>
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>'~/.weechat/plugins'</entry>
<entry>Chemin de recherche des extensions</entry>
<entry>'%h/plugins'</entry>
<entry>Chemin de recherche des extensions ('%h' sera remplacé par le répertoire de base WeeChat, par défaut: ~/.weechat)</entry>
</row>
<row>
<entry><option>plugins_autoload</option></entry>
@@ -1089,7 +1130,7 @@
<entry>chaîne</entry>
<entry>toute chaîne</entry>
<entry>''</entry>
<entry>Commande à exécuter en premier lorsque connecté au serveur</entry>
<entry>Commande(s) à exécuter lorsque connecté au serveur (plusieurs commandes doivent être séparées par ';', utilisez '\;' pour un point-virgule)</entry>
</row>
<row>
<entry><option>server_command_delay</option></entry>
+6
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>admin [cible]</command>
<programlisting>
trouver les informations sur l'administrateur du serveur
+26
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><literal>return</literal></entry>
<entry>terminer la ligne</entry>
@@ -91,6 +97,22 @@
<entry><literal>page_down</literal></entry>
<entry>faire défiler d'une page vers le bas</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>faire défiler de quelques lignes vers le haut</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>faire défiler de quelques lignes vers le bas</entry>
</row>
<row>
<entry><literal>scroll_top</literal></entry>
<entry>faire défiler jusqu'au début du tampon</entry>
</row>
<row>
<entry><literal>scroll_bottom</literal></entry>
<entry>faire défiler jusqu'à la fin du tampon</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>afficher le début de la liste des pseudos</entry>
@@ -115,6 +137,10 @@
<entry><literal>jump_dcc</literal></entry>
<entry>sauter au tampon DCC</entry>
</row>
<row>
<entry><literal>jump_raw_data</literal></entry>
<entry>sauter au tampon IRC brut</entry>
</row>
<row>
<entry><literal>jump_last_buffer</literal></entry>
<entry>sauter au dernier tampon</entry>
File diff suppressed because it is too large Load Diff
+8
View File
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- ********* WARNING! *********
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<command>alias [nom_alias [commande [paramètres]]</command>
<programlisting>
créer un alias pour une commande
@@ -167,6 +173,8 @@ Sans param
<programlisting>
mettre à jour WeeChat sans se déconnecter des serveurs
Cette commande lance à nouveau le binaire WeeChat, il doit donc avoir été compilé ou installé via un gestionnaire de paquet avant de lancer cette commande.
</programlisting>
<command>uptime [-o]</command>
<programlisting>
+5 -1
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "January 2006" "FlashCode"
.TH WEECHAT 1 "March 2006" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
@@ -27,6 +27,10 @@ disable auto-connect to servers at startup
.br
display config file help (list of options)
.TP
.B \-d, \-\-dir <dir>
.br
set WeeChat home dir
.TP
.B \-f, \-\-key\-functions
.br
display internal functions for keys
+1009 -882
View File
File diff suppressed because it is too large Load Diff
+1003 -872
View File
File diff suppressed because it is too large Load Diff
+1011 -875
View File
File diff suppressed because it is too large Load Diff

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